@modern-js/monorepo-tools 2.0.0-beta.0 → 2.0.0-beta.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.
- package/CHANGELOG.md +38 -0
- package/dist/js/modern/cli/new.js +0 -3
- package/dist/js/modern/commands/build.js +4 -9
- package/dist/js/modern/dag/create.js +8 -15
- package/dist/js/modern/dag/edge-manager.js +0 -10
- package/dist/js/modern/dag/operator.js +14 -57
- package/dist/js/modern/dag/task.js +0 -18
- package/dist/js/modern/dag/utils.js +13 -31
- package/dist/js/modern/features/build/index.js +8 -19
- package/dist/js/modern/features/clear/index.js +0 -1
- package/dist/js/modern/features/deploy/index.js +7 -35
- package/dist/js/modern/features/dev/cmds.js +1 -0
- package/dist/js/modern/features/dev/create-task.js +2 -13
- package/dist/js/modern/features/dev/index.js +4 -11
- package/dist/js/modern/features/dev/watch-projects-state.js +0 -19
- package/dist/js/modern/features/install/index.js +0 -12
- package/dist/js/modern/index.js +1 -2
- package/dist/js/modern/log/multi-tasks-log.js +8 -31
- package/dist/js/modern/log/time.js +0 -3
- package/dist/js/modern/log/utils.js +0 -2
- package/dist/js/modern/package/index.js +0 -8
- package/dist/js/modern/parse-config/index.js +3 -6
- package/dist/js/modern/parse-config/monorepo.js +0 -23
- package/dist/js/modern/projects/check-project-change.js +4 -16
- package/dist/js/modern/projects/get-projects-by-packages-config.js +12 -29
- package/dist/js/modern/projects/get-projects-by-workspace-file.js +0 -16
- package/dist/js/modern/projects/get-projects.js +4 -29
- package/dist/js/modern/utils/install.js +0 -2
- package/dist/js/node/cli/build-watch.js +0 -3
- package/dist/js/node/cli/build.js +0 -3
- package/dist/js/node/cli/clear.js +0 -3
- package/dist/js/node/cli/deploy.js +0 -3
- package/dist/js/node/cli/index.js +0 -12
- package/dist/js/node/cli/install.js +0 -3
- package/dist/js/node/cli/new.js +0 -7
- package/dist/js/node/commands/build-watch.js +0 -6
- package/dist/js/node/commands/build.js +2 -14
- package/dist/js/node/commands/clear.js +0 -5
- package/dist/js/node/commands/deploy.js +0 -9
- package/dist/js/node/commands/index.js +0 -10
- package/dist/js/node/commands/install.js +0 -6
- package/dist/js/node/dag/create.js +8 -17
- package/dist/js/node/dag/edge-manager.js +0 -12
- package/dist/js/node/dag/index.js +0 -4
- package/dist/js/node/dag/operator.js +14 -65
- package/dist/js/node/dag/task.js +0 -23
- package/dist/js/node/dag/utils.js +12 -39
- package/dist/js/node/features/build/index.js +8 -29
- package/dist/js/node/features/clear/index.js +0 -15
- package/dist/js/node/features/deploy/index.js +7 -53
- package/dist/js/node/features/dev/cmds.js +1 -0
- package/dist/js/node/features/dev/create-task.js +2 -22
- package/dist/js/node/features/dev/index.js +4 -19
- package/dist/js/node/features/dev/watch-projects-state.js +0 -25
- package/dist/js/node/features/install/index.js +0 -25
- package/dist/js/node/hooks/index.js +0 -2
- package/dist/js/node/index.js +2 -16
- package/dist/js/node/locale/index.js +0 -4
- package/dist/js/node/log/error.js +0 -2
- package/dist/js/node/log/multi-tasks-log.js +8 -34
- package/dist/js/node/log/time.js +0 -10
- package/dist/js/node/log/utils.js +0 -4
- package/dist/js/node/package/index.js +0 -10
- package/dist/js/node/parse-config/index.js +3 -14
- package/dist/js/node/parse-config/monorepo.js +0 -34
- package/dist/js/node/projects/check-project-change.js +4 -33
- package/dist/js/node/projects/clear-memory-files.js +0 -8
- package/dist/js/node/projects/get-projects-by-packages-config.js +12 -41
- package/dist/js/node/projects/get-projects-by-workspace-file.js +0 -36
- package/dist/js/node/projects/get-projects.js +4 -37
- package/dist/js/node/utils/install.js +0 -11
- package/dist/js/node/utils/language.js +0 -2
- package/dist/types/dag/operator.d.ts +0 -3
- package/dist/types/dag/utils.d.ts +0 -1
- package/dist/types/features/dev/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/projects/get-projects.d.ts +0 -1
- package/package.json +13 -13
|
@@ -4,105 +4,69 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.syncGetProjectsByWorkspaceFile = exports.getProjectsByWorkspaceFile = void 0;
|
|
7
|
-
|
|
8
7
|
var path = _interopRequireWildcard(require("path"));
|
|
9
|
-
|
|
10
8
|
var _nodeCoreLibrary = require("@rushstack/node-core-library");
|
|
11
|
-
|
|
12
9
|
var _utils = require("@modern-js/utils");
|
|
13
|
-
|
|
14
10
|
var _monorepo = require("../parse-config/monorepo");
|
|
15
|
-
|
|
16
11
|
var _constants = require("../constants");
|
|
17
|
-
|
|
18
12
|
var _getProjectsByPackagesConfig = require("./get-projects-by-packages-config");
|
|
19
|
-
|
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
15
|
const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs) => {
|
|
25
16
|
var _config$workspaceFile;
|
|
26
|
-
|
|
27
17
|
let {
|
|
28
18
|
workspaceFile
|
|
29
19
|
} = config;
|
|
30
|
-
|
|
31
20
|
if (!config.enableAutoFinder && (!('workspaceFile' in config) || ((_config$workspaceFile = config.workspaceFile) === null || _config$workspaceFile === void 0 ? void 0 : _config$workspaceFile.length) === 0)) {
|
|
32
21
|
throw new Error('Missing workspaceFile Key or workspaceFile is empty string');
|
|
33
22
|
}
|
|
34
|
-
|
|
35
23
|
if (config.enableAutoFinder) {
|
|
36
24
|
workspaceFile = (0, _monorepo.getWorkspaceFile)(rootPath);
|
|
37
25
|
}
|
|
38
|
-
|
|
39
26
|
let packagesConfig = [];
|
|
40
|
-
|
|
41
27
|
if (workspaceFile === _constants.WORKSPACE_FILE.PNPM) {
|
|
42
28
|
const yamlString = await _nodeCoreLibrary.FileSystem.readFileAsync(path.resolve('/', rootPath, workspaceFile)).then(data => data.toString());
|
|
43
|
-
|
|
44
29
|
const pnpmWorkspace = _utils.yaml.load(yamlString);
|
|
45
|
-
|
|
46
30
|
packagesConfig = pnpmWorkspace.packages || [];
|
|
47
31
|
} else if (workspaceFile === _constants.WORKSPACE_FILE.YARN) {
|
|
48
32
|
var _pkgJson$workspaces;
|
|
49
|
-
|
|
50
33
|
const pkgJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
51
|
-
|
|
52
34
|
packagesConfig = (pkgJson === null || pkgJson === void 0 ? void 0 : (_pkgJson$workspaces = pkgJson.workspaces) === null || _pkgJson$workspaces === void 0 ? void 0 : _pkgJson$workspaces.packages) || [];
|
|
53
35
|
} else if (workspaceFile === _constants.WORKSPACE_FILE.LERNA) {
|
|
54
36
|
var _lernaJson$packages;
|
|
55
|
-
|
|
56
37
|
const lernaJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
57
|
-
|
|
58
38
|
packagesConfig = (_lernaJson$packages = lernaJson.packages) !== null && _lernaJson$packages !== void 0 ? _lernaJson$packages : [];
|
|
59
39
|
}
|
|
60
|
-
|
|
61
40
|
const projects = await (0, _getProjectsByPackagesConfig.getProjectsByPackageConfig)(rootPath, packagesConfig, ignoreConfigs);
|
|
62
41
|
return projects;
|
|
63
42
|
};
|
|
64
|
-
|
|
65
43
|
exports.getProjectsByWorkspaceFile = getProjectsByWorkspaceFile;
|
|
66
|
-
|
|
67
44
|
const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs) => {
|
|
68
45
|
var _config$workspaceFile2;
|
|
69
|
-
|
|
70
46
|
let {
|
|
71
47
|
workspaceFile
|
|
72
48
|
} = config;
|
|
73
|
-
|
|
74
49
|
if (!config.enableAutoFinder && (!('workspaceFile' in config) || ((_config$workspaceFile2 = config.workspaceFile) === null || _config$workspaceFile2 === void 0 ? void 0 : _config$workspaceFile2.length) === 0)) {
|
|
75
50
|
throw new Error('Missing workspaceFile Key or workspaceFile is empty string');
|
|
76
51
|
}
|
|
77
|
-
|
|
78
52
|
if (config.enableAutoFinder) {
|
|
79
53
|
workspaceFile = (0, _monorepo.getWorkspaceFile)(rootPath);
|
|
80
54
|
}
|
|
81
|
-
|
|
82
55
|
let packagesConfig = [];
|
|
83
|
-
|
|
84
56
|
if (workspaceFile === _constants.WORKSPACE_FILE.PNPM) {
|
|
85
57
|
const yamlString = _utils.fs.readFileSync(path.resolve('/', rootPath, workspaceFile), 'utf-8');
|
|
86
|
-
|
|
87
58
|
const pnpmWorkspace = _utils.yaml.load(yamlString);
|
|
88
|
-
|
|
89
59
|
packagesConfig = pnpmWorkspace.packages || [];
|
|
90
60
|
} else if (workspaceFile === _constants.WORKSPACE_FILE.YARN) {
|
|
91
61
|
var _pkgJson$workspaces2;
|
|
92
|
-
|
|
93
62
|
const pkgJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
94
|
-
|
|
95
63
|
packagesConfig = (pkgJson === null || pkgJson === void 0 ? void 0 : (_pkgJson$workspaces2 = pkgJson.workspaces) === null || _pkgJson$workspaces2 === void 0 ? void 0 : _pkgJson$workspaces2.packages) || [];
|
|
96
64
|
} else if (workspaceFile === _constants.WORKSPACE_FILE.LERNA) {
|
|
97
65
|
var _lernaJson$packages2;
|
|
98
|
-
|
|
99
66
|
const lernaJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
100
|
-
|
|
101
67
|
packagesConfig = (_lernaJson$packages2 = lernaJson.packages) !== null && _lernaJson$packages2 !== void 0 ? _lernaJson$packages2 : [];
|
|
102
68
|
}
|
|
103
|
-
|
|
104
69
|
const projects = (0, _getProjectsByPackagesConfig.syncGetProjectsByPackageConfig)(rootPath, packagesConfig, ignoreConfigs);
|
|
105
70
|
return projects;
|
|
106
71
|
};
|
|
107
|
-
|
|
108
72
|
exports.syncGetProjectsByWorkspaceFile = syncGetProjectsByWorkspaceFile;
|
|
@@ -4,31 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.syncGetProjects = exports.getProjects = void 0;
|
|
7
|
-
|
|
8
7
|
var _error = require("../log/error");
|
|
9
|
-
|
|
10
8
|
var _monorepo = require("../parse-config/monorepo");
|
|
11
|
-
|
|
12
9
|
var _getProjectsByPackagesConfig = require("./get-projects-by-packages-config");
|
|
13
|
-
|
|
14
10
|
var _getProjectsByWorkspaceFile = require("./get-projects-by-workspace-file");
|
|
15
|
-
|
|
16
11
|
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; }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
var FindProjectsMode;
|
|
23
|
-
|
|
24
15
|
(function (FindProjectsMode) {
|
|
25
16
|
FindProjectsMode[FindProjectsMode["Rough"] = 0] = "Rough";
|
|
26
17
|
FindProjectsMode[FindProjectsMode["Precise"] = 1] = "Precise";
|
|
27
18
|
})(FindProjectsMode || (FindProjectsMode = {}));
|
|
28
|
-
|
|
29
19
|
const getProjectsByProjectsConfig = (rootPath, configs = []) => {
|
|
30
20
|
const subProjects = [];
|
|
31
|
-
|
|
32
21
|
for (const config of configs) {
|
|
33
22
|
subProjects.push({
|
|
34
23
|
name: config.name,
|
|
@@ -42,13 +31,10 @@ const getProjectsByProjectsConfig = (rootPath, configs = []) => {
|
|
|
42
31
|
circlePath: []
|
|
43
32
|
});
|
|
44
33
|
}
|
|
45
|
-
|
|
46
34
|
return subProjects;
|
|
47
35
|
};
|
|
48
|
-
|
|
49
36
|
const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
|
|
50
37
|
let projects = [];
|
|
51
|
-
|
|
52
38
|
if (Array.isArray(match)) {
|
|
53
39
|
// like lerna`s packages config
|
|
54
40
|
projects = await (0, _getProjectsByPackagesConfig.getProjectsByPackageConfig)(rootPath, match, ignore);
|
|
@@ -56,9 +42,7 @@ const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
|
|
|
56
42
|
// use workspace file
|
|
57
43
|
projects = await (0, _getProjectsByWorkspaceFile.getProjectsByWorkspaceFile)(rootPath, match, ignore);
|
|
58
44
|
}
|
|
59
|
-
|
|
60
45
|
const subProjects = [];
|
|
61
|
-
|
|
62
46
|
for (const project of projects) {
|
|
63
47
|
subProjects.push({
|
|
64
48
|
name: project.name,
|
|
@@ -72,13 +56,11 @@ const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
|
|
|
72
56
|
circlePath: []
|
|
73
57
|
});
|
|
74
58
|
}
|
|
75
|
-
|
|
76
59
|
return subProjects;
|
|
77
60
|
};
|
|
78
|
-
|
|
79
61
|
const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
80
|
-
let projects = [];
|
|
81
|
-
|
|
62
|
+
let projects = [];
|
|
63
|
+
// TODO: code start
|
|
82
64
|
if (Array.isArray(match)) {
|
|
83
65
|
// like lerna`s packages config
|
|
84
66
|
projects = (0, _getProjectsByPackagesConfig.syncGetProjectsByPackageConfig)(rootPath, match, ignore);
|
|
@@ -86,9 +68,7 @@ const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
|
86
68
|
// use workspace file
|
|
87
69
|
projects = (0, _getProjectsByWorkspaceFile.syncGetProjectsByWorkspaceFile)(rootPath, match, ignore);
|
|
88
70
|
}
|
|
89
|
-
|
|
90
71
|
const subProjects = [];
|
|
91
|
-
|
|
92
72
|
for (const project of projects) {
|
|
93
73
|
subProjects.push({
|
|
94
74
|
name: project.name,
|
|
@@ -102,63 +82,50 @@ const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
|
102
82
|
circlePath: []
|
|
103
83
|
});
|
|
104
84
|
}
|
|
105
|
-
|
|
106
85
|
return subProjects;
|
|
107
86
|
};
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
const checkFindProjectsMode = (config
|
|
88
|
+
// eslint-disable-next-line consistent-return
|
|
110
89
|
) => {
|
|
111
90
|
if (config.packagesMatchs && Array.isArray(config.packagesMatchs)) {
|
|
112
91
|
return FindProjectsMode.Rough;
|
|
113
92
|
}
|
|
114
|
-
|
|
115
93
|
if (config.packagesMatchs && typeof config.packagesMatchs === 'object' && (config.packagesMatchs.workspaceFile || config.packagesMatchs.enableAutoFinder)) {
|
|
116
94
|
return FindProjectsMode.Rough;
|
|
117
95
|
}
|
|
118
|
-
|
|
119
96
|
if (config.projectsConfig && Array.isArray(config.projectsConfig)) {
|
|
120
97
|
return FindProjectsMode.Precise;
|
|
121
98
|
}
|
|
122
|
-
|
|
123
99
|
if (config.projectsConfig && config.packagesMatchs) {
|
|
124
100
|
(0, _error.errorLog)('There can not be both `packagesMatchs` and `projectsConfig`');
|
|
125
101
|
}
|
|
126
|
-
|
|
127
102
|
(0, _error.errorLog)('No `packagesMatchs` and `projectsConfig` configurations found');
|
|
128
103
|
};
|
|
129
|
-
|
|
130
104
|
const getProjects = async (config, currentDir = process.cwd()) => {
|
|
131
105
|
const {
|
|
132
106
|
rootPath
|
|
133
107
|
} = (0, _monorepo.getMonorepoBaseData)(currentDir);
|
|
134
108
|
const mode = checkFindProjectsMode(config);
|
|
135
109
|
let projects = [];
|
|
136
|
-
|
|
137
110
|
if (mode === FindProjectsMode.Rough) {
|
|
138
111
|
projects = await getProjectsByPackagesMatch(rootPath, config.packagesMatchs, config.packagesIgnoreMatchs || []);
|
|
139
112
|
} else if (mode === FindProjectsMode.Precise) {
|
|
140
113
|
projects = getProjectsByProjectsConfig(rootPath, config.projectsConfig);
|
|
141
114
|
}
|
|
142
|
-
|
|
143
115
|
return projects;
|
|
144
116
|
};
|
|
145
|
-
|
|
146
117
|
exports.getProjects = getProjects;
|
|
147
|
-
|
|
148
118
|
const syncGetProjects = (config, currentDir = process.cwd()) => {
|
|
149
119
|
const {
|
|
150
120
|
rootPath
|
|
151
121
|
} = (0, _monorepo.getMonorepoBaseData)(currentDir);
|
|
152
122
|
const mode = checkFindProjectsMode(config);
|
|
153
123
|
let projects = [];
|
|
154
|
-
|
|
155
124
|
if (mode === FindProjectsMode.Rough) {
|
|
156
125
|
projects = syncGetProjectsByPackagesMatch(rootPath, config.packagesMatchs, config.packagesIgnoreMatchs || []);
|
|
157
126
|
} else if (mode === FindProjectsMode.Precise) {
|
|
158
127
|
projects = getProjectsByProjectsConfig(rootPath, config.projectsConfig);
|
|
159
128
|
}
|
|
160
|
-
|
|
161
129
|
return projects;
|
|
162
130
|
};
|
|
163
|
-
|
|
164
131
|
exports.syncGetProjects = syncGetProjects;
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.removeLockFile = exports.installByPackageManager = void 0;
|
|
7
|
-
|
|
8
7
|
var path = _interopRequireWildcard(require("path"));
|
|
9
|
-
|
|
10
8
|
var _utils = require("@modern-js/utils");
|
|
11
|
-
|
|
12
9
|
var _constants = require("../constants");
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
12
|
const removeLockFile = (rootPath, packageManager) => {
|
|
19
13
|
if (packageManager === 'pnpm') {
|
|
20
14
|
_utils.fs.removeSync(path.join(rootPath, _constants.LOCK_FILE.PNPM));
|
|
@@ -24,9 +18,7 @@ const removeLockFile = (rootPath, packageManager) => {
|
|
|
24
18
|
_utils.fs.removeSync(path.join(rootPath, _constants.LOCK_FILE.NPM));
|
|
25
19
|
}
|
|
26
20
|
};
|
|
27
|
-
|
|
28
21
|
exports.removeLockFile = removeLockFile;
|
|
29
|
-
|
|
30
22
|
const installByPackageManager = async (packageManager, {
|
|
31
23
|
rootPath,
|
|
32
24
|
removeLock
|
|
@@ -34,18 +26,15 @@ const installByPackageManager = async (packageManager, {
|
|
|
34
26
|
if (removeLock) {
|
|
35
27
|
removeLockFile(rootPath, packageManager);
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
if (packageManager === 'pnpm') {
|
|
39
30
|
await (0, _utils.execa)('pnpm', ['install'], {
|
|
40
31
|
stdio: 'inherit'
|
|
41
32
|
});
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
if (packageManager === 'yarn') {
|
|
45
35
|
await (0, _utils.execa)('yarn', ['install'], {
|
|
46
36
|
stdio: 'inherit'
|
|
47
37
|
});
|
|
48
38
|
}
|
|
49
39
|
};
|
|
50
|
-
|
|
51
40
|
exports.installByPackageManager = installByPackageManager;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getLocaleLanguage = getLocaleLanguage;
|
|
7
|
-
|
|
8
7
|
var _languageDetector = require("@modern-js/plugin-i18n/language-detector");
|
|
9
|
-
|
|
10
8
|
function getLocaleLanguage() {
|
|
11
9
|
const detector = new _languageDetector.I18CLILanguageDetector();
|
|
12
10
|
return detector.detect();
|
|
@@ -31,7 +31,6 @@ export declare class DagOperator {
|
|
|
31
31
|
* 3. 检查是否存在 dependencyEdge === 0 的节点,加入叶子节点集合 A中。
|
|
32
32
|
* 4. 根据情况(是否存在空闲的进程)选择是否执行新加入的节点对应的任务。
|
|
33
33
|
*/
|
|
34
|
-
|
|
35
34
|
traverseProjectToDependent(name: string, task: Task, {
|
|
36
35
|
withSelf,
|
|
37
36
|
runTaskConcurrency
|
|
@@ -43,7 +42,6 @@ export declare class DagOperator {
|
|
|
43
42
|
* 4. 检查 B 集合中是否存在入度为0的节点,则此节点为叶子节点,并加入叶子节点集合 A
|
|
44
43
|
* 5. 根据情况(是否存在空闲的进程)选择是否执行新加入的节点对应的任务。
|
|
45
44
|
*/
|
|
46
|
-
|
|
47
45
|
traverseDependenciesToProject(name: string, task: Task, {
|
|
48
46
|
withSelf,
|
|
49
47
|
runTaskConcurrency
|
|
@@ -58,7 +56,6 @@ export declare class DagOperator {
|
|
|
58
56
|
/**
|
|
59
57
|
* Checks for projects that indirectly depend on themselves.
|
|
60
58
|
*/
|
|
61
|
-
|
|
62
59
|
private _checkForCyclicDependencies;
|
|
63
60
|
private _getDependencyLeafNodes;
|
|
64
61
|
private readonly _createTask;
|
|
@@ -3,7 +3,6 @@ import { IProjectNode } from '../projects/get-projects';
|
|
|
3
3
|
* Calculate the number of packages which must be built before we reach
|
|
4
4
|
* the furthest away "root" node
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
export declare const calculateCriticalPaths: (project: IProjectNode) => number;
|
|
8
7
|
export declare const recursiveGetDependency: (project: IProjectNode, skipCircleProjects?: boolean) => IProjectNode[];
|
|
9
8
|
export declare const sortProjects: (projects: IProjectNode[]) => IProjectNode[][];
|
|
@@ -17,7 +17,6 @@ export interface IProjectChangeResult {
|
|
|
17
17
|
/**
|
|
18
18
|
* Contains the git hashes for all tracked files in the repo
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
20
|
state: any;
|
|
22
21
|
}
|
|
23
22
|
export declare const runBuildWatchTask: (projectName: string, operator: DagOperator, config: IBuildWatchConfig, taskCmds?: BuildWatchCmdsType) => Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.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,29 +35,29 @@
|
|
|
35
35
|
"modern": "./bin/modern.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@modern-js/core": "2.0.0-beta.0",
|
|
39
38
|
"@babel/runtime": "^7.18.0",
|
|
40
|
-
"@modern-js/new-action": "2.0.0-beta.0",
|
|
41
|
-
"@modern-js/upgrade": "2.0.0-beta.0",
|
|
42
|
-
"@modern-js/plugin": "2.0.0-beta.0",
|
|
43
|
-
"@modern-js/plugin-changeset": "2.0.0-beta.0",
|
|
44
|
-
"@modern-js/plugin-i18n": "2.0.0-beta.0",
|
|
45
|
-
"@modern-js/plugin-jarvis": "2.0.0-beta.0",
|
|
46
|
-
"@modern-js/utils": "2.0.0-beta.0",
|
|
47
39
|
"@rushstack/node-core-library": "^3.39.1",
|
|
48
40
|
"@rushstack/package-deps-hash": "^3.0.54",
|
|
49
41
|
"anymatch": "^3.1.2",
|
|
50
42
|
"md5": "^2.3.0",
|
|
51
|
-
"p-map": "^4.0.0"
|
|
43
|
+
"p-map": "^4.0.0",
|
|
44
|
+
"@modern-js/core": "2.0.0-beta.1",
|
|
45
|
+
"@modern-js/new-action": "2.0.0-beta.1",
|
|
46
|
+
"@modern-js/upgrade": "2.0.0-beta.1",
|
|
47
|
+
"@modern-js/plugin": "2.0.0-beta.1",
|
|
48
|
+
"@modern-js/plugin-changeset": "2.0.0-beta.1",
|
|
49
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.1",
|
|
50
|
+
"@modern-js/plugin-lint": "2.0.0-beta.1",
|
|
51
|
+
"@modern-js/utils": "2.0.0-beta.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@scripts/build": "2.0.0-beta.0",
|
|
55
|
-
"@scripts/jest-config": "2.0.0-beta.0",
|
|
56
54
|
"@types/jest": "^27",
|
|
57
55
|
"@types/md5": "^2.3.1",
|
|
58
56
|
"@types/node": "^14",
|
|
59
57
|
"jest": "^27",
|
|
60
|
-
"typescript": "^4"
|
|
58
|
+
"typescript": "^4",
|
|
59
|
+
"@scripts/build": "2.0.0-beta.1",
|
|
60
|
+
"@scripts/jest-config": "2.0.0-beta.1"
|
|
61
61
|
},
|
|
62
62
|
"sideEffects": false,
|
|
63
63
|
"modernConfig": {
|