@docusaurus/core 4.0.0-canary-6964 → 4.0.0-canary-6965
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.
|
@@ -12,7 +12,6 @@ const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
|
12
12
|
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
13
13
|
const bundler_1 = require("@docusaurus/bundler");
|
|
14
14
|
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
|
|
15
|
-
const evalSourceMapMiddleware_1 = tslib_1.__importDefault(require("../utils/legacy/evalSourceMapMiddleware"));
|
|
16
15
|
const watcher_1 = require("./watcher");
|
|
17
16
|
const getHttpsConfig_1 = tslib_1.__importDefault(require("../../webpack/utils/getHttpsConfig"));
|
|
18
17
|
const configure_1 = require("../../webpack/configure");
|
|
@@ -93,11 +92,6 @@ async function createDevServerConfig({ cliOptions, props, host, port, }) {
|
|
|
93
92
|
allowedHosts: 'all',
|
|
94
93
|
host,
|
|
95
94
|
port,
|
|
96
|
-
setupMiddlewares: (middlewares, devServer) => {
|
|
97
|
-
// This lets us fetch source contents from webpack for the error overlay.
|
|
98
|
-
middlewares.unshift((0, evalSourceMapMiddleware_1.default)(devServer));
|
|
99
|
-
return middlewares;
|
|
100
|
-
},
|
|
101
95
|
};
|
|
102
96
|
}
|
|
103
97
|
async function getStartClientConfig({ props, minify, poll, configureWebpackUtils, }) {
|
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": "4.0.0-canary-
|
|
4
|
+
"version": "4.0.0-canary-6965",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@docusaurus/babel": "4.0.0-canary-
|
|
31
|
-
"@docusaurus/bundler": "4.0.0-canary-
|
|
32
|
-
"@docusaurus/fs": "4.0.0-canary-
|
|
33
|
-
"@docusaurus/glob": "4.0.0-canary-
|
|
34
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
35
|
-
"@docusaurus/mdx-loader": "4.0.0-canary-
|
|
36
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
37
|
-
"@docusaurus/utils-common": "4.0.0-canary-
|
|
38
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
30
|
+
"@docusaurus/babel": "4.0.0-canary-6965",
|
|
31
|
+
"@docusaurus/bundler": "4.0.0-canary-6965",
|
|
32
|
+
"@docusaurus/fs": "4.0.0-canary-6965",
|
|
33
|
+
"@docusaurus/glob": "4.0.0-canary-6965",
|
|
34
|
+
"@docusaurus/logger": "4.0.0-canary-6965",
|
|
35
|
+
"@docusaurus/mdx-loader": "4.0.0-canary-6965",
|
|
36
|
+
"@docusaurus/utils": "4.0.0-canary-6965",
|
|
37
|
+
"@docusaurus/utils-common": "4.0.0-canary-6965",
|
|
38
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6965",
|
|
39
39
|
"@rspack/core": "^2.2.3",
|
|
40
40
|
"@rspack/dev-server": "^2.2.1",
|
|
41
41
|
"boxen": "^9.0.0",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"webpack-merge": "^6.0.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@docusaurus/module-type-aliases": "4.0.0-canary-
|
|
72
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
71
|
+
"@docusaurus/module-type-aliases": "4.0.0-canary-6965",
|
|
72
|
+
"@docusaurus/types": "4.0.0-canary-6965",
|
|
73
73
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
74
74
|
"@types/escape-html": "^1.0.4",
|
|
75
75
|
"@types/history": "^4.7.11",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
export = createEvalSourceMapMiddleware;
|
|
8
|
-
/**
|
|
9
|
-
* Middleware responsible for retrieving a generated source
|
|
10
|
-
* Receives a webpack internal url: "webpack-internal:///<module-id>"
|
|
11
|
-
* Returns a generated source: "<source-text><sourceMappingURL><sourceURL>"
|
|
12
|
-
*
|
|
13
|
-
* Based on EvalSourceMapDevToolModuleTemplatePlugin.js
|
|
14
|
-
*
|
|
15
|
-
* @param {import("webpack-dev-server").default} server
|
|
16
|
-
* @returns {import("express").Handler}
|
|
17
|
-
*/
|
|
18
|
-
declare function createEvalSourceMapMiddleware(server: import("webpack-dev-server").default): import("express").Handler;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// TODO Legacy CRA react-dev-utils package code
|
|
9
|
-
// This code was in CRA/react-dev-utils (deprecated in 2025)
|
|
10
|
-
// We just copied the code as-is to remove a fat/useless dependency subtree
|
|
11
|
-
// See https://github.com/facebook/docusaurus/pull/10956
|
|
12
|
-
// See https://github.com/facebook/create-react-app/blob/main/packages/react-dev-utils/evalSourceMapMiddleware.js
|
|
13
|
-
|
|
14
|
-
/* eslint-disable */
|
|
15
|
-
|
|
16
|
-
function base64SourceMap(source) {
|
|
17
|
-
const base64 = Buffer.from(JSON.stringify(source.map()), 'utf8').toString(
|
|
18
|
-
'base64',
|
|
19
|
-
);
|
|
20
|
-
return `data:application/json;charset=utf-8;base64,${base64}`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getSourceById(server, id) {
|
|
24
|
-
const module = Array.from(server._stats.compilation.modules).find(
|
|
25
|
-
(m) => server._stats.compilation.chunkGraph.getModuleId(m) == id,
|
|
26
|
-
);
|
|
27
|
-
return module.originalSource();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Middleware responsible for retrieving a generated source
|
|
32
|
-
* Receives a webpack internal url: "webpack-internal:///<module-id>"
|
|
33
|
-
* Returns a generated source: "<source-text><sourceMappingURL><sourceURL>"
|
|
34
|
-
*
|
|
35
|
-
* Based on EvalSourceMapDevToolModuleTemplatePlugin.js
|
|
36
|
-
*
|
|
37
|
-
* @param {import("webpack-dev-server").default} server
|
|
38
|
-
* @returns {import("express").Handler}
|
|
39
|
-
*/
|
|
40
|
-
module.exports = function createEvalSourceMapMiddleware(server) {
|
|
41
|
-
return function handleWebpackInternalMiddleware(req, res, next) {
|
|
42
|
-
if (req.url.startsWith('/__get-internal-source')) {
|
|
43
|
-
const fileName = req.query.fileName;
|
|
44
|
-
const id = fileName.match(/webpack-internal:\/\/\/(.+)/)[1];
|
|
45
|
-
if (!id || !server._stats) {
|
|
46
|
-
next();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const source = getSourceById(server, id);
|
|
50
|
-
const sourceMapURL = `//# sourceMappingURL=${base64SourceMap(source)}`;
|
|
51
|
-
const sourceURL = `//# sourceURL=webpack-internal:///${module.id}`;
|
|
52
|
-
res.end(`${source.source()}\n${sourceMapURL}\n${sourceURL}`);
|
|
53
|
-
} else {
|
|
54
|
-
next();
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|