@modern-js/app-tools 2.68.0 → 2.68.1
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/builder/generator/index.js +1 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -3
- package/dist/cjs/commands/inspect.js +5 -1
- package/dist/esm/builder/generator/index.js +1 -0
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +4 -4
- package/dist/esm/commands/inspect.js +5 -2
- package/dist/esm-node/builder/generator/index.js +1 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +4 -4
- package/dist/esm-node/commands/inspect.js +5 -1
- package/package.json +17 -17
@@ -45,6 +45,7 @@ async function generateBuilder(options, bundlerType) {
|
|
45
45
|
cwd: appContext.appDirectory,
|
46
46
|
rscClientRuntimePath: `@${appContext.metaName}/runtime/rsc/client`,
|
47
47
|
rscServerRuntimePath: `@${appContext.metaName}/runtime/rsc/server`,
|
48
|
+
internalDirectory: appContext.internalDirectory,
|
48
49
|
frameworkConfigPath: appContext.configFile || void 0,
|
49
50
|
bundlerType,
|
50
51
|
config: builderConfig
|
@@ -49,7 +49,7 @@ const builderPluginAdapterSSR = (options) => ({
|
|
49
49
|
server: {
|
50
50
|
// the http-compression can't handler stream http.
|
51
51
|
// so we disable compress when user use stream ssr temporarily.
|
52
|
-
compress: isStreamingSSR(normalizedConfig) ? false : void 0
|
52
|
+
compress: isStreamingSSR(normalizedConfig) || (0, import_utils.isUseRsc)(normalizedConfig) ? false : void 0
|
53
53
|
}
|
54
54
|
});
|
55
55
|
});
|
@@ -65,7 +65,7 @@ const builderPluginAdapterSSR = (options) => ({
|
|
65
65
|
appNormalizedConfig: normalizedConfig2
|
66
66
|
});
|
67
67
|
}
|
68
|
-
if ((0, import_utils.isUseSSRBundle)(normalizedConfig2)) {
|
68
|
+
if ((0, import_utils.isUseSSRBundle)(normalizedConfig2) || (0, import_utils.isUseRsc)(normalizedConfig2)) {
|
69
69
|
await applySSRLoaderEntry(chain, options, isServer);
|
70
70
|
applySSRDataLoader(chain, options);
|
71
71
|
}
|
@@ -95,7 +95,7 @@ const isStreamingSSR = (userConfig) => {
|
|
95
95
|
return false;
|
96
96
|
};
|
97
97
|
function applyAsyncChunkHtmlPlugin({ chain, modernConfig, HtmlBundlerPlugin }) {
|
98
|
-
if (isStreamingSSR(modernConfig)) {
|
98
|
+
if (isStreamingSSR(modernConfig) || (0, import_utils.isUseRsc)(modernConfig)) {
|
99
99
|
chain.plugin("html-async-chunk").use(import_bundlerPlugins.HtmlAsyncChunkPlugin, [
|
100
100
|
HtmlBundlerPlugin
|
101
101
|
]);
|
@@ -26,11 +26,15 @@ const inspect = async (api, options) => {
|
|
26
26
|
if (!appContext.builder) {
|
27
27
|
throw new Error("Expect the Builder to have been initialized, But the appContext.builder received `undefined`");
|
28
28
|
}
|
29
|
+
const metaName = appContext.metaName === "modern-js" ? "modern.js" : appContext.metaName;
|
29
30
|
return appContext.builder.inspectConfig({
|
30
31
|
mode: options.env,
|
31
32
|
verbose: options.verbose,
|
32
33
|
outputPath: options.output,
|
33
|
-
writeToDisk: true
|
34
|
+
writeToDisk: true,
|
35
|
+
extraConfigs: {
|
36
|
+
[metaName]: api.getNormalizedConfig()
|
37
|
+
}
|
34
38
|
});
|
35
39
|
};
|
36
40
|
// Annotate the CommonJS export names for ESM import in node:
|
@@ -24,6 +24,7 @@ function _generateBuilder() {
|
|
24
24
|
cwd: appContext.appDirectory,
|
25
25
|
rscClientRuntimePath: "@".concat(appContext.metaName, "/runtime/rsc/client"),
|
26
26
|
rscServerRuntimePath: "@".concat(appContext.metaName, "/runtime/rsc/server"),
|
27
|
+
internalDirectory: appContext.internalDirectory,
|
27
28
|
frameworkConfigPath: appContext.configFile || void 0,
|
28
29
|
bundlerType,
|
29
30
|
config: builderConfig
|
@@ -3,7 +3,7 @@ import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
3
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
4
4
|
import * as path from "path";
|
5
5
|
import { SERVICE_WORKER_ENVIRONMENT_NAME, isHtmlDisabled } from "@modern-js/uni-builder";
|
6
|
-
import { fs, isUseSSRBundle } from "@modern-js/utils";
|
6
|
+
import { fs, isUseRsc, isUseSSRBundle } from "@modern-js/utils";
|
7
7
|
import { mergeRsbuildConfig } from "@rsbuild/core";
|
8
8
|
import { getServerCombinedModueFile } from "../../../plugins/analyze/utils";
|
9
9
|
import { HtmlAsyncChunkPlugin, RouterPlugin } from "../bundlerPlugins";
|
@@ -20,7 +20,7 @@ var builderPluginAdapterSSR = function(options) {
|
|
20
20
|
server: {
|
21
21
|
// the http-compression can't handler stream http.
|
22
22
|
// so we disable compress when user use stream ssr temporarily.
|
23
|
-
compress: isStreamingSSR(normalizedConfig) ? false : void 0
|
23
|
+
compress: isStreamingSSR(normalizedConfig) || isUseRsc(normalizedConfig) ? false : void 0
|
24
24
|
}
|
25
25
|
});
|
26
26
|
});
|
@@ -42,7 +42,7 @@ var builderPluginAdapterSSR = function(options) {
|
|
42
42
|
appNormalizedConfig: normalizedConfig2
|
43
43
|
});
|
44
44
|
}
|
45
|
-
if (!isUseSSRBundle(normalizedConfig2))
|
45
|
+
if (!(isUseSSRBundle(normalizedConfig2) || isUseRsc(normalizedConfig2)))
|
46
46
|
return [
|
47
47
|
3,
|
48
48
|
2
|
@@ -112,7 +112,7 @@ var isStreamingSSR = function(userConfig) {
|
|
112
112
|
};
|
113
113
|
function applyAsyncChunkHtmlPlugin(param) {
|
114
114
|
var chain = param.chain, modernConfig = param.modernConfig, HtmlBundlerPlugin = param.HtmlBundlerPlugin;
|
115
|
-
if (isStreamingSSR(modernConfig)) {
|
115
|
+
if (isStreamingSSR(modernConfig) || isUseRsc(modernConfig)) {
|
116
116
|
chain.plugin("html-async-chunk").use(HtmlAsyncChunkPlugin, [
|
117
117
|
HtmlBundlerPlugin
|
118
118
|
]);
|
@@ -1,20 +1,23 @@
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
2
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
2
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
3
4
|
var inspect = function() {
|
4
5
|
var _ref = _async_to_generator(function(api, options) {
|
5
|
-
var appContext;
|
6
|
+
var appContext, metaName;
|
6
7
|
return _ts_generator(this, function(_state) {
|
7
8
|
appContext = api.getAppContext();
|
8
9
|
if (!appContext.builder) {
|
9
10
|
throw new Error("Expect the Builder to have been initialized, But the appContext.builder received `undefined`");
|
10
11
|
}
|
12
|
+
metaName = appContext.metaName === "modern-js" ? "modern.js" : appContext.metaName;
|
11
13
|
return [
|
12
14
|
2,
|
13
15
|
appContext.builder.inspectConfig({
|
14
16
|
mode: options.env,
|
15
17
|
verbose: options.verbose,
|
16
18
|
outputPath: options.output,
|
17
|
-
writeToDisk: true
|
19
|
+
writeToDisk: true,
|
20
|
+
extraConfigs: _define_property({}, metaName, api.getNormalizedConfig())
|
18
21
|
})
|
19
22
|
];
|
20
23
|
});
|
@@ -12,6 +12,7 @@ async function generateBuilder(options, bundlerType) {
|
|
12
12
|
cwd: appContext.appDirectory,
|
13
13
|
rscClientRuntimePath: `@${appContext.metaName}/runtime/rsc/client`,
|
14
14
|
rscServerRuntimePath: `@${appContext.metaName}/runtime/rsc/server`,
|
15
|
+
internalDirectory: appContext.internalDirectory,
|
15
16
|
frameworkConfigPath: appContext.configFile || void 0,
|
16
17
|
bundlerType,
|
17
18
|
config: builderConfig
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as path from "path";
|
2
2
|
import { SERVICE_WORKER_ENVIRONMENT_NAME, isHtmlDisabled } from "@modern-js/uni-builder";
|
3
|
-
import { fs, isUseSSRBundle } from "@modern-js/utils";
|
3
|
+
import { fs, isUseRsc, isUseSSRBundle } from "@modern-js/utils";
|
4
4
|
import { mergeRsbuildConfig } from "@rsbuild/core";
|
5
5
|
import { getServerCombinedModueFile } from "../../../plugins/analyze/utils";
|
6
6
|
import { HtmlAsyncChunkPlugin, RouterPlugin } from "../bundlerPlugins";
|
@@ -16,7 +16,7 @@ const builderPluginAdapterSSR = (options) => ({
|
|
16
16
|
server: {
|
17
17
|
// the http-compression can't handler stream http.
|
18
18
|
// so we disable compress when user use stream ssr temporarily.
|
19
|
-
compress: isStreamingSSR(normalizedConfig) ? false : void 0
|
19
|
+
compress: isStreamingSSR(normalizedConfig) || isUseRsc(normalizedConfig) ? false : void 0
|
20
20
|
}
|
21
21
|
});
|
22
22
|
});
|
@@ -32,7 +32,7 @@ const builderPluginAdapterSSR = (options) => ({
|
|
32
32
|
appNormalizedConfig: normalizedConfig2
|
33
33
|
});
|
34
34
|
}
|
35
|
-
if (isUseSSRBundle(normalizedConfig2)) {
|
35
|
+
if (isUseSSRBundle(normalizedConfig2) || isUseRsc(normalizedConfig2)) {
|
36
36
|
await applySSRLoaderEntry(chain, options, isServer);
|
37
37
|
applySSRDataLoader(chain, options);
|
38
38
|
}
|
@@ -62,7 +62,7 @@ const isStreamingSSR = (userConfig) => {
|
|
62
62
|
return false;
|
63
63
|
};
|
64
64
|
function applyAsyncChunkHtmlPlugin({ chain, modernConfig, HtmlBundlerPlugin }) {
|
65
|
-
if (isStreamingSSR(modernConfig)) {
|
65
|
+
if (isStreamingSSR(modernConfig) || isUseRsc(modernConfig)) {
|
66
66
|
chain.plugin("html-async-chunk").use(HtmlAsyncChunkPlugin, [
|
67
67
|
HtmlBundlerPlugin
|
68
68
|
]);
|
@@ -3,11 +3,15 @@ const inspect = async (api, options) => {
|
|
3
3
|
if (!appContext.builder) {
|
4
4
|
throw new Error("Expect the Builder to have been initialized, But the appContext.builder received `undefined`");
|
5
5
|
}
|
6
|
+
const metaName = appContext.metaName === "modern-js" ? "modern.js" : appContext.metaName;
|
6
7
|
return appContext.builder.inspectConfig({
|
7
8
|
mode: options.env,
|
8
9
|
verbose: options.verbose,
|
9
10
|
outputPath: options.output,
|
10
|
-
writeToDisk: true
|
11
|
+
writeToDisk: true,
|
12
|
+
extraConfigs: {
|
13
|
+
[metaName]: api.getNormalizedConfig()
|
14
|
+
}
|
11
15
|
});
|
12
16
|
};
|
13
17
|
export {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.68.
|
18
|
+
"version": "2.68.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -85,7 +85,7 @@
|
|
85
85
|
"@babel/parser": "^7.22.15",
|
86
86
|
"@babel/traverse": "^7.23.2",
|
87
87
|
"@babel/types": "^7.26.0",
|
88
|
-
"@rsbuild/core": "1.4.
|
88
|
+
"@rsbuild/core": "1.4.4",
|
89
89
|
"@rsbuild/plugin-node-polyfill": "1.3.0",
|
90
90
|
"@swc/helpers": "^0.5.17",
|
91
91
|
"es-module-lexer": "^1.1.0",
|
@@ -94,22 +94,22 @@
|
|
94
94
|
"flatted": "^3.3.3",
|
95
95
|
"mlly": "^1.7.4",
|
96
96
|
"ndepe": "^0.1.12",
|
97
|
-
"pkg-types": "^1.1
|
97
|
+
"pkg-types": "^1.3.1",
|
98
98
|
"std-env": "^3.7.0",
|
99
|
-
"@modern-js/core": "2.68.
|
100
|
-
"@modern-js/
|
101
|
-
"@modern-js/
|
102
|
-
"@modern-js/plugin-data-loader": "2.68.
|
103
|
-
"@modern-js/plugin-i18n": "2.68.
|
104
|
-
"@modern-js/plugin-v2": "2.68.
|
105
|
-
"@modern-js/prod-server": "2.68.
|
106
|
-
"@modern-js/rsbuild-plugin-esbuild": "2.68.
|
107
|
-
"@modern-js/server": "2.68.
|
108
|
-
"@modern-js/server
|
109
|
-
"@modern-js/server-utils": "2.68.
|
110
|
-
"@modern-js/
|
111
|
-
"@modern-js/
|
112
|
-
"@modern-js/utils": "2.68.
|
99
|
+
"@modern-js/core": "2.68.1",
|
100
|
+
"@modern-js/node-bundle-require": "2.68.1",
|
101
|
+
"@modern-js/plugin": "2.68.1",
|
102
|
+
"@modern-js/plugin-data-loader": "2.68.1",
|
103
|
+
"@modern-js/plugin-i18n": "2.68.1",
|
104
|
+
"@modern-js/plugin-v2": "2.68.1",
|
105
|
+
"@modern-js/prod-server": "2.68.1",
|
106
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.68.1",
|
107
|
+
"@modern-js/server-core": "2.68.1",
|
108
|
+
"@modern-js/server": "2.68.1",
|
109
|
+
"@modern-js/server-utils": "2.68.1",
|
110
|
+
"@modern-js/uni-builder": "2.68.1",
|
111
|
+
"@modern-js/types": "2.68.1",
|
112
|
+
"@modern-js/utils": "2.68.1"
|
113
113
|
},
|
114
114
|
"devDependencies": {
|
115
115
|
"@rsbuild/plugin-webpack-swc": "1.1.1",
|