@modern-js/monorepo-tools 2.0.0-beta.2 → 2.0.0-beta.4

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 (104) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/bin/modern.js +3 -1
  3. package/dist/js/modern/cli/build-watch.js +30 -5
  4. package/dist/js/modern/cli/build.js +31 -5
  5. package/dist/js/modern/cli/clear.js +30 -5
  6. package/dist/js/modern/cli/deploy.js +35 -7
  7. package/dist/js/modern/cli/index.js +1 -1
  8. package/dist/js/modern/cli/install.js +30 -5
  9. package/dist/js/modern/cli/new.js +56 -14
  10. package/dist/js/modern/commands/build-watch.js +32 -18
  11. package/dist/js/modern/commands/build.js +49 -23
  12. package/dist/js/modern/commands/clear.js +31 -15
  13. package/dist/js/modern/commands/deploy.js +38 -24
  14. package/dist/js/modern/commands/index.js +1 -1
  15. package/dist/js/modern/commands/install.js +32 -17
  16. package/dist/js/modern/constants.js +13 -9
  17. package/dist/js/modern/dag/create.js +27 -23
  18. package/dist/js/modern/dag/edge-manager.js +5 -4
  19. package/dist/js/modern/dag/index.js +6 -5
  20. package/dist/js/modern/dag/operator.js +174 -156
  21. package/dist/js/modern/dag/task.js +64 -39
  22. package/dist/js/modern/dag/utils.js +32 -38
  23. package/dist/js/modern/features/build/index.js +47 -28
  24. package/dist/js/modern/features/clear/index.js +16 -15
  25. package/dist/js/modern/features/deploy/index.js +107 -82
  26. package/dist/js/modern/features/dev/cmds.js +4 -3
  27. package/dist/js/modern/features/dev/create-task.js +43 -34
  28. package/dist/js/modern/features/dev/index.js +60 -41
  29. package/dist/js/modern/features/dev/watch-projects-state.js +47 -24
  30. package/dist/js/modern/features/install/index.js +43 -22
  31. package/dist/js/modern/hooks/index.js +6 -3
  32. package/dist/js/modern/index.js +18 -16
  33. package/dist/js/modern/locale/en.js +10 -7
  34. package/dist/js/modern/locale/index.js +6 -6
  35. package/dist/js/modern/locale/zh.js +11 -8
  36. package/dist/js/modern/log/error.js +6 -3
  37. package/dist/js/modern/log/multi-tasks-log.js +25 -34
  38. package/dist/js/modern/log/time.js +26 -11
  39. package/dist/js/modern/log/utils.js +9 -5
  40. package/dist/js/modern/package/index.js +5 -6
  41. package/dist/js/modern/parse-config/index.js +49 -22
  42. package/dist/js/modern/parse-config/monorepo.js +41 -26
  43. package/dist/js/modern/projects/check-project-change.js +59 -30
  44. package/dist/js/modern/projects/clear-memory-files.js +17 -7
  45. package/dist/js/modern/projects/get-projects-by-packages-config.js +89 -52
  46. package/dist/js/modern/projects/get-projects-by-workspace-file.js +68 -32
  47. package/dist/js/modern/projects/get-projects.js +96 -53
  48. package/dist/js/modern/type.js +0 -1
  49. package/dist/js/modern/utils/install.js +36 -19
  50. package/dist/js/modern/utils/language.js +6 -3
  51. package/dist/js/node/cli/build-watch.js +47 -10
  52. package/dist/js/node/cli/build.js +48 -10
  53. package/dist/js/node/cli/clear.js +47 -10
  54. package/dist/js/node/cli/deploy.js +52 -12
  55. package/dist/js/node/cli/index.js +22 -71
  56. package/dist/js/node/cli/install.js +47 -10
  57. package/dist/js/node/cli/new.js +73 -19
  58. package/dist/js/node/commands/build-watch.js +55 -29
  59. package/dist/js/node/commands/build.js +72 -32
  60. package/dist/js/node/commands/clear.js +53 -25
  61. package/dist/js/node/commands/deploy.js +61 -35
  62. package/dist/js/node/commands/index.js +21 -60
  63. package/dist/js/node/commands/install.js +55 -28
  64. package/dist/js/node/constants.js +28 -13
  65. package/dist/js/node/dag/create.js +44 -28
  66. package/dist/js/node/dag/edge-manager.js +21 -8
  67. package/dist/js/node/dag/index.js +26 -13
  68. package/dist/js/node/dag/operator.js +209 -174
  69. package/dist/js/node/dag/task.js +88 -46
  70. package/dist/js/node/dag/utils.js +51 -47
  71. package/dist/js/node/features/build/index.js +79 -47
  72. package/dist/js/node/features/clear/index.js +44 -28
  73. package/dist/js/node/features/deploy/index.js +135 -104
  74. package/dist/js/node/features/dev/cmds.js +22 -9
  75. package/dist/js/node/features/dev/create-task.js +75 -51
  76. package/dist/js/node/features/dev/index.js +94 -58
  77. package/dist/js/node/features/dev/watch-projects-state.js +69 -30
  78. package/dist/js/node/features/install/index.js +78 -41
  79. package/dist/js/node/hooks/index.js +23 -8
  80. package/dist/js/node/index.js +51 -32
  81. package/dist/js/node/locale/en.js +26 -11
  82. package/dist/js/node/locale/index.js +27 -15
  83. package/dist/js/node/locale/zh.js +27 -12
  84. package/dist/js/node/log/error.js +22 -7
  85. package/dist/js/node/log/multi-tasks-log.js +44 -41
  86. package/dist/js/node/log/time.js +43 -18
  87. package/dist/js/node/log/utils.js +26 -10
  88. package/dist/js/node/package/index.js +21 -10
  89. package/dist/js/node/parse-config/index.js +73 -30
  90. package/dist/js/node/parse-config/monorepo.js +71 -44
  91. package/dist/js/node/projects/check-project-change.js +96 -56
  92. package/dist/js/node/projects/clear-memory-files.js +38 -15
  93. package/dist/js/node/projects/get-projects-by-packages-config.js +116 -65
  94. package/dist/js/node/projects/get-projects-by-workspace-file.js +103 -55
  95. package/dist/js/node/projects/get-projects.js +109 -61
  96. package/dist/js/node/type.js +0 -5
  97. package/dist/js/node/utils/install.js +63 -31
  98. package/dist/js/node/utils/language.js +24 -8
  99. package/dist/types/dag/operator.d.ts +3 -0
  100. package/dist/types/dag/utils.d.ts +1 -0
  101. package/dist/types/features/dev/index.d.ts +1 -0
  102. package/dist/types/index.d.ts +2 -0
  103. package/dist/types/projects/get-projects.d.ts +1 -0
  104. package/package.json +12 -19
@@ -1,24 +1,60 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
- 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; }
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __async = (__this, __arguments, generator) => {
18
+ return new Promise((resolve, reject) => {
19
+ var fulfilled = (value) => {
20
+ try {
21
+ step(generator.next(value));
22
+ } catch (e) {
23
+ reject(e);
24
+ }
25
+ };
26
+ var rejected = (value) => {
27
+ try {
28
+ step(generator.throw(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
34
+ step((generator = generator.apply(__this, __arguments)).next());
35
+ });
36
+ };
4
37
  import { errorLog } from "../log/error";
5
38
  import { getMonorepoBaseData } from "../parse-config/monorepo";
6
- import { getProjectsByPackageConfig, syncGetProjectsByPackageConfig } from "./get-projects-by-packages-config";
7
- import { getProjectsByWorkspaceFile, syncGetProjectsByWorkspaceFile } from "./get-projects-by-workspace-file";
8
- var FindProjectsMode;
9
- (function (FindProjectsMode) {
10
- FindProjectsMode[FindProjectsMode["Rough"] = 0] = "Rough";
11
- FindProjectsMode[FindProjectsMode["Precise"] = 1] = "Precise";
12
- })(FindProjectsMode || (FindProjectsMode = {}));
39
+ import {
40
+ getProjectsByPackageConfig,
41
+ syncGetProjectsByPackageConfig
42
+ } from "./get-projects-by-packages-config";
43
+ import {
44
+ getProjectsByWorkspaceFile,
45
+ syncGetProjectsByWorkspaceFile
46
+ } from "./get-projects-by-workspace-file";
47
+ var FindProjectsMode = /* @__PURE__ */ ((FindProjectsMode2) => {
48
+ FindProjectsMode2[FindProjectsMode2["Rough"] = 0] = "Rough";
49
+ FindProjectsMode2[FindProjectsMode2["Precise"] = 1] = "Precise";
50
+ return FindProjectsMode2;
51
+ })(FindProjectsMode || {});
13
52
  const getProjectsByProjectsConfig = (rootPath, configs = []) => {
14
53
  const subProjects = [];
15
54
  for (const config of configs) {
16
55
  subProjects.push({
17
56
  name: config.name,
18
- extra: {
19
- path: config.path
20
- },
21
- // dagNodeEdge: 0,
57
+ extra: { path: config.path },
22
58
  dependencyEdge: 0,
23
59
  dependentEdge: 0,
24
60
  checkedCircle: false,
@@ -27,23 +63,24 @@ const getProjectsByProjectsConfig = (rootPath, configs = []) => {
27
63
  }
28
64
  return subProjects;
29
65
  };
30
- const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
66
+ const getProjectsByPackagesMatch = (rootPath, match, ignore) => __async(void 0, null, function* () {
31
67
  let projects = [];
32
68
  if (Array.isArray(match)) {
33
- // like lerna`s packages config
34
- projects = await getProjectsByPackageConfig(rootPath, match, ignore);
69
+ projects = yield getProjectsByPackageConfig(rootPath, match, ignore);
35
70
  } else {
36
- // use workspace file
37
- projects = await getProjectsByWorkspaceFile(rootPath, match, ignore);
71
+ projects = yield getProjectsByWorkspaceFile(
72
+ rootPath,
73
+ match,
74
+ ignore
75
+ );
38
76
  }
39
77
  const subProjects = [];
40
78
  for (const project of projects) {
41
79
  subProjects.push({
42
80
  name: project.name,
43
- extra: _objectSpread({
81
+ extra: __spreadValues({
44
82
  path: project.path
45
83
  }, project.json),
46
- // dagNodeEdge: 0,
47
84
  dependencyEdge: 0,
48
85
  dependentEdge: 0,
49
86
  checkedCircle: false,
@@ -51,25 +88,25 @@ const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
51
88
  });
52
89
  }
53
90
  return subProjects;
54
- };
91
+ });
55
92
  const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
56
93
  let projects = [];
57
- // TODO: code start
58
94
  if (Array.isArray(match)) {
59
- // like lerna`s packages config
60
95
  projects = syncGetProjectsByPackageConfig(rootPath, match, ignore);
61
96
  } else {
62
- // use workspace file
63
- projects = syncGetProjectsByWorkspaceFile(rootPath, match, ignore);
97
+ projects = syncGetProjectsByWorkspaceFile(
98
+ rootPath,
99
+ match,
100
+ ignore
101
+ );
64
102
  }
65
103
  const subProjects = [];
66
104
  for (const project of projects) {
67
105
  subProjects.push({
68
106
  name: project.name,
69
- extra: _objectSpread({
107
+ extra: __spreadValues({
70
108
  path: project.path
71
109
  }, project.json),
72
- // dagNodeEdge: 0,
73
110
  dependencyEdge: 0,
74
111
  dependentEdge: 0,
75
112
  checkedCircle: false,
@@ -78,46 +115,52 @@ const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
78
115
  }
79
116
  return subProjects;
80
117
  };
81
- const checkFindProjectsMode = (config
82
- // eslint-disable-next-line consistent-return
83
- ) => {
118
+ const checkFindProjectsMode = (config) => {
84
119
  if (config.packagesMatchs && Array.isArray(config.packagesMatchs)) {
85
- return FindProjectsMode.Rough;
120
+ return 0 /* Rough */;
86
121
  }
87
- if (config.packagesMatchs && typeof config.packagesMatchs === 'object' && (config.packagesMatchs.workspaceFile || config.packagesMatchs.enableAutoFinder)) {
88
- return FindProjectsMode.Rough;
122
+ if (config.packagesMatchs && typeof config.packagesMatchs === "object" && (config.packagesMatchs.workspaceFile || config.packagesMatchs.enableAutoFinder)) {
123
+ return 0 /* Rough */;
89
124
  }
90
125
  if (config.projectsConfig && Array.isArray(config.projectsConfig)) {
91
- return FindProjectsMode.Precise;
126
+ return 1 /* Precise */;
92
127
  }
93
128
  if (config.projectsConfig && config.packagesMatchs) {
94
- errorLog('There can not be both `packagesMatchs` and `projectsConfig`');
129
+ errorLog("There can not be both `packagesMatchs` and `projectsConfig`");
95
130
  }
96
- errorLog('No `packagesMatchs` and `projectsConfig` configurations found');
131
+ errorLog("No `packagesMatchs` and `projectsConfig` configurations found");
97
132
  };
98
- export const getProjects = async (config, currentDir = process.cwd()) => {
99
- const {
100
- rootPath
101
- } = getMonorepoBaseData(currentDir);
133
+ const getProjects = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (config, currentDir = process.cwd()) {
134
+ const { rootPath } = getMonorepoBaseData(currentDir);
102
135
  const mode = checkFindProjectsMode(config);
103
136
  let projects = [];
104
- if (mode === FindProjectsMode.Rough) {
105
- projects = await getProjectsByPackagesMatch(rootPath, config.packagesMatchs, config.packagesIgnoreMatchs || []);
106
- } else if (mode === FindProjectsMode.Precise) {
137
+ if (mode === 0 /* Rough */) {
138
+ projects = yield getProjectsByPackagesMatch(
139
+ rootPath,
140
+ config.packagesMatchs,
141
+ config.packagesIgnoreMatchs || []
142
+ );
143
+ } else if (mode === 1 /* Precise */) {
107
144
  projects = getProjectsByProjectsConfig(rootPath, config.projectsConfig);
108
145
  }
109
146
  return projects;
110
- };
111
- export const syncGetProjects = (config, currentDir = process.cwd()) => {
112
- const {
113
- rootPath
114
- } = getMonorepoBaseData(currentDir);
147
+ });
148
+ const syncGetProjects = (config, currentDir = process.cwd()) => {
149
+ const { rootPath } = getMonorepoBaseData(currentDir);
115
150
  const mode = checkFindProjectsMode(config);
116
151
  let projects = [];
117
- if (mode === FindProjectsMode.Rough) {
118
- projects = syncGetProjectsByPackagesMatch(rootPath, config.packagesMatchs, config.packagesIgnoreMatchs || []);
119
- } else if (mode === FindProjectsMode.Precise) {
152
+ if (mode === 0 /* Rough */) {
153
+ projects = syncGetProjectsByPackagesMatch(
154
+ rootPath,
155
+ config.packagesMatchs,
156
+ config.packagesIgnoreMatchs || []
157
+ );
158
+ } else if (mode === 1 /* Precise */) {
120
159
  projects = getProjectsByProjectsConfig(rootPath, config.projectsConfig);
121
160
  }
122
161
  return projects;
123
- };
162
+ };
163
+ export {
164
+ getProjects,
165
+ syncGetProjects
166
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +1,47 @@
1
- import * as path from 'path';
2
- import { fs, execa } from '@modern-js/utils';
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import * as path from "path";
22
+ import { fs, execa } from "@modern-js/utils";
3
23
  import { LOCK_FILE } from "../constants";
4
- export const removeLockFile = (rootPath, packageManager) => {
5
- if (packageManager === 'pnpm') {
24
+ const removeLockFile = (rootPath, packageManager) => {
25
+ if (packageManager === "pnpm") {
6
26
  fs.removeSync(path.join(rootPath, LOCK_FILE.PNPM));
7
- } else if (packageManager === 'yarn') {
27
+ } else if (packageManager === "yarn") {
8
28
  fs.removeSync(path.join(rootPath, LOCK_FILE.YARN));
9
- } else if (packageManager === 'npm') {
29
+ } else if (packageManager === "npm") {
10
30
  fs.removeSync(path.join(rootPath, LOCK_FILE.NPM));
11
31
  }
12
32
  };
13
- export const installByPackageManager = async (packageManager, {
14
- rootPath,
15
- removeLock
16
- }) => {
33
+ const installByPackageManager = (_0, _1) => __async(void 0, [_0, _1], function* (packageManager, { rootPath, removeLock }) {
17
34
  if (removeLock) {
18
35
  removeLockFile(rootPath, packageManager);
19
36
  }
20
- if (packageManager === 'pnpm') {
21
- await execa('pnpm', ['install'], {
22
- stdio: 'inherit'
23
- });
37
+ if (packageManager === "pnpm") {
38
+ yield execa("pnpm", ["install"], { stdio: "inherit" });
24
39
  }
25
- if (packageManager === 'yarn') {
26
- await execa('yarn', ['install'], {
27
- stdio: 'inherit'
28
- });
40
+ if (packageManager === "yarn") {
41
+ yield execa("yarn", ["install"], { stdio: "inherit" });
29
42
  }
30
- };
43
+ });
44
+ export {
45
+ installByPackageManager,
46
+ removeLockFile
47
+ };
@@ -1,5 +1,8 @@
1
- import { I18CLILanguageDetector } from '@modern-js/plugin-i18n/language-detector';
2
- export function getLocaleLanguage() {
1
+ import { I18CLILanguageDetector } from "@modern-js/plugin-i18n/language-detector";
2
+ function getLocaleLanguage() {
3
3
  const detector = new I18CLILanguageDetector();
4
4
  return detector.detect();
5
- }
5
+ }
6
+ export {
7
+ getLocaleLanguage
8
+ };
@@ -1,13 +1,50 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ buildWatchCli: () => buildWatchCli
5
21
  });
6
- exports.buildWatchCli = void 0;
7
- var _commands = require("../commands");
8
- const buildWatchCli = (program, api) => {
9
- 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) => {
10
- await (0, _commands.buildWatch)(targetProjectName, option, api);
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var import_commands = require("../commands");
24
+ var __async = (__this, __arguments, generator) => {
25
+ return new Promise((resolve, reject) => {
26
+ var fulfilled = (value) => {
27
+ try {
28
+ step(generator.next(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var rejected = (value) => {
34
+ try {
35
+ step(generator.throw(value));
36
+ } catch (e) {
37
+ reject(e);
38
+ }
39
+ };
40
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
41
+ step((generator = generator.apply(__this, __arguments)).next());
11
42
  });
12
43
  };
13
- exports.buildWatchCli = buildWatchCli;
44
+ const buildWatchCli = (program, api) => {
45
+ 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(
46
+ (targetProjectName, option) => __async(void 0, null, function* () {
47
+ yield (0, import_commands.buildWatch)(targetProjectName, option, api);
48
+ })
49
+ );
50
+ };
@@ -1,13 +1,51 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ buildCli: () => buildCli
5
21
  });
6
- exports.buildCli = void 0;
7
- var _commands = require("../commands");
8
- const buildCli = (program, api) => {
9
- 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 dependencies').option('--only-self', 'build target project with nothing').option('-a, --all', 'build target project with project’s dependencies 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) => {
10
- await (0, _commands.build)(targetProjectName, option, api);
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var import_commands = require("../commands");
24
+ var __async = (__this, __arguments, generator) => {
25
+ return new Promise((resolve, reject) => {
26
+ var fulfilled = (value) => {
27
+ try {
28
+ step(generator.next(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var rejected = (value) => {
34
+ try {
35
+ step(generator.throw(value));
36
+ } catch (e) {
37
+ reject(e);
38
+ }
39
+ };
40
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
41
+ step((generator = generator.apply(__this, __arguments)).next());
11
42
  });
12
43
  };
13
- exports.buildCli = buildCli;
44
+ const buildCli = (program, api) => {
45
+ 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 dependencies").option("--only-self", "build target project with nothing").option(
46
+ "-a, --all",
47
+ "build target project with project’s dependencies and dependent"
48
+ ).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((targetProjectName, option) => __async(void 0, null, function* () {
49
+ yield (0, import_commands.build)(targetProjectName, option, api);
50
+ }));
51
+ };
@@ -1,13 +1,50 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ clearCli: () => clearCli
5
21
  });
6
- exports.clearCli = void 0;
7
- var _commands = require("../commands");
8
- const clearCli = (program, api) => {
9
- program.command('clear [projects...]').usage('[options]').option('--remove-dirs [dirs...]', 'remove dirs, default is node_modules').description('clear project dirs').action(async (targetProjectNames, option) => {
10
- await (0, _commands.clear)(targetProjectNames, option, api);
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var import_commands = require("../commands");
24
+ var __async = (__this, __arguments, generator) => {
25
+ return new Promise((resolve, reject) => {
26
+ var fulfilled = (value) => {
27
+ try {
28
+ step(generator.next(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var rejected = (value) => {
34
+ try {
35
+ step(generator.throw(value));
36
+ } catch (e) {
37
+ reject(e);
38
+ }
39
+ };
40
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
41
+ step((generator = generator.apply(__this, __arguments)).next());
11
42
  });
12
43
  };
13
- exports.clearCli = clearCli;
44
+ const clearCli = (program, api) => {
45
+ program.command("clear [projects...]").usage("[options]").option("--remove-dirs [dirs...]", "remove dirs, default is node_modules").description("clear project dirs").action(
46
+ (targetProjectNames, option) => __async(void 0, null, function* () {
47
+ yield (0, import_commands.clear)(targetProjectNames, option, api);
48
+ })
49
+ );
50
+ };
@@ -1,15 +1,55 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ deployCli: () => deployCli
5
21
  });
6
- exports.deployCli = void 0;
7
- var _commands = require("../commands");
8
- const deployCli = (program, api) => {
9
- 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) => {
10
- // 在查找 workspace 下项目时,默认忽略 output 下面的项目
11
- const ignoreMatchs = ['**/output/**'];
12
- await (0, _commands.deploy)(api, deployProjectNames, option, ignoreMatchs);
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var import_commands = require("../commands");
24
+ var __async = (__this, __arguments, generator) => {
25
+ return new Promise((resolve, reject) => {
26
+ var fulfilled = (value) => {
27
+ try {
28
+ step(generator.next(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var rejected = (value) => {
34
+ try {
35
+ step(generator.throw(value));
36
+ } catch (e) {
37
+ reject(e);
38
+ }
39
+ };
40
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
41
+ step((generator = generator.apply(__this, __arguments)).next());
13
42
  });
14
43
  };
15
- exports.deployCli = deployCli;
44
+ const deployCli = (program, api) => {
45
+ program.command("deploy [project...]").usage("[options]").option(
46
+ "-p, --path [path]",
47
+ "Specify the path of the product output",
48
+ "output"
49
+ ).description("deploy project").action(
50
+ (deployProjectNames, option) => __async(void 0, null, function* () {
51
+ const ignoreMatchs = ["**/output/**"];
52
+ yield (0, import_commands.deploy)(api, deployProjectNames, option, ignoreMatchs);
53
+ })
54
+ );
55
+ };
@@ -1,71 +1,22 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _new = require("./new");
7
- Object.keys(_new).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _new[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _new[key];
14
- }
15
- });
16
- });
17
- var _deploy = require("./deploy");
18
- Object.keys(_deploy).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _deploy[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _deploy[key];
25
- }
26
- });
27
- });
28
- var _build = require("./build");
29
- Object.keys(_build).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _build[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _build[key];
36
- }
37
- });
38
- });
39
- var _buildWatch = require("./build-watch");
40
- Object.keys(_buildWatch).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _buildWatch[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _buildWatch[key];
47
- }
48
- });
49
- });
50
- var _clear = require("./clear");
51
- Object.keys(_clear).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _clear[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _clear[key];
58
- }
59
- });
60
- });
61
- var _install = require("./install");
62
- Object.keys(_install).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _install[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _install[key];
69
- }
70
- });
71
- });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var stdin_exports = {};
16
+ module.exports = __toCommonJS(stdin_exports);
17
+ __reExport(stdin_exports, require("./new"), module.exports);
18
+ __reExport(stdin_exports, require("./deploy"), module.exports);
19
+ __reExport(stdin_exports, require("./build"), module.exports);
20
+ __reExport(stdin_exports, require("./build-watch"), module.exports);
21
+ __reExport(stdin_exports, require("./clear"), module.exports);
22
+ __reExport(stdin_exports, require("./install"), module.exports);