Commit graph

2724 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
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
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
Drew Alexander
d365b7424b
docs(v2): add useThemeContext note (#2934)
* docs: add note to useThemeContext api docs

* Update example usage
2020-06-15 12:39:17 +02:00
Drew Alexander
c341f457fb
docs(v2): add router implementation note (#2935) 2020-06-15 12:37:49 +02:00
Sam Zhou
1fdc8c5da1
chore(v2): Run E2E tests in CI (#2929) 2020-06-15 03:19:08 +08:00
Teik Jun
8eed245000
docs(v2): add documentation for multiple blogs (#2933)
* docs(v2): add documentation for multiple blogs

* docs(v2): fix typos of docusaurus

* docs(v2): make the same changes in the latest version of documentation

* docs(v2): remove an empty blockquote

* docs(v2): improve documentation for multiple blogs
2020-06-15 03:18:37 +08: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
slorber
c964a1e3b6 add introduction redirect 2020-06-10 17:22:08 +02:00