@modern-js/app-tools 3.0.2 → 3.0.4
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.
|
@@ -26,6 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
default: ()=>analyze
|
|
28
28
|
});
|
|
29
|
+
const types_namespaceObject = require("node:util/types");
|
|
29
30
|
const external_path_namespaceObject = require("path");
|
|
30
31
|
const utils_namespaceObject = require("@modern-js/utils");
|
|
31
32
|
const index_js_namespaceObject = require("../../builder/index.js");
|
|
@@ -198,7 +199,16 @@ const analyze = ()=>({
|
|
|
198
199
|
port
|
|
199
200
|
});
|
|
200
201
|
});
|
|
201
|
-
|
|
202
|
+
const getFlattenedPlugins = async (pluginOptions)=>{
|
|
203
|
+
let plugins = pluginOptions;
|
|
204
|
+
do plugins = (await Promise.all(plugins)).flat(1 / 0);
|
|
205
|
+
while (plugins.some((v)=>(0, types_namespaceObject.isPromise)(v)));
|
|
206
|
+
return plugins;
|
|
207
|
+
};
|
|
208
|
+
if (resolvedConfig.builderPlugins) {
|
|
209
|
+
const plugins = await getFlattenedPlugins(resolvedConfig.builderPlugins);
|
|
210
|
+
builder.addPlugins(plugins);
|
|
211
|
+
}
|
|
202
212
|
api.updateAppContext({
|
|
203
213
|
builder
|
|
204
214
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPromise } from "node:util/types";
|
|
1
2
|
import { extname, resolve } from "path";
|
|
2
3
|
import { createDebugger, fs, getArgv, getMeta, isApiOnly, isDevCommand, minimist } from "@modern-js/utils";
|
|
3
4
|
import { createBuilderGenerator } from "../../builder/index.mjs";
|
|
@@ -170,7 +171,16 @@ const analyze = ()=>({
|
|
|
170
171
|
port
|
|
171
172
|
});
|
|
172
173
|
});
|
|
173
|
-
|
|
174
|
+
const getFlattenedPlugins = async (pluginOptions)=>{
|
|
175
|
+
let plugins = pluginOptions;
|
|
176
|
+
do plugins = (await Promise.all(plugins)).flat(1 / 0);
|
|
177
|
+
while (plugins.some((v)=>isPromise(v)));
|
|
178
|
+
return plugins;
|
|
179
|
+
};
|
|
180
|
+
if (resolvedConfig.builderPlugins) {
|
|
181
|
+
const plugins = await getFlattenedPlugins(resolvedConfig.builderPlugins);
|
|
182
|
+
builder.addPlugins(plugins);
|
|
183
|
+
}
|
|
174
184
|
api.updateAppContext({
|
|
175
185
|
builder
|
|
176
186
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
+
import { isPromise } from "node:util/types";
|
|
2
3
|
import { extname, resolve } from "path";
|
|
3
4
|
import { createDebugger, fs, getArgv, getMeta, isApiOnly, isDevCommand, minimist } from "@modern-js/utils";
|
|
4
5
|
import { createBuilderGenerator } from "../../builder/index.mjs";
|
|
@@ -171,7 +172,16 @@ const analyze = ()=>({
|
|
|
171
172
|
port
|
|
172
173
|
});
|
|
173
174
|
});
|
|
174
|
-
|
|
175
|
+
const getFlattenedPlugins = async (pluginOptions)=>{
|
|
176
|
+
let plugins = pluginOptions;
|
|
177
|
+
do plugins = (await Promise.all(plugins)).flat(1 / 0);
|
|
178
|
+
while (plugins.some((v)=>isPromise(v)));
|
|
179
|
+
return plugins;
|
|
180
|
+
};
|
|
181
|
+
if (resolvedConfig.builderPlugins) {
|
|
182
|
+
const plugins = await getFlattenedPlugins(resolvedConfig.builderPlugins);
|
|
183
|
+
builder.addPlugins(plugins);
|
|
184
|
+
}
|
|
175
185
|
api.updateAppContext({
|
|
176
186
|
builder
|
|
177
187
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RsbuildPlugins } from '@modern-js/builder';
|
|
2
2
|
import type { CLIPlugin, CLIPluginExtends } from '@modern-js/plugin';
|
|
3
3
|
import type { BffUserConfig, ServerUserConfig } from '@modern-js/server-core';
|
|
4
4
|
import type { RsbuildConfig } from '@rsbuild/core';
|
|
@@ -33,7 +33,7 @@ export interface AppToolsUserConfig {
|
|
|
33
33
|
tools?: ToolsUserConfig;
|
|
34
34
|
security?: SecurityUserConfig;
|
|
35
35
|
testing?: TestingUserConfig;
|
|
36
|
-
builderPlugins?:
|
|
36
|
+
builderPlugins?: RsbuildPlugins;
|
|
37
37
|
performance?: PerformanceUserConfig;
|
|
38
38
|
environments?: RsbuildConfig['environments'];
|
|
39
39
|
splitChunks?: RsbuildConfig['splitChunks'];
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.0.
|
|
18
|
+
"version": "3.0.4",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -93,19 +93,19 @@
|
|
|
93
93
|
"ndepe": "^0.1.13",
|
|
94
94
|
"pkg-types": "^1.3.1",
|
|
95
95
|
"std-env": "^3.10.0",
|
|
96
|
-
"@modern-js/builder": "3.0.
|
|
97
|
-
"@modern-js/i18n-utils": "3.0.
|
|
98
|
-
"@modern-js/plugin": "3.0.
|
|
99
|
-
"@modern-js/plugin
|
|
100
|
-
"@modern-js/
|
|
101
|
-
"@modern-js/server-core": "3.0.
|
|
102
|
-
"@modern-js/server": "3.0.
|
|
103
|
-
"@modern-js/server-utils": "3.0.
|
|
104
|
-
"@modern-js/
|
|
105
|
-
"@modern-js/
|
|
96
|
+
"@modern-js/builder": "3.0.4",
|
|
97
|
+
"@modern-js/i18n-utils": "3.0.4",
|
|
98
|
+
"@modern-js/plugin-data-loader": "3.0.4",
|
|
99
|
+
"@modern-js/plugin": "3.0.4",
|
|
100
|
+
"@modern-js/server": "3.0.4",
|
|
101
|
+
"@modern-js/server-core": "3.0.4",
|
|
102
|
+
"@modern-js/prod-server": "3.0.4",
|
|
103
|
+
"@modern-js/server-utils": "3.0.4",
|
|
104
|
+
"@modern-js/types": "3.0.4",
|
|
105
|
+
"@modern-js/utils": "3.0.4"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@rslib/core": "0.19.
|
|
108
|
+
"@rslib/core": "0.19.6",
|
|
109
109
|
"@types/babel__traverse": "7.28.0",
|
|
110
110
|
"@types/node": "^20",
|
|
111
111
|
"ts-node": "^10.9.2",
|