@modern-js/app-tools 1.6.3 → 1.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,107 @@
1
1
  # @modern-js/app-tools
2
2
 
3
+ ## 1.6.6
4
+
5
+ ### Patch Changes
6
+
7
+ - a1198d509: feat: bump babel 7.18.0
8
+ - d12686040: feat(app-tools): support dev --analyze
9
+ - 8ee2b1b29: fix: remove some unnecessary logs during dev
10
+ - 8f7c0f898: feat(app-tools): support specify config file in build and deploy command
11
+ - Updated dependencies [8d508c6ed]
12
+ - Updated dependencies [0eff2473c]
13
+ - Updated dependencies [a1198d509]
14
+ - Updated dependencies [29728812e]
15
+ - Updated dependencies [f25d6a62e]
16
+ - Updated dependencies [a18926bbd]
17
+ - Updated dependencies [c7e38b4e6]
18
+ - Updated dependencies [147e090f7]
19
+ - Updated dependencies [18892c65c]
20
+ - Updated dependencies [a1198d509]
21
+ - Updated dependencies [8f7c0f898]
22
+ - @modern-js/core@1.11.2
23
+ - @modern-js/webpack@1.10.0
24
+ - @modern-js/server@1.4.18
25
+ - @modern-js/i18n-cli-language-detector@1.2.4
26
+ - @modern-js/plugin-analyze@1.4.6
27
+ - @modern-js/plugin-i18n@1.2.7
28
+ - @modern-js/new-action@1.3.10
29
+ - @modern-js/prod-server@1.1.8
30
+ - @modern-js/node-bundle-require@1.3.5
31
+ - @modern-js/plugin@1.3.6
32
+
33
+ ## 1.6.5
34
+
35
+ ### Patch Changes
36
+
37
+ - da65bf12: chore: merge plugin-fast-refresh into webpack
38
+ - 437367c6: fix(server): hmr not working when using proxy
39
+ - 7394df61: feat: prebundle @loadable/webpack-plugin and fix peer deps warning
40
+ - Updated dependencies [5f7fccf0]
41
+ - Updated dependencies [02b0a22e]
42
+ - Updated dependencies [f730081c]
43
+ - Updated dependencies [d1ab1f05]
44
+ - Updated dependencies [da65bf12]
45
+ - Updated dependencies [2ec8181a]
46
+ - Updated dependencies [8854c600]
47
+ - Updated dependencies [f7cbc771]
48
+ - Updated dependencies [6451a098]
49
+ - Updated dependencies [cdc2df9c]
50
+ - Updated dependencies [f5c48c3f]
51
+ - Updated dependencies [b39b399e]
52
+ - Updated dependencies [192dbc78]
53
+ - Updated dependencies [430d417e]
54
+ - Updated dependencies [658b4dd5]
55
+ - Updated dependencies [7fcfd6cc]
56
+ - Updated dependencies [d5a2cfd8]
57
+ - Updated dependencies [45d5643a]
58
+ - Updated dependencies [0d161fa8]
59
+ - Updated dependencies [437367c6]
60
+ - Updated dependencies [280eebf9]
61
+ - Updated dependencies [2ba8d62f]
62
+ - Updated dependencies [7394df61]
63
+ - @modern-js/webpack@1.9.0
64
+ - @modern-js/core@1.11.1
65
+ - @modern-js/server@1.4.16
66
+ - @modern-js/utils@1.7.6
67
+ - @modern-js/types@1.5.4
68
+ - @modern-js/prod-server@1.1.6
69
+ - @modern-js/plugin-analyze@1.4.5
70
+
71
+ ## 1.6.4
72
+
73
+ ### Patch Changes
74
+
75
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
76
+ - Updated dependencies [d2995e7d7]
77
+ - Updated dependencies [47934c4da]
78
+ - Updated dependencies [d5913bd96]
79
+ - Updated dependencies [d32f35134]
80
+ - Updated dependencies [43d9bb5fa]
81
+ - Updated dependencies [b1f7d2aa6]
82
+ - Updated dependencies [86fe5a657]
83
+ - Updated dependencies [d9d398e16]
84
+ - Updated dependencies [97086dde8]
85
+ - Updated dependencies [6ae4a34ae]
86
+ - Updated dependencies [97086dde8]
87
+ - Updated dependencies [97086dde8]
88
+ - Updated dependencies [b80229c79]
89
+ - Updated dependencies [ff6219909]
90
+ - Updated dependencies [948cc4436]
91
+ - @modern-js/webpack@1.7.0
92
+ - @modern-js/plugin@1.3.4
93
+ - @modern-js/core@1.10.2
94
+ - @modern-js/i18n-cli-language-detector@1.2.3
95
+ - @modern-js/plugin-analyze@1.4.3
96
+ - @modern-js/plugin-fast-refresh@1.2.6
97
+ - @modern-js/plugin-i18n@1.2.6
98
+ - @modern-js/new-action@1.3.9
99
+ - @modern-js/prod-server@1.1.5
100
+ - @modern-js/server@1.4.14
101
+ - @modern-js/node-bundle-require@1.3.3
102
+ - @modern-js/types@1.5.3
103
+ - @modern-js/utils@1.7.3
104
+
3
105
  ## 1.6.3
4
106
 
5
107
  ### Patch Changes
@@ -4,7 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- import { fs, logger, HMR_SOCK_PATH, clearConsole, chalk, isSSR } from '@modern-js/utils';
7
+ import { fs, logger, chalk, isSSR, clearConsole } from '@modern-js/utils';
8
+ import { manager, ResolvedConfigContext } from '@modern-js/core';
8
9
  import { createCompiler } from "../utils/createCompiler";
9
10
  import { createServer } from "../utils/createServer";
10
11
  import { generateRoutes } from "../utils/routes";
@@ -12,9 +13,15 @@ import { printInstructions } from "../utils/printInstructions";
12
13
  import { getSpecifiedEntries } from "../utils/getSpecifiedEntries";
13
14
  import { buildServerConfig } from "../utils/config";
14
15
  export const dev = async (api, options) => {
16
+ let userConfig = api.useResolvedConfigContext();
15
17
  const appContext = api.useAppContext();
16
- const userConfig = api.useResolvedConfigContext();
17
18
  const hookRunners = api.useHookRunners();
19
+ manager.run(() => {
20
+ userConfig = _objectSpread(_objectSpread({}, userConfig), {}, {
21
+ cliOptions: options
22
+ });
23
+ ResolvedConfigContext.set(userConfig);
24
+ });
18
25
  const {
19
26
  appDirectory,
20
27
  distDirectory,
@@ -61,10 +68,7 @@ export const dev = async (api, options) => {
61
68
  dev: _objectSpread(_objectSpread({}, {
62
69
  client: {
63
70
  port: port.toString(),
64
- overlay: false,
65
- logging: 'none',
66
- path: HMR_SOCK_PATH,
67
- host: 'localhost'
71
+ logging: 'none'
68
72
  },
69
73
  devMiddleware: {
70
74
  writeToDisk: file => !file.includes('.hot-update.')
@@ -7,7 +7,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  import * as path from 'path';
8
8
  import { defineConfig, cli } from '@modern-js/core';
9
9
  import AnalyzePlugin from '@modern-js/plugin-analyze';
10
- import FastRefreshPlugin from '@modern-js/plugin-fast-refresh/cli';
11
10
  import { cleanRequireCache } from '@modern-js/utils';
12
11
  import { hooks } from "./hooks";
13
12
  import { i18n, localeKeys } from "./locale";
@@ -18,9 +17,9 @@ import { closeServer } from "./utils/createServer";
18
17
  export { defineConfig };
19
18
  export default (() => ({
20
19
  name: '@modern-js/app-tools',
21
- post: ['@modern-js/plugin-analyze', '@modern-js/plugin-fast-refresh', '@modern-js/plugin-ssr', '@modern-js/plugin-state', '@modern-js/plugin-router', '@modern-js/plugin-polyfill'],
20
+ post: ['@modern-js/plugin-analyze', '@modern-js/plugin-ssr', '@modern-js/plugin-state', '@modern-js/plugin-router', '@modern-js/plugin-polyfill'],
22
21
  registerHook: hooks,
23
- usePlugins: [AnalyzePlugin(), FastRefreshPlugin()],
22
+ usePlugins: [AnalyzePlugin()],
24
23
  setup: api => {
25
24
  const locale = getLocaleLanguage();
26
25
  i18n.changeLanguage({
@@ -30,10 +29,10 @@ export default (() => ({
30
29
  commands({
31
30
  program
32
31
  }) {
33
- program.command('dev').usage('[options]').description(i18n.t(localeKeys.command.dev.describe)).option('-c --config <config>', i18n.t(localeKeys.command.dev.config)).option('-e --entry [entry...]', i18n.t(localeKeys.command.dev.entry)).option('--api-only', i18n.t(localeKeys.command.dev.apiOnly)).action(async options => {
32
+ program.command('dev').usage('[options]').description(i18n.t(localeKeys.command.dev.describe)).option('-c --config <config>', i18n.t(localeKeys.command.shared.config)).option('-e --entry [entry...]', i18n.t(localeKeys.command.dev.entry)).option('--analyze', i18n.t(localeKeys.command.shared.analyze)).option('--api-only', i18n.t(localeKeys.command.dev.apiOnly)).action(async options => {
34
33
  await dev(api, options);
35
34
  });
36
- program.command('build').usage('[options]').description(i18n.t(localeKeys.command.build.describe)).option('--analyze', i18n.t(localeKeys.command.build.analyze)).action(async options => {
35
+ 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 => {
37
36
  const {
38
37
  build
39
38
  } = await import("./commands/build");
@@ -45,7 +44,7 @@ export default (() => ({
45
44
  program.command('start').usage('[options]').description(i18n.t(localeKeys.command.start.describe)).option('--api-only', i18n.t(localeKeys.command.dev.apiOnly)).action(async () => {
46
45
  await start(api);
47
46
  });
48
- program.command('deploy').usage('[options]').description(i18n.t(localeKeys.command.deploy.describe)).action(async options => {
47
+ program.command('deploy').usage('[options]').option('-c --config <config>', i18n.t(localeKeys.command.shared.config)).description(i18n.t(localeKeys.command.deploy.describe)).action(async options => {
49
48
  const {
50
49
  build
51
50
  } = await import("./commands/build");
@@ -87,7 +86,7 @@ export default (() => ({
87
86
  },
88
87
 
89
88
  async beforeRestart() {
90
- cleanRequireCache([require.resolve('@modern-js/plugin-analyze/cli'), require.resolve('@modern-js/plugin-fast-refresh/cli')]);
89
+ cleanRequireCache([require.resolve('@modern-js/plugin-analyze/cli')]);
91
90
  }
92
91
 
93
92
  };
@@ -1,14 +1,16 @@
1
1
  export const EN_LOCALE = {
2
2
  command: {
3
+ shared: {
4
+ analyze: 'analyze bundle size',
5
+ config: 'specify config file'
6
+ },
3
7
  dev: {
4
8
  describe: 'start dev server',
5
- config: 'specify config file',
6
9
  entry: 'compiler by entry',
7
10
  apiOnly: 'start api server only'
8
11
  },
9
12
  build: {
10
- describe: 'build application',
11
- analyze: 'analyze bundle'
13
+ describe: 'build application'
12
14
  },
13
15
  start: {
14
16
  describe: 'start server'
@@ -1,14 +1,16 @@
1
1
  export const ZH_LOCALE = {
2
2
  command: {
3
+ shared: {
4
+ analyze: '分析构建产物体积,查看各个模块打包后的大小',
5
+ config: '指定配置文件路径,可以为相对路径或绝对路径'
6
+ },
3
7
  dev: {
4
8
  describe: '本地开发命令',
5
- config: '制定配置文件路径',
6
- entry: '按入口编译',
9
+ entry: '指定入口,编译特定的页面',
7
10
  apiOnly: '仅启动 API 接口服务'
8
11
  },
9
12
  build: {
10
- describe: '构建应用命令',
11
- analyze: '分析构建产物体积,查看各个模块打包后的大小'
13
+ describe: '构建应用命令'
12
14
  },
13
15
  start: {
14
16
  describe: '应用启动命令'
@@ -1,13 +1,6 @@
1
1
  import { webpack } from '@modern-js/webpack';
2
2
  import { chalk, logger, formatWebpackMessages, clearConsole } from '@modern-js/utils';
3
3
  import { printInstructions } from "./printInstructions";
4
-
5
- const prettyTime = stats => {
6
- var _stats$children;
7
-
8
- return Math.max(...(((_stats$children = stats.children) === null || _stats$children === void 0 ? void 0 : _stats$children.map(child => child.time || 0)) || []));
9
- };
10
-
11
4
  export const createCompiler = async ({
12
5
  api,
13
6
  webpackConfigs,
@@ -30,7 +23,6 @@ export const createCompiler = async ({
30
23
  logger.log('Compiling...');
31
24
  });
32
25
  compiler.hooks.done.tap('done', async stats => {
33
- clearConsole();
34
26
  const statsData = stats.toJson({
35
27
  all: false,
36
28
  warnings: true,
@@ -53,8 +45,6 @@ export const createCompiler = async ({
53
45
  logger.log(chalk.yellow(`Compiled with warnings.\n`));
54
46
  logger.log(warnings.join('\n\n'));
55
47
  logger.log();
56
- } else {
57
- logger.log(chalk.green(`Compiled successfully in ${prettyTime(statsData)} ms.\n`));
58
48
  }
59
49
 
60
50
  await printInstructions(hookRunners, appContext, userConfig);
@@ -1,14 +1,6 @@
1
- import { prettyInstructions, logger, isDev, chalk } from '@modern-js/utils';
1
+ import { prettyInstructions, logger } from '@modern-js/utils';
2
2
  export const printInstructions = async (hookRunners, appContext, config) => {
3
- let message = prettyInstructions(appContext, config);
4
- const {
5
- apiOnly
6
- } = appContext;
7
-
8
- if (isDev() && !apiOnly) {
9
- message += `\n${chalk.cyanBright([`Note that the development build is not optimized.`, `To create a production build, execute build command.`].join('\n'))}`;
10
- } // call beforePrintInstructions hook.
11
-
3
+ const message = prettyInstructions(appContext, config); // call beforePrintInstructions hook.
12
4
 
13
5
  const {
14
6
  instructions
@@ -7,6 +7,8 @@ exports.dev = void 0;
7
7
 
8
8
  var _utils = require("@modern-js/utils");
9
9
 
10
+ var _core = require("@modern-js/core");
11
+
10
12
  var _createCompiler = require("../utils/createCompiler");
11
13
 
12
14
  var _createServer = require("../utils/createServer");
@@ -30,9 +32,18 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
30
32
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
33
 
32
34
  const dev = async (api, options) => {
35
+ let userConfig = api.useResolvedConfigContext();
33
36
  const appContext = api.useAppContext();
34
- const userConfig = api.useResolvedConfigContext();
35
37
  const hookRunners = api.useHookRunners();
38
+
39
+ _core.manager.run(() => {
40
+ userConfig = _objectSpread(_objectSpread({}, userConfig), {}, {
41
+ cliOptions: options
42
+ });
43
+
44
+ _core.ResolvedConfigContext.set(userConfig);
45
+ });
46
+
36
47
  const {
37
48
  appDirectory,
38
49
  distDirectory,
@@ -81,10 +92,7 @@ const dev = async (api, options) => {
81
92
  dev: _objectSpread(_objectSpread({}, {
82
93
  client: {
83
94
  port: port.toString(),
84
- overlay: false,
85
- logging: 'none',
86
- path: _utils.HMR_SOCK_PATH,
87
- host: 'localhost'
95
+ logging: 'none'
88
96
  },
89
97
  devMiddleware: {
90
98
  writeToDisk: file => !file.includes('.hot-update.')
@@ -17,8 +17,6 @@ var _core = require("@modern-js/core");
17
17
 
18
18
  var _pluginAnalyze = _interopRequireDefault(require("@modern-js/plugin-analyze"));
19
19
 
20
- var _cli = _interopRequireDefault(require("@modern-js/plugin-fast-refresh/cli"));
21
-
22
20
  var _utils = require("@modern-js/utils");
23
21
 
24
22
  var _hooks = require("./hooks");
@@ -47,9 +45,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
47
45
 
48
46
  var _default = () => ({
49
47
  name: '@modern-js/app-tools',
50
- post: ['@modern-js/plugin-analyze', '@modern-js/plugin-fast-refresh', '@modern-js/plugin-ssr', '@modern-js/plugin-state', '@modern-js/plugin-router', '@modern-js/plugin-polyfill'],
48
+ post: ['@modern-js/plugin-analyze', '@modern-js/plugin-ssr', '@modern-js/plugin-state', '@modern-js/plugin-router', '@modern-js/plugin-polyfill'],
51
49
  registerHook: _hooks.hooks,
52
- usePlugins: [(0, _pluginAnalyze.default)(), (0, _cli.default)()],
50
+ usePlugins: [(0, _pluginAnalyze.default)()],
53
51
  setup: api => {
54
52
  const locale = (0, _language.getLocaleLanguage)();
55
53
 
@@ -61,10 +59,10 @@ var _default = () => ({
61
59
  commands({
62
60
  program
63
61
  }) {
64
- program.command('dev').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.dev.describe)).option('-c --config <config>', _locale.i18n.t(_locale.localeKeys.command.dev.config)).option('-e --entry [entry...]', _locale.i18n.t(_locale.localeKeys.command.dev.entry)).option('--api-only', _locale.i18n.t(_locale.localeKeys.command.dev.apiOnly)).action(async options => {
62
+ program.command('dev').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.dev.describe)).option('-c --config <config>', _locale.i18n.t(_locale.localeKeys.command.shared.config)).option('-e --entry [entry...]', _locale.i18n.t(_locale.localeKeys.command.dev.entry)).option('--analyze', _locale.i18n.t(_locale.localeKeys.command.shared.analyze)).option('--api-only', _locale.i18n.t(_locale.localeKeys.command.dev.apiOnly)).action(async options => {
65
63
  await (0, _dev.dev)(api, options);
66
64
  });
67
- program.command('build').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.build.describe)).option('--analyze', _locale.i18n.t(_locale.localeKeys.command.build.analyze)).action(async options => {
65
+ program.command('build').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.build.describe)).option('-c --config <config>', _locale.i18n.t(_locale.localeKeys.command.shared.config)).option('--analyze', _locale.i18n.t(_locale.localeKeys.command.shared.analyze)).action(async options => {
68
66
  const {
69
67
  build
70
68
  } = await Promise.resolve().then(() => _interopRequireWildcard(require("./commands/build")));
@@ -76,7 +74,7 @@ var _default = () => ({
76
74
  program.command('start').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.start.describe)).option('--api-only', _locale.i18n.t(_locale.localeKeys.command.dev.apiOnly)).action(async () => {
77
75
  await (0, _start.start)(api);
78
76
  });
79
- program.command('deploy').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.deploy.describe)).action(async options => {
77
+ program.command('deploy').usage('[options]').option('-c --config <config>', _locale.i18n.t(_locale.localeKeys.command.shared.config)).description(_locale.i18n.t(_locale.localeKeys.command.deploy.describe)).action(async options => {
80
78
  const {
81
79
  build
82
80
  } = await Promise.resolve().then(() => _interopRequireWildcard(require("./commands/build")));
@@ -118,7 +116,7 @@ var _default = () => ({
118
116
  },
119
117
 
120
118
  async beforeRestart() {
121
- (0, _utils.cleanRequireCache)([require.resolve('@modern-js/plugin-analyze/cli'), require.resolve('@modern-js/plugin-fast-refresh/cli')]);
119
+ (0, _utils.cleanRequireCache)([require.resolve('@modern-js/plugin-analyze/cli')]);
122
120
  }
123
121
 
124
122
  };
@@ -6,15 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.EN_LOCALE = void 0;
7
7
  const EN_LOCALE = {
8
8
  command: {
9
+ shared: {
10
+ analyze: 'analyze bundle size',
11
+ config: 'specify config file'
12
+ },
9
13
  dev: {
10
14
  describe: 'start dev server',
11
- config: 'specify config file',
12
15
  entry: 'compiler by entry',
13
16
  apiOnly: 'start api server only'
14
17
  },
15
18
  build: {
16
- describe: 'build application',
17
- analyze: 'analyze bundle'
19
+ describe: 'build application'
18
20
  },
19
21
  start: {
20
22
  describe: 'start server'
@@ -6,15 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ZH_LOCALE = void 0;
7
7
  const ZH_LOCALE = {
8
8
  command: {
9
+ shared: {
10
+ analyze: '分析构建产物体积,查看各个模块打包后的大小',
11
+ config: '指定配置文件路径,可以为相对路径或绝对路径'
12
+ },
9
13
  dev: {
10
14
  describe: '本地开发命令',
11
- config: '制定配置文件路径',
12
- entry: '按入口编译',
15
+ entry: '指定入口,编译特定的页面',
13
16
  apiOnly: '仅启动 API 接口服务'
14
17
  },
15
18
  build: {
16
- describe: '构建应用命令',
17
- analyze: '分析构建产物体积,查看各个模块打包后的大小'
19
+ describe: '构建应用命令'
18
20
  },
19
21
  start: {
20
22
  describe: '应用启动命令'
@@ -11,12 +11,6 @@ var _utils = require("@modern-js/utils");
11
11
 
12
12
  var _printInstructions = require("./printInstructions");
13
13
 
14
- const prettyTime = stats => {
15
- var _stats$children;
16
-
17
- return Math.max(...(((_stats$children = stats.children) === null || _stats$children === void 0 ? void 0 : _stats$children.map(child => child.time || 0)) || []));
18
- };
19
-
20
14
  const createCompiler = async ({
21
15
  api,
22
16
  webpackConfigs,
@@ -40,7 +34,6 @@ const createCompiler = async ({
40
34
  _utils.logger.log('Compiling...');
41
35
  });
42
36
  compiler.hooks.done.tap('done', async stats => {
43
- (0, _utils.clearConsole)();
44
37
  const statsData = stats.toJson({
45
38
  all: false,
46
39
  warnings: true,
@@ -67,8 +60,6 @@ const createCompiler = async ({
67
60
  _utils.logger.log(warnings.join('\n\n'));
68
61
 
69
62
  _utils.logger.log();
70
- } else {
71
- _utils.logger.log(_utils.chalk.green(`Compiled successfully in ${prettyTime(statsData)} ms.\n`));
72
63
  }
73
64
 
74
65
  await (0, _printInstructions.printInstructions)(hookRunners, appContext, userConfig);
@@ -8,15 +8,7 @@ exports.printInstructions = void 0;
8
8
  var _utils = require("@modern-js/utils");
9
9
 
10
10
  const printInstructions = async (hookRunners, appContext, config) => {
11
- let message = (0, _utils.prettyInstructions)(appContext, config);
12
- const {
13
- apiOnly
14
- } = appContext;
15
-
16
- if ((0, _utils.isDev)() && !apiOnly) {
17
- message += `\n${_utils.chalk.cyanBright([`Note that the development build is not optimized.`, `To create a production build, execute build command.`].join('\n'))}`;
18
- } // call beforePrintInstructions hook.
19
-
11
+ const message = (0, _utils.prettyInstructions)(appContext, config); // call beforePrintInstructions hook.
20
12
 
21
13
  const {
22
14
  instructions
@@ -1,3 +1,3 @@
1
- import type { PluginAPI } from '@modern-js/core';
1
+ import { PluginAPI } from '@modern-js/core';
2
2
  import { DevOptions } from '../utils/types';
3
3
  export declare const dev: (api: PluginAPI, options: DevOptions) => Promise<void>;
@@ -1,14 +1,16 @@
1
1
  export declare const EN_LOCALE: {
2
2
  command: {
3
+ shared: {
4
+ analyze: string;
5
+ config: string;
6
+ };
3
7
  dev: {
4
8
  describe: string;
5
- config: string;
6
9
  entry: string;
7
10
  apiOnly: string;
8
11
  };
9
12
  build: {
10
13
  describe: string;
11
- analyze: string;
12
14
  };
13
15
  start: {
14
16
  describe: string;
@@ -2,15 +2,17 @@ import { I18n } from '@modern-js/plugin-i18n';
2
2
  declare const i18n: I18n;
3
3
  declare const localeKeys: {
4
4
  command: {
5
+ shared: {
6
+ analyze: string;
7
+ config: string;
8
+ };
5
9
  dev: {
6
10
  describe: string;
7
- config: string;
8
11
  entry: string;
9
12
  apiOnly: string;
10
13
  };
11
14
  build: {
12
15
  describe: string;
13
- analyze: string;
14
16
  };
15
17
  start: {
16
18
  describe: string;
@@ -28,15 +30,17 @@ declare const localeKeys: {
28
30
  };
29
31
  } | {
30
32
  command: {
33
+ shared: {
34
+ analyze: string;
35
+ config: string;
36
+ };
31
37
  dev: {
32
38
  describe: string;
33
- config: string;
34
39
  entry: string;
35
40
  apiOnly: string;
36
41
  };
37
42
  build: {
38
43
  describe: string;
39
- analyze: string;
40
44
  };
41
45
  start: {
42
46
  describe: string;
@@ -1,14 +1,16 @@
1
1
  export declare const ZH_LOCALE: {
2
2
  command: {
3
+ shared: {
4
+ analyze: string;
5
+ config: string;
6
+ };
3
7
  dev: {
4
8
  describe: string;
5
- config: string;
6
9
  entry: string;
7
10
  apiOnly: string;
8
11
  };
9
12
  build: {
10
13
  describe: string;
11
- analyze: string;
12
14
  };
13
15
  start: {
14
16
  describe: string;
@@ -1,10 +1,16 @@
1
1
  export declare type DevOptions = {
2
2
  entry?: string[] | boolean;
3
+ config?: string;
3
4
  apiOnly?: boolean;
5
+ analyze?: boolean;
4
6
  };
5
7
  export declare type BuildOptions = {
8
+ config?: string;
6
9
  analyze?: boolean;
7
10
  };
11
+ export declare type DeployOptions = {
12
+ config?: string;
13
+ };
8
14
  export declare type StartOptions = {
9
15
  apiOnly?: boolean;
10
16
  };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.6.3",
14
+ "version": "1.6.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -56,26 +56,25 @@
56
56
  "modern": "./bin/modern.js"
57
57
  },
58
58
  "dependencies": {
59
- "@babel/runtime": "^7",
60
- "@modern-js/core": "^1.10.1",
61
- "@modern-js/i18n-cli-language-detector": "^1.2.2",
62
- "@modern-js/new-action": "^1.3.8",
63
- "@modern-js/node-bundle-require": "^1.3.2",
64
- "@modern-js/plugin": "^1.3.3",
65
- "@modern-js/plugin-analyze": "^1.4.2",
66
- "@modern-js/plugin-fast-refresh": "^1.2.5",
67
- "@modern-js/plugin-i18n": "^1.2.5",
68
- "@modern-js/prod-server": "^1.1.4",
69
- "@modern-js/server": "^1.4.13",
70
- "@modern-js/types": "^1.5.2",
71
- "@modern-js/utils": "^1.7.2",
72
- "@modern-js/webpack": "^1.6.2"
59
+ "@babel/runtime": "^7.18.0",
60
+ "@modern-js/core": "^1.11.2",
61
+ "@modern-js/i18n-cli-language-detector": "^1.2.4",
62
+ "@modern-js/new-action": "^1.3.10",
63
+ "@modern-js/node-bundle-require": "^1.3.5",
64
+ "@modern-js/plugin": "^1.3.6",
65
+ "@modern-js/plugin-analyze": "^1.4.6",
66
+ "@modern-js/plugin-i18n": "^1.2.7",
67
+ "@modern-js/prod-server": "^1.1.8",
68
+ "@modern-js/server": "^1.4.18",
69
+ "@modern-js/types": "^1.5.4",
70
+ "@modern-js/utils": "^1.7.6",
71
+ "@modern-js/webpack": "^1.10.0"
73
72
  },
74
73
  "devDependencies": {
75
- "@modern-js/server-core": "1.3.4",
74
+ "@modern-js/server-core": "1.3.5",
76
75
  "@scripts/build": "0.0.0",
77
76
  "@scripts/jest-config": "0.0.0",
78
- "@types/jest": "^26",
77
+ "@types/jest": "^27",
79
78
  "@types/node": "^14",
80
79
  "@types/react": "^17",
81
80
  "@types/react-dom": "^17",
@@ -87,11 +86,34 @@
87
86
  "registry": "https://registry.npmjs.org/",
88
87
  "access": "public"
89
88
  },
89
+ "wireit": {
90
+ "build": {
91
+ "command": "modern build",
92
+ "files": [
93
+ "src/**/*",
94
+ "tsconfig.json",
95
+ "package.json"
96
+ ],
97
+ "output": [
98
+ "dist/**/*"
99
+ ]
100
+ },
101
+ "test": {
102
+ "command": "jest --passWithNoTests",
103
+ "files": [
104
+ "src/**/*",
105
+ "tsconfig.json",
106
+ "package.json",
107
+ "tests/**/*"
108
+ ],
109
+ "output": []
110
+ }
111
+ },
90
112
  "scripts": {
91
113
  "new": "modern new",
92
114
  "dev": "modern build --watch",
93
- "build": "modern build",
94
- "test": "jest --passWithNoTests"
115
+ "build": "wireit",
116
+ "test": "wireit"
95
117
  },
96
118
  "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
97
119
  }
package/.eslintrc.js DELETED
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ['@modern-js'],
4
- parserOptions: {
5
- tsconfigRootDir: __dirname,
6
- project: ['./tsconfig.json'],
7
- },
8
- };
package/jest.config.js DELETED
@@ -1,7 +0,0 @@
1
- const sharedConfig = require('@scripts/jest-config');
2
-
3
- /** @type {import('@jest/types').Config.InitialOptions} */
4
- module.exports = {
5
- ...sharedConfig,
6
- rootDir: __dirname,
7
- };
package/modern.config.js DELETED
@@ -1,7 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {
3
- output: {
4
- packageMode: 'node-js',
5
- disableSourceMap: true,
6
- },
7
- };
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "esModuleInterop": true,
6
- "allowJs": true,
7
- "jsx": "preserve",
8
- "baseUrl": "./",
9
- "skipLibCheck": true,
10
- "isolatedModules": true,
11
- "paths": {}
12
- },
13
- "include": ["src"]
14
- }