chore: add package.json, tsconfig pair, and vitest config
ESM-only, Node 20+, ships pre-compiled dist/. Peer dependency on better-sqlite3 >=11 <13. Dev pins: typescript ^5.5, vitest ^4.0 (resolved to 4.1.6), better-sqlite3 12.6.2 (matches authd). tsconfig.json (noEmit) is the dev/test config; tsconfig.build.json extends it and emits .js + .d.ts to dist/. Relative imports inside src/ use .js extensions so the emitted JS resolves correctly at runtime.
This commit is contained in:
1823
package-lock.json
generated
Normal file
1823
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
42
package.json
Normal file
42
package.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"name": "bchen-sqlite-migrate",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Lightweight SQLite migration runner for better-sqlite3 — numbered SQL files, sha256 checksums, idempotent re-apply, genesis-stamping.",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "module",
|
||||||
|
"main": "./dist/index.js",
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
|
"import": "./dist/index.js"
|
||||||
|
},
|
||||||
|
"./cli": {
|
||||||
|
"types": "./dist/cli.d.ts",
|
||||||
|
"import": "./dist/cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": ["dist", "README.md", "LICENSE"],
|
||||||
|
"engines": { "node": ">=20" },
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc -p tsconfig.build.json",
|
||||||
|
"test": "vitest run",
|
||||||
|
"test:watch": "vitest",
|
||||||
|
"typecheck": "tsc --noEmit"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"better-sqlite3": ">=11 <13"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/better-sqlite3": "^7.6.13",
|
||||||
|
"@types/node": "^22",
|
||||||
|
"better-sqlite3": "12.6.2",
|
||||||
|
"typescript": "^5.5",
|
||||||
|
"vitest": "^4.0.0"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://gitea.bchen.dev/brendan/sqlite-migrate.git"
|
||||||
|
},
|
||||||
|
"keywords": ["sqlite", "migration", "better-sqlite3", "schema-migrations"]
|
||||||
|
}
|
||||||
14
tsconfig.build.json
Normal file
14
tsconfig.build.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": false,
|
||||||
|
"sourceMap": false,
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": "./src",
|
||||||
|
"allowImportingTsExtensions": false
|
||||||
|
},
|
||||||
|
"include": ["src/**/*"],
|
||||||
|
"exclude": ["tests/**/*", "node_modules", "dist"]
|
||||||
|
}
|
||||||
16
tsconfig.json
Normal file
16
tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"lib": ["ES2022"],
|
||||||
|
"strict": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true
|
||||||
|
},
|
||||||
|
"include": ["src/**/*", "tests/**/*"]
|
||||||
|
}
|
||||||
5
vitest.config.ts
Normal file
5
vitest.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: { globals: false, environment: 'node' },
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user