@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.
Files changed (140) hide show
  1. package/README.md +13 -12
  2. package/dist/child-process.d.ts +62 -62
  3. package/dist/child-process.js +165 -165
  4. package/dist/command.d.ts +37 -35
  5. package/dist/command.js +266 -266
  6. package/dist/command.js.map +1 -1
  7. package/dist/conventional-commits/constants.d.ts +4 -4
  8. package/dist/conventional-commits/constants.js +12 -12
  9. package/dist/conventional-commits/get-changelog-config.d.ts +12 -12
  10. package/dist/conventional-commits/get-changelog-config.js +98 -98
  11. package/dist/conventional-commits/index.d.ts +6 -6
  12. package/dist/conventional-commits/index.js +22 -22
  13. package/dist/conventional-commits/make-bump-only-filter.d.ts +6 -6
  14. package/dist/conventional-commits/make-bump-only-filter.js +22 -22
  15. package/dist/conventional-commits/read-existing-changelog.d.ts +7 -7
  16. package/dist/conventional-commits/read-existing-changelog.js +32 -32
  17. package/dist/conventional-commits/recommend-version.d.ts +11 -11
  18. package/dist/conventional-commits/recommend-version.js +86 -86
  19. package/dist/conventional-commits/update-changelog.d.ts +11 -11
  20. package/dist/conventional-commits/update-changelog.js +83 -83
  21. package/dist/git-clients/GitLabClient.d.ts +8 -8
  22. package/dist/git-clients/GitLabClient.js +39 -39
  23. package/dist/git-clients/github-client.d.ts +6 -6
  24. package/dist/git-clients/github-client.js +40 -40
  25. package/dist/git-clients/gitlab-client.d.ts +6 -6
  26. package/dist/git-clients/gitlab-client.js +21 -21
  27. package/dist/git-clients/index.d.ts +2 -2
  28. package/dist/git-clients/index.js +18 -18
  29. package/dist/index.d.ts +12 -12
  30. package/dist/index.js +30 -30
  31. package/dist/models/command-options.d.ts +206 -0
  32. package/dist/models/command-options.js +3 -0
  33. package/dist/models/command-options.js.map +1 -0
  34. package/dist/models/index.d.ts +2 -186
  35. package/dist/models/index.js +18 -2
  36. package/dist/models/index.js.map +1 -1
  37. package/dist/models/interfaces.d.ts +201 -0
  38. package/dist/models/interfaces.js +3 -0
  39. package/dist/models/interfaces.js.map +1 -0
  40. package/dist/otplease.d.ts +14 -14
  41. package/dist/otplease.js +108 -108
  42. package/dist/package-graph/index.d.ts +2 -2
  43. package/dist/package-graph/index.js +18 -18
  44. package/dist/package-graph/lib/cyclic-package-graph-node.d.ts +42 -42
  45. package/dist/package-graph/lib/cyclic-package-graph-node.js +97 -97
  46. package/dist/package-graph/lib/index.d.ts +3 -3
  47. package/dist/package-graph/lib/index.js +19 -19
  48. package/dist/package-graph/lib/package-graph-node.d.ts +33 -33
  49. package/dist/package-graph/lib/package-graph-node.js +58 -58
  50. package/dist/package-graph/lib/report-cycles.d.ts +1 -1
  51. package/dist/package-graph/lib/report-cycles.js +19 -19
  52. package/dist/package-graph/package-graph.d.ts +79 -79
  53. package/dist/package-graph/package-graph.js +276 -276
  54. package/dist/package.d.ts +91 -85
  55. package/dist/package.js +282 -276
  56. package/dist/package.js.map +1 -1
  57. package/dist/project/index.d.ts +2 -2
  58. package/dist/project/index.js +18 -18
  59. package/dist/project/lib/apply-extends.d.ts +10 -10
  60. package/dist/project/lib/apply-extends.js +37 -37
  61. package/dist/project/lib/index.d.ts +3 -3
  62. package/dist/project/lib/index.js +19 -19
  63. package/dist/project/lib/make-file-finder.d.ts +3 -3
  64. package/dist/project/lib/make-file-finder.js +71 -71
  65. package/dist/project/lib/shallow-extend.d.ts +11 -11
  66. package/dist/project/lib/shallow-extend.js +24 -24
  67. package/dist/project/project.d.ts +45 -45
  68. package/dist/project/project.js +195 -195
  69. package/dist/prompt.d.ts +23 -23
  70. package/dist/prompt.js +75 -75
  71. package/dist/utils/check-working-tree.d.ts +8 -8
  72. package/dist/utils/check-working-tree.js +41 -41
  73. package/dist/utils/clean-stack.d.ts +5 -5
  74. package/dist/utils/clean-stack.js +18 -18
  75. package/dist/utils/collect-uncommitted.d.ts +18 -18
  76. package/dist/utils/collect-uncommitted.js +40 -40
  77. package/dist/utils/collect-updates/collect-updates.d.ts +11 -11
  78. package/dist/utils/collect-updates/collect-updates.js +82 -82
  79. package/dist/utils/collect-updates/index.d.ts +2 -2
  80. package/dist/utils/collect-updates/index.js +18 -18
  81. package/dist/utils/collect-updates/lib/collect-dependents.d.ts +11 -11
  82. package/dist/utils/collect-updates/lib/collect-dependents.js +45 -45
  83. package/dist/utils/collect-updates/lib/collect-packages.d.ts +13 -13
  84. package/dist/utils/collect-updates/lib/collect-packages.js +33 -33
  85. package/dist/utils/collect-updates/lib/get-packages-for-option.d.ts +5 -5
  86. package/dist/utils/collect-updates/lib/get-packages-for-option.js +30 -30
  87. package/dist/utils/collect-updates/lib/has-tags.d.ts +5 -5
  88. package/dist/utils/collect-updates/lib/has-tags.js +26 -26
  89. package/dist/utils/collect-updates/lib/index.d.ts +5 -5
  90. package/dist/utils/collect-updates/lib/index.js +21 -21
  91. package/dist/utils/collect-updates/lib/make-diff-predicate.d.ts +7 -7
  92. package/dist/utils/collect-updates/lib/make-diff-predicate.js +64 -64
  93. package/dist/utils/conf.d.ts +25 -25
  94. package/dist/utils/conf.js +255 -255
  95. package/dist/utils/defaults.d.ts +1 -1
  96. package/dist/utils/defaults.js +182 -182
  97. package/dist/utils/defaults.js.map +1 -1
  98. package/dist/utils/describe-ref.d.ts +37 -37
  99. package/dist/utils/describe-ref.js +80 -80
  100. package/dist/utils/env-replace.d.ts +1 -1
  101. package/dist/utils/env-replace.js +22 -22
  102. package/dist/utils/find-prefix.d.ts +2 -2
  103. package/dist/utils/find-prefix.js +48 -48
  104. package/dist/utils/index.d.ts +23 -22
  105. package/dist/utils/index.js +39 -38
  106. package/dist/utils/index.js.map +1 -1
  107. package/dist/utils/log-package-error.d.ts +5 -5
  108. package/dist/utils/log-package-error.js +35 -35
  109. package/dist/utils/nerf-dart.d.ts +1 -1
  110. package/dist/utils/nerf-dart.js +18 -18
  111. package/dist/utils/npm-conf.d.ts +4 -4
  112. package/dist/utils/npm-conf.js +55 -55
  113. package/dist/utils/output.d.ts +1 -1
  114. package/dist/utils/output.js +13 -13
  115. package/dist/utils/parse-field.d.ts +1 -1
  116. package/dist/utils/parse-field.js +65 -65
  117. package/dist/utils/prerelease-id-from-version.d.ts +5 -5
  118. package/dist/utils/prerelease-id-from-version.js +15 -15
  119. package/dist/utils/pulse-till-done.d.ts +1 -1
  120. package/dist/utils/pulse-till-done.js +40 -40
  121. package/dist/utils/query-graph.d.ts +36 -36
  122. package/dist/utils/query-graph.js +77 -77
  123. package/dist/utils/query-graph.js.map +1 -1
  124. package/dist/utils/run-lifecycle.d.ts +10 -10
  125. package/dist/utils/run-lifecycle.js +131 -107
  126. package/dist/utils/run-lifecycle.js.map +1 -1
  127. package/dist/utils/run-topologically.d.ts +12 -12
  128. package/dist/utils/run-topologically.js +36 -36
  129. package/dist/utils/temp-write.d.ts +13 -0
  130. package/dist/utils/temp-write.js +50 -0
  131. package/dist/utils/temp-write.js.map +1 -0
  132. package/dist/utils/types.d.ts +131 -129
  133. package/dist/utils/types.js +138 -138
  134. package/dist/utils/warn-if-hanging.d.ts +1 -1
  135. package/dist/utils/warn-if-hanging.js +17 -17
  136. package/dist/utils/write-log-file.d.ts +1 -1
  137. package/dist/utils/write-log-file.js +32 -32
  138. package/dist/validation-error.d.ts +4 -4
  139. package/dist/validation-error.js +18 -18
  140. package/package.json +14 -10
@@ -1,59 +1,59 @@
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.PackageGraphNode = void 0;
7
- const semver_1 = __importDefault(require("semver"));
8
- const prerelease_id_from_version_1 = require("../../utils/prerelease-id-from-version");
9
- const PKG = Symbol('pkg');
10
- /**
11
- * A node in a PackageGraph.
12
- */
13
- class PackageGraphNode {
14
- /**
15
- * @param {import("@lerna/package").Package} pkg
16
- */
17
- constructor(pkg) {
18
- var _a;
19
- this.name = (_a = pkg === null || pkg === void 0 ? void 0 : pkg.name) !== null && _a !== void 0 ? _a : '';
20
- this[PKG] = pkg;
21
- // omit raw pkg from default util.inspect() output
22
- Object.defineProperty(this, PKG, { enumerable: false });
23
- this.externalDependencies = new Map();
24
- this.localDependencies = new Map();
25
- this.localDependents = new Map();
26
- }
27
- get location() {
28
- return this[PKG].location;
29
- }
30
- get pkg() {
31
- return this[PKG];
32
- }
33
- get prereleaseId() {
34
- return (0, prerelease_id_from_version_1.prereleaseIdFromVersion)(this.version);
35
- }
36
- get version() {
37
- return this[PKG].version;
38
- }
39
- /**
40
- * Determine if the Node satisfies a resolved semver range.
41
- * @see https://github.com/npm/npm-package-arg#result-object
42
- *
43
- * @param {!Result} resolved npm-package-arg Result object
44
- * @returns {Boolean}
45
- */
46
- satisfies({ gitCommittish, gitRange, fetchSpec }) {
47
- return semver_1.default.satisfies(this.version, (gitCommittish || gitRange || fetchSpec));
48
- }
49
- /**
50
- * Returns a string representation of this node (its name)
51
- *
52
- * @returns {String}
53
- */
54
- toString() {
55
- return this.name;
56
- }
57
- }
58
- exports.PackageGraphNode = PackageGraphNode;
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.PackageGraphNode = void 0;
7
+ const semver_1 = __importDefault(require("semver"));
8
+ const prerelease_id_from_version_1 = require("../../utils/prerelease-id-from-version");
9
+ const PKG = Symbol('pkg');
10
+ /**
11
+ * A node in a PackageGraph.
12
+ */
13
+ class PackageGraphNode {
14
+ /**
15
+ * @param {import("@lerna/package").Package} pkg
16
+ */
17
+ constructor(pkg) {
18
+ var _a;
19
+ this.name = (_a = pkg === null || pkg === void 0 ? void 0 : pkg.name) !== null && _a !== void 0 ? _a : '';
20
+ this[PKG] = pkg;
21
+ // omit raw pkg from default util.inspect() output
22
+ Object.defineProperty(this, PKG, { enumerable: false });
23
+ this.externalDependencies = new Map();
24
+ this.localDependencies = new Map();
25
+ this.localDependents = new Map();
26
+ }
27
+ get location() {
28
+ return this[PKG].location;
29
+ }
30
+ get pkg() {
31
+ return this[PKG];
32
+ }
33
+ get prereleaseId() {
34
+ return (0, prerelease_id_from_version_1.prereleaseIdFromVersion)(this.version);
35
+ }
36
+ get version() {
37
+ return this[PKG].version;
38
+ }
39
+ /**
40
+ * Determine if the Node satisfies a resolved semver range.
41
+ * @see https://github.com/npm/npm-package-arg#result-object
42
+ *
43
+ * @param {!Result} resolved npm-package-arg Result object
44
+ * @returns {Boolean}
45
+ */
46
+ satisfies({ gitCommittish, gitRange, fetchSpec }) {
47
+ return semver_1.default.satisfies(this.version, (gitCommittish || gitRange || fetchSpec));
48
+ }
49
+ /**
50
+ * Returns a string representation of this node (its name)
51
+ *
52
+ * @returns {String}
53
+ */
54
+ toString() {
55
+ return this.name;
56
+ }
57
+ }
58
+ exports.PackageGraphNode = PackageGraphNode;
59
59
  //# sourceMappingURL=package-graph-node.js.map
@@ -1 +1 @@
1
- export declare function reportCycles(paths: any, rejectCycles: any): void;
1
+ export declare function reportCycles(paths: any, rejectCycles: any): void;
@@ -1,20 +1,20 @@
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.reportCycles = void 0;
7
- const npmlog_1 = __importDefault(require("npmlog"));
8
- const validation_error_1 = require("../../validation-error");
9
- function reportCycles(paths, rejectCycles) {
10
- if (!paths.length) {
11
- return;
12
- }
13
- const cycleMessage = ['Dependency cycles detected, you should fix these!'].concat(paths).join('\n');
14
- if (rejectCycles) {
15
- throw new validation_error_1.ValidationError('ECYCLE', cycleMessage);
16
- }
17
- npmlog_1.default.warn('ECYCLE', cycleMessage);
18
- }
19
- exports.reportCycles = reportCycles;
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.reportCycles = void 0;
7
+ const npmlog_1 = __importDefault(require("npmlog"));
8
+ const validation_error_1 = require("../../validation-error");
9
+ function reportCycles(paths, rejectCycles) {
10
+ if (!paths.length) {
11
+ return;
12
+ }
13
+ const cycleMessage = ['Dependency cycles detected, you should fix these!'].concat(paths).join('\n');
14
+ if (rejectCycles) {
15
+ throw new validation_error_1.ValidationError('ECYCLE', cycleMessage);
16
+ }
17
+ npmlog_1.default.warn('ECYCLE', cycleMessage);
18
+ }
19
+ exports.reportCycles = reportCycles;
20
20
  //# sourceMappingURL=report-cycles.js.map
@@ -1,79 +1,79 @@
1
- import { CyclicPackageGraphNode, PackageGraphNode } from './lib';
2
- import { Package } from '../package';
3
- /**
4
- * A graph of packages in the current project.
5
- *
6
- * @extends {Map<string, PackageGraphNode>}
7
- */
8
- export declare class PackageGraph extends Map {
9
- /**
10
- * @param {import("@lerna/package").Package[]} packages An array of Packages to build the graph out of.
11
- * @param {'allDependencies'|'dependencies'} [graphType]
12
- * Pass "dependencies" to create a graph of only dependencies,
13
- * excluding the devDependencies that would normally be included.
14
- * @param {boolean|'auto'|'force'|'explicit'} [localDependencies] Treatment of local sibling dependencies, default "auto"
15
- */
16
- constructor(packages: Package[], graphType?: 'allDependencies' | 'dependencies', localDependencies?: boolean | 'auto' | 'force' | 'explicit' | 'forceLocal');
17
- get rawPackageList(): any[];
18
- /**
19
- * Takes a list of Packages and returns a list of those same Packages with any Packages
20
- * they depend on. i.e if packageA depended on packageB `graph.addDependencies([packageA])`
21
- * would return [packageA, packageB].
22
- *
23
- * @param {import("@lerna/package").Package[]} filteredPackages The packages to include dependencies for.
24
- */
25
- addDependencies(filteredPackages: Package[]): Package[];
26
- /**
27
- * Takes a list of Packages and returns a list of those same Packages with any Packages
28
- * that depend on them. i.e if packageC depended on packageD `graph.addDependents([packageD])`
29
- * would return [packageD, packageC].
30
- *
31
- * @param {import("@lerna/package").Package[]} filteredPackages The packages to include dependents for.
32
- */
33
- addDependents(filteredPackages: Package[]): Package[];
34
- /**
35
- * Extends a list of packages by traversing on a given property, which must refer to a
36
- * `PackageGraphNode` property that is a collection of `PackageGraphNode`s.
37
- * Returns input packages with any additional packages found by traversing `nodeProp`.
38
- *
39
- * @param {import("@lerna/package").Package[]} packageList The list of packages to extend
40
- * @param {'localDependencies'|'localDependents'} nodeProp The property on `PackageGraphNode` used to traverse
41
- */
42
- extendList(packageList: Package[], nodeProp: 'localDependencies' | 'localDependents'): Package[];
43
- /**
44
- * Return a tuple of cycle paths and nodes.
45
- *
46
- * @deprecated Use collapseCycles instead.
47
- *
48
- * @param {boolean} rejectCycles Whether or not to reject cycles
49
- * @returns {[Set<string[]>, Set<PackageGraphNode>]}
50
- */
51
- partitionCycles(rejectCycles?: boolean): (Set<PackageGraphNode> | Set<string[]>)[];
52
- /**
53
- * Returns the cycles of this graph. If two cycles share some elements, they will
54
- * be returned as a single cycle.
55
- *
56
- * @param {boolean} rejectCycles Whether or not to reject cycles
57
- * @returns {Set<CyclicPackageGraphNode>}
58
- */
59
- collapseCycles(rejectCycles?: boolean): Set<CyclicPackageGraphNode>;
60
- /**
61
- * Remove cycle nodes.
62
- *
63
- * @deprecated Spread set into prune() instead.
64
- *
65
- * @param {Set<PackageGraphNode>} cycleNodes
66
- */
67
- pruneCycleNodes(cycleNodes: Set<PackageGraphNode>): void;
68
- /**
69
- * Remove all candidate nodes.
70
- * @param {PackageGraphNode[]} candidates
71
- */
72
- prune(...candidates: PackageGraphNode[]): void;
73
- /**
74
- * Delete by value (instead of key), as well as removing pointers
75
- * to itself in the other node's internal collections.
76
- * @param {PackageGraphNode} candidateNode instance to remove
77
- */
78
- remove(candidateNode: PackageGraphNode): void;
79
- }
1
+ import { CyclicPackageGraphNode, PackageGraphNode } from './lib';
2
+ import { Package } from '../package';
3
+ /**
4
+ * A graph of packages in the current project.
5
+ *
6
+ * @extends {Map<string, PackageGraphNode>}
7
+ */
8
+ export declare class PackageGraph extends Map {
9
+ /**
10
+ * @param {import("@lerna/package").Package[]} packages An array of Packages to build the graph out of.
11
+ * @param {'allDependencies'|'dependencies'} [graphType]
12
+ * Pass "dependencies" to create a graph of only dependencies,
13
+ * excluding the devDependencies that would normally be included.
14
+ * @param {boolean|'auto'|'force'|'explicit'} [localDependencies] Treatment of local sibling dependencies, default "auto"
15
+ */
16
+ constructor(packages: Package[], graphType?: 'allDependencies' | 'dependencies', localDependencies?: boolean | 'auto' | 'force' | 'explicit' | 'forceLocal');
17
+ get rawPackageList(): any[];
18
+ /**
19
+ * Takes a list of Packages and returns a list of those same Packages with any Packages
20
+ * they depend on. i.e if packageA depended on packageB `graph.addDependencies([packageA])`
21
+ * would return [packageA, packageB].
22
+ *
23
+ * @param {import("@lerna/package").Package[]} filteredPackages The packages to include dependencies for.
24
+ */
25
+ addDependencies(filteredPackages: Package[]): Package[];
26
+ /**
27
+ * Takes a list of Packages and returns a list of those same Packages with any Packages
28
+ * that depend on them. i.e if packageC depended on packageD `graph.addDependents([packageD])`
29
+ * would return [packageD, packageC].
30
+ *
31
+ * @param {import("@lerna/package").Package[]} filteredPackages The packages to include dependents for.
32
+ */
33
+ addDependents(filteredPackages: Package[]): Package[];
34
+ /**
35
+ * Extends a list of packages by traversing on a given property, which must refer to a
36
+ * `PackageGraphNode` property that is a collection of `PackageGraphNode`s.
37
+ * Returns input packages with any additional packages found by traversing `nodeProp`.
38
+ *
39
+ * @param {import("@lerna/package").Package[]} packageList The list of packages to extend
40
+ * @param {'localDependencies'|'localDependents'} nodeProp The property on `PackageGraphNode` used to traverse
41
+ */
42
+ extendList(packageList: Package[], nodeProp: 'localDependencies' | 'localDependents'): Package[];
43
+ /**
44
+ * Return a tuple of cycle paths and nodes.
45
+ *
46
+ * @deprecated Use collapseCycles instead.
47
+ *
48
+ * @param {boolean} rejectCycles Whether or not to reject cycles
49
+ * @returns {[Set<string[]>, Set<PackageGraphNode>]}
50
+ */
51
+ partitionCycles(rejectCycles?: boolean): (Set<PackageGraphNode> | Set<string[]>)[];
52
+ /**
53
+ * Returns the cycles of this graph. If two cycles share some elements, they will
54
+ * be returned as a single cycle.
55
+ *
56
+ * @param {boolean} rejectCycles Whether or not to reject cycles
57
+ * @returns {Set<CyclicPackageGraphNode>}
58
+ */
59
+ collapseCycles(rejectCycles?: boolean): Set<CyclicPackageGraphNode>;
60
+ /**
61
+ * Remove cycle nodes.
62
+ *
63
+ * @deprecated Spread set into prune() instead.
64
+ *
65
+ * @param {Set<PackageGraphNode>} cycleNodes
66
+ */
67
+ pruneCycleNodes(cycleNodes: Set<PackageGraphNode>): void;
68
+ /**
69
+ * Remove all candidate nodes.
70
+ * @param {PackageGraphNode[]} candidates
71
+ */
72
+ prune(...candidates: PackageGraphNode[]): void;
73
+ /**
74
+ * Delete by value (instead of key), as well as removing pointers
75
+ * to itself in the other node's internal collections.
76
+ * @param {PackageGraphNode} candidateNode instance to remove
77
+ */
78
+ remove(candidateNode: PackageGraphNode): void;
79
+ }