Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge webpack.js.org/master into webpack.js.org/cn @ ee5a23b6 #1686

Merged
merged 36 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
db5dcd2
docs(Configuration): remove typo extra underscore (#6358)
peilingjiang Aug 31, 2022
ebfdaef
build(deps-dev): bump cypress from 10.6.0 to 10.7.0 (#6363)
dependabot[bot] Aug 31, 2022
dc92ed7
build(deps-dev): bump sass from 1.54.5 to 1.54.6 (#6364)
dependabot[bot] Aug 31, 2022
c711493
drop node 17 (#6365)
chenxsan Aug 31, 2022
3381e63
update snapshots (#6366)
chenxsan Aug 31, 2022
7b23419
build(deps-dev): bump sass from 1.54.6 to 1.54.7 (#6368)
dependabot[bot] Sep 1, 2022
6802655
build(deps-dev): bump sass from 1.54.7 to 1.54.8 (#6369)
dependabot[bot] Sep 3, 2022
c15911d
build(deps-dev): bump directory-tree from 3.3.0 to 3.3.1 (#6370)
dependabot[bot] Sep 3, 2022
5fa895c
build(deps-dev): bump @parcel/css from 1.13.0 to 1.13.1 (#6371)
dependabot[bot] Sep 3, 2022
91cb3ba
docs(Guides): Grammar correction (#6372)
4127157 Sep 5, 2022
2dd9b9f
build(deps-dev): bump jest from 29.0.1 to 29.0.2 (#6375)
dependabot[bot] Sep 6, 2022
55d1e28
build(deps-dev): bump eslint-plugin-mdx from 2.0.2 to 2.0.3 (#6374)
dependabot[bot] Sep 6, 2022
97638c3
build(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#6378)
dependabot[bot] Sep 7, 2022
9b39e15
build(deps-dev): bump eslint-plugin-mdx from 2.0.3 to 2.0.4 (#6381)
dependabot[bot] Sep 7, 2022
d75188c
build(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#6382)
dependabot[bot] Sep 8, 2022
941ca15
build(deps-dev): upgrade eslint plugin react (#6383)
chenxsan Sep 8, 2022
7408091
build(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#6379)
dependabot[bot] Sep 8, 2022
61992aa
build(deps-dev): bump sass from 1.54.8 to 1.54.9 (#6386)
dependabot[bot] Sep 9, 2022
8d917b7
build(deps-dev): bump @parcel/css from 1.13.1 to 1.14.0 (#6385)
dependabot[bot] Sep 9, 2022
04af200
build(deps-dev): bump eslint-plugin-react from 7.31.7 to 7.31.8 (#6387)
dependabot[bot] Sep 10, 2022
ece04a1
build(deps-dev): bump jest from 29.0.2 to 29.0.3 (#6389)
dependabot[bot] Sep 13, 2022
3c02ee6
build(deps-dev): bump css-minimizer-webpack-plugin from 4.0.0 to 4.1.…
dependabot[bot] Sep 14, 2022
079ab29
build(deps-dev): bump eslint from 8.23.0 to 8.23.1 (#6393)
dependabot[bot] Sep 14, 2022
b964f6f
use lightningCss (#6399)
chenxsan Sep 14, 2022
a16b557
build(deps): bump react-spring from 9.5.2 to 9.5.4 (#6398)
dependabot[bot] Sep 14, 2022
c1b807b
build(deps-dev): bump autoprefixer from 10.4.8 to 10.4.10 (#6396)
dependabot[bot] Sep 14, 2022
49026e6
build(deps-dev): bump @babel/core from 7.19.0 to 7.19.1 (#6400)
dependabot[bot] Sep 14, 2022
48e1beb
build(deps-dev): bump @babel/eslint-parser from 7.18.9 to 7.19.1 (#6403)
dependabot[bot] Sep 15, 2022
a4b82a8
build(deps): bump react-router-dom from 6.3.0 to 6.4.0 (#6402)
dependabot[bot] Sep 16, 2022
ecd833b
build(deps-dev): bump @babel/preset-env from 7.19.0 to 7.19.1 (#6404)
dependabot[bot] Sep 16, 2022
bd0d379
build(deps-dev): bump lightningcss from 1.14.0 to 1.15.0 (#6405)
dependabot[bot] Sep 16, 2022
38e7625
build(deps-dev): bump autoprefixer from 10.4.10 to 10.4.11 (#6401)
dependabot[bot] Sep 16, 2022
ee5a23b
build(deps-dev): bump lightningcss from 1.15.0 to 1.15.1 (#6406)
dependabot[bot] Sep 17, 2022
463a5db
docs(en): merging all conflicts
docschina-bot Sep 18, 2022
188b563
docs(en): fix conflicts
jacob-lcs Sep 19, 2022
527998e
docs(en): fix conflicts
jacob-lcs Sep 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module.exports = {
'react/react-in-jsx-scope': 'off', // ditto
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/no-unknown-property': [
'error',
{
ignore: ['watch', 'align'],
},
],
},
settings: {
react: {
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ on:
pull_request:

jobs:
unitTest:
name: Unit Test
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- run: yarn --frozen-lockfile
- run: yarn jest

lint:
name: Lint
strategy:
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"url": "https://github.com/webpack/webpack.js.org/issues"
},
"engines": {
"node": ">=14"
"node": "^14.20.0 || ^16.15.0 || >=18.0.0"
},
"scripts": {
"clean-dist": "rimraf ./dist",
Expand Down Expand Up @@ -73,31 +73,30 @@
]
},
"devDependencies": {
"@babel/core": "^7.18.13",
"@babel/eslint-parser": "^7.18.9",
"@babel/core": "^7.19.1",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.18.10",
"@babel/preset-env": "^7.19.1",
"@babel/preset-react": "^7.18.6",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^2.0.1",
"@octokit/rest": "^19.0.4",
"@parcel/css": "^1.13.0",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.3.1",
"autoprefixer": "^10.4.8",
"autoprefixer": "^10.4.11",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.0.0",
"cypress": "^10.6.0",
"directory-tree": "^3.3.0",
"css-minimizer-webpack-plugin": "^4.1.0",
"cypress": "^10.7.0",
"directory-tree": "^3.3.1",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.23.0",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^2.0.2",
"eslint-plugin-react": "^7.31.1",
"eslint-plugin-mdx": "^2.0.4",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react-hooks": "^4.6.0",
"front-matter": "^4.0.2",
"github-slugger": "^1.4.0",
Expand All @@ -106,7 +105,8 @@
"http-server": "^14.1.1",
"husky": "^8.0.1",
"hyperlink": "^5.0.4",
"jest": "^29.0.1",
"jest": "^29.0.3",
"lightningcss": "^1.15.1",
"lint-staged": "^13.0.3",
"lodash": "^4.17.21",
"markdownlint": "^0.26.2",
Expand All @@ -131,7 +131,7 @@
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
"sass": "^1.54.5",
"sass": "^1.54.9",
"sass-loader": "^13.0.2",
"sirv-cli": "^2.0.2",
"sitemap-static": "^0.4.2",
Expand All @@ -145,7 +145,7 @@
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.10.1",
"webpack-dev-server": "^4.11.0",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.4",
"yarn-deduplicate": "^6.0.0"
Expand All @@ -157,8 +157,8 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet-async": "^1.3.0",
"react-router-dom": "^6.3.0",
"react-spring": "^9.5.2",
"react-router-dom": "^6.4.0",
"react-spring": "^9.5.4",
"react-tiny-popover": "5",
"react-use": "^17.4.0",
"react-visibility-sensor": "^5.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/content/configuration/output.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ module.exports = {

类型默认包括 `'var'`、 `'module'`、 `'assign'`、 `'assign-properties'`、 `'this'`、 `'window'`、 `'self'`、 `'global'`、 `'commonjs'`、 `'commonjs2'`、 `'commonjs-module'`、 `'commonjs-static'`、 `'amd'`、 `'amd-require'`、 `'umd'`、 `'umd2'`、 `'jsonp'` 以及 `'system'`,除此之外也可以通过插件添加。

对于接下来的实例,我们将会使用 `__entry_return_` 表示被入口点返回的值。
对于接下来的示例,我们将会使用 `_entry_return_` 表示被入口点返回的值。

#### Expose a Variable $#exposeavariable$

Expand Down Expand Up @@ -1504,7 +1504,7 @@ module.exports = {
//Test Comment
else root['MyLibrary'] = factory();
})(self, function () {
return __entry_return_;
return _entry_return_;
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ exports[`cleanup readme should clean up div[align="center"] block with paragraph
"/* @jsxRuntime classic */
/* @jsx mdx */
/* @jsxFrag mdx.Fragment */
const MDXLayout = \\"wrapper\\";
const MDXLayout = "wrapper";
function MDXContent({components, ...props}) {
return <MDXLayout components={components} {...props}><div align=\\"center\\"><p parentName=\\"div\\"><h1 parentName=\\"p\\">{\\"Imagemin Webpack\\"}</h1></p><p parentName=\\"div\\"><p parentName=\\"p\\">{\\"Plugin and Loader for \\"}<a href=\\"http://webpack.js.org/\\" parentName=\\"p\\">{\\"webpack\\"}</a>{\\" to optimize (compress) all images using \\"}<a href=\\"https://github.com/imagemin/imagemin\\" parentName=\\"p\\">{\\"imagemin\\"}</a>{\\".\\\\nDo not worry about size of images, now they are always optimized/compressed.\\"}</p></p></div></MDXLayout>;
return <MDXLayout components={components} {...props}><div align="center"><p parentName="div"><h1 parentName="p">{"Imagemin Webpack"}</h1></p><p parentName="div"><p parentName="p">{"Plugin and Loader for "}<a href="http://webpack.js.org/" parentName="p">{"webpack"}</a>{" to optimize (compress) all images using "}<a href="https://github.com/imagemin/imagemin" parentName="p">{"imagemin"}</a>{".\\nDo not worry about size of images, now they are always optimized/compressed."}</p></p></div></MDXLayout>;
}
MDXContent.isMDXComponent = true;
export default MDXContent;
Expand All @@ -17,9 +17,9 @@ exports[`cleanup readme should clean up div[align="center"] block without paragr
"/* @jsxRuntime classic */
/* @jsx mdx */
/* @jsxFrag mdx.Fragment */
const MDXLayout = \\"wrapper\\";
const MDXLayout = "wrapper";
function MDXContent({components, ...props}) {
return <MDXLayout components={components} {...props}><div align=\\"center\\" /></MDXLayout>;
return <MDXLayout components={components} {...props}><div align="center" /></MDXLayout>;
}
MDXContent.isMDXComponent = true;
export default MDXContent;
Expand All @@ -30,9 +30,9 @@ exports[`cleanup readme should clean up nested div[align="center"] block 1`] =
"/* @jsxRuntime classic */
/* @jsx mdx */
/* @jsxFrag mdx.Fragment */
const MDXLayout = \\"wrapper\\";
const MDXLayout = "wrapper";
function MDXContent({components, ...props}) {
return <MDXLayout components={components} {...props}><div align=\\"center\\" /></MDXLayout>;
return <MDXLayout components={components} {...props}><div align="center" /></MDXLayout>;
}
MDXContent.isMDXComponent = true;
export default MDXContent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`customize blockquote should transform W> into aside of warning 1`] = `
"<aside class=\\"warning\\"><h6 class=\\"warning__prefix\\">warning</h6><p>hello world</p></aside>
"<aside class="warning"><h6 class="warning__prefix">warning</h6><p>hello world</p></aside>
"
`;
4 changes: 3 additions & 1 deletion src/remark-plugins/remark-custom-asides/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ describe('customize blockquote', () => {
'W>': 'warning',
},
})
.use(remarkHtml)
.use(remarkHtml, {
sanitize: false
})
.process(
`
W> hello world
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`customize blockquote should add id 1`] = `
"<h2><span id=\\"user-content-hello-world\\"></span>hello world</h2>
"<h2><span id="user-content-hello-world"></span>hello world</h2>
<p>this is me.</p>
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ exports[`responsive table should add data-th 1`] = `
</thead>
<tbody>
<tr>
<td data-th=\\"foo\\"><span>baz</span></td>
<td data-th=\\"bar\\"><span>-</span></td>
<td data-th="foo"><span>baz</span></td>
<td data-th="bar"><span>-</span></td>
</tr>
<tr>
<td data-th=\\"foo\\"><span>sam</span></td>
<td data-th=\\"bar\\"><span>chen</span></td>
<td data-th="foo"><span>sam</span></td>
<td data-th="bar"><span>chen</span></td>
</tr>
</tbody>
</table>
Expand All @@ -32,12 +32,12 @@ exports[`responsive table should handle empty thead 1`] = `
</thead>
<tbody>
<tr>
<td data-th=\\"\\"><span>baz</span></td>
<td data-th=\\"bar\\"><span>-</span></td>
<td data-th=""><span>baz</span></td>
<td data-th="bar"><span>-</span></td>
</tr>
<tr>
<td data-th=\\"\\"><span>sam</span></td>
<td data-th=\\"bar\\"><span>chen</span></td>
<td data-th=""><span>sam</span></td>
<td data-th="bar"><span>chen</span></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ describe('responsive table', () => {
const processor = remark()
.use(remarkGfm)
.use(remarkResponsiveTable)
.use(remarkHtml);
.use(remarkHtml, {
sanitize: false,
});
it('should add data-th', () => {
processor.process(
`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`remark slug should add id 1`] = `
"<h2 id=\\"user-content-hello-world\\"><span id=\\"user-content-hello-world\\"></span>hello world</h2>
"<h2 id="user-content-hello-world"><span id="user-content-hello-world"></span>hello world</h2>
<p>this is me.</p>
"
`;
2 changes: 1 addition & 1 deletion webpack.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default (env) =>
minimizer: [
'...',
new CssMinimizerPlugin({
minify: CssMinimizerPlugin.parcelCssMinify,
minify: CssMinimizerPlugin.lightningCssMinify,
}),
],
},
Expand Down
2 changes: 1 addition & 1 deletion webpack.ssg.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default (env) =>
optimization: {
minimizer: [
new CssMinimizerPlugin({
minify: CssMinimizerPlugin.parcelCssMinify,
minify: CssMinimizerPlugin.lightningCssMinify,
}),
],
},
Expand Down
Loading