beachball 2.65.2 → 2.65.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/README.md +4 -0
- package/lib/changefile/getAllChangedPackages.d.ts +18 -0
- package/lib/changefile/getAllChangedPackages.d.ts.map +1 -0
- package/lib/changefile/getAllChangedPackages.js +78 -0
- package/lib/changefile/getAllChangedPackages.js.map +1 -0
- package/lib/changefile/getCatalogChangedPackages.d.ts +19 -0
- package/lib/changefile/getCatalogChangedPackages.d.ts.map +1 -0
- package/lib/changefile/getCatalogChangedPackages.js +84 -0
- package/lib/changefile/getCatalogChangedPackages.js.map +1 -0
- package/lib/changefile/getChangedPackages.d.ts +12 -14
- package/lib/changefile/getChangedPackages.d.ts.map +1 -1
- package/lib/changefile/getChangedPackages.js +56 -109
- package/lib/changefile/getChangedPackages.js.map +1 -1
- package/lib/changefile/isPackageIncluded.d.ts +18 -0
- package/lib/changefile/isPackageIncluded.d.ts.map +1 -0
- package/lib/changefile/isPackageIncluded.js +33 -0
- package/lib/changefile/isPackageIncluded.js.map +1 -0
- package/lib/changefile/writeChangeFiles.d.ts.map +1 -1
- package/lib/changefile/writeChangeFiles.js +6 -10
- package/lib/changefile/writeChangeFiles.js.map +1 -1
- package/lib/commands/configGet.js +3 -3
- package/lib/commands/configGet.js.map +1 -1
- package/lib/commands/configList.js +2 -2
- package/lib/commands/configList.js.map +1 -1
- package/lib/commands/publish.d.ts.map +1 -1
- package/lib/commands/publish.js +5 -0
- package/lib/commands/publish.js.map +1 -1
- package/lib/git/ensureSharedHistory.d.ts +8 -2
- package/lib/git/ensureSharedHistory.d.ts.map +1 -1
- package/lib/git/ensureSharedHistory.js +40 -23
- package/lib/git/ensureSharedHistory.js.map +1 -1
- package/lib/git/fetch.d.ts +16 -4
- package/lib/git/fetch.d.ts.map +1 -1
- package/lib/git/fetch.js +21 -9
- package/lib/git/fetch.js.map +1 -1
- package/lib/monorepo/diffCatalogs.d.ts +14 -0
- package/lib/monorepo/diffCatalogs.d.ts.map +1 -0
- package/lib/monorepo/diffCatalogs.js +47 -0
- package/lib/monorepo/diffCatalogs.js.map +1 -0
- package/lib/monorepo/filterIgnoredFiles.d.ts +1 -1
- package/lib/monorepo/filterIgnoredFiles.d.ts.map +1 -1
- package/lib/monorepo/filterIgnoredFiles.js +11 -5
- package/lib/monorepo/filterIgnoredFiles.js.map +1 -1
- package/lib/packageManager/npmAuthEnvPassthrough.d.ts +32 -0
- package/lib/packageManager/npmAuthEnvPassthrough.d.ts.map +1 -0
- package/lib/packageManager/npmAuthEnvPassthrough.js +90 -0
- package/lib/packageManager/npmAuthEnvPassthrough.js.map +1 -0
- package/lib/packageManager/packageManager.d.ts.map +1 -1
- package/lib/packageManager/packageManager.js +2 -19
- package/lib/packageManager/packageManager.js.map +1 -1
- package/lib/types/BeachballOptions.d.ts +1 -0
- package/lib/types/BeachballOptions.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeChangeFiles.js","sourceRoot":"","sources":["../../src/changefile/writeChangeFiles.ts"],"names":[],"mappings":";;;;;;AACA,oCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"writeChangeFiles.js","sourceRoot":"","sources":["../../src/changefile/writeChangeFiles.ts"],"names":[],"mappings":";;;;;;AACA,oCAAyC;AACzC,qDAAgD;AAChD,oDAA4B;AAC5B,4CAAoB;AACpB,gDAAwB;AAExB,mDAAgD;AAEhD;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,OAAyB,EACzB,OAAiF;IAEjF,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC;IACvE,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,OAAO,CAAC,CAAC;IAE1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;QAChC,OAAO,EAAE,CAAC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C;KAClE;IAED,OAAO,CAAC,GAAG,CACT,OAAO,iBAAiB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,wBAAwB,WAAW;SACjF,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;SACrB,IAAI,CAAC,EAAE,CAAC,EAAE,CACd,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC;AA/CD,4CA+CC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configGet = void 0;
|
|
4
|
-
const
|
|
4
|
+
const isPackageIncluded_1 = require("../changefile/isPackageIncluded");
|
|
5
5
|
const getDisallowedChangeTypes_1 = require("../changefile/getDisallowedChangeTypes");
|
|
6
6
|
const formatValue_1 = require("../logging/formatValue");
|
|
7
7
|
const BeachballError_1 = require("../types/BeachballError");
|
|
@@ -96,7 +96,7 @@ function configGet(options, context) {
|
|
|
96
96
|
hasError = true;
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
|
-
const { isIncluded, reason } = (0,
|
|
99
|
+
const { isIncluded, reason } = (0, isPackageIncluded_1.isPackageIncluded)(packageInfos[pkgName], scopedPackages);
|
|
100
100
|
if (!isIncluded) {
|
|
101
101
|
console.error(`Invalid package: ${reason}`);
|
|
102
102
|
hasError = true;
|
|
@@ -149,7 +149,7 @@ function printDefault(name, options, context) {
|
|
|
149
149
|
for (const pkgInfo of Object.values(packageInfos)) {
|
|
150
150
|
const pkgValue = pkgInfo.packageOptions?.[pkgKey];
|
|
151
151
|
// Verify the package is included, but it's not an error here since it wasn't explicitly requested
|
|
152
|
-
if ((0,
|
|
152
|
+
if ((0, isPackageIncluded_1.isPackageIncluded)(pkgInfo, scopedPackages).isIncluded && pkgValue !== undefined) {
|
|
153
153
|
pkgOverrides[pkgInfo.name] = pkgValue;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configGet.js","sourceRoot":"","sources":["../../src/commands/configGet.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"configGet.js","sourceRoot":"","sources":["../../src/commands/configGet.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AACpE,qFAAkF;AAClF,wDAAqD;AACrD,4DAAyD;AAIzD,sEAAsE;AACtE,MAAM,iBAAiB,GAAyB;IAC9C,GAAG,EAAE,IAAI;IACT,aAAa,EAAE,IAAI;IACnB,qBAAqB,EAAE,IAAI;IAC3B,OAAO,EAAE,IAAI;IACb,aAAa,EAAE,IAAI;CACyB,CAAC;AAE/C,gGAAgG;AAChG,MAAM,cAAc,GAAyB;IAC3C,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,IAAI;IACtB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,IAAI;IACnB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;IAChC,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,iBAAiB,EAAE,IAAI;IACvB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,IAAI;IACrB,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,IAAI;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W,EAAC,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACtD;IAED,IAAI,iBAAiB,EAAE;QACrB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,IAAA,yBAAW,EAAC,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACxD;AACH,CAAC;AAED,oFAAoF;AACpF,SAAS,WAAW,CAAC,KAAa,EAAE,UAAoB;IACtD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,yBAAyB;IACzB,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,IAAI,WAAW;QAAE,OAAO,WAAW,CAAC;IACpC,oBAAoB;IACpB,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configList = void 0;
|
|
4
|
-
const
|
|
4
|
+
const isPackageIncluded_1 = require("../changefile/isPackageIncluded");
|
|
5
5
|
const formatValue_1 = require("../logging/formatValue");
|
|
6
6
|
/**
|
|
7
7
|
* Handles the `beachball config list` command.
|
|
@@ -24,7 +24,7 @@ function configList(options, context) {
|
|
|
24
24
|
}
|
|
25
25
|
// Print per-package overrides
|
|
26
26
|
const packagesWithOverrides = Object.values(packageInfos)
|
|
27
|
-
.filter(pkg => Object.keys(pkg.packageOptions || {}).length && (0,
|
|
27
|
+
.filter(pkg => Object.keys(pkg.packageOptions || {}).length && (0, isPackageIncluded_1.isPackageIncluded)(pkg, scopedPackages))
|
|
28
28
|
.map(pkg => [pkg.name, pkg.packageOptions]);
|
|
29
29
|
if (packagesWithOverrides.length) {
|
|
30
30
|
console.log('\nPackage overrides:');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configList.js","sourceRoot":"","sources":["../../src/commands/configList.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"configList.js","sourceRoot":"","sources":["../../src/commands/configList.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AACpE,wDAAqD;AAIrD;;;GAGG;AACH,SAAgB,UAAU,CAAC,OAAyB,EAAE,OAA4B;IAChF,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IACtF,MAAM,aAAa,GAAG,OAA6C,CAAC;IAEpE,qFAAqF;IACrF,yFAAyF;IACzF,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/G,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,IAAA,yBAAW,EAAC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEtD,sFAAsF;IACtF,oDAAoD;IACpD,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,uBAAuB,IAAI,KAAK,CAAC,CAAC;IACnH,IAAI,mBAAmB,CAAC,MAAM,EAAE;QAC9B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,IAAA,yBAAW,EAAC,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACjF;IAED,8BAA8B;IAC9B,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;SACtD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,IAAA,qCAAiB,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SACrG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAU,CAAC,CAAC;IACvD,IAAI,qBAAqB,CAAC,MAAM,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,IAAA,yBAAW,EAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACnF;AACH,CAAC;AA1BD,gCA0BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D;;;GAGG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACjG,sCAAsC;AACtC,wBAAsB,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/lib/commands/publish.js
CHANGED
|
@@ -11,6 +11,7 @@ const createCommandContext_1 = require("../monorepo/createCommandContext");
|
|
|
11
11
|
const bumpAndPush_1 = require("../publish/bumpAndPush");
|
|
12
12
|
const getNewPackages_1 = require("../publish/getNewPackages");
|
|
13
13
|
const publishToRegistry_1 = require("../publish/publishToRegistry");
|
|
14
|
+
const npmAuthEnvPassthrough_1 = require("../packageManager/npmAuthEnvPassthrough");
|
|
14
15
|
async function publish(options, context) {
|
|
15
16
|
console.log('Preparing to publish\n');
|
|
16
17
|
const { path: cwd, branch, registry, tag, packToPath } = options;
|
|
@@ -52,6 +53,10 @@ async function publish(options, context) {
|
|
|
52
53
|
}
|
|
53
54
|
console.log();
|
|
54
55
|
}
|
|
56
|
+
if (options.token) {
|
|
57
|
+
// Verify that passing the npm auth token via env vars works (see function comment...)
|
|
58
|
+
await (0, npmAuthEnvPassthrough_1.checkNpmAuthEnvPassthrough)(options);
|
|
59
|
+
}
|
|
55
60
|
// checkout publish branch
|
|
56
61
|
const publishBranch = `publish_${Date.now()}`;
|
|
57
62
|
console.log(`Creating temporary publish branch ${publishBranch}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,qDAAkF;AAClF,uDAAoD;AACpD,2EAAwE;AACxE,wDAAqD;AACrD,8DAA2D;AAC3D,oEAAiE;
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"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,UAAU,EAAE,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;KACnD;SAAM,IAAI,WAAW,EAAE;QACtB,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,gBAAgB,WAAW,EAAE,CAAC,CAAC;QAC3C,IAAA,6BAAW,EAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;KACjD;IAED,IAAI,aAAa,IAAI,WAAW,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,qCAAqC,aAAa,EAAE,CAAC,CAAC;QAClE,MAAM,cAAc,GAAG,IAAA,qBAAG,EAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACrE,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YAC3B,OAAO,CAAC,IAAI,CAAC,sCAAsC,aAAa,iBAAiB,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;SAC3G;KACF;AACH,CAAC;AAjID,0BAiIC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { BeachballOptions } from '../types/BeachballOptions';
|
|
2
2
|
/**
|
|
3
3
|
* Ensure that adequate history is available to check for changes between HEAD and `options.branch`.
|
|
4
|
-
* Otherwise attempting to get changes will fail with an error "no merge base".
|
|
5
|
-
*
|
|
4
|
+
* Otherwise attempting to get changes will fail with an error "no merge base". (This is mostly an
|
|
5
|
+
* issue with CI builds that use shallow clones and may not have a tracking branch configured for
|
|
6
|
+
* the remote target branch.)
|
|
7
|
+
*
|
|
8
|
+
* Since repo may be very large, it's important to avoid fetching the entire history or extra refs.
|
|
9
|
+
* If the repo is shallow and no common commit is found after a normal fetch, this function will
|
|
10
|
+
* iteratively deepen the history (100 commits at a time by default) and check for a common commit
|
|
11
|
+
* each round. If still not found, it will unshallow the clone.
|
|
6
12
|
*
|
|
7
13
|
* Throws an error if history is inadequate and cannot be fixed.
|
|
8
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureSharedHistory.d.ts","sourceRoot":"","sources":["../../src/git/ensureSharedHistory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ensureSharedHistory.d.ts","sourceRoot":"","sources":["../../src/git/ensureSharedHistory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKlE;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC,GACjF,IAAI,CAuEN"}
|
|
@@ -4,10 +4,17 @@ exports.ensureSharedHistory = void 0;
|
|
|
4
4
|
const workspace_tools_1 = require("workspace-tools");
|
|
5
5
|
const fetch_1 = require("./fetch");
|
|
6
6
|
const bulletedList_1 = require("../logging/bulletedList");
|
|
7
|
+
const BeachballError_1 = require("../types/BeachballError");
|
|
7
8
|
/**
|
|
8
9
|
* Ensure that adequate history is available to check for changes between HEAD and `options.branch`.
|
|
9
|
-
* Otherwise attempting to get changes will fail with an error "no merge base".
|
|
10
|
-
*
|
|
10
|
+
* Otherwise attempting to get changes will fail with an error "no merge base". (This is mostly an
|
|
11
|
+
* issue with CI builds that use shallow clones and may not have a tracking branch configured for
|
|
12
|
+
* the remote target branch.)
|
|
13
|
+
*
|
|
14
|
+
* Since repo may be very large, it's important to avoid fetching the entire history or extra refs.
|
|
15
|
+
* If the repo is shallow and no common commit is found after a normal fetch, this function will
|
|
16
|
+
* iteratively deepen the history (100 commits at a time by default) and check for a common commit
|
|
17
|
+
* each round. If still not found, it will unshallow the clone.
|
|
11
18
|
*
|
|
12
19
|
* Throws an error if history is inadequate and cannot be fixed.
|
|
13
20
|
*/
|
|
@@ -24,24 +31,16 @@ function ensureSharedHistory(options) {
|
|
|
24
31
|
// This is most likely to be an issue in a CI build which does a shallow checkout (github
|
|
25
32
|
// actions/checkout does this by default) and also disables beachball fetching.
|
|
26
33
|
logError('missing-branch', branch, remote, remoteBranch);
|
|
27
|
-
throw new
|
|
34
|
+
throw new BeachballError_1.BeachballError(`Target branch "${branch}" does not exist locally, and fetching is disabled`, {
|
|
35
|
+
alreadyLogged: true,
|
|
36
|
+
});
|
|
28
37
|
}
|
|
29
38
|
if (!remote) {
|
|
30
|
-
// If the remote isn't specified, even if fetching is allowed it will be unclear what to
|
|
31
|
-
// compare against
|
|
32
|
-
throw new
|
|
39
|
+
// If the remote isn't specified, even if fetching is allowed, it will be unclear what to
|
|
40
|
+
// compare against, so throw an error.
|
|
41
|
+
throw new BeachballError_1.BeachballError(`Target branch "${branch}" doesn't exist locally, and a remote name wasn't specified and couldn't be inferred. ` +
|
|
33
42
|
'Please set "repository" in your root package.json or include a remote in the beachball "branch" setting.');
|
|
34
43
|
}
|
|
35
|
-
// If fetching the requested branch isn't already (probably) configured, add it to the list so
|
|
36
|
-
// it can be fetched in the next step. Otherwise the ref <remote>/<remoteBranch> won't exist locally.
|
|
37
|
-
const fetchConfig = (0, workspace_tools_1.git)(['config', '--get-all', `remote.${remote}.fetch`], { cwd }).stdout.trim();
|
|
38
|
-
if (!fetchConfig.includes(`${remote}/*`) && !fetchConfig.includes(branch)) {
|
|
39
|
-
console.log(`Adding branch "${remoteBranch}" to fetch config for remote "${remote}"`);
|
|
40
|
-
const result = (0, workspace_tools_1.git)(['remote', 'set-branches', '--add', remote, remoteBranch], { cwd });
|
|
41
|
-
if (!result.success) {
|
|
42
|
-
throw new Error(`Failed to add branch "${remoteBranch}" to fetch config for remote "${remote}":\n${result.stderr}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
44
|
}
|
|
46
45
|
if (fetch) {
|
|
47
46
|
// Fetch the latest from the remote branch for comparison. If the specified remoteBranch doesn't
|
|
@@ -56,7 +55,7 @@ function ensureSharedHistory(options) {
|
|
|
56
55
|
depth: depth && isShallowRepository(cwd) ? depth : undefined,
|
|
57
56
|
});
|
|
58
57
|
if (!result.success) {
|
|
59
|
-
throw new
|
|
58
|
+
throw new BeachballError_1.BeachballError(`Failed to fetch branch "${remoteBranch}" from remote "${remote}": ${result.errorMessage || ''}`);
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
// Verify that HEAD and the target branch share history
|
|
@@ -67,13 +66,18 @@ function ensureSharedHistory(options) {
|
|
|
67
66
|
if (!fetch) {
|
|
68
67
|
// Fetching is disabled, so the lack of history can't be fixed
|
|
69
68
|
logError('shallow-clone', branch, remote, remoteBranch);
|
|
70
|
-
throw new
|
|
69
|
+
throw new BeachballError_1.BeachballError(`Inadequate history available to connect HEAD to target branch "${branch}"`, {
|
|
70
|
+
alreadyLogged: true,
|
|
71
|
+
});
|
|
71
72
|
}
|
|
72
73
|
// Try fetching more history
|
|
73
74
|
isConnected = deepenHistory({ remote, remoteBranch, branch, depth, cwd, verbose });
|
|
74
75
|
}
|
|
76
|
+
else {
|
|
77
|
+
// Repo isn't shallow, so potentially we just need to add a ref to be connected
|
|
78
|
+
}
|
|
75
79
|
if (!isConnected) {
|
|
76
|
-
throw new
|
|
80
|
+
throw new BeachballError_1.BeachballError(`HEAD does not appear to share history with target branch "${branch}"`);
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
}
|
|
@@ -87,13 +91,20 @@ function deepenHistory(params) {
|
|
|
87
91
|
const { remote, remoteBranch, branch, cwd, verbose } = params;
|
|
88
92
|
const depth = params.depth || 100;
|
|
89
93
|
console.log(`This is a shallow clone. Deepening to check for changes...`);
|
|
94
|
+
// git fetch --deepen only deepens the histories of the refs explicitly listed in the
|
|
95
|
+
// refspec args, not other local refs. To find the common ancestor, both the target branch
|
|
96
|
+
// and HEAD (when on a different branch) need enough history to reach it. We pass both
|
|
97
|
+
// refspecs to a single git invocation so one --deepen / --unshallow covers both refs in one
|
|
98
|
+
// network round-trip.
|
|
99
|
+
const headBranch = getHeadBranch(cwd);
|
|
100
|
+
const branchesToFetch = headBranch && headBranch !== remoteBranch ? [remoteBranch, headBranch] : [remoteBranch];
|
|
90
101
|
// Iteratively deepen the history
|
|
91
102
|
const maxAttempts = 3;
|
|
92
103
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
93
104
|
console.log(`Deepening by ${depth} more commits (attempt ${attempt}/${maxAttempts})...`);
|
|
94
|
-
const result = (0, fetch_1.gitFetch)({ remote, branch:
|
|
105
|
+
const result = (0, fetch_1.gitFetch)({ remote, branch: branchesToFetch, deepen: depth, cwd, verbose });
|
|
95
106
|
if (!result.success) {
|
|
96
|
-
throw new
|
|
107
|
+
throw new BeachballError_1.BeachballError(`Failed to fetch more history (see above for details)`);
|
|
97
108
|
}
|
|
98
109
|
if (hasCommonCommit(branch, cwd)) {
|
|
99
110
|
// Fetched enough history to find a common commit
|
|
@@ -106,9 +117,9 @@ function deepenHistory(params) {
|
|
|
106
117
|
}
|
|
107
118
|
// No common commit was found and the repo is still shallow, so fully unshallow it
|
|
108
119
|
console.log(`Still didn't find a common commit after deepening by ${depth * maxAttempts}. Unshallowing...`);
|
|
109
|
-
const result = (0, fetch_1.gitFetch)({ remote, branch:
|
|
120
|
+
const result = (0, fetch_1.gitFetch)({ remote, branch: branchesToFetch, unshallow: true, cwd, verbose });
|
|
110
121
|
if (!result.success) {
|
|
111
|
-
throw new
|
|
122
|
+
throw new BeachballError_1.BeachballError(`Failed to unshallow repo (see above for details)`);
|
|
112
123
|
}
|
|
113
124
|
return hasCommonCommit(branch, cwd);
|
|
114
125
|
}
|
|
@@ -146,6 +157,12 @@ ${(0, bulletedList_1.bulletedList)(mitigationSteps)}
|
|
|
146
157
|
function hasBranchRef(branch, cwd) {
|
|
147
158
|
return (0, workspace_tools_1.git)(['rev-parse', '--verify', branch], { cwd }).success;
|
|
148
159
|
}
|
|
160
|
+
/** Returns the current branch name, or undefined if in detached HEAD state */
|
|
161
|
+
function getHeadBranch(cwd) {
|
|
162
|
+
const result = (0, workspace_tools_1.git)(['rev-parse', '--abbrev-ref', 'HEAD'], { cwd });
|
|
163
|
+
const branch = result.stdout.trim();
|
|
164
|
+
return result.success && branch !== 'HEAD' ? branch : undefined;
|
|
165
|
+
}
|
|
149
166
|
function isShallowRepository(cwd) {
|
|
150
167
|
return (0, workspace_tools_1.git)(['rev-parse', '--is-shallow-repository'], { cwd }).stdout.trim() === 'true';
|
|
151
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureSharedHistory.js","sourceRoot":"","sources":["../../src/git/ensureSharedHistory.ts"],"names":[],"mappings":";;;AAAA,qDAAyD;AAEzD,mCAAmC;AACnC,0DAAwE;
|
|
1
|
+
{"version":3,"file":"ensureSharedHistory.js","sourceRoot":"","sources":["../../src/git/ensureSharedHistory.ts"],"names":[],"mappings":";;;AAAA,qDAAyD;AAEzD,mCAAmC;AACnC,0DAAwE;AACxE,4DAAyD;AAEzD;;;;;;;;;;;;GAYG;AACH,SAAgB,mBAAmB,CACjC,OAAkF;IAElF,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC7D,yFAAyF;IACzF,sFAAsF;IACtF,8DAA8D;IAC9D,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,mCAAiB,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAEpE,0CAA0C;IAC1C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;QAC9B,IAAI,CAAC,KAAK,EAAE;YACV,uFAAuF;YACvF,yFAAyF;YACzF,+EAA+E;YAC/E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YACzD,MAAM,IAAI,+BAAc,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ACH,CAAC;AAED,SAAS,YAAY,CAAC,MAAc,EAAE,GAAW;IAC/C,OAAO,IAAA,qBAAG,EAAC,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC;AACjE,CAAC;AAED,8EAA8E;AAC9E,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,MAAM,GAAG,IAAA,qBAAG,EAAC,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACpC,OAAO,MAAM,CAAC,OAAO,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAW;IACtC,OAAO,IAAA,qBAAG,EAAC,CAAC,WAAW,EAAE,yBAAyB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;AACzF,CAAC;AAED,uFAAuF;AACvF,SAAS,eAAe,CAAC,MAAc,EAAE,GAAW;IAClD,OAAO,IAAA,qBAAG,EAAC,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC;AAC9D,CAAC"}
|
package/lib/git/fetch.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { type GitProcessOutput } from 'workspace-tools';
|
|
2
2
|
type GitFetchParams = {
|
|
3
3
|
cwd: string;
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Remote to fetch from. This should almost always be set but might be an empty string
|
|
6
|
+
* if the repo somehow has no remotes configured.
|
|
7
|
+
*/
|
|
8
|
+
remote: string;
|
|
9
|
+
/**
|
|
10
|
+
* Branch(es) to fetch. Each will be converted to a full refspec for fetching:
|
|
11
|
+
* e.g. `branch: 'main', remote: 'origin'` will be converted to `+refs/heads/main:refs/remotes/origin/main`.
|
|
12
|
+
* Pass an array to fetch multiple branches in a single git invocation, which lets a single
|
|
13
|
+
* `--deepen` or `--unshallow` apply to all of them (saves network round-trips when both HEAD
|
|
14
|
+
* and the target branch need deepening).
|
|
15
|
+
*/
|
|
16
|
+
branch: string | string[];
|
|
8
17
|
/** Set depth to this number of commits (mutually exclusive with `deepen` and `unshallow`) */
|
|
9
18
|
depth?: number;
|
|
10
19
|
/** Deepen a shallow clone by this number of commits (mutually exclusive with `depth` and `unshallow`) */
|
|
@@ -17,6 +26,9 @@ type GitFetchParams = {
|
|
|
17
26
|
* Wrapper for `git fetch`. If `verbose` is true, log the command before starting, and display output
|
|
18
27
|
* on stdout (except in tests). In tests with `verbose`, the output will be logged all together to
|
|
19
28
|
* `console.log` when the command finishes (for easier mocking/capturing).
|
|
29
|
+
*
|
|
30
|
+
* This converts `remote` and `branch` into a fully qualified refspec, so it doesn't matter if
|
|
31
|
+
* the remote branch is tracked or not in the local repository.
|
|
20
32
|
*/
|
|
21
33
|
export declare function gitFetch(params: GitFetchParams): GitProcessOutput & {
|
|
22
34
|
errorMessage?: string;
|
package/lib/git/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/git/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/git/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yGAAyG;IACzG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uGAAuG;IACvG,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAiE7F"}
|
package/lib/git/fetch.js
CHANGED
|
@@ -7,26 +7,38 @@ const gitAsync_1 = require("./gitAsync");
|
|
|
7
7
|
* Wrapper for `git fetch`. If `verbose` is true, log the command before starting, and display output
|
|
8
8
|
* on stdout (except in tests). In tests with `verbose`, the output will be logged all together to
|
|
9
9
|
* `console.log` when the command finishes (for easier mocking/capturing).
|
|
10
|
+
*
|
|
11
|
+
* This converts `remote` and `branch` into a fully qualified refspec, so it doesn't matter if
|
|
12
|
+
* the remote branch is tracked or not in the local repository.
|
|
10
13
|
*/
|
|
11
14
|
function gitFetch(params) {
|
|
12
|
-
const { remote,
|
|
15
|
+
const { remote, depth, deepen, unshallow, cwd, verbose } = params;
|
|
16
|
+
const branches = Array.isArray(params.branch) ? params.branch : [params.branch];
|
|
13
17
|
const { shouldLog } = (0, gitAsync_1.getGitEnv)(verbose);
|
|
14
18
|
if ([depth, deepen, unshallow].filter(v => v !== undefined).length > 1) {
|
|
15
19
|
throw new Error('"depth", "deepen", and "unshallow" are mutually exclusive');
|
|
16
20
|
}
|
|
17
21
|
const extraArgs = depth ? [`--depth=${depth}`] : deepen ? [`--deepen=${deepen}`] : unshallow ? ['--unshallow'] : [];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Be specific with each ref being fetched, so we don't have to worry about tracking configs.
|
|
23
|
+
// In git fetch <remote> +<src>:<dst>...
|
|
24
|
+
// - The + means allow non-fast-forward updates (in case the remote was force pushed).
|
|
25
|
+
// - <src> refs/heads/${branch} is resolved against the remote's advertised refs. The fully
|
|
26
|
+
// qualified ref is unambiguous, whereas bare branch names can be silently misresolved,
|
|
27
|
+
// causing git to treat the ref as absent and delete the local tracking ref.
|
|
28
|
+
// - <dst> refs/remotes/${remote}/${branch} is resolved locally and only moves the tracking ref
|
|
29
|
+
// for the remote branch, not the local refs/heads/${branch} or its tracking config.
|
|
30
|
+
const resolvedRefspecs = remote ? branches.map(b => `+refs/heads/${b}:refs/remotes/${remote}/${b}`) : [];
|
|
31
|
+
const branchLabel = branches.length > 1 ? `branches ${branches.map(b => `"${b}"`).join(', ')}` : `branch "${branches[0]}"`;
|
|
32
|
+
const shortDescription = `Fetching ${resolvedRefspecs.length ? `${branchLabel} from remote "${remote}"` : 'all remotes'}`;
|
|
33
|
+
let description = shortDescription;
|
|
34
|
+
resolvedRefspecs.length && (description += ` (${resolvedRefspecs.join(' ')})`);
|
|
35
|
+
extraArgs.length && (description += ` (with ${extraArgs.join(' ')})`);
|
|
24
36
|
shouldLog && console.log(description + '...');
|
|
25
37
|
const result = (0, workspace_tools_1.git)([
|
|
26
38
|
'fetch',
|
|
27
39
|
...extraArgs,
|
|
28
40
|
// If the remote is unknown, don't specify the branch (fetching a branch without a remote is invalid)
|
|
29
|
-
...(
|
|
41
|
+
...(resolvedRefspecs.length ? [remote, ...resolvedRefspecs] : []),
|
|
30
42
|
], { cwd, stdio: shouldLog === 'live' ? 'inherit' : 'pipe' });
|
|
31
43
|
const log = result.success ? console.log : console.warn;
|
|
32
44
|
// do the jest logging all at once in a way that can be captured by mocks (jest can't mock process.stdout/err)
|
|
@@ -34,7 +46,7 @@ function gitFetch(params) {
|
|
|
34
46
|
result.stdout && console.log(result.stdout);
|
|
35
47
|
result.stderr && log(result.stderr);
|
|
36
48
|
}
|
|
37
|
-
let message = `${
|
|
49
|
+
let message = `${shortDescription} ${result.success ? 'completed successfully' : `failed (code ${result.status})`}`;
|
|
38
50
|
if (shouldLog) {
|
|
39
51
|
log(message);
|
|
40
52
|
message += ' - see above for details';
|
package/lib/git/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/git/fetch.ts"],"names":[],"mappings":";;;AAAA,qDAA6D;AAC7D,yCAAuC;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/git/fetch.ts"],"names":[],"mappings":";;;AAAA,qDAA6D;AAC7D,yCAAuC;AA0BvC;;;;;;;GAOG;AACH,SAAgB,QAAQ,CAAC,MAAsB;IAC7C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAClE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,oBAAS,EAAC,OAAO,CAAC,CAAC;IAEzC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACtE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;KAC9E;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,MAAM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C;AAjED,4BAiEC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Catalogs } from 'workspace-tools';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a `Catalogs` containing only the entries that were added or changed in `after`
|
|
4
|
+
* relative to `before`. Removed entries (and removed named catalogs) are excluded.
|
|
5
|
+
* Returns `undefined` if nothing was added or changed.
|
|
6
|
+
*
|
|
7
|
+
* (It's possible that newly-added catalog entries didn't actually change from their
|
|
8
|
+
* prior versions, but it's better to be conservative and include them.)
|
|
9
|
+
*/
|
|
10
|
+
export declare function diffCatalogs(options: {
|
|
11
|
+
before: Catalogs;
|
|
12
|
+
after: Catalogs;
|
|
13
|
+
}): Catalogs | undefined;
|
|
14
|
+
//# sourceMappingURL=diffCatalogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diffCatalogs.d.ts","sourceRoot":"","sources":["../../src/monorepo/diffCatalogs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,QAAQ,EAAiB,MAAM,iBAAiB,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GAAG,QAAQ,GAAG,SAAS,CA0BjG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diffCatalogs = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a `Catalogs` containing only the entries that were added or changed in `after`
|
|
6
|
+
* relative to `before`. Removed entries (and removed named catalogs) are excluded.
|
|
7
|
+
* Returns `undefined` if nothing was added or changed.
|
|
8
|
+
*
|
|
9
|
+
* (It's possible that newly-added catalog entries didn't actually change from their
|
|
10
|
+
* prior versions, but it's better to be conservative and include them.)
|
|
11
|
+
*/
|
|
12
|
+
function diffCatalogs(options) {
|
|
13
|
+
const { before, after } = options;
|
|
14
|
+
let result;
|
|
15
|
+
if (after.default) {
|
|
16
|
+
const defaultDiff = diffCatalog(before.default, after.default);
|
|
17
|
+
if (defaultDiff) {
|
|
18
|
+
result = { default: defaultDiff };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (after.named) {
|
|
22
|
+
const namedDiff = {};
|
|
23
|
+
for (const [catalogName, catalog] of Object.entries(after.named)) {
|
|
24
|
+
const catalogDiff = diffCatalog(before.named?.[catalogName], catalog);
|
|
25
|
+
if (catalogDiff) {
|
|
26
|
+
namedDiff[catalogName] = catalogDiff;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (Object.keys(namedDiff).length) {
|
|
30
|
+
result = { ...result, named: namedDiff };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
exports.diffCatalogs = diffCatalogs;
|
|
36
|
+
function diffCatalog(before, after) {
|
|
37
|
+
const diff = {};
|
|
38
|
+
let hasDiff = false;
|
|
39
|
+
for (const [name, version] of Object.entries(after)) {
|
|
40
|
+
if (before?.[name] !== version) {
|
|
41
|
+
diff[name] = version;
|
|
42
|
+
hasDiff = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return hasDiff ? diff : undefined;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=diffCatalogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diffCatalogs.js","sourceRoot":"","sources":["../../src/monorepo/diffCatalogs.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,OAA8C;IACzE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAClC,IAAI,MAA4B,CAAC;IAEjC,IAAI,KAAK,CAAC,OAAO,EAAE;QACjB,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/D,IAAI,WAAW,EAAE;YACf,MAAM,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;SACnC;KACF;IAED,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,MAAM,SAAS,GAAkB,EAAE,CAAC;QACpC,KAAK,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAChE,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;YACtE,IAAI,WAAW,EAAE;gBACf,SAAS,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;aACtC;SACF;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE;YACjC,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;SAC1C;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA1BD,oCA0BC;AAED,SAAS,WAAW,CAAC,MAA2B,EAAE,KAAc;IAC9D,MAAM,IAAI,GAAY,EAAE,CAAC;IACzB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACnD,IAAI,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;YACrB,OAAO,GAAG,IAAI,CAAC;SAChB;KACF;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACpC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { BeachballOptions } from '../types/BeachballOptions';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function filterIgnoredFiles(params: Pick<BeachballOptions, 'ignorePatterns'> & {
|
|
6
6
|
/** Relative file paths */
|
|
7
|
-
filePaths: string[]
|
|
7
|
+
filePaths: string[] | Set<string>;
|
|
8
8
|
/** If specified, called for each ignored file */
|
|
9
9
|
logIgnored?: (filePath: string, reason: string) => void;
|
|
10
10
|
}): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterIgnoredFiles.d.ts","sourceRoot":"","sources":["../../src/monorepo/filterIgnoredFiles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG;IACjD,0BAA0B;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"filterIgnoredFiles.d.ts","sourceRoot":"","sources":["../../src/monorepo/filterIgnoredFiles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG;IACjD,0BAA0B;IAC1B,SAAS,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,iDAAiD;IACjD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD,GACA,MAAM,EAAE,CAgBV"}
|
|
@@ -12,13 +12,19 @@ const minimatchOptions = { matchBase: true };
|
|
|
12
12
|
function filterIgnoredFiles(params) {
|
|
13
13
|
const { filePaths, ignorePatterns, logIgnored } = params;
|
|
14
14
|
if (!ignorePatterns?.length) {
|
|
15
|
-
return filePaths;
|
|
15
|
+
return Array.isArray(filePaths) ? filePaths : [...filePaths];
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const filtered = [];
|
|
18
|
+
for (const filePath of filePaths) {
|
|
18
19
|
const ignorePattern = ignorePatterns.find(pattern => (0, minimatch_1.default)(filePath, pattern, minimatchOptions));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if (ignorePattern) {
|
|
21
|
+
logIgnored?.(filePath, `ignored by pattern "${ignorePattern}"`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
filtered.push(filePath);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return filtered;
|
|
22
28
|
}
|
|
23
29
|
exports.filterIgnoredFiles = filterIgnoredFiles;
|
|
24
30
|
//# sourceMappingURL=filterIgnoredFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterIgnoredFiles.js","sourceRoot":"","sources":["../../src/monorepo/filterIgnoredFiles.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAGlC,MAAM,gBAAgB,GAAuB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAEjE;;GAEG;AACH,SAAgB,kBAAkB,CAChC,MAKC;IAED,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACzD,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE;QAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"filterIgnoredFiles.js","sourceRoot":"","sources":["../../src/monorepo/filterIgnoredFiles.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAGlC,MAAM,gBAAgB,GAAuB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAEjE;;GAEG;AACH,SAAgB,kBAAkB,CAChC,MAKC;IAED,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACzD,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;KAC9D;IAED,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAA,mBAAS,EAAC,QAAQ,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;QACrG,IAAI,aAAa,EAAE;YACjB,UAAU,EAAE,CAAC,QAAQ,EAAE,uBAAuB,aAAa,GAAG,CAAC,CAAC;SACjE;aAAM;YACL,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACzB;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAvBD,gDAuBC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BeachballOptions } from '../types/BeachballOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Filter PATH for running npm commands, removing entries that contain shell-script node wrappers.
|
|
4
|
+
*
|
|
5
|
+
* Package managers inject temp directories into PATH with shims for `node` — yarn classic uses
|
|
6
|
+
* `yarn--*` dirs, yarn berry uses `xfs-*` dirs. (Context: https://github.com/yarnpkg/yarn/issues/6685 -
|
|
7
|
+
* yarn berry does similar but cleans up afterwards.)
|
|
8
|
+
*
|
|
9
|
+
* These shims are POSIX shell scripts, e.g. this `node` shim:
|
|
10
|
+
* ```sh
|
|
11
|
+
* #!/bin/sh
|
|
12
|
+
* exec "/path/to/node" "$@"
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Problem is POSIX `sh` drops env var names with invalid characters like `/` and `:`, which are
|
|
16
|
+
* needed for npm auth token env vars (e.g. `npm_config_//someRegistry/:_authToken`).
|
|
17
|
+
*
|
|
18
|
+
* Removing those path entries fixes the issue and is unlikely to cause other problems in this context.
|
|
19
|
+
* Use `checkNpmAuthEnvPassthrough` after this filter to detect unknown variants of this issue.
|
|
20
|
+
*/
|
|
21
|
+
export declare function filterPathForNpm(pathEnv: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Check whether env vars with special characters in their names (like npm auth token env vars,
|
|
24
|
+
* which contain `//` and `:`) will be passed through to npm subprocesses. Runs a test using the same
|
|
25
|
+
* PATH filtering applied to actual npm commands, so a failure here means the fix in
|
|
26
|
+
* `filterPathForNpm` doesn't cover this platform/environment variant.
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkNpmAuthEnvPassthrough(options: Pick<BeachballOptions, 'registry' | 'path'> & {
|
|
29
|
+
/** PATH override only for testing */
|
|
30
|
+
pathEnv?: string;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=npmAuthEnvPassthrough.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npmAuthEnvPassthrough.d.ts","sourceRoot":"","sources":["../../src/packageManager/npmAuthEnvPassthrough.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKlE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQxD;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IACrD,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,IAAI,CAAC,CA+Cf"}
|