docs: complete housekeeping migration matrix
This commit is contained in:
1 parent
9b7d5de12f
commit
3b3d7780c9
6 files changed
+634
-1
No files matched your search
+2
-1
@@ -21,7 +21,8 @@
|
|||||||
"db:generate": "drizzle-kit generate",
|
"db:generate": "drizzle-kit generate",
|
||||||
"db:migrate": "tsx scripts/apply-migrations.ts",
|
"db:migrate": "tsx scripts/apply-migrations.ts",
|
||||||
"db:migrate:status": "tsx scripts/apply-migrations.ts --status",
|
"db:migrate:status": "tsx scripts/apply-migrations.ts --status",
|
||||||
"db:studio": "drizzle-kit studio"
|
"db:studio": "drizzle-kit studio",
|
||||||
|
"hk:matrix:check": "tsx scripts/verify-housekeeping-matrix.ts"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{js,ts,jsx,tsx,json}": "biome check --write --no-errors-on-unmatched"
|
"*.{js,ts,jsx,tsx,json}": "biome check --write --no-errors-on-unmatched"
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { discoverLegacyPages } from "../src/features/housekeeping/migration/discover-legacy-pages";
|
||||||
|
import { HOUSEKEEPING_MIGRATION_MATRIX } from "../src/features/housekeeping/migration/matrix";
|
||||||
|
import { validateMigrationEntries } from "../src/features/housekeeping/migration/validate-matrix";
|
||||||
|
|
||||||
|
const discovered = discoverLegacyPages();
|
||||||
|
const issues = validateMigrationEntries(
|
||||||
|
discovered,
|
||||||
|
HOUSEKEEPING_MIGRATION_MATRIX,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (issues.length > 0) {
|
||||||
|
for (const issue of issues) console.error(issue);
|
||||||
|
process.exitCode = 1;
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
`Housekeeping migration matrix: ${HOUSEKEEPING_MIGRATION_MATRIX.length}/${discovered.length} valid`,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { discoverLegacyPages } from "./discover-legacy-pages";
|
||||||
|
import { HOUSEKEEPING_MIGRATION_MATRIX } from "./matrix";
|
||||||
|
import { validateMigrationEntries } from "./validate-matrix";
|
||||||
|
|
||||||
|
describe("HOUSEKEEPING_MIGRATION_MATRIX", () => {
|
||||||
|
it("covers all 137 legacy pages exactly once", () => {
|
||||||
|
const discovered = discoverLegacyPages();
|
||||||
|
|
||||||
|
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(137);
|
||||||
|
expect(
|
||||||
|
validateMigrationEntries(discovered, HOUSEKEEPING_MIGRATION_MATRIX),
|
||||||
|
).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("contains no undecided evidence markers", () => {
|
||||||
|
expect(JSON.stringify(HOUSEKEEPING_MIGRATION_MATRIX)).not.toMatch(
|
||||||
|
/TBD|TODO|FIXME|UNCLASSIFIED/,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("is sorted by legacy path", () => {
|
||||||
|
expect(HOUSEKEEPING_MIGRATION_MATRIX.map((row) => row.legacyPath)).toEqual(
|
||||||
|
[...HOUSEKEEPING_MIGRATION_MATRIX.map((row) => row.legacyPath)].sort(
|
||||||
|
(a, b) => a.localeCompare(b),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { contentMigrationEntries } from "./content";
|
||||||
|
import { economyMigrationEntries } from "./economy";
|
||||||
|
import { hotelMigrationEntries } from "./hotel";
|
||||||
|
import { operationsMigrationEntries } from "./operations";
|
||||||
|
import { peopleMigrationEntries } from "./people";
|
||||||
|
import { systemMigrationEntries } from "./system";
|
||||||
|
|
||||||
|
export const HOUSEKEEPING_MIGRATION_MATRIX = [
|
||||||
|
...operationsMigrationEntries,
|
||||||
|
...peopleMigrationEntries,
|
||||||
|
...contentMigrationEntries,
|
||||||
|
...economyMigrationEntries,
|
||||||
|
...hotelMigrationEntries,
|
||||||
|
...systemMigrationEntries,
|
||||||
|
].sort((a, b) => a.legacyPath.localeCompare(b.legacyPath));
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user