diff --git a/admin/publish.md b/admin/publish.md index 0e923ed6af71..5a284a5c4b91 100644 --- a/admin/publish.md +++ b/admin/publish.md @@ -196,7 +196,13 @@ Now that the release is done, **merge the pull request**. - Hit the green "Publish release" button - Profit! 💰 -### 8. Notify people about new release (optional but desirable) +### 8. Update example projects (optional but desirable) + +After a release, update the examples to keep them in sync with the latest release. This will ensure that CodeSandbox playground is able to use the new version at [new.docusaurus.io](https://new.docusaurus.io). + +Create a separate branch/PR and run `yarn examples:generate` + +### 9. Notify people about new release (optional but desirable) After new release, it is cool to notify our users about this in the Discord chat (`docusaurus-users` channel) and write summaries on Twitter using the following templates. diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 000000000000..f06fdc38b3e1 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,17 @@ +# Docusaurus examples + +These example projects are generated with the init CLI: + +``` +npx @docusaurus/init@latest init examples/ ` +``` + +You can run them in CodeSandbox: + +- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/classic) +- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/bootstrap) +- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/facebook) + +**Tip**: use the [new.docusaurus.io](https://new.docusaurus.io) shortcut. + +**Note**: We update these examples regularly with `yarn examples:generate` diff --git a/examples/bootstrap/package.json b/examples/bootstrap/package.json index 3cf7a8a21ddf..d2060b0db1e0 100644 --- a/examples/bootstrap/package.json +++ b/examples/bootstrap/package.json @@ -1,5 +1,5 @@ { - "name": "examples-bootstrap", + "name": "docusaurus-bootstrap", "version": "0.0.0", "private": true, "scripts": { @@ -30,5 +30,6 @@ "last 1 firefox version", "last 1 safari version" ] - } + }, + "description": "Docusaurus example project (bootstrap template)" } \ No newline at end of file diff --git a/examples/bootstrap/sandbox.config.json b/examples/bootstrap/sandbox.config.json index a3e712c82f19..aeec7c272787 100644 --- a/examples/bootstrap/sandbox.config.json +++ b/examples/bootstrap/sandbox.config.json @@ -3,4 +3,4 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus" -} +} \ No newline at end of file diff --git a/examples/bootstrap/yarn.lock b/examples/bootstrap/yarn.lock index 73248304eecf..04090b62fff1 100644 --- a/examples/bootstrap/yarn.lock +++ b/examples/bootstrap/yarn.lock @@ -1465,9 +1465,9 @@ integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA== "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" - integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/mdast@^3.0.0": version "3.0.3" @@ -1482,9 +1482,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "14.14.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e" - integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A== + version "14.14.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18" + integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw== "@types/parse-json@^4.0.0": version "4.0.0" @@ -2130,9 +2130,9 @@ boolbase@^1.0.0, boolbase@~1.0.0: integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= bootstrap@^4.4.1: - version "4.5.3" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.5.3.tgz#c6a72b355aaf323920be800246a6e4ef30997fe6" - integrity sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ== + version "4.6.0" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.0.tgz#97b9f29ac98f98dfa43bf7468262d84392552fd7" + integrity sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw== boxen@^4.2.0: version "4.2.0" @@ -3602,9 +3602,9 @@ ejs@^2.6.1: integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.634: - version "1.3.641" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.641.tgz#03f14efd70a7971eff2efc947b3c1d0f717c82b9" - integrity sha512-b0DLhsHSHESC1I+Nx6n4w4Lr61chMd3m/av1rZQhS2IXTzaS5BMM5N+ldWdMIlni9CITMRM09m8He4+YV/92TA== + version "1.3.642" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz#8b884f50296c2ae2a9997f024d0e3e57facc2b94" + integrity sha512-cev+jOrz/Zm1i+Yh334Hed6lQVOkkemk2wRozfMF4MtTR7pxf3r3L5Rbd7uX1zMcEqVJ7alJBnJL7+JffkC6FQ== elliptic@^6.5.3: version "6.5.3" @@ -4186,14 +4186,14 @@ from2@^2.1.0: readable-stream "^2.0.0" fs-extra@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" - integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" - universalify "^1.0.0" + universalify "^2.0.0" fs-minipass@^2.0.0: version "2.1.0" @@ -7891,9 +7891,9 @@ react@^16.8.4: prop-types "^15.6.2" reactstrap@^8.4.1: - version "8.8.1" - resolved "https://registry.yarnpkg.com/reactstrap/-/reactstrap-8.8.1.tgz#181ba837b797994f8d4571497d8a5eb678abfd8a" - integrity sha512-Sv+JdQNrr0J96rUpI19slm21A1T++Xv97mhO5C9gq1bz8qdOQE0fXhF0/HxYcxyUops8Rdmwsli+8iu+yy9N/w== + version "8.9.0" + resolved "https://registry.yarnpkg.com/reactstrap/-/reactstrap-8.9.0.tgz#bca4afa3f5cd18899ef9b33d877a141886d5abae" + integrity sha512-pmf33YjpNZk1IfrjqpWCUMq9hk6GzSnMWBAofTBNIRJQB1zQ0Au2kzv3lPUAFsBYgWEuI9iYa/xKXHaboSiMkQ== dependencies: "@babel/runtime" "^7.12.5" classnames "^2.2.3" @@ -9349,11 +9349,6 @@ unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist- unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" -universalify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" - integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== - universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" diff --git a/examples/classic/package.json b/examples/classic/package.json index b85a62c49b67..c1c1c68aef96 100644 --- a/examples/classic/package.json +++ b/examples/classic/package.json @@ -1,5 +1,5 @@ { - "name": "examples-classic", + "name": "docusaurus", "version": "0.0.0", "private": true, "scripts": { @@ -31,5 +31,6 @@ "last 1 firefox version", "last 1 safari version" ] - } + }, + "description": "Docusaurus example project" } \ No newline at end of file diff --git a/examples/classic/sandbox.config.json b/examples/classic/sandbox.config.json index a3e712c82f19..aeec7c272787 100644 --- a/examples/classic/sandbox.config.json +++ b/examples/classic/sandbox.config.json @@ -3,4 +3,4 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus" -} +} \ No newline at end of file diff --git a/examples/classic/src/pages/index.js b/examples/classic/src/pages/index.js index 5649b00bc5a4..fa42291a6d5f 100644 --- a/examples/classic/src/pages/index.js +++ b/examples/classic/src/pages/index.js @@ -54,7 +54,7 @@ function Feature({imageUrl, title, description}) { ); } -export default function Home() { +function Home() { const context = useDocusaurusContext(); const {siteConfig = {}} = context; return ( @@ -93,3 +93,5 @@ export default function Home() { ); } + +export default Home; diff --git a/examples/classic/yarn.lock b/examples/classic/yarn.lock index fe1c968f3442..46e2c2edba79 100644 --- a/examples/classic/yarn.lock +++ b/examples/classic/yarn.lock @@ -1669,9 +1669,9 @@ integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA== "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" - integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/mdast@^3.0.0": version "3.0.3" @@ -1686,9 +1686,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "14.14.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e" - integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A== + version "14.14.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18" + integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw== "@types/parse-json@^4.0.0": version "4.0.0" @@ -3874,9 +3874,9 @@ ejs@^2.6.1: integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.634: - version "1.3.641" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.641.tgz#03f14efd70a7971eff2efc947b3c1d0f717c82b9" - integrity sha512-b0DLhsHSHESC1I+Nx6n4w4Lr61chMd3m/av1rZQhS2IXTzaS5BMM5N+ldWdMIlni9CITMRM09m8He4+YV/92TA== + version "1.3.642" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz#8b884f50296c2ae2a9997f024d0e3e57facc2b94" + integrity sha512-cev+jOrz/Zm1i+Yh334Hed6lQVOkkemk2wRozfMF4MtTR7pxf3r3L5Rbd7uX1zMcEqVJ7alJBnJL7+JffkC6FQ== elliptic@^6.5.3: version "6.5.3" @@ -4496,14 +4496,14 @@ from2@^2.1.0: readable-stream "^2.0.0" fs-extra@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" - integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" - universalify "^1.0.0" + universalify "^2.0.0" fs-minipass@^2.0.0: version "2.1.0" @@ -9737,11 +9737,6 @@ unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist- unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" -universalify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" - integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== - universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" diff --git a/examples/facebook/package.json b/examples/facebook/package.json index 15e919645f56..29652ef2f7a8 100644 --- a/examples/facebook/package.json +++ b/examples/facebook/package.json @@ -1,5 +1,5 @@ { - "name": "examples-facebook", + "name": "docusaurus-facebook", "version": "0.0.0", "private": true, "scripts": { @@ -48,5 +48,6 @@ "last 1 firefox version", "last 1 safari version" ] - } + }, + "description": "Docusaurus example project (facebook template)" } \ No newline at end of file diff --git a/examples/facebook/sandbox.config.json b/examples/facebook/sandbox.config.json index a3e712c82f19..aeec7c272787 100644 --- a/examples/facebook/sandbox.config.json +++ b/examples/facebook/sandbox.config.json @@ -3,4 +3,4 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus" -} +} \ No newline at end of file diff --git a/examples/facebook/yarn.lock b/examples/facebook/yarn.lock index 90d69af9205e..928bb97cc34f 100644 --- a/examples/facebook/yarn.lock +++ b/examples/facebook/yarn.lock @@ -1684,9 +1684,9 @@ integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA== "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" - integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/json5@^0.0.29": version "0.0.29" @@ -1711,9 +1711,9 @@ integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== "@types/node@*": - version "14.14.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e" - integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A== + version "14.14.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18" + integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -3708,7 +3708,7 @@ debug@^3.1.1, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0: +debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== @@ -4060,9 +4060,9 @@ ejs@^2.6.1: integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.634: - version "1.3.641" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.641.tgz#03f14efd70a7971eff2efc947b3c1d0f717c82b9" - integrity sha512-b0DLhsHSHESC1I+Nx6n4w4Lr61chMd3m/av1rZQhS2IXTzaS5BMM5N+ldWdMIlni9CITMRM09m8He4+YV/92TA== + version "1.3.642" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz#8b884f50296c2ae2a9997f024d0e3e57facc2b94" + integrity sha512-cev+jOrz/Zm1i+Yh334Hed6lQVOkkemk2wRozfMF4MtTR7pxf3r3L5Rbd7uX1zMcEqVJ7alJBnJL7+JffkC6FQ== elliptic@^6.5.3: version "6.5.3" @@ -4638,7 +4638,7 @@ fast-glob@^2.0.2: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.4: +fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.4, fast-glob@^3.2.5: version "3.2.5" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== @@ -4935,14 +4935,14 @@ from2@^2.1.0: readable-stream "^2.0.0" fs-extra@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" - integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" - universalify "^1.0.0" + universalify "^2.0.0" fs-minipass@^2.0.0: version "2.1.0" @@ -5143,7 +5143,7 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.1: +globby@^11.0.1, globby@^11.0.2: version "11.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== @@ -6893,13 +6893,14 @@ memory-fs@^0.5.0: errno "^0.1.3" readable-stream "^2.0.1" -meow@^8.0.0: - version "8.1.2" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" - integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== +meow@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" + integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== dependencies: "@types/minimist" "^1.2.0" camelcase-keys "^6.2.2" + decamelize "^1.2.0" decamelize-keys "^1.1.0" hard-rejection "^2.1.0" minimist-options "4.1.0" @@ -10310,9 +10311,9 @@ stylehacks@^4.0.0: postcss-selector-parser "^3.0.0" stylelint@^13.2.1: - version "13.8.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.8.0.tgz#446765dbe25e3617f819a0165956faf2563ddc23" - integrity sha512-iHH3dv3UI23SLDrH4zMQDjLT9/dDIz/IpoFeuNxZmEx86KtfpjDOscxLTFioQyv+2vQjPlRZnK0UoJtfxLICXQ== + version "13.9.0" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.9.0.tgz#93921ee6e11d4556b9f31131f485dc813b68e32a" + integrity sha512-VVWH2oixOAxpWL1vH+V42ReCzBjW2AeqskSAbi8+3OjV1Xg3VZkmTcAqBZfRRvJeF4BvYuDLXebW3tIHxgZDEg== dependencies: "@stylelint/postcss-css-in-js" "^0.37.2" "@stylelint/postcss-markdown" "^0.36.2" @@ -10320,14 +10321,14 @@ stylelint@^13.2.1: balanced-match "^1.0.0" chalk "^4.1.0" cosmiconfig "^7.0.0" - debug "^4.2.0" + debug "^4.3.1" execall "^2.0.0" - fast-glob "^3.2.4" + fast-glob "^3.2.5" fastest-levenshtein "^1.0.12" file-entry-cache "^6.0.0" get-stdin "^8.0.0" global-modules "^2.0.0" - globby "^11.0.1" + globby "^11.0.2" globjoin "^0.1.4" html-tags "^3.1.0" ignore "^5.1.8" @@ -10337,7 +10338,7 @@ stylelint@^13.2.1: lodash "^4.17.20" log-symbols "^4.0.0" mathml-tag-names "^2.1.3" - meow "^8.0.0" + meow "^9.0.0" micromatch "^4.0.2" normalize-selector "^0.2.0" postcss "^7.0.35" @@ -10359,7 +10360,7 @@ stylelint@^13.2.1: style-search "^0.1.0" sugarss "^2.0.0" svg-tags "^1.0.0" - table "^6.0.3" + table "^6.0.7" v8-compile-cache "^2.2.0" write-file-atomic "^3.0.3" @@ -10435,7 +10436,7 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -table@^6.0.3: +table@^6.0.7: version "6.0.7" resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== @@ -10898,11 +10899,6 @@ unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist- unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" -universalify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" - integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== - universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" diff --git a/generateExamples.js b/generateExamples.js index 810e0df9750f..a13b68b84870 100644 --- a/generateExamples.js +++ b/generateExamples.js @@ -39,6 +39,20 @@ function generateTemplateExample(template) { // attach the dev script which would be used in code sandbox by default templatePackageJson.scripts.dev = 'docusaurus start'; + // these example projects are not meant to be published to npm + templatePackageJson.private = true; + + // make sure package.json name is not "examples-classic" + // the package.json name appear in CodeSandbox UI so let's display a good name! + // unfortunately we can't use uppercase or spaces + // see also https://github.com/codesandbox/codesandbox-client/pull/5136#issuecomment-763521662 + templatePackageJson.name = + template === 'classic' ? 'docusaurus' : `docusaurus-${template}`; + templatePackageJson.description = + template === 'classic' + ? 'Docusaurus example project' + : `Docusaurus example project (${template} template)`; + // rewrite the package.json file with the new edit writeFileSync( `./examples/${template}/package.json`, @@ -65,8 +79,10 @@ function generateTemplateExample(template) { } } -// delete the examples directory if it exists -rimraf.sync('./examples'); +// delete the examples directories if they exists +rimraf.sync('./examples/classic'); +rimraf.sync('./examples/facebook'); +rimraf.sync('./examples/bootstrap'); // get the list of all available templates readdir('./packages/docusaurus-init/templates', (err, data) => {