Commit graph

916 commits

Author SHA1 Message Date
Eric Dobbertin
d513dec521
feat(v1): add deletedDocs config to escape from versioning fallback (#2955)
* feat: support for deletedDocs in siteConfig

fixes #2429

* docs: document deletedDocs option

* feat: allow array in deletedDocs config

* docs: clarify deletedDocs version formatting
2020-06-25 17:54:49 +02:00
Alexey Pyltsyn
bdffd28b9f
feat(v2): allow skipping build docs for next version (#2877)
* feat(v2): allow skipping build docs for next version

* Refactor

* Refactor

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-06-25 17:21:05 +02:00
Sam Zhou
5ccd24cc1f
feat(v2): Support swizzling TypeScript components (#2671)
* feat(v2): Support swizzling TypeScript components

* Add tsc --noEmit to tsc script in theme-classic

Now everything can pass the type checker! (although still a lot of any)

* Add tsconfig and types.d.ts to website

Improve developer experience.

As an example, I converted NotFound to tsx

* Apply type annotation suggestions

* Do not fallback to `getThemePath` if getTypeScriptThemePath is undefined

* Fix tsc

* Add module declaration for @theme-original/*

* Move babel cli to root package.json
2020-06-25 16:07:30 +02:00
Anshul Goyal
81d855355e
feat(v2): option and config validation life cycle method for official plugins (#2943)
* add validation for blog plugin

* fix wrong default component

* fix test and add yup to package.json

* remove console.log

* add validation for classic theme and code block theme

* add yup to packages

* remove console.log

* fix build

* fix logo required

* replaced yup with joi

* fix test

* remove hapi from docusuars core

* replace joi with @hapi/joi

* fix eslint

* fix remark plugin type

* change remark plugin validation to match documentation

* move schema to it's own file

* allow unknown only on outer theme object

* fix type for schema type

* fix yarn.lock

* support both commonjs and ES modules

* add docs for new lifecycle method
2020-06-24 20:08:16 +02:00
slorber
3c334d781c add warning for chunk overrides (related to https://github.com/facebook/docusaurus/issues/2917) 2020-06-23 18:23:58 +02:00
Sam Zhou
11b7ce529c
feat(v2): Error when hooks depends on context is used outside of Layout (#2974) 2020-06-23 15:55:18 +02:00
Anshul Goyal
2b4b6f73b7
feat(v2): replace yup validation by joi validation (#2962)
* replace yup with joi

* update test snapshots with new  error messages
2020-06-22 19:40:52 +02:00
John Knox
ee5e59f633
fix(v2): fromExtensions and toExtensions translation with baseUrl (#2969) 2020-06-22 18:43:42 +02:00
Sam Zhou
592dca9196
chore(v2): Implement a simple E2E testing mechanism for docusausus start (#2950)
* chore(v2): Implement a simple E2E testing mechanism for `docusausus start`

* Detect compiler errors
2020-06-22 11:32:22 +02:00
Sam Zhou
fa99aeb6d4
chore(v2): Remove extraneous package-lock.json (#2977)
* chore(v2): Remove extraneous package-lock.json

* Empty commit to rerun tests
2020-06-22 04:11:50 +08:00
Sam Zhou
6e43c9bd34
chore(v2): Fix more eslint errors (#2976) 2020-06-21 15:09:00 +08:00
Sam Zhou
3611c96f90
chore(v2): Fix a lot of eslint warnings (#2972) 2020-06-20 12:30:18 +08:00
slorber
16ba6e54b6 v2.0.0-alpha.58 2020-06-18 14:02:26 +02:00
Sébastien Lorber
72884a0c1a
chore(v2): fix eslint TS setup (#2949)
* update eslint parser

* fix yarn lint script

* lint-staged, lint ts files

* fix TS eslint configuration + fix some lint errors (https://github.com/facebook/docusaurus/pull/2949)

* eslint root + separate linting in 2 scripts

* test commit

* test commit

* test commit

* fix /// TS directive
2020-06-18 17:37:48 +08:00
Sébastien Lorber
f6b1c85b01
fix(v2): fix docs homepage permalink issues (#2905)
* better fixes for docs homepage

* fix tests

* create special route for docs homepage + cleanup existing code

* no need to create multiple docs parent paths

* useful comment

* add test for slug + doc home usage at the same time error

* remove confusing variable name

* fix tests by using same suffix as before for docs base metadata path

* metadata: use homePageId correctly for nested docs: the full docId (including /) should be used to compare against homePageId

* add folder/testNested test doc

* refactor a bit processMetadata, the home should be handled correctly for all versions

* Workaround to fix issue when parent layout route (DocPage) has same path as the child route (DocItem): see https://github.com/facebook/docusaurus/issues/2917

* revert homePageId

* remove test doc

* remove test doc

* add useful comment
2020-06-17 14:54:08 +02:00
Guillaume Jacquart
a3f54d747d
fix(v2): Add hooks to detect window resize, toggle off sidebar and navbar in desktop (#2932)
* Add hooks to detect window resize, toggle off sidebar and navbar on desktop

* Review fixes

* Latest fixes. Refactor window sizes into object

* Fix deps and checks on windowSize change

Co-authored-by: guillaume <guillaume.jacquart@abtasty.com>
2020-06-17 11:32:34 +02:00
Sam Zhou
c05b5de580
fix(v2): Add optional-chaining and nullish-coalescing babel plugin (#2951) 2020-06-17 10:09:32 +08:00
Sam Zhou
85ad312287
fix(v2): Declare @docusaurus-plugin-debug as dependency of preset classic (#2944)
Missed it in #2929.
2020-06-17 01:55:40 +08:00
Sébastien Lorber
025ac4e28c
refactor(v2): legacy export = syntax (#2948) 2020-06-17 01:55:14 +08:00
Alexey Pyltsyn
5b9f4dd0bb
fix(v2): adjust anchor offset when routes switched (#2909) 2020-06-16 20:41:30 +08:00
Sébastien Lorber
b5d7c3a111
misc(v2): better dx: yarn clear, yarn watch, yarn serve (#2922)
* add clear + serve scripts

* add ability to launch all TS projects in --watch mode

* attempt to create a watch plugin

* use rimraf for clear script

* update watch plugin poc

* add start:v2:watch

* remove the watch plugin
2020-06-16 20:40:46 +08:00
Sébastien Lorber
c1102a4eae
fix(v2): upgrade react-loadable-ssr-addon (#2921)
* docs(v2): fix typo in ExecutionEnvironment example

* upgrade react-loadable-ssr-addon for https://github.com/facebook/docusaurus/issues/2898

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-16 20:39:26 +08:00
moonrailgun
930222ea87
refactor(v2): convert synchronous file write to asynchronous (#2936)
* perf(v2): convert synchronous filewrite to asynchronous in feed file generate

This looks like should return a Promise list , other than a sync io operation

* perf(v2): convert synchronous filewrite to asynchronous in sitemap generate

* perf(v2): convert  Promise style to async/await style

for consistency
2020-06-15 16:04:15 +02:00
Teik Jun
0c92f5aacd
feat(v2): add a banner that links to latest version of documentation (#2916)
* feat(v2): add metadata to indicate the document is old

* feat(v2): add badge that links old versions to latest version

* feat(v2): fix test related to metadata

* feat(v2): fix formatting

* feat(v2): fix formatting

* feat(v2): use Link component instead of anchor tag

* feat(v2): add pramlink to latest docs

* feat(v2): add more vibrant warning message

* feat(v2): position the banner above the article

* feat(v2): link latest version to intro page

* fix(v2): fix some test cases

* feat(v2): fix tests

* feat(v2): change banner to warning orange

* feat(v2): compute root route from sidebar

* style(v2): fix formatting

* feat(v2): use homeid if provided to compute base route

* feat(v2): rename functions and fix a corner case

* feat(v2): fix formating

* feat(v2): compute homepageurl

* style(v2): improve code quality

* style(v2): unbold fullstop for consistency

Co-authored-by: Anshul Goyal <anshulgoel151999@gmail.com>
2020-06-15 14:31:23 +02:00
Fanny
22178ebded
chore(v2): remove unused hooks from bootstrap theme (#2931)
* chore(v2): remove unused hooks

* chore(v2): Update aria label
2020-06-14 20:05:29 +08:00
Sam Zhou
6e37d3fb12
feat(v2): Implement proof-of-concept Docusaurus Debug Dashboard (#2928)
* feat(v2): Implement proof-of-concept Docusaurus Debug Dashboard

* Ensure we show the exact boolean
2020-06-14 15:30:04 +08:00
Sam Zhou
729b3cae9b
feat(v2): Allow configuring babel via babel.config.js (#2903)
* feat(v2): Allow configuring babel via docusaurus.config.js

* Use api.caller feature from babel to avoid expose isServer to users

* Remove unused optional config key

* Make babel loader resolve and require config file
2020-06-12 11:03:00 +08:00
Sébastien Lorber
68a1bb1ebf
Merge pull request #2793 from slorber/feature/client-side-redirects
feat(v2): docusaurus-plugin-client-redirects
2020-06-10 17:36:57 +02:00
slorber
6b507630e3 migrate useful helper functions to docusaurus-utils 2020-06-10 17:22:41 +02:00
Sébastien Lorber
08359dd3ca
chore(v2): fix async tests (#2906) 2020-06-09 01:10:13 +08:00
Teik Jun
66716d1619
feat(v2): add nojekyll file to static folder for all templates (#2902) 2020-06-08 09:45:57 +08:00
Alexey Pyltsyn
dd1ef71aac
chore(v2): replace Clipboard with copy-text-to-clipboard (#2900)
* chore(v2): replace Clipboard with copy-text-to-clipboard

* Remove clipboard from yarn.lock
2020-06-07 13:48:28 +08:00
Alexey Pyltsyn
afe9ff91a4
chore(v2): replace classnames with clsx (#2895) 2020-06-07 13:40:06 +08:00
Alexey Pyltsyn
277f02b924
fix(v2): set correct canonical url for docs home page (#2896) 2020-06-06 16:51:00 +08:00
Sébastien Lorber
1003a15d1f
polish(v2): improve Docusaurus 1 to 2 migration developer experience (#2884)
* improve markdown parsing errors by adding file path to error

* typo commit

* Add default nav item position to right (as v1)

* improve error when sidebar references unexisting document

* parseMarkdownFile: improve errors by providing hint about using "" to avoid parsing errors, if using special characters

* improve subcategory migration error for Unknown sidebar item type

* improve unrecognizedFields error

* typo

* fix inline snapshots

* improve the migration docs

* improve the migration docs

* improve migration doc

* Update migrating-from-v1-to-v2.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-06 11:16:50 +08:00
Sam Zhou
8aa520c314
fix(v2): Do not automatically change tab when a non-existing option is selected (#2893) 2020-06-06 11:11:42 +08:00
Alexey Pyltsyn
664ceb7771
fix(v2): restore styles for menu scrollbar (#2888) 2020-06-05 20:13:40 +08:00
Fanny
8a34872750
fix(v2): bootstrap doc sidebar (#2860)
* fix(v2): doc sidebar

* chore(v2): prettier

* fix(v2): docs navbar path

* fix(v2): fix error about activepath

* chore(v2): prettier

* feat(v2): change active color

* feat(v2): update to new docs cpmfog

* feat(v2): Add homepagepath
2020-06-05 15:36:36 +08:00
Alexey Pyltsyn
174cd8dc6f
refactor(v2): combine nested theme providers into one (#2870) 2020-06-05 15:09:13 +08:00
slorber
0ac5a66a1f rename fromRoutePath/toRoutePath to simply from/to 2020-06-04 14:31:26 +02:00
slorber
06673ee8c3 refactor: remove redirectCreator abstraction 2020-06-04 14:28:31 +02:00
Alexey Pyltsyn
6f2e59a176
fix(v2): render as regular text uncollapsible categories (#2880) 2020-06-04 20:27:16 +08:00
Sébastien Lorber
953abd8154
feat(v2): allow adding components to react-live scope (#2826)
* feat(v2): add components to react-live scope (#2807)

* fix admonition issue + improve react-live scope doc

* fix again admonition :(

* remove forwarding of mdx components to react-live scope (for now)

* remove useless dep
2020-06-04 15:18:42 +03:00
slorber
e60c063120 snapshot update 2020-06-03 19:47:36 +02:00
slorber
89038dea0c Fix non-strict validation error, allowing [] for string 2020-06-03 19:46:57 +02:00
slorber
00a79f69c7 Add chalk non-blocking errors + fix config bug 2020-06-03 19:28:57 +02:00
slorber
c224efb8a1 Add better options validation error 2020-06-03 17:53:54 +02:00
slorber
1439bad84c Add redirects plugin option 2020-06-03 17:30:21 +02:00
slorber
a0991c581b add context to error message 2020-06-03 16:07:27 +02:00
slorber
5bf85e44ac add validateRedirect 2020-06-03 16:03:03 +02:00