@modern-js/monorepo-tools 1.4.3 → 1.4.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.
- package/CHANGELOG.md +20 -0
- package/dist/js/modern/features/dev/watch-projects-state.js +1 -1
- package/dist/js/modern/parse-config/monorepo.js +1 -3
- package/dist/js/modern/projects/check-project-change.js +1 -2
- package/dist/js/modern/projects/get-projects-by-packages-config.js +1 -1
- package/dist/js/node/features/dev/watch-projects-state.js +2 -4
- package/dist/js/node/parse-config/monorepo.js +0 -3
- package/dist/js/node/projects/check-project-change.js +3 -4
- package/dist/js/node/projects/get-projects-by-packages-config.js +3 -3
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @modern-js/monorepo-tools
|
|
2
2
|
|
|
3
|
+
## 1.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 592edabc: feat: prebundle url-join,mime-types,json5,fast-glob,globby,ora,inquirer
|
|
8
|
+
- Updated dependencies [2d155c4c]
|
|
9
|
+
- Updated dependencies [123e432d]
|
|
10
|
+
- Updated dependencies [e5a9b26d]
|
|
11
|
+
- Updated dependencies [0b26b93b]
|
|
12
|
+
- Updated dependencies [123e432d]
|
|
13
|
+
- Updated dependencies [f9f66ef9]
|
|
14
|
+
- Updated dependencies [592edabc]
|
|
15
|
+
- Updated dependencies [895fa0ff]
|
|
16
|
+
- Updated dependencies [3578913e]
|
|
17
|
+
- Updated dependencies [1c3beab3]
|
|
18
|
+
- @modern-js/utils@1.6.0
|
|
19
|
+
- @modern-js/core@1.9.0
|
|
20
|
+
- @modern-js/new-action@1.3.7
|
|
21
|
+
- @modern-js/plugin-changeset@1.2.5
|
|
22
|
+
|
|
3
23
|
## 1.4.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -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;
|
|
@@ -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";
|
|
@@ -109,5 +108,4 @@ export const getMonorepoBaseData = (root = process.cwd()) => {
|
|
|
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';
|
|
@@ -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";
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -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
|
|
|
@@ -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()) {
|
|
@@ -9,7 +9,7 @@ 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
|
|
|
@@ -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
|
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.4",
|
|
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.9.0",
|
|
39
39
|
"@babel/runtime": "^7",
|
|
40
40
|
"@modern-js/i18n-cli-language-detector": "^1.2.2",
|
|
41
|
-
"@modern-js/new-action": "^1.3.
|
|
41
|
+
"@modern-js/new-action": "^1.3.7",
|
|
42
42
|
"@modern-js/plugin": "^1.3.3",
|
|
43
43
|
"@modern-js/plugin-changeset": "^1.2.5",
|
|
44
44
|
"@modern-js/plugin-i18n": "^1.2.4",
|
|
45
|
-
"@modern-js/utils": "^1.
|
|
45
|
+
"@modern-js/utils": "^1.6.0",
|
|
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
|
},
|