beachball 3.0.0-alpha.2 → 3.0.0-alpha.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/lib/bump/bumpInMemory.d.ts.map +1 -1
- package/lib/bump/bumpInMemory.js +5 -0
- package/lib/bump/bumpInMemory.js.map +1 -1
- package/lib/bump/calculatePackageTags.d.ts +18 -0
- package/lib/bump/calculatePackageTags.d.ts.map +1 -0
- package/lib/bump/calculatePackageTags.js +47 -0
- package/lib/bump/calculatePackageTags.js.map +1 -0
- package/lib/changefile/getQuestionsForPackage.js +1 -0
- package/lib/changefile/getQuestionsForPackage.js.map +1 -1
- package/lib/changefile/isPackageIncluded.d.ts.map +1 -1
- package/lib/changefile/isPackageIncluded.js +3 -6
- package/lib/changefile/isPackageIncluded.js.map +1 -1
- package/lib/changefile/promptForChange.js +1 -1
- package/lib/changefile/promptForChange.js.map +1 -1
- package/lib/changelog/getPackageChangelogs.d.ts +1 -1
- package/lib/changelog/getPackageChangelogs.d.ts.map +1 -1
- package/lib/changelog/getPackageChangelogs.js +7 -10
- package/lib/changelog/getPackageChangelogs.js.map +1 -1
- package/lib/changelog/mergeChangelogs.d.ts +3 -2
- package/lib/changelog/mergeChangelogs.d.ts.map +1 -1
- package/lib/changelog/mergeChangelogs.js +4 -4
- package/lib/changelog/mergeChangelogs.js.map +1 -1
- package/lib/changelog/writeChangelog.d.ts +1 -1
- package/lib/changelog/writeChangelog.d.ts.map +1 -1
- package/lib/changelog/writeChangelog.js +2 -2
- package/lib/changelog/writeChangelog.js.map +1 -1
- package/lib/cli.js +1 -1
- package/lib/cli.js.map +1 -1
- package/lib/commands/configGet.js +1 -1
- package/lib/commands/configGet.js.map +1 -1
- package/lib/commands/migrate.d.ts +2 -2
- package/lib/commands/migrate.d.ts.map +1 -1
- package/lib/commands/migrate.js +68 -8
- package/lib/commands/migrate.js.map +1 -1
- package/lib/commands/publish.d.ts.map +1 -1
- package/lib/commands/publish.js +0 -12
- package/lib/commands/publish.js.map +1 -1
- package/lib/git/ensureSharedHistory.d.ts.map +1 -1
- package/lib/git/ensureSharedHistory.js +3 -11
- package/lib/git/ensureSharedHistory.js.map +1 -1
- package/lib/git/fetch.d.ts +3 -3
- package/lib/git/fetch.d.ts.map +1 -1
- package/lib/git/fetch.js +6 -8
- package/lib/git/fetch.js.map +1 -1
- package/lib/git/getRemoteBranch.d.ts +19 -0
- package/lib/git/getRemoteBranch.d.ts.map +1 -0
- package/lib/git/getRemoteBranch.js +40 -0
- package/lib/git/getRemoteBranch.js.map +1 -0
- package/lib/git/tempGetDefaultRemoteBranch.d.ts +39 -0
- package/lib/git/tempGetDefaultRemoteBranch.d.ts.map +1 -0
- package/lib/git/tempGetDefaultRemoteBranch.js +72 -0
- package/lib/git/tempGetDefaultRemoteBranch.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/monorepo/getPackageInfos.d.ts +9 -0
- package/lib/monorepo/getPackageInfos.d.ts.map +1 -1
- package/lib/monorepo/getPackageInfos.js +17 -9
- package/lib/monorepo/getPackageInfos.js.map +1 -1
- package/lib/options/getCliOptions.d.ts +6 -1
- package/lib/options/getCliOptions.d.ts.map +1 -1
- package/lib/options/getCliOptions.js +20 -11
- package/lib/options/getCliOptions.js.map +1 -1
- package/lib/options/getDefaultOptions.d.ts.map +1 -1
- package/lib/options/getDefaultOptions.js +1 -2
- package/lib/options/getDefaultOptions.js.map +1 -1
- package/lib/options/getOptions.d.ts.map +1 -1
- package/lib/options/getOptions.js +1 -0
- package/lib/options/getOptions.js.map +1 -1
- package/lib/options/getRepoOptions.d.ts +1 -1
- package/lib/options/getRepoOptions.d.ts.map +1 -1
- package/lib/options/getRepoOptions.js +9 -21
- package/lib/options/getRepoOptions.js.map +1 -1
- package/lib/publish/bumpAndPush.d.ts.map +1 -1
- package/lib/publish/bumpAndPush.js +3 -2
- package/lib/publish/bumpAndPush.js.map +1 -1
- package/lib/publish/getPackageGraphLayers.d.ts +2 -3
- package/lib/publish/getPackageGraphLayers.d.ts.map +1 -1
- package/lib/publish/getPackageGraphLayers.js +0 -2
- package/lib/publish/getPackageGraphLayers.js.map +1 -1
- package/lib/publish/getPackagesToPublish.d.ts +6 -4
- package/lib/publish/getPackagesToPublish.d.ts.map +1 -1
- package/lib/publish/getPackagesToPublish.js +8 -6
- package/lib/publish/getPackagesToPublish.js.map +1 -1
- package/lib/publish/publishToRegistry.d.ts +2 -2
- package/lib/publish/publishToRegistry.d.ts.map +1 -1
- package/lib/publish/publishToRegistry.js +2 -1
- package/lib/publish/publishToRegistry.js.map +1 -1
- package/lib/publish/tagPackages.d.ts +6 -4
- package/lib/publish/tagPackages.d.ts.map +1 -1
- package/lib/publish/tagPackages.js +11 -15
- package/lib/publish/tagPackages.js.map +1 -1
- package/lib/publish/validatePackageDependencies.d.ts +3 -1
- package/lib/publish/validatePackageDependencies.d.ts.map +1 -1
- package/lib/publish/validatePackageDependencies.js +15 -5
- package/lib/publish/validatePackageDependencies.js.map +1 -1
- package/lib/types/BeachballOptions.d.ts +24 -19
- package/lib/types/BeachballOptions.d.ts.map +1 -1
- package/lib/types/BumpInfo.d.ts +16 -11
- package/lib/types/BumpInfo.d.ts.map +1 -1
- package/lib/types/ChangeLog.d.ts +10 -3
- package/lib/types/ChangeLog.d.ts.map +1 -1
- package/package.json +5 -5
- package/lib/git/generateTag.d.ts +0 -3
- package/lib/git/generateTag.d.ts.map +0 -1
- package/lib/git/generateTag.js +0 -8
- package/lib/git/generateTag.js.map +0 -1
- package/lib/publish/getNewPackages.d.ts +0 -9
- package/lib/publish/getNewPackages.d.ts.map +0 -1
- package/lib/publish/getNewPackages.js +0 -21
- package/lib/publish/getNewPackages.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/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MAAM,CAAC;IAClE,IAAI,WAAW,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAChD,mDAAmD;QACnD,OAAO;IACT,CAAC;IAED,MAAM,iBAAiB,GAAG;QACxB,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,gBAAgB,CAAC,CAAC;QAC7F,GAAG,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAC7C,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAClE,IAAI,EAAE,CAAC;KACT,CAAC;IACF,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,YAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7E,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC;QAC1B,OAAO,CAAC,IAAI,CACV,uFAAuF;YACrF,oEAAoE,EACtE;YACE,6FAA6F;YAC7F,0DAA0D;YAC1D,cAAc,CAAC,IAAI,EAAE;SACtB,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAMA,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
|
@@ -9,7 +9,6 @@ const workspace_tools_1 = require("workspace-tools");
|
|
|
9
9
|
const bumpInMemory_1 = require("../bump/bumpInMemory");
|
|
10
10
|
const createCommandContext_1 = require("../monorepo/createCommandContext");
|
|
11
11
|
const bumpAndPush_1 = require("../publish/bumpAndPush");
|
|
12
|
-
const getNewPackages_1 = require("../publish/getNewPackages");
|
|
13
12
|
const publishToRegistry_1 = require("../publish/publishToRegistry");
|
|
14
13
|
const npmAuthEnvPassthrough_1 = require("../packageManager/npmAuthEnvPassthrough");
|
|
15
14
|
async function publish(options, context) {
|
|
@@ -67,17 +66,6 @@ async function publish(options, context) {
|
|
|
67
66
|
context.bumpInfo = (0, bumpInMemory_1.bumpInMemory)(options, context);
|
|
68
67
|
}
|
|
69
68
|
const bumpInfo = context.bumpInfo;
|
|
70
|
-
// eslint-disable-next-line @ms-cloudpack/no-deprecated
|
|
71
|
-
if (options.new) {
|
|
72
|
-
// Publish newly created packages even if they don't have change files
|
|
73
|
-
// (this is unlikely unless the packages were pushed without a PR that runs "beachball check")
|
|
74
|
-
console.log('Fetching all unmodified packages from the registry to check if there are any ' +
|
|
75
|
-
"newly-added packages that didn't have a change file...\n" +
|
|
76
|
-
'(NOTE: If your PR build runs `beachball check`, this step is unnecessarily slowing down ' +
|
|
77
|
-
"your publish process. In that case, it's recommended to remove `new: true` from your " +
|
|
78
|
-
'config or remove `--new` from your publish command.)\n');
|
|
79
|
-
bumpInfo.newPackages = await (0, getNewPackages_1.getNewPackages)(bumpInfo, options);
|
|
80
|
-
}
|
|
81
69
|
// Step 1. Bump on disk + npm publish
|
|
82
70
|
// npm / yarn publish
|
|
83
71
|
if (options.publish || packToPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":";;;;;AAkBA,0BAmHC;AArID,sDAA8B;AAC9B,qDAAkF;AAClF,uDAAoD;AACpD,2EAAwE;AACxE,wDAAqD;AACrD,oEAAiE;AAIjE,mFAAqF;AAS9E,KAAK,UAAU,OAAO,CAAC,OAAyB,EAAE,OAAwB;IAC/E,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEtC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACjE,sEAAsE;IACtE,OAAO,KAAK,IAAA,2CAAoB,EAAC,OAAO,CAAC,CAAC;IAE1C,kDAAkD;IAClD,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,OAAO;IACT,CAAC;IAED,MAAM,aAAa,GAAG,IAAA,+BAAa,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,IAAA,gCAAc,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5C,MAAM,iBAAiB,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;IAErE,OAAO,CAAC,GAAG,CAAC;;cAEA,QAAQ;;oBAEF,aAAa;kBACf,WAAW;mBACV,MAAM;kBACP,GAAG;;0BAEK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;IAE3F,UA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ACpD,CAAC;SAAM,IAAI,WAAW,EAAE,CAAC;QACvB,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;IAClD,CAAC;IAED,IAAI,aAAa,IAAI,WAAW,EAAE,CAAC;QACjC,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,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,sCAAsC,aAAa,iBAAiB,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5G,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -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;AAMlE;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC,GACjF,IAAI,CA2DN"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ensureSharedHistory = ensureSharedHistory;
|
|
4
4
|
const workspace_tools_1 = require("workspace-tools");
|
|
5
5
|
const fetch_1 = require("./fetch");
|
|
6
|
+
const getRemoteBranch_1 = require("./getRemoteBranch");
|
|
6
7
|
const bulletedList_1 = require("../logging/bulletedList");
|
|
7
8
|
const BeachballError_1 = require("../types/BeachballError");
|
|
8
9
|
/**
|
|
@@ -20,10 +21,7 @@ const BeachballError_1 = require("../types/BeachballError");
|
|
|
20
21
|
*/
|
|
21
22
|
function ensureSharedHistory(options) {
|
|
22
23
|
const { fetch, path: cwd, branch, depth, verbose } = options;
|
|
23
|
-
|
|
24
|
-
// `remote` is the remote name (e.g. "origin") or "" if `branch` was missing a remote.
|
|
25
|
-
// `remoteBranch` is the comparison branch name (e.g. "main").
|
|
26
|
-
const { remote, remoteBranch } = (0, workspace_tools_1.parseRemoteBranch)({ branch, cwd });
|
|
24
|
+
const { remote, remoteBranch } = (0, getRemoteBranch_1.getRemoteBranch)(options);
|
|
27
25
|
// Ensure the comparison branch ref exists
|
|
28
26
|
if (!hasBranchRef(branch, cwd)) {
|
|
29
27
|
if (!fetch) {
|
|
@@ -35,12 +33,6 @@ function ensureSharedHistory(options) {
|
|
|
35
33
|
alreadyLogged: true,
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
|
-
if (!remote) {
|
|
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. ` +
|
|
42
|
-
'Please set "repository" in your root package.json or include a remote in the beachball "branch" setting.');
|
|
43
|
-
}
|
|
44
36
|
}
|
|
45
37
|
if (fetch) {
|
|
46
38
|
// Fetch the latest from the remote branch for comparison. If the specified remoteBranch doesn't
|
|
@@ -127,7 +119,7 @@ function logError(error, branch, remote, remoteBranch) {
|
|
|
127
119
|
let mitigationSteps = [];
|
|
128
120
|
switch (error) {
|
|
129
121
|
case 'missing-branch':
|
|
130
|
-
//
|
|
122
|
+
// The config-reading logic ensures "remote" is non-empty here
|
|
131
123
|
mainError = `Target branch "${branch}" does not exist locally, and fetching is disabled.`;
|
|
132
124
|
mitigationSteps = [
|
|
133
125
|
`Fetch the branch manually:\n git remote set-branches --add ${remote} ${remoteBranch} && git fetch ${remote}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureSharedHistory.js","sourceRoot":"","sources":["../../src/git/ensureSharedHistory.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ensureSharedHistory.js","sourceRoot":"","sources":["../../src/git/ensureSharedHistory.ts"],"names":[],"mappings":";;AAoBA,kDA6DC;AAjFD,qDAAsC;AAEtC,mCAAmC;AACnC,uDAAuE;AACvE,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,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,iCAAe,EAAC,OAAO,CAAC,CAAC;IAE1D,0CAA0C;IAC1C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,uFAAuF;YACvF,yFAAyF;YACzF,+EAA+E;YAC/E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YACzD,MAAM,IAAI,+BAAc,CAAC,kBAAkB,MAAM,oDAAoD,EAAE;gBACrG,aAAa,EAAE,IAAI;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,gGAAgG;QAChG,8EAA8E;QAC9E,MAAM,MAAM,GAAG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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
|
@@ -2,12 +2,12 @@ import { type GitProcessOutput } from 'workspace-tools';
|
|
|
2
2
|
type GitFetchParams = {
|
|
3
3
|
cwd: string;
|
|
4
4
|
/**
|
|
5
|
-
* Remote to fetch from.
|
|
6
|
-
*
|
|
5
|
+
* Remote to fetch from. The config reading logic ensures this is a non-empty string (with the
|
|
6
|
+
* fallback of `origin` if no remotes were detected, though in that case fetching will likely fail).
|
|
7
7
|
*/
|
|
8
8
|
remote: string;
|
|
9
9
|
/**
|
|
10
|
-
* Branch(es) to fetch. Each will be converted to a full refspec for fetching:
|
|
10
|
+
* Branch(es) to fetch, **without** a remote prefix. Each will be converted to a full refspec for fetching:
|
|
11
11
|
* e.g. `branch: 'main', remote: 'origin'` will be converted to `+refs/heads/main:refs/remotes/origin/main`.
|
|
12
12
|
* Pass an array to fetch multiple branches in a single git invocation, which lets a single
|
|
13
13
|
* `--deepen` or `--unshallow` apply to all of them (saves network round-trips when both HEAD
|
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;;;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,
|
|
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,CA0D7F"}
|
package/lib/git/fetch.js
CHANGED
|
@@ -27,19 +27,17 @@ function gitFetch(params) {
|
|
|
27
27
|
// causing git to treat the ref as absent and delete the local tracking ref.
|
|
28
28
|
// - <dst> refs/remotes/${remote}/${branch} is resolved locally and only moves the tracking ref
|
|
29
29
|
// for the remote branch, not the local refs/heads/${branch} or its tracking config.
|
|
30
|
-
const resolvedRefspecs =
|
|
30
|
+
const resolvedRefspecs = branches.map(b => `+refs/heads/${b}:refs/remotes/${remote}/${b}`);
|
|
31
31
|
const branchLabel = branches.length > 1 ? `branches ${branches.map(b => `"${b}"`).join(', ')}` : `branch "${branches[0]}"`;
|
|
32
|
-
const shortDescription = `Fetching ${
|
|
32
|
+
const shortDescription = `Fetching ${branchLabel} from remote "${remote}"`;
|
|
33
33
|
let description = shortDescription;
|
|
34
34
|
resolvedRefspecs.length && (description += ` (${resolvedRefspecs.join(' ')})`);
|
|
35
35
|
extraArgs.length && (description += ` (with ${extraArgs.join(' ')})`);
|
|
36
36
|
shouldLog && console.log(description + '...');
|
|
37
|
-
const result = (0, workspace_tools_1.git)([
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...(resolvedRefspecs.length ? [remote, ...resolvedRefspecs] : []),
|
|
42
|
-
], { cwd, stdio: shouldLog === 'live' ? 'inherit' : 'pipe' });
|
|
37
|
+
const result = (0, workspace_tools_1.git)(['fetch', '--no-tags', ...extraArgs, remote, ...resolvedRefspecs], {
|
|
38
|
+
cwd,
|
|
39
|
+
stdio: shouldLog === 'live' ? 'inherit' : 'pipe',
|
|
40
|
+
});
|
|
43
41
|
const log = result.success ? console.log : console.warn;
|
|
44
42
|
// do the jest logging all at once in a way that can be captured by mocks (jest can't mock process.stdout/err)
|
|
45
43
|
if (shouldLog === 'end') {
|
package/lib/git/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/git/fetch.ts"],"names":[],"mappings":";;AAmCA,
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/git/fetch.ts"],"names":[],"mappings":";;AAmCA,4BA0DC;AA7FD,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,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpH,6FAA6F;IAC7F,wCAAwC;I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AAC;IAExD,8GAA8G;IAC9G,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;QACxB,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,GAAG,GAAG,gBAAgB,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,gBAAgB,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;IACpH,IAAI,SAAS,EAAE,CAAC;QACd,GAAG,CAAC,OAAO,CAAC,CAAC;QACb,OAAO,IAAI,0BAA0B,CAAC;IACxC,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAC1C,OAAO,IAAI,cAAc,MAAM,CAAC,MAAM,cAAc,MAAM,CAAC,MAAM,EAAE,CAAC;IACtE,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAC1C,OAAO,IAAI,eAAe,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;IAC7D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BeachballOptions } from '../types/BeachballOptions';
|
|
2
|
+
export type RemoteBranch = {
|
|
3
|
+
/** Remote name (always set) */
|
|
4
|
+
remote: string;
|
|
5
|
+
/** Branch name without the remote prefix */
|
|
6
|
+
remoteBranch: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Get the remote name and branch name (no prefix) from `branch`, with caching.
|
|
10
|
+
*
|
|
11
|
+
* Throws if the remote could not be determined (should never happen after initial option processing,
|
|
12
|
+
* which ensures the branch includes a remote name).
|
|
13
|
+
*/
|
|
14
|
+
export declare function getRemoteBranch(options: Pick<BeachballOptions, 'branch' | 'path'>): RemoteBranch;
|
|
15
|
+
/**
|
|
16
|
+
* Add remote branch info to the cache for both `${remote}/${remoteBranch}` and `${remoteBranch}` keys.
|
|
17
|
+
*/
|
|
18
|
+
export declare function cacheRemoteBranch(info: RemoteBranch, cwd: string): void;
|
|
19
|
+
//# sourceMappingURL=getRemoteBranch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRemoteBranch.d.ts","sourceRoot":"","sources":["../../src/git/getRemoteBranch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,YAAY,GAAG;IACzB,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,MAAM,CAAC,GAAG,YAAY,CAiBhG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRemoteBranch = getRemoteBranch;
|
|
4
|
+
exports.cacheRemoteBranch = cacheRemoteBranch;
|
|
5
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
6
|
+
const BeachballError_1 = require("../types/BeachballError");
|
|
7
|
+
const cache = {};
|
|
8
|
+
/**
|
|
9
|
+
* Get the remote name and branch name (no prefix) from `branch`, with caching.
|
|
10
|
+
*
|
|
11
|
+
* Throws if the remote could not be determined (should never happen after initial option processing,
|
|
12
|
+
* which ensures the branch includes a remote name).
|
|
13
|
+
*/
|
|
14
|
+
function getRemoteBranch(options) {
|
|
15
|
+
const { branch, path: cwd } = options;
|
|
16
|
+
const cacheKey = getCacheKey({ cwd, branch });
|
|
17
|
+
if (cache[cacheKey]) {
|
|
18
|
+
return cache[cacheKey];
|
|
19
|
+
}
|
|
20
|
+
// If `branch` starts with "origin" or "upstream", that's assumed to be the remote, but otherwise
|
|
21
|
+
// it will get the actual list of remotes from git config.
|
|
22
|
+
const parsed = (0, workspace_tools_1.parseRemoteBranch)({ branch, cwd });
|
|
23
|
+
if (!parsed.remote) {
|
|
24
|
+
throw new BeachballError_1.BeachballError(`Could not determine the remote for "${branch}"`);
|
|
25
|
+
}
|
|
26
|
+
const result = { remote: parsed.remote, remoteBranch: parsed.remoteBranch };
|
|
27
|
+
cache[cacheKey] = result;
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Add remote branch info to the cache for both `${remote}/${remoteBranch}` and `${remoteBranch}` keys.
|
|
32
|
+
*/
|
|
33
|
+
function cacheRemoteBranch(info, cwd) {
|
|
34
|
+
cache[getCacheKey({ cwd, branch: `${info.remote}/${info.remoteBranch}` })] = info;
|
|
35
|
+
cache[getCacheKey({ cwd, branch: info.remoteBranch })] = info;
|
|
36
|
+
}
|
|
37
|
+
function getCacheKey(params) {
|
|
38
|
+
return `${params.cwd}#${params.branch}`;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=getRemoteBranch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRemoteBranch.js","sourceRoot":"","sources":["../../src/git/getRemoteBranch.ts"],"names":[],"mappings":";;AAmBA,0CAiBC;AAKD,8CAGC;AA5CD,qDAAoD;AACpD,4DAAyD;AAUzD,MAAM,KAAK,GAAgD,EAAE,CAAC;AAE9D;;;;;GAKG;AACH,SAAgB,eAAe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lib/git/getDefaultRemote';
|
|
2
|
+
export type ParsedRemoteBranch = {
|
|
3
|
+
/**
|
|
4
|
+
* Remote name, e.g. `origin`.
|
|
5
|
+
* May be an empty string if the original branch reference didn't include a remote.
|
|
6
|
+
*/
|
|
7
|
+
remote: string;
|
|
8
|
+
/** Branch name without remote, e.g. `main`. This is always set. */
|
|
9
|
+
remoteBranch: string;
|
|
10
|
+
};
|
|
11
|
+
export type RemoteBranch = Pick<ParsedRemoteBranch, 'remoteBranch'> & {
|
|
12
|
+
/** Remote name, e.g. `origin`. */
|
|
13
|
+
remote: string;
|
|
14
|
+
};
|
|
15
|
+
export type GetDefaultRemoteBranchOptions = GetDefaultRemoteOptions & {
|
|
16
|
+
/**
|
|
17
|
+
* Name of branch to use, **without** a remote prefix. If you want to resolve a branch
|
|
18
|
+
* that may already include a remote prefix, use {@link resolveRemoteAndBranch}.
|
|
19
|
+
*
|
|
20
|
+
* If undefined, uses the default branch name (falling back to `master`).
|
|
21
|
+
*/
|
|
22
|
+
branch?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Resolve a user-provided branch (possibly with a remote) to a fully-qualified remote branch.
|
|
26
|
+
* First tries the less-expensive {@link parseRemoteBranchPlusRemotes} (compares with remote names
|
|
27
|
+
* read from `git config`) to see if there's an explicit remote in the branch name, then tries
|
|
28
|
+
* {@link getDefaultRemoteBranch}.
|
|
29
|
+
*
|
|
30
|
+
* If `options.strict` is true, throws in the same cases as {@link parseRemoteBranch},
|
|
31
|
+
* {@link getDefaultRemoteBranch}, {@link getDefaultRemote}, or {@link getRemotes}.
|
|
32
|
+
*
|
|
33
|
+
* @returns A fully-qualified target remote branch reference (e.g. `{ remote: "origin", branch: "main" }`)
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveRemoteAndBranch(options: Omit<GetDefaultRemoteBranchOptions, 'branch' | 'remotes'> & {
|
|
36
|
+
/** Branch which might include a remote prefix */
|
|
37
|
+
branch: string | undefined;
|
|
38
|
+
}): RemoteBranch;
|
|
39
|
+
//# sourceMappingURL=tempGetDefaultRemoteBranch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempGetDefaultRemoteBranch.d.ts","sourceRoot":"","sources":["../../src/git/tempGetDefaultRemoteBranch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAK1G,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC,GAAG;IACpE,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,GAAG;IACpE;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA+CF;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,IAAI,CAAC,6BAA6B,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IACnE,iDAAiD;IACjD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,GACA,YAAY,CAiBd"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRemoteAndBranch = resolveRemoteAndBranch;
|
|
4
|
+
// temporary copy of packages/workspace-tools/src/git/getDefaultRemoteBranch.ts
|
|
5
|
+
// to allow continued testing of ESRP before package quarantine time passes
|
|
6
|
+
const getDefaultRemote_1 = require("workspace-tools/lib/git/getDefaultRemote");
|
|
7
|
+
const git_1 = require("workspace-tools/lib/git/git");
|
|
8
|
+
const gitUtilities_1 = require("workspace-tools/lib/git/gitUtilities");
|
|
9
|
+
const parseRemoteBranch_1 = require("workspace-tools/lib/git/parseRemoteBranch");
|
|
10
|
+
/**
|
|
11
|
+
* Like {@link getDefaultRemoteBranch} but it returns an object.
|
|
12
|
+
*
|
|
13
|
+
* @returns A branch reference like `{ remote: "upstream", branch: "master" }` or `{ remote: "origin", branch: "main" }`.
|
|
14
|
+
*/
|
|
15
|
+
function getDefaultRemoteAndBranch(options) {
|
|
16
|
+
const { cwd, branch } = options;
|
|
17
|
+
const defaultRemote = (0, getDefaultRemote_1.getDefaultRemote)(options);
|
|
18
|
+
if (branch) {
|
|
19
|
+
// For this specific function, `branch` has no remote prefix
|
|
20
|
+
return { remote: defaultRemote, remoteBranch: branch };
|
|
21
|
+
}
|
|
22
|
+
let remoteDefaultBranch;
|
|
23
|
+
// Get the default branch name from the default remote.
|
|
24
|
+
// ls-remote is a plumbing command with stable, locale-independent output.
|
|
25
|
+
// Output format: "ref: refs/heads/main\tHEAD\n<hash>\tHEAD"
|
|
26
|
+
const lsRemoteCmd = ['ls-remote', '--symref', defaultRemote, 'HEAD'];
|
|
27
|
+
const lsRemote = (0, git_1.git)(lsRemoteCmd, {
|
|
28
|
+
cwd,
|
|
29
|
+
throwOnError: options.strict,
|
|
30
|
+
description: `Fetching default branch info from remote "${defaultRemote}"`,
|
|
31
|
+
});
|
|
32
|
+
if (lsRemote.success) {
|
|
33
|
+
const refRegex = /^ref: refs\/heads\/(.*?)\t/;
|
|
34
|
+
const symRefLine = lsRemote.stdout.split('\n').find(line => refRegex.test(line));
|
|
35
|
+
remoteDefaultBranch = symRefLine && symRefLine.match(refRegex)?.[1];
|
|
36
|
+
if (!remoteDefaultBranch && options.strict) {
|
|
37
|
+
throw new Error(`Could not parse default branch from \`git ${lsRemoteCmd.join(' ')}\` output:\n${lsRemote.stdout}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// If no default branch found from the remote, fall back to the local git config or "master"
|
|
41
|
+
// (this can't use throwOnError in case the key isn't set)
|
|
42
|
+
remoteDefaultBranch ||= (0, gitUtilities_1.getDefaultBranch)({ cwd });
|
|
43
|
+
return { remote: defaultRemote, remoteBranch: remoteDefaultBranch };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolve a user-provided branch (possibly with a remote) to a fully-qualified remote branch.
|
|
47
|
+
* First tries the less-expensive {@link parseRemoteBranchPlusRemotes} (compares with remote names
|
|
48
|
+
* read from `git config`) to see if there's an explicit remote in the branch name, then tries
|
|
49
|
+
* {@link getDefaultRemoteBranch}.
|
|
50
|
+
*
|
|
51
|
+
* If `options.strict` is true, throws in the same cases as {@link parseRemoteBranch},
|
|
52
|
+
* {@link getDefaultRemoteBranch}, {@link getDefaultRemote}, or {@link getRemotes}.
|
|
53
|
+
*
|
|
54
|
+
* @returns A fully-qualified target remote branch reference (e.g. `{ remote: "origin", branch: "main" }`)
|
|
55
|
+
*/
|
|
56
|
+
function resolveRemoteAndBranch(options) {
|
|
57
|
+
const { branch } = options;
|
|
58
|
+
let parsed;
|
|
59
|
+
if (branch) {
|
|
60
|
+
// A branch is provided, so see if it includes a remote name.
|
|
61
|
+
// The result is saved so the fetched list of remotes can be reused.
|
|
62
|
+
parsed = (0, parseRemoteBranch_1.parseRemoteBranchPlusRemotes)({ ...options, branch });
|
|
63
|
+
if (parsed.remote) {
|
|
64
|
+
// have to extract these to avoid returning `remotes`
|
|
65
|
+
return { remote: parsed.remote, remoteBranch: parsed.remoteBranch };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// No branch provided, or the provided branch didn't include a remote.
|
|
69
|
+
// Get the default remote and possibly default branch.
|
|
70
|
+
return getDefaultRemoteAndBranch({ ...options, remotes: parsed?.remotes });
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=tempGetDefaultRemoteBranch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempGetDefaultRemoteBranch.js","sourceRoot":"","sources":["../../src/git/tempGetDefaultRemoteBranch.ts"],"names":[],"mappings":";;A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,MAAM,EAAE,CACnG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,4FAA4F;IAC5F,0DAA0D;IAC1D,mBAAmB,KAAK,IAAA,+BAAgB,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAElD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AACtE,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,sBAAsB,CACpC,OAGC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,IAAI,MAAmE,CAAC;IACxE,IAAI,MAAM,EAAE,CAAC;QACX,6DAA6D;QAC7D,oEAAoE;QACpE,MAAM,GAAG,IAAA,gDAA4B,EAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,qDAAqD;YACrD,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;QACtE,CAAC;IACH,CAAC;IAED,sEAAsE;IACtE,sDAAsD;IACtD,OAAO,yBAAyB,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAC7E,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export type { VersionGroupOptions } from './types/BeachballOptions';
|
|
|
4
4
|
export type { ChangeFilePromptOptions } from './types/ChangeFilePrompt';
|
|
5
5
|
export type { ChangeType } from './types/ChangeInfo';
|
|
6
6
|
export type { ChangelogEntry, ChangelogJson, ChangelogJsonEntry, PackageChangelog } from './types/ChangeLog';
|
|
7
|
+
export type { PackageInfo } from './types/PackageInfo';
|
|
7
8
|
export type { ChangelogOptions, ChangelogGroupOptions, PackageChangelogRenderInfo, ChangelogRenderers, } from './types/ChangelogOptions';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7G,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7G,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PackageInfo as WSPackageInfo } from 'workspace-tools';
|
|
1
2
|
import type { PackageInfos } from '../types/PackageInfo';
|
|
2
3
|
import type { BeachballOptions, ParsedOptions } from '../types/BeachballOptions';
|
|
3
4
|
/** Options subset used by `getPackageInfos` */
|
|
@@ -16,5 +17,13 @@ type PackageInfosOptions = Pick<ParsedOptions, 'cliOptions'> & {
|
|
|
16
17
|
export declare function getPackageInfos(cliOptions: PackageInfosOptions): PackageInfos;
|
|
17
18
|
/** @deprecated Pass the pre-parsed options */
|
|
18
19
|
export declare function getPackageInfos(cwd: string): PackageInfos;
|
|
20
|
+
/**
|
|
21
|
+
* Internal helper to get raw package infos.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getRawPackageInfos(params: {
|
|
24
|
+
projectRoot: string;
|
|
25
|
+
packageRoot: string | undefined;
|
|
26
|
+
options: PackageInfosOptions['options'] | undefined;
|
|
27
|
+
}): WSPackageInfo[] | undefined;
|
|
19
28
|
export {};
|
|
20
29
|
//# sourceMappingURL=getPackageInfos.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPackageInfos.d.ts","sourceRoot":"","sources":["../../src/monorepo/getPackageInfos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getPackageInfos.d.ts","sourceRoot":"","sources":["../../src/monorepo/getPackageInfos.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,IAAI,aAAa,EAElC,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGjF,+CAA+C;AAC/C,KAAK,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG;IAC7D,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,MAAM,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,mBAAmB,GAAG,YAAY,CAAC;AAC/E,8CAA8C;AAC9C,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;AAmB3D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;CACrD,GAAG,aAAa,EAAE,GAAG,SAAS,CAiB9B"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getPackageInfos = getPackageInfos;
|
|
7
|
+
exports.getRawPackageInfos = getRawPackageInfos;
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const workspace_tools_1 = require("workspace-tools");
|
|
9
10
|
const getPackageInfosWithOptions_1 = require("../options/getPackageInfosWithOptions");
|
|
@@ -14,11 +15,24 @@ function getPackageInfos(optionsOrCwd) {
|
|
|
14
15
|
// If cwd comes from processed CLI options, it's already the root
|
|
15
16
|
const projectRoot = typeof optionsOrCwd === 'string' ? (0, workspace_tools_1.findProjectRoot)(cwd) : cwd;
|
|
16
17
|
const packageRoot = (0, workspace_tools_1.findPackageRoot)(cwd);
|
|
18
|
+
const wsPackageInfos = getRawPackageInfos({ projectRoot, packageRoot, options: parsedOptions?.options });
|
|
19
|
+
if (wsPackageInfos) {
|
|
20
|
+
return parsedOptions
|
|
21
|
+
? (0, getPackageInfosWithOptions_1.getPackageInfosWithOptions)(wsPackageInfos, parsedOptions.cliOptions)
|
|
22
|
+
: // eslint-disable-next-line @ms-cloudpack/no-deprecated
|
|
23
|
+
(0, getPackageInfosWithOptions_1.getPackageInfosWithOptions)(wsPackageInfos);
|
|
24
|
+
}
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Internal helper to get raw package infos.
|
|
29
|
+
*/
|
|
30
|
+
function getRawPackageInfos(params) {
|
|
31
|
+
const { projectRoot, packageRoot, options } = params;
|
|
17
32
|
let wsPackageInfos;
|
|
18
33
|
if (projectRoot) {
|
|
19
34
|
wsPackageInfos =
|
|
20
|
-
getPackageInfosFromMonorepoManager(projectRoot) ||
|
|
21
|
-
getPackageInfosFromOtherMonorepo(projectRoot, parsedOptions?.options);
|
|
35
|
+
getPackageInfosFromMonorepoManager(projectRoot) || getPackageInfosFromOtherMonorepo(projectRoot, options);
|
|
22
36
|
}
|
|
23
37
|
if (!wsPackageInfos?.length && packageRoot) {
|
|
24
38
|
const singlePackage = (0, workspace_tools_1.getPackageInfo)(packageRoot);
|
|
@@ -26,13 +40,7 @@ function getPackageInfos(optionsOrCwd) {
|
|
|
26
40
|
wsPackageInfos = [singlePackage];
|
|
27
41
|
}
|
|
28
42
|
}
|
|
29
|
-
|
|
30
|
-
return parsedOptions
|
|
31
|
-
? (0, getPackageInfosWithOptions_1.getPackageInfosWithOptions)(wsPackageInfos, parsedOptions.cliOptions)
|
|
32
|
-
: // eslint-disable-next-line @ms-cloudpack/no-deprecated
|
|
33
|
-
(0, getPackageInfosWithOptions_1.getPackageInfosWithOptions)(wsPackageInfos);
|
|
34
|
-
}
|
|
35
|
-
return {};
|
|
43
|
+
return wsPackageInfos;
|
|
36
44
|
}
|
|
37
45
|
/** Try to find packages from a monorepo manager */
|
|
38
46
|
function getPackageInfosFromMonorepoManager(projectRoot) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPackageInfos.js","sourceRoot":"","sources":["../../src/monorepo/getPackageInfos.ts"],"names":[],"mappings":";;;;;AAgCA,
|
|
1
|
+
{"version":3,"file":"getPackageIn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I,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,WAAW;YAAE,SAAS;QAE3B,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CACX,2CAA2C,WAAW,CAAC,IAAI,2CAA2C;gBACpG,KAAK,cAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,IAAI;gBACrF,KAAK,cAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE,CACjE,CAAC;YACF,0CAA0C;YAC1C,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,0DAA0D;YACxD,uFAAuF;YACvF,kDAAkD,CACrD,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ParsedOptions } from '../types/BeachballOptions';
|
|
1
|
+
import type { CliOptions, ParsedOptions } from '../types/BeachballOptions';
|
|
2
2
|
export interface ProcessInfo {
|
|
3
3
|
/** Complete argv (node and script path aren't used but elements must be present) */
|
|
4
4
|
argv: string[];
|
|
@@ -23,4 +23,9 @@ export interface ProcessInfo {
|
|
|
23
23
|
export declare function getCliOptions(processInfo: ProcessInfo): ParsedOptions['cliOptions'];
|
|
24
24
|
/** @deprecated Pass full process info */
|
|
25
25
|
export declare function getCliOptions(argv: string[]): ParsedOptions['cliOptions'];
|
|
26
|
+
/**
|
|
27
|
+
* Resolves `rawOptions.branch` if provided to ensure it includes the remote name.
|
|
28
|
+
* If no branch is provided, returns the default branch.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveBranchOption(rawOptions: Partial<Pick<CliOptions, 'branch' | 'verbose'>>, cwd: string): string;
|
|
26
31
|
//# sourceMappingURL=getCliOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCliOptions.d.ts","sourceRoot":"","sources":["../../src/options/getCliOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getCliOptions.d.ts","sourceRoot":"","sources":["../../src/options/getCliOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI3E,MAAM,WAAW,WAAW;IAC1B,oFAAoF;IACpF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAyGD;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AACrF,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAiF3E;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUpH"}
|
|
@@ -4,9 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getCliOptions = getCliOptions;
|
|
7
|
-
|
|
7
|
+
exports.resolveBranchOption = resolveBranchOption;
|
|
8
8
|
const workspace_tools_1 = require("workspace-tools");
|
|
9
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
9
10
|
const env_1 = require("../env");
|
|
11
|
+
const getRemoteBranch_1 = require("../git/getRemoteBranch");
|
|
12
|
+
const tempGetDefaultRemoteBranch_1 = require("../git/tempGetDefaultRemoteBranch");
|
|
10
13
|
// For camelCased options, yargs will automatically accept them with-dashes too.
|
|
11
14
|
const arrayOptions = ['disallowedChangeTypes', 'package', 'scope'];
|
|
12
15
|
const booleanOptions = [
|
|
@@ -20,7 +23,6 @@ const booleanOptions = [
|
|
|
20
23
|
'gitTags',
|
|
21
24
|
'help',
|
|
22
25
|
'keepChangeFiles',
|
|
23
|
-
'new',
|
|
24
26
|
'publish',
|
|
25
27
|
'push',
|
|
26
28
|
'verbose',
|
|
@@ -126,15 +128,8 @@ function getCliOptions(processOrArgv) {
|
|
|
126
128
|
// Save extra positional args for commands that support subcommands (e.g. 'config get <name>')
|
|
127
129
|
// (yargs-parser doesn't support positional arguments directly)
|
|
128
130
|
const extraPositionalArgs = positionalArgs.length > 1 ? positionalArgs.slice(1).map(String) : undefined;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// TODO: This logic assumes the first segment of any branch name with a slash must be the remote,
|
|
132
|
-
// which is not necessarily accurate. Ideally we should check if a remote with that name exists,
|
|
133
|
-
// and if not, perform the default remote lookup.
|
|
134
|
-
cliOptions.branch =
|
|
135
|
-
branchArg.indexOf('/') > -1
|
|
136
|
-
? branchArg
|
|
137
|
-
: (0, workspace_tools_1.getDefaultRemoteBranch)({ branch: branchArg, verbose: args.verbose, cwd });
|
|
131
|
+
if (args.branch) {
|
|
132
|
+
cliOptions.branch = resolveBranchOption(args, cwd);
|
|
138
133
|
}
|
|
139
134
|
if (cliOptions.command === 'canary') {
|
|
140
135
|
cliOptions.tag = cliOptions.canaryName || 'canary';
|
|
@@ -174,4 +169,18 @@ function getCliOptions(processOrArgv) {
|
|
|
174
169
|
}
|
|
175
170
|
return cliOptions;
|
|
176
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Resolves `rawOptions.branch` if provided to ensure it includes the remote name.
|
|
174
|
+
* If no branch is provided, returns the default branch.
|
|
175
|
+
*/
|
|
176
|
+
function resolveBranchOption(rawOptions, cwd) {
|
|
177
|
+
const branchResult = (0, tempGetDefaultRemoteBranch_1.resolveRemoteAndBranch)({
|
|
178
|
+
branch: rawOptions.branch,
|
|
179
|
+
cwd,
|
|
180
|
+
verbose: rawOptions.verbose,
|
|
181
|
+
strict: true,
|
|
182
|
+
});
|
|
183
|
+
(0, getRemoteBranch_1.cacheRemoteBranch)(branchResult, cwd);
|
|
184
|
+
return `${branchResult.remote}/${branchResult.remoteBranch}`;
|
|
185
|
+
}
|
|
177
186
|
//# sourceMappingURL=getCliOptions.js.map
|