@treeseed/sdk 0.12.6 → 0.12.8
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/dist/workflow/operations.d.ts +9 -23
- package/dist/workflow/operations.js +33 -24
- package/package.json +1 -1
|
@@ -1011,30 +1011,7 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1011
1011
|
version: string | null;
|
|
1012
1012
|
result: {
|
|
1013
1013
|
status: string;
|
|
1014
|
-
adapter: string;
|
|
1015
|
-
command: string;
|
|
1016
|
-
packageLock?: undefined;
|
|
1017
1014
|
reason?: undefined;
|
|
1018
|
-
} | {
|
|
1019
|
-
status: string;
|
|
1020
|
-
adapter: string;
|
|
1021
|
-
packageLock: {
|
|
1022
|
-
status: string;
|
|
1023
|
-
reason: string;
|
|
1024
|
-
path?: undefined;
|
|
1025
|
-
} | {
|
|
1026
|
-
status: string;
|
|
1027
|
-
path: string;
|
|
1028
|
-
reason?: undefined;
|
|
1029
|
-
};
|
|
1030
|
-
command?: undefined;
|
|
1031
|
-
reason?: undefined;
|
|
1032
|
-
} | {
|
|
1033
|
-
status: string;
|
|
1034
|
-
adapter: string;
|
|
1035
|
-
reason: string;
|
|
1036
|
-
command?: undefined;
|
|
1037
|
-
packageLock?: undefined;
|
|
1038
1015
|
} | {
|
|
1039
1016
|
status: string;
|
|
1040
1017
|
reason: string;
|
|
@@ -1068,6 +1045,15 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1068
1045
|
changelogUpdated: boolean;
|
|
1069
1046
|
entry: string;
|
|
1070
1047
|
};
|
|
1048
|
+
rootInstall: {
|
|
1049
|
+
status: string;
|
|
1050
|
+
reason: string;
|
|
1051
|
+
attempts?: undefined;
|
|
1052
|
+
} | {
|
|
1053
|
+
status: string;
|
|
1054
|
+
reason: null;
|
|
1055
|
+
attempts: number;
|
|
1056
|
+
};
|
|
1071
1057
|
commit: {
|
|
1072
1058
|
committed: boolean;
|
|
1073
1059
|
commitSha: string;
|
|
@@ -1887,9 +1887,9 @@ function prepareAdapterReleaseMetadata(root, pkg, version) {
|
|
|
1887
1887
|
}
|
|
1888
1888
|
if (existsSync(resolve(pkg.dir, "package.json"))) {
|
|
1889
1889
|
return {
|
|
1890
|
-
status: "
|
|
1890
|
+
status: "npm-install",
|
|
1891
1891
|
adapter: adapter?.id ?? pkg.name,
|
|
1892
|
-
|
|
1892
|
+
...runReleaseNpmInstall(pkg.dir, { workspaceRoot: root })
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
1895
|
return { status: "skipped", adapter: adapter?.id ?? pkg.name, reason: "no package metadata updater" };
|
|
@@ -1933,31 +1933,36 @@ function runReleaseNpmInstall(repoDir, options = {}) {
|
|
|
1933
1933
|
}
|
|
1934
1934
|
const args = repoDir === options.workspaceRoot ? ["install", "--package-lock-only", "--ignore-scripts", "--no-audit", "--no-fund"] : ["install", "--package-lock-only", "--ignore-scripts", "--workspaces=false", "--no-audit", "--no-fund"];
|
|
1935
1935
|
const spawnCommand = npmCommandForWorkflowSpawn(args);
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1936
|
+
let lastDetail = "";
|
|
1937
|
+
for (let attempt = 1; attempt <= 10; attempt += 1) {
|
|
1938
|
+
const result = spawnSync(spawnCommand.command, spawnCommand.args, {
|
|
1939
|
+
cwd: repoDir,
|
|
1940
|
+
env: {
|
|
1941
|
+
...process.env,
|
|
1942
|
+
npm_config_audit: "false",
|
|
1943
|
+
npm_config_fetch_retries: "4",
|
|
1944
|
+
npm_config_fund: "false",
|
|
1945
|
+
npm_config_foreground_scripts: "true",
|
|
1946
|
+
npm_config_loglevel: "warn",
|
|
1947
|
+
npm_config_maxsockets: "4",
|
|
1948
|
+
npm_config_prefer_online: "true",
|
|
1949
|
+
npm_config_progress: "false"
|
|
1950
|
+
},
|
|
1951
|
+
stdio: "pipe",
|
|
1952
|
+
encoding: "utf8"
|
|
1953
|
+
});
|
|
1954
|
+
if (result.status === 0) {
|
|
1955
|
+
return { status: "completed", reason: null, attempts: attempt };
|
|
1956
|
+
}
|
|
1957
|
+
lastDetail = [
|
|
1954
1958
|
result.error?.message,
|
|
1955
1959
|
result.stderr?.trim(),
|
|
1956
1960
|
result.stdout?.trim()
|
|
1957
1961
|
].filter(Boolean).join("\n");
|
|
1958
|
-
|
|
1962
|
+
if (!/No matching version found|notarget|ETARGET|E404/u.test(lastDetail) || attempt === 10) break;
|
|
1963
|
+
spawnSync("sleep", ["30"], { stdio: "ignore" });
|
|
1959
1964
|
}
|
|
1960
|
-
|
|
1965
|
+
throw new Error(lastDetail || `npm ${args.join(" ")} failed`);
|
|
1961
1966
|
}
|
|
1962
1967
|
function pathIsWithin(parent, candidate) {
|
|
1963
1968
|
const path = relative(parent, candidate);
|
|
@@ -5350,10 +5355,10 @@ ${blockers.join("\n")}`, {
|
|
|
5350
5355
|
const adapterMetadata = checkedOutWorkspacePackageRepos(root).filter((pkg) => selectedPackageSet.has(pkg.name)).map((pkg) => ({
|
|
5351
5356
|
name: pkg.name,
|
|
5352
5357
|
version: selectedVersions.get(pkg.name) ?? null,
|
|
5353
|
-
result: selectedVersions.has(pkg.name) ?
|
|
5358
|
+
result: selectedVersions.has(pkg.name) ? { status: "pending-package-release-step" } : { status: "skipped", reason: "no planned version" }
|
|
5354
5359
|
}));
|
|
5355
5360
|
const rootPackageLock = updatePackageLockRootVersion(root, plannedRelease.rootVersion);
|
|
5356
|
-
const remainingDevReferences = collectInternalDevReferenceIssues(root, selectedPackageSet).filter((issue) => issue.reason
|
|
5361
|
+
const remainingDevReferences = collectInternalDevReferenceIssues(root, selectedPackageSet).filter((issue) => !issue.reason.startsWith("lockfile-"));
|
|
5357
5362
|
if (remainingDevReferences.length > 0) {
|
|
5358
5363
|
const rendered = remainingDevReferences.map((issue) => `${issue.repoName}: ${issue.filePath} ${issue.dependencyName ?? ""} ${issue.reason} ${issue.spec}`).join("\n");
|
|
5359
5364
|
throw new Error(`Stable release metadata still contains development references.
|
|
@@ -5371,6 +5376,7 @@ ${rendered}`);
|
|
|
5371
5376
|
const version = selectedVersions.get(pkg.name);
|
|
5372
5377
|
if (!version) continue;
|
|
5373
5378
|
const packageRelease = await executeJournalStep(root, workflowRun.runId, `release-${pkg.name}`, async () => {
|
|
5379
|
+
const metadata = prepareAdapterReleaseMetadata(root, pkg, version);
|
|
5374
5380
|
const changelog = updateReleaseChangelog(pkg.dir, {
|
|
5375
5381
|
version,
|
|
5376
5382
|
sourceRef: `origin/${PRODUCTION_BRANCH}`,
|
|
@@ -5405,6 +5411,7 @@ ${rendered}`);
|
|
|
5405
5411
|
path: relative(root, pkg.dir),
|
|
5406
5412
|
version,
|
|
5407
5413
|
changelog,
|
|
5414
|
+
metadata,
|
|
5408
5415
|
commit,
|
|
5409
5416
|
promotion,
|
|
5410
5417
|
tag,
|
|
@@ -5415,6 +5422,7 @@ ${rendered}`);
|
|
|
5415
5422
|
packageReleases.push(packageRelease);
|
|
5416
5423
|
}
|
|
5417
5424
|
const rootRelease = await executeJournalStep(root, workflowRun.runId, "release-root", () => {
|
|
5425
|
+
const rootInstall = runReleaseNpmInstall(root, { workspaceRoot: root });
|
|
5418
5426
|
const changelog = updateReleaseChangelog(repoRoot(root), {
|
|
5419
5427
|
version: plannedRelease.rootVersion,
|
|
5420
5428
|
sourceRef: `origin/${PRODUCTION_BRANCH}`,
|
|
@@ -5438,6 +5446,7 @@ ${rendered}`);
|
|
|
5438
5446
|
version: plannedRelease.rootVersion,
|
|
5439
5447
|
releaseTag: plannedRelease.releaseTag,
|
|
5440
5448
|
changelog,
|
|
5449
|
+
rootInstall,
|
|
5441
5450
|
commit,
|
|
5442
5451
|
promotion,
|
|
5443
5452
|
tag
|