feat(housekeeping): cut over administration to ase

This commit is contained in:
Simo committed 2026-08-30 20:35:22 +02:00
1 parent c9e35cf602
commit 2b8f73a91d
457 files changed
+589 -55936

No files matched your search

@@ -13,8 +13,8 @@ describe("Housekeeping runtime parity", () => {
HOUSEKEEPING_ROUTE_HANDLERS,
);
it("closes all 137 discovered migration rows against the runtime", () => {
expect(discoverLegacyPages()).toHaveLength(137);
it("closes all 137 recorded migration rows after removing legacy routes", () => {
expect(discoverLegacyPages()).toEqual([]);
expect(report).toEqual({
discovered: 137,
mapped: 137,
@@ -0,0 +1,71 @@
import { existsSync, readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const CANONICAL_ENTRYPOINTS = [
"src/app/ase/layout.tsx",
"src/app/ase/page.tsx",
"src/app/ase/[domain]/layout.tsx",
"src/app/ase/[domain]/[[...segments]]/page.tsx",
"src/features/housekeeping/route-handlers.ts",
] as const;
const REMOVED_UI_ROOTS = [
"src/app/admin",
"src/app/admin-next",
"src/app/ase-next",
"src/app/mod",
] as const;
const CANONICAL_GLOBAL_SOURCES = [
"src/features/housekeeping/foundation/routing/href.ts",
"src/lib/admin/guard.ts",
"src/lib/proxy-access.ts",
"src/components/navigation.tsx",
"src/components/top-header.tsx",
] as const;
const REMOVED_UI_PATH = /\/(?:admin(?:-next)?|ase-next|mod)(?:[/?"'`]|$)/;
describe("atomic Housekeeping route cutover", () => {
it("publishes the canonical /ase entrypoints and dispatcher", () => {
for (const path of CANONICAL_ENTRYPOINTS) {
expect(existsSync(path), path).toBe(true);
}
});
it("removes every legacy UI tree while preserving internal admin APIs", () => {
for (const path of REMOVED_UI_ROOTS) {
expect(existsSync(path), path).toBe(false);
}
expect(existsSync("src/app/api/admin/csrf/route.ts")).toBe(true);
});
it("uses /ase for global links, proxy access, and authorization fallbacks", () => {
for (const path of CANONICAL_GLOBAL_SOURCES) {
const source = readFileSync(path, "utf8");
expect(source, path).toContain("/ase");
expect(source, path).not.toMatch(REMOVED_UI_PATH);
}
});
it("removes the preview gate and environment flag", () => {
expect(
existsSync("src/features/housekeeping/foundation/preview-gate.ts"),
).toBe(false);
for (const path of ["src/env.ts", ".env.example"] as const) {
expect(readFileSync(path, "utf8"), path).not.toContain(
"HOUSEKEEPING_NEXT_PREVIEW_ENABLED",
);
}
});
it("does not add redirects for removed UI paths", () => {
for (const path of ["next.config.ts", "src/proxy.ts"] as const) {
const source = readFileSync(path, "utf8");
expect(source, path).not.toMatch(
/(?:source|destination|redirect)\s*[:(][^\n]*(?:\/admin|\/admin-next|\/ase-next|\/mod)/,
);
}
});
});