@modern-js/monorepo-tools 1.4.2 → 1.4.5
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/.eslintrc.js +8 -0
- package/CHANGELOG.md +64 -0
- package/dist/js/modern/cli/build.js +1 -1
- package/dist/js/modern/dag/task.js +6 -6
- package/dist/js/modern/features/deploy/index.js +2 -2
- package/dist/js/modern/features/dev/watch-projects-state.js +1 -1
- package/dist/js/modern/features/install/index.js +6 -6
- package/dist/js/modern/parse-config/monorepo.js +2 -4
- package/dist/js/modern/projects/check-project-change.js +5 -6
- package/dist/js/modern/projects/get-projects-by-packages-config.js +3 -3
- package/dist/js/modern/projects/get-projects-by-workspace-file.js +13 -3
- package/dist/js/modern/projects/get-projects.js +5 -5
- package/dist/js/node/cli/build.js +1 -1
- package/dist/js/node/dag/task.js +6 -6
- package/dist/js/node/features/deploy/index.js +2 -2
- package/dist/js/node/features/dev/watch-projects-state.js +2 -4
- package/dist/js/node/features/install/index.js +6 -6
- package/dist/js/node/parse-config/monorepo.js +1 -4
- package/dist/js/node/projects/check-project-change.js +7 -8
- package/dist/js/node/projects/get-projects-by-packages-config.js +8 -8
- package/dist/js/node/projects/get-projects-by-workspace-file.js +14 -2
- package/dist/js/node/projects/get-projects.js +4 -4
- package/dist/types/dag/task.d.ts +3 -3
- package/dist/types/projects/get-projects-by-packages-config.d.ts +2 -2
- package/package.json +8 -9
- package/tests/index.test.ts +0 -7
- package/tests/tsconfig.json +0 -13
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @modern-js/monorepo-tools
|
|
2
2
|
|
|
3
|
+
## 1.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 69a728375: fix: remove exports.jsnext:source after publish
|
|
8
|
+
- Updated dependencies [cd7346b0d]
|
|
9
|
+
- Updated dependencies [6b0bb5e3b]
|
|
10
|
+
- Updated dependencies [69a728375]
|
|
11
|
+
- @modern-js/utils@1.7.2
|
|
12
|
+
- @modern-js/new-action@1.3.8
|
|
13
|
+
- @modern-js/core@1.10.1
|
|
14
|
+
- @modern-js/plugin-changeset@1.2.6
|
|
15
|
+
- @modern-js/plugin-i18n@1.2.5
|
|
16
|
+
|
|
17
|
+
## 1.4.4
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 592edabc: feat: prebundle url-join,mime-types,json5,fast-glob,globby,ora,inquirer
|
|
22
|
+
- Updated dependencies [2d155c4c]
|
|
23
|
+
- Updated dependencies [123e432d]
|
|
24
|
+
- Updated dependencies [e5a9b26d]
|
|
25
|
+
- Updated dependencies [0b26b93b]
|
|
26
|
+
- Updated dependencies [123e432d]
|
|
27
|
+
- Updated dependencies [f9f66ef9]
|
|
28
|
+
- Updated dependencies [592edabc]
|
|
29
|
+
- Updated dependencies [895fa0ff]
|
|
30
|
+
- Updated dependencies [3578913e]
|
|
31
|
+
- Updated dependencies [1c3beab3]
|
|
32
|
+
- @modern-js/utils@1.6.0
|
|
33
|
+
- @modern-js/core@1.9.0
|
|
34
|
+
- @modern-js/new-action@1.3.7
|
|
35
|
+
- @modern-js/plugin-changeset@1.2.5
|
|
36
|
+
|
|
37
|
+
## 1.4.3
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 6cffe99d: chore:
|
|
42
|
+
remove react eslint rules for `modern-js` rule set.
|
|
43
|
+
add .eslintrc for each package to speed up linting
|
|
44
|
+
- 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
|
|
45
|
+
- 60f7d8bf: feat: add tests dir to npmignore
|
|
46
|
+
- 305e0bb4: fix: commander.commandsMap typing not work
|
|
47
|
+
- 2888389b: add parse config for lerna
|
|
48
|
+
- Updated dependencies [a4330c73]
|
|
49
|
+
- Updated dependencies [b8599d09]
|
|
50
|
+
- Updated dependencies [6cffe99d]
|
|
51
|
+
- Updated dependencies [04ae5262]
|
|
52
|
+
- Updated dependencies [60f7d8bf]
|
|
53
|
+
- Updated dependencies [e4cec1ce]
|
|
54
|
+
- Updated dependencies [3b7aa8bb]
|
|
55
|
+
- Updated dependencies [5dbbeb57]
|
|
56
|
+
- Updated dependencies [ebfcbb35]
|
|
57
|
+
- Updated dependencies [3bf4f8b0]
|
|
58
|
+
- Updated dependencies [305e0bb4]
|
|
59
|
+
- @modern-js/core@1.8.0
|
|
60
|
+
- @modern-js/utils@1.5.0
|
|
61
|
+
- @modern-js/i18n-cli-language-detector@1.2.2
|
|
62
|
+
- @modern-js/plugin-changeset@1.2.5
|
|
63
|
+
- @modern-js/plugin-i18n@1.2.4
|
|
64
|
+
- @modern-js/new-action@1.3.6
|
|
65
|
+
- @modern-js/plugin@1.3.3
|
|
66
|
+
|
|
3
67
|
## 1.4.2
|
|
4
68
|
|
|
5
69
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { build } from "../commands";
|
|
2
2
|
export const buildCli = (program, api) => {
|
|
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
|
|
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 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) => {
|
|
4
4
|
await build(targetProjectName, option, api);
|
|
5
5
|
});
|
|
6
6
|
};
|
|
@@ -7,18 +7,18 @@ export class TaskRunner extends EventEmitter {
|
|
|
7
7
|
super();
|
|
8
8
|
this._tasks = void 0;
|
|
9
9
|
this._concurrency = void 0;
|
|
10
|
-
this.
|
|
10
|
+
this._usableConcurrency = void 0;
|
|
11
11
|
this._stopFlag = void 0;
|
|
12
12
|
this._tasks = tasks;
|
|
13
13
|
this._concurrency = concurrency || TaskRunner.DefaultConcurrency;
|
|
14
|
-
this.
|
|
14
|
+
this._usableConcurrency = this._concurrency;
|
|
15
15
|
this._stopFlag = false;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async run() {
|
|
19
19
|
const tasks = this._tasks.splice(0, this._concurrency);
|
|
20
20
|
|
|
21
|
-
this.
|
|
21
|
+
this._usableConcurrency = this._concurrency - tasks.length;
|
|
22
22
|
await pMap(tasks, async task => {
|
|
23
23
|
await this._runTask(task);
|
|
24
24
|
}, {
|
|
@@ -36,13 +36,13 @@ export class TaskRunner extends EventEmitter {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const emitValue = await task(this._stopTask.bind(this));
|
|
39
|
-
this.
|
|
39
|
+
this._usableConcurrency--;
|
|
40
40
|
this.emit(TaskRunner.TASK_FINISH, emitValue);
|
|
41
41
|
|
|
42
42
|
if (this._tasks.length > 0) {
|
|
43
|
-
const nextTasks = this._tasks.splice(0, this.
|
|
43
|
+
const nextTasks = this._tasks.splice(0, this._usableConcurrency);
|
|
44
44
|
|
|
45
|
-
this.
|
|
45
|
+
this._usableConcurrency -= nextTasks.length;
|
|
46
46
|
|
|
47
47
|
if (nextTasks.length > 0) {
|
|
48
48
|
await pMap(nextTasks, async _task => {
|
|
@@ -75,9 +75,9 @@ const generatorAndCopyRequiredFiles = (rootPath, deployDir) => {
|
|
|
75
75
|
const checkAndRunDeployCommand = async (monorepoPath, targetProject, packageManager) => {
|
|
76
76
|
var _targetProject$extra;
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const scripts = ((_targetProject$extra = targetProject.extra) === null || _targetProject$extra === void 0 ? void 0 : _targetProject$extra.scripts) || {};
|
|
79
79
|
|
|
80
|
-
if (
|
|
80
|
+
if (scripts.deploy) {
|
|
81
81
|
var _childProcess$stdout, _childProcess$stderr;
|
|
82
82
|
|
|
83
83
|
logger.info(`The 'deploy' command for the ${targetProject.name} is detected, so 'deploy' will be executed`);
|
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
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
7
|
import * as path from 'path';
|
|
8
|
-
import globby from '
|
|
8
|
+
import { globby } from '@modern-js/utils';
|
|
9
9
|
export class WatchedProjectsState {
|
|
10
10
|
constructor(fromNodes, config) {
|
|
11
11
|
this._config = void 0;
|
|
@@ -6,19 +6,19 @@ import { installByPackageManager } from "../../utils/install";
|
|
|
6
6
|
|
|
7
7
|
const replaceWorkspaces = ({
|
|
8
8
|
rootPath,
|
|
9
|
-
|
|
9
|
+
projectsInWorkspaces
|
|
10
10
|
}) => {
|
|
11
11
|
// pnpm
|
|
12
12
|
const pnpmWsFilePath = path.join(rootPath, WORKSPACE_FILE.PNPM);
|
|
13
13
|
|
|
14
14
|
if (fs.existsSync(pnpmWsFilePath)) {
|
|
15
15
|
const pnpmWorkspace = fs.readFileSync(pnpmWsFilePath, 'utf-8');
|
|
16
|
-
const
|
|
16
|
+
const originalPnpmWorkspaces = yaml.load(pnpmWorkspace);
|
|
17
17
|
fs.writeFileSync(pnpmWsFilePath, yaml.dump({
|
|
18
|
-
packages:
|
|
18
|
+
packages: projectsInWorkspaces
|
|
19
19
|
}));
|
|
20
20
|
return () => {
|
|
21
|
-
yaml.dump(
|
|
21
|
+
yaml.dump(originalPnpmWorkspaces);
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -31,7 +31,7 @@ const replaceWorkspaces = ({
|
|
|
31
31
|
|
|
32
32
|
if (pkg !== null && pkg !== void 0 && (_pkg$workspaces = pkg.workspaces) !== null && _pkg$workspaces !== void 0 && _pkg$workspaces.packages) {
|
|
33
33
|
const originalPkg = pkg;
|
|
34
|
-
pkg.workspaces.packages =
|
|
34
|
+
pkg.workspaces.packages = projectsInWorkspaces;
|
|
35
35
|
JsonFile.save(pkg, pkgFilePath);
|
|
36
36
|
return () => {
|
|
37
37
|
JsonFile.save(originalPkg, pkgFilePath);
|
|
@@ -62,7 +62,7 @@ export const runInstallTask = async (projectNames, operator, config) => {
|
|
|
62
62
|
const noDupProjectList = Array.from(new Set(projectsInWorkspaces));
|
|
63
63
|
const restorWorkspace = replaceWorkspaces({
|
|
64
64
|
rootPath,
|
|
65
|
-
|
|
65
|
+
projectsInWorkspaces: noDupProjectList
|
|
66
66
|
});
|
|
67
67
|
await installByPackageManager(packageManager, {
|
|
68
68
|
rootPath,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
1
|
import * as path from 'path';
|
|
3
2
|
import { FileSystem, JsonFile } from '@rushstack/node-core-library';
|
|
4
3
|
import { WORKSPACE_FILE } from "../constants";
|
|
@@ -102,12 +101,11 @@ export const getMonorepoBaseData = (root = process.cwd()) => {
|
|
|
102
101
|
const rootPath = findMonorepoRoot(root);
|
|
103
102
|
|
|
104
103
|
if (!rootPath) {
|
|
105
|
-
throw new Error('not find any monorepo, you can add lerna、pnpm or yarn
|
|
104
|
+
throw new Error('not find any monorepo, you can add lerna、pnpm or yarn workspace file');
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
return {
|
|
109
108
|
rootPath,
|
|
110
109
|
packageManager: getPackageManager(rootPath)
|
|
111
110
|
};
|
|
112
|
-
};
|
|
113
|
-
/* eslint-enable react-hooks/rules-of-hooks */
|
|
111
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import { FileSystem, JsonFile, Sort } from '@rushstack/node-core-library';
|
|
3
3
|
import { getGitHashForFiles } from '@rushstack/package-deps-hash';
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import { globby } from '@modern-js/utils';
|
|
6
5
|
import md5 from 'md5';
|
|
7
6
|
export const PROJECT_CONTENT_FILE_NAME = 'project-content.json';
|
|
8
7
|
export const MONOREPO_GIT_FILE_NAME = 'monorepo-git.json';
|
|
@@ -39,12 +38,12 @@ export const checkProjectChangeByGit = async (project, rootPath) => {
|
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
const
|
|
43
|
-
const changed =
|
|
41
|
+
const monorepoProjectHashJson = JsonFile.load(monorepoGitMemory);
|
|
42
|
+
const changed = monorepoProjectHashJson[project.name] !== currentProjectHash;
|
|
44
43
|
|
|
45
44
|
if (changed) {
|
|
46
|
-
|
|
47
|
-
FileSystem.writeFile(monorepoGitMemory, JsonFile.stringify(
|
|
45
|
+
monorepoProjectHashJson[project.name] = currentProjectHash;
|
|
46
|
+
FileSystem.writeFile(monorepoGitMemory, JsonFile.stringify(monorepoProjectHashJson), {
|
|
48
47
|
ensureFolderExists: true
|
|
49
48
|
});
|
|
50
49
|
}
|
|
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
import * as path from 'path';
|
|
8
8
|
import { PackageJsonLookup } from '@rushstack/node-core-library';
|
|
9
|
-
import globby from '
|
|
9
|
+
import { globby } from '@modern-js/utils';
|
|
10
10
|
import pMap from 'p-map';
|
|
11
11
|
import { errorLog } from "../log/error";
|
|
12
12
|
import { Package } from "../package";
|
|
@@ -55,7 +55,7 @@ const makeFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export const
|
|
58
|
+
export const getProjectsByPackageConfig = async (rootPath, packagesConfig, ignoreConfigs) => {
|
|
59
59
|
const finder = makeFileFinder(rootPath, packagesConfig, ignoreConfigs);
|
|
60
60
|
const fileName = 'package.json';
|
|
61
61
|
|
|
@@ -93,7 +93,7 @@ const makeSyncFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
export const
|
|
96
|
+
export const syncGetProjectsByPackageConfig = (rootPath, packagesConfig, ignoreConfigs) => {
|
|
97
97
|
const finder = makeSyncFileFinder(rootPath, packagesConfig, ignoreConfigs);
|
|
98
98
|
const fileName = 'package.json';
|
|
99
99
|
|
|
@@ -3,7 +3,7 @@ import { FileSystem, JsonFile } from '@rushstack/node-core-library';
|
|
|
3
3
|
import { fs, yaml } from '@modern-js/utils';
|
|
4
4
|
import { getWorkspaceFile } from "../parse-config/monorepo";
|
|
5
5
|
import { WORKSPACE_FILE } from "../constants";
|
|
6
|
-
import {
|
|
6
|
+
import { getProjectsByPackageConfig, syncGetProjectsByPackageConfig } from "./get-projects-by-packages-config";
|
|
7
7
|
export const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs) => {
|
|
8
8
|
var _config$workspaceFile;
|
|
9
9
|
|
|
@@ -30,9 +30,14 @@ export const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs
|
|
|
30
30
|
|
|
31
31
|
const pkgJson = JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
32
32
|
packagesConfig = (pkgJson === null || pkgJson === void 0 ? void 0 : (_pkgJson$workspaces = pkgJson.workspaces) === null || _pkgJson$workspaces === void 0 ? void 0 : _pkgJson$workspaces.packages) || [];
|
|
33
|
+
} else if (workspaceFile === WORKSPACE_FILE.LERNA) {
|
|
34
|
+
var _lernaJson$packages;
|
|
35
|
+
|
|
36
|
+
const lernaJson = JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
37
|
+
packagesConfig = (_lernaJson$packages = lernaJson.packages) !== null && _lernaJson$packages !== void 0 ? _lernaJson$packages : [];
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
const projects = await
|
|
40
|
+
const projects = await getProjectsByPackageConfig(rootPath, packagesConfig, ignoreConfigs);
|
|
36
41
|
return projects;
|
|
37
42
|
};
|
|
38
43
|
export const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs) => {
|
|
@@ -61,8 +66,13 @@ export const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs)
|
|
|
61
66
|
|
|
62
67
|
const pkgJson = JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
63
68
|
packagesConfig = (pkgJson === null || pkgJson === void 0 ? void 0 : (_pkgJson$workspaces2 = pkgJson.workspaces) === null || _pkgJson$workspaces2 === void 0 ? void 0 : _pkgJson$workspaces2.packages) || [];
|
|
69
|
+
} else if (workspaceFile === WORKSPACE_FILE.LERNA) {
|
|
70
|
+
var _lernaJson$packages2;
|
|
71
|
+
|
|
72
|
+
const lernaJson = JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
73
|
+
packagesConfig = (_lernaJson$packages2 = lernaJson.packages) !== null && _lernaJson$packages2 !== void 0 ? _lernaJson$packages2 : [];
|
|
64
74
|
}
|
|
65
75
|
|
|
66
|
-
const projects =
|
|
76
|
+
const projects = syncGetProjectsByPackageConfig(rootPath, packagesConfig, ignoreConfigs);
|
|
67
77
|
return projects;
|
|
68
78
|
};
|
|
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
import { errorLog } from "../log/error";
|
|
8
8
|
import { getMonorepoBaseData } from "../parse-config/monorepo";
|
|
9
|
-
import {
|
|
9
|
+
import { getProjectsByPackageConfig, syncGetProjectsByPackageConfig } from "./get-projects-by-packages-config";
|
|
10
10
|
import { getProjectsByWorkspaceFile, syncGetProjectsByWorkspaceFile } from "./get-projects-by-workspace-file";
|
|
11
11
|
var FindProjectsMode;
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
|
|
|
40
40
|
|
|
41
41
|
if (Array.isArray(match)) {
|
|
42
42
|
// like lerna`s packages config
|
|
43
|
-
projects = await
|
|
43
|
+
projects = await getProjectsByPackageConfig(rootPath, match, ignore);
|
|
44
44
|
} else {
|
|
45
45
|
// use workspace file
|
|
46
46
|
projects = await getProjectsByWorkspaceFile(rootPath, match, ignore);
|
|
@@ -70,7 +70,7 @@ const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
|
70
70
|
|
|
71
71
|
if (Array.isArray(match)) {
|
|
72
72
|
// like lerna`s packages config
|
|
73
|
-
projects =
|
|
73
|
+
projects = syncGetProjectsByPackageConfig(rootPath, match, ignore);
|
|
74
74
|
} else {
|
|
75
75
|
// use workspace file
|
|
76
76
|
projects = syncGetProjectsByWorkspaceFile(rootPath, match, ignore);
|
|
@@ -110,10 +110,10 @@ const checkFindProjectsMode = (config // eslint-disable-next-line consistent-ret
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
if (config.projectsConfig && config.packagesMatchs) {
|
|
113
|
-
errorLog('There can not be both `
|
|
113
|
+
errorLog('There can not be both `packagesMatchs` and `projectsConfig`');
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
errorLog('No `
|
|
116
|
+
errorLog('No `packagesMatchs` and `projectsConfig` configurations found');
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
export const getProjects = async (config, currentDir = process.cwd()) => {
|
|
@@ -8,7 +8,7 @@ exports.buildCli = void 0;
|
|
|
8
8
|
var _commands = require("../commands");
|
|
9
9
|
|
|
10
10
|
const buildCli = (program, api) => {
|
|
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
|
|
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 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) => {
|
|
12
12
|
await (0, _commands.build)(targetProjectName, option, api);
|
|
13
13
|
});
|
|
14
14
|
};
|
package/dist/js/node/dag/task.js
CHANGED
|
@@ -18,18 +18,18 @@ class TaskRunner extends _events.EventEmitter {
|
|
|
18
18
|
super();
|
|
19
19
|
this._tasks = void 0;
|
|
20
20
|
this._concurrency = void 0;
|
|
21
|
-
this.
|
|
21
|
+
this._usableConcurrency = void 0;
|
|
22
22
|
this._stopFlag = void 0;
|
|
23
23
|
this._tasks = tasks;
|
|
24
24
|
this._concurrency = concurrency || TaskRunner.DefaultConcurrency;
|
|
25
|
-
this.
|
|
25
|
+
this._usableConcurrency = this._concurrency;
|
|
26
26
|
this._stopFlag = false;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async run() {
|
|
30
30
|
const tasks = this._tasks.splice(0, this._concurrency);
|
|
31
31
|
|
|
32
|
-
this.
|
|
32
|
+
this._usableConcurrency = this._concurrency - tasks.length;
|
|
33
33
|
await (0, _pMap.default)(tasks, async task => {
|
|
34
34
|
await this._runTask(task);
|
|
35
35
|
}, {
|
|
@@ -47,13 +47,13 @@ class TaskRunner extends _events.EventEmitter {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const emitValue = await task(this._stopTask.bind(this));
|
|
50
|
-
this.
|
|
50
|
+
this._usableConcurrency--;
|
|
51
51
|
this.emit(TaskRunner.TASK_FINISH, emitValue);
|
|
52
52
|
|
|
53
53
|
if (this._tasks.length > 0) {
|
|
54
|
-
const nextTasks = this._tasks.splice(0, this.
|
|
54
|
+
const nextTasks = this._tasks.splice(0, this._usableConcurrency);
|
|
55
55
|
|
|
56
|
-
this.
|
|
56
|
+
this._usableConcurrency -= nextTasks.length;
|
|
57
57
|
|
|
58
58
|
if (nextTasks.length > 0) {
|
|
59
59
|
await (0, _pMap.default)(nextTasks, async _task => {
|
|
@@ -90,9 +90,9 @@ const generatorAndCopyRequiredFiles = (rootPath, deployDir) => {
|
|
|
90
90
|
const checkAndRunDeployCommand = async (monorepoPath, targetProject, packageManager) => {
|
|
91
91
|
var _targetProject$extra;
|
|
92
92
|
|
|
93
|
-
const
|
|
93
|
+
const scripts = ((_targetProject$extra = targetProject.extra) === null || _targetProject$extra === void 0 ? void 0 : _targetProject$extra.scripts) || {};
|
|
94
94
|
|
|
95
|
-
if (
|
|
95
|
+
if (scripts.deploy) {
|
|
96
96
|
var _childProcess$stdout, _childProcess$stderr;
|
|
97
97
|
|
|
98
98
|
_utils.logger.info(`The 'deploy' command for the ${targetProject.name} is detected, so 'deploy' will be executed`);
|
|
@@ -7,9 +7,7 @@ exports.WatchedProjectsState = void 0;
|
|
|
7
7
|
|
|
8
8
|
var path = _interopRequireWildcard(require("path"));
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var _utils = require("@modern-js/utils");
|
|
13
11
|
|
|
14
12
|
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
13
|
|
|
@@ -44,7 +42,7 @@ class WatchedProjectsState {
|
|
|
44
42
|
ignore: ['**/node_modules/**', '.project-memory/**', 'dist/**']
|
|
45
43
|
};
|
|
46
44
|
this._watchProjects = this._fromNodes.reduce((ret, node) => {
|
|
47
|
-
const files =
|
|
45
|
+
const files = _utils.globby.sync(`${node.extra.path}/**`, globOption);
|
|
48
46
|
|
|
49
47
|
for (const filePath of files) {
|
|
50
48
|
this._projectsFileMap.set(path.relative(this._config.rootPath, filePath), node.extra.path);
|
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
|
|
22
22
|
const replaceWorkspaces = ({
|
|
23
23
|
rootPath,
|
|
24
|
-
|
|
24
|
+
projectsInWorkspaces
|
|
25
25
|
}) => {
|
|
26
26
|
// pnpm
|
|
27
27
|
const pnpmWsFilePath = path.join(rootPath, _constants.WORKSPACE_FILE.PNPM);
|
|
@@ -29,14 +29,14 @@ const replaceWorkspaces = ({
|
|
|
29
29
|
if (_utils.fs.existsSync(pnpmWsFilePath)) {
|
|
30
30
|
const pnpmWorkspace = _utils.fs.readFileSync(pnpmWsFilePath, 'utf-8');
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const originalPnpmWorkspaces = _utils.yaml.load(pnpmWorkspace);
|
|
33
33
|
|
|
34
34
|
_utils.fs.writeFileSync(pnpmWsFilePath, _utils.yaml.dump({
|
|
35
|
-
packages:
|
|
35
|
+
packages: projectsInWorkspaces
|
|
36
36
|
}));
|
|
37
37
|
|
|
38
38
|
return () => {
|
|
39
|
-
_utils.yaml.dump(
|
|
39
|
+
_utils.yaml.dump(originalPnpmWorkspaces);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -49,7 +49,7 @@ const replaceWorkspaces = ({
|
|
|
49
49
|
|
|
50
50
|
if (pkg !== null && pkg !== void 0 && (_pkg$workspaces = pkg.workspaces) !== null && _pkg$workspaces !== void 0 && _pkg$workspaces.packages) {
|
|
51
51
|
const originalPkg = pkg;
|
|
52
|
-
pkg.workspaces.packages =
|
|
52
|
+
pkg.workspaces.packages = projectsInWorkspaces;
|
|
53
53
|
|
|
54
54
|
_nodeCoreLibrary.JsonFile.save(pkg, pkgFilePath);
|
|
55
55
|
|
|
@@ -82,7 +82,7 @@ const runInstallTask = async (projectNames, operator, config) => {
|
|
|
82
82
|
const noDupProjectList = Array.from(new Set(projectsInWorkspaces));
|
|
83
83
|
const restorWorkspace = replaceWorkspaces({
|
|
84
84
|
rootPath,
|
|
85
|
-
|
|
85
|
+
projectsInWorkspaces: noDupProjectList
|
|
86
86
|
});
|
|
87
87
|
await (0, _install.installByPackageManager)(packageManager, {
|
|
88
88
|
rootPath,
|
|
@@ -15,7 +15,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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
17
|
|
|
18
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
19
18
|
const useLerna = monorepoRootPath => {
|
|
20
19
|
if (_nodeCoreLibrary.FileSystem.exists(path.join(monorepoRootPath, _constants.WORKSPACE_FILE.LERNA))) {
|
|
21
20
|
return true;
|
|
@@ -124,7 +123,7 @@ const getMonorepoBaseData = (root = process.cwd()) => {
|
|
|
124
123
|
const rootPath = findMonorepoRoot(root);
|
|
125
124
|
|
|
126
125
|
if (!rootPath) {
|
|
127
|
-
throw new Error('not find any monorepo, you can add lerna、pnpm or yarn
|
|
126
|
+
throw new Error('not find any monorepo, you can add lerna、pnpm or yarn workspace file');
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
return {
|
|
@@ -132,7 +131,5 @@ const getMonorepoBaseData = (root = process.cwd()) => {
|
|
|
132
131
|
packageManager: getPackageManager(rootPath)
|
|
133
132
|
};
|
|
134
133
|
};
|
|
135
|
-
/* eslint-enable react-hooks/rules-of-hooks */
|
|
136
|
-
|
|
137
134
|
|
|
138
135
|
exports.getMonorepoBaseData = getMonorepoBaseData;
|
|
@@ -11,7 +11,7 @@ var _nodeCoreLibrary = require("@rushstack/node-core-library");
|
|
|
11
11
|
|
|
12
12
|
var _packageDepsHash = require("@rushstack/package-deps-hash");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _utils = require("@modern-js/utils");
|
|
15
15
|
|
|
16
16
|
var _md = _interopRequireDefault(require("md5"));
|
|
17
17
|
|
|
@@ -21,7 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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
23
|
|
|
24
|
-
// import type { GlobbyOptions } from 'globby';
|
|
25
24
|
const PROJECT_CONTENT_FILE_NAME = 'project-content.json';
|
|
26
25
|
exports.PROJECT_CONTENT_FILE_NAME = PROJECT_CONTENT_FILE_NAME;
|
|
27
26
|
const MONOREPO_GIT_FILE_NAME = 'monorepo-git.json';
|
|
@@ -39,7 +38,7 @@ const getProjectGitHash = async project => {
|
|
|
39
38
|
ignore: ['**/node_modules/**', '.project-memory/**', 'dist/**']
|
|
40
39
|
};
|
|
41
40
|
const globPattern = `${projectDir}/**`;
|
|
42
|
-
const files = await (0,
|
|
41
|
+
const files = await (0, _utils.globby)(path.posix.join(globPattern), globOption);
|
|
43
42
|
const hashMap = (0, _packageDepsHash.getGitHashForFiles)(files, projectDir);
|
|
44
43
|
const hashObject = {}; // sort is important
|
|
45
44
|
|
|
@@ -61,14 +60,14 @@ const checkProjectChangeByGit = async (project, rootPath) => {
|
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
const
|
|
63
|
+
const monorepoProjectHashJson = _nodeCoreLibrary.JsonFile.load(monorepoGitMemory);
|
|
65
64
|
|
|
66
|
-
const changed =
|
|
65
|
+
const changed = monorepoProjectHashJson[project.name] !== currentProjectHash;
|
|
67
66
|
|
|
68
67
|
if (changed) {
|
|
69
|
-
|
|
68
|
+
monorepoProjectHashJson[project.name] = currentProjectHash;
|
|
70
69
|
|
|
71
|
-
_nodeCoreLibrary.FileSystem.writeFile(monorepoGitMemory, _nodeCoreLibrary.JsonFile.stringify(
|
|
70
|
+
_nodeCoreLibrary.FileSystem.writeFile(monorepoGitMemory, _nodeCoreLibrary.JsonFile.stringify(monorepoProjectHashJson), {
|
|
72
71
|
ensureFolderExists: true
|
|
73
72
|
});
|
|
74
73
|
}
|
|
@@ -88,7 +87,7 @@ const getProjectContentHashObjectForFiles = async project => {
|
|
|
88
87
|
ignore: ['**/node_modules/**', '.project-memory/**', '**/dist/**']
|
|
89
88
|
};
|
|
90
89
|
const globPattern = `${projectDir}/**`;
|
|
91
|
-
const files = await (0,
|
|
90
|
+
const files = await (0, _utils.globby)(path.posix.join(globPattern), globOption);
|
|
92
91
|
const hashObject = {}; // sort is important
|
|
93
92
|
|
|
94
93
|
for (const file of files.sort()) {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.syncGetProjectsByPackageConfig = exports.getProjectsByPackageConfig = void 0;
|
|
7
7
|
|
|
8
8
|
var path = _interopRequireWildcard(require("path"));
|
|
9
9
|
|
|
10
10
|
var _nodeCoreLibrary = require("@rushstack/node-core-library");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _utils = require("@modern-js/utils");
|
|
13
13
|
|
|
14
14
|
var _pMap = _interopRequireDefault(require("p-map"));
|
|
15
15
|
|
|
@@ -58,7 +58,7 @@ const makeFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
|
58
58
|
const options = _objectSpread(_objectSpread({}, customGlobOpts), globOpts);
|
|
59
59
|
|
|
60
60
|
const promise = (0, _pMap.default)(Array.from(packageConfigs).sort(), async globPath => {
|
|
61
|
-
let result = await (0,
|
|
61
|
+
let result = await (0, _utils.globby)(path.posix.join(globPath, fileName), options); // fast-glob does not respect pattern order, so we re-sort by absolute path
|
|
62
62
|
|
|
63
63
|
result = result.sort(); // POSIX results always need to be normalized
|
|
64
64
|
|
|
@@ -73,7 +73,7 @@ const makeFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const getProjectsByPackageConfig = async (rootPath, packagesConfig, ignoreConfigs) => {
|
|
77
77
|
const finder = makeFileFinder(rootPath, packagesConfig, ignoreConfigs);
|
|
78
78
|
const fileName = 'package.json';
|
|
79
79
|
|
|
@@ -91,7 +91,7 @@ const getProjetsByPackageConfig = async (rootPath, packagesConfig, ignoreConfigs
|
|
|
91
91
|
return projects;
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
exports.
|
|
94
|
+
exports.getProjectsByPackageConfig = getProjectsByPackageConfig;
|
|
95
95
|
|
|
96
96
|
const makeSyncFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
97
97
|
const globOpts = getGlobOpts(rootPath, packageConfigs, ignoreConfigs);
|
|
@@ -101,7 +101,7 @@ const makeSyncFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
|
101
101
|
const options = _objectSpread(_objectSpread({}, customGlobOpts), globOpts);
|
|
102
102
|
|
|
103
103
|
for (const globPath of Array.from(packageConfigs).sort()) {
|
|
104
|
-
let result =
|
|
104
|
+
let result = _utils.globby.sync(path.posix.join(globPath, fileName), options); // fast-glob does not respect pattern order, so we re-sort by absolute path
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
result = result.sort(); // POSIX results always need to be normalized
|
|
@@ -114,7 +114,7 @@ const makeSyncFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const syncGetProjectsByPackageConfig = (rootPath, packagesConfig, ignoreConfigs) => {
|
|
118
118
|
const finder = makeSyncFileFinder(rootPath, packagesConfig, ignoreConfigs);
|
|
119
119
|
const fileName = 'package.json';
|
|
120
120
|
|
|
@@ -130,4 +130,4 @@ const syncGetProjetsByPackageConfig = (rootPath, packagesConfig, ignoreConfigs)
|
|
|
130
130
|
return projects;
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
exports.
|
|
133
|
+
exports.syncGetProjectsByPackageConfig = syncGetProjectsByPackageConfig;
|
|
@@ -50,9 +50,15 @@ const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs) => {
|
|
|
50
50
|
const pkgJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
51
51
|
|
|
52
52
|
packagesConfig = (pkgJson === null || pkgJson === void 0 ? void 0 : (_pkgJson$workspaces = pkgJson.workspaces) === null || _pkgJson$workspaces === void 0 ? void 0 : _pkgJson$workspaces.packages) || [];
|
|
53
|
+
} else if (workspaceFile === _constants.WORKSPACE_FILE.LERNA) {
|
|
54
|
+
var _lernaJson$packages;
|
|
55
|
+
|
|
56
|
+
const lernaJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
57
|
+
|
|
58
|
+
packagesConfig = (_lernaJson$packages = lernaJson.packages) !== null && _lernaJson$packages !== void 0 ? _lernaJson$packages : [];
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
const projects = await (0, _getProjectsByPackagesConfig.
|
|
61
|
+
const projects = await (0, _getProjectsByPackagesConfig.getProjectsByPackageConfig)(rootPath, packagesConfig, ignoreConfigs);
|
|
56
62
|
return projects;
|
|
57
63
|
};
|
|
58
64
|
|
|
@@ -87,9 +93,15 @@ const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs) => {
|
|
|
87
93
|
const pkgJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
88
94
|
|
|
89
95
|
packagesConfig = (pkgJson === null || pkgJson === void 0 ? void 0 : (_pkgJson$workspaces2 = pkgJson.workspaces) === null || _pkgJson$workspaces2 === void 0 ? void 0 : _pkgJson$workspaces2.packages) || [];
|
|
96
|
+
} else if (workspaceFile === _constants.WORKSPACE_FILE.LERNA) {
|
|
97
|
+
var _lernaJson$packages2;
|
|
98
|
+
|
|
99
|
+
const lernaJson = _nodeCoreLibrary.JsonFile.load(path.resolve(rootPath, workspaceFile));
|
|
100
|
+
|
|
101
|
+
packagesConfig = (_lernaJson$packages2 = lernaJson.packages) !== null && _lernaJson$packages2 !== void 0 ? _lernaJson$packages2 : [];
|
|
90
102
|
}
|
|
91
103
|
|
|
92
|
-
const projects = (0, _getProjectsByPackagesConfig.
|
|
104
|
+
const projects = (0, _getProjectsByPackagesConfig.syncGetProjectsByPackageConfig)(rootPath, packagesConfig, ignoreConfigs);
|
|
93
105
|
return projects;
|
|
94
106
|
};
|
|
95
107
|
|
|
@@ -51,7 +51,7 @@ const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
|
|
|
51
51
|
|
|
52
52
|
if (Array.isArray(match)) {
|
|
53
53
|
// like lerna`s packages config
|
|
54
|
-
projects = await (0, _getProjectsByPackagesConfig.
|
|
54
|
+
projects = await (0, _getProjectsByPackagesConfig.getProjectsByPackageConfig)(rootPath, match, ignore);
|
|
55
55
|
} else {
|
|
56
56
|
// use workspace file
|
|
57
57
|
projects = await (0, _getProjectsByWorkspaceFile.getProjectsByWorkspaceFile)(rootPath, match, ignore);
|
|
@@ -81,7 +81,7 @@ const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
|
81
81
|
|
|
82
82
|
if (Array.isArray(match)) {
|
|
83
83
|
// like lerna`s packages config
|
|
84
|
-
projects = (0, _getProjectsByPackagesConfig.
|
|
84
|
+
projects = (0, _getProjectsByPackagesConfig.syncGetProjectsByPackageConfig)(rootPath, match, ignore);
|
|
85
85
|
} else {
|
|
86
86
|
// use workspace file
|
|
87
87
|
projects = (0, _getProjectsByWorkspaceFile.syncGetProjectsByWorkspaceFile)(rootPath, match, ignore);
|
|
@@ -121,10 +121,10 @@ const checkFindProjectsMode = (config // eslint-disable-next-line consistent-ret
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
if (config.projectsConfig && config.packagesMatchs) {
|
|
124
|
-
(0, _error.errorLog)('There can not be both `
|
|
124
|
+
(0, _error.errorLog)('There can not be both `packagesMatchs` and `projectsConfig`');
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
(0, _error.errorLog)('No `
|
|
127
|
+
(0, _error.errorLog)('No `packagesMatchs` and `projectsConfig` configurations found');
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
const getProjects = async (config, currentDir = process.cwd()) => {
|
package/dist/types/dag/task.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ITaskRunnerConfig {
|
|
4
4
|
concurrency?: number;
|
|
5
5
|
}
|
|
6
6
|
export declare type TaskFunType<T = undefined> = (stopTask?: () => void) => Promise<T>;
|
|
@@ -9,11 +9,11 @@ export declare class TaskRunner<S> extends EventEmitter {
|
|
|
9
9
|
static TASK_FINISH: string;
|
|
10
10
|
_tasks: TaskFunType<S>[];
|
|
11
11
|
_concurrency: number;
|
|
12
|
-
|
|
12
|
+
_usableConcurrency: number;
|
|
13
13
|
private _stopFlag;
|
|
14
14
|
constructor(tasks: TaskFunType<S>[], {
|
|
15
15
|
concurrency
|
|
16
|
-
}:
|
|
16
|
+
}: ITaskRunnerConfig);
|
|
17
17
|
run(): Promise<void>;
|
|
18
18
|
addTask(task: TaskFunType<S>): void;
|
|
19
19
|
private _runTask;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Package } from '../package';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const getProjectsByPackageConfig: (rootPath: string, packagesConfig: string[], ignoreConfigs: string[]) => Promise<Package[]>;
|
|
3
|
+
export declare const syncGetProjectsByPackageConfig: (rootPath: string, packagesConfig: string[], ignoreConfigs: string[]) => Package[];
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.4.
|
|
14
|
+
"version": "1.4.5",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -35,18 +35,17 @@
|
|
|
35
35
|
"modern": "./bin/modern.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@modern-js/core": "^1.
|
|
38
|
+
"@modern-js/core": "^1.10.1",
|
|
39
39
|
"@babel/runtime": "^7",
|
|
40
|
-
"@modern-js/i18n-cli-language-detector": "^1.2.
|
|
41
|
-
"@modern-js/new-action": "^1.3.
|
|
42
|
-
"@modern-js/plugin": "^1.3.
|
|
43
|
-
"@modern-js/plugin-changeset": "^1.2.
|
|
44
|
-
"@modern-js/plugin-i18n": "^1.2.
|
|
45
|
-
"@modern-js/utils": "^1.
|
|
40
|
+
"@modern-js/i18n-cli-language-detector": "^1.2.2",
|
|
41
|
+
"@modern-js/new-action": "^1.3.8",
|
|
42
|
+
"@modern-js/plugin": "^1.3.3",
|
|
43
|
+
"@modern-js/plugin-changeset": "^1.2.6",
|
|
44
|
+
"@modern-js/plugin-i18n": "^1.2.5",
|
|
45
|
+
"@modern-js/utils": "^1.7.2",
|
|
46
46
|
"@rushstack/node-core-library": "^3.39.1",
|
|
47
47
|
"@rushstack/package-deps-hash": "^3.0.54",
|
|
48
48
|
"anymatch": "^3.1.2",
|
|
49
|
-
"globby": "^11.0.0",
|
|
50
49
|
"md5": "^2.3.0",
|
|
51
50
|
"p-map": "^4.0.0"
|
|
52
51
|
},
|
package/tests/index.test.ts
DELETED
package/tests/tsconfig.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@modern-js/tsconfig/base",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"jsx": "preserve",
|
|
6
|
-
"baseUrl": "./",
|
|
7
|
-
"outDir": "./out",
|
|
8
|
-
"emitDeclarationOnly": true,
|
|
9
|
-
"isolatedModules": true,
|
|
10
|
-
"paths": {},
|
|
11
|
-
"types": ["node", "jest"]
|
|
12
|
-
}
|
|
13
|
-
}
|