@modern-js/app-tools 2.68.10 → 2.68.12

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.
@@ -44,23 +44,18 @@ const build = async (api, options) => {
44
44
  const resolvedConfig = api.getNormalizedConfig();
45
45
  const appContext = api.getAppContext();
46
46
  const hooks = api.getHooks();
47
+ var _resolvedConfig_resolve_alias, _resolvedConfig_source_alias;
48
+ const combinedAlias = [].concat((_resolvedConfig_resolve_alias = resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias) !== null && _resolvedConfig_resolve_alias !== void 0 ? _resolvedConfig_resolve_alias : []).concat((_resolvedConfig_source_alias = resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias) !== null && _resolvedConfig_source_alias !== void 0 ? _resolvedConfig_source_alias : []);
47
49
  await (0, import_loadPlugins.loadServerPlugins)(api, appContext.appDirectory, appContext.metaName);
48
50
  if (appContext.moduleType && appContext.moduleType === "module") {
49
- var _resolvedConfig_resolve1, _resolvedConfig_source1;
50
51
  const { registerEsm } = await import("../esm/register-esm.mjs");
51
52
  await registerEsm({
52
53
  appDir: appContext.appDirectory,
53
54
  distDir: appContext.distDirectory,
54
- alias: {
55
- ...(_resolvedConfig_resolve1 = resolvedConfig.resolve) === null || _resolvedConfig_resolve1 === void 0 ? void 0 : _resolvedConfig_resolve1.alias,
56
- ...(_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
57
- }
55
+ alias: combinedAlias
58
56
  });
59
57
  }
60
- await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, {
61
- ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias,
62
- ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias
63
- });
58
+ await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, combinedAlias);
64
59
  const { apiOnly } = appContext;
65
60
  if (apiOnly) {
66
61
  const { appDirectory: appDirectory2, distDirectory: distDirectory2, serverConfigFile: serverConfigFile2 } = appContext;
@@ -42,29 +42,24 @@ var import_printInstructions = require("../utils/printInstructions");
42
42
  var import_register = require("../utils/register");
43
43
  var import_routes = require("../utils/routes");
44
44
  const dev = async (api, options, devServerOptions) => {
45
- var _normalizedConfig_source, _normalizedConfig_resolve, _normalizedConfig_tools, _normalizedConfig_dev;
45
+ var _normalizedConfig_resolve, _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev;
46
46
  if (options.analyze) {
47
47
  process.env.BUNDLE_ANALYZE = "true";
48
48
  }
49
49
  const normalizedConfig = api.getNormalizedConfig();
50
50
  const appContext = api.getAppContext();
51
51
  const hooks = api.getHooks();
52
+ var _normalizedConfig_resolve_alias, _normalizedConfig_source_alias;
53
+ const combinedAlias = [].concat((_normalizedConfig_resolve_alias = normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias) !== null && _normalizedConfig_resolve_alias !== void 0 ? _normalizedConfig_resolve_alias : []).concat((_normalizedConfig_source_alias = normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias) !== null && _normalizedConfig_source_alias !== void 0 ? _normalizedConfig_source_alias : []);
52
54
  if (appContext.moduleType && appContext.moduleType === "module") {
53
- var _normalizedConfig_resolve1, _normalizedConfig_source1;
54
55
  const { registerEsm } = await import("../esm/register-esm.mjs");
55
56
  await registerEsm({
56
57
  appDir: appContext.appDirectory,
57
58
  distDir: appContext.distDirectory,
58
- alias: {
59
- ...(_normalizedConfig_resolve1 = normalizedConfig.resolve) === null || _normalizedConfig_resolve1 === void 0 ? void 0 : _normalizedConfig_resolve1.alias,
60
- ...(_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
61
- }
59
+ alias: combinedAlias
62
60
  });
63
61
  }
64
- await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, {
65
- ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias,
66
- ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias
67
- });
62
+ await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, combinedAlias);
68
63
  const { appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes } = appContext;
69
64
  await (0, import_config.buildServerConfig)({
70
65
  appDirectory,
@@ -1,5 +1,4 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
- import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
4
3
  import { logger } from "@modern-js/utils";
5
4
  import { buildServerConfig } from "../utils/config";
@@ -8,7 +7,7 @@ import { registerCompiler } from "../utils/register";
8
7
  import { generateRoutes } from "../utils/routes";
9
8
  var build = function() {
10
9
  var _ref = _async_to_generator(function(api, options) {
11
- var _resolvedConfig_resolve, _resolvedConfig_source, resolvedConfig, appContext, hooks, _resolvedConfig_resolve1, _resolvedConfig_source1, registerEsm, apiOnly, appDirectory, distDirectory, serverConfigFile, distDirectory1, appDirectory1, serverConfigFile1;
10
+ var _resolvedConfig_resolve, _resolvedConfig_source, resolvedConfig, appContext, hooks, _resolvedConfig_resolve_alias, _resolvedConfig_source_alias, combinedAlias, registerEsm, apiOnly, appDirectory, distDirectory, serverConfigFile, distDirectory1, appDirectory1, serverConfigFile1;
12
11
  return _ts_generator(this, function(_state) {
13
12
  switch (_state.label) {
14
13
  case 0:
@@ -18,6 +17,7 @@ var build = function() {
18
17
  resolvedConfig = api.getNormalizedConfig();
19
18
  appContext = api.getAppContext();
20
19
  hooks = api.getHooks();
20
+ combinedAlias = [].concat((_resolvedConfig_resolve_alias = resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias) !== null && _resolvedConfig_resolve_alias !== void 0 ? _resolvedConfig_resolve_alias : []).concat((_resolvedConfig_source_alias = resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias) !== null && _resolvedConfig_source_alias !== void 0 ? _resolvedConfig_source_alias : []);
21
21
  return [
22
22
  4,
23
23
  loadServerPlugins(api, appContext.appDirectory, appContext.metaName)
@@ -40,7 +40,7 @@ var build = function() {
40
40
  registerEsm({
41
41
  appDir: appContext.appDirectory,
42
42
  distDir: appContext.distDirectory,
43
- alias: _object_spread({}, (_resolvedConfig_resolve1 = resolvedConfig.resolve) === null || _resolvedConfig_resolve1 === void 0 ? void 0 : _resolvedConfig_resolve1.alias, (_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias)
43
+ alias: combinedAlias
44
44
  })
45
45
  ];
46
46
  case 3:
@@ -49,7 +49,7 @@ var build = function() {
49
49
  case 4:
50
50
  return [
51
51
  4,
52
- registerCompiler(appContext.appDirectory, appContext.distDirectory, _object_spread({}, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias))
52
+ registerCompiler(appContext.appDirectory, appContext.distDirectory, combinedAlias)
53
53
  ];
54
54
  case 5:
55
55
  _state.sent();
@@ -14,7 +14,7 @@ import { registerCompiler } from "../utils/register";
14
14
  import { generateRoutes } from "../utils/routes";
15
15
  var dev = function() {
16
16
  var _ref = _async_to_generator(function(api, options, devServerOptions) {
17
- var _normalizedConfig_source, _normalizedConfig_resolve, _normalizedConfig_tools, _normalizedConfig_dev, normalizedConfig, appContext, hooks, _normalizedConfig_resolve1, _normalizedConfig_source1, registerEsm, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes, meta, serverConfigPath, pluginInstances, toolsDevServerConfig, _normalizedConfig_dev_host, _normalizedConfig_dev_https, _normalizedConfig_dev_hmr, _normalizedConfig_dev_setupMiddlewares, serverOptions, host, server, _ref2, server1, afterListen;
17
+ var _normalizedConfig_resolve, _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev, normalizedConfig, appContext, hooks, _normalizedConfig_resolve_alias, _normalizedConfig_source_alias, combinedAlias, registerEsm, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes, meta, serverConfigPath, pluginInstances, toolsDevServerConfig, _normalizedConfig_dev_host, _normalizedConfig_dev_https, _normalizedConfig_dev_hmr, _normalizedConfig_dev_setupMiddlewares, serverOptions, host, server, _ref2, server1, afterListen;
18
18
  return _ts_generator(this, function(_state) {
19
19
  switch (_state.label) {
20
20
  case 0:
@@ -24,6 +24,7 @@ var dev = function() {
24
24
  normalizedConfig = api.getNormalizedConfig();
25
25
  appContext = api.getAppContext();
26
26
  hooks = api.getHooks();
27
+ combinedAlias = [].concat((_normalizedConfig_resolve_alias = normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias) !== null && _normalizedConfig_resolve_alias !== void 0 ? _normalizedConfig_resolve_alias : []).concat((_normalizedConfig_source_alias = normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias) !== null && _normalizedConfig_source_alias !== void 0 ? _normalizedConfig_source_alias : []);
27
28
  if (!(appContext.moduleType && appContext.moduleType === "module"))
28
29
  return [
29
30
  3,
@@ -40,7 +41,7 @@ var dev = function() {
40
41
  registerEsm({
41
42
  appDir: appContext.appDirectory,
42
43
  distDir: appContext.distDirectory,
43
- alias: _object_spread({}, (_normalizedConfig_resolve1 = normalizedConfig.resolve) === null || _normalizedConfig_resolve1 === void 0 ? void 0 : _normalizedConfig_resolve1.alias, (_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias)
44
+ alias: combinedAlias
44
45
  })
45
46
  ];
46
47
  case 2:
@@ -49,7 +50,7 @@ var dev = function() {
49
50
  case 3:
50
51
  return [
51
52
  4,
52
- registerCompiler(appContext.appDirectory, appContext.distDirectory, _object_spread({}, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias))
53
+ registerCompiler(appContext.appDirectory, appContext.distDirectory, combinedAlias)
53
54
  ];
54
55
  case 4:
55
56
  _state.sent();
@@ -11,23 +11,18 @@ const build = async (api, options) => {
11
11
  const resolvedConfig = api.getNormalizedConfig();
12
12
  const appContext = api.getAppContext();
13
13
  const hooks = api.getHooks();
14
+ var _resolvedConfig_resolve_alias, _resolvedConfig_source_alias;
15
+ const combinedAlias = [].concat((_resolvedConfig_resolve_alias = resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias) !== null && _resolvedConfig_resolve_alias !== void 0 ? _resolvedConfig_resolve_alias : []).concat((_resolvedConfig_source_alias = resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias) !== null && _resolvedConfig_source_alias !== void 0 ? _resolvedConfig_source_alias : []);
14
16
  await loadServerPlugins(api, appContext.appDirectory, appContext.metaName);
15
17
  if (appContext.moduleType && appContext.moduleType === "module") {
16
- var _resolvedConfig_resolve1, _resolvedConfig_source1;
17
18
  const { registerEsm } = await import("../esm/register-esm.mjs");
18
19
  await registerEsm({
19
20
  appDir: appContext.appDirectory,
20
21
  distDir: appContext.distDirectory,
21
- alias: {
22
- ...(_resolvedConfig_resolve1 = resolvedConfig.resolve) === null || _resolvedConfig_resolve1 === void 0 ? void 0 : _resolvedConfig_resolve1.alias,
23
- ...(_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
24
- }
22
+ alias: combinedAlias
25
23
  });
26
24
  }
27
- await registerCompiler(appContext.appDirectory, appContext.distDirectory, {
28
- ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias,
29
- ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias
30
- });
25
+ await registerCompiler(appContext.appDirectory, appContext.distDirectory, combinedAlias);
31
26
  const { apiOnly } = appContext;
32
27
  if (apiOnly) {
33
28
  const { appDirectory: appDirectory2, distDirectory: distDirectory2, serverConfigFile: serverConfigFile2 } = appContext;
@@ -9,29 +9,24 @@ import { printInstructions } from "../utils/printInstructions";
9
9
  import { registerCompiler } from "../utils/register";
10
10
  import { generateRoutes } from "../utils/routes";
11
11
  const dev = async (api, options, devServerOptions) => {
12
- var _normalizedConfig_source, _normalizedConfig_resolve, _normalizedConfig_tools, _normalizedConfig_dev;
12
+ var _normalizedConfig_resolve, _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev;
13
13
  if (options.analyze) {
14
14
  process.env.BUNDLE_ANALYZE = "true";
15
15
  }
16
16
  const normalizedConfig = api.getNormalizedConfig();
17
17
  const appContext = api.getAppContext();
18
18
  const hooks = api.getHooks();
19
+ var _normalizedConfig_resolve_alias, _normalizedConfig_source_alias;
20
+ const combinedAlias = [].concat((_normalizedConfig_resolve_alias = normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias) !== null && _normalizedConfig_resolve_alias !== void 0 ? _normalizedConfig_resolve_alias : []).concat((_normalizedConfig_source_alias = normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias) !== null && _normalizedConfig_source_alias !== void 0 ? _normalizedConfig_source_alias : []);
19
21
  if (appContext.moduleType && appContext.moduleType === "module") {
20
- var _normalizedConfig_resolve1, _normalizedConfig_source1;
21
22
  const { registerEsm } = await import("../esm/register-esm.mjs");
22
23
  await registerEsm({
23
24
  appDir: appContext.appDirectory,
24
25
  distDir: appContext.distDirectory,
25
- alias: {
26
- ...(_normalizedConfig_resolve1 = normalizedConfig.resolve) === null || _normalizedConfig_resolve1 === void 0 ? void 0 : _normalizedConfig_resolve1.alias,
27
- ...(_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
28
- }
26
+ alias: combinedAlias
29
27
  });
30
28
  }
31
- await registerCompiler(appContext.appDirectory, appContext.distDirectory, {
32
- ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias,
33
- ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias
34
- });
29
+ await registerCompiler(appContext.appDirectory, appContext.distDirectory, combinedAlias);
35
30
  const { appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes } = appContext;
36
31
  await buildServerConfig({
37
32
  appDirectory,
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.68.10",
18
+ "version": "2.68.12",
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.15",
89
- "@rsbuild/plugin-node-polyfill": "1.4.1",
88
+ "@rsbuild/core": "1.5.3",
89
+ "@rsbuild/plugin-node-polyfill": "1.4.2",
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.10",
100
- "@modern-js/node-bundle-require": "2.68.10",
101
- "@modern-js/plugin": "2.68.10",
102
- "@modern-js/plugin-data-loader": "2.68.10",
103
- "@modern-js/plugin-i18n": "2.68.10",
104
- "@modern-js/plugin-v2": "2.68.10",
105
- "@modern-js/prod-server": "2.68.10",
106
- "@modern-js/rsbuild-plugin-esbuild": "2.68.10",
107
- "@modern-js/server": "2.68.10",
108
- "@modern-js/server-core": "2.68.10",
109
- "@modern-js/server-utils": "2.68.10",
110
- "@modern-js/types": "2.68.10",
111
- "@modern-js/utils": "2.68.10",
112
- "@modern-js/uni-builder": "2.68.10"
99
+ "@modern-js/core": "2.68.12",
100
+ "@modern-js/node-bundle-require": "2.68.12",
101
+ "@modern-js/plugin": "2.68.12",
102
+ "@modern-js/plugin-data-loader": "2.68.12",
103
+ "@modern-js/plugin-i18n": "2.68.12",
104
+ "@modern-js/plugin-v2": "2.68.12",
105
+ "@modern-js/prod-server": "2.68.12",
106
+ "@modern-js/rsbuild-plugin-esbuild": "2.68.12",
107
+ "@modern-js/server-core": "2.68.12",
108
+ "@modern-js/server": "2.68.12",
109
+ "@modern-js/server-utils": "2.68.12",
110
+ "@modern-js/types": "2.68.12",
111
+ "@modern-js/uni-builder": "2.68.12",
112
+ "@modern-js/utils": "2.68.12"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@rsbuild/plugin-webpack-swc": "1.1.2",
@@ -120,7 +120,7 @@
120
120
  "ts-node": "^10.9.1",
121
121
  "tsconfig-paths": "^4.2.0",
122
122
  "typescript": "^5",
123
- "webpack": "^5.101.0",
123
+ "webpack": "^5.101.3",
124
124
  "@scripts/build": "2.66.0",
125
125
  "@scripts/jest-config": "2.66.0"
126
126
  },