Skip to content

Commit beb294e

Browse files
jleclancheclaude
andcommitted
chore: drop Supabase support and the legacy newsletter package
The fleet has fully moved off Supabase. Remove every Supabase code path, dependency, lint rule, and reference, and delete the newsletter package (superseded by nk-marketing). - newsletter: delete the package entirely; drop refs in READMEs, guide, architecture/db/philosophy docs, CI publint loop, and publish script. - nk-db (breaking, major): resolve the connection from DATABASE_URL only (drop the POSTGRES_URL_NON_POOLING / POSTGRES_URL Supabase fallbacks); remove configureTimestampsAsStrings() and the ./types module (a Supabase-row-types shim — use Drizzle's per-column mode). Reword RLS / coerce / pool / pglite comments to drop Supabase/PostgREST framing. - nk-auth: mark bcryptPassword @deprecated (legacy support only); drop the optional @supabase/supabase-js peer/dev dependency and the "Supabase RLS bridge" description; document the bcrypt->scrypt migration path in the README (dual-format verify + lazy rehash-on-login or a reset campaign). - nk-dev: remove the @supabase/supabase-js no-restricted-imports rule; reword dev/format script comments. - nk-api: reword "PostgREST-style auto API" framing to "auto-generated REST API" in the description, README, and comments. - docs: delete better-auth-migration.md (migration complete); reframe the RLS guidance as the JWT-claims pattern on a direct connection; generalize the vendor-stance reasoning without naming the product. - Migration SQL comments reworded only (DDL byte-identical). Changesets: nk-db major; nk-auth, nk-api, nk-dev, nk-marketing patch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 89268a8 commit beb294e

61 files changed

Lines changed: 299 additions & 1847 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@ingram-tech/nk-api": patch
3+
---
4+
5+
Docs/metadata only: reword the package description, README, and source comments
6+
to describe nk-api as the alternative to an auto-generated REST API rather than
7+
"a PostgREST-style auto API." No code change.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@ingram-tech/nk-auth": patch
3+
---
4+
5+
Mark `bcryptPassword` as **legacy support only** (`@deprecated`): it exists
6+
solely so sites with pre-existing bcrypt hashes keep verifying. New sites should
7+
omit it and use Better Auth's default scrypt. The README's canonical `lib/auth.ts`
8+
no longer wires it, and a new "Migrating bcrypt passwords to scrypt" section
9+
documents the path (a dual-format verifier + lazy rehash-on-login or a reset
10+
campaign; Better Auth has the reset flow natively but no rehash-on-login and no
11+
"must reset" gate). `bcryptPassword` still works — no API change.
12+
13+
Also drops the optional `@supabase/supabase-js` peer dependency (and the
14+
"Supabase RLS bridge" mention in the package description); the fleet is fully off
15+
Supabase, and RLS now lives in `@ingram-tech/nk-db` (`withRls` /
16+
`withRlsTransaction`).

.changeset/nk-db-drop-supabase.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@ingram-tech/nk-db": major
3+
---
4+
5+
Drop Supabase-era compatibility. **Breaking:**
6+
7+
- **Connection string is `DATABASE_URL` only.** The `POSTGRES_URL_NON_POOLING`
8+
and `POSTGRES_URL` fallbacks (the Supabase integration's autopopulated vars)
9+
are no longer read by `getDatabaseUrl` / `dbEnv`. Set `DATABASE_URL`.
10+
- **Removed `configureTimestampsAsStrings()`** (and the `./types` module). It was
11+
a shim for Supabase-generated row types that declared timestamps as `string`.
12+
On the golden path, express this per-column with Drizzle's
13+
`timestamp(..., { mode: "string" })`; the `pgTimestampToIso` /
14+
`pgNumericToNumber` response-boundary coercions remain for strict schemas.
15+
16+
No behavioral change to the pool, RLS helpers, or queries — only doc comments
17+
were reworded to drop Supabase/PostgREST framing.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@ingram-tech/nk-dev": patch
3+
---
4+
5+
Remove the `@supabase/supabase-js` `no-restricted-imports` rule from the tier-b
6+
oxlint config — the fleet no longer uses supabase-js, so the guardrail is moot.
7+
The `pg` `Pool`/`Client` restriction (use `createPool` from nk-db) is unchanged.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@ingram-tech/nk-marketing": patch
3+
---
4+
5+
Docs/comments only: drop the "successor to `@ingram-tech/newsletter` (which was
6+
Supabase-bound)" framing from the README and migration header, and remove the
7+
stale reference to nk-db's removed `configureTimestampsAsStrings` helper. No code
8+
change.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
- name: Lint & format check
1818
run: bun run check
1919
# Build before type-check: packages whose deps resolve to built workspace
20-
# types (e.g. newsletter → email's dist/*.d.ts) need dist to exist first.
21-
# check runs first on the clean tree, so oxlint never sees dist/.
20+
# types (e.g. nk-marketingnk-email's dist/*.d.ts) need dist to exist
21+
# first. check runs first on the clean tree, so oxlint never sees dist/.
2222
- name: Build
2323
run: bun run build
2424
# Catches malformed exports / types / files fields before they ship — the
2525
# class of packaging bug that only surfaces on `npm install` in a real app.
2626
- name: Check package publishing (publint)
2727
run: |
28-
for dir in packages/email packages/bot-protection packages/newsletter; do
28+
for dir in packages/nk-email packages/bot-protection; do
2929
bunx publint "$dir"
3030
done
3131
- name: Type-check

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Read **[docs/philosophy.md](./docs/philosophy.md)** for the full reasoning.
3030
| [`@ingram-tech/nk-api`](./packages/nk-api) | Typed API toolkit: Hono + zod-openapi router, auth/scope guards, cursor pagination, and a typed client — mounts into a Next.js route |
3131
| [`@ingram-tech/nk-i18n`](./packages/nk-i18n) | Lightweight i18n: `intl-messageformat` formatting, Accept-Language negotiation, and React client helpers |
3232
| [`@ingram-tech/nk-marketing`](./packages/nk-marketing) | Postgres-backed marketing & lifecycle email: contacts + consent, newsletter audiences (broadcast), and idempotent triggered campaigns, with RFC 8058 one-click unsubscribe |
33-
| [`@ingram-tech/newsletter`](./packages/newsletter) | **Deprecated**`nk-marketing`. Supabase-backed newsletter subscriptions + sending |
3433

3534
More to come (blog). See [docs/](./docs/README.md).
3635

bun.lock

Lines changed: 3 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ with the philosophy, then dip into specifics as needed.
1717
- **[db-package.md](./db-package.md)** — the `@ingram-tech/nk-db` plan: the shared
1818
Postgres pool, Drizzle, and the PGlite dev/test harness (`nk dev`).
1919
- **[marketing.md](./marketing.md)**`@ingram-tech/nk-marketing`: contacts +
20-
consent, newsletter broadcasts, and idempotent lifecycle/triggered email; the
21-
Postgres successor to `@ingram-tech/newsletter`.
22-
- **[better-auth-migration.md](./better-auth-migration.md)** — moving the fleet
23-
from Supabase Auth to Better Auth. The RLS-bridge path here now applies to the
24-
remaining Supabase-Postgres holdouts; migrated apps went to DO Postgres
25-
outright.
20+
consent, newsletter broadcasts, and idempotent lifecycle/triggered email.
2621
- **[creating-a-package.md](./creating-a-package.md)** — checklist for new
2722
packages.
2823
- **[releasing.md](./releasing.md)** — versioning + npm Trusted Publishing flow.

docs/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ nextkit/
3535
and the `nk` CLI (`bin` + `lib`). No build step. `nk init` scaffolds a site.
3636
See [`philosophy.md`](./philosophy.md) for why dev-time config is one bundle
3737
while runtime stays vertical slices.
38-
- **Runtime packages** (`email`, `nk-db`, `nk-auth`, `nk-billing`, `nk-api`,
39-
`nk-i18n`, `bot-protection`, `newsletter`): ship compiled JS + `.d.ts` from
38+
- **Runtime packages** (`nk-email`, `nk-db`, `nk-auth`, `nk-billing`, `nk-api`,
39+
`nk-i18n`, `bot-protection`, `nk-marketing`): ship compiled JS + `.d.ts` from
4040
`src/`, built with `tsc`. These stay separate and peer-depend on
4141
`next`/`react`.
4242

@@ -75,7 +75,7 @@ feel it first.
7575
tags (`changeset tag`).
7676
- **Publishing does not use `changeset publish`.** It shells out to `npm
7777
publish`, which can't resolve bun's `workspace:` protocol, so a package with a
78-
*runtime* workspace dep (e.g. newsletter → nk-email) would ship an
78+
*runtime* workspace dep (e.g. nk-marketing → nk-email) would ship an
7979
uninstallable `workspace:^` range. `scripts/publish.ts` resolves those ranges
8080
from each package's `package.json` version — the source of truth, immune to a
8181
stale `bun.lock` — and refuses to publish anything still carrying a

0 commit comments

Comments
 (0)