Skip to content

Commit eeb167e

Browse files
authored
polish(v2): improve codesandbox template package.json (facebook#4074)
1 parent 0a5d306 commit eeb167e

13 files changed

+119
-89
lines changed

admin/publish.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,13 @@ Now that the release is done, **merge the pull request**.
196196
- Hit the green "Publish release" button
197197
- Profit! 💰
198198

199-
### 8. Notify people about new release (optional but desirable)
199+
### 8. Update example projects (optional but desirable)
200+
201+
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).
202+
203+
Create a separate branch/PR and run `yarn examples:generate`
204+
205+
### 9. Notify people about new release (optional but desirable)
200206

201207
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.
202208

examples/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Docusaurus examples
2+
3+
These example projects are generated with the init CLI:
4+
5+
```
6+
npx @docusaurus/init@latest init examples/<templateName> <templateName>`
7+
```
8+
9+
You can run them in CodeSandbox:
10+
11+
- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/classic)
12+
- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/bootstrap)
13+
- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/facebook)
14+
15+
**Tip**: use the [new.docusaurus.io](https://new.docusaurus.io) shortcut.
16+
17+
**Note**: We update these examples regularly with `yarn examples:generate`

examples/bootstrap/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "examples-bootstrap",
2+
"name": "docusaurus-bootstrap",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
@@ -30,5 +30,6 @@
3030
"last 1 firefox version",
3131
"last 1 safari version"
3232
]
33-
}
33+
},
34+
"description": "Docusaurus example project (bootstrap template)"
3435
}

examples/bootstrap/sandbox.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"hardReloadOnChange": true,
44
"view": "browser",
55
"template": "docusaurus"
6-
}
6+
}

examples/bootstrap/yarn.lock

+19-24
Original file line numberDiff line numberDiff line change
@@ -1465,9 +1465,9 @@
14651465
integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA==
14661466

14671467
"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6":
1468-
version "7.0.6"
1469-
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
1470-
integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==
1468+
version "7.0.7"
1469+
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
1470+
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
14711471

14721472
"@types/mdast@^3.0.0":
14731473
version "3.0.3"
@@ -1482,9 +1482,9 @@
14821482
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
14831483

14841484
"@types/node@*":
1485-
version "14.14.21"
1486-
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e"
1487-
integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==
1485+
version "14.14.22"
1486+
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
1487+
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
14881488

14891489
"@types/parse-json@^4.0.0":
14901490
version "4.0.0"
@@ -2130,9 +2130,9 @@ boolbase@^1.0.0, boolbase@~1.0.0:
21302130
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
21312131

21322132
bootstrap@^4.4.1:
2133-
version "4.5.3"
2134-
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.5.3.tgz#c6a72b355aaf323920be800246a6e4ef30997fe6"
2135-
integrity sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ==
2133+
version "4.6.0"
2134+
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.0.tgz#97b9f29ac98f98dfa43bf7468262d84392552fd7"
2135+
integrity sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==
21362136

21372137
boxen@^4.2.0:
21382138
version "4.2.0"
@@ -3602,9 +3602,9 @@ ejs@^2.6.1:
36023602
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
36033603

36043604
electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.634:
3605-
version "1.3.641"
3606-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.641.tgz#03f14efd70a7971eff2efc947b3c1d0f717c82b9"
3607-
integrity sha512-b0DLhsHSHESC1I+Nx6n4w4Lr61chMd3m/av1rZQhS2IXTzaS5BMM5N+ldWdMIlni9CITMRM09m8He4+YV/92TA==
3605+
version "1.3.642"
3606+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz#8b884f50296c2ae2a9997f024d0e3e57facc2b94"
3607+
integrity sha512-cev+jOrz/Zm1i+Yh334Hed6lQVOkkemk2wRozfMF4MtTR7pxf3r3L5Rbd7uX1zMcEqVJ7alJBnJL7+JffkC6FQ==
36083608

36093609
elliptic@^6.5.3:
36103610
version "6.5.3"
@@ -4186,14 +4186,14 @@ from2@^2.1.0:
41864186
readable-stream "^2.0.0"
41874187

41884188
fs-extra@^9.0.1:
4189-
version "9.0.1"
4190-
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
4191-
integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
4189+
version "9.1.0"
4190+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
4191+
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
41924192
dependencies:
41934193
at-least-node "^1.0.0"
41944194
graceful-fs "^4.2.0"
41954195
jsonfile "^6.0.1"
4196-
universalify "^1.0.0"
4196+
universalify "^2.0.0"
41974197

41984198
fs-minipass@^2.0.0:
41994199
version "2.1.0"
@@ -7891,9 +7891,9 @@ react@^16.8.4:
78917891
prop-types "^15.6.2"
78927892

78937893
reactstrap@^8.4.1:
7894-
version "8.8.1"
7895-
resolved "https://registry.yarnpkg.com/reactstrap/-/reactstrap-8.8.1.tgz#181ba837b797994f8d4571497d8a5eb678abfd8a"
7896-
integrity sha512-Sv+JdQNrr0J96rUpI19slm21A1T++Xv97mhO5C9gq1bz8qdOQE0fXhF0/HxYcxyUops8Rdmwsli+8iu+yy9N/w==
7894+
version "8.9.0"
7895+
resolved "https://registry.yarnpkg.com/reactstrap/-/reactstrap-8.9.0.tgz#bca4afa3f5cd18899ef9b33d877a141886d5abae"
7896+
integrity sha512-pmf33YjpNZk1IfrjqpWCUMq9hk6GzSnMWBAofTBNIRJQB1zQ0Au2kzv3lPUAFsBYgWEuI9iYa/xKXHaboSiMkQ==
78977897
dependencies:
78987898
"@babel/runtime" "^7.12.5"
78997899
classnames "^2.2.3"
@@ -9349,11 +9349,6 @@ [email protected], unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-
93499349
unist-util-is "^4.0.0"
93509350
unist-util-visit-parents "^3.0.0"
93519351

9352-
universalify@^1.0.0:
9353-
version "1.0.0"
9354-
resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
9355-
integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==
9356-
93579352
universalify@^2.0.0:
93589353
version "2.0.0"
93599354
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"

examples/classic/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "examples-classic",
2+
"name": "docusaurus",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
@@ -31,5 +31,6 @@
3131
"last 1 firefox version",
3232
"last 1 safari version"
3333
]
34-
}
34+
},
35+
"description": "Docusaurus example project"
3536
}

examples/classic/sandbox.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"hardReloadOnChange": true,
44
"view": "browser",
55
"template": "docusaurus"
6-
}
6+
}

examples/classic/src/pages/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function Feature({imageUrl, title, description}) {
5454
);
5555
}
5656

57-
export default function Home() {
57+
function Home() {
5858
const context = useDocusaurusContext();
5959
const {siteConfig = {}} = context;
6060
return (
@@ -93,3 +93,5 @@ export default function Home() {
9393
</Layout>
9494
);
9595
}
96+
97+
export default Home;

examples/classic/yarn.lock

+13-18
Original file line numberDiff line numberDiff line change
@@ -1669,9 +1669,9 @@
16691669
integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA==
16701670

16711671
"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6":
1672-
version "7.0.6"
1673-
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
1674-
integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==
1672+
version "7.0.7"
1673+
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
1674+
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
16751675

16761676
"@types/mdast@^3.0.0":
16771677
version "3.0.3"
@@ -1686,9 +1686,9 @@
16861686
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
16871687

16881688
"@types/node@*":
1689-
version "14.14.21"
1690-
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e"
1691-
integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==
1689+
version "14.14.22"
1690+
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
1691+
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
16921692

16931693
"@types/parse-json@^4.0.0":
16941694
version "4.0.0"
@@ -3874,9 +3874,9 @@ ejs@^2.6.1:
38743874
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
38753875

38763876
electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.634:
3877-
version "1.3.641"
3878-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.641.tgz#03f14efd70a7971eff2efc947b3c1d0f717c82b9"
3879-
integrity sha512-b0DLhsHSHESC1I+Nx6n4w4Lr61chMd3m/av1rZQhS2IXTzaS5BMM5N+ldWdMIlni9CITMRM09m8He4+YV/92TA==
3877+
version "1.3.642"
3878+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz#8b884f50296c2ae2a9997f024d0e3e57facc2b94"
3879+
integrity sha512-cev+jOrz/Zm1i+Yh334Hed6lQVOkkemk2wRozfMF4MtTR7pxf3r3L5Rbd7uX1zMcEqVJ7alJBnJL7+JffkC6FQ==
38803880

38813881
elliptic@^6.5.3:
38823882
version "6.5.3"
@@ -4496,14 +4496,14 @@ from2@^2.1.0:
44964496
readable-stream "^2.0.0"
44974497

44984498
fs-extra@^9.0.1:
4499-
version "9.0.1"
4500-
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
4501-
integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
4499+
version "9.1.0"
4500+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
4501+
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
45024502
dependencies:
45034503
at-least-node "^1.0.0"
45044504
graceful-fs "^4.2.0"
45054505
jsonfile "^6.0.1"
4506-
universalify "^1.0.0"
4506+
universalify "^2.0.0"
45074507

45084508
fs-minipass@^2.0.0:
45094509
version "2.1.0"
@@ -9737,11 +9737,6 @@ [email protected], unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-
97379737
unist-util-is "^4.0.0"
97389738
unist-util-visit-parents "^3.0.0"
97399739

9740-
universalify@^1.0.0:
9741-
version "1.0.0"
9742-
resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
9743-
integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==
9744-
97459740
universalify@^2.0.0:
97469741
version "2.0.0"
97479742
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"

examples/facebook/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "examples-facebook",
2+
"name": "docusaurus-facebook",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
@@ -48,5 +48,6 @@
4848
"last 1 firefox version",
4949
"last 1 safari version"
5050
]
51-
}
51+
},
52+
"description": "Docusaurus example project (facebook template)"
5253
}

examples/facebook/sandbox.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"hardReloadOnChange": true,
44
"view": "browser",
55
"template": "docusaurus"
6-
}
6+
}

0 commit comments

Comments
 (0)