@docusaurus/core 2.0.0-rc.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/docusaurus.mjs +2 -0
- package/lib/webpack/plugins/WaitPlugin.js +30 -29
- package/package.json +10 -10
package/bin/docusaurus.mjs
CHANGED
|
@@ -217,5 +217,7 @@ cli.parse(process.argv);
|
|
|
217
217
|
|
|
218
218
|
process.on('unhandledRejection', (err) => {
|
|
219
219
|
logger.error(err instanceof Error ? err.stack : err);
|
|
220
|
+
logger.info`Docusaurus version: number=${DOCUSAURUS_VERSION}
|
|
221
|
+
Node version: number=${process.version}`;
|
|
220
222
|
process.exit(1);
|
|
221
223
|
});
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
7
|
+
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const fs = require('fs-extra');
|
|
10
|
+
const {waitFile} = require('wait-file');
|
|
11
|
+
|
|
13
12
|
class WaitPlugin {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.filepath = options.filepath;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
apply(compiler) {
|
|
18
|
+
// Before finishing the compilation step
|
|
19
|
+
compiler.hooks.make.tapAsync('WaitPlugin', (compilation, callback) => {
|
|
20
|
+
// To prevent 'waitFile' error on waiting non-existing directory
|
|
21
|
+
fs.ensureDir(path.dirname(this.filepath), () => {
|
|
22
|
+
// Wait until file exist
|
|
23
|
+
waitFile({
|
|
24
|
+
resources: [this.filepath],
|
|
25
|
+
interval: 300,
|
|
26
|
+
})
|
|
27
|
+
.then(() => {
|
|
28
|
+
callback();
|
|
29
|
+
})
|
|
30
|
+
.catch((error) => {
|
|
31
|
+
console.warn(`WaitPlugin error: ${error}`);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
module.exports = WaitPlugin;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/core",
|
|
3
3
|
"description": "Easy to Maintain Open Source Documentation Websites",
|
|
4
|
-
"version": "2.0.0
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@babel/runtime": "^7.18.6",
|
|
44
44
|
"@babel/runtime-corejs3": "^7.18.6",
|
|
45
45
|
"@babel/traverse": "^7.18.8",
|
|
46
|
-
"@docusaurus/cssnano-preset": "2.0.0
|
|
47
|
-
"@docusaurus/logger": "2.0.0
|
|
48
|
-
"@docusaurus/mdx-loader": "2.0.0
|
|
46
|
+
"@docusaurus/cssnano-preset": "2.0.0",
|
|
47
|
+
"@docusaurus/logger": "2.0.0",
|
|
48
|
+
"@docusaurus/mdx-loader": "2.0.0",
|
|
49
49
|
"@docusaurus/react-loadable": "5.5.2",
|
|
50
|
-
"@docusaurus/utils": "2.0.0
|
|
51
|
-
"@docusaurus/utils-common": "2.0.0
|
|
52
|
-
"@docusaurus/utils-validation": "2.0.0
|
|
50
|
+
"@docusaurus/utils": "2.0.0",
|
|
51
|
+
"@docusaurus/utils-common": "2.0.0",
|
|
52
|
+
"@docusaurus/utils-validation": "2.0.0",
|
|
53
53
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.7",
|
|
54
54
|
"@svgr/webpack": "^6.2.1",
|
|
55
55
|
"autoprefixer": "^10.4.7",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"webpackbar": "^5.0.2"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@docusaurus/module-type-aliases": "2.0.0
|
|
110
|
-
"@docusaurus/types": "2.0.0
|
|
109
|
+
"@docusaurus/module-type-aliases": "2.0.0",
|
|
110
|
+
"@docusaurus/types": "2.0.0",
|
|
111
111
|
"@types/detect-port": "^1.3.2",
|
|
112
112
|
"@types/react-dom": "^18.0.6",
|
|
113
113
|
"@types/react-router-config": "^5.0.6",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"engines": {
|
|
128
128
|
"node": ">=16.14"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "2a9e8f5ec807e49a973fc72326f1ef26092e977e"
|
|
131
131
|
}
|