@modern-js/monorepo-tools 1.3.3-beta.2 → 1.3.3-beta.3

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.
@@ -1,6 +1,8 @@
1
1
  import { deploy } from "../commands";
2
2
  export const deployCli = program => {
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
- await deploy(deployProjectNames, option);
4
+ // 在查找 workspace 下项目时,默认忽略 output 下面的项目
5
+ const ignoreMatchs = ['**/output/**'];
6
+ await deploy(deployProjectNames, option, ignoreMatchs);
5
7
  });
6
8
  };
@@ -4,7 +4,7 @@ import { initDAG } from "../dag";
4
4
  import { getMonorepoBaseData } from "../parse-config/monorepo";
5
5
  import { getProjects } from "../projects/get-projects";
6
6
  import { deploy as runDeployTask } from "../features/deploy";
7
- export const deploy = async (deployProjectNames, option) => {
7
+ export const deploy = async (deployProjectNames, option, ignoreMatchs = []) => {
8
8
  const {
9
9
  deployPath = 'output'
10
10
  } = option; // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -16,7 +16,8 @@ export const deploy = async (deployProjectNames, option) => {
16
16
  const projects = await getProjects({
17
17
  packagesMatchs: {
18
18
  enableAutoFinder: true
19
- }
19
+ },
20
+ packagesIgnoreMatchs: ignoreMatchs
20
21
  }, appDirectory);
21
22
  const {
22
23
  rootPath,
@@ -103,7 +103,8 @@ const checkAndRunDeployCommand = async (monorepoPath, targetProject, packageMana
103
103
  (_childProcess$stderr = childProcess.stderr) === null || _childProcess$stderr === void 0 ? void 0 : _childProcess$stderr.pipe(process.stderr);
104
104
  await childProcess;
105
105
  }
106
- };
106
+ }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
107
+
107
108
 
108
109
  const installDependency = async (deployDir, packageManager) => {
109
110
  // TODO: 使用公共方法替换
@@ -0,0 +1,8 @@
1
+ import { registerHook } from '@modern-js/core';
2
+ import { createAsyncWorkflow } from '@modern-js/plugin';
3
+ const afterMonorepoDeploy = createAsyncWorkflow();
4
+ export const lifecycle = () => {
5
+ registerHook({
6
+ afterMonorepoDeploy
7
+ });
8
+ };
@@ -1,17 +1,9 @@
1
- import { createPlugin, usePlugins, defineConfig, registerHook } from '@modern-js/core';
2
- import { createAsyncWorkflow } from '@modern-js/plugin';
1
+ import { createPlugin, usePlugins, defineConfig } from '@modern-js/core';
3
2
  import { i18n } from "./locale";
4
3
  import { newCli, deployCli, clearCli } from "./cli";
5
4
  import { getLocaleLanguage } from "./utils/language";
6
- export { defineConfig };
7
- const afterMonorepoDeploy = createAsyncWorkflow();
8
-
9
- const lifecycle = () => {
10
- registerHook({
11
- afterMonorepoDeploy
12
- });
13
- }; // eslint-disable-next-line react-hooks/rules-of-hooks
14
-
5
+ import { lifecycle } from "./hooks";
6
+ export { defineConfig }; // eslint-disable-next-line react-hooks/rules-of-hooks
15
7
 
16
8
  usePlugins([require.resolve('@modern-js/plugin-changeset/cli')]);
17
9
  export default createPlugin(() => {
@@ -9,7 +9,9 @@ var _commands = require("../commands");
9
9
 
10
10
  const deployCli = program => {
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
- await (0, _commands.deploy)(deployProjectNames, option);
12
+ // 在查找 workspace 下项目时,默认忽略 output 下面的项目
13
+ const ignoreMatchs = ['**/output/**'];
14
+ await (0, _commands.deploy)(deployProjectNames, option, ignoreMatchs);
13
15
  });
14
16
  };
15
17
 
@@ -17,7 +17,7 @@ var _getProjects = require("../projects/get-projects");
17
17
 
18
18
  var _deploy = require("../features/deploy");
19
19
 
20
- const deploy = async (deployProjectNames, option) => {
20
+ const deploy = async (deployProjectNames, option, ignoreMatchs = []) => {
21
21
  const {
22
22
  deployPath = 'output'
23
23
  } = option; // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -31,7 +31,8 @@ const deploy = async (deployProjectNames, option) => {
31
31
  const projects = await (0, _getProjects.getProjects)({
32
32
  packagesMatchs: {
33
33
  enableAutoFinder: true
34
- }
34
+ },
35
+ packagesIgnoreMatchs: ignoreMatchs
35
36
  }, appDirectory);
36
37
  const {
37
38
  rootPath,
@@ -124,7 +124,8 @@ const checkAndRunDeployCommand = async (monorepoPath, targetProject, packageMana
124
124
  (_childProcess$stderr = childProcess.stderr) === null || _childProcess$stderr === void 0 ? void 0 : _childProcess$stderr.pipe(process.stderr);
125
125
  await childProcess;
126
126
  }
127
- };
127
+ }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
128
+
128
129
 
129
130
  const installDependency = async (deployDir, packageManager) => {
130
131
  // TODO: 使用公共方法替换
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.lifecycle = void 0;
7
+
8
+ var _core = require("@modern-js/core");
9
+
10
+ var _plugin = require("@modern-js/plugin");
11
+
12
+ const afterMonorepoDeploy = (0, _plugin.createAsyncWorkflow)();
13
+
14
+ const lifecycle = () => {
15
+ (0, _core.registerHook)({
16
+ afterMonorepoDeploy
17
+ });
18
+ };
19
+
20
+ exports.lifecycle = lifecycle;
@@ -13,27 +13,19 @@ Object.defineProperty(exports, "defineConfig", {
13
13
 
14
14
  var _core = require("@modern-js/core");
15
15
 
16
- var _plugin = require("@modern-js/plugin");
17
-
18
16
  var _locale = require("./locale");
19
17
 
20
18
  var _cli = require("./cli");
21
19
 
22
20
  var _language = require("./utils/language");
23
21
 
24
- const afterMonorepoDeploy = (0, _plugin.createAsyncWorkflow)();
25
-
26
- const lifecycle = () => {
27
- (0, _core.registerHook)({
28
- afterMonorepoDeploy
29
- });
30
- }; // eslint-disable-next-line react-hooks/rules-of-hooks
31
-
22
+ var _hooks = require("./hooks");
32
23
 
24
+ // eslint-disable-next-line react-hooks/rules-of-hooks
33
25
  (0, _core.usePlugins)([require.resolve('@modern-js/plugin-changeset/cli')]);
34
26
 
35
27
  var _default = (0, _core.createPlugin)(() => {
36
- lifecycle();
28
+ (0, _hooks.lifecycle)();
37
29
  const locale = (0, _language.getLocaleLanguage)();
38
30
 
39
31
  _locale.i18n.changeLanguage({
@@ -1,4 +1,4 @@
1
1
  export interface IDeployCommandOption {
2
2
  deployPath?: string;
3
3
  }
4
- export declare const deploy: (deployProjectNames: string[], option: IDeployCommandOption) => Promise<void>;
4
+ export declare const deploy: (deployProjectNames: string[], option: IDeployCommandOption, ignoreMatchs?: string[]) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const lifecycle: () => void;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.3.3-beta.2",
14
+ "version": "1.3.3-beta.3",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",