Commit graph

3486 commits

Author SHA1 Message Date
Teik Jun
086d1b7135
fix(v2): fix broken links on versions page (#3017)
* fix(v2): fix broken links on versions page

* fix(v2): fix broken link to remark and rehype
2020-07-01 12:04:53 +02:00
Taylor Allen
998e4d5f5e
feat(v2): prompt user when default port is in use (#3006)
* feat(v2): prompt user when default port is in use

* chore(v2): fixed eslint error

* fix(v2): removed portfinder from package

* fix(v2): removed irrelevant cra specific feature

* fix(v2): isolates feature and credits cra
2020-06-30 12:35:01 +02:00
Sébastien Lorber
c2bb03ab00
fix(v2): refactor color mode system (#3012)
* refactor color mode system to enable all possibilities

* fix destructuring bug

* colorMode validation + deprecation + minor name changes + doc

* rename method noFlashColorMode

* fix doc wording

* docs wording

* docs wording

* re-enable theme config merging/normalization + colorMode fixes

* document theme normalization

* code review changes
2020-06-30 12:21:20 +02:00
Sébastien Lorber
cf97662eef
fix(v2): refactor routes.ts + add route hash for chunkNames key (#3001)
* add simpleHash util

* refactor/split the routes generation logic + add route hash to avoid chunk conflicts

* minor fixes + fix tests

* fix comment typo
2020-06-30 11:52:39 +02:00
Sébastien Lorber
984e2d4598
docs(v1): external links (#3011) 2020-06-30 09:06:22 +08:00
Teik Jun
2e055f4ae2
fix(v2): make client-redirect-plugin not baseUrl sensitive (#3010)
* feat(v2): use relative routes path in postBuild hook

* feat(v2): use relativeRoutesPath in other methods and modify tests

* fix(v2): fix D2 client redirects and tests

* feat(v2): add tests for relativeRoutesPaths

* fix(v2): fix some typos in configValidation

* fix(v2): fix an eslint warning and restart github action

* refactor(v2): create a removePrefix method

* refactor(v2): inline unnecessary method
2020-06-29 18:38:28 +02:00
Sam Zhou
b58a53eae8
fix(v2): Add two missing docusaurus core babel dependency (#3007) 2020-06-28 19:58:02 +08:00
Teik Jun
0f59cd1599
feat(v2): add option validation for remaining official plugins (#2970)
* feat(v2): add option validation lifecycle method

* chore(v2): add dependencies

* chore(v2): add yup dependency

* feat(v2): add option validation for plugin-content-docs

* chore(v2): add facebook copyright

* refactor(v2): remove unused variable

* chore(v2): add dependencies

* chore(v2): add copyright

* fix(v2): use strict for option validation

* feat(v2): add option validation for plugin-content-pages

* feat(v2): add schema for plugin-google-analytics and plugin-google-gtag

* feat(v2): add option validation for plugin-sitemap

* chore(v2): add dependency for yup

* fix(v2): remove strict to allow normalization

* refactor(v2): refactor validate method

* feat(v2): modify existing tests

* feat(v2): add tests for plugin normalization

* style(v2): use a more descriptive filename for schema

* feat(v2): add normalization tests

* feat(v2): add more tests for option validation

* refactor(v2): remove unused code

* refactor(v2): remove unused code

* refactor(v2): refactor methods and types

* feat(v2): replace Yup with Joi

* fix(v2): fix plugin-content-docs schema

* feat(v2): modify tests for plugin-content-docs

* fix(v2): fix a typo

* refactor(v2): improve tests and refactor code

* feat(v2): support both commonjs and ES modules

* refactor(v2): refactor validateOption method

* style(v2): fix eslint errors and typo in types

* chore(v2): remove unused yup dependency

* style(v2): standardize naming across official plugins

* chore(v2): update test snapshots

* chore(v2): remove obsolete snapshots

* chore(v2): fix a typo and check test

* feat(v2): add validation for new field

* feat(v2): add test for new field
2020-06-26 15:14:59 +02:00
Anshul Goyal
3213955e72
chore(v2): use joi for config validation (#2987)
* use joi for  validation

* fix theme validation

* add test for required fields

* format errors

* a little better format errors

* fix config file

* try to rerun action
2020-06-26 14:54:33 +02:00
Sam Zhou
ec3c281952
docs(v2): Document TypeScript support (#2997) 2020-06-26 12:09:21 +02:00
Sam Zhou
71b5c2712b
chore(v2): Merge devDependencies in theme-classic (#2996) 2020-06-26 09:31:47 +08:00
Amirul Ahmad
f16258b19b
fix(v1): enableUpdateTime fails if local directory name has spaces (#2993)
Co-authored-by: Amirul Ahmad <amirul.ahmad@oleo.co.uk>
2020-06-25 18:00:54 +02:00
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
ehsan jso
8304e8253c
docs(v2): Fix typo in markdown-features (#2973)
* Fix typo in markdown-features

The code needed to be in npm syntax in order to work with npm2yarn

* Update markdown-features.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-06-25 17:05:51 +02:00
Rian Finnegan
65ce107331
docs(v2): showcase Amphora Data (#2991)
Co-authored-by: Rian Finnegan <rian@amphoradata.com>
2020-06-25 16:24:07 +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
Sébastien Lorber
20930dc837
docs(v2): add plugin redirects production build note (#2983)
* add plugin redirects production build note

* Update using-plugins.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-24 20:13:32 +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
ce10646606 document that docs/blog-only modes should delete the existing homepage 2020-06-23 18:29:19 +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
Colin Diesh
4aa77651d3
docs(v2): update docs about creating a new plugin #2963 2020-06-19 15:32:36 +02:00
matbub
56067e4add
docs(v2): fix typos in plugin-content-pages example (#2967) 2020-06-19 14:17:28 +08:00
Sébastien Lorber
9301d0c861
doc(v2): publish doc update after alpha.58 release (#2960)
* doc(v2): publish doc update after alpha.58 release

* typo

* publish doc update

* Update publish.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-19 12:59:08 +08:00
matbub
459b2c56fd
docs(v2): fix typo in plugin-content-pages example (#2966)
fixed grammar error in @docusaurus/plugin-content-pages example from 'blog' to 'page'
2020-06-19 12:57:35 +08:00
Yangshun Tay
73c835b518
docs(v2): rename 2.0.0-alpha.57 to 2.0.0-alpha.58 (#2958) 2020-06-18 16:10:52 +02:00
slorber
16ba6e54b6 v2.0.0-alpha.58 2020-06-18 14:02:26 +02:00
slorber
d280cd2e15 chore(v2): rename 2.0.0-alpha.57 to 2.0.0-alpha.58 2020-06-18 14:00:16 +02:00
slorber
e396c64f31 chore(v2): update yarn.lock 2020-06-18 14:00:16 +02:00
Marius Andra
162870d251
docs: mention posthog-docusaurus plugin (#2957) 2020-06-18 19:30:42 +08: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
38c8478e75
chore(v2): prepare v2.0.0.alpha-57 release (#2954)
* chore(v2): prepare v2.0.0.alpha-57 release

* update changelog

* fix changelog
2020-06-18 01:04:57 +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
Teik Jun
955e656496
docs(v2): add require.resolve to plugin imports on all pages (#2946) 2020-06-17 01:06:16 +08:00
Tom Brien
e97d2eab5a
docs(v2): wrap all plugin imports in require.resolve() (#2941)
* Wrap all plugin imports in require.resolve()

As per breaking change in 2.0.0-alpha0.56

* Wrap plugins in next version

* Revert "Wrap plugins in next version"

This reverts commit 5afa06e243.
2020-06-16 22:47:07 +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
Tom Brien
b77ae91247
docs(v2): fix changelog require.resolve mention
* Update change log

The 2.0.0-alpha56 Change log does not make mention to the breaking change with plugin imports. The [GitHub release](https://github.com/facebook/docusaurus/releases/tag/v2.0.0-alpha.56) does. This has meant that dependabot has missed this change in it's pull requests (which seemed to use the changelog in some cases)

* Fix typo

Was in the source I copied from GH release
2020-06-16 11:15:41 +02:00