@modern-js/monorepo-tools 2.47.1 → 2.48.0

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/bin/modern.js CHANGED
@@ -1,5 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ const { version } = require('../package.json');
4
+
5
+ if (!process.env.MODERN_JS_VERSION) {
6
+ process.env.MODERN_JS_VERSION = version;
7
+ }
8
+
3
9
  require('@modern-js/core/runBin').run({
4
- initialLog: `Modern.js Monorepo v${require('../package.json').version}`,
10
+ initialLog: `Modern.js Monorepo v${version}`,
5
11
  });
@@ -21,6 +21,7 @@ __reExport(cli_exports, require("./build"), module.exports);
21
21
  __reExport(cli_exports, require("./buildWatch"), module.exports);
22
22
  __reExport(cli_exports, require("./clear"), module.exports);
23
23
  __reExport(cli_exports, require("./install"), module.exports);
24
+ __reExport(cli_exports, require("./upgrade"), module.exports);
24
25
  // Annotate the CommonJS export names for ESM import in node:
25
26
  0 && (module.exports = {
26
27
  ...require("./new"),
@@ -28,5 +29,6 @@ __reExport(cli_exports, require("./install"), module.exports);
28
29
  ...require("./build"),
29
30
  ...require("./buildWatch"),
30
31
  ...require("./clear"),
31
- ...require("./install")
32
+ ...require("./install"),
33
+ ...require("./upgrade")
32
34
  });
@@ -21,17 +21,17 @@ __export(new_exports, {
21
21
  newCli: () => newCli
22
22
  });
23
23
  module.exports = __toCommonJS(new_exports);
24
- var import_new_action = require("@modern-js/new-action");
24
+ var import_utils = require("@modern-js/utils");
25
25
  var import_locale = require("../locale");
26
26
  const newCli = (program, locale) => {
27
27
  program.command("new").usage("[options]").description(import_locale.i18n.t(import_locale.localeKeys.command.new.describe)).option("--config-file <configFile>", import_locale.i18n.t(import_locale.localeKeys.command.shared.config)).option("--lang <lang>", import_locale.i18n.t(import_locale.localeKeys.command.new.lang)).option("-c, --config <config>", import_locale.i18n.t(import_locale.localeKeys.command.new.config)).option("-p, --plugin <plugin>", import_locale.i18n.t(import_locale.localeKeys.command.new.plugin), (val, memo) => {
28
28
  memo.push(val);
29
29
  return memo;
30
30
  }, []).option("-d, --debug", import_locale.i18n.t(import_locale.localeKeys.command.new.debug), false).option("--dist-tag <tag>", import_locale.i18n.t(import_locale.localeKeys.command.new.distTag)).option("--registry", import_locale.i18n.t(import_locale.localeKeys.command.new.registry)).option("--no-need-install", import_locale.i18n.t(import_locale.localeKeys.command.shared.noNeedInstall)).action(async (options) => {
31
- await (0, import_new_action.MonorepoNewAction)({
31
+ await (0, import_utils.newAction)({
32
32
  ...options,
33
33
  locale: options.lang || locale
34
- });
34
+ }, "monorepo");
35
35
  });
36
36
  };
37
37
  // Annotate the CommonJS export names for ESM import in node:
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var upgrade_exports = {};
20
+ __export(upgrade_exports, {
21
+ upgradeCli: () => upgradeCli
22
+ });
23
+ module.exports = __toCommonJS(upgrade_exports);
24
+ var import_utils = require("@modern-js/utils");
25
+ const upgradeCli = (program) => {
26
+ program.command("upgrade").allowUnknownOption().option("-h --help", "Show help").action(async () => {
27
+ await (0, import_utils.upgradeAction)();
28
+ });
29
+ };
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ upgradeCli
33
+ });
package/dist/cjs/index.js CHANGED
@@ -25,13 +25,11 @@ __export(src_exports, {
25
25
  module.exports = __toCommonJS(src_exports);
26
26
  var import_plugin_changeset = require("@modern-js/plugin-changeset");
27
27
  var import_plugin_lint = require("@modern-js/plugin-lint");
28
- var import_utils = require("@modern-js/utils");
29
28
  var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
30
29
  var import_locale = require("./locale");
31
30
  var import_cli = require("./cli");
32
31
  var import_hooks = require("./hooks");
33
32
  __reExport(src_exports, require("./projects/getProjects"), module.exports);
34
- const upgradeModel = import_utils.Import.lazy("@modern-js/upgrade", require);
35
33
  const monorepoTools = () => ({
36
34
  name: "@modern-js/monorepo-tools",
37
35
  usePlugins: [
@@ -54,7 +52,7 @@ const monorepoTools = () => ({
54
52
  (0, import_cli.clearCli)(program, api);
55
53
  (0, import_cli.deployCli)(program, api);
56
54
  (0, import_cli.newCli)(program, locale);
57
- upgradeModel.defineCommand(program.command("upgrade").option("-c --config <config>", import_locale.i18n.t(import_locale.localeKeys.command.shared.config)).option("--no-need-install", import_locale.i18n.t(import_locale.localeKeys.command.shared.noNeedInstall)));
55
+ (0, import_cli.upgradeCli)(program);
58
56
  }
59
57
  };
60
58
  },
@@ -4,3 +4,4 @@ export * from "./build";
4
4
  export * from "./buildWatch";
5
5
  export * from "./clear";
6
6
  export * from "./install";
7
+ export * from "./upgrade";
@@ -1,14 +1,14 @@
1
- import { MonorepoNewAction } from "@modern-js/new-action";
1
+ import { newAction } from "@modern-js/utils";
2
2
  import { i18n, localeKeys } from "../locale";
3
3
  const newCli = (program, locale) => {
4
4
  program.command("new").usage("[options]").description(i18n.t(localeKeys.command.new.describe)).option("--config-file <configFile>", i18n.t(localeKeys.command.shared.config)).option("--lang <lang>", i18n.t(localeKeys.command.new.lang)).option("-c, --config <config>", i18n.t(localeKeys.command.new.config)).option("-p, --plugin <plugin>", i18n.t(localeKeys.command.new.plugin), (val, memo) => {
5
5
  memo.push(val);
6
6
  return memo;
7
7
  }, []).option("-d, --debug", i18n.t(localeKeys.command.new.debug), false).option("--dist-tag <tag>", i18n.t(localeKeys.command.new.distTag)).option("--registry", i18n.t(localeKeys.command.new.registry)).option("--no-need-install", i18n.t(localeKeys.command.shared.noNeedInstall)).action(async (options) => {
8
- await MonorepoNewAction({
8
+ await newAction({
9
9
  ...options,
10
10
  locale: options.lang || locale
11
- });
11
+ }, "monorepo");
12
12
  });
13
13
  };
14
14
  export {
@@ -0,0 +1,9 @@
1
+ import { upgradeAction } from "@modern-js/utils";
2
+ const upgradeCli = (program) => {
3
+ program.command("upgrade").allowUnknownOption().option("-h --help", "Show help").action(async () => {
4
+ await upgradeAction();
5
+ });
6
+ };
7
+ export {
8
+ upgradeCli
9
+ };
package/dist/esm/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  import { changesetPlugin } from "@modern-js/plugin-changeset";
2
2
  import { lintPlugin } from "@modern-js/plugin-lint";
3
- import { Import } from "@modern-js/utils";
4
3
  import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
5
- import { i18n, localeKeys } from "./locale";
6
- import { newCli, deployCli, clearCli } from "./cli";
4
+ import { i18n } from "./locale";
5
+ import { newCli, deployCli, clearCli, upgradeCli } from "./cli";
7
6
  import { hooks } from "./hooks";
8
7
  export * from "./projects/getProjects";
9
- const upgradeModel = Import.lazy("@modern-js/upgrade", require);
10
8
  const monorepoTools = () => ({
11
9
  name: "@modern-js/monorepo-tools",
12
10
  usePlugins: [
@@ -29,7 +27,7 @@ const monorepoTools = () => ({
29
27
  clearCli(program, api);
30
28
  deployCli(program, api);
31
29
  newCli(program, locale);
32
- upgradeModel.defineCommand(program.command("upgrade").option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--no-need-install", i18n.t(localeKeys.command.shared.noNeedInstall)));
30
+ upgradeCli(program);
33
31
  }
34
32
  };
35
33
  },
@@ -4,3 +4,4 @@ export * from './build';
4
4
  export * from './buildWatch';
5
5
  export * from './clear';
6
6
  export * from './install';
7
+ export * from './upgrade';
@@ -0,0 +1,2 @@
1
+ import type { Command } from '@modern-js/utils';
2
+ export declare const upgradeCli: (program: Command) => void;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.47.1",
18
+ "version": "2.48.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -43,14 +43,12 @@
43
43
  "md5": "^2.3.0",
44
44
  "p-map": "4.0.0",
45
45
  "@swc/helpers": "0.5.3",
46
- "@modern-js/core": "2.47.1",
47
- "@modern-js/upgrade": "2.47.1",
48
- "@modern-js/plugin": "2.47.1",
49
- "@modern-js/new-action": "2.47.1",
50
- "@modern-js/plugin-changeset": "2.47.1",
51
- "@modern-js/plugin-i18n": "2.47.1",
52
- "@modern-js/plugin-lint": "2.47.1",
53
- "@modern-js/utils": "2.47.1"
46
+ "@modern-js/core": "2.48.0",
47
+ "@modern-js/plugin-changeset": "2.48.0",
48
+ "@modern-js/plugin": "2.48.0",
49
+ "@modern-js/plugin-i18n": "2.48.0",
50
+ "@modern-js/utils": "2.48.0",
51
+ "@modern-js/plugin-lint": "2.48.0"
54
52
  },
55
53
  "devDependencies": {
56
54
  "@types/jest": "^29",
@@ -58,8 +56,8 @@
58
56
  "@types/node": "^14",
59
57
  "jest": "^29",
60
58
  "typescript": "^5",
61
- "@scripts/build": "2.47.1",
62
- "@scripts/jest-config": "2.47.1"
59
+ "@scripts/build": "2.48.0",
60
+ "@scripts/jest-config": "2.48.0"
63
61
  },
64
62
  "sideEffects": false,
65
63
  "publishConfig": {