Commit graph

2757 commits

Author SHA1 Message Date
Anshul Goyal
a51a56ec42
feat(v2): add support for serve command (#3080)
* add support for serve command

* add serve to init

* use existing choosePort function

* add --host

* add more docs

* add docs to deployment
2020-07-20 19:00:37 +02:00
Mahfoudh Arous
6a511b805a
docs(v1): fixing few typos and enhancing few sentences clarity (#3082) 2020-07-20 16:48:37 +02:00
Jordan Liu
3cfbf4b70d
docs: Updated link for #docusaurus-2-dev discord (#3078) 2020-07-20 11:59:15 +02:00
Vandré Leal
020a48e7f6
docs(v2): showcase Runlet (#3076) 2020-07-19 23:55:47 +08:00
Sébastien Lorber
1272ab83fb
feat(v2): useDocusaurusContext().siteMetadata (#3058) 2020-07-16 12:46:21 +02:00
Frida Hjelm
5d08ef8ef1
fix(v2): classify link hrefs with protocol identifier as internal (#3063) 2020-07-15 19:05:33 +02:00
Sam Zhou
7660005db8
chore(v2): Adopt corejs 3 and only import at entry point (#3055) 2020-07-14 09:36:00 +08:00
Teik Jun
f947036595
feat(v2): notify users when docusaurus version is outdated (#3032)
* feat(v2): notify users when docusaurus version is outdated

* style(v2): add comments

* fix(v2): fix spacing in message

* feat(v2): make update notifier work on first run
2020-07-13 15:51:11 +02:00
Sam Zhou
3ebe245b55
feat(v2): Collect plugin versions to allow them to be inspected in debug plugin (#3050) 2020-07-13 15:46:48 +02:00
Anshul Goyal
a3849860ae
fix(v2):pass siteConfig as prop to pages (#3025)
* pass config as prop to pages

* use existing file

* Update packages/docusaurus-plugin-content-pages/src/index.ts

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-07-09 18:57:41 +02:00
Teik Jun
11751c20b0
docs(v2): correct the documentation for doc-only mode (#3040) 2020-07-09 17:15:23 +02:00
Deepak Giri
04fc4190f9
feat(v2): Support keywords meta in blog posts (#3038)
* #3036: support rendering  meta tag for blog posts (only in theme-classic)

* #3036: add keywords in an existing blog post
2020-07-09 17:02:00 +02:00
Paul Cowgill
233737ec3d
docs(v2): showcase user Tasit (#3034)
* Add Tasit to users showcase

* Add Tasit docs screenshot

* Update users.js

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-07-09 08:29:25 +08:00
Sébastien Lorber
a8b2e59a48
feat(v2): add useBaseUrlUtils() hook (#3033)
* add useBaseUrlUtils

* fix code highlighted lines
2020-07-08 17:51:59 +02:00
Teik Jun
e5afd1866d
fix(v2): change description for blog post paginator (#3029) 2020-07-08 17:10:40 +02:00
Jeremy Asuncion
9b3da59886
feat(v2): Plugin for Offline/PWA support (#2205)
* implement PWA plugin

* added pwa support for docusaurus website

* moved sw registration to client module

* moved compile function to webpack util

* build sw using webpack and render pwa popup

* implement @theme/PwaReloadPopup

* update website sw to use modules

* updated pwa readme

* fix header lint errors

* apply code formatting

* cache files only for mobile, saveData, or installed pwa

* added comments about clearing registrations

* fixed prettier error

* updated pwa README

* fix README JS

* move /blog => /blog/index.html logic to else branch

* add `alwaysPrecache` option

* updated docusaurus-plugin-pwa version

* added pwa to using-plugins.md

* review fixes

* re-disable restricted-globals to use self in service worker

* useless doc

* Update packages/docusaurus-plugin-pwa/README.md

Co-authored-by: Reece Dunham <me@rdil.rocks>

* Update packages/docusaurus-plugin-pwa/README.md

* update a bit pwa doc + minor refactors

* minor refactors + add workbox debug mode

* env PWA_ prefix

* typo

* minor refactor

* fix file output

* add serve:v2:ssl yarn command

* minor pwa fixes

* typo

* add dynamic import comment in SW

* comment

* let the PWA plugin implement its reload popup on his own

* pwa: add Joi options validation

* pwa plugin should have its own webpack/babel custom setup

* PWA:
- debug logs
- better SW params system
- offline mode activation strategies
- docs

* add pwa install gif

* pwa: popup -> reloadPopup + minor refactors

* fix process.env reading + better debug log

* minor fixes

* minor changes

* minor changes

Co-authored-by: slorber <lorber.sebastien@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: Reece Dunham <me@rdil.rocks>
2020-07-08 12:32:41 +02:00
Ben Gubler
46f794b2ba
docs(v2): showcase Eta (#3022) 2020-07-05 11:43:08 +08:00
Sébastien Lorber
8aa6ef47e4
feat(v2): configureWebpack merge strategy + use file-loader for common asset types (#2994)
* Add some default asset loaders
Add webpack merge strategy feature to enable plugins to prepend some webpack configuration (like the ideal image plugin that should override the default image loader)

* Add documentation for using assets from markdown

* add path prefix for webpack file loader

* renaming

* document Merge strategies

* rename mergeStrategies -> mergeStrategy
2020-07-01 19:06:02 +02:00
Sébastien Lorber
a5b2b6056b
feat(v2): add disableVersioning config to docs plugin (#2989)
* add disableVersioning config to docs plugin

* fix test

* fix test
2020-07-01 19:03:59 +02:00
Sébastien Lorber
9265de982b
chore(v2): refactor scripts + add theme-classic watchmode (#2998) 2020-07-01 18:30:44 +02:00
Sam Zhou
cf5babd5c1
chore(v2): Add E2E test for yarn v2 (#3008)
* chore(v2): Add E2E test for yarn v2

* Remove root node_modules to prevent them from accessible in e2e test

The purpose of e2e test is to ensure that the docusaurus inited website can stand on its own. The root node_modules remain accessible according to how node resolution works and it might interfere with the test. Remove them for safety.

* Add @mdx-js/react to docusaurus init templates
2020-07-01 12:06:03 +02:00
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