release: move publication orchestration into tools/release.zig, pin rotated subkey
Gates / package (push) Successful in 8m51s
Release / guard (push) Successful in 1m33s
Gates / test-aarch64 (push) Successful in 4m24s
Gates / frontend (push) Successful in 44s
Gates / package (push) Successful in 33s
Gates / container (push) Successful in 35s
Release / gates (push) Successful in 8m24s
Gates / test-aarch64 (push) Successful in 7m56s
Gates / frontend (push) Successful in 1m31s
Gates / test (push) Failing after 16m8s
Gates / container (push) Successful in 5m11s
CI / gates (push) Failing after 30m3s
Gates / test (push) Successful in 2m7s
Release / publish (push) Failing after 10m20s
Gates / package (push) Successful in 8m51s
Release / guard (push) Successful in 1m33s
Gates / test-aarch64 (push) Successful in 4m24s
Gates / frontend (push) Successful in 44s
Gates / package (push) Successful in 33s
Gates / container (push) Successful in 35s
Release / gates (push) Successful in 8m24s
Gates / test-aarch64 (push) Successful in 7m56s
Gates / frontend (push) Successful in 1m31s
Gates / test (push) Failing after 16m8s
Gates / container (push) Successful in 5m11s
CI / gates (push) Failing after 30m3s
Gates / test (push) Successful in 2m7s
Release / publish (push) Failing after 10m20s
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
bundledPackages,
|
||||
comparePackages,
|
||||
formatDiff,
|
||||
packageFromSource,
|
||||
recordedPackages,
|
||||
} from "./bundledPackages.mjs";
|
||||
|
||||
describe("packageFromSource", () => {
|
||||
it("reads a plain package name", () => {
|
||||
expect(packageFromSource("../../node_modules/react-dom/client.js")).toBe("react-dom");
|
||||
});
|
||||
|
||||
it("keeps the scope of a scoped package", () => {
|
||||
expect(packageFromSource("../../node_modules/@tanstack/react-query/build/index.js")).toBe(
|
||||
"@tanstack/react-query",
|
||||
);
|
||||
});
|
||||
|
||||
it("takes the last node_modules, so a nested dependency is named correctly", () => {
|
||||
expect(packageFromSource("node_modules/vite/node_modules/@scope/inner/x.js")).toBe("@scope/inner");
|
||||
});
|
||||
|
||||
it("ignores application sources", () => {
|
||||
expect(packageFromSource("src/lib/api.ts")).toBeNull();
|
||||
expect(packageFromSource("../src/main.tsx")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("bundledPackages", () => {
|
||||
it("sorts and deduplicates across every map", () => {
|
||||
const packages = bundledPackages([
|
||||
["node_modules/react/index.js", "src/main.tsx", "node_modules/react/jsx-runtime.js"],
|
||||
["node_modules/@tanstack/react-router/x.js", "node_modules/react/index.js"],
|
||||
]);
|
||||
expect(packages).toEqual(["@tanstack/react-router", "react"]);
|
||||
});
|
||||
|
||||
it("returns an empty set when nothing came from node_modules", () => {
|
||||
expect(bundledPackages([["src/main.tsx"]])).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("recordedPackages", () => {
|
||||
const identity = [
|
||||
"[some earlier section]",
|
||||
"ignored",
|
||||
"",
|
||||
"[npm packages bundled into web/dist]",
|
||||
"react",
|
||||
"@tanstack/react-query",
|
||||
"",
|
||||
"react-dom",
|
||||
"",
|
||||
"[a later section]",
|
||||
"not-a-package",
|
||||
].join("\n");
|
||||
|
||||
it("reads only its own section, sorted and deduplicated", () => {
|
||||
expect(recordedPackages(identity)).toEqual(["@tanstack/react-query", "react", "react-dom"]);
|
||||
});
|
||||
|
||||
it("distinguishes a missing section from an empty one", () => {
|
||||
expect(recordedPackages("[other]\nx\n")).toBeNull();
|
||||
expect(recordedPackages("[npm packages bundled into web/dist]\n\n[next]\n")).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("comparePackages", () => {
|
||||
it("reports both directions", () => {
|
||||
const { added, removed } = comparePackages(["a", "b"], ["b", "c"]);
|
||||
expect(added).toEqual(["c"]);
|
||||
expect(removed).toEqual(["a"]);
|
||||
});
|
||||
|
||||
it("reports nothing when the sets match", () => {
|
||||
expect(comparePackages(["a", "b"], ["a", "b"])).toEqual({ added: [], removed: [] });
|
||||
expect(formatDiff(["a"], ["a"])).toBe("");
|
||||
});
|
||||
|
||||
it("formats a diff the way the failure prints it", () => {
|
||||
expect(formatDiff(["a", "b"], ["b", "c"])).toBe("-a\n+c");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user