@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.99 → 3.4.0-ultramodern.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/dist/cjs/baseline.js +12 -92
- package/dist/cjs/builder/builder-rspack/index.js +9 -5
- package/dist/cjs/builder/generator/adapterCopy.js +9 -5
- package/dist/cjs/builder/generator/createBuilderProviderConfig.js +9 -5
- package/dist/cjs/builder/generator/createCopyPattern.js +9 -5
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +41 -9
- package/dist/cjs/builder/generator/index.js +16 -5
- package/dist/cjs/builder/index.js +9 -5
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +9 -5
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +10 -6
- package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +9 -5
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +39 -9
- package/dist/cjs/builder/shared/builderPlugins/builderHooks.js +12 -8
- package/dist/cjs/builder/shared/builderPlugins/index.js +9 -5
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +9 -5
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +12 -8
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +41 -8
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +9 -5
- package/dist/cjs/builder/shared/createCopyInfo.js +9 -5
- package/dist/cjs/builder/shared/index.js +9 -5
- package/dist/cjs/builder/shared/lazyCompilation.js +94 -0
- package/dist/cjs/builder/shared/loaders/serverModuleLoader.js +12 -8
- package/dist/cjs/commands/build.js +9 -5
- package/dist/cjs/commands/deploy.js +9 -5
- package/dist/cjs/commands/dev.js +9 -5
- package/dist/cjs/commands/index.js +12 -11
- package/dist/cjs/commands/info.js +9 -5
- package/dist/cjs/commands/inspect.js +12 -8
- package/dist/cjs/commands/runtime.js +50 -13
- package/dist/cjs/commands/serve.js +9 -5
- package/dist/cjs/compat/hooks.js +9 -5
- package/dist/cjs/compat/index.js +9 -5
- package/dist/cjs/compat/utils.js +9 -5
- package/dist/cjs/config/default.js +27 -7
- package/dist/cjs/config/index.js +9 -5
- package/dist/cjs/config/initialize/index.js +9 -5
- package/dist/cjs/config/initialize/inits.js +9 -5
- package/dist/cjs/constants.js +13 -9
- package/dist/cjs/defineConfig.js +12 -8
- package/dist/cjs/esm/register-esm.js +12 -8
- package/dist/cjs/esm/ts-paths-loader.js +9 -5
- package/dist/cjs/index.js +23 -17
- package/dist/cjs/locale/en.js +12 -8
- package/dist/cjs/locale/index.js +9 -5
- package/dist/cjs/locale/zh.js +12 -8
- package/dist/cjs/plugins/analyze/constants.js +14 -10
- package/dist/cjs/plugins/analyze/getBundleEntry.js +9 -5
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +9 -5
- package/dist/cjs/plugins/analyze/getHtmlTemplate.js +9 -5
- package/dist/cjs/plugins/analyze/getServerRoutes.js +9 -5
- package/dist/cjs/plugins/analyze/index.js +12 -6
- package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +10 -6
- package/dist/cjs/plugins/analyze/templates.js +12 -8
- package/dist/cjs/plugins/analyze/utils.js +9 -5
- package/dist/cjs/plugins/deploy/index.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/cloudflare.js +185 -7
- package/dist/cjs/plugins/deploy/platforms/gh-pages.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/netlify.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/node.js +9 -5
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +141 -16
- package/dist/cjs/plugins/deploy/platforms/vercel.js +9 -5
- package/dist/cjs/plugins/deploy/utils/generator.js +9 -5
- package/dist/cjs/plugins/deploy/utils/index.js +19 -40
- package/dist/cjs/plugins/initialize/index.js +19 -6
- package/dist/cjs/plugins/serverBuild.js +9 -5
- package/dist/cjs/plugins/serverRuntime.js +12 -8
- package/dist/cjs/presetUltramodern.js +96 -7
- package/dist/cjs/rsbuild.js +55 -67
- package/dist/cjs/run/index.js +9 -5
- package/dist/cjs/types/config/cloudflareDeploy.js +18 -0
- package/dist/cjs/types/config/index.js +9 -5
- package/dist/cjs/types/config/precompress.js +18 -0
- package/dist/cjs/types/index.js +9 -5
- package/dist/cjs/ultramodern/designSystem.js +16 -12
- package/dist/cjs/utils/config.js +9 -5
- package/dist/cjs/utils/createServer.js +14 -10
- package/dist/cjs/utils/env.js +9 -5
- package/dist/cjs/utils/generateWatchFiles.js +9 -5
- package/dist/cjs/utils/getConfigFile.js +9 -5
- package/dist/cjs/utils/getSelectedEntries.js +9 -5
- package/dist/cjs/utils/initAppContext.js +9 -5
- package/dist/cjs/utils/loadPlugins.js +9 -5
- package/dist/cjs/utils/printInstructions.js +9 -5
- package/dist/cjs/utils/register.js +9 -5
- package/dist/cjs/utils/restart.js +9 -5
- package/dist/cjs/utils/routes.js +9 -5
- package/dist/esm/baseline.mjs +3 -77
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +32 -4
- package/dist/esm/builder/generator/index.mjs +7 -0
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.mjs +1 -1
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +31 -5
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.mjs +32 -3
- package/dist/esm/builder/shared/lazyCompilation.mjs +44 -0
- package/dist/esm/commands/index.mjs +2 -5
- package/dist/esm/commands/runtime.mjs +33 -3
- package/dist/esm/config/default.mjs +14 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/plugins/analyze/index.mjs +3 -1
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +176 -2
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +141 -16
- package/dist/esm/plugins/deploy/utils/index.mjs +11 -36
- package/dist/esm/plugins/initialize/index.mjs +11 -2
- package/dist/esm/presetUltramodern.mjs +77 -3
- package/dist/esm/rsbuild.mjs +1 -8
- package/dist/esm/types/config/cloudflareDeploy.mjs +0 -0
- package/dist/esm/types/config/precompress.mjs +0 -0
- package/dist/esm-node/baseline.mjs +3 -77
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +32 -4
- package/dist/esm-node/builder/generator/index.mjs +7 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +1 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +31 -5
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.mjs +32 -3
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +45 -0
- package/dist/esm-node/commands/index.mjs +2 -5
- package/dist/esm-node/commands/runtime.mjs +33 -3
- package/dist/esm-node/config/default.mjs +14 -1
- package/dist/esm-node/index.mjs +3 -2
- package/dist/esm-node/plugins/analyze/index.mjs +3 -1
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +176 -2
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +141 -16
- package/dist/esm-node/plugins/deploy/utils/index.mjs +12 -36
- package/dist/esm-node/plugins/initialize/index.mjs +11 -2
- package/dist/esm-node/presetUltramodern.mjs +77 -3
- package/dist/esm-node/rsbuild.mjs +1 -8
- package/dist/esm-node/types/config/cloudflareDeploy.mjs +1 -0
- package/dist/esm-node/types/config/precompress.mjs +1 -0
- package/dist/types/baseline.d.ts +16 -46
- package/dist/types/builder/builder-rspack/index.d.ts +1 -1
- package/dist/types/builder/generator/index.d.ts +1 -1
- package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +3 -1
- package/dist/types/builder/shared/createCopyInfo.d.ts +1 -1
- package/dist/types/builder/shared/lazyCompilation.d.ts +43 -0
- package/dist/types/builder/shared/types.d.ts +10 -0
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/inspect.d.ts +1 -1
- package/dist/types/commands/runtime.d.ts +1 -0
- package/dist/types/config/default.d.ts +6 -0
- package/dist/types/locale/index.d.ts +89 -2
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +2 -2
- package/dist/types/plugins/analyze/index.d.ts +1 -1
- package/dist/types/plugins/analyze/utils.d.ts +1 -1
- package/dist/types/plugins/deploy/index.d.ts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.d.mts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.cts +1 -1
- package/dist/types/plugins/deploy/utils/generator.d.ts +2 -2
- package/dist/types/plugins/deploy/utils/index.d.ts +1 -1
- package/dist/types/plugins/initialize/index.d.ts +1 -1
- package/dist/types/plugins/serverBuild.d.ts +1 -1
- package/dist/types/plugins/serverRuntime.d.ts +1 -1
- package/dist/types/presetUltramodern.d.ts +52 -2
- package/dist/types/rsbuild.d.ts +1 -1
- package/dist/types/run/index.d.ts +1 -1
- package/dist/types/types/config/cloudflareDeploy.d.ts +79 -0
- package/dist/types/types/config/deploy.d.ts +9 -15
- package/dist/types/types/config/output.d.ts +4 -20
- package/dist/types/types/config/precompress.d.ts +20 -0
- package/dist/types/types/plugin.d.ts +20 -0
- package/dist/types/utils/getConfigFile.d.ts +1 -1
- package/dist/types/utils/loadPlugins.d.ts +2 -2
- package/package.json +26 -21
- package/dist/esm/rslib-runtime.mjs +0 -18
- package/dist/esm-node/rslib-runtime.mjs +0 -19
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -92,6 +96,25 @@ class RouterPlugin {
|
|
|
92
96
|
routeAssets: {}
|
|
93
97
|
});
|
|
94
98
|
const prevManifest = JSON.parse(prevManifestStr);
|
|
99
|
+
const namedChunkGroupInstances = new Map();
|
|
100
|
+
for (const cg of compilation.chunkGroups || [])if (cg.name) namedChunkGroupInstances.set(cg.name, cg);
|
|
101
|
+
const collectDescendantCssAssets = (name)=>{
|
|
102
|
+
const root = namedChunkGroupInstances.get(name);
|
|
103
|
+
if (!root) return [];
|
|
104
|
+
const cssFiles = new Set();
|
|
105
|
+
const visited = new Set();
|
|
106
|
+
const stack = [
|
|
107
|
+
...root.childrenIterable
|
|
108
|
+
];
|
|
109
|
+
while(stack.length){
|
|
110
|
+
const child = stack.pop();
|
|
111
|
+
if (visited.has(child)) continue;
|
|
112
|
+
visited.add(child);
|
|
113
|
+
for (const chunk of child.chunks)for (const file of chunk.files)if (/\.css$/.test(file)) cssFiles.add(publicPath ? normalizePath(publicPath) + file : file);
|
|
114
|
+
for (const c of child.childrenIterable)stack.push(c);
|
|
115
|
+
}
|
|
116
|
+
return Array.from(cssFiles);
|
|
117
|
+
};
|
|
95
118
|
const asyncEntryNames = [];
|
|
96
119
|
for (const [name, chunkGroup] of Object.entries(namedChunkGroups)){
|
|
97
120
|
if (name.startsWith('async-')) asyncEntryNames.push(name);
|
|
@@ -99,7 +122,12 @@ class RouterPlugin {
|
|
|
99
122
|
const filename = asset.name;
|
|
100
123
|
return publicPath ? normalizePath(publicPath) + filename : filename;
|
|
101
124
|
});
|
|
102
|
-
const
|
|
125
|
+
const directCssAssets = assets.filter((asset)=>/\.css$/.test(asset));
|
|
126
|
+
const descendantCssAssets = collectDescendantCssAssets(name).filter((asset)=>!directCssAssets.includes(asset));
|
|
127
|
+
const referenceCssAssets = [
|
|
128
|
+
...directCssAssets,
|
|
129
|
+
...descendantCssAssets
|
|
130
|
+
];
|
|
103
131
|
routeAssets[name] = {
|
|
104
132
|
chunkIds: chunkGroup.chunks,
|
|
105
133
|
assets,
|
|
@@ -141,10 +169,14 @@ class RouterPlugin {
|
|
|
141
169
|
const manifest = {
|
|
142
170
|
routeAssets: relatedAssets
|
|
143
171
|
};
|
|
172
|
+
const { useRsc } = this;
|
|
144
173
|
const injectedContent = `
|
|
145
174
|
;(function(){
|
|
146
175
|
window.${constants_namespaceObject.ROUTE_MANIFEST} = ${JSON.stringify(manifest, (k, v)=>{
|
|
147
|
-
if (('assets' === k || 'referenceCssAssets' === k) && Array.isArray(v))
|
|
176
|
+
if (('assets' === k || 'referenceCssAssets' === k) && Array.isArray(v)) {
|
|
177
|
+
if (!useRsc) return;
|
|
178
|
+
return v.map((item)=>item.replace(publicPath, ''));
|
|
179
|
+
}
|
|
148
180
|
return v;
|
|
149
181
|
})};
|
|
150
182
|
})();
|
|
@@ -172,7 +204,7 @@ class RouterPlugin {
|
|
|
172
204
|
});
|
|
173
205
|
});
|
|
174
206
|
}
|
|
175
|
-
constructor({ staticJsDir = 'static/js', HtmlBundlerPlugin, enableInlineRouteManifests, disableFilenameHash = false, scriptLoading = 'defer', nonce }){
|
|
207
|
+
constructor({ staticJsDir = 'static/js', HtmlBundlerPlugin, enableInlineRouteManifests, disableFilenameHash = false, scriptLoading = 'defer', nonce, useRsc = false }){
|
|
176
208
|
this.name = 'RouterPlugin';
|
|
177
209
|
this.HtmlBundlerPlugin = HtmlBundlerPlugin;
|
|
178
210
|
this.enableInlineRouteManifests = enableInlineRouteManifests;
|
|
@@ -180,6 +212,7 @@ class RouterPlugin {
|
|
|
180
212
|
this.disableFilenameHash = disableFilenameHash;
|
|
181
213
|
this.scriptLoading = scriptLoading;
|
|
182
214
|
this.nonce = nonce;
|
|
215
|
+
this.useRsc = useRsc;
|
|
183
216
|
}
|
|
184
217
|
}
|
|
185
218
|
exports.RouterPlugin = __webpack_exports__.RouterPlugin;
|
|
@@ -30,11 +30,15 @@ function __webpack_require__(moduleId) {
|
|
|
30
30
|
};
|
|
31
31
|
})();
|
|
32
32
|
(()=>{
|
|
33
|
-
__webpack_require__.d = (exports1,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
34
|
+
var define = (defs, kind)=>{
|
|
35
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
[kind]: defs[key]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
define(getters, "get");
|
|
41
|
+
define(values, "value");
|
|
38
42
|
};
|
|
39
43
|
})();
|
|
40
44
|
(()=>{
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -30,11 +30,15 @@ function __webpack_require__(moduleId) {
|
|
|
30
30
|
};
|
|
31
31
|
})();
|
|
32
32
|
(()=>{
|
|
33
|
-
__webpack_require__.d = (exports1,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
34
|
+
var define = (defs, kind)=>{
|
|
35
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
[kind]: defs[key]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
define(getters, "get");
|
|
41
|
+
define(values, "value");
|
|
38
42
|
};
|
|
39
43
|
})();
|
|
40
44
|
(()=>{
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
aggregateEagerRouteComponentFiles: ()=>aggregateEagerRouteComponentFiles,
|
|
32
|
+
buildSSRLazyCompilationTest: ()=>buildSSRLazyCompilationTest,
|
|
33
|
+
collectRouteComponentFiles: ()=>utils_namespaceObject.collectRouteComponentFiles,
|
|
34
|
+
normalizeModulePath: ()=>utils_namespaceObject.normalizeModulePath,
|
|
35
|
+
planSSRLazyCompilation: ()=>planSSRLazyCompilation
|
|
36
|
+
});
|
|
37
|
+
const utils_namespaceObject = require("@modern-js/utils");
|
|
38
|
+
function aggregateEagerRouteComponentFiles(byEntry) {
|
|
39
|
+
const files = new Set();
|
|
40
|
+
const unresolvedByEntry = new Map();
|
|
41
|
+
if (byEntry) for (const [entryName, collection] of byEntry){
|
|
42
|
+
for (const file of collection.resolvedFiles)files.add(file);
|
|
43
|
+
if (collection.unresolvedSpecifiers.length > 0) unresolvedByEntry.set(entryName, collection.unresolvedSpecifiers);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
files,
|
|
47
|
+
unresolvedByEntry
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function buildSSRLazyCompilationTest(eagerRouteFiles, userTest) {
|
|
51
|
+
const userTestFn = 'function' == typeof userTest ? userTest : userTest instanceof RegExp ? (m)=>userTest.test(m.resource || '') : ()=>true;
|
|
52
|
+
return (m)=>{
|
|
53
|
+
const resource = m.resource;
|
|
54
|
+
if (!resource) return userTestFn(m);
|
|
55
|
+
if (eagerRouteFiles.has((0, utils_namespaceObject.normalizeModulePath)(resource))) return false;
|
|
56
|
+
return userTestFn(m);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function planSSRLazyCompilation(current, info) {
|
|
60
|
+
if (!current) return {
|
|
61
|
+
apply: false
|
|
62
|
+
};
|
|
63
|
+
if (info.unresolvedByEntry.size > 0) return {
|
|
64
|
+
apply: false,
|
|
65
|
+
unresolvedByEntry: info.unresolvedByEntry
|
|
66
|
+
};
|
|
67
|
+
if (0 === info.files.size) return {
|
|
68
|
+
apply: false
|
|
69
|
+
};
|
|
70
|
+
const base = 'object' == typeof current ? current : {};
|
|
71
|
+
const userTest = current.test;
|
|
72
|
+
return {
|
|
73
|
+
apply: true,
|
|
74
|
+
lazyCompilation: {
|
|
75
|
+
...base,
|
|
76
|
+
test: buildSSRLazyCompilationTest(info.files, userTest)
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
exports.aggregateEagerRouteComponentFiles = __webpack_exports__.aggregateEagerRouteComponentFiles;
|
|
81
|
+
exports.buildSSRLazyCompilationTest = __webpack_exports__.buildSSRLazyCompilationTest;
|
|
82
|
+
exports.collectRouteComponentFiles = __webpack_exports__.collectRouteComponentFiles;
|
|
83
|
+
exports.normalizeModulePath = __webpack_exports__.normalizeModulePath;
|
|
84
|
+
exports.planSSRLazyCompilation = __webpack_exports__.planSSRLazyCompilation;
|
|
85
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
86
|
+
"aggregateEagerRouteComponentFiles",
|
|
87
|
+
"buildSSRLazyCompilationTest",
|
|
88
|
+
"collectRouteComponentFiles",
|
|
89
|
+
"normalizeModulePath",
|
|
90
|
+
"planSSRLazyCompilation"
|
|
91
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
92
|
+
Object.defineProperty(exports, '__esModule', {
|
|
93
|
+
value: true
|
|
94
|
+
});
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,13 +27,13 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
default: ()=>__rspack_default_export
|
|
28
|
-
});
|
|
29
30
|
function loader() {
|
|
30
31
|
return "module.exports = {}";
|
|
31
32
|
}
|
|
32
33
|
const __rspack_default_export = loader;
|
|
34
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
35
|
+
default: __rspack_default_export
|
|
36
|
+
});
|
|
33
37
|
exports["default"] = __webpack_exports__["default"];
|
|
34
38
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
35
39
|
"default"
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
package/dist/cjs/commands/dev.js
CHANGED
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -29,7 +33,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
33
|
devCommand: ()=>devCommand,
|
|
30
34
|
infoCommand: ()=>infoCommand,
|
|
31
35
|
inspectCommand: ()=>inspectCommand,
|
|
32
|
-
|
|
36
|
+
runtimeCommand: ()=>external_runtime_js_namespaceObject.runtimeCommand,
|
|
33
37
|
serverCommand: ()=>serverCommand
|
|
34
38
|
});
|
|
35
39
|
const index_js_namespaceObject = require("../locale/index.js");
|
|
@@ -75,15 +79,12 @@ const infoCommand = (program, api)=>{
|
|
|
75
79
|
await info(api, options);
|
|
76
80
|
});
|
|
77
81
|
};
|
|
78
|
-
const runtimeOperationsCommand = async (program, api)=>{
|
|
79
|
-
await (0, external_runtime_js_namespaceObject.runtimeCommand)(program, api);
|
|
80
|
-
};
|
|
81
82
|
exports.buildCommand = __webpack_exports__.buildCommand;
|
|
82
83
|
exports.deployCommand = __webpack_exports__.deployCommand;
|
|
83
84
|
exports.devCommand = __webpack_exports__.devCommand;
|
|
84
85
|
exports.infoCommand = __webpack_exports__.infoCommand;
|
|
85
86
|
exports.inspectCommand = __webpack_exports__.inspectCommand;
|
|
86
|
-
exports.
|
|
87
|
+
exports.runtimeCommand = __webpack_exports__.runtimeCommand;
|
|
87
88
|
exports.serverCommand = __webpack_exports__.serverCommand;
|
|
88
89
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
89
90
|
"buildCommand",
|
|
@@ -91,7 +92,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
91
92
|
"devCommand",
|
|
92
93
|
"infoCommand",
|
|
93
94
|
"inspectCommand",
|
|
94
|
-
"
|
|
95
|
+
"runtimeCommand",
|
|
95
96
|
"serverCommand"
|
|
96
97
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
97
98
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,9 +27,6 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
inspect: ()=>inspect
|
|
28
|
-
});
|
|
29
30
|
const inspect = async (api, options)=>{
|
|
30
31
|
const appContext = api.getAppContext();
|
|
31
32
|
if (!appContext.builder) throw new Error('Expect the Builder to have been initialized, But the appContext.builder received `undefined`');
|
|
@@ -40,6 +41,9 @@ const inspect = async (api, options)=>{
|
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
};
|
|
44
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
45
|
+
inspect: inspect
|
|
46
|
+
});
|
|
43
47
|
exports.inspect = __webpack_exports__.inspect;
|
|
44
48
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
49
|
"inspect"
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,12 +27,6 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
createRuntimeFallbackSignalPayload: ()=>createRuntimeFallbackSignalPayload,
|
|
28
|
-
resolveRuntimeEndpoint: ()=>resolveRuntimeEndpoint,
|
|
29
|
-
resolveToken: ()=>resolveToken,
|
|
30
|
-
runtimeCommand: ()=>runtimeCommand
|
|
31
|
-
});
|
|
32
30
|
const DEFAULT_RUNTIME_HOST = 'http://127.0.0.1:8080';
|
|
33
31
|
const DEFAULT_RUNTIME_STATUS_PATH = '/_modern/runtime/status';
|
|
34
32
|
const DEFAULT_RUNTIME_FALLBACK_SIGNAL_PATH = '/_modern/contract-gates/runtime-fallback';
|
|
@@ -85,9 +83,39 @@ const parseResponseBody = async (response)=>{
|
|
|
85
83
|
};
|
|
86
84
|
}
|
|
87
85
|
};
|
|
86
|
+
const INDENT_STEP = ' ';
|
|
87
|
+
const formatScalar = (value)=>'string' == typeof value ? value : JSON.stringify(value) ?? 'undefined';
|
|
88
|
+
const formatHumanReadableLines = (value, indent)=>{
|
|
89
|
+
if (Array.isArray(value)) {
|
|
90
|
+
if (0 === value.length) return [
|
|
91
|
+
`${indent}(empty)`
|
|
92
|
+
];
|
|
93
|
+
return value.flatMap((entry)=>null !== entry && 'object' == typeof entry ? [
|
|
94
|
+
`${indent}-`,
|
|
95
|
+
...formatHumanReadableLines(entry, indent + INDENT_STEP)
|
|
96
|
+
] : [
|
|
97
|
+
`${indent}- ${formatScalar(entry)}`
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
if (null !== value && 'object' == typeof value) {
|
|
101
|
+
const entries = Object.entries(value);
|
|
102
|
+
if (0 === entries.length) return [
|
|
103
|
+
`${indent}(empty)`
|
|
104
|
+
];
|
|
105
|
+
return entries.flatMap(([key, entry])=>null !== entry && 'object' == typeof entry ? [
|
|
106
|
+
`${indent}${key}:`,
|
|
107
|
+
...formatHumanReadableLines(entry, indent + INDENT_STEP)
|
|
108
|
+
] : [
|
|
109
|
+
`${indent}${key}: ${formatScalar(entry)}`
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
return [
|
|
113
|
+
`${indent}${formatScalar(value)}`
|
|
114
|
+
];
|
|
115
|
+
};
|
|
116
|
+
const formatRuntimeOutput = (payload, jsonOnly)=>jsonOnly ? JSON.stringify(payload, null, 2) : formatHumanReadableLines(payload, '').join('\n');
|
|
88
117
|
const printOutput = (payload, jsonOnly)=>{
|
|
89
|
-
|
|
90
|
-
console.log(JSON.stringify(payload, null, 2));
|
|
118
|
+
console.log(formatRuntimeOutput(payload, jsonOnly));
|
|
91
119
|
};
|
|
92
120
|
const createRuntimeFallbackSignalPayload = (options)=>{
|
|
93
121
|
const payload = {
|
|
@@ -144,12 +172,21 @@ const runtimeCommand = async (program, _api)=>{
|
|
|
144
172
|
printOutput(responsePayload, options.json);
|
|
145
173
|
});
|
|
146
174
|
};
|
|
175
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
176
|
+
createRuntimeFallbackSignalPayload: createRuntimeFallbackSignalPayload,
|
|
177
|
+
formatRuntimeOutput: formatRuntimeOutput,
|
|
178
|
+
resolveRuntimeEndpoint: resolveRuntimeEndpoint,
|
|
179
|
+
resolveToken: resolveToken,
|
|
180
|
+
runtimeCommand: runtimeCommand
|
|
181
|
+
});
|
|
147
182
|
exports.createRuntimeFallbackSignalPayload = __webpack_exports__.createRuntimeFallbackSignalPayload;
|
|
183
|
+
exports.formatRuntimeOutput = __webpack_exports__.formatRuntimeOutput;
|
|
148
184
|
exports.resolveRuntimeEndpoint = __webpack_exports__.resolveRuntimeEndpoint;
|
|
149
185
|
exports.resolveToken = __webpack_exports__.resolveToken;
|
|
150
186
|
exports.runtimeCommand = __webpack_exports__.runtimeCommand;
|
|
151
187
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
152
188
|
"createRuntimeFallbackSignalPayload",
|
|
189
|
+
"formatRuntimeOutput",
|
|
153
190
|
"resolveRuntimeEndpoint",
|
|
154
191
|
"resolveToken",
|
|
155
192
|
"runtimeCommand"
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
package/dist/cjs/compat/hooks.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
package/dist/cjs/compat/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|