@modern-js/app-tools 2.68.5 → 2.68.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.
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var run_exports = {};
30
30
  __export(run_exports, {
31
+ createRunOptions: () => createRunOptions,
31
32
  run: () => run
32
33
  });
33
34
  module.exports = __toCommonJS(run_exports);
@@ -40,7 +41,7 @@ var import_constants = require("../constants");
40
41
  var import_getConfigFile = require("../utils/getConfigFile");
41
42
  var import_getUserConfig = require("../utils/getUserConfig");
42
43
  var import_loadPlugins = require("../utils/loadPlugins");
43
- async function run({ cwd, initialLog, metaName = "modern-js", version, internalPlugins, packageJsonConfig = import_constants.PACKAGE_JSON_CONFIG_NAME, statePluginName = import_constants.STATE_PLUGIN_NAME, configFile }) {
44
+ async function createRunOptions({ cwd, initialLog, metaName = "modern-js", version, internalPlugins, packageJsonConfig = import_constants.PACKAGE_JSON_CONFIG_NAME, statePluginName = import_constants.STATE_PLUGIN_NAME, configFile }) {
44
45
  var _userConfig_runtime, _userConfig_runtime1, _userConfig_runtime_state, _userConfig_runtime2;
45
46
  const nodeVersion = process.versions.node;
46
47
  const versionArr = nodeVersion.split(".").map(Number);
@@ -117,7 +118,7 @@ export default defineConfig({
117
118
  `)}`);
118
119
  }
119
120
  }
120
- await (0, import_run.run)({
121
+ return {
121
122
  cwd,
122
123
  initialLog: initialLog || `Modern.js Framework v${version}`,
123
124
  configFile: finalConfigFile,
@@ -125,9 +126,14 @@ export default defineConfig({
125
126
  packageJsonConfig,
126
127
  internalPlugins: plugins,
127
128
  handleSetupResult: import_hooks.handleSetupResult
128
- });
129
+ };
130
+ }
131
+ async function run(options) {
132
+ const runOptions = await createRunOptions(options);
133
+ await (0, import_run.run)(runOptions);
129
134
  }
130
135
  // Annotate the CommonJS export names for ESM import in node:
131
136
  0 && (module.exports = {
137
+ createRunOptions,
132
138
  run
133
139
  });
@@ -10,11 +10,11 @@ import { PACKAGE_JSON_CONFIG_NAME, STATE_PLUGIN_NAME } from "../constants";
10
10
  import { getConfigFile } from "../utils/getConfigFile";
11
11
  import { getUserConfig } from "../utils/getUserConfig";
12
12
  import { loadInternalPlugins } from "../utils/loadPlugins";
13
- function run(_) {
14
- return _run.apply(this, arguments);
13
+ function createRunOptions(_) {
14
+ return _createRunOptions.apply(this, arguments);
15
15
  }
16
- function _run() {
17
- _run = _async_to_generator(function(param) {
16
+ function _createRunOptions() {
17
+ _createRunOptions = _async_to_generator(function(param) {
18
18
  var cwd, initialLog, _param_metaName, metaName, version, internalPlugins, _param_packageJsonConfig, packageJsonConfig, _param_statePluginName, statePluginName, configFile, _userConfig_runtime, _userConfig_runtime1, _userConfig_runtime_state, _userConfig_runtime2, nodeVersion, versionArr, command, cliParams, SUPPORT_CONFIG_PARAM_COMMANDS, customConfigFile, appDirectory, finalConfigFile, userConfig, plugins;
19
19
  return _ts_generator(this, function(_state) {
20
20
  switch (_state.label) {
@@ -83,8 +83,8 @@ function _run() {
83
83
  }
84
84
  }
85
85
  return [
86
- 4,
87
- CLIPluginRun({
86
+ 2,
87
+ {
88
88
  cwd,
89
89
  initialLog: initialLog || "Modern.js Framework v".concat(version),
90
90
  configFile: finalConfigFile,
@@ -92,9 +92,33 @@ function _run() {
92
92
  packageJsonConfig,
93
93
  internalPlugins: plugins,
94
94
  handleSetupResult
95
- })
95
+ }
96
+ ];
97
+ }
98
+ });
99
+ });
100
+ return _createRunOptions.apply(this, arguments);
101
+ }
102
+ function run(options) {
103
+ return _run.apply(this, arguments);
104
+ }
105
+ function _run() {
106
+ _run = _async_to_generator(function(options) {
107
+ var runOptions;
108
+ return _ts_generator(this, function(_state) {
109
+ switch (_state.label) {
110
+ case 0:
111
+ return [
112
+ 4,
113
+ createRunOptions(options)
96
114
  ];
97
- case 4:
115
+ case 1:
116
+ runOptions = _state.sent();
117
+ return [
118
+ 4,
119
+ CLIPluginRun(runOptions)
120
+ ];
121
+ case 2:
98
122
  _state.sent();
99
123
  return [
100
124
  2
@@ -105,5 +129,6 @@ function _run() {
105
129
  return _run.apply(this, arguments);
106
130
  }
107
131
  export {
132
+ createRunOptions,
108
133
  run
109
134
  };
@@ -7,7 +7,7 @@ import { PACKAGE_JSON_CONFIG_NAME, STATE_PLUGIN_NAME } from "../constants";
7
7
  import { getConfigFile } from "../utils/getConfigFile";
8
8
  import { getUserConfig } from "../utils/getUserConfig";
9
9
  import { loadInternalPlugins } from "../utils/loadPlugins";
10
- async function run({ cwd, initialLog, metaName = "modern-js", version, internalPlugins, packageJsonConfig = PACKAGE_JSON_CONFIG_NAME, statePluginName = STATE_PLUGIN_NAME, configFile }) {
10
+ async function createRunOptions({ cwd, initialLog, metaName = "modern-js", version, internalPlugins, packageJsonConfig = PACKAGE_JSON_CONFIG_NAME, statePluginName = STATE_PLUGIN_NAME, configFile }) {
11
11
  var _userConfig_runtime, _userConfig_runtime1, _userConfig_runtime_state, _userConfig_runtime2;
12
12
  const nodeVersion = process.versions.node;
13
13
  const versionArr = nodeVersion.split(".").map(Number);
@@ -84,7 +84,7 @@ export default defineConfig({
84
84
  `)}`);
85
85
  }
86
86
  }
87
- await CLIPluginRun({
87
+ return {
88
88
  cwd,
89
89
  initialLog: initialLog || `Modern.js Framework v${version}`,
90
90
  configFile: finalConfigFile,
@@ -92,8 +92,13 @@ export default defineConfig({
92
92
  packageJsonConfig,
93
93
  internalPlugins: plugins,
94
94
  handleSetupResult
95
- });
95
+ };
96
+ }
97
+ async function run(options) {
98
+ const runOptions = await createRunOptions(options);
99
+ await CLIPluginRun(runOptions);
96
100
  }
97
101
  export {
102
+ createRunOptions,
98
103
  run
99
104
  };
@@ -1,4 +1,5 @@
1
1
  import type { InternalPlugins } from '@modern-js/types';
2
+ import { handleSetupResult } from '../compat/hooks';
2
3
  export interface RunOptions {
3
4
  cwd?: string;
4
5
  configFile?: string;
@@ -12,4 +13,13 @@ export interface RunOptions {
12
13
  initialLog?: string;
13
14
  version: string;
14
15
  }
15
- export declare function run({ cwd, initialLog, metaName, version, internalPlugins, packageJsonConfig, statePluginName, configFile, }: RunOptions): Promise<void>;
16
+ export declare function createRunOptions({ cwd, initialLog, metaName, version, internalPlugins, packageJsonConfig, statePluginName, configFile, }: RunOptions): Promise<{
17
+ cwd: string | undefined;
18
+ initialLog: string;
19
+ configFile: string;
20
+ metaName: string;
21
+ packageJsonConfig: string;
22
+ internalPlugins: import("@modern-js/plugin-v2").Plugin[];
23
+ handleSetupResult: typeof handleSetupResult;
24
+ }>;
25
+ export declare function run(options: RunOptions): Promise<void>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.68.5",
18
+ "version": "2.68.6",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -85,8 +85,8 @@
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.10",
89
- "@rsbuild/plugin-node-polyfill": "1.3.2",
88
+ "@rsbuild/core": "1.4.11",
89
+ "@rsbuild/plugin-node-polyfill": "1.4.0",
90
90
  "@swc/helpers": "^0.5.17",
91
91
  "es-module-lexer": "^1.1.0",
92
92
  "esbuild": "0.25.5",
@@ -96,20 +96,20 @@
96
96
  "ndepe": "^0.1.12",
97
97
  "pkg-types": "^1.3.1",
98
98
  "std-env": "^3.7.0",
99
- "@modern-js/core": "2.68.5",
100
- "@modern-js/plugin": "2.68.5",
101
- "@modern-js/node-bundle-require": "2.68.5",
102
- "@modern-js/plugin-data-loader": "2.68.5",
103
- "@modern-js/plugin-i18n": "2.68.5",
104
- "@modern-js/plugin-v2": "2.68.5",
105
- "@modern-js/prod-server": "2.68.5",
106
- "@modern-js/rsbuild-plugin-esbuild": "2.68.5",
107
- "@modern-js/server": "2.68.5",
108
- "@modern-js/server-core": "2.68.5",
109
- "@modern-js/types": "2.68.5",
110
- "@modern-js/server-utils": "2.68.5",
111
- "@modern-js/uni-builder": "2.68.5",
112
- "@modern-js/utils": "2.68.5"
99
+ "@modern-js/core": "2.68.6",
100
+ "@modern-js/node-bundle-require": "2.68.6",
101
+ "@modern-js/plugin": "2.68.6",
102
+ "@modern-js/plugin-data-loader": "2.68.6",
103
+ "@modern-js/plugin-i18n": "2.68.6",
104
+ "@modern-js/plugin-v2": "2.68.6",
105
+ "@modern-js/prod-server": "2.68.6",
106
+ "@modern-js/rsbuild-plugin-esbuild": "2.68.6",
107
+ "@modern-js/server": "2.68.6",
108
+ "@modern-js/server-utils": "2.68.6",
109
+ "@modern-js/server-core": "2.68.6",
110
+ "@modern-js/types": "2.68.6",
111
+ "@modern-js/uni-builder": "2.68.6",
112
+ "@modern-js/utils": "2.68.6"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@rsbuild/plugin-webpack-swc": "1.1.1",