chore(examples): update examples to 2.0.0-beta.14 (#6148)

This commit is contained in:
Sébastien Lorber 2021-12-21 17:49:39 +01:00 committed by GitHub
parent 01b407011a
commit f22eb95194
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 5470 additions and 9435 deletions

View file

@ -26,8 +26,16 @@ This command generates static content into the `build` directory and can be serv
### Deployment ### Deployment
Using SSH:
``` ```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy $ USE_SSH=true yarn deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
``` ```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View file

@ -32,4 +32,4 @@ npx docusaurus start
Your site starts at `http://localhost:3000`. Your site starts at `http://localhost:3000`.
Open `docs/intro.md` and edit some lines: the site **reloads automatically** and display your changes. Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.

View file

@ -18,19 +18,19 @@ const config = {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', 'classic',
/** @type {import('@docusaurus/preset-classic').Options} */ /** @type {import('@docusaurus/preset-classic').Options} */
({ ({
docs: { docs: {
sidebarPath: require.resolve('./sidebars.js'), sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo. // Please change this to your repo.
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', editUrl: 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
}, },
blog: { blog: {
showReadingTime: true, showReadingTime: true,
// Please change this to your repo. // Please change this to your repo.
editUrl: editUrl:
'https://github.com/facebook/docusaurus/edit/main/website/blog/', 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
}, },
theme: { theme: {
customCss: require.resolve('./src/css/custom.css'), customCss: require.resolve('./src/css/custom.css'),

View file

@ -16,21 +16,18 @@
"dev": "docusaurus start" "dev": "docusaurus start"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "2.0.0-beta.8", "@docusaurus/core": "2.0.0-beta.14",
"@docusaurus/preset-classic": "2.0.0-beta.8", "@docusaurus/preset-classic": "2.0.0-beta.14",
"@mdx-js/react": "^1.6.21", "@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1", "clsx": "^1.1.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1", "prism-react-renderer": "^1.2.1",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1", "react-dom": "^17.0.1"
"url-loader": "^4.1.1"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.8", "@docusaurus/module-type-aliases": "2.0.0-beta.14",
"@tsconfig/docusaurus": "^1.0.4", "@tsconfig/docusaurus": "^1.0.4",
"typescript": "^4.3.5" "typescript": "^4.5.2"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [

File diff suppressed because it is too large Load diff

View file

@ -26,8 +26,16 @@ This command generates static content into the `build` directory and can be serv
### Deployment ### Deployment
Using SSH:
``` ```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy $ USE_SSH=true yarn deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
``` ```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View file

@ -32,4 +32,4 @@ npx docusaurus start
Your site starts at `http://localhost:3000`. Your site starts at `http://localhost:3000`.
Open `docs/intro.md` and edit some lines: the site **reloads automatically** and display your changes. Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.

View file

@ -18,19 +18,19 @@ const config = {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', 'classic',
/** @type {import('@docusaurus/preset-classic').Options} */ /** @type {import('@docusaurus/preset-classic').Options} */
({ ({
docs: { docs: {
sidebarPath: require.resolve('./sidebars.js'), sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo. // Please change this to your repo.
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', editUrl: 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
}, },
blog: { blog: {
showReadingTime: true, showReadingTime: true,
// Please change this to your repo. // Please change this to your repo.
editUrl: editUrl:
'https://github.com/facebook/docusaurus/edit/main/website/blog/', 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
}, },
theme: { theme: {
customCss: require.resolve('./src/css/custom.css'), customCss: require.resolve('./src/css/custom.css'),

View file

@ -15,16 +15,13 @@
"dev": "docusaurus start" "dev": "docusaurus start"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "2.0.0-beta.8", "@docusaurus/core": "2.0.0-beta.14",
"@docusaurus/preset-classic": "2.0.0-beta.8", "@docusaurus/preset-classic": "2.0.0-beta.14",
"@mdx-js/react": "^1.6.21", "@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1", "clsx": "^1.1.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1", "prism-react-renderer": "^1.2.1",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1", "react-dom": "^17.0.1"
"url-loader": "^4.1.1"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,7 @@ module.exports = {
parserOptions: { parserOptions: {
allowImportExportEverywhere: true, allowImportExportEverywhere: true,
}, },
extends: ['airbnb', 'prettier', 'prettier/react'], extends: ['airbnb', 'prettier'],
plugins: ['react-hooks', 'header'], plugins: ['react-hooks', 'header'],
rules: { rules: {
// Ignore certain webpack alias because it can't be resolved // Ignore certain webpack alias because it can't be resolved
@ -56,5 +56,12 @@ module.exports = {
'react/jsx-filename-extension': OFF, 'react/jsx-filename-extension': OFF,
'react-hooks/rules-of-hooks': ERROR, 'react-hooks/rules-of-hooks': ERROR,
'react/prop-types': OFF, // PropTypes aren't used much these days. 'react/prop-types': OFF, // PropTypes aren't used much these days.
'react/function-component-definition': [
WARNING,
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
}, },
}; };

View file

@ -26,8 +26,16 @@ This command generates static content into the `build` directory and can be serv
### Deployment ### Deployment
Using SSH:
``` ```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy $ USE_SSH=true yarn deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
``` ```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View file

@ -23,19 +23,20 @@ const config = {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', 'classic',
/** @type {import('@docusaurus/preset-classic').Options} */ /** @type {import('@docusaurus/preset-classic').Options} */
({ ({
docs: { docs: {
sidebarPath: require.resolve('./sidebars.js'), sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo. // Please change this to your repo.
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
}, },
blog: { blog: {
showReadingTime: true, showReadingTime: true,
// Please change this to your repo. // Please change this to your repo.
editUrl: editUrl:
'https://github.com/facebook/docusaurus/edit/main/website/blog/', 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
}, },
theme: { theme: {
customCss: require.resolve('./src/css/custom.css'), customCss: require.resolve('./src/css/custom.css'),

View file

@ -19,26 +19,23 @@
"dev": "docusaurus start" "dev": "docusaurus start"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "2.0.0-beta.8", "@docusaurus/core": "2.0.0-beta.14",
"@docusaurus/preset-classic": "2.0.0-beta.8", "@docusaurus/preset-classic": "2.0.0-beta.14",
"@mdx-js/react": "^1.6.21", "@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1", "clsx": "^1.1.1",
"file-loader": "^6.2.0",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1", "react-dom": "^17.0.1"
"url-loader": "^4.1.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.16.3", "@babel/eslint-parser": "^7.16.3",
"eslint": "^7.20.0", "eslint": "^8.2.0",
"eslint-config-airbnb": "^18.2.1", "eslint-config-airbnb": "^19.0.0",
"eslint-config-prettier": "^6.15.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-header": "^3.0.0", "eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.21.5", "eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.3.0",
"prettier": "^2.5.0", "prettier": "^2.5.0",
"stylelint": "^13.2.1" "stylelint": "^13.2.1"
}, },

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,13 @@ const rimraf = require('rimraf');
const {readFileSync, writeFileSync, readdirSync} = require('fs'); const {readFileSync, writeFileSync, readdirSync} = require('fs');
const {execSync} = require('child_process'); const {execSync} = require('child_process');
const NODE_MAJOR_VERSION = parseInt(process.versions.node.split('.')[0], 10);
if (NODE_MAJOR_VERSION < 16) {
throw new Error(
'This generateExamples Docusaurus script requires at least Node.js 16 and npm 7. See why here: https://github.com/facebook/docusaurus/pull/5722#issuecomment-948847891',
);
}
// Generate one example per init template // Generate one example per init template
// We use those generated examples as CodeSandbox projects // We use those generated examples as CodeSandbox projects
// See https://github.com/facebook/docusaurus/issues/1699 // See https://github.com/facebook/docusaurus/issues/1699