Files
TREK/knip.jsonc
T
Maurice 55607ff2f9 feat(db): move a SQLite install into an empty Postgres database
npm run db:move-to-postgres (dist/move-to-postgres.js in the image) copies
a SQLite file at this build's migration level into an empty Postgres
database. It refuses a file at another level, rows whose references point
at nothing and a target holding any table or plugin schema, creates the
schema with the engine's own bootstrap, then in one transaction copies every
table in foreign key order (setting a self-reference once its rows are in),
converts each value to its column's type and refuses one Postgres cannot
hold exactly, copies each plugin's plugin.db into its schema, moves the
sequences past the copied ids and compares every table's row count and an
order-free checksum over all rows before it commits. A failure drops the
schema again. The SQLite files and the uploads are never written.
2026-11-17 23:03:54 +01:00

92 lines
4.1 KiB
JSON

{
// knip over the three workspaces: unused files, exports, types and
// dependencies. scripts/ci/knip-ratchet.mjs (npm run lint:knip) holds what it
// finds today in scripts/ci/knip-baseline.json and fails on anything new.
// A false positive is fixed here, with the reason, never in the baseline.
"$schema": "https://unpkg.com/knip@6/schema.json",
// plugin-sdk is published on its own with its own lockfile and is not a
// root workspace; its test files would otherwise read as unlisted vitest.
"ignore": ["plugin-sdk/**"],
// test.yml runs `cd server && node --require tsconfig-paths/register`; knip
// resolves the workflow from the root, where server's dependency is not.
"ignoreUnresolved": ["tsconfig-paths/register"],
"workspaces": {
".": {
"entry": ["scripts/ci/*.mjs", "scripts/*.{cjs,mts}"],
"project": ["scripts/**/*.{mjs,cjs,mts}"],
// An optional peer of tsdown, which loads shared/tsdown.config.ts through
// it; nothing imports it by name. eslint and prettier are the workspaces'
// own copies: the shared scripts/lib takes them handed in, and its tests
// import the hoisted ones the server and shared declare. jsdom is here
// only to hold one copy at the root, where vitest's built-in jsdom
// environment resolves it (see the comment in package.json). tsconfig-paths
// is the server's: test.yml loads it with `cd server && node --require`,
// which knip reads from the root, where the server's dependency is not listed.
"ignoreDependencies": ["unrun", "eslint", "prettier", "jsdom", "tsconfig-paths"]
},
"client": {
// The app, the native apps' address screen, its scripts, the Playwright specs and the server launcher
// playwright.config.ts starts (`node e2e/server-launch.mjs`), and the tests.
"entry": [
"src/main.tsx",
// The address screen the native apps ship, its own build (vite.native.config.js).
"native-shell/main.ts",
"scripts/*.mjs",
"e2e/**/*.{ts,mjs}",
"src/**/*.test.{ts,tsx}",
"tests/**/*.{ts,tsx}"
],
"project": [
"src/**/*.{ts,tsx}",
"native-shell/**/*.ts",
"scripts/**/*.mjs",
"tests/**/*.{ts,tsx}",
"e2e/**/*.{ts,mjs}"
]
},
"server": {
"entry": [
"src/index.ts",
"src/bootstrap.ts",
// The move of a SQLite install into Postgres, run by hand (npm run db:move-to-postgres, dist/ in the image).
"src/move-to-postgres.ts",
// Read by the MikroORM CLI and at boot, by path.
"src/mikro-orm.config.ts",
// Started with child_process.fork() by the plugin supervisor (nest/plugins/paths.ts).
"src/nest/plugins/runtime/plugin-host-entry.ts",
// The plugin-author-facing API the forked child exposes; its exported
// types are the contract for plugin code outside this repository.
"src/nest/plugins/runtime/plugin-sdk.ts",
// The release pipeline loads the registration dialect by path
// (scripts/ci/check-registration-dialect.mjs) and runs its SELF_CHECK.
"src/nest/service-identity/registration-dialect.ts",
// Found by the migrator and the seeder through a glob, never imported.
"src/db/migrations/*.ts",
"src/db/seeders/*.ts",
"scripts/**/*.{mjs,cjs,ts}",
"reset-admin.js",
"tests/**/*.ts"
],
"project": ["src/**/*.ts", "scripts/**/*.{mjs,cjs,ts}", "tests/**/*.ts"],
// The MikroORM command line (npx mikro-orm), configured by the
// "mikro-orm" block in server/package.json and never imported.
"ignoreDependencies": ["@mikro-orm/cli"]
},
"shared": {
"entry": [
// The package entry points tsdown builds, one per locale for the lazy chunks.
"src/index.ts",
"src/roadtrip/planning.ts",
"src/sanitize/sanitize.ts",
"src/book/stickers/index.ts",
"src/i18n/index.ts",
"src/i18n/*/index.ts",
// open-request-schemas.d.mts types the .mjs script beside it.
"scripts/*.{mjs,d.mts}",
"src/**/*.spec.ts"
],
"project": ["src/**/*.ts", "scripts/**/*.{mjs,mts}"]
}
}
}