@treeseed/sdk 0.12.51 → 0.12.53
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.
|
@@ -818,7 +818,7 @@ function validateStandaloneGitDependencyLockfile(node, options) {
|
|
|
818
818
|
rmSync(isolatedRoot, { recursive: true, force: true });
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
|
-
emitProgress(options, node, "lockfile", "Validated the standalone lockfile
|
|
821
|
+
emitProgress(options, node, "lockfile", "Validated the standalone lockfile against the committed package manifest.");
|
|
822
822
|
return true;
|
|
823
823
|
}
|
|
824
824
|
function planPackageVersion(node, options) {
|
|
@@ -1809,6 +1809,9 @@ async function saveOneRepository(node, options, state) {
|
|
|
1809
1809
|
} else if (node.kind === "project" && (dependencyChanged || node.path === options.root && submodulesChanged) && hasNpmLockfile(node.path)) {
|
|
1810
1810
|
report.install = await runNpmInstallWithRetry(node, options, gitDependencyRefreshSpecs);
|
|
1811
1811
|
}
|
|
1812
|
+
if (!isRootWorkspaceRepository(node, options) && hasNpmLockfile(node.path) && (packageNeedsVersion || dependencyChanged)) {
|
|
1813
|
+
validateStandaloneGitDependencyLockfile(node, options);
|
|
1814
|
+
}
|
|
1812
1815
|
if (hasNpmLockfile(node.path) && (node.kind === "project" || packageNeedsVersion || dependencyChanged || submodulesChanged)) {
|
|
1813
1816
|
const lockfileIssues = collectDeploymentLockfileWorkspaceIssues(node.path);
|
|
1814
1817
|
if (node.kind === "project" && lockfileIssues.length > 0 && !shouldSkipNetworkInstall()) {
|
|
@@ -2090,6 +2090,9 @@ function releaseWorkflowForPackage(root, packageName) {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
function productionDeployWorkflowForPackage(root, packageName) {
|
|
2092
2092
|
const adapter = discoverTreeseedPackageAdapters(root).find((entry) => entry.id === packageName || entry.name === packageName);
|
|
2093
|
+
if (adapter?.capabilities.deploy !== true) {
|
|
2094
|
+
return null;
|
|
2095
|
+
}
|
|
2093
2096
|
const repoPath = adapter?.dir;
|
|
2094
2097
|
if (!repoPath || !existsSync(resolve(repoPath, "treeseed.site.yaml"))) {
|
|
2095
2098
|
return null;
|
package/dist/workflow/session.js
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
repoRoot
|
|
8
8
|
} from "../operations/services/workspace-save.js";
|
|
9
9
|
import {
|
|
10
|
-
changedWorkspacePackages,
|
|
11
10
|
hasCompleteTreeseedPackageCheckout,
|
|
12
11
|
publishableWorkspacePackages,
|
|
13
12
|
sortWorkspacePackages,
|
|
@@ -15,6 +14,7 @@ import {
|
|
|
15
14
|
workspaceRoot
|
|
16
15
|
} from "../operations/services/workspace-tools.js";
|
|
17
16
|
import { discoverTreeseedPackageAdapters } from "../operations/services/package-adapters.js";
|
|
17
|
+
import { runTreeseedGit } from "../operations/services/git-runner.js";
|
|
18
18
|
import {
|
|
19
19
|
classifyTreeseedBranchRole,
|
|
20
20
|
resolveTreeseedWorkflowPaths
|
|
@@ -91,19 +91,42 @@ function collectReleasePackageSelection(root) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
const publishable = sortWorkspacePackages([...publishableByName.values()]);
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
const changedNames = publishable.filter((pkg) => {
|
|
95
|
+
const remoteMain = runTreeseedGit(["rev-parse", "--verify", "origin/main"], {
|
|
96
|
+
cwd: pkg.dir,
|
|
97
|
+
mode: "read",
|
|
98
|
+
allowFailure: true
|
|
99
|
+
});
|
|
100
|
+
const baseRef = remoteMain.status === 0 ? "origin/main" : "main";
|
|
101
|
+
const diff = runTreeseedGit(["diff", "--quiet", baseRef, "HEAD"], {
|
|
102
|
+
cwd: pkg.dir,
|
|
103
|
+
mode: "read",
|
|
104
|
+
allowFailure: true
|
|
105
|
+
});
|
|
106
|
+
return diff.status !== 0 || gitStatusPorcelain(pkg.dir).length > 0;
|
|
107
|
+
}).map((pkg) => pkg.name);
|
|
108
|
+
const selectedNames = new Set(changedNames);
|
|
109
|
+
const reverseDependencies = new Map(publishable.map((pkg) => [pkg.name, /* @__PURE__ */ new Set()]));
|
|
110
|
+
const packageNames = new Set(publishable.map((pkg) => pkg.name));
|
|
111
|
+
for (const pkg of publishable) {
|
|
112
|
+
for (const field of ["dependencies", "optionalDependencies", "peerDependencies", "devDependencies"]) {
|
|
113
|
+
const dependencies = pkg.packageJson?.[field];
|
|
114
|
+
if (!dependencies || typeof dependencies !== "object" || Array.isArray(dependencies)) continue;
|
|
115
|
+
for (const dependency of Object.keys(dependencies)) {
|
|
116
|
+
if (packageNames.has(dependency)) reverseDependencies.get(dependency)?.add(pkg.name);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const queue = [...changedNames];
|
|
121
|
+
while (queue.length > 0) {
|
|
122
|
+
const dependency = queue.shift();
|
|
123
|
+
for (const dependent of reverseDependencies.get(dependency) ?? []) {
|
|
124
|
+
if (selectedNames.has(dependent)) continue;
|
|
125
|
+
selectedNames.add(dependent);
|
|
126
|
+
queue.push(dependent);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const selected = publishable.filter((pkg) => selectedNames.has(pkg.name));
|
|
107
130
|
return {
|
|
108
131
|
changed: changedNames,
|
|
109
132
|
dependents: selected.filter((pkg) => !changedNames.includes(pkg.name)).map((pkg) => pkg.name),
|