@brainervirus/workit-core 8.21.0 → 8.21.2
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/package.json
CHANGED
|
@@ -20,14 +20,44 @@ export function changedPackages(root: string, fromTag: string): string[] {
|
|
|
20
20
|
// Plus packages whose inlined third-party deps resolve differently in the
|
|
21
21
|
// lockfile (BUNDLED_DEPS); a dev-tooling-only lockfile bump changes none.
|
|
22
22
|
const relocked = new Set<string>(lockChangedPackages(root, fromTag, "HEAD"));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const changed = new Set<string>(
|
|
24
|
+
RELEASE_PACKAGES.filter((pkg) => {
|
|
25
|
+
if (relocked.has(pkg)) return true;
|
|
26
|
+
// Own directory plus any sources bundled into its dist/ (BUNDLED_SOURCES).
|
|
27
|
+
const out = git(root, [
|
|
28
|
+
"diff",
|
|
29
|
+
"--name-only",
|
|
30
|
+
`${fromTag}..HEAD`,
|
|
31
|
+
"--",
|
|
32
|
+
...payloadPaths(pkg),
|
|
33
|
+
]);
|
|
34
|
+
return out !== "";
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
// A published package depends on its internal dependencies at ^<released
|
|
38
|
+
// version> (rewrite-workspace-deps), so each must ship that version too or
|
|
39
|
+
// the package cannot install (#386: workit-cli 8.21.1 required an
|
|
40
|
+
// unpublished workit-cursor 8.21.1).
|
|
41
|
+
const queue = [...changed];
|
|
42
|
+
for (let pkg = queue.pop(); pkg !== undefined; pkg = queue.pop())
|
|
43
|
+
for (const dep of internalDependencies(root, pkg))
|
|
44
|
+
if (!changed.has(dep)) {
|
|
45
|
+
changed.add(dep);
|
|
46
|
+
queue.push(dep);
|
|
47
|
+
}
|
|
48
|
+
return RELEASE_PACKAGES.filter((pkg) => changed.has(pkg));
|
|
29
49
|
}
|
|
30
50
|
|
|
51
|
+
/** The release packages `pkg` declares as runtime dependencies at HEAD. */
|
|
52
|
+
const internalDependencies = (root: string, pkg: string): string[] => {
|
|
53
|
+
const manifest = JSON.parse(git(root, ["show", `HEAD:packages/${pkg}/package.json`])) as {
|
|
54
|
+
dependencies?: Record<string, string>;
|
|
55
|
+
};
|
|
56
|
+
return RELEASE_PACKAGES.filter(
|
|
57
|
+
(other) => manifest.dependencies?.[`@brainervirus/${other}`] !== undefined,
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
31
61
|
export function publishChanged(opts: {
|
|
32
62
|
root: string;
|
|
33
63
|
dryRun?: boolean;
|