@modern-js/app-tools 2.65.2 → 2.65.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.
@@ -90,7 +90,9 @@ const build = async (api, options) => {
90
90
  if (!appContext.builder) {
91
91
  throw new Error("Expect the Builder to have been initialized, But the appContext.builder received `undefined`");
92
92
  }
93
- await appContext.builder.build();
93
+ await appContext.builder.build({
94
+ watch: options === null || options === void 0 ? void 0 : options.watch
95
+ });
94
96
  };
95
97
  // Annotate the CommonJS export names for ESM import in node:
96
98
  0 && (module.exports = {
@@ -65,7 +65,7 @@ const devCommand = async (program, api) => {
65
65
  const buildCommand = async (program, api) => {
66
66
  const hooks = api.getHooks();
67
67
  const platformBuilders = await hooks.registerBuildPlatform.call();
68
- const buildProgram = program.command("build").usage("[options]").description(import_locale.i18n.t(import_locale.localeKeys.command.build.describe)).option("-c --config <config>", import_locale.i18n.t(import_locale.localeKeys.command.shared.config)).option("--analyze", import_locale.i18n.t(import_locale.localeKeys.command.shared.analyze)).action(async (options) => {
68
+ const buildProgram = program.command("build").usage("[options]").description(import_locale.i18n.t(import_locale.localeKeys.command.build.describe)).option("-c --config <config>", import_locale.i18n.t(import_locale.localeKeys.command.shared.config)).option("--analyze", import_locale.i18n.t(import_locale.localeKeys.command.shared.analyze)).option("-w --watch", import_locale.i18n.t(import_locale.localeKeys.command.build.watch)).action(async (options) => {
69
69
  const { build } = await import("./build.js");
70
70
  await build(api, options);
71
71
  });
@@ -38,7 +38,8 @@ const EN_LOCALE = {
38
38
  requireEntry: "You must choose at least one entry"
39
39
  },
40
40
  build: {
41
- describe: "build the app for production"
41
+ describe: "build the app for production",
42
+ watch: "turn on watch mode, watch for changes and rebuild"
42
43
  },
43
44
  serve: {
44
45
  describe: "preview the production build locally"
@@ -38,7 +38,8 @@ const ZH_LOCALE = {
38
38
  requireEntry: "请至少选择一个入口"
39
39
  },
40
40
  build: {
41
- describe: "构建生产环境产物"
41
+ describe: "构建生产环境产物",
42
+ watch: "开启 watch 模式, 监听文件变更并重新构建"
42
43
  },
43
44
  serve: {
44
45
  describe: "启动生产环境服务"
@@ -120,7 +120,9 @@ var build = function() {
120
120
  }
121
121
  return [
122
122
  4,
123
- appContext.builder.build()
123
+ appContext.builder.build({
124
+ watch: options === null || options === void 0 ? void 0 : options.watch
125
+ })
124
126
  ];
125
127
  case 12:
126
128
  _state.sent();
@@ -140,7 +140,7 @@ var buildCommand = function() {
140
140
  ];
141
141
  case 1:
142
142
  platformBuilders = _state.sent();
143
- buildProgram = program.command("build").usage("[options]").description(i18n.t(localeKeys.command.build.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).action(function() {
143
+ buildProgram = program.command("build").usage("[options]").description(i18n.t(localeKeys.command.build.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).option("-w --watch", i18n.t(localeKeys.command.build.watch)).action(function() {
144
144
  var _ref2 = _async_to_generator(function(options) {
145
145
  var build;
146
146
  return _ts_generator(this, function(_state2) {
@@ -15,7 +15,8 @@ var EN_LOCALE = {
15
15
  requireEntry: "You must choose at least one entry"
16
16
  },
17
17
  build: {
18
- describe: "build the app for production"
18
+ describe: "build the app for production",
19
+ watch: "turn on watch mode, watch for changes and rebuild"
19
20
  },
20
21
  serve: {
21
22
  describe: "preview the production build locally"
@@ -15,7 +15,8 @@ var ZH_LOCALE = {
15
15
  requireEntry: "请至少选择一个入口"
16
16
  },
17
17
  build: {
18
- describe: "构建生产环境产物"
18
+ describe: "构建生产环境产物",
19
+ watch: "开启 watch 模式, 监听文件变更并重新构建"
19
20
  },
20
21
  serve: {
21
22
  describe: "启动生产环境服务"
@@ -57,7 +57,9 @@ const build = async (api, options) => {
57
57
  if (!appContext.builder) {
58
58
  throw new Error("Expect the Builder to have been initialized, But the appContext.builder received `undefined`");
59
59
  }
60
- await appContext.builder.build();
60
+ await appContext.builder.build({
61
+ watch: options === null || options === void 0 ? void 0 : options.watch
62
+ });
61
63
  };
62
64
  export {
63
65
  build
@@ -26,7 +26,7 @@ const devCommand = async (program, api) => {
26
26
  const buildCommand = async (program, api) => {
27
27
  const hooks = api.getHooks();
28
28
  const platformBuilders = await hooks.registerBuildPlatform.call();
29
- const buildProgram = program.command("build").usage("[options]").description(i18n.t(localeKeys.command.build.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).action(async (options) => {
29
+ const buildProgram = program.command("build").usage("[options]").description(i18n.t(localeKeys.command.build.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).option("-w --watch", i18n.t(localeKeys.command.build.watch)).action(async (options) => {
30
30
  const { build } = await import("./build.js");
31
31
  await build(api, options);
32
32
  });
@@ -15,7 +15,8 @@ const EN_LOCALE = {
15
15
  requireEntry: "You must choose at least one entry"
16
16
  },
17
17
  build: {
18
- describe: "build the app for production"
18
+ describe: "build the app for production",
19
+ watch: "turn on watch mode, watch for changes and rebuild"
19
20
  },
20
21
  serve: {
21
22
  describe: "preview the production build locally"
@@ -15,7 +15,8 @@ const ZH_LOCALE = {
15
15
  requireEntry: "请至少选择一个入口"
16
16
  },
17
17
  build: {
18
- describe: "构建生产环境产物"
18
+ describe: "构建生产环境产物",
19
+ watch: "开启 watch 模式, 监听文件变更并重新构建"
19
20
  },
20
21
  serve: {
21
22
  describe: "启动生产环境服务"
@@ -16,6 +16,7 @@ export declare const EN_LOCALE: {
16
16
  };
17
17
  build: {
18
18
  describe: string;
19
+ watch: string;
19
20
  };
20
21
  serve: {
21
22
  describe: string;
@@ -18,6 +18,7 @@ declare const localeKeys: {
18
18
  };
19
19
  build: {
20
20
  describe: string;
21
+ watch: string;
21
22
  };
22
23
  serve: {
23
24
  describe: string;
@@ -57,6 +58,7 @@ declare const localeKeys: {
57
58
  };
58
59
  build: {
59
60
  describe: string;
61
+ watch: string;
60
62
  };
61
63
  serve: {
62
64
  describe: string;
@@ -16,6 +16,7 @@ export declare const ZH_LOCALE: {
16
16
  };
17
17
  build: {
18
18
  describe: string;
19
+ watch: string;
19
20
  };
20
21
  serve: {
21
22
  describe: string;
@@ -7,6 +7,7 @@ export type DevOptions = {
7
7
  export type BuildOptions = {
8
8
  config?: string;
9
9
  analyze?: boolean;
10
+ watch?: boolean;
10
11
  };
11
12
  export type DeployOptions = {
12
13
  config?: string;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.65.2",
18
+ "version": "2.65.4",
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.2.8",
83
+ "@rsbuild/core": "1.2.18",
84
84
  "@rsbuild/plugin-node-polyfill": "1.3.0",
85
85
  "@swc/helpers": "0.5.13",
86
86
  "es-module-lexer": "^1.1.0",
@@ -91,23 +91,23 @@
91
91
  "ndepe": "0.1.5",
92
92
  "pkg-types": "^1.1.0",
93
93
  "std-env": "^3.7.0",
94
- "@modern-js/core": "2.65.2",
95
- "@modern-js/node-bundle-require": "2.65.2",
96
- "@modern-js/plugin": "2.65.2",
97
- "@modern-js/plugin-data-loader": "2.65.2",
98
- "@modern-js/plugin-i18n": "2.65.2",
99
- "@modern-js/plugin-v2": "2.65.2",
100
- "@modern-js/prod-server": "2.65.2",
101
- "@modern-js/rsbuild-plugin-esbuild": "2.65.2",
102
- "@modern-js/server": "2.65.2",
103
- "@modern-js/server-core": "2.65.2",
104
- "@modern-js/server-utils": "2.65.2",
105
- "@modern-js/types": "2.65.2",
106
- "@modern-js/uni-builder": "2.65.2",
107
- "@modern-js/utils": "2.65.2"
94
+ "@modern-js/core": "2.65.4",
95
+ "@modern-js/node-bundle-require": "2.65.4",
96
+ "@modern-js/plugin": "2.65.4",
97
+ "@modern-js/plugin-v2": "2.65.4",
98
+ "@modern-js/plugin-data-loader": "2.65.4",
99
+ "@modern-js/prod-server": "2.65.4",
100
+ "@modern-js/plugin-i18n": "2.65.4",
101
+ "@modern-js/rsbuild-plugin-esbuild": "2.65.4",
102
+ "@modern-js/server": "2.65.4",
103
+ "@modern-js/server-core": "2.65.4",
104
+ "@modern-js/server-utils": "2.65.4",
105
+ "@modern-js/types": "2.65.4",
106
+ "@modern-js/uni-builder": "2.65.4",
107
+ "@modern-js/utils": "2.65.4"
108
108
  },
109
109
  "devDependencies": {
110
- "@rsbuild/plugin-webpack-swc": "1.0.9",
110
+ "@rsbuild/plugin-webpack-swc": "1.0.12",
111
111
  "@types/babel__traverse": "7.20.6",
112
112
  "@types/jest": "^29",
113
113
  "@types/node": "^16",
@@ -116,8 +116,8 @@
116
116
  "tsconfig-paths": "^4.2.0",
117
117
  "typescript": "^5",
118
118
  "webpack": "^5.98.0",
119
- "@scripts/build": "2.65.2",
120
- "@scripts/jest-config": "2.65.2"
119
+ "@scripts/build": "2.65.4",
120
+ "@scripts/jest-config": "2.65.4"
121
121
  },
122
122
  "peerDependencies": {
123
123
  "ts-node": "^10.7.0",