@modern-js/monorepo-tools 1.4.0 → 1.4.1

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/js/modern/cli/build-watch.js +3 -3
  3. package/dist/js/modern/cli/build.js +2 -2
  4. package/dist/js/modern/cli/clear.js +2 -2
  5. package/dist/js/modern/cli/deploy.js +2 -2
  6. package/dist/js/modern/cli/install.js +2 -2
  7. package/dist/js/modern/commands/build-watch.js +2 -4
  8. package/dist/js/modern/commands/build.js +2 -4
  9. package/dist/js/modern/commands/clear.js +3 -5
  10. package/dist/js/modern/commands/deploy.js +5 -6
  11. package/dist/js/modern/commands/install.js +2 -4
  12. package/dist/js/modern/hooks/index.js +2 -5
  13. package/dist/js/modern/index.js +22 -22
  14. package/dist/js/node/cli/build-watch.js +3 -3
  15. package/dist/js/node/cli/build.js +2 -2
  16. package/dist/js/node/cli/clear.js +2 -2
  17. package/dist/js/node/cli/deploy.js +2 -2
  18. package/dist/js/node/cli/install.js +2 -2
  19. package/dist/js/node/commands/build-watch.js +2 -5
  20. package/dist/js/node/commands/build.js +2 -5
  21. package/dist/js/node/commands/clear.js +3 -6
  22. package/dist/js/node/commands/deploy.js +5 -7
  23. package/dist/js/node/commands/install.js +2 -5
  24. package/dist/js/node/hooks/index.js +4 -10
  25. package/dist/js/node/index.js +25 -29
  26. package/dist/types/cli/build-watch.d.ts +2 -1
  27. package/dist/types/cli/build.d.ts +2 -1
  28. package/dist/types/cli/clear.d.ts +2 -1
  29. package/dist/types/cli/deploy.d.ts +2 -1
  30. package/dist/types/cli/install.d.ts +2 -1
  31. package/dist/types/commands/build-watch.d.ts +2 -1
  32. package/dist/types/commands/build.d.ts +2 -1
  33. package/dist/types/commands/clear.d.ts +2 -1
  34. package/dist/types/commands/deploy.d.ts +2 -1
  35. package/dist/types/commands/install.d.ts +2 -1
  36. package/dist/types/hooks/index.d.ts +7 -1
  37. package/dist/types/index.d.ts +2 -3
  38. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @modern-js/monorepo-tools
2
2
 
3
+ ## 1.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 57419eb4: convert to new plugin
8
+ - Updated dependencies [05ce88a0]
9
+ - Updated dependencies [a8df060e]
10
+ - Updated dependencies [c2046f37]
11
+ - Updated dependencies [dc88abf9]
12
+ - Updated dependencies [0462ff77]
13
+ - Updated dependencies [61e3f623]
14
+ - Updated dependencies [6a7acb81]
15
+ - Updated dependencies [681a1ff9]
16
+ - Updated dependencies [4e2026e4]
17
+ - @modern-js/core@1.6.0
18
+ - @modern-js/utils@1.3.6
19
+ - @modern-js/plugin@1.3.2
20
+ - @modern-js/plugin-changeset@1.2.3
21
+
3
22
  ## 1.4.0
4
23
 
5
24
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  import { buildWatch } from "../commands";
2
- export const buildWatchCli = program => {
3
- program.command('build-watch [project]').usage('[options]').option('--only-self', 'build target project with nothing').option('-i, --init', 'init build beforebuild watch ').description('watch target project and target project’s dependences').action(async (targetProjectName, option) => {
4
- await buildWatch(targetProjectName, option);
2
+ export const buildWatchCli = (program, api) => {
3
+ program.command('build-watch [project]').usage('[options]').option('--only-self', 'build target project with nothing').option('-i, --init', 'init build beforebuild watch ').description('watch target project and target project’s dependencies').action(async (targetProjectName, option) => {
4
+ await buildWatch(targetProjectName, option, api);
5
5
  });
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { build } from "../commands";
2
- export const buildCli = program => {
2
+ export const buildCli = (program, api) => {
3
3
  program.command('build [project]').usage('[options]').option('--no-self', 'build without target project').option('-t, --dept', 'build target project with project’s dependent').option('--no-deps', 'build target project without project’s dependences').option('--only-self', 'build target project with nothing').option('-a, --all', 'build target project with project’s dependences and dependent').option('--content-hash', 'build target project use content hash cache').option('--git-hash', 'build target project use git hash cache').description('build target project').action(async (targetProjectName, option) => {
4
- await build(targetProjectName, option);
4
+ await build(targetProjectName, option, api);
5
5
  });
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { clear } from "../commands";
2
- export const clearCli = program => {
2
+ export const clearCli = (program, api) => {
3
3
  program.command('clear [projects...]').usage('[options]').option('--remove-dirs [dirs...]', 'remove dirs, default is node_modules').description('clear project dirs').action(async (targetProjectNames, option) => {
4
- await clear(targetProjectNames, option);
4
+ await clear(targetProjectNames, option, api);
5
5
  });
6
6
  };
@@ -1,8 +1,8 @@
1
1
  import { deploy } from "../commands";
2
- export const deployCli = program => {
2
+ export const deployCli = (program, api) => {
3
3
  program.command('deploy [project...]').usage('[options]').option('-p, --path [path]', 'Specify the path of the product output', 'output').description('deploy project').action(async (deployProjectNames, option) => {
4
4
  // 在查找 workspace 下项目时,默认忽略 output 下面的项目
5
5
  const ignoreMatchs = ['**/output/**'];
6
- await deploy(deployProjectNames, option, ignoreMatchs);
6
+ await deploy(api, deployProjectNames, option, ignoreMatchs);
7
7
  });
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { install } from "../commands";
2
- export const installCli = program => {
2
+ export const installCli = (program, api) => {
3
3
  program.command('install [project...]').usage('[options]').description('install deps for some projects').action(async (installProjectNames, option) => {
4
- await install(installProjectNames, option);
4
+ await install(installProjectNames, option, api);
5
5
  });
6
6
  };
@@ -1,13 +1,11 @@
1
- import { useAppContext } from '@modern-js/core';
2
1
  import { getMonorepoBaseData } from "../parse-config/monorepo";
3
2
  import { runBuildWatchTask } from "../features/dev";
4
3
  import { getProjects } from "../projects/get-projects";
5
4
  import { initDAG } from "../dag";
6
- export const buildWatch = async (targetProjectName, option) => {
7
- // eslint-disable-next-line react-hooks/rules-of-hooks
5
+ export const buildWatch = async (targetProjectName, option, api) => {
8
6
  const {
9
7
  appDirectory
10
- } = useAppContext();
8
+ } = api.useAppContext();
11
9
  const {
12
10
  onlySelf = false,
13
11
  init = false
@@ -4,17 +4,15 @@ 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 { useAppContext } from '@modern-js/core';
8
7
  import { getMonorepoBaseData } from "../parse-config/monorepo";
9
8
  import { runBuildTask, runAllBuildTask } from "../features/build";
10
9
  import { getProjects } from "../projects/get-projects";
11
10
  import { initDAG } from "../dag"; // import { clearProjectsMemoryFile } from './projects/clear-memory-files';
12
11
 
13
- export const build = async (targetProjectName, option) => {
14
- // eslint-disable-next-line react-hooks/rules-of-hooks
12
+ export const build = async (targetProjectName, option, api) => {
15
13
  const {
16
14
  appDirectory
17
- } = useAppContext();
15
+ } = api.useAppContext();
18
16
  const {
19
17
  self = true,
20
18
  dept = false,
@@ -1,15 +1,13 @@
1
- import { useAppContext } from '@modern-js/core';
2
1
  import { getProjects } from "../projects/get-projects";
3
2
  import { getMonorepoBaseData } from "../parse-config/monorepo";
4
3
  import { runClearTask } from "../features/clear";
5
- export const clear = async (projectNames, option) => {
4
+ export const clear = async (projectNames, option, api) => {
6
5
  const {
7
6
  removeDirs
8
- } = option; // eslint-disable-next-line react-hooks/rules-of-hooks
9
-
7
+ } = option;
10
8
  const {
11
9
  appDirectory
12
- } = useAppContext();
10
+ } = api.useAppContext();
13
11
  const projects = await getProjects({
14
12
  packagesMatchs: {
15
13
  enableAutoFinder: true
@@ -1,17 +1,15 @@
1
- import { useAppContext, mountHook } from '@modern-js/core';
2
1
  import { logger } from '@modern-js/utils';
3
2
  import { initDAG } from "../dag";
4
3
  import { getMonorepoBaseData } from "../parse-config/monorepo";
5
4
  import { getProjects } from "../projects/get-projects";
6
5
  import { deploy as runDeployTask } from "../features/deploy";
7
- export const deploy = async (deployProjectNames, option, ignoreMatchs = []) => {
6
+ export const deploy = async (api, deployProjectNames, option, ignoreMatchs = []) => {
8
7
  const {
9
8
  deployPath = 'output'
10
- } = option; // eslint-disable-next-line react-hooks/rules-of-hooks
11
-
9
+ } = option;
12
10
  const {
13
11
  appDirectory
14
- } = useAppContext();
12
+ } = api.useAppContext();
15
13
  logger.info(`start deploy ${deployProjectNames.join(',')}`);
16
14
  const projects = await getProjects({
17
15
  packagesMatchs: {
@@ -29,7 +27,8 @@ export const deploy = async (deployProjectNames, option, ignoreMatchs = []) => {
29
27
  packageManager,
30
28
  deployPath
31
29
  });
32
- mountHook().afterMonorepoDeploy({
30
+ const runners = api.useHookRunners();
31
+ runners.afterMonorepoDeploy({
33
32
  operator,
34
33
  deployProjectNames
35
34
  });
@@ -1,13 +1,11 @@
1
- import { useAppContext } from '@modern-js/core';
2
1
  import { runInstallTask } from "../features/install";
3
2
  import { getMonorepoBaseData } from "../parse-config/monorepo";
4
3
  import { getProjects } from "../projects/get-projects";
5
4
  import { initDAG } from "../dag";
6
- export const install = async (projectNames = [], option) => {
7
- // eslint-disable-next-line react-hooks/rules-of-hooks
5
+ export const install = async (projectNames = [], option, api) => {
8
6
  const {
9
7
  appDirectory
10
- } = useAppContext();
8
+ } = api.useAppContext();
11
9
  const {
12
10
  auto
13
11
  } = option;
@@ -1,8 +1,5 @@
1
- import { registerHook } from '@modern-js/core';
2
1
  import { createAsyncWorkflow } from '@modern-js/plugin';
3
2
  const afterMonorepoDeploy = createAsyncWorkflow();
4
- export const lifecycle = () => {
5
- registerHook({
6
- afterMonorepoDeploy
7
- });
3
+ export const hooks = {
4
+ afterMonorepoDeploy
8
5
  };
@@ -1,27 +1,27 @@
1
- import { createPlugin, usePlugins, defineConfig } from '@modern-js/core';
1
+ import ChangesetPlugin from '@modern-js/plugin-changeset';
2
2
  import { i18n } from "./locale";
3
3
  import { newCli, deployCli, clearCli } from "./cli";
4
4
  import { getLocaleLanguage } from "./utils/language";
5
- import { lifecycle } from "./hooks";
6
- export { defineConfig }; // eslint-disable-next-line react-hooks/rules-of-hooks
5
+ import { hooks } from "./hooks";
6
+ export default (() => ({
7
+ name: '@modern-js/monorepo-tools',
8
+ usePlugins: [ChangesetPlugin()],
9
+ registerHook: hooks,
10
+ setup: api => {
11
+ const locale = getLocaleLanguage();
12
+ i18n.changeLanguage({
13
+ locale
14
+ });
15
+ return {
16
+ commands({
17
+ program
18
+ }) {
19
+ clearCli(program, api);
20
+ deployCli(program, api);
21
+ newCli(program, locale);
22
+ }
7
23
 
8
- usePlugins([require.resolve('@modern-js/plugin-changeset/cli')]);
9
- export default createPlugin(() => {
10
- lifecycle();
11
- const locale = getLocaleLanguage();
12
- i18n.changeLanguage({
13
- locale
14
- });
15
- return {
16
- commands({
17
- program
18
- }) {
19
- clearCli(program);
20
- deployCli(program);
21
- newCli(program, locale);
22
- }
23
-
24
- };
25
- }, {
24
+ };
25
+ },
26
26
  post: ['@modern-js/plugin-changeset']
27
- });
27
+ }));
@@ -7,9 +7,9 @@ exports.buildWatchCli = void 0;
7
7
 
8
8
  var _commands = require("../commands");
9
9
 
10
- const buildWatchCli = program => {
11
- program.command('build-watch [project]').usage('[options]').option('--only-self', 'build target project with nothing').option('-i, --init', 'init build beforebuild watch ').description('watch target project and target project’s dependences').action(async (targetProjectName, option) => {
12
- await (0, _commands.buildWatch)(targetProjectName, option);
10
+ const buildWatchCli = (program, api) => {
11
+ program.command('build-watch [project]').usage('[options]').option('--only-self', 'build target project with nothing').option('-i, --init', 'init build beforebuild watch ').description('watch target project and target project’s dependencies').action(async (targetProjectName, option) => {
12
+ await (0, _commands.buildWatch)(targetProjectName, option, api);
13
13
  });
14
14
  };
15
15
 
@@ -7,9 +7,9 @@ exports.buildCli = void 0;
7
7
 
8
8
  var _commands = require("../commands");
9
9
 
10
- const buildCli = program => {
10
+ const buildCli = (program, api) => {
11
11
  program.command('build [project]').usage('[options]').option('--no-self', 'build without target project').option('-t, --dept', 'build target project with project’s dependent').option('--no-deps', 'build target project without project’s dependences').option('--only-self', 'build target project with nothing').option('-a, --all', 'build target project with project’s dependences and dependent').option('--content-hash', 'build target project use content hash cache').option('--git-hash', 'build target project use git hash cache').description('build target project').action(async (targetProjectName, option) => {
12
- await (0, _commands.build)(targetProjectName, option);
12
+ await (0, _commands.build)(targetProjectName, option, api);
13
13
  });
14
14
  };
15
15
 
@@ -7,9 +7,9 @@ exports.clearCli = void 0;
7
7
 
8
8
  var _commands = require("../commands");
9
9
 
10
- const clearCli = program => {
10
+ const clearCli = (program, api) => {
11
11
  program.command('clear [projects...]').usage('[options]').option('--remove-dirs [dirs...]', 'remove dirs, default is node_modules').description('clear project dirs').action(async (targetProjectNames, option) => {
12
- await (0, _commands.clear)(targetProjectNames, option);
12
+ await (0, _commands.clear)(targetProjectNames, option, api);
13
13
  });
14
14
  };
15
15
 
@@ -7,11 +7,11 @@ exports.deployCli = void 0;
7
7
 
8
8
  var _commands = require("../commands");
9
9
 
10
- const deployCli = program => {
10
+ const deployCli = (program, api) => {
11
11
  program.command('deploy [project...]').usage('[options]').option('-p, --path [path]', 'Specify the path of the product output', 'output').description('deploy project').action(async (deployProjectNames, option) => {
12
12
  // 在查找 workspace 下项目时,默认忽略 output 下面的项目
13
13
  const ignoreMatchs = ['**/output/**'];
14
- await (0, _commands.deploy)(deployProjectNames, option, ignoreMatchs);
14
+ await (0, _commands.deploy)(api, deployProjectNames, option, ignoreMatchs);
15
15
  });
16
16
  };
17
17
 
@@ -7,9 +7,9 @@ exports.installCli = void 0;
7
7
 
8
8
  var _commands = require("../commands");
9
9
 
10
- const installCli = program => {
10
+ const installCli = (program, api) => {
11
11
  program.command('install [project...]').usage('[options]').description('install deps for some projects').action(async (installProjectNames, option) => {
12
- await (0, _commands.install)(installProjectNames, option);
12
+ await (0, _commands.install)(installProjectNames, option, api);
13
13
  });
14
14
  };
15
15
 
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildWatch = void 0;
7
7
 
8
- var _core = require("@modern-js/core");
9
-
10
8
  var _monorepo = require("../parse-config/monorepo");
11
9
 
12
10
  var _dev = require("../features/dev");
@@ -15,11 +13,10 @@ var _getProjects = require("../projects/get-projects");
15
13
 
16
14
  var _dag = require("../dag");
17
15
 
18
- const buildWatch = async (targetProjectName, option) => {
19
- // eslint-disable-next-line react-hooks/rules-of-hooks
16
+ const buildWatch = async (targetProjectName, option, api) => {
20
17
  const {
21
18
  appDirectory
22
- } = (0, _core.useAppContext)();
19
+ } = api.useAppContext();
23
20
  const {
24
21
  onlySelf = false,
25
22
  init = false
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.build = void 0;
7
7
 
8
- var _core = require("@modern-js/core");
9
-
10
8
  var _monorepo = require("../parse-config/monorepo");
11
9
 
12
10
  var _build = require("../features/build");
@@ -21,11 +19,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
21
19
 
22
20
  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; }
23
21
 
24
- const build = async (targetProjectName, option) => {
25
- // eslint-disable-next-line react-hooks/rules-of-hooks
22
+ const build = async (targetProjectName, option, api) => {
26
23
  const {
27
24
  appDirectory
28
- } = (0, _core.useAppContext)();
25
+ } = api.useAppContext();
29
26
  const {
30
27
  self = true,
31
28
  dept = false,
@@ -5,22 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.clear = void 0;
7
7
 
8
- var _core = require("@modern-js/core");
9
-
10
8
  var _getProjects = require("../projects/get-projects");
11
9
 
12
10
  var _monorepo = require("../parse-config/monorepo");
13
11
 
14
12
  var _clear = require("../features/clear");
15
13
 
16
- const clear = async (projectNames, option) => {
14
+ const clear = async (projectNames, option, api) => {
17
15
  const {
18
16
  removeDirs
19
- } = option; // eslint-disable-next-line react-hooks/rules-of-hooks
20
-
17
+ } = option;
21
18
  const {
22
19
  appDirectory
23
- } = (0, _core.useAppContext)();
20
+ } = api.useAppContext();
24
21
  const projects = await (0, _getProjects.getProjects)({
25
22
  packagesMatchs: {
26
23
  enableAutoFinder: true
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.deploy = void 0;
7
7
 
8
- var _core = require("@modern-js/core");
9
-
10
8
  var _utils = require("@modern-js/utils");
11
9
 
12
10
  var _dag = require("../dag");
@@ -17,14 +15,13 @@ var _getProjects = require("../projects/get-projects");
17
15
 
18
16
  var _deploy = require("../features/deploy");
19
17
 
20
- const deploy = async (deployProjectNames, option, ignoreMatchs = []) => {
18
+ const deploy = async (api, deployProjectNames, option, ignoreMatchs = []) => {
21
19
  const {
22
20
  deployPath = 'output'
23
- } = option; // eslint-disable-next-line react-hooks/rules-of-hooks
24
-
21
+ } = option;
25
22
  const {
26
23
  appDirectory
27
- } = (0, _core.useAppContext)();
24
+ } = api.useAppContext();
28
25
 
29
26
  _utils.logger.info(`start deploy ${deployProjectNames.join(',')}`);
30
27
 
@@ -44,7 +41,8 @@ const deploy = async (deployProjectNames, option, ignoreMatchs = []) => {
44
41
  packageManager,
45
42
  deployPath
46
43
  });
47
- (0, _core.mountHook)().afterMonorepoDeploy({
44
+ const runners = api.useHookRunners();
45
+ runners.afterMonorepoDeploy({
48
46
  operator,
49
47
  deployProjectNames
50
48
  });
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.install = void 0;
7
7
 
8
- var _core = require("@modern-js/core");
9
-
10
8
  var _install = require("../features/install");
11
9
 
12
10
  var _monorepo = require("../parse-config/monorepo");
@@ -15,11 +13,10 @@ var _getProjects = require("../projects/get-projects");
15
13
 
16
14
  var _dag = require("../dag");
17
15
 
18
- const install = async (projectNames = [], option) => {
19
- // eslint-disable-next-line react-hooks/rules-of-hooks
16
+ const install = async (projectNames = [], option, api) => {
20
17
  const {
21
18
  appDirectory
22
- } = (0, _core.useAppContext)();
19
+ } = api.useAppContext();
23
20
  const {
24
21
  auto
25
22
  } = option;
@@ -3,18 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.lifecycle = void 0;
7
-
8
- var _core = require("@modern-js/core");
6
+ exports.hooks = void 0;
9
7
 
10
8
  var _plugin = require("@modern-js/plugin");
11
9
 
12
10
  const afterMonorepoDeploy = (0, _plugin.createAsyncWorkflow)();
13
-
14
- const lifecycle = () => {
15
- (0, _core.registerHook)({
16
- afterMonorepoDeploy
17
- });
11
+ const hooks = {
12
+ afterMonorepoDeploy
18
13
  };
19
-
20
- exports.lifecycle = lifecycle;
14
+ exports.hooks = hooks;
@@ -4,14 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- Object.defineProperty(exports, "defineConfig", {
8
- enumerable: true,
9
- get: function () {
10
- return _core.defineConfig;
11
- }
12
- });
13
7
 
14
- var _core = require("@modern-js/core");
8
+ var _pluginChangeset = _interopRequireDefault(require("@modern-js/plugin-changeset"));
15
9
 
16
10
  var _locale = require("./locale");
17
11
 
@@ -21,28 +15,30 @@ var _language = require("./utils/language");
21
15
 
22
16
  var _hooks = require("./hooks");
23
17
 
24
- // eslint-disable-next-line react-hooks/rules-of-hooks
25
- (0, _core.usePlugins)([require.resolve('@modern-js/plugin-changeset/cli')]);
26
-
27
- var _default = (0, _core.createPlugin)(() => {
28
- (0, _hooks.lifecycle)();
29
- const locale = (0, _language.getLocaleLanguage)();
30
-
31
- _locale.i18n.changeLanguage({
32
- locale
33
- });
34
-
35
- return {
36
- commands({
37
- program
38
- }) {
39
- (0, _cli.clearCli)(program);
40
- (0, _cli.deployCli)(program);
41
- (0, _cli.newCli)(program, locale);
42
- }
43
-
44
- };
45
- }, {
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ var _default = () => ({
21
+ name: '@modern-js/monorepo-tools',
22
+ usePlugins: [(0, _pluginChangeset.default)()],
23
+ registerHook: _hooks.hooks,
24
+ setup: api => {
25
+ const locale = (0, _language.getLocaleLanguage)();
26
+
27
+ _locale.i18n.changeLanguage({
28
+ locale
29
+ });
30
+
31
+ return {
32
+ commands({
33
+ program
34
+ }) {
35
+ (0, _cli.clearCli)(program, api);
36
+ (0, _cli.deployCli)(program, api);
37
+ (0, _cli.newCli)(program, locale);
38
+ }
39
+
40
+ };
41
+ },
46
42
  post: ['@modern-js/plugin-changeset']
47
43
  });
48
44
 
@@ -1,2 +1,3 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  import { Command } from 'commander';
2
- export declare const buildWatchCli: (program: Command) => void;
3
+ export declare const buildWatchCli: (program: Command, api: PluginAPI) => void;
@@ -1,2 +1,3 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  import { Command } from 'commander';
2
- export declare const buildCli: (program: Command) => void;
3
+ export declare const buildCli: (program: Command, api: PluginAPI) => void;
@@ -1,2 +1,3 @@
1
1
  import { Command } from 'commander';
2
- export declare const clearCli: (program: Command) => void;
2
+ import type { PluginAPI } from '@modern-js/core';
3
+ export declare const clearCli: (program: Command, api: PluginAPI) => void;
@@ -1,2 +1,3 @@
1
1
  import { Command } from 'commander';
2
- export declare const deployCli: (program: Command) => void;
2
+ import type { PluginAPI } from '@modern-js/core';
3
+ export declare const deployCli: (program: Command, api: PluginAPI) => void;
@@ -1,2 +1,3 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  import { Command } from 'commander';
2
- export declare const installCli: (program: Command) => void;
3
+ export declare const installCli: (program: Command, api: PluginAPI) => void;
@@ -1,5 +1,6 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  export interface IBuildWatchCommandOption {
2
3
  onlySelf?: boolean;
3
4
  init?: boolean;
4
5
  }
5
- export declare const buildWatch: (targetProjectName: string, option: IBuildWatchCommandOption) => Promise<void>;
6
+ export declare const buildWatch: (targetProjectName: string, option: IBuildWatchCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,3 +1,4 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  export interface IBuildCommandOption {
2
3
  self?: boolean;
3
4
  dept?: boolean;
@@ -7,4 +8,4 @@ export interface IBuildCommandOption {
7
8
  contentHash?: boolean;
8
9
  gitHash?: boolean;
9
10
  }
10
- export declare const build: (targetProjectName: string, option: IBuildCommandOption) => Promise<void>;
11
+ export declare const build: (targetProjectName: string, option: IBuildCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,4 +1,5 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  export interface IClearCommandOption {
2
3
  removeDirs?: string[];
3
4
  }
4
- export declare const clear: (projectNames: string[], option: IClearCommandOption) => Promise<void>;
5
+ export declare const clear: (projectNames: string[], option: IClearCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,4 +1,5 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  export interface IDeployCommandOption {
2
3
  deployPath?: string;
3
4
  }
4
- export declare const deploy: (deployProjectNames: string[], option: IDeployCommandOption, ignoreMatchs?: string[]) => Promise<void>;
5
+ export declare const deploy: (api: PluginAPI, deployProjectNames: string[], option: IDeployCommandOption, ignoreMatchs?: string[]) => Promise<void>;
@@ -1,4 +1,5 @@
1
+ import type { PluginAPI } from '@modern-js/core';
1
2
  export interface IInstallCommandOption {
2
3
  auto?: boolean;
3
4
  }
4
- export declare const install: (projectNames: string[] | undefined, option: IInstallCommandOption) => Promise<void>;
5
+ export declare const install: (projectNames: string[] | undefined, option: IInstallCommandOption, api: PluginAPI) => Promise<void>;
@@ -1 +1,7 @@
1
- export declare const lifecycle: () => void;
1
+ import type { DagOperator } from '../dag/operator';
2
+ export declare const hooks: {
3
+ afterMonorepoDeploy: import("@modern-js/plugin").AsyncWorkflow<{
4
+ operator: DagOperator;
5
+ deployProjectNames: string[];
6
+ }, void>;
7
+ };
@@ -1,6 +1,5 @@
1
- import { defineConfig } from '@modern-js/core';
2
- export { defineConfig };
1
+ import type { CliPlugin } from '@modern-js/core';
3
2
 
4
- declare const _default: any;
3
+ declare const _default: () => CliPlugin;
5
4
 
6
5
  export default _default;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.0",
14
+ "version": "1.4.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -35,14 +35,14 @@
35
35
  "modern": "./bin/modern.js"
36
36
  },
37
37
  "dependencies": {
38
- "@modern-js/core": "^1.4.4",
38
+ "@modern-js/core": "^1.6.0",
39
39
  "@babel/runtime": "^7",
40
40
  "@modern-js/i18n-cli-language-detector": "^1.2.1",
41
41
  "@modern-js/new-action": "^1.3.3",
42
- "@modern-js/plugin": "^1.2.1",
43
- "@modern-js/plugin-changeset": "^1.2.2",
42
+ "@modern-js/plugin": "^1.3.2",
43
+ "@modern-js/plugin-changeset": "^1.2.3",
44
44
  "@modern-js/plugin-i18n": "^1.2.1",
45
- "@modern-js/utils": "^1.3.3",
45
+ "@modern-js/utils": "^1.3.6",
46
46
  "@rushstack/node-core-library": "^3.39.1",
47
47
  "@rushstack/package-deps-hash": "^3.0.54",
48
48
  "anymatch": "^3.1.2",