@modern-js/app-tools 2.64.3-alpha.0 → 2.64.3
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 +2 -3
- package/dist/cjs/builder/shared/builderPlugins/index.js +1 -3
- package/dist/esm/builder/generator/index.js +3 -4
- package/dist/esm/builder/shared/builderPlugins/index.js +0 -1
- package/dist/esm-node/builder/generator/index.js +2 -3
- package/dist/esm-node/builder/shared/builderPlugins/index.js +0 -1
- package/dist/types/builder/shared/builderPlugins/index.d.ts +0 -1
- package/package.json +7 -6
- package/dist/cjs/builder/shared/builderPlugins/builderHooks.js +0 -50
- package/dist/esm/builder/shared/builderPlugins/builderHooks.js +0 -120
- package/dist/esm-node/builder/shared/builderPlugins/builderHooks.js +0 -26
- package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +0 -4
@@ -53,12 +53,11 @@ async function generateBuilder(options, bundlerType) {
|
|
53
53
|
return builder;
|
54
54
|
}
|
55
55
|
async function applyBuilderPlugins(builder, options) {
|
56
|
-
const { builderPluginAdapterBasic, builderPluginAdapterHtml, builderPluginAdapterSSR
|
56
|
+
const { builderPluginAdapterBasic, builderPluginAdapterHtml, builderPluginAdapterSSR } = await import("../shared/builderPlugins/index.js");
|
57
57
|
builder.addPlugins([
|
58
58
|
builderPluginAdapterBasic(),
|
59
59
|
builderPluginAdapterSSR(options),
|
60
|
-
builderPluginAdapterHtml(options)
|
61
|
-
builderHookPlugin(options)
|
60
|
+
builderPluginAdapterHtml(options)
|
62
61
|
]);
|
63
62
|
builder.addPlugins([
|
64
63
|
(0, import_adapterCopy.builderPluginAdapterCopy)(options)
|
@@ -18,11 +18,9 @@ module.exports = __toCommonJS(builderPlugins_exports);
|
|
18
18
|
__reExport(builderPlugins_exports, require("./adapterBasic"), module.exports);
|
19
19
|
__reExport(builderPlugins_exports, require("./adapterHtml"), module.exports);
|
20
20
|
__reExport(builderPlugins_exports, require("./adapterSSR"), module.exports);
|
21
|
-
__reExport(builderPlugins_exports, require("./builderHooks"), module.exports);
|
22
21
|
// Annotate the CommonJS export names for ESM import in node:
|
23
22
|
0 && (module.exports = {
|
24
23
|
...require("./adapterBasic"),
|
25
24
|
...require("./adapterHtml"),
|
26
|
-
...require("./adapterSSR")
|
27
|
-
...require("./builderHooks")
|
25
|
+
...require("./adapterSSR")
|
28
26
|
});
|
@@ -51,7 +51,7 @@ function applyBuilderPlugins(builder, options) {
|
|
51
51
|
}
|
52
52
|
function _applyBuilderPlugins() {
|
53
53
|
_applyBuilderPlugins = _async_to_generator(function(builder, options) {
|
54
|
-
var _ref, builderPluginAdapterBasic, builderPluginAdapterHtml, builderPluginAdapterSSR,
|
54
|
+
var _ref, builderPluginAdapterBasic, builderPluginAdapterHtml, builderPluginAdapterSSR, normalizedConfig, pluginNodePolyfill;
|
55
55
|
return _ts_generator(this, function(_state) {
|
56
56
|
switch (_state.label) {
|
57
57
|
case 0:
|
@@ -60,12 +60,11 @@ function _applyBuilderPlugins() {
|
|
60
60
|
import("../shared/builderPlugins/index.js")
|
61
61
|
];
|
62
62
|
case 1:
|
63
|
-
_ref = _state.sent(), builderPluginAdapterBasic = _ref.builderPluginAdapterBasic, builderPluginAdapterHtml = _ref.builderPluginAdapterHtml, builderPluginAdapterSSR = _ref.builderPluginAdapterSSR
|
63
|
+
_ref = _state.sent(), builderPluginAdapterBasic = _ref.builderPluginAdapterBasic, builderPluginAdapterHtml = _ref.builderPluginAdapterHtml, builderPluginAdapterSSR = _ref.builderPluginAdapterSSR;
|
64
64
|
builder.addPlugins([
|
65
65
|
builderPluginAdapterBasic(),
|
66
66
|
builderPluginAdapterSSR(options),
|
67
|
-
builderPluginAdapterHtml(options)
|
68
|
-
builderHookPlugin(options)
|
67
|
+
builderPluginAdapterHtml(options)
|
69
68
|
]);
|
70
69
|
builder.addPlugins([
|
71
70
|
builderPluginAdapterCopy(options)
|
@@ -20,12 +20,11 @@ async function generateBuilder(options, bundlerType) {
|
|
20
20
|
return builder;
|
21
21
|
}
|
22
22
|
async function applyBuilderPlugins(builder, options) {
|
23
|
-
const { builderPluginAdapterBasic, builderPluginAdapterHtml, builderPluginAdapterSSR
|
23
|
+
const { builderPluginAdapterBasic, builderPluginAdapterHtml, builderPluginAdapterSSR } = await import("../shared/builderPlugins/index.js");
|
24
24
|
builder.addPlugins([
|
25
25
|
builderPluginAdapterBasic(),
|
26
26
|
builderPluginAdapterSSR(options),
|
27
|
-
builderPluginAdapterHtml(options)
|
28
|
-
builderHookPlugin(options)
|
27
|
+
builderPluginAdapterHtml(options)
|
29
28
|
]);
|
30
29
|
builder.addPlugins([
|
31
30
|
builderPluginAdapterCopy(options)
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.64.3
|
18
|
+
"version": "2.64.3",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -92,19 +92,19 @@
|
|
92
92
|
"pkg-types": "^1.1.0",
|
93
93
|
"std-env": "^3.7.0",
|
94
94
|
"@modern-js/core": "2.64.3",
|
95
|
+
"@modern-js/node-bundle-require": "2.64.3",
|
95
96
|
"@modern-js/plugin": "2.64.3",
|
97
|
+
"@modern-js/plugin-data-loader": "2.64.3",
|
96
98
|
"@modern-js/plugin-i18n": "2.64.3",
|
97
99
|
"@modern-js/plugin-v2": "2.64.3",
|
98
100
|
"@modern-js/prod-server": "2.64.3",
|
99
101
|
"@modern-js/server": "2.64.3",
|
100
102
|
"@modern-js/rsbuild-plugin-esbuild": "2.64.3",
|
101
|
-
"@modern-js/node-bundle-require": "2.64.3",
|
102
103
|
"@modern-js/server-core": "2.64.3",
|
103
104
|
"@modern-js/server-utils": "2.64.3",
|
104
|
-
"@modern-js/uni-builder": "2.64.3",
|
105
105
|
"@modern-js/types": "2.64.3",
|
106
|
-
"@modern-js/
|
107
|
-
"@modern-js/
|
106
|
+
"@modern-js/uni-builder": "2.64.3",
|
107
|
+
"@modern-js/utils": "2.64.3"
|
108
108
|
},
|
109
109
|
"devDependencies": {
|
110
110
|
"@rsbuild/plugin-webpack-swc": "1.0.9",
|
@@ -134,7 +134,8 @@
|
|
134
134
|
"sideEffects": false,
|
135
135
|
"publishConfig": {
|
136
136
|
"registry": "https://registry.npmjs.org/",
|
137
|
-
"access": "public"
|
137
|
+
"access": "public",
|
138
|
+
"provenance": true
|
138
139
|
},
|
139
140
|
"scripts": {
|
140
141
|
"new": "modern-lib new",
|
@@ -1,50 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var builderHooks_exports = {};
|
20
|
-
__export(builderHooks_exports, {
|
21
|
-
builderHookPlugin: () => builderHookPlugin
|
22
|
-
});
|
23
|
-
module.exports = __toCommonJS(builderHooks_exports);
|
24
|
-
const builderHookPlugin = (options) => ({
|
25
|
-
name: "builder-plugin-support-modern-hooks",
|
26
|
-
setup(api) {
|
27
|
-
var _internalContext_pluginAPI;
|
28
|
-
const _internalContext = options.appContext._internalContext;
|
29
|
-
const hooks = (_internalContext_pluginAPI = _internalContext.pluginAPI) === null || _internalContext_pluginAPI === void 0 ? void 0 : _internalContext_pluginAPI.getHooks();
|
30
|
-
api.modifyBundlerChain(async (chain, utils) => {
|
31
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyBundlerChain.call(chain, utils));
|
32
|
-
});
|
33
|
-
api.modifyRsbuildConfig(async (config, utils) => {
|
34
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyRsbuildConfig.call(config, utils));
|
35
|
-
});
|
36
|
-
api.modifyRspackConfig(async (config, utils) => {
|
37
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyRspackConfig.call(config, utils));
|
38
|
-
});
|
39
|
-
api.modifyWebpackChain(async (chain, utils) => {
|
40
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyWebpackChain.call(chain, utils));
|
41
|
-
});
|
42
|
-
api.modifyWebpackConfig(async (config, utils) => {
|
43
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyWebpackConfig.call(config, utils));
|
44
|
-
});
|
45
|
-
}
|
46
|
-
});
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
48
|
-
0 && (module.exports = {
|
49
|
-
builderHookPlugin
|
50
|
-
});
|
@@ -1,120 +0,0 @@
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
2
|
-
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
3
|
-
var builderHookPlugin = function(options) {
|
4
|
-
return {
|
5
|
-
name: "builder-plugin-support-modern-hooks",
|
6
|
-
setup: function setup(api) {
|
7
|
-
var _internalContext_pluginAPI;
|
8
|
-
var _internalContext = options.appContext._internalContext;
|
9
|
-
var hooks = (_internalContext_pluginAPI = _internalContext.pluginAPI) === null || _internalContext_pluginAPI === void 0 ? void 0 : _internalContext_pluginAPI.getHooks();
|
10
|
-
api.modifyBundlerChain(function() {
|
11
|
-
var _ref = _async_to_generator(function(chain, utils) {
|
12
|
-
return _ts_generator(this, function(_state) {
|
13
|
-
switch (_state.label) {
|
14
|
-
case 0:
|
15
|
-
return [
|
16
|
-
4,
|
17
|
-
hooks === null || hooks === void 0 ? void 0 : hooks.modifyBundlerChain.call(chain, utils)
|
18
|
-
];
|
19
|
-
case 1:
|
20
|
-
_state.sent();
|
21
|
-
return [
|
22
|
-
2
|
23
|
-
];
|
24
|
-
}
|
25
|
-
});
|
26
|
-
});
|
27
|
-
return function(chain, utils) {
|
28
|
-
return _ref.apply(this, arguments);
|
29
|
-
};
|
30
|
-
}());
|
31
|
-
api.modifyRsbuildConfig(function() {
|
32
|
-
var _ref = _async_to_generator(function(config, utils) {
|
33
|
-
return _ts_generator(this, function(_state) {
|
34
|
-
switch (_state.label) {
|
35
|
-
case 0:
|
36
|
-
return [
|
37
|
-
4,
|
38
|
-
hooks === null || hooks === void 0 ? void 0 : hooks.modifyRsbuildConfig.call(config, utils)
|
39
|
-
];
|
40
|
-
case 1:
|
41
|
-
_state.sent();
|
42
|
-
return [
|
43
|
-
2
|
44
|
-
];
|
45
|
-
}
|
46
|
-
});
|
47
|
-
});
|
48
|
-
return function(config, utils) {
|
49
|
-
return _ref.apply(this, arguments);
|
50
|
-
};
|
51
|
-
}());
|
52
|
-
api.modifyRspackConfig(function() {
|
53
|
-
var _ref = _async_to_generator(function(config, utils) {
|
54
|
-
return _ts_generator(this, function(_state) {
|
55
|
-
switch (_state.label) {
|
56
|
-
case 0:
|
57
|
-
return [
|
58
|
-
4,
|
59
|
-
hooks === null || hooks === void 0 ? void 0 : hooks.modifyRspackConfig.call(config, utils)
|
60
|
-
];
|
61
|
-
case 1:
|
62
|
-
_state.sent();
|
63
|
-
return [
|
64
|
-
2
|
65
|
-
];
|
66
|
-
}
|
67
|
-
});
|
68
|
-
});
|
69
|
-
return function(config, utils) {
|
70
|
-
return _ref.apply(this, arguments);
|
71
|
-
};
|
72
|
-
}());
|
73
|
-
api.modifyWebpackChain(function() {
|
74
|
-
var _ref = _async_to_generator(function(chain, utils) {
|
75
|
-
return _ts_generator(this, function(_state) {
|
76
|
-
switch (_state.label) {
|
77
|
-
case 0:
|
78
|
-
return [
|
79
|
-
4,
|
80
|
-
hooks === null || hooks === void 0 ? void 0 : hooks.modifyWebpackChain.call(chain, utils)
|
81
|
-
];
|
82
|
-
case 1:
|
83
|
-
_state.sent();
|
84
|
-
return [
|
85
|
-
2
|
86
|
-
];
|
87
|
-
}
|
88
|
-
});
|
89
|
-
});
|
90
|
-
return function(chain, utils) {
|
91
|
-
return _ref.apply(this, arguments);
|
92
|
-
};
|
93
|
-
}());
|
94
|
-
api.modifyWebpackConfig(function() {
|
95
|
-
var _ref = _async_to_generator(function(config, utils) {
|
96
|
-
return _ts_generator(this, function(_state) {
|
97
|
-
switch (_state.label) {
|
98
|
-
case 0:
|
99
|
-
return [
|
100
|
-
4,
|
101
|
-
hooks === null || hooks === void 0 ? void 0 : hooks.modifyWebpackConfig.call(config, utils)
|
102
|
-
];
|
103
|
-
case 1:
|
104
|
-
_state.sent();
|
105
|
-
return [
|
106
|
-
2
|
107
|
-
];
|
108
|
-
}
|
109
|
-
});
|
110
|
-
});
|
111
|
-
return function(config, utils) {
|
112
|
-
return _ref.apply(this, arguments);
|
113
|
-
};
|
114
|
-
}());
|
115
|
-
}
|
116
|
-
};
|
117
|
-
};
|
118
|
-
export {
|
119
|
-
builderHookPlugin
|
120
|
-
};
|
@@ -1,26 +0,0 @@
|
|
1
|
-
const builderHookPlugin = (options) => ({
|
2
|
-
name: "builder-plugin-support-modern-hooks",
|
3
|
-
setup(api) {
|
4
|
-
var _internalContext_pluginAPI;
|
5
|
-
const _internalContext = options.appContext._internalContext;
|
6
|
-
const hooks = (_internalContext_pluginAPI = _internalContext.pluginAPI) === null || _internalContext_pluginAPI === void 0 ? void 0 : _internalContext_pluginAPI.getHooks();
|
7
|
-
api.modifyBundlerChain(async (chain, utils) => {
|
8
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyBundlerChain.call(chain, utils));
|
9
|
-
});
|
10
|
-
api.modifyRsbuildConfig(async (config, utils) => {
|
11
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyRsbuildConfig.call(config, utils));
|
12
|
-
});
|
13
|
-
api.modifyRspackConfig(async (config, utils) => {
|
14
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyRspackConfig.call(config, utils));
|
15
|
-
});
|
16
|
-
api.modifyWebpackChain(async (chain, utils) => {
|
17
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyWebpackChain.call(chain, utils));
|
18
|
-
});
|
19
|
-
api.modifyWebpackConfig(async (config, utils) => {
|
20
|
-
await (hooks === null || hooks === void 0 ? void 0 : hooks.modifyWebpackConfig.call(config, utils));
|
21
|
-
});
|
22
|
-
}
|
23
|
-
});
|
24
|
-
export {
|
25
|
-
builderHookPlugin
|
26
|
-
};
|