@modern-js/app-tools 2.63.4 → 2.63.6
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/compat/hooks.js +1 -4
- package/dist/cjs/compat/utils.js +2 -1
- package/dist/cjs/index.js +0 -1
- package/dist/esm/compat/hooks.js +1 -9
- package/dist/esm/compat/utils.js +2 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm-node/compat/hooks.js +1 -4
- package/dist/esm-node/compat/utils.js +2 -1
- package/dist/esm-node/index.js +0 -1
- package/dist/types/compat/utils.d.ts +1 -1
- package/dist/types/types/new.d.ts +0 -3
- package/package.json +19 -19
package/dist/cjs/compat/hooks.js
CHANGED
@@ -30,9 +30,6 @@ function getHookRunners(context) {
|
|
30
30
|
/**
|
31
31
|
* app tools hooks
|
32
32
|
*/
|
33
|
-
beforeConfig: async () => {
|
34
|
-
return hooks.onBeforeConfig.call();
|
35
|
-
},
|
36
33
|
afterPrepare: async () => {
|
37
34
|
return hooks.onAfterPrepare.call();
|
38
35
|
},
|
@@ -167,7 +164,7 @@ function handleSetupResult(setupResult, api) {
|
|
167
164
|
const fn = setupResult[key];
|
168
165
|
if (typeof fn === "function") {
|
169
166
|
const newAPI = (0, import_utils.transformHookRunner)(key);
|
170
|
-
if (api[newAPI]) {
|
167
|
+
if (newAPI && api[newAPI]) {
|
171
168
|
api[newAPI](async (...params) => {
|
172
169
|
const { isMultiple, params: transformParams } = (0, import_utils.transformHookParams)(key, params);
|
173
170
|
if (isMultiple) {
|
package/dist/cjs/compat/utils.js
CHANGED
@@ -27,7 +27,8 @@ var import_getHtmlTemplate = require("../plugins/analyze/getHtmlTemplate");
|
|
27
27
|
function transformHookRunner(hookRunnerName) {
|
28
28
|
switch (hookRunnerName) {
|
29
29
|
case "beforeConfig":
|
30
|
-
|
30
|
+
console.error("The `beforeConfig` hook has been deprecated. Please define your code directly in the setup function instead.");
|
31
|
+
return void 0;
|
31
32
|
case "prepare":
|
32
33
|
return "onPrepare";
|
33
34
|
case "afterPrepare":
|
package/dist/cjs/index.js
CHANGED
@@ -91,7 +91,6 @@ const appTools = (options = {
|
|
91
91
|
"@modern-js/plugin-polyfill"
|
92
92
|
],
|
93
93
|
registryHooks: {
|
94
|
-
onBeforeConfig: (0, import_plugin_v2.createAsyncHook)(),
|
95
94
|
onAfterPrepare: (0, import_plugin_v2.createAsyncHook)(),
|
96
95
|
deploy: (0, import_plugin_v2.createAsyncHook)(),
|
97
96
|
_internalRuntimePlugins: (0, import_plugin_v2.createAsyncHook)(),
|
package/dist/esm/compat/hooks.js
CHANGED
@@ -9,14 +9,6 @@ function getHookRunners(context) {
|
|
9
9
|
/**
|
10
10
|
* app tools hooks
|
11
11
|
*/
|
12
|
-
beforeConfig: /* @__PURE__ */ _async_to_generator(function() {
|
13
|
-
return _ts_generator(this, function(_state) {
|
14
|
-
return [
|
15
|
-
2,
|
16
|
-
hooks.onBeforeConfig.call()
|
17
|
-
];
|
18
|
-
});
|
19
|
-
}),
|
20
12
|
afterPrepare: /* @__PURE__ */ _async_to_generator(function() {
|
21
13
|
return _ts_generator(this, function(_state) {
|
22
14
|
return [
|
@@ -449,7 +441,7 @@ function handleSetupResult(setupResult, api) {
|
|
449
441
|
var fn = setupResult[key];
|
450
442
|
if (typeof fn === "function") {
|
451
443
|
var newAPI = transformHookRunner(key);
|
452
|
-
if (api[newAPI]) {
|
444
|
+
if (newAPI && api[newAPI]) {
|
453
445
|
api[newAPI](/* @__PURE__ */ _async_to_generator(function() {
|
454
446
|
var _len, params, _key, _transformHookParams, isMultiple, transformParams, _tmp, _tmp1;
|
455
447
|
var _arguments = arguments;
|
package/dist/esm/compat/utils.js
CHANGED
@@ -2,7 +2,8 @@ import { getModifyHtmlPartials } from "../plugins/analyze/getHtmlTemplate";
|
|
2
2
|
function transformHookRunner(hookRunnerName) {
|
3
3
|
switch (hookRunnerName) {
|
4
4
|
case "beforeConfig":
|
5
|
-
|
5
|
+
console.error("The `beforeConfig` hook has been deprecated. Please define your code directly in the setup function instead.");
|
6
|
+
return void 0;
|
6
7
|
case "prepare":
|
7
8
|
return "onPrepare";
|
8
9
|
case "afterPrepare":
|
package/dist/esm/index.js
CHANGED
@@ -6,9 +6,6 @@ function getHookRunners(context) {
|
|
6
6
|
/**
|
7
7
|
* app tools hooks
|
8
8
|
*/
|
9
|
-
beforeConfig: async () => {
|
10
|
-
return hooks.onBeforeConfig.call();
|
11
|
-
},
|
12
9
|
afterPrepare: async () => {
|
13
10
|
return hooks.onAfterPrepare.call();
|
14
11
|
},
|
@@ -143,7 +140,7 @@ function handleSetupResult(setupResult, api) {
|
|
143
140
|
const fn = setupResult[key];
|
144
141
|
if (typeof fn === "function") {
|
145
142
|
const newAPI = transformHookRunner(key);
|
146
|
-
if (api[newAPI]) {
|
143
|
+
if (newAPI && api[newAPI]) {
|
147
144
|
api[newAPI](async (...params) => {
|
148
145
|
const { isMultiple, params: transformParams } = transformHookParams(key, params);
|
149
146
|
if (isMultiple) {
|
@@ -2,7 +2,8 @@ import { getModifyHtmlPartials } from "../plugins/analyze/getHtmlTemplate";
|
|
2
2
|
function transformHookRunner(hookRunnerName) {
|
3
3
|
switch (hookRunnerName) {
|
4
4
|
case "beforeConfig":
|
5
|
-
|
5
|
+
console.error("The `beforeConfig` hook has been deprecated. Please define your code directly in the setup function instead.");
|
6
|
+
return void 0;
|
6
7
|
case "prepare":
|
7
8
|
return "onPrepare";
|
8
9
|
case "afterPrepare":
|
package/dist/esm-node/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Maps old plugin hook function names to new plugin API names
|
3
3
|
*/
|
4
|
-
export declare function transformHookRunner(hookRunnerName: string): string;
|
4
|
+
export declare function transformHookRunner(hookRunnerName: string): string | undefined;
|
5
5
|
/**
|
6
6
|
* Note:
|
7
7
|
* isMultiple Indicates whether the function parameter represents multiple values.
|
@@ -7,7 +7,6 @@ import type { getHookRunners } from '../compat/hooks';
|
|
7
7
|
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
8
8
|
import type { RuntimePlugin } from './hooks';
|
9
9
|
import type { Bundler } from './utils';
|
10
|
-
export type BeforeConfigFn = () => Promise<void> | void;
|
11
10
|
export type AfterPrepareFn = () => Promise<void> | void;
|
12
11
|
export type InternalRuntimePluginsFn = TransformFunction<{
|
13
12
|
entrypoint: Entrypoint;
|
@@ -45,7 +44,6 @@ export type RegisterDevFn = () => Promise<DevToolData> | DevToolData;
|
|
45
44
|
export type RegisterBuildPlatformFn = () => Promise<RegisterBuildPlatformResult> | RegisterBuildPlatformResult;
|
46
45
|
export type AddRuntimeExportsFn = () => Promise<void> | void;
|
47
46
|
export interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
48
|
-
onBeforeConfig: PluginHookTap<BeforeConfigFn>;
|
49
47
|
onAfterPrepare: PluginHookTap<AfterPrepareFn>;
|
50
48
|
deploy: PluginHookTap<DeplpoyFn>;
|
51
49
|
_internalRuntimePlugins: PluginHookTap<InternalRuntimePluginsFn>;
|
@@ -90,7 +88,6 @@ export interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
|
90
88
|
useHookRunners: () => ReturnType<typeof getHookRunners>;
|
91
89
|
}
|
92
90
|
export interface AppToolsExtendHooks extends Record<string, PluginHook<(...args: any[]) => any>> {
|
93
|
-
onBeforeConfig: AsyncHook<BeforeConfigFn>;
|
94
91
|
onAfterPrepare: AsyncHook<AfterPrepareFn>;
|
95
92
|
deploy: AsyncHook<DeplpoyFn>;
|
96
93
|
_internalRuntimePlugins: AsyncHook<InternalRuntimePluginsFn>;
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.63.
|
18
|
+
"version": "2.63.6",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"@babel/parser": "^7.22.15",
|
81
81
|
"@babel/traverse": "^7.23.2",
|
82
82
|
"@babel/types": "^7.26.0",
|
83
|
-
"@rsbuild/core": "1.1.
|
83
|
+
"@rsbuild/core": "1.1.13",
|
84
84
|
"@rsbuild/plugin-node-polyfill": "1.2.0",
|
85
85
|
"@swc/helpers": "0.5.13",
|
86
86
|
"@vercel/nft": "^0.26.4",
|
@@ -90,22 +90,22 @@
|
|
90
90
|
"flatted": "^3.2.9",
|
91
91
|
"mlly": "^1.6.1",
|
92
92
|
"pkg-types": "^1.1.0",
|
93
|
-
"ndepe": "0.1.
|
93
|
+
"ndepe": "0.1.5",
|
94
94
|
"std-env": "^3.7.0",
|
95
|
-
"@modern-js/core": "2.63.
|
96
|
-
"@modern-js/node-bundle-require": "2.63.
|
97
|
-
"@modern-js/plugin": "2.63.
|
98
|
-
"@modern-js/plugin-data-loader": "2.63.
|
99
|
-
"@modern-js/plugin-i18n": "2.63.
|
100
|
-
"@modern-js/plugin-v2": "2.63.
|
101
|
-
"@modern-js/prod-server": "2.63.
|
102
|
-
"@modern-js/rsbuild-plugin-esbuild": "2.63.
|
103
|
-
"@modern-js/server": "2.63.
|
104
|
-
"@modern-js/
|
105
|
-
"@modern-js/server-
|
106
|
-
"@modern-js/
|
107
|
-
"@modern-js/uni-builder": "2.63.
|
108
|
-
"@modern-js/utils": "2.63.
|
95
|
+
"@modern-js/core": "2.63.6",
|
96
|
+
"@modern-js/node-bundle-require": "2.63.6",
|
97
|
+
"@modern-js/plugin": "2.63.6",
|
98
|
+
"@modern-js/plugin-data-loader": "2.63.6",
|
99
|
+
"@modern-js/plugin-i18n": "2.63.6",
|
100
|
+
"@modern-js/plugin-v2": "2.63.6",
|
101
|
+
"@modern-js/prod-server": "2.63.6",
|
102
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.63.6",
|
103
|
+
"@modern-js/server": "2.63.6",
|
104
|
+
"@modern-js/server-core": "2.63.6",
|
105
|
+
"@modern-js/server-utils": "2.63.6",
|
106
|
+
"@modern-js/types": "2.63.6",
|
107
|
+
"@modern-js/uni-builder": "2.63.6",
|
108
|
+
"@modern-js/utils": "2.63.6"
|
109
109
|
},
|
110
110
|
"devDependencies": {
|
111
111
|
"@rsbuild/plugin-webpack-swc": "1.0.9",
|
@@ -117,8 +117,8 @@
|
|
117
117
|
"tsconfig-paths": "^4.2.0",
|
118
118
|
"typescript": "^5",
|
119
119
|
"webpack": "^5.97.1",
|
120
|
-
"@scripts/build": "2.63.
|
121
|
-
"@scripts/jest-config": "2.63.
|
120
|
+
"@scripts/build": "2.63.6",
|
121
|
+
"@scripts/jest-config": "2.63.6"
|
122
122
|
},
|
123
123
|
"peerDependencies": {
|
124
124
|
"ts-node": "^10.7.0",
|