mirror of
https://github.com/devkitshq/notifkit.git
synced 2026-10-19 18:24:52 +02:00
* feat(db): install into a configurable PostgreSQL schema
Add DB_SCHEMA (and dbOptions.schema / createDatabase({ schema }) /
runMigrations(db, { schema })) so notifkit can live in a schema other than
public. Defaults to public, where behaviour is unchanged.
For a custom schema, runMigrations creates the schema, retargets the
bundled migrations at it (rewrites the "public". qualifiers drizzle-kit
emits and sets search_path for the unqualified objects with SET LOCAL,
inside the migration transaction), refuses any migration that still
mentions public afterwards, and keeps the drizzle journal in the same
schema. Afterwards it checks via information_schema that every table of
the package's Drizzle schema exists in the target schema and throws with
the names of any that are missing. createDatabase sets search_path on
every connection.
Add a notifkit-migrate bin (next to notifkit-create-admin) that reads
DATABASE_URL and DB_SCHEMA, applies the migrations, closes the connection
and exits non-zero on failure. The README now uses it for production
migrations instead of drizzle-kit, which ignores DB_SCHEMA, and warns
that switching an existing public install to DB_SCHEMA without moving
its tables first makes it look empty.
Closes #4
* test(db): fix typecheck and lint, move schema tests under tests/
---------
Co-authored-by: Alexander Savchenko <savchenko_av@nlmk.com>
Co-authored-by: coo1estguy <70365929+coolestcodeguy@users.noreply.github.com>
125 lines
3.2 KiB
JSON
125 lines
3.2 KiB
JSON
{
|
|
"name": "notifkit",
|
|
"version": "0.1.11",
|
|
"description": "Self-hosted notification infrastructure. One call delivers to email, SMS, push, and webhook — routed by preference, quiet hours, and consent.",
|
|
"license": "MIT",
|
|
"author": "devkitshq",
|
|
"homepage": "https://notifkit.dev",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/devkitshq/notifkit.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/devkitshq/notifkit/issues"
|
|
},
|
|
"keywords": [
|
|
"notifications",
|
|
"notification-system",
|
|
"email",
|
|
"sms",
|
|
"push-notifications",
|
|
"webhooks",
|
|
"self-hosted",
|
|
"queue",
|
|
"redis-streams",
|
|
"postgres",
|
|
"drizzle",
|
|
"transactional-email",
|
|
"user-preferences",
|
|
"quiet-hours",
|
|
"unsubscribe",
|
|
"multi-tenant",
|
|
"typescript"
|
|
],
|
|
"workspaces": [
|
|
"packages/*"
|
|
],
|
|
"type": "module",
|
|
"main": "dist/index.mjs",
|
|
"types": "dist/index.d.mts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.mts",
|
|
"default": "./dist/index.mjs"
|
|
},
|
|
"./package.json": "./package.json"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"src",
|
|
"drizzle",
|
|
"dashboard/dist",
|
|
"scripts/create-project.mjs",
|
|
"scripts/create-admin.mjs",
|
|
"scripts/migrate.mjs",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"bin": {
|
|
"notifkit-create-project": "./scripts/create-project.mjs",
|
|
"notifkit-create-admin": "./scripts/create-admin.mjs",
|
|
"notifkit-migrate": "./scripts/migrate.mjs"
|
|
},
|
|
"scripts": {
|
|
"build": "tsdown",
|
|
"dev": "tsdown --watch",
|
|
"create-project": "node scripts/create-project.mjs",
|
|
"create-admin": "node scripts/create-admin.mjs",
|
|
"migrate": "node scripts/migrate.mjs",
|
|
"build:dashboard": "npm --prefix dashboard run build",
|
|
"test": "vitest run --coverage",
|
|
"test:watch": "vitest",
|
|
"lint": "eslint . --fix",
|
|
"typecheck": "tsc --noEmit",
|
|
"typecheck:workspaces": "npm run typecheck --workspaces --if-present",
|
|
"prepare": "husky",
|
|
"prepublishOnly": "npm run typecheck && npm run build && npm run typecheck:workspaces && npm run build:dashboard"
|
|
},
|
|
"dependencies": {
|
|
"ai": "^7.0.118",
|
|
"dotenv": "^18.0.4",
|
|
"drizzle-orm": "^0.45.3",
|
|
"ioredis": "^6.0.0",
|
|
"pino": "^10.3.1",
|
|
"pino-pretty": "^13.1.3",
|
|
"postgres": "^3.4.9",
|
|
"prom-client": "^15.1.3",
|
|
"zod": "^4.6.5"
|
|
},
|
|
"devDependencies": {
|
|
"@commitlint/cli": "^19.3.0",
|
|
"@commitlint/config-conventional": "^19.2.2",
|
|
"@testcontainers/postgresql": "^12.0.4",
|
|
"@testcontainers/redis": "^12.0.4",
|
|
"@types/node": "^22.0.0",
|
|
"@types/supertest": "^7.2.1",
|
|
"@typescript-eslint/eslint-plugin": "^8.70.1",
|
|
"@typescript-eslint/parser": "^8.70.1",
|
|
"@vitest/coverage-v8": "^2.0.0",
|
|
"drizzle-kit": "^0.31.11",
|
|
"eslint": "^9.0.0",
|
|
"husky": "^9.0.11",
|
|
"lint-staged": "^15.5.2",
|
|
"prettier": "^3.9.9",
|
|
"supertest": "^7.3.0",
|
|
"testcontainers": "^12.0.4",
|
|
"tsdown": "^0.22.14",
|
|
"typescript": "^5.8.3",
|
|
"vitest": "^2.0.0"
|
|
},
|
|
"lint-staged": {
|
|
"*.{ts,tsx}": [
|
|
"eslint --fix",
|
|
"prettier --write"
|
|
],
|
|
"*.{json,md,yaml,yml}": [
|
|
"prettier --write"
|
|
]
|
|
},
|
|
"engines": {
|
|
"node": ">=22.0.0",
|
|
"npm": ">=10.0.0"
|
|
},
|
|
"packageManager": "npm@10.8.1"
|
|
}
|