Skip to content

Commit 0f786c4

Browse files
authored
Merge pull request #1686 from docschina/sync-ee5a23b6
docs(en): merge webpack.js.org/master into webpack.js.org/cn @ ee5a23b
2 parents 1220d79 + 527998e commit 0f786c4

File tree

14 files changed

+791
-778
lines changed

14 files changed

+791
-778
lines changed

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ module.exports = {
1919
'react/react-in-jsx-scope': 'off', // ditto
2020
'react-hooks/rules-of-hooks': 'error',
2121
'react-hooks/exhaustive-deps': 'warn',
22+
'react/no-unknown-property': [
23+
'error',
24+
{
25+
ignore: ['watch', 'align'],
26+
},
27+
],
2228
},
2329
settings: {
2430
react: {

.github/workflows/testing.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ on:
44
pull_request:
55

66
jobs:
7+
unitTest:
8+
name: Unit Test
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
node-version: [16.x]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: yarn
22+
23+
- run: yarn --frozen-lockfile
24+
- run: yarn jest
25+
726
lint:
827
name: Lint
928
strategy:

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://github.com/webpack/webpack.js.org/issues"
2222
},
2323
"engines": {
24-
"node": ">=14"
24+
"node": "^14.20.0 || ^16.15.0 || >=18.0.0"
2525
},
2626
"scripts": {
2727
"clean-dist": "rimraf ./dist",
@@ -73,31 +73,30 @@
7373
]
7474
},
7575
"devDependencies": {
76-
"@babel/core": "^7.18.13",
77-
"@babel/eslint-parser": "^7.18.9",
76+
"@babel/core": "^7.19.1",
77+
"@babel/eslint-parser": "^7.19.1",
7878
"@babel/plugin-proposal-class-properties": "^7.17.12",
79-
"@babel/preset-env": "^7.18.10",
79+
"@babel/preset-env": "^7.19.1",
8080
"@babel/preset-react": "^7.18.6",
8181
"@mdx-js/loader": "^2.0.0-next.9",
8282
"@octokit/auth-action": "^2.0.1",
8383
"@octokit/rest": "^19.0.4",
84-
"@parcel/css": "^1.13.0",
8584
"@pmmmwh/react-refresh-webpack-plugin": "next",
8685
"@svgr/webpack": "^6.3.1",
87-
"autoprefixer": "^10.4.8",
86+
"autoprefixer": "^10.4.11",
8887
"babel-loader": "^8.2.5",
8988
"copy-webpack-plugin": "^11.0.0",
9089
"css-loader": "^6.7.1",
91-
"css-minimizer-webpack-plugin": "^4.0.0",
92-
"cypress": "^10.6.0",
93-
"directory-tree": "^3.3.0",
90+
"css-minimizer-webpack-plugin": "^4.1.0",
91+
"cypress": "^10.7.0",
92+
"directory-tree": "^3.3.1",
9493
"directory-tree-webpack-plugin": "^1.0.3",
9594
"duplexer": "^0.1.1",
96-
"eslint": "^8.23.0",
95+
"eslint": "^8.23.1",
9796
"eslint-config-prettier": "^8.5.0",
9897
"eslint-plugin-cypress": "^2.12.1",
99-
"eslint-plugin-mdx": "^2.0.2",
100-
"eslint-plugin-react": "^7.31.1",
98+
"eslint-plugin-mdx": "^2.0.4",
99+
"eslint-plugin-react": "^7.31.8",
101100
"eslint-plugin-react-hooks": "^4.6.0",
102101
"front-matter": "^4.0.2",
103102
"github-slugger": "^1.4.0",
@@ -106,7 +105,8 @@
106105
"http-server": "^14.1.1",
107106
"husky": "^8.0.1",
108107
"hyperlink": "^5.0.4",
109-
"jest": "^29.0.1",
108+
"jest": "^29.0.3",
109+
"lightningcss": "^1.15.1",
110110
"lint-staged": "^13.0.3",
111111
"lodash": "^4.17.21",
112112
"markdownlint": "^0.26.2",
@@ -131,7 +131,7 @@
131131
"remark-html": "^15.0.1",
132132
"remark-refractor": "montogeek/remark-refractor",
133133
"rimraf": "^3.0.2",
134-
"sass": "^1.54.5",
134+
"sass": "^1.54.9",
135135
"sass-loader": "^13.0.2",
136136
"sirv-cli": "^2.0.2",
137137
"sitemap-static": "^0.4.2",
@@ -145,7 +145,7 @@
145145
"webpack": "^5.74.0",
146146
"webpack-bundle-analyzer": "^4.6.1",
147147
"webpack-cli": "^4.10.0",
148-
"webpack-dev-server": "^4.10.1",
148+
"webpack-dev-server": "^4.11.0",
149149
"webpack-merge": "^5.8.0",
150150
"workbox-webpack-plugin": "^6.5.4",
151151
"yarn-deduplicate": "^6.0.0"
@@ -157,8 +157,8 @@
157157
"react": "^17.0.2",
158158
"react-dom": "^17.0.2",
159159
"react-helmet-async": "^1.3.0",
160-
"react-router-dom": "^6.3.0",
161-
"react-spring": "^9.5.2",
160+
"react-router-dom": "^6.4.0",
161+
"react-spring": "^9.5.4",
162162
"react-tiny-popover": "5",
163163
"react-use": "^17.4.0",
164164
"react-visibility-sensor": "^5.0.2",

src/content/configuration/output.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ module.exports = {
927927

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

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

932932
#### Expose a Variable $#exposeavariable$
933933

@@ -1504,7 +1504,7 @@ module.exports = {
15041504
//Test Comment
15051505
else root['MyLibrary'] = factory();
15061506
})(self, function () {
1507-
return __entry_return_;
1507+
return _entry_return_;
15081508
});
15091509
```
15101510

src/remark-plugins/remark-cleanup-readme/__snapshots__/index.test.mjs.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ exports[`cleanup readme should clean up div[align="center"] block with paragraph
44
"/* @jsxRuntime classic */
55
/* @jsx mdx */
66
/* @jsxFrag mdx.Fragment */
7-
const MDXLayout = \\"wrapper\\";
7+
const MDXLayout = "wrapper";
88
function MDXContent({components, ...props}) {
9-
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>;
9+
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>;
1010
}
1111
MDXContent.isMDXComponent = true;
1212
export default MDXContent;
@@ -17,9 +17,9 @@ exports[`cleanup readme should clean up div[align="center"] block without paragr
1717
"/* @jsxRuntime classic */
1818
/* @jsx mdx */
1919
/* @jsxFrag mdx.Fragment */
20-
const MDXLayout = \\"wrapper\\";
20+
const MDXLayout = "wrapper";
2121
function MDXContent({components, ...props}) {
22-
return <MDXLayout components={components} {...props}><div align=\\"center\\" /></MDXLayout>;
22+
return <MDXLayout components={components} {...props}><div align="center" /></MDXLayout>;
2323
}
2424
MDXContent.isMDXComponent = true;
2525
export default MDXContent;
@@ -30,9 +30,9 @@ exports[`cleanup readme should clean up nested div[align="center"] block 1`] =
3030
"/* @jsxRuntime classic */
3131
/* @jsx mdx */
3232
/* @jsxFrag mdx.Fragment */
33-
const MDXLayout = \\"wrapper\\";
33+
const MDXLayout = "wrapper";
3434
function MDXContent({components, ...props}) {
35-
return <MDXLayout components={components} {...props}><div align=\\"center\\" /></MDXLayout>;
35+
return <MDXLayout components={components} {...props}><div align="center" /></MDXLayout>;
3636
}
3737
MDXContent.isMDXComponent = true;
3838
export default MDXContent;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`customize blockquote should transform W> into aside of warning 1`] = `
4-
"<aside class=\\"warning\\"><h6 class=\\"warning__prefix\\">warning</h6><p>hello world</p></aside>
4+
"<aside class="warning"><h6 class="warning__prefix">warning</h6><p>hello world</p></aside>
55
"
66
`;

src/remark-plugins/remark-custom-asides/index.test.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ describe('customize blockquote', () => {
99
'W>': 'warning',
1010
},
1111
})
12-
.use(remarkHtml)
12+
.use(remarkHtml, {
13+
sanitize: false
14+
})
1315
.process(
1416
`
1517
W> hello world
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`customize blockquote should add id 1`] = `
4-
"<h2><span id=\\"user-content-hello-world\\"></span>hello world</h2>
4+
"<h2><span id="user-content-hello-world"></span>hello world</h2>
55
<p>this is me.</p>
66
"
77
`;

src/remark-plugins/remark-responsive-table/__snapshots__/remark-responsive-table.test.mjs.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ exports[`responsive table should add data-th 1`] = `
1010
</thead>
1111
<tbody>
1212
<tr>
13-
<td data-th=\\"foo\\"><span>baz</span></td>
14-
<td data-th=\\"bar\\"><span>-</span></td>
13+
<td data-th="foo"><span>baz</span></td>
14+
<td data-th="bar"><span>-</span></td>
1515
</tr>
1616
<tr>
17-
<td data-th=\\"foo\\"><span>sam</span></td>
18-
<td data-th=\\"bar\\"><span>chen</span></td>
17+
<td data-th="foo"><span>sam</span></td>
18+
<td data-th="bar"><span>chen</span></td>
1919
</tr>
2020
</tbody>
2121
</table>
@@ -32,12 +32,12 @@ exports[`responsive table should handle empty thead 1`] = `
3232
</thead>
3333
<tbody>
3434
<tr>
35-
<td data-th=\\"\\"><span>baz</span></td>
36-
<td data-th=\\"bar\\"><span>-</span></td>
35+
<td data-th=""><span>baz</span></td>
36+
<td data-th="bar"><span>-</span></td>
3737
</tr>
3838
<tr>
39-
<td data-th=\\"\\"><span>sam</span></td>
40-
<td data-th=\\"bar\\"><span>chen</span></td>
39+
<td data-th=""><span>sam</span></td>
40+
<td data-th="bar"><span>chen</span></td>
4141
</tr>
4242
</tbody>
4343
</table>

src/remark-plugins/remark-responsive-table/remark-responsive-table.test.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ describe('responsive table', () => {
88
const processor = remark()
99
.use(remarkGfm)
1010
.use(remarkResponsiveTable)
11-
.use(remarkHtml);
11+
.use(remarkHtml, {
12+
sanitize: false,
13+
});
1214
it('should add data-th', () => {
1315
processor.process(
1416
`

0 commit comments

Comments
 (0)