@lerna-lite/core 1.3.0 → 1.4.0
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/README.md +13 -12
- package/dist/child-process.d.ts +62 -62
- package/dist/child-process.js +165 -165
- package/dist/command.d.ts +37 -35
- package/dist/command.js +266 -266
- package/dist/command.js.map +1 -1
- package/dist/conventional-commits/constants.d.ts +4 -4
- package/dist/conventional-commits/constants.js +12 -12
- package/dist/conventional-commits/get-changelog-config.d.ts +12 -12
- package/dist/conventional-commits/get-changelog-config.js +98 -98
- package/dist/conventional-commits/index.d.ts +6 -6
- package/dist/conventional-commits/index.js +22 -22
- package/dist/conventional-commits/make-bump-only-filter.d.ts +6 -6
- package/dist/conventional-commits/make-bump-only-filter.js +22 -22
- package/dist/conventional-commits/read-existing-changelog.d.ts +7 -7
- package/dist/conventional-commits/read-existing-changelog.js +32 -32
- package/dist/conventional-commits/recommend-version.d.ts +11 -11
- package/dist/conventional-commits/recommend-version.js +86 -86
- package/dist/conventional-commits/update-changelog.d.ts +11 -11
- package/dist/conventional-commits/update-changelog.js +83 -83
- package/dist/git-clients/GitLabClient.d.ts +8 -8
- package/dist/git-clients/GitLabClient.js +39 -39
- package/dist/git-clients/github-client.d.ts +6 -6
- package/dist/git-clients/github-client.js +40 -40
- package/dist/git-clients/gitlab-client.d.ts +6 -6
- package/dist/git-clients/gitlab-client.js +21 -21
- package/dist/git-clients/index.d.ts +2 -2
- package/dist/git-clients/index.js +18 -18
- package/dist/index.d.ts +12 -12
- package/dist/index.js +30 -30
- package/dist/models/command-options.d.ts +206 -0
- package/dist/models/command-options.js +3 -0
- package/dist/models/command-options.js.map +1 -0
- package/dist/models/index.d.ts +2 -186
- package/dist/models/index.js +18 -2
- package/dist/models/index.js.map +1 -1
- package/dist/models/interfaces.d.ts +201 -0
- package/dist/models/interfaces.js +3 -0
- package/dist/models/interfaces.js.map +1 -0
- package/dist/otplease.d.ts +14 -14
- package/dist/otplease.js +108 -108
- package/dist/package-graph/index.d.ts +2 -2
- package/dist/package-graph/index.js +18 -18
- package/dist/package-graph/lib/cyclic-package-graph-node.d.ts +42 -42
- package/dist/package-graph/lib/cyclic-package-graph-node.js +97 -97
- package/dist/package-graph/lib/index.d.ts +3 -3
- package/dist/package-graph/lib/index.js +19 -19
- package/dist/package-graph/lib/package-graph-node.d.ts +33 -33
- package/dist/package-graph/lib/package-graph-node.js +58 -58
- package/dist/package-graph/lib/report-cycles.d.ts +1 -1
- package/dist/package-graph/lib/report-cycles.js +19 -19
- package/dist/package-graph/package-graph.d.ts +79 -79
- package/dist/package-graph/package-graph.js +276 -276
- package/dist/package.d.ts +91 -85
- package/dist/package.js +282 -276
- package/dist/package.js.map +1 -1
- package/dist/project/index.d.ts +2 -2
- package/dist/project/index.js +18 -18
- package/dist/project/lib/apply-extends.d.ts +10 -10
- package/dist/project/lib/apply-extends.js +37 -37
- package/dist/project/lib/index.d.ts +3 -3
- package/dist/project/lib/index.js +19 -19
- package/dist/project/lib/make-file-finder.d.ts +3 -3
- package/dist/project/lib/make-file-finder.js +71 -71
- package/dist/project/lib/shallow-extend.d.ts +11 -11
- package/dist/project/lib/shallow-extend.js +24 -24
- package/dist/project/project.d.ts +45 -45
- package/dist/project/project.js +195 -195
- package/dist/prompt.d.ts +23 -23
- package/dist/prompt.js +75 -75
- package/dist/utils/check-working-tree.d.ts +8 -8
- package/dist/utils/check-working-tree.js +41 -41
- package/dist/utils/clean-stack.d.ts +5 -5
- package/dist/utils/clean-stack.js +18 -18
- package/dist/utils/collect-uncommitted.d.ts +18 -18
- package/dist/utils/collect-uncommitted.js +40 -40
- package/dist/utils/collect-updates/collect-updates.d.ts +11 -11
- package/dist/utils/collect-updates/collect-updates.js +82 -82
- package/dist/utils/collect-updates/index.d.ts +2 -2
- package/dist/utils/collect-updates/index.js +18 -18
- package/dist/utils/collect-updates/lib/collect-dependents.d.ts +11 -11
- package/dist/utils/collect-updates/lib/collect-dependents.js +45 -45
- package/dist/utils/collect-updates/lib/collect-packages.d.ts +13 -13
- package/dist/utils/collect-updates/lib/collect-packages.js +33 -33
- package/dist/utils/collect-updates/lib/get-packages-for-option.d.ts +5 -5
- package/dist/utils/collect-updates/lib/get-packages-for-option.js +30 -30
- package/dist/utils/collect-updates/lib/has-tags.d.ts +5 -5
- package/dist/utils/collect-updates/lib/has-tags.js +26 -26
- package/dist/utils/collect-updates/lib/index.d.ts +5 -5
- package/dist/utils/collect-updates/lib/index.js +21 -21
- package/dist/utils/collect-updates/lib/make-diff-predicate.d.ts +7 -7
- package/dist/utils/collect-updates/lib/make-diff-predicate.js +64 -64
- package/dist/utils/conf.d.ts +25 -25
- package/dist/utils/conf.js +255 -255
- package/dist/utils/defaults.d.ts +1 -1
- package/dist/utils/defaults.js +182 -182
- package/dist/utils/defaults.js.map +1 -1
- package/dist/utils/describe-ref.d.ts +37 -37
- package/dist/utils/describe-ref.js +80 -80
- package/dist/utils/env-replace.d.ts +1 -1
- package/dist/utils/env-replace.js +22 -22
- package/dist/utils/find-prefix.d.ts +2 -2
- package/dist/utils/find-prefix.js +48 -48
- package/dist/utils/index.d.ts +23 -22
- package/dist/utils/index.js +39 -38
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/log-package-error.d.ts +5 -5
- package/dist/utils/log-package-error.js +35 -35
- package/dist/utils/nerf-dart.d.ts +1 -1
- package/dist/utils/nerf-dart.js +18 -18
- package/dist/utils/npm-conf.d.ts +4 -4
- package/dist/utils/npm-conf.js +55 -55
- package/dist/utils/output.d.ts +1 -1
- package/dist/utils/output.js +13 -13
- package/dist/utils/parse-field.d.ts +1 -1
- package/dist/utils/parse-field.js +65 -65
- package/dist/utils/prerelease-id-from-version.d.ts +5 -5
- package/dist/utils/prerelease-id-from-version.js +15 -15
- package/dist/utils/pulse-till-done.d.ts +1 -1
- package/dist/utils/pulse-till-done.js +40 -40
- package/dist/utils/query-graph.d.ts +36 -36
- package/dist/utils/query-graph.js +77 -77
- package/dist/utils/query-graph.js.map +1 -1
- package/dist/utils/run-lifecycle.d.ts +10 -10
- package/dist/utils/run-lifecycle.js +131 -107
- package/dist/utils/run-lifecycle.js.map +1 -1
- package/dist/utils/run-topologically.d.ts +12 -12
- package/dist/utils/run-topologically.js +36 -36
- package/dist/utils/temp-write.d.ts +13 -0
- package/dist/utils/temp-write.js +50 -0
- package/dist/utils/temp-write.js.map +1 -0
- package/dist/utils/types.d.ts +131 -129
- package/dist/utils/types.js +138 -138
- package/dist/utils/warn-if-hanging.d.ts +1 -1
- package/dist/utils/warn-if-hanging.js +17 -17
- package/dist/utils/write-log-file.d.ts +1 -1
- package/dist/utils/write-log-file.js +32 -32
- package/dist/validation-error.d.ts +4 -4
- package/dist/validation-error.js +18 -18
- package/package.json +14 -10
package/dist/project/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./project"), exports);
|
|
18
|
-
__exportStar(require("./lib"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./project"), exports);
|
|
18
|
+
__exportStar(require("./lib"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {{ [key: string]: unknown }} config
|
|
3
|
-
* @param {string} cwd
|
|
4
|
-
* @param {Set<string>} seen
|
|
5
|
-
*/
|
|
6
|
-
export declare function applyExtends(config: {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}, cwd: string, seen?: Set<string>): {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @param {{ [key: string]: unknown }} config
|
|
3
|
+
* @param {string} cwd
|
|
4
|
+
* @param {Set<string>} seen
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyExtends(config: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}, cwd: string, seen?: Set<string>): {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.applyExtends = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
9
|
-
const shallow_extend_1 = require("./shallow-extend");
|
|
10
|
-
const validation_error_1 = require("../../validation-error");
|
|
11
|
-
/**
|
|
12
|
-
* @param {{ [key: string]: unknown }} config
|
|
13
|
-
* @param {string} cwd
|
|
14
|
-
* @param {Set<string>} seen
|
|
15
|
-
*/
|
|
16
|
-
function applyExtends(config, cwd, seen = new Set()) {
|
|
17
|
-
let defaultConfig = {};
|
|
18
|
-
if ('extends' in config) {
|
|
19
|
-
let pathToDefault;
|
|
20
|
-
try {
|
|
21
|
-
pathToDefault = (0, resolve_from_1.default)(cwd, config.extends);
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
throw new validation_error_1.ValidationError('ERESOLVED', 'Config .extends must be locally-resolvable', err);
|
|
25
|
-
}
|
|
26
|
-
if (seen.has(pathToDefault)) {
|
|
27
|
-
throw new validation_error_1.ValidationError('ECIRCULAR', 'Config .extends cannot be circular', seen);
|
|
28
|
-
}
|
|
29
|
-
seen.add(pathToDefault);
|
|
30
|
-
defaultConfig = require(pathToDefault);
|
|
31
|
-
delete config.extends; // eslint-disable-line no-param-reassign
|
|
32
|
-
// deprecateConfig(defaultConfig, pathToDefault);
|
|
33
|
-
defaultConfig = applyExtends(defaultConfig, path_1.default.dirname(pathToDefault), seen);
|
|
34
|
-
}
|
|
35
|
-
return (0, shallow_extend_1.shallowExtend)(config, defaultConfig);
|
|
36
|
-
}
|
|
37
|
-
exports.applyExtends = applyExtends;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.applyExtends = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
9
|
+
const shallow_extend_1 = require("./shallow-extend");
|
|
10
|
+
const validation_error_1 = require("../../validation-error");
|
|
11
|
+
/**
|
|
12
|
+
* @param {{ [key: string]: unknown }} config
|
|
13
|
+
* @param {string} cwd
|
|
14
|
+
* @param {Set<string>} seen
|
|
15
|
+
*/
|
|
16
|
+
function applyExtends(config, cwd, seen = new Set()) {
|
|
17
|
+
let defaultConfig = {};
|
|
18
|
+
if ('extends' in config) {
|
|
19
|
+
let pathToDefault;
|
|
20
|
+
try {
|
|
21
|
+
pathToDefault = (0, resolve_from_1.default)(cwd, config.extends);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
throw new validation_error_1.ValidationError('ERESOLVED', 'Config .extends must be locally-resolvable', err);
|
|
25
|
+
}
|
|
26
|
+
if (seen.has(pathToDefault)) {
|
|
27
|
+
throw new validation_error_1.ValidationError('ECIRCULAR', 'Config .extends cannot be circular', seen);
|
|
28
|
+
}
|
|
29
|
+
seen.add(pathToDefault);
|
|
30
|
+
defaultConfig = require(pathToDefault);
|
|
31
|
+
delete config.extends; // eslint-disable-line no-param-reassign
|
|
32
|
+
// deprecateConfig(defaultConfig, pathToDefault);
|
|
33
|
+
defaultConfig = applyExtends(defaultConfig, path_1.default.dirname(pathToDefault), seen);
|
|
34
|
+
}
|
|
35
|
+
return (0, shallow_extend_1.shallowExtend)(config, defaultConfig);
|
|
36
|
+
}
|
|
37
|
+
exports.applyExtends = applyExtends;
|
|
38
38
|
//# sourceMappingURL=apply-extends.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './apply-extends';
|
|
2
|
-
export * from './make-file-finder';
|
|
3
|
-
export * from './shallow-extend';
|
|
1
|
+
export * from './apply-extends';
|
|
2
|
+
export * from './make-file-finder';
|
|
3
|
+
export * from './shallow-extend';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./apply-extends"), exports);
|
|
18
|
-
__exportStar(require("./make-file-finder"), exports);
|
|
19
|
-
__exportStar(require("./shallow-extend"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./apply-extends"), exports);
|
|
18
|
+
__exportStar(require("./make-file-finder"), exports);
|
|
19
|
+
__exportStar(require("./shallow-extend"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function makeFileFinder(rootPath: string, packageConfigs: string[]): (fileName: string, fileMapper: any, customGlobOpts?: any) => Promise<any>;
|
|
3
|
-
export declare function makeSyncFileFinder(rootPath: string, packageConfigs: string[]): (fileName: string, fileMapper: (value: string, index: number, array: string[]) => any, customGlobOpts?:
|
|
1
|
+
import { GlobbyOptions } from 'globby';
|
|
2
|
+
export declare function makeFileFinder(rootPath: string, packageConfigs: string[]): (fileName: string, fileMapper: any, customGlobOpts?: any) => Promise<any>;
|
|
3
|
+
export declare function makeSyncFileFinder(rootPath: string, packageConfigs: string[]): (fileName: string, fileMapper: (value: string, index: number, array: string[]) => any, customGlobOpts?: GlobbyOptions) => string[];
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.makeSyncFileFinder = exports.makeFileFinder = void 0;
|
|
7
|
-
const globby_1 = __importDefault(require("globby"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const p_map_1 = __importDefault(require("p-map"));
|
|
10
|
-
const validation_error_1 = require("../../validation-error");
|
|
11
|
-
/**
|
|
12
|
-
* @param {string[]} results
|
|
13
|
-
*/
|
|
14
|
-
function normalize(results) {
|
|
15
|
-
return results.map((fp) => path_1.default.normalize(fp));
|
|
16
|
-
}
|
|
17
|
-
function getGlobOpts(rootPath, packageConfigs) {
|
|
18
|
-
const globOpts = {
|
|
19
|
-
cwd: rootPath,
|
|
20
|
-
absolute: true,
|
|
21
|
-
expandDirectories: false,
|
|
22
|
-
followSymbolicLinks: false,
|
|
23
|
-
};
|
|
24
|
-
if (packageConfigs.some((cfg) => cfg.indexOf('**') > -1)) {
|
|
25
|
-
if (packageConfigs.some((cfg) => cfg.indexOf('node_modules') > -1)) {
|
|
26
|
-
throw new validation_error_1.ValidationError('EPKGCONFIG', 'An explicit node_modules package path does not allow globstars (**)');
|
|
27
|
-
}
|
|
28
|
-
globOpts.ignore = [
|
|
29
|
-
// allow globs like "packages/**",
|
|
30
|
-
// but avoid picking up node_modules/**/package.json
|
|
31
|
-
'**/node_modules/**',
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
return globOpts;
|
|
35
|
-
}
|
|
36
|
-
function makeFileFinder(rootPath, packageConfigs) {
|
|
37
|
-
const globOpts = getGlobOpts(rootPath, packageConfigs);
|
|
38
|
-
return (fileName, fileMapper, customGlobOpts) => {
|
|
39
|
-
const options = Object.assign({}, customGlobOpts, globOpts);
|
|
40
|
-
const promise = (0, p_map_1.default)(Array.from(packageConfigs).sort(), (globPath) => {
|
|
41
|
-
let chain = (0, globby_1.default)(path_1.default.posix.join(globPath, fileName), options);
|
|
42
|
-
// fast-glob does not respect pattern order, so we re-sort by absolute path
|
|
43
|
-
chain = chain.then((results) => results.sort());
|
|
44
|
-
// POSIX results always need to be normalized
|
|
45
|
-
chain = chain.then(normalize);
|
|
46
|
-
if (fileMapper) {
|
|
47
|
-
chain = chain.then(fileMapper);
|
|
48
|
-
}
|
|
49
|
-
return chain;
|
|
50
|
-
}, { concurrency: 4 });
|
|
51
|
-
// always flatten the results
|
|
52
|
-
return promise.then((results) => results.reduce((acc, result) => acc.concat(result), []));
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.makeFileFinder = makeFileFinder;
|
|
56
|
-
function makeSyncFileFinder(rootPath, packageConfigs) {
|
|
57
|
-
const globOpts = getGlobOpts(rootPath, packageConfigs);
|
|
58
|
-
return (fileName, fileMapper, customGlobOpts) => {
|
|
59
|
-
const options = Object.assign({}, customGlobOpts, globOpts);
|
|
60
|
-
const patterns = packageConfigs.map((globPath) => path_1.default.posix.join(globPath, fileName)).sort();
|
|
61
|
-
let results = globby_1.default.sync(patterns, options);
|
|
62
|
-
// POSIX results always need to be normalized
|
|
63
|
-
results = normalize(results);
|
|
64
|
-
/* istanbul ignore else */
|
|
65
|
-
if (fileMapper) {
|
|
66
|
-
results = results.map(fileMapper);
|
|
67
|
-
}
|
|
68
|
-
return results;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
exports.makeSyncFileFinder = makeSyncFileFinder;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.makeSyncFileFinder = exports.makeFileFinder = void 0;
|
|
7
|
+
const globby_1 = __importDefault(require("globby"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const p_map_1 = __importDefault(require("p-map"));
|
|
10
|
+
const validation_error_1 = require("../../validation-error");
|
|
11
|
+
/**
|
|
12
|
+
* @param {string[]} results
|
|
13
|
+
*/
|
|
14
|
+
function normalize(results) {
|
|
15
|
+
return results.map((fp) => path_1.default.normalize(fp));
|
|
16
|
+
}
|
|
17
|
+
function getGlobOpts(rootPath, packageConfigs) {
|
|
18
|
+
const globOpts = {
|
|
19
|
+
cwd: rootPath,
|
|
20
|
+
absolute: true,
|
|
21
|
+
expandDirectories: false,
|
|
22
|
+
followSymbolicLinks: false,
|
|
23
|
+
};
|
|
24
|
+
if (packageConfigs.some((cfg) => cfg.indexOf('**') > -1)) {
|
|
25
|
+
if (packageConfigs.some((cfg) => cfg.indexOf('node_modules') > -1)) {
|
|
26
|
+
throw new validation_error_1.ValidationError('EPKGCONFIG', 'An explicit node_modules package path does not allow globstars (**)');
|
|
27
|
+
}
|
|
28
|
+
globOpts.ignore = [
|
|
29
|
+
// allow globs like "packages/**",
|
|
30
|
+
// but avoid picking up node_modules/**/package.json
|
|
31
|
+
'**/node_modules/**',
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
return globOpts;
|
|
35
|
+
}
|
|
36
|
+
function makeFileFinder(rootPath, packageConfigs) {
|
|
37
|
+
const globOpts = getGlobOpts(rootPath, packageConfigs);
|
|
38
|
+
return (fileName, fileMapper, customGlobOpts) => {
|
|
39
|
+
const options = Object.assign({}, customGlobOpts, globOpts);
|
|
40
|
+
const promise = (0, p_map_1.default)(Array.from(packageConfigs).sort(), (globPath) => {
|
|
41
|
+
let chain = (0, globby_1.default)(path_1.default.posix.join(globPath, fileName), options);
|
|
42
|
+
// fast-glob does not respect pattern order, so we re-sort by absolute path
|
|
43
|
+
chain = chain.then((results) => results.sort());
|
|
44
|
+
// POSIX results always need to be normalized
|
|
45
|
+
chain = chain.then(normalize);
|
|
46
|
+
if (fileMapper) {
|
|
47
|
+
chain = chain.then(fileMapper);
|
|
48
|
+
}
|
|
49
|
+
return chain;
|
|
50
|
+
}, { concurrency: 4 });
|
|
51
|
+
// always flatten the results
|
|
52
|
+
return promise.then((results) => results.reduce((acc, result) => acc.concat(result), []));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
exports.makeFileFinder = makeFileFinder;
|
|
56
|
+
function makeSyncFileFinder(rootPath, packageConfigs) {
|
|
57
|
+
const globOpts = getGlobOpts(rootPath, packageConfigs);
|
|
58
|
+
return (fileName, fileMapper, customGlobOpts) => {
|
|
59
|
+
const options = Object.assign({}, customGlobOpts, globOpts);
|
|
60
|
+
const patterns = packageConfigs.map((globPath) => path_1.default.posix.join(globPath, fileName)).sort();
|
|
61
|
+
let results = globby_1.default.sync(patterns, options);
|
|
62
|
+
// POSIX results always need to be normalized
|
|
63
|
+
results = normalize(results);
|
|
64
|
+
/* istanbul ignore else */
|
|
65
|
+
if (fileMapper) {
|
|
66
|
+
results = results.map(fileMapper);
|
|
67
|
+
}
|
|
68
|
+
return results;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
exports.makeSyncFileFinder = makeSyncFileFinder;
|
|
72
72
|
//# sourceMappingURL=make-file-finder.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {{ [key: string]: unknown }} json
|
|
3
|
-
* @param {{ [key: string]: unknown }} defaults
|
|
4
|
-
*/
|
|
5
|
-
export declare function shallowExtend(json: {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}, defaults?: {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}): {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @param {{ [key: string]: unknown }} json
|
|
3
|
+
* @param {{ [key: string]: unknown }} defaults
|
|
4
|
+
*/
|
|
5
|
+
export declare function shallowExtend(json: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}, defaults?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}): {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shallowExtend = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @param {{ [key: string]: unknown }} json
|
|
6
|
-
* @param {{ [key: string]: unknown }} defaults
|
|
7
|
-
*/
|
|
8
|
-
function shallowExtend(json, defaults = {}) {
|
|
9
|
-
return Object.keys(json).reduce((obj, key) => {
|
|
10
|
-
const val = json[key];
|
|
11
|
-
if (Array.isArray(val)) {
|
|
12
|
-
// always clobber arrays, merging isn't worth unexpected complexity
|
|
13
|
-
obj[key] = val.slice();
|
|
14
|
-
}
|
|
15
|
-
else if (val && typeof val === 'object') {
|
|
16
|
-
obj[key] = shallowExtend(val, obj[key]);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
obj[key] = val;
|
|
20
|
-
}
|
|
21
|
-
return obj;
|
|
22
|
-
}, defaults);
|
|
23
|
-
}
|
|
24
|
-
exports.shallowExtend = shallowExtend;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shallowExtend = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @param {{ [key: string]: unknown }} json
|
|
6
|
+
* @param {{ [key: string]: unknown }} defaults
|
|
7
|
+
*/
|
|
8
|
+
function shallowExtend(json, defaults = {}) {
|
|
9
|
+
return Object.keys(json).reduce((obj, key) => {
|
|
10
|
+
const val = json[key];
|
|
11
|
+
if (Array.isArray(val)) {
|
|
12
|
+
// always clobber arrays, merging isn't worth unexpected complexity
|
|
13
|
+
obj[key] = val.slice();
|
|
14
|
+
}
|
|
15
|
+
else if (val && typeof val === 'object') {
|
|
16
|
+
obj[key] = shallowExtend(val, obj[key]);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
obj[key] = val;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}, defaults);
|
|
23
|
+
}
|
|
24
|
+
exports.shallowExtend = shallowExtend;
|
|
25
25
|
//# sourceMappingURL=shallow-extend.js.map
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { Package } from '../package';
|
|
2
|
-
import { ProjectConfig } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* A representation of the entire project managed by Lerna.
|
|
5
|
-
*
|
|
6
|
-
* Wherever the lerna.json file is located, that is the project root.
|
|
7
|
-
* All package globs are rooted from this location.
|
|
8
|
-
*/
|
|
9
|
-
export declare class Project {
|
|
10
|
-
config: ProjectConfig;
|
|
11
|
-
rootConfigLocation: string;
|
|
12
|
-
rootPath: string;
|
|
13
|
-
static PACKAGE_GLOB: string;
|
|
14
|
-
static LICENSE_GLOB: string;
|
|
15
|
-
/**
|
|
16
|
-
* @param {string} [cwd] Defaults to process.cwd()
|
|
17
|
-
*/
|
|
18
|
-
constructor(cwd: string);
|
|
19
|
-
/**
|
|
20
|
-
* @param {string} [cwd] Defaults to process.cwd()
|
|
21
|
-
*/
|
|
22
|
-
static getPackages(cwd: string): Promise<Package[]>;
|
|
23
|
-
/**
|
|
24
|
-
* @param {string} [cwd] Defaults to process.cwd()
|
|
25
|
-
*/
|
|
26
|
-
static getPackagesSync(cwd: string): string[];
|
|
27
|
-
get version(): string;
|
|
28
|
-
set version(val: string);
|
|
29
|
-
get packageConfigs(): string[];
|
|
30
|
-
get packageParentDirs(): Promise<string[]>;
|
|
31
|
-
get manifest():
|
|
32
|
-
get licensePath(): string;
|
|
33
|
-
get fileFinder(): (fileName: string, fileMapper: any, customGlobOpts?: any) => Promise<any>;
|
|
34
|
-
/**
|
|
35
|
-
* @returns {Promise<Package[]>} A promise resolving to a list of Package instances
|
|
36
|
-
*/
|
|
37
|
-
getPackages(): Promise<Package[]>;
|
|
38
|
-
/**
|
|
39
|
-
* @returns {Package[]} A list of Package instances
|
|
40
|
-
*/
|
|
41
|
-
getPackagesSync(): string[];
|
|
42
|
-
getPackageLicensePaths(): Promise<string[]>;
|
|
43
|
-
isIndependent(): boolean;
|
|
44
|
-
serializeConfig(): Promise<string>;
|
|
45
|
-
}
|
|
1
|
+
import { Package } from '../package';
|
|
2
|
+
import { ProjectConfig, RawManifest } from '../models';
|
|
3
|
+
/**
|
|
4
|
+
* A representation of the entire project managed by Lerna.
|
|
5
|
+
*
|
|
6
|
+
* Wherever the lerna.json file is located, that is the project root.
|
|
7
|
+
* All package globs are rooted from this location.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Project {
|
|
10
|
+
config: ProjectConfig;
|
|
11
|
+
rootConfigLocation: string;
|
|
12
|
+
rootPath: string;
|
|
13
|
+
static PACKAGE_GLOB: string;
|
|
14
|
+
static LICENSE_GLOB: string;
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} [cwd] Defaults to process.cwd()
|
|
17
|
+
*/
|
|
18
|
+
constructor(cwd: string);
|
|
19
|
+
/**
|
|
20
|
+
* @param {string} [cwd] Defaults to process.cwd()
|
|
21
|
+
*/
|
|
22
|
+
static getPackages(cwd: string): Promise<Package[]>;
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} [cwd] Defaults to process.cwd()
|
|
25
|
+
*/
|
|
26
|
+
static getPackagesSync(cwd: string): string[];
|
|
27
|
+
get version(): string;
|
|
28
|
+
set version(val: string);
|
|
29
|
+
get packageConfigs(): string[];
|
|
30
|
+
get packageParentDirs(): Promise<string[]>;
|
|
31
|
+
get manifest(): RawManifest;
|
|
32
|
+
get licensePath(): string;
|
|
33
|
+
get fileFinder(): (fileName: string, fileMapper: any, customGlobOpts?: any) => Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* @returns {Promise<Package[]>} A promise resolving to a list of Package instances
|
|
36
|
+
*/
|
|
37
|
+
getPackages(): Promise<Package[]>;
|
|
38
|
+
/**
|
|
39
|
+
* @returns {Package[]} A list of Package instances
|
|
40
|
+
*/
|
|
41
|
+
getPackagesSync(): string[];
|
|
42
|
+
getPackageLicensePaths(): Promise<string[]>;
|
|
43
|
+
isIndependent(): boolean;
|
|
44
|
+
serializeConfig(): Promise<string>;
|
|
45
|
+
}
|