diff --git a/.changeset/adapter-package-split.md b/.changeset/adapter-package-split.md index e5cb460f7..4117728bc 100644 --- a/.changeset/adapter-package-split.md +++ b/.changeset/adapter-package-split.md @@ -7,7 +7,7 @@ Split the Drizzle and Supabase integrations into their own packages. The adapters now ship as first-party packages that depend on `@cipherstash/stack`, -following the `@cipherstash/prisma-next` precedent: +following the `@cipherstash/stack-prisma` precedent: - **`@cipherstash/stack-drizzle`** — EQL v3 Drizzle integration on the package root (`types` factories, `createEncryptionOperators`, diff --git a/.changeset/config.json b/.changeset/config.json index 2bacd138c..fb05a4c16 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,7 +8,7 @@ "@cipherstash/stack", "@cipherstash/stack-drizzle", "@cipherstash/stack-supabase", - "@cipherstash/prisma-next", + "@cipherstash/stack-prisma", "@cipherstash/wizard" ] ], diff --git a/.changeset/encryption-schema-arrays.md b/.changeset/encryption-schema-arrays.md index c3cbb5f39..d2b1e829d 100644 --- a/.changeset/encryption-schema-arrays.md +++ b/.changeset/encryption-schema-arrays.md @@ -1,6 +1,6 @@ --- '@cipherstash/stack': minor -'@cipherstash/prisma-next': patch +'@cipherstash/stack-prisma': patch --- `Encryption({ schemas })` now accepts any non-empty array of EQL v3 tables, not diff --git a/.changeset/eql-baked-digest-verified.md b/.changeset/eql-baked-digest-verified.md index 1e7b239d5..b370a17bf 100644 --- a/.changeset/eql-baked-digest-verified.md +++ b/.changeset/eql-baked-digest-verified.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor --- Bake the EQL v3 install SQL into the migration artefacts at emit time, diff --git a/.changeset/eql-v3-prisma-next.md b/.changeset/eql-v3-prisma-next.md index 40d4564c0..93f3f2c82 100644 --- a/.changeset/eql-v3-prisma-next.md +++ b/.changeset/eql-v3-prisma-next.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor --- **Breaking:** EQL v3 columns are now authored through **concrete per-domain constructors** — the constructor you choose *is* the capability set. The legacy boolean-option surface (`EncryptedString({ equality, freeTextSearch, orderAndRange })`) is not carried into v3. @@ -11,7 +11,7 @@ - `EncryptedJson` — searchable encrypted JSONB (`public.eql_v3_json`, `ste_vec`), queried with `eqlJsonContains` (`@>` containment). Selector querying (comparing the value at a JSONPath) is tracked in #677. - **Impossible capability combinations have no constructor** (e.g. text equality + free-text without order/range) — they are unrepresentable, not runtime errors. - **BigInt is a first-class v3 family** (`EncryptedBigInt` / `EncryptedBigIntEq` / `EncryptedBigIntOrd`, JS `bigint` plaintext, backed by `public.eql_v3_bigint*`). -- New `@cipherstash/prisma-next/v3` entry point: `cipherstashFromStackV3({ contractJson })` builds the v3 runtime descriptor, bulk-encrypt middleware, and a stack `Encryption` client from the emitted contract. +- New `@cipherstash/stack-prisma/v3` entry point: `cipherstashFromStackV3({ contractJson })` builds the v3 runtime descriptor, bulk-encrypt middleware, and a stack `Encryption` client from the emitted contract. - Query operators use an **EQL-derived vocabulary** (`eqlEq`, `eqlNeq`, `eqlIn`, `eqlNotIn`, `eqlGt`, `eqlGte`, `eqlLt`, `eqlLte`, `eqlBetween`, `eqlNotBetween`, `eqlJsonContains`; ordering via `eqlAsc` / `eqlDesc`), lowering to the same-named `eql_v3.*` functions with operands cast to the domain's query type (`$n::eql_v3.query_`); ordering uses `eql_v3.ord_term` / `eql_v3.ord_term_ore` by the column's ordering flavour. The domains are `public.eql_v3_*`; the operator functions live in the `eql_v3` schema. - Free-text search is **`eqlMatch`** — fuzzy bloom token matching (`eql_v3.contains`), deliberately NOT named after SQL `ILIKE`: matching is case-insensitive, order/multiplicity-insensitive, and one-sided (may false-positive). Two guards run before encryption: SQL wildcards are normalised (leading/trailing `%` stripped; interior `%` or any `_` rejected), and needles the column's match index cannot answer (empty / below the tokenizer length) are rejected via the shared `matchNeedleError` guard. There is **no negated match operator** — negating a may-false-positive bloom test would silently drop matching rows. - A new baseline migration `20260601T0100_install_eql_v3_bundle` (invariant `cipherstash:install-eql-v3-bundle-v1`) installs the `public.eql_v3_*` domains and `eql_v3.*` functions from the pinned `@cipherstash/eql` release. Regenerate contracts and run migrations after changing constructors. diff --git a/.changeset/pre.json b/.changeset/pre.json index b874a8b82..89dab5375 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -4,13 +4,13 @@ "initialVersions": { "@cipherstash/e2e": "0.0.2", "@cipherstash/basic-example": "1.2.13", - "@cipherstash/prisma-next-example": "0.0.5", + "@cipherstash/prisma-example": "0.0.5", "@cipherstash/supabase-worker-example": "0.0.0", "@cipherstash/bench": "0.0.4", "stash": "0.17.1", "@cipherstash/migrate": "0.2.0", "@cipherstash/nextjs": "4.1.1", - "@cipherstash/prisma-next": "0.3.2", + "@cipherstash/stack-prisma": "0.3.2", "@cipherstash/stack": "0.19.0", "@cipherstash/stack-drizzle": "0.0.0", "@cipherstash/stack-supabase": "0.0.0", @@ -75,8 +75,8 @@ "stash-cli-skill-refresh", "stash-drizzle-skill-encrypt-query", "stash-env-mint-credentials", - "stash-prisma-next-skill-v3-only", - "stash-prisma-next-skill", + "stash-prisma-skill-v3-only", + "stash-prisma-skill", "stash-skills-contains-to-matches", "stash-supabase-contains-substrings", "supabase-encryption-error", diff --git a/.changeset/prisma-example-eql-v3.md b/.changeset/prisma-example-eql-v3.md index c5b55055d..3268a0955 100644 --- a/.changeset/prisma-example-eql-v3.md +++ b/.changeset/prisma-example-eql-v3.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next-example': minor +'@cipherstash/prisma-example': minor --- Convert the example app to EQL v3. Every column is now a concrete `public.eql_v3_*` domain authored with the per-domain constructors (`EncryptedTextSearch`, `EncryptedDoubleOrd`, `EncryptedBigIntOrd`, `EncryptedDateOrd`, `EncryptedBoolean`, `EncryptedJson`), wired through `cipherstashFromStackV3({ contractJson })`. The e2e harness runs the full v3 surface against live Postgres + ZeroKMS with no skips: the `eql*` operator vocabulary (equality/range plus `eqlMatch` free-text token search), `eqlAsc`/`eqlDesc` order-term sorting, encrypted JSON containment (`eqlJsonContains` — the v2 `cipherstashJsonb*` helpers do not exist in v3), lossless `bigint` beyond `Number.MAX_SAFE_INTEGER`, and the storage-only `eql_v3_boolean` refusal (`EncryptionOperatorError`) pinned as a feature. Migrations regenerate from the v3 contract: the initial app migration creates the `users` table against the v3 domains with zero `add_search_config` ops, and the cipherstash space carries both bundle baselines (v2 + v3). diff --git a/.changeset/prisma-next-0-14.md b/.changeset/prisma-next-0-14.md index f1ad6d5a5..e3eb71a8a 100644 --- a/.changeset/prisma-next-0-14.md +++ b/.changeset/prisma-next-0-14.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor --- Upgrade to Prisma Next 0.14.0 (from 0.8.0). Every `@prisma-next/*` dependency is now pinned at 0.14.0; consuming apps must run Prisma Next 0.14 to use this release. diff --git a/.changeset/prisma-next-0-16.md b/.changeset/prisma-next-0-16.md index b025f3aed..7ddbff997 100644 --- a/.changeset/prisma-next-0-16.md +++ b/.changeset/prisma-next-0-16.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor 'stash': patch --- @@ -24,7 +24,7 @@ contract: prismaContract('./prisma/schema.prisma', { ``` Without it, `prisma-next contract emit` fails at runtime with `createNamespace is -not a function`. The bundled `stash-prisma-next` skill documents this too. +not a function`. The bundled `stash-prisma` skill documents this too. The bundled EQL v3 baseline migration is re-emitted so its label and hash reflect the pinned `@cipherstash/eql` 3.0.2 (the committed artifact still said 3.0.0). diff --git a/.changeset/prisma-next-drop-encrypted-prefix.md b/.changeset/prisma-next-drop-encrypted-prefix.md index 50624bcac..ff211ec37 100644 --- a/.changeset/prisma-next-drop-encrypted-prefix.md +++ b/.changeset/prisma-next-drop-encrypted-prefix.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor 'stash': patch --- @@ -22,5 +22,5 @@ Unchanged: the runtime value envelopes (`EncryptedString`, `EncryptedNumber`, `eql*` query operators. The legacy v2 constructors are removed elsewhere in this release. -The `stash-prisma-next` skill is updated to the new names (skills ship in the +The `stash-prisma` skill is updated to the new names (skills ship in the `stash` tarball). diff --git a/.changeset/prisma-next-eql-runtime-source.md b/.changeset/prisma-next-eql-runtime-source.md index bf61040f0..05f5e8f69 100644 --- a/.changeset/prisma-next-eql-runtime-source.md +++ b/.changeset/prisma-next-eql-runtime-source.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor --- Source the EQL v3 install SQL from `@cipherstash/eql` at runtime instead of diff --git a/.changeset/prisma-next-joins-release-train.md b/.changeset/prisma-next-joins-release-train.md index fe9c35e4b..fa2998807 100644 --- a/.changeset/prisma-next-joins-release-train.md +++ b/.changeset/prisma-next-joins-release-train.md @@ -1,8 +1,8 @@ --- -'@cipherstash/prisma-next': patch +'@cipherstash/stack-prisma': patch --- -`@cipherstash/prisma-next` now versions in lockstep with the Stack release +`@cipherstash/stack-prisma` now versions in lockstep with the Stack release train (`stash`, `@cipherstash/stack`, and the other adapters) via a Changesets `fixed` group — `stash init` installs it pinned by exact version, so the two must always release together. This moves the package from its previous `0.4.x` diff --git a/.changeset/prisma-next-migrate-command.md b/.changeset/prisma-next-migrate-command.md index 72f2fd098..a8e583c76 100644 --- a/.changeset/prisma-next-migrate-command.md +++ b/.changeset/prisma-next-migrate-command.md @@ -1,13 +1,13 @@ --- 'stash': patch -'@cipherstash/prisma-next': patch +'@cipherstash/stack-prisma': patch --- Fix the wrong `prisma-next migration apply` command name in the Prisma Next guidance. Prisma Next has no `migration apply` subcommand — the apply verb is the top-level `prisma-next migrate` (`migration` only has `plan`/`new`/`show`/ `status`/`log`/`list`/`graph`/`check`). The stale name appeared in the -`stash-prisma-next` and `stash-cli` skills, the `@cipherstash/prisma-next` +`stash-prisma` and `stash-cli` skills, the `@cipherstash/stack-prisma` README, and — user-visibly — in `stash init --prisma-next`'s printed next-steps, the `stash init` flag help, and the `stash eql install` Prisma-Next refusal message, all of which now say `prisma-next migrate`. Surfaced by the rc.4 diff --git a/.changeset/prisma-next-skill-accuracy.md b/.changeset/prisma-next-skill-accuracy.md index e7930e811..b72d319c5 100644 --- a/.changeset/prisma-next-skill-accuracy.md +++ b/.changeset/prisma-next-skill-accuracy.md @@ -2,10 +2,10 @@ 'stash': patch --- -Correct the `stash-prisma-next` skill against the current adapter, and fix a +Correct the `stash-prisma` skill against the current adapter, and fix a stale constructor name in `stash init --prisma-next`'s next steps. -The skill was verified line-by-line against `@cipherstash/prisma-next` on +The skill was verified line-by-line against `@cipherstash/stack-prisma` on main (constructors, domains, operators, `rawSql` shape, EQL function names, CLI commands — all confirmed current). Two real errors fixed: diff --git a/.changeset/prisma-next-v3-client-config.md b/.changeset/prisma-next-v3-client-config.md index 4a6aa723e..3d206f992 100644 --- a/.changeset/prisma-next-v3-client-config.md +++ b/.changeset/prisma-next-v3-client-config.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': major +'@cipherstash/stack-prisma': major --- **Breaking:** `CipherstashFromStackV3Options.encryptionConfig` — the config diff --git a/.changeset/prisma-next-v3-only-install.md b/.changeset/prisma-next-v3-only-install.md index 9c9eb7c8e..4625f1222 100644 --- a/.changeset/prisma-next-v3-only-install.md +++ b/.changeset/prisma-next-v3-only-install.md @@ -1,8 +1,8 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor --- -Make `@cipherstash/prisma-next` **EQL v3 only**. The EQL v2 surface is removed +Make `@cipherstash/stack-prisma` **EQL v3 only**. The EQL v2 surface is removed entirely — install path, authoring constructors, runtime codecs, and the v2 subpath exports. diff --git a/.changeset/protect-ffi-030-json-selectors.md b/.changeset/protect-ffi-030-json-selectors.md index abc38f637..8019db961 100644 --- a/.changeset/protect-ffi-030-json-selectors.md +++ b/.changeset/protect-ffi-030-json-selectors.md @@ -2,7 +2,7 @@ '@cipherstash/stack': minor '@cipherstash/stack-drizzle': minor '@cipherstash/stack-supabase': patch -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor 'stash': patch --- diff --git a/.changeset/release-train-coupling.md b/.changeset/release-train-coupling.md index dffd05790..a47c4ae21 100644 --- a/.changeset/release-train-coupling.md +++ b/.changeset/release-train-coupling.md @@ -16,7 +16,7 @@ be offered the reinstall fix, never "looks newer, leave it"). **Version lockstep.** The release-train packages (`stash`, `@cipherstash/stack`, `@cipherstash/stack-drizzle`, -`@cipherstash/stack-supabase`, `@cipherstash/prisma-next`, +`@cipherstash/stack-supabase`, `@cipherstash/stack-prisma`, `@cipherstash/wizard`) are now a Changesets `fixed` group: a release of any of them republishes all of them at the same version, so the CLI's embedded version map can never go stale against the packages it pins (previously a diff --git a/.changeset/rename-packages-1-0.md b/.changeset/rename-packages-1-0.md new file mode 100644 index 000000000..9cf9e12b2 --- /dev/null +++ b/.changeset/rename-packages-1-0.md @@ -0,0 +1,17 @@ +--- +'@cipherstash/stack-prisma': minor +'@cipherstash/wizard': patch +'stash': minor +--- + +Renamed `@cipherstash/prisma-next` to **`@cipherstash/stack-prisma`** (#842), +matching the `@cipherstash/stack-drizzle` / `@cipherstash/stack-supabase` +adapter naming. Only the npm name changes: the `prisma-next` CLI, +`prisma-next.config.ts`, and the `@prisma-next/*` framework packages are the +Prisma Next framework's own surface and keep their names. Update imports +(`@cipherstash/prisma-next/stack` → `@cipherstash/stack-prisma/stack`, and the +other subpaths likewise) and the `extensionPacks` import in +`prisma-next.config.ts`. + +`stash init` and the bundled skills now install and document the new name; the +`stash-prisma-next` skill is now `stash-prisma`. diff --git a/.changeset/stack-logger-edge-safe.md b/.changeset/stack-logger-edge-safe.md index c84c0d97e..0d1435bde 100644 --- a/.changeset/stack-logger-edge-safe.md +++ b/.changeset/stack-logger-edge-safe.md @@ -6,6 +6,6 @@ The shared logger read `process.env.STASH_STACK_LOG` unguarded while initialising at module scope, so importing adapter-kit — which re-exports that logger — threw `ReferenceError: process is not defined` before any user code ran. The environment read is now guarded. -This is not a single-adapter fix. `@cipherstash/stack-supabase`, `@cipherstash/stack-drizzle` and `@cipherstash/prisma-next` all value-import `@cipherstash/stack/adapter-kit`, so edge users of all three hit the same import-time throw, and all three are fixed by this release. +This is not a single-adapter fix. `@cipherstash/stack-supabase`, `@cipherstash/stack-drizzle` and `@cipherstash/stack-prisma` all value-import `@cipherstash/stack/adapter-kit`, so edge users of all three hit the same import-time throw, and all three are fixed by this release. **No behaviour change on Node.** `STASH_STACK_LOG`, its accepted values (`debug` / `info` / `error`), its `error` default, and the point at which the logger is configured are all unchanged. diff --git a/.changeset/stash-indexing-skill.md b/.changeset/stash-indexing-skill.md index 6303d9d64..a64ff23fa 100644 --- a/.changeset/stash-indexing-skill.md +++ b/.changeset/stash-indexing-skill.md @@ -19,5 +19,5 @@ during an encryption rollout (after backfill, before switching reads). prompt — now install it for **every** integration (Drizzle, Supabase, Prisma Next, plain PostgreSQL) — the gap is cross-cutting. The existing per-integration skills gained pointers to it (including the -missing `stash-prisma-next` one-line purpose in the setup prompt, which +missing `stash-prisma` one-line purpose in the setup prompt, which previously rendered "(no description)"). diff --git a/.changeset/stash-prisma-next-skill-v3-only.md b/.changeset/stash-prisma-next-skill-v3-only.md index 4e2bd8f71..56c5ae66c 100644 --- a/.changeset/stash-prisma-next-skill-v3-only.md +++ b/.changeset/stash-prisma-next-skill-v3-only.md @@ -2,7 +2,7 @@ 'stash': patch --- -Update the bundled `stash-prisma-next` skill for the EQL v3-only -`@cipherstash/prisma-next`: drop the stale references to the removed EQL v2 +Update the bundled `stash-prisma` skill for the EQL v3-only +`@cipherstash/stack-prisma`: drop the stale references to the removed EQL v2 surface (`cipherstashFromStackV2`, the `cipherstash*` operators, the "legacy v2" subpath note) so the guidance copied into customer repos matches the package. diff --git a/.changeset/stash-prisma-next-skill.md b/.changeset/stash-prisma-next-skill.md index a1617d521..6c5060efa 100644 --- a/.changeset/stash-prisma-next-skill.md +++ b/.changeset/stash-prisma-next-skill.md @@ -11,7 +11,7 @@ degrades an unmapped integration to the base skill set instead of crashing (`tsup` ships without type-checking, so the `Record` type alone didn't protect the build). -Ships a new **`stash-prisma-next`** agent skill documenting the EQL v3 Prisma +Ships a new **`stash-prisma`** agent skill documenting the EQL v3 Prisma Next surface — the domain-named encrypted column types (`EncryptedTextSearch`, `EncryptedDoubleOrd`, …), `cipherstashFromStackV3` wiring, the runtime value envelopes, the `eql*` query operators, and EQL installation via diff --git a/.changeset/v3-only-config-typing-and-entry-parity.md b/.changeset/v3-only-config-typing-and-entry-parity.md index 6f5822aa6..2a4faf31f 100644 --- a/.changeset/v3-only-config-typing-and-entry-parity.md +++ b/.changeset/v3-only-config-typing-and-entry-parity.md @@ -1,6 +1,6 @@ --- '@cipherstash/stack': major -'@cipherstash/prisma-next': patch +'@cipherstash/stack-prisma': patch 'stash': patch --- diff --git a/.changeset/v3-only-encryption-client.md b/.changeset/v3-only-encryption-client.md index f6ab4e055..3b3a60472 100644 --- a/.changeset/v3-only-encryption-client.md +++ b/.changeset/v3-only-encryption-client.md @@ -1,7 +1,7 @@ --- '@cipherstash/stack': major '@cipherstash/stack-supabase': major -'@cipherstash/prisma-next': major +'@cipherstash/stack-prisma': major 'stash': patch --- diff --git a/.changeset/v3-payload-routing.md b/.changeset/v3-payload-routing.md index 22ee70a44..c3056d99f 100644 --- a/.changeset/v3-payload-routing.md +++ b/.changeset/v3-payload-routing.md @@ -1,5 +1,5 @@ --- -'@cipherstash/prisma-next': minor +'@cipherstash/stack-prisma': minor --- Route v3 decoding from the EQL payload's own identifier, so encrypted columns diff --git a/.github/workflows/integration-prisma-next.yml b/.github/workflows/integration-prisma-next.yml index 6b7e19134..35544513c 100644 --- a/.github/workflows/integration-prisma-next.yml +++ b/.github/workflows/integration-prisma-next.yml @@ -19,7 +19,7 @@ on: branches: [main] paths: - 'packages/stack/src/eql/v3/**' - - 'packages/prisma-next/**' + - 'packages/stack-prisma/**' # Source layers the adapter's encoding/round-trip rests on: a break here # (not just under src/eql/v3) can produce wrong rows, so trigger the live # suite that would catch it. @@ -38,7 +38,7 @@ on: # Repeated verbatim: GitHub Actions does not support YAML anchors/aliases. paths: - 'packages/stack/src/eql/v3/**' - - 'packages/prisma-next/**' + - 'packages/stack-prisma/**' # Source layers the adapter's encoding/round-trip rests on: a break here # (not just under src/eql/v3) can produce wrong rows, so trigger the live # suite that would catch it. @@ -114,7 +114,7 @@ jobs: # `stash eql install --eql-version 3`, so an installer regression fails # here rather than hiding behind a test-only SQL apply. - name: prisma-next v3 family suites - run: pnpm exec turbo run test:integration --filter @cipherstash/prisma-next --env-mode=loose + run: pnpm exec turbo run test:integration --filter @cipherstash/stack-prisma --env-mode=loose env: # Step env, not a `.env` file: `dotenv/config` does not override an # already-set `process.env`, so these win and no secret hits disk. diff --git a/.github/workflows/prisma-example-readme-e2e.yml b/.github/workflows/prisma-example-readme-e2e.yml index 0a5a0c2d0..5df2dc58f 100644 --- a/.github/workflows/prisma-example-readme-e2e.yml +++ b/.github/workflows/prisma-example-readme-e2e.yml @@ -75,12 +75,12 @@ jobs: client-key: ${{ secrets.CS_CLIENT_KEY }} client-access-key: ${{ secrets.CS_CLIENT_ACCESS_KEY }} - # Build via turbo so `^build` on `@cipherstash/prisma-next` and + # Build via turbo so `^build` on `@cipherstash/stack-prisma` and # its `@cipherstash/stack` peer is honoured. The test's # `pnpm install` subprocess inside `examples/prisma/` is a no-op # given the lockfile is already in steady state from this step. - - name: Build @cipherstash/prisma-next - run: pnpm exec turbo run build --filter @cipherstash/prisma-next + - name: Build @cipherstash/stack-prisma + run: pnpm exec turbo run build --filter @cipherstash/stack-prisma - name: Run README walkthrough e2e run: pnpm exec turbo run test:e2e --filter @cipherstash/e2e -- --run tests/prisma-example-readme.e2e.test.ts diff --git a/.github/workflows/prisma-next-e2e.yml b/.github/workflows/prisma-next-e2e.yml index 4bccc8dd4..74f4c9552 100644 --- a/.github/workflows/prisma-next-e2e.yml +++ b/.github/workflows/prisma-next-e2e.yml @@ -1,6 +1,6 @@ name: Prisma Next E2E -# End-to-end tests for `@cipherstash/prisma-next`: spins up a real +# End-to-end tests for `@cipherstash/stack-prisma`: spins up a real # Postgres container, applies the cipherstash baseline migration # (EQL bundle install) + the example app's schema, then runs the # suite at `examples/prisma/test/e2e/` against a live ZeroKMS @@ -15,14 +15,14 @@ on: branches: - main paths: - - 'packages/prisma-next/**' + - 'packages/stack-prisma/**' - 'examples/prisma/**' - '.github/workflows/prisma-next-e2e.yml' pull_request: branches: - '**' paths: - - 'packages/prisma-next/**' + - 'packages/stack-prisma/**' - 'examples/prisma/**' - '.github/workflows/prisma-next-e2e.yml' @@ -95,16 +95,16 @@ jobs: echo "CS_CLIENT_ACCESS_KEY=${{ secrets.CS_CLIENT_ACCESS_KEY }}" >> ./examples/prisma/.env # Build via turbo so the `^build` dependency on - # `@cipherstash/stack` (which `@cipherstash/prisma-next` imports + # `@cipherstash/stack` (which `@cipherstash/stack-prisma` imports # `/schema` from) is honoured. A bare - # `pnpm --filter @cipherstash/prisma-next build` bypasses the + # `pnpm --filter @cipherstash/stack-prisma build` bypasses the # task graph and leaves the upstream dist/ empty, surfacing as # `Cannot find module '@cipherstash/stack/schema'` from tsc. - - name: Build @cipherstash/prisma-next - run: pnpm exec turbo run build --filter @cipherstash/prisma-next + - name: Build @cipherstash/stack-prisma + run: pnpm exec turbo run build --filter @cipherstash/stack-prisma - name: Emit example contract - run: pnpm --filter @cipherstash/prisma-next-example emit + run: pnpm --filter @cipherstash/prisma-example emit - name: Start E2E Postgres container working-directory: examples/prisma @@ -121,7 +121,7 @@ jobs: done - name: Run E2E suite - run: pnpm exec turbo run test:e2e --filter @cipherstash/prisma-next-example --env-mode=loose + run: pnpm exec turbo run test:e2e --filter @cipherstash/prisma-example --env-mode=loose - name: Stop E2E Postgres container if: always() diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4a656554d..59a1fa64c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -134,7 +134,7 @@ jobs: # Its tsconfig resolves stack subpaths to SOURCE, so no build step is # needed first. - name: Typecheck (prisma-next — enforces v3 operator-capability gating) - run: pnpm --filter @cipherstash/prisma-next run typecheck + run: pnpm --filter @cipherstash/stack-prisma run typecheck # `packages/bench` is a live importer of `@cipherstash/stack` and # `@cipherstash/stack-drizzle`, but it has no `test` script (its suites @@ -181,7 +181,7 @@ jobs: run: pnpm exec turbo run typecheck --filter @cipherstash/nextjs - name: Typecheck (examples/prisma — guards the prisma-next importers) - run: pnpm exec turbo run typecheck --filter @cipherstash/prisma-next-example + run: pnpm exec turbo run typecheck --filter @cipherstash/prisma-example - name: Typecheck (e2e) run: pnpm exec turbo run typecheck --filter @cipherstash/e2e diff --git a/AGENTS.md b/AGENTS.md index 27c1f749b..3c64c93a7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -76,7 +76,7 @@ If these variables are missing, tests that require live encryption will fail or - `packages/cli`: The `stash` CLI — auth, init, encryption schema, and database setup (`stash eql install`). Has its own `AGENTS.md`. - `packages/wizard`: AI-powered encryption setup (`@cipherstash/wizard`) - `packages/migrate`: Plaintext-to-encrypted column migration (`@cipherstash/migrate`) — resumable backfill, per-column state -- `packages/prisma-next`: Prisma Next integration (`@cipherstash/prisma-next`) — searchable field-level encryption for Postgres. **EQL v3 only**: per-domain constructors (`cipherstash.TextSearch()` / `text()` / `bigIntOrd()` / …) and `cipherstashFromStack` (the `./v3` and `./stack` entries). The EQL v2 surface was removed — the adapter's baseline migration installs the EQL v3 bundle only (works on Supabase as a non-superuser) +- `packages/stack-prisma`: Prisma Next integration (`@cipherstash/stack-prisma`) — searchable field-level encryption for Postgres. **EQL v3 only**: per-domain constructors (`cipherstash.TextSearch()` / `text()` / `bigIntOrd()` / …) and `cipherstashFromStack` (the `./v3` and `./stack` entries). The EQL v2 surface was removed — the adapter's baseline migration installs the EQL v3 bundle only (works on Supabase as a non-superuser) - `packages/stack-drizzle`: Drizzle ORM integration (`@cipherstash/stack-drizzle`), depends on `@cipherstash/stack` — **EQL v3 only**, on the package root (the v2 surface was removed and the old `./v3` subpath collapsed into `.`). Split out of `@cipherstash/stack`. - `packages/stack-supabase`: Supabase integration (`@cipherstash/stack-supabase`), depends on `@cipherstash/stack` — **EQL v3 only**: `encryptedSupabase` is the v3 factory (`encryptedSupabaseV3` remains as a `@deprecated` alias). Split out of `@cipherstash/stack`. - `packages/nextjs`: Next.js helpers and Clerk integration (`./clerk` export) @@ -85,7 +85,7 @@ If these variables are missing, tests that require live encryption will fail or - `e2e/*`: Cross-package end-to-end tests (package managers, supply chain, Prisma example README) - `examples/*`: Working apps (basic, prisma, supabase-worker) - `docs/plans/*`: Internal design plans. User-facing documentation lives at https://cipherstash.com/docs (not in this repo). -- `skills/*`: Agent skills (`stash-cli`, `stash-encryption`, `stash-indexing`, `stash-deployment`, `stash-zerokms`, `stash-auth`, `stash-postgres`, `stash-edge`, `stash-drizzle`, `stash-dynamodb`, `stash-supabase`, `stash-prisma-next`, `stash-supply-chain-security`) +- `skills/*`: Agent skills (`stash-cli`, `stash-encryption`, `stash-indexing`, `stash-deployment`, `stash-zerokms`, `stash-auth`, `stash-postgres`, `stash-edge`, `stash-drizzle`, `stash-dynamodb`, `stash-supabase`, `stash-prisma`, `stash-supply-chain-security`) ## Agent Skills — these ship to customers @@ -110,7 +110,7 @@ nothing type-checks them, and the damage lands in a customer's repo, not ours. |---|---| | `packages/cli` commands, flags, or prompts | `skills/stash-cli` | | `packages/stack` encryption API, schema builders, subpath exports | `skills/stash-encryption` | -| Drizzle / Supabase / Prisma Next / DynamoDB integrations | `skills/stash-drizzle`, `skills/stash-supabase`, `skills/stash-prisma-next`, `skills/stash-dynamodb` | +| Drizzle / Supabase / Prisma Next / DynamoDB integrations | `skills/stash-drizzle`, `skills/stash-supabase`, `skills/stash-prisma`, `skills/stash-dynamodb` | | The rollout/cutover lifecycle (`packages/migrate`, `stash encrypt *`) | `skills/stash-encryption` and `skills/stash-cli` | | The deploy sequencing / deploy-gate story, `stash env`, or platform-specific deployment guidance | `skills/stash-deployment` | | The `@cipherstash/eql` pin, `eql install`/`eql migration` behaviour, or index-related SQL guidance | `skills/stash-indexing` | diff --git a/SECURITY.md b/SECURITY.md index ba3996d97..d1ff6fc03 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -13,7 +13,7 @@ This repository is the CipherStash Stack monorepo for JavaScript/TypeScript. It | `stash` | CipherStash CLI | | `@cipherstash/nextjs` | Next.js helpers | | `@cipherstash/migrate` | Plaintext-to-encrypted column migration tooling | -| `@cipherstash/prisma-next` | Prisma Next integration (searchable field-level encryption for Postgres) | +| `@cipherstash/stack-prisma` | Prisma Next integration (searchable field-level encryption for Postgres) | | `@cipherstash/stack-drizzle` | Drizzle ORM integration for `@cipherstash/stack` (EQL v3) | | `@cipherstash/stack-supabase` | Supabase integration for `@cipherstash/stack` (EQL v3) | | `@cipherstash/wizard` | AI-powered encryption setup | diff --git a/examples/prisma/README.md b/examples/prisma/README.md index afd336cf2..15fdad0e9 100644 --- a/examples/prisma/README.md +++ b/examples/prisma/README.md @@ -1,6 +1,6 @@ -# @cipherstash/prisma-next example +# @cipherstash/stack-prisma example -End-to-end demo of [`@cipherstash/prisma-next`](../../packages/prisma-next/README.md): searchable application-layer encryption for Postgres with [Prisma Next](https://www.npmjs.com/package/@prisma-next/cli), using [`@cipherstash/stack`](../../packages/stack/README.md) as the encryption SDK — on **EQL v3**, where every encrypted column is a concrete `public.eql_v3_*` Postgres domain and the constructor you pick *is* the capability set. +End-to-end demo of [`@cipherstash/stack-prisma`](../../packages/stack-prisma/README.md): searchable application-layer encryption for Postgres with [Prisma Next](https://www.npmjs.com/package/@prisma-next/cli), using [`@cipherstash/stack`](../../packages/stack/README.md) as the encryption SDK — on **EQL v3**, where every encrypted column is a concrete `public.eql_v3_*` Postgres domain and the constructor you pick *is* the capability set. A single `User` model with one column per plaintext family, exercised end-to-end: insert, equality, free-text token search, range, between, in-array, encrypted-order-term sort, JSON containment, and `decryptAll`-amortised read. @@ -108,4 +108,4 @@ Two v3 behaviours worth noticing in that output: ## References - 📖 [Prisma Next encryption docs](https://cipherstash.com/docs/stack/cipherstash/encryption/prisma-next) — the canonical reference. -- [`@cipherstash/prisma-next` package README](../../packages/prisma-next/README.md) — install, subpath exports, quick start. +- [`@cipherstash/stack-prisma` package README](../../packages/stack-prisma/README.md) — install, subpath exports, quick start. diff --git a/examples/prisma/docker-compose.yml b/examples/prisma/docker-compose.yml index 491c246b3..0ec2f00de 100644 --- a/examples/prisma/docker-compose.yml +++ b/examples/prisma/docker-compose.yml @@ -1,4 +1,4 @@ -# Local Postgres for the @cipherstash/prisma-next example. +# Local Postgres for the @cipherstash/stack-prisma example. # # Usage: # docker compose up -d # start diff --git a/examples/prisma/package.json b/examples/prisma/package.json index cab49036f..10304d38c 100644 --- a/examples/prisma/package.json +++ b/examples/prisma/package.json @@ -1,8 +1,8 @@ { - "name": "@cipherstash/prisma-next-example", + "name": "@cipherstash/prisma-example", "private": true, "version": "0.1.0-rc.4", - "description": "End-to-end example of @cipherstash/prisma-next: searchable application-layer encryption for Postgres with Prisma Next, using @cipherstash/stack as the SDK.", + "description": "End-to-end example of @cipherstash/stack-prisma: searchable application-layer encryption for Postgres with Prisma Next, using @cipherstash/stack as the SDK.", "type": "module", "scripts": { "emit": "prisma-next contract emit", @@ -13,7 +13,7 @@ "typecheck": "tsc --project tsconfig.json --noEmit" }, "dependencies": { - "@cipherstash/prisma-next": "workspace:*", + "@cipherstash/stack-prisma": "workspace:*", "@cipherstash/stack": "workspace:*", "@prisma-next/adapter-postgres": "0.16.0", "@prisma-next/contract": "0.16.0", diff --git a/examples/prisma/prisma-next.config.ts b/examples/prisma/prisma-next.config.ts index 94f4458c2..1cb5a2bdb 100644 --- a/examples/prisma/prisma-next.config.ts +++ b/examples/prisma/prisma-next.config.ts @@ -1,5 +1,5 @@ import 'dotenv/config' -import cipherstash from '@cipherstash/prisma-next/control' +import cipherstash from '@cipherstash/stack-prisma/control' import postgresAdapter from '@prisma-next/adapter-postgres/control' import { defineConfig } from '@prisma-next/cli/config-types' import postgresDriver from '@prisma-next/driver-postgres/control' diff --git a/examples/prisma/prisma/schema.prisma b/examples/prisma/prisma/schema.prisma index 5be400e4e..1f57f9bf3 100644 --- a/examples/prisma/prisma/schema.prisma +++ b/examples/prisma/prisma/schema.prisma @@ -1,4 +1,4 @@ -// @cipherstash/prisma-next example schema — EQL v3. +// @cipherstash/stack-prisma example schema — EQL v3. // // One User model exercising one v3 domain per plaintext family. Each // v3 constructor is argument-less and maps 1:1 to a concrete diff --git a/examples/prisma/src/db.ts b/examples/prisma/src/db.ts index df793398f..511680c52 100644 --- a/examples/prisma/src/db.ts +++ b/examples/prisma/src/db.ts @@ -13,7 +13,7 @@ import 'dotenv/config' -import { cipherstashFromStack } from '@cipherstash/prisma-next/v3' +import { cipherstashFromStack } from '@cipherstash/stack-prisma/v3' import postgres from '@prisma-next/postgres/runtime' import type { Contract } from './prisma/contract.d' diff --git a/examples/prisma/src/index.ts b/examples/prisma/src/index.ts index 5725236b3..f0aeeb183 100644 --- a/examples/prisma/src/index.ts +++ b/examples/prisma/src/index.ts @@ -1,5 +1,5 @@ /** - * @cipherstash/prisma-next example — end-to-end demo (EQL v3). + * @cipherstash/stack-prisma example — end-to-end demo (EQL v3). * * Exercises one v3 domain per plaintext family, plus the * trait-dispatched predicate operators and the encrypted ORDER BY @@ -47,7 +47,7 @@ import { EncryptedNumber, EncryptedString, eqlAsc, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { db } from './db' diff --git a/examples/prisma/test/e2e/README.md b/examples/prisma/test/e2e/README.md index ebb051cf4..2e129ff7d 100644 --- a/examples/prisma/test/e2e/README.md +++ b/examples/prisma/test/e2e/README.md @@ -1,6 +1,6 @@ # Live PG + EQL v3 + ZeroKMS e2e harness -This directory hosts the live-Postgres + EQL v3 bundle + ZeroKMS end-to-end harness for the @cipherstash/prisma-next example app. Seven `*.e2e.test.ts` files cover one domain or scenario each: +This directory hosts the live-Postgres + EQL v3 bundle + ZeroKMS end-to-end harness for the @cipherstash/stack-prisma example app. Seven `*.e2e.test.ts` files cover one domain or scenario each: - `num.e2e.test.ts` — `eql_v3_double_ord` round-trip (decrypts to `EncryptedNumber`); `eqlGt`/`eqlGte`/`eqlLt`/`eqlLte`/`eqlBetween`; `eqlAsc`/`eqlDesc` order-term sort. - `bigint.e2e.test.ts` — `eql_v3_bigint_ord` round-trip **lossless beyond `Number.MAX_SAFE_INTEGER`** (native `bigint` pipeline); equality + range + in-array + sort. @@ -14,7 +14,7 @@ This directory hosts the live-Postgres + EQL v3 bundle + ZeroKMS end-to-end harn ```bash docker compose -f test/e2e/docker-compose.yml up -d # from examples/prisma -pnpm --filter @cipherstash/prisma-next-example test:e2e +pnpm --filter @cipherstash/prisma-example test:e2e ``` The harness's Vitest global setup (`global-setup.ts`): diff --git a/examples/prisma/test/e2e/bigint.e2e.test.ts b/examples/prisma/test/e2e/bigint.e2e.test.ts index 602b974d9..f1e742114 100644 --- a/examples/prisma/test/e2e/bigint.e2e.test.ts +++ b/examples/prisma/test/e2e/bigint.e2e.test.ts @@ -20,7 +20,7 @@ import { EncryptedNumber, EncryptedString, eqlAsc, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { beforeAll, describe, expect, it } from 'vitest' import { db, ensureConnected, truncateUsers } from './harness' diff --git a/examples/prisma/test/e2e/bool.e2e.test.ts b/examples/prisma/test/e2e/bool.e2e.test.ts index f565458c5..f9ae12678 100644 --- a/examples/prisma/test/e2e/bool.e2e.test.ts +++ b/examples/prisma/test/e2e/bool.e2e.test.ts @@ -28,7 +28,7 @@ import { EncryptedNumber, EncryptedString, EncryptionOperatorError, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { beforeAll, describe, expect, it } from 'vitest' import { db, ensureConnected, truncateUsers } from './harness' diff --git a/examples/prisma/test/e2e/date.e2e.test.ts b/examples/prisma/test/e2e/date.e2e.test.ts index c1146cd03..2608610e0 100644 --- a/examples/prisma/test/e2e/date.e2e.test.ts +++ b/examples/prisma/test/e2e/date.e2e.test.ts @@ -23,7 +23,7 @@ import { EncryptedString, eqlAsc, eqlDesc, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { beforeAll, describe, expect, it } from 'vitest' import { db, ensureConnected, truncateUsers } from './harness' diff --git a/examples/prisma/test/e2e/json.e2e.test.ts b/examples/prisma/test/e2e/json.e2e.test.ts index 22a530422..b86a2058d 100644 --- a/examples/prisma/test/e2e/json.e2e.test.ts +++ b/examples/prisma/test/e2e/json.e2e.test.ts @@ -29,7 +29,7 @@ import { EncryptedNumber, EncryptedString, EncryptionOperatorError, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { beforeAll, describe, expect, it } from 'vitest' import { db, ensureConnected, truncateUsers } from './harness' diff --git a/examples/prisma/test/e2e/mixed.e2e.test.ts b/examples/prisma/test/e2e/mixed.e2e.test.ts index 4f361c2db..da8c6b7d9 100644 --- a/examples/prisma/test/e2e/mixed.e2e.test.ts +++ b/examples/prisma/test/e2e/mixed.e2e.test.ts @@ -38,12 +38,12 @@ import { EncryptedNumber, EncryptedString, eqlAsc, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { cipherstashFromStack, createCipherstashV3Sdk, deriveStackSchemasV3, -} from '@cipherstash/prisma-next/v3' +} from '@cipherstash/stack-prisma/v3' import postgres from '@prisma-next/postgres/runtime' import { and } from '@prisma-next/sql-orm-client' import { afterAll, beforeAll, describe, expect, it } from 'vitest' diff --git a/examples/prisma/test/e2e/num.e2e.test.ts b/examples/prisma/test/e2e/num.e2e.test.ts index 8bb41bc45..5b474735c 100644 --- a/examples/prisma/test/e2e/num.e2e.test.ts +++ b/examples/prisma/test/e2e/num.e2e.test.ts @@ -30,7 +30,7 @@ import { EncryptedString, eqlAsc, eqlDesc, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { beforeAll, describe, expect, it } from 'vitest' import { db, ensureConnected, truncateUsers } from './harness' diff --git a/examples/prisma/test/e2e/str-range.e2e.test.ts b/examples/prisma/test/e2e/str-range.e2e.test.ts index 2c7f77dd8..62e118aef 100644 --- a/examples/prisma/test/e2e/str-range.e2e.test.ts +++ b/examples/prisma/test/e2e/str-range.e2e.test.ts @@ -27,7 +27,7 @@ import { EncryptedString, eqlAsc, eqlDesc, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' import { beforeAll, describe, expect, it } from 'vitest' import { db, ensureConnected, truncateUsers } from './harness' diff --git a/packages/cli/src/__tests__/runtime-versions.test.ts b/packages/cli/src/__tests__/runtime-versions.test.ts index 20f35dea6..b10a8b5e5 100644 --- a/packages/cli/src/__tests__/runtime-versions.test.ts +++ b/packages/cli/src/__tests__/runtime-versions.test.ts @@ -70,7 +70,7 @@ describe('runtime-versions (explicit version map)', () => { const versions = { stash: '9.9.9-test.1', '@cipherstash/stack': '9.9.9-test.1', - '@cipherstash/prisma-next': '8.8.8-test.2', + '@cipherstash/stack-prisma': '8.8.8-test.2', } it('pins known packages to the release version', () => { @@ -79,8 +79,8 @@ describe('runtime-versions (explicit version map)', () => { ) // prisma-next versions on its own line — the map, not a shared constant, // is the source of truth. - expect(pinnedSpec('@cipherstash/prisma-next', versions)).toBe( - '@cipherstash/prisma-next@8.8.8-test.2', + expect(pinnedSpec('@cipherstash/stack-prisma', versions)).toBe( + '@cipherstash/stack-prisma@8.8.8-test.2', ) }) diff --git a/packages/cli/src/commands/db/__tests__/prisma-next-install-guard.test.ts b/packages/cli/src/commands/db/__tests__/prisma-next-install-guard.test.ts index 469a8fcee..1dbd81acf 100644 --- a/packages/cli/src/commands/db/__tests__/prisma-next-install-guard.test.ts +++ b/packages/cli/src/commands/db/__tests__/prisma-next-install-guard.test.ts @@ -24,10 +24,12 @@ describe('prismaNextInstallGuard', () => { expect(msg).toContain('--force') }) - it('blocks when @cipherstash/prisma-next is a dependency', () => { + it('blocks when @cipherstash/stack-prisma is a dependency', () => { writeFileSync( join(dir, 'package.json'), - JSON.stringify({ dependencies: { '@cipherstash/prisma-next': '1.0.0' } }), + JSON.stringify({ + dependencies: { '@cipherstash/stack-prisma': '1.0.0' }, + }), ) expect(prismaNextInstallGuard(dir, {})).toContain( diff --git a/packages/cli/src/commands/db/detect.ts b/packages/cli/src/commands/db/detect.ts index 93b681ee6..3684c5ca5 100644 --- a/packages/cli/src/commands/db/detect.ts +++ b/packages/cli/src/commands/db/detect.ts @@ -130,7 +130,7 @@ export function detectDrizzle(cwd: string): boolean { * Return true when the project uses Prisma Next. * * Detected via a `prisma-next.config.*` at the cwd (fast path) or - * a `@prisma-next/cli` / `@cipherstash/prisma-next` entry in + * a `@prisma-next/cli` / `@cipherstash/stack-prisma` entry in * package.json. Either signal alone is enough. */ export function detectPrismaNext(cwd: string): boolean { @@ -160,7 +160,7 @@ export function detectPrismaNext(cwd: string): boolean { ...pkg.peerDependencies, ...pkg.optionalDependencies, } - return '@prisma-next/cli' in deps || '@cipherstash/prisma-next' in deps + return '@prisma-next/cli' in deps || '@cipherstash/stack-prisma' in deps } catch { return false } diff --git a/packages/cli/src/commands/db/install.ts b/packages/cli/src/commands/db/install.ts index b17c9061a..edfd1f196 100644 --- a/packages/cli/src/commands/db/install.ts +++ b/packages/cli/src/commands/db/install.ts @@ -197,7 +197,7 @@ export function prismaNextInstallGuard( ): string | null { if (options.force || !detectPrismaNext(cwd)) return null return ( - `${messages.eql.prismaNextDetected} (found prisma-next.config.* or @cipherstash/prisma-next). ` + + `${messages.eql.prismaNextDetected} (found prisma-next.config.* or @cipherstash/stack-prisma). ` + 'Prisma Next installs the EQL bundle through its own migration system — run ' + '`prisma-next migrate` instead of `stash eql install`. ' + 'Pass --force to run the standalone installer against this database anyway.' diff --git a/packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md b/packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md index ec56cf110..a95bac92b 100644 --- a/packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md +++ b/packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md @@ -47,4 +47,4 @@ The CipherStash setup skills carry the API details. Use them when you need speci - `.codex/skills//SKILL.md` (Codex) - Under `## Skill references` at the bottom of this file (editor agents, or when a skills directory could not be written — if the section exists, it is the current copy) -Skills relevant to this project depend on the integration. Common ones: `stash-encryption` (encryption API), `stash-indexing` (indexes on encrypted columns), `stash-deployment` (taking a rollout to production), `stash-zerokms` (keysets, clients, and key management), `stash-auth` (credentials, auth strategies, lock context), `stash-cli` (`stash` commands), and one of `stash-drizzle` / `stash-supabase` / `stash-prisma-next` / `stash-dynamodb` for the chosen ORM. +Skills relevant to this project depend on the integration. Common ones: `stash-encryption` (encryption API), `stash-indexing` (indexes on encrypted columns), `stash-deployment` (taking a rollout to production), `stash-zerokms` (keysets, clients, and key management), `stash-auth` (credentials, auth strategies, lock context), `stash-cli` (`stash` commands), and one of `stash-drizzle` / `stash-supabase` / `stash-prisma` / `stash-dynamodb` for the chosen ORM. diff --git a/packages/cli/src/commands/init/lib/__tests__/build-agents-md.test.ts b/packages/cli/src/commands/init/lib/__tests__/build-agents-md.test.ts index 6599656b2..69015d000 100644 --- a/packages/cli/src/commands/init/lib/__tests__/build-agents-md.test.ts +++ b/packages/cli/src/commands/init/lib/__tests__/build-agents-md.test.ts @@ -53,11 +53,11 @@ describe('buildAgentsMdBody', () => { expect(out).not.toContain('# Skill: stash-supabase') }) - it('prisma-next inlines the stash-prisma-next skill (no crash on undefined map)', () => { + it('prisma-next inlines the stash-prisma skill (no crash on undefined map)', () => { // Regression: SKILL_MAP once lacked a prisma-next key, so this call // threw "SKILL_MAP[integration] is not iterable" for any Prisma repo. const out = buildAgentsMdBody('prisma-next', 'doctrine-plus-skills') - expect(out).toContain('# Skill: stash-prisma-next') + expect(out).toContain('# Skill: stash-prisma') expect(out).toContain('# Skill: stash-encryption') expect(out).not.toContain('# Skill: stash-drizzle') }) diff --git a/packages/cli/src/commands/init/lib/__tests__/install-skills.test.ts b/packages/cli/src/commands/init/lib/__tests__/install-skills.test.ts index 5f9f93e11..46940b53e 100644 --- a/packages/cli/src/commands/init/lib/__tests__/install-skills.test.ts +++ b/packages/cli/src/commands/init/lib/__tests__/install-skills.test.ts @@ -89,14 +89,14 @@ describe('SKILL_MAP', () => { expect(SKILL_MAP.supabase).toContain('stash-supabase') }) - it('prisma-next includes stash-prisma-next', () => { - expect(SKILL_MAP['prisma-next']).toContain('stash-prisma-next') + it('prisma-next includes stash-prisma', () => { + expect(SKILL_MAP['prisma-next']).toContain('stash-prisma') }) it('postgresql skips ORM-specific skills', () => { expect(SKILL_MAP.postgresql).not.toContain('stash-drizzle') expect(SKILL_MAP.postgresql).not.toContain('stash-supabase') - expect(SKILL_MAP.postgresql).not.toContain('stash-prisma-next') + expect(SKILL_MAP.postgresql).not.toContain('stash-prisma') }) // #754: the no-ORM path had no source for the raw-SQL binding surface or @@ -126,7 +126,7 @@ describe('skillsFor', () => { it('returns the mapped skills for a known integration', () => { expect(skillsFor('prisma-next')).toEqual([ 'stash-encryption', - 'stash-prisma-next', + 'stash-prisma', 'stash-indexing', 'stash-deployment', 'stash-zerokms', diff --git a/packages/cli/src/commands/init/lib/__tests__/setup-prompt.test.ts b/packages/cli/src/commands/init/lib/__tests__/setup-prompt.test.ts index bd9dbff9f..4003a3edf 100644 --- a/packages/cli/src/commands/init/lib/__tests__/setup-prompt.test.ts +++ b/packages/cli/src/commands/init/lib/__tests__/setup-prompt.test.ts @@ -271,7 +271,7 @@ describe('renderSetupPrompt — orient + route (implement mode)', () => { it('has a purpose line for every skill SKILL_MAP can install', () => { // renderSkillIndex falls back to "(no description)" for a skill missing // from SKILL_PURPOSES — a silent gap no per-skill assertion catches when - // a new skill lands (stash-prisma-next shipped that way). Render the + // a new skill lands (stash-prisma shipped that way). Render the // union of every installable skill and require zero fallbacks. const everyInstallable = [...new Set(Object.values(SKILL_MAP).flat())] const out = renderSetupPrompt({ diff --git a/packages/cli/src/commands/init/lib/install-skills.ts b/packages/cli/src/commands/init/lib/install-skills.ts index 989db8a17..8f798bed5 100644 --- a/packages/cli/src/commands/init/lib/install-skills.ts +++ b/packages/cli/src/commands/init/lib/install-skills.ts @@ -37,7 +37,7 @@ export const SKILL_MAP: Record = { ], 'prisma-next': [ 'stash-encryption', - 'stash-prisma-next', + 'stash-prisma', 'stash-indexing', 'stash-deployment', 'stash-zerokms', diff --git a/packages/cli/src/commands/init/lib/setup-prompt.ts b/packages/cli/src/commands/init/lib/setup-prompt.ts index fc18a3f12..a74cac5a0 100644 --- a/packages/cli/src/commands/init/lib/setup-prompt.ts +++ b/packages/cli/src/commands/init/lib/setup-prompt.ts @@ -102,7 +102,7 @@ function schemaAuthoringGuidance(integration: Integration): string { case 'supabase': return 'Declare the column with a concrete `public.eql_v3_*` domain in the migration SQL — for example, `email public.eql_v3_text_search` (`encryptedSupabase` derives its encryption config by introspecting those domains)' case 'prisma-next': - return 'Declare the field with the `cipherstash.*` constructors in `prisma/schema.prisma` (`cipherstash.TextSearch()`, `cipherstash.DoubleOrd()`, …), with the `cipherstash` extension pack wired up per `@cipherstash/prisma-next/control`' + return 'Declare the field with the `cipherstash.*` constructors in `prisma/schema.prisma` (`cipherstash.TextSearch()`, `cipherstash.DoubleOrd()`, …), with the `cipherstash` extension pack wired up per `@cipherstash/stack-prisma/control`' default: return 'Declare the table with `encryptedTable` and the `types.*` domain factories from `@cipherstash/stack/v3`, then pass it to `Encryption({ schemas })`' } @@ -194,7 +194,7 @@ const SKILL_PURPOSES: Record = { 'Drizzle-specific patterns: declaring encrypted columns, query operators, the rollout/cutover walkthrough for an existing column', 'stash-supabase': 'Supabase-specific patterns: `encryptedSupabase` wrapper, encrypted query filters, transparent decryption, the rollout/cutover walkthrough', - 'stash-prisma-next': + 'stash-prisma': 'Prisma Next-specific patterns: `cipherstash.*` field constructors, migration flow, encrypted query operators', 'stash-indexing': 'index recipes for encrypted columns — the `eql_v3` extractor functional indexes, Supabase/managed-Postgres constraints, EXPLAIN verification', diff --git a/packages/cli/src/commands/init/providers/prisma-next.ts b/packages/cli/src/commands/init/providers/prisma-next.ts index be1e5a698..523c5e543 100644 --- a/packages/cli/src/commands/init/providers/prisma-next.ts +++ b/packages/cli/src/commands/init/providers/prisma-next.ts @@ -18,7 +18,7 @@ export function createPrismaNextProvider(): InitProvider { 'Register the extension: add `cipherstash` to `extensionPacks` in prisma-next.config.ts', `Generate the contract: ${prismaNext} contract emit`, `Plan + apply (installs the EQL bundle alongside your app schema): ${prismaNext} migration plan && ${prismaNext} migrate`, - 'Wire the runtime: cipherstashFromStack({ contractJson }) — see @cipherstash/prisma-next/stack', + 'Wire the runtime: cipherstashFromStack({ contractJson }) — see @cipherstash/stack-prisma/stack', `Customize your schema: ${stash} wizard (AI-guided, automated)`, 'Prisma Next guide: https://cipherstash.com/docs/stack/cipherstash/encryption/prisma-next', 'Dashboard: https://dashboard.cipherstash.com/workspaces', diff --git a/packages/cli/src/commands/init/steps/install-deps.ts b/packages/cli/src/commands/init/steps/install-deps.ts index 8357f11ca..70e382d0a 100644 --- a/packages/cli/src/commands/init/steps/install-deps.ts +++ b/packages/cli/src/commands/init/steps/install-deps.ts @@ -34,7 +34,7 @@ const CLI_PACKAGE = 'stash' * skew warning, silently reintroducing #661 for exactly the newest package. */ export const INTEGRATION_ADAPTER_PACKAGES: Readonly> = { - 'prisma-next': '@cipherstash/prisma-next', + 'prisma-next': '@cipherstash/stack-prisma', drizzle: '@cipherstash/stack-drizzle', supabase: '@cipherstash/stack-supabase', } diff --git a/packages/cli/src/commands/init/steps/install-eql.ts b/packages/cli/src/commands/init/steps/install-eql.ts index e8e5003a8..704c5a3f8 100644 --- a/packages/cli/src/commands/init/steps/install-eql.ts +++ b/packages/cli/src/commands/init/steps/install-eql.ts @@ -41,7 +41,7 @@ export const installEqlStep: InitStep = { const integration = state.integration ?? 'postgresql' // Prisma Next ships the EQL bundle as a baseline migration inside - // `@cipherstash/prisma-next`. `prisma-next migrate` runs + // `@cipherstash/stack-prisma`. `prisma-next migrate` runs // it in the same control-plane sweep as the user's application // migrations — running `stash eql install` here would be a // duplicate install and would race with the framework's diff --git a/packages/cli/src/release-train.ts b/packages/cli/src/release-train.ts index 3ad6ffd60..eb80083e1 100644 --- a/packages/cli/src/release-train.ts +++ b/packages/cli/src/release-train.ts @@ -20,7 +20,7 @@ export const RELEASE_TRAIN_MANIFESTS = { '@cipherstash/stack': '../stack/package.json', '@cipherstash/stack-drizzle': '../stack-drizzle/package.json', '@cipherstash/stack-supabase': '../stack-supabase/package.json', - '@cipherstash/prisma-next': '../prisma-next/package.json', + '@cipherstash/stack-prisma': '../stack-prisma/package.json', '@cipherstash/wizard': '../wizard/package.json', } as const diff --git a/packages/prisma-next/CHANGELOG.md b/packages/stack-prisma/CHANGELOG.md similarity index 100% rename from packages/prisma-next/CHANGELOG.md rename to packages/stack-prisma/CHANGELOG.md diff --git a/packages/prisma-next/DEVELOPING.md b/packages/stack-prisma/DEVELOPING.md similarity index 99% rename from packages/prisma-next/DEVELOPING.md rename to packages/stack-prisma/DEVELOPING.md index 78aa21937..273fbb42d 100644 --- a/packages/prisma-next/DEVELOPING.md +++ b/packages/stack-prisma/DEVELOPING.md @@ -1,4 +1,4 @@ -# Developing `@cipherstash/prisma-next` +# Developing `@cipherstash/stack-prisma` Contributor-facing notes for the cipherstash extension. The user-facing surface lives in [`README.md`](./README.md); this file collects the @@ -15,7 +15,7 @@ per-column search-mode flags. ## Source layout ```text -packages/prisma-next/ +packages/stack-prisma/ ├── src/ │ ├── contract.prisma PSL contract source (models NO storage — v3 │ │ declares none; the bundle creates the domains) diff --git a/packages/prisma-next/README.md b/packages/stack-prisma/README.md similarity index 95% rename from packages/prisma-next/README.md rename to packages/stack-prisma/README.md index acc29ce63..050361dbb 100644 --- a/packages/prisma-next/README.md +++ b/packages/stack-prisma/README.md @@ -1,4 +1,4 @@ -# @cipherstash/prisma-next +# @cipherstash/stack-prisma **Searchable field-level encryption for Postgres with [Prisma Next](https://www.npmjs.com/package/prisma-next)** — powered by [`@cipherstash/stack`](../stack/README.md) and the [EQL bundle](https://cipherstash.com/docs/stack/platform/eql). @@ -18,7 +18,7 @@ Declare encrypted columns directly in `schema.prisma`, and the framework's migra ## Installation ```bash -npm install @cipherstash/stack @cipherstash/prisma-next +npm install @cipherstash/stack @cipherstash/stack-prisma ``` ## Quick start @@ -36,7 +36,7 @@ model User { ```typescript // prisma-next.config.ts -import cipherstash from "@cipherstash/prisma-next/control" +import cipherstash from "@cipherstash/stack-prisma/control" // ... other imports export default defineConfig({ // ... family, target, adapter, contract @@ -47,7 +47,7 @@ export default defineConfig({ ```typescript // src/db.ts import "dotenv/config" -import { cipherstashFromStack } from "@cipherstash/prisma-next/v3" +import { cipherstashFromStack } from "@cipherstash/stack-prisma/v3" import postgres from "@prisma-next/postgres/runtime" import type { Contract } from "./prisma/contract.d" import contractJson from "./prisma/contract.json" with { type: "json" } @@ -69,7 +69,7 @@ npx prisma-next migrate # installs EQL bundle + your schema (t ``` ```typescript -import { EncryptedString, decryptAll } from "@cipherstash/prisma-next/runtime" +import { EncryptedString, decryptAll } from "@cipherstash/stack-prisma/runtime" await db.orm.public.User.create({ id: "user-0", diff --git a/packages/prisma-next/integration/adapter.ts b/packages/stack-prisma/integration/adapter.ts similarity index 100% rename from packages/prisma-next/integration/adapter.ts rename to packages/stack-prisma/integration/adapter.ts diff --git a/packages/prisma-next/integration/families.integration.test.ts b/packages/stack-prisma/integration/families.integration.test.ts similarity index 100% rename from packages/prisma-next/integration/families.integration.test.ts rename to packages/stack-prisma/integration/families.integration.test.ts diff --git a/packages/prisma-next/integration/json-adapter.ts b/packages/stack-prisma/integration/json-adapter.ts similarity index 100% rename from packages/prisma-next/integration/json-adapter.ts rename to packages/stack-prisma/integration/json-adapter.ts diff --git a/packages/prisma-next/integration/json.integration.test.ts b/packages/stack-prisma/integration/json.integration.test.ts similarity index 100% rename from packages/prisma-next/integration/json.integration.test.ts rename to packages/stack-prisma/integration/json.integration.test.ts diff --git a/packages/prisma-next/integration/vitest.config.ts b/packages/stack-prisma/integration/vitest.config.ts similarity index 100% rename from packages/prisma-next/integration/vitest.config.ts rename to packages/stack-prisma/integration/vitest.config.ts diff --git a/packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/end-contract.d.ts b/packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/end-contract.d.ts similarity index 100% rename from packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/end-contract.d.ts rename to packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/end-contract.d.ts diff --git a/packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/end-contract.json b/packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/end-contract.json similarity index 100% rename from packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/end-contract.json rename to packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/end-contract.json diff --git a/packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/migration.json b/packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/migration.json similarity index 100% rename from packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/migration.json rename to packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/migration.json diff --git a/packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/migration.ts b/packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/migration.ts similarity index 100% rename from packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/migration.ts rename to packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/migration.ts diff --git a/packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/ops.json b/packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/ops.json similarity index 100% rename from packages/prisma-next/migrations/20260601T0100_install_eql_v3_bundle/ops.json rename to packages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/ops.json diff --git a/packages/prisma-next/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.json b/packages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.json similarity index 100% rename from packages/prisma-next/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.json rename to packages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.json diff --git a/packages/prisma-next/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.ts b/packages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.ts similarity index 100% rename from packages/prisma-next/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.ts rename to packages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.ts diff --git a/packages/prisma-next/migrations/20260720T0000_upgrade_eql_v3_3_0_2/ops.json b/packages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/ops.json similarity index 100% rename from packages/prisma-next/migrations/20260720T0000_upgrade_eql_v3_3_0_2/ops.json rename to packages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/ops.json diff --git a/packages/prisma-next/migrations/refs/head.json b/packages/stack-prisma/migrations/refs/head.json similarity index 100% rename from packages/prisma-next/migrations/refs/head.json rename to packages/stack-prisma/migrations/refs/head.json diff --git a/packages/prisma-next/package.json b/packages/stack-prisma/package.json similarity index 97% rename from packages/prisma-next/package.json rename to packages/stack-prisma/package.json index 9c335aa2b..41669e002 100644 --- a/packages/prisma-next/package.json +++ b/packages/stack-prisma/package.json @@ -1,5 +1,5 @@ { - "name": "@cipherstash/prisma-next", + "name": "@cipherstash/stack-prisma", "version": "1.0.0-rc.4", "license": "MIT", "author": "CipherStash ", @@ -19,7 +19,7 @@ "repository": { "type": "git", "url": "git+https://github.com/cipherstash/stack.git", - "directory": "packages/prisma-next" + "directory": "packages/stack-prisma" }, "type": "module", "sideEffects": false, diff --git a/packages/prisma-next/prisma-next.config.ts b/packages/stack-prisma/prisma-next.config.ts similarity index 95% rename from packages/prisma-next/prisma-next.config.ts rename to packages/stack-prisma/prisma-next.config.ts index 2c7434dfe..5a9aac56d 100644 --- a/packages/prisma-next/prisma-next.config.ts +++ b/packages/stack-prisma/prisma-next.config.ts @@ -1,5 +1,5 @@ /** - * Prisma Next config for the `@cipherstash/prisma-next` package itself. + * Prisma Next config for the `@cipherstash/stack-prisma` package itself. * * The extension package is treated as a self-contained "project" for * the CLI: `prisma-next contract emit` writes diff --git a/packages/prisma-next/src/contract-authoring.ts b/packages/stack-prisma/src/contract-authoring.ts similarity index 100% rename from packages/prisma-next/src/contract-authoring.ts rename to packages/stack-prisma/src/contract-authoring.ts diff --git a/packages/prisma-next/src/contract.d.ts b/packages/stack-prisma/src/contract.d.ts similarity index 100% rename from packages/prisma-next/src/contract.d.ts rename to packages/stack-prisma/src/contract.d.ts diff --git a/packages/prisma-next/src/contract.json b/packages/stack-prisma/src/contract.json similarity index 100% rename from packages/prisma-next/src/contract.json rename to packages/stack-prisma/src/contract.json diff --git a/packages/prisma-next/src/contract.prisma b/packages/stack-prisma/src/contract.prisma similarity index 100% rename from packages/prisma-next/src/contract.prisma rename to packages/stack-prisma/src/contract.prisma diff --git a/packages/prisma-next/src/execution/abort.ts b/packages/stack-prisma/src/execution/abort.ts similarity index 100% rename from packages/prisma-next/src/execution/abort.ts rename to packages/stack-prisma/src/execution/abort.ts diff --git a/packages/prisma-next/src/execution/decrypt-all.ts b/packages/stack-prisma/src/execution/decrypt-all.ts similarity index 100% rename from packages/prisma-next/src/execution/decrypt-all.ts rename to packages/stack-prisma/src/execution/decrypt-all.ts diff --git a/packages/prisma-next/src/execution/envelope-base.ts b/packages/stack-prisma/src/execution/envelope-base.ts similarity index 100% rename from packages/prisma-next/src/execution/envelope-base.ts rename to packages/stack-prisma/src/execution/envelope-base.ts diff --git a/packages/prisma-next/src/execution/envelope-bigint.ts b/packages/stack-prisma/src/execution/envelope-bigint.ts similarity index 100% rename from packages/prisma-next/src/execution/envelope-bigint.ts rename to packages/stack-prisma/src/execution/envelope-bigint.ts diff --git a/packages/prisma-next/src/execution/envelope-boolean.ts b/packages/stack-prisma/src/execution/envelope-boolean.ts similarity index 100% rename from packages/prisma-next/src/execution/envelope-boolean.ts rename to packages/stack-prisma/src/execution/envelope-boolean.ts diff --git a/packages/prisma-next/src/execution/envelope-date.ts b/packages/stack-prisma/src/execution/envelope-date.ts similarity index 100% rename from packages/prisma-next/src/execution/envelope-date.ts rename to packages/stack-prisma/src/execution/envelope-date.ts diff --git a/packages/prisma-next/src/execution/envelope-json.ts b/packages/stack-prisma/src/execution/envelope-json.ts similarity index 100% rename from packages/prisma-next/src/execution/envelope-json.ts rename to packages/stack-prisma/src/execution/envelope-json.ts diff --git a/packages/prisma-next/src/execution/envelope-string.ts b/packages/stack-prisma/src/execution/envelope-string.ts similarity index 100% rename from packages/prisma-next/src/execution/envelope-string.ts rename to packages/stack-prisma/src/execution/envelope-string.ts diff --git a/packages/prisma-next/src/execution/middleware-registry.ts b/packages/stack-prisma/src/execution/middleware-registry.ts similarity index 100% rename from packages/prisma-next/src/execution/middleware-registry.ts rename to packages/stack-prisma/src/execution/middleware-registry.ts diff --git a/packages/prisma-next/src/execution/routing.ts b/packages/stack-prisma/src/execution/routing.ts similarity index 100% rename from packages/prisma-next/src/execution/routing.ts rename to packages/stack-prisma/src/execution/routing.ts diff --git a/packages/prisma-next/src/execution/sdk.ts b/packages/stack-prisma/src/execution/sdk.ts similarity index 100% rename from packages/prisma-next/src/execution/sdk.ts rename to packages/stack-prisma/src/execution/sdk.ts diff --git a/packages/prisma-next/src/exports/codec-types.ts b/packages/stack-prisma/src/exports/codec-types.ts similarity index 100% rename from packages/prisma-next/src/exports/codec-types.ts rename to packages/stack-prisma/src/exports/codec-types.ts diff --git a/packages/prisma-next/src/exports/column-types.ts b/packages/stack-prisma/src/exports/column-types.ts similarity index 100% rename from packages/prisma-next/src/exports/column-types.ts rename to packages/stack-prisma/src/exports/column-types.ts diff --git a/packages/prisma-next/src/exports/contract-space-typing.ts b/packages/stack-prisma/src/exports/contract-space-typing.ts similarity index 100% rename from packages/prisma-next/src/exports/contract-space-typing.ts rename to packages/stack-prisma/src/exports/contract-space-typing.ts diff --git a/packages/prisma-next/src/exports/control.ts b/packages/stack-prisma/src/exports/control.ts similarity index 100% rename from packages/prisma-next/src/exports/control.ts rename to packages/stack-prisma/src/exports/control.ts diff --git a/packages/prisma-next/src/exports/operation-types.ts b/packages/stack-prisma/src/exports/operation-types.ts similarity index 100% rename from packages/prisma-next/src/exports/operation-types.ts rename to packages/stack-prisma/src/exports/operation-types.ts diff --git a/packages/prisma-next/src/exports/pack.ts b/packages/stack-prisma/src/exports/pack.ts similarity index 100% rename from packages/prisma-next/src/exports/pack.ts rename to packages/stack-prisma/src/exports/pack.ts diff --git a/packages/prisma-next/src/exports/runtime.ts b/packages/stack-prisma/src/exports/runtime.ts similarity index 100% rename from packages/prisma-next/src/exports/runtime.ts rename to packages/stack-prisma/src/exports/runtime.ts diff --git a/packages/prisma-next/src/exports/stack.ts b/packages/stack-prisma/src/exports/stack.ts similarity index 95% rename from packages/prisma-next/src/exports/stack.ts rename to packages/stack-prisma/src/exports/stack.ts index 59276f1dc..b2d57ea9c 100644 --- a/packages/prisma-next/src/exports/stack.ts +++ b/packages/stack-prisma/src/exports/stack.ts @@ -1,5 +1,5 @@ /** - * `@cipherstash/prisma-next/stack` — one-call setup for the + * `@cipherstash/stack-prisma/stack` — one-call setup for the * `@cipherstash/stack` SDK against a Prisma Next contract (EQL v3). * * Most consumers want {@link cipherstashFromStack}: it derives the v3 diff --git a/packages/prisma-next/src/exports/v3.ts b/packages/stack-prisma/src/exports/v3.ts similarity index 97% rename from packages/prisma-next/src/exports/v3.ts rename to packages/stack-prisma/src/exports/v3.ts index 48dceaee9..21734b85a 100644 --- a/packages/prisma-next/src/exports/v3.ts +++ b/packages/stack-prisma/src/exports/v3.ts @@ -1,5 +1,5 @@ /** - * `@cipherstash/prisma-next/v3` — the complete EQL v3 surface in one + * `@cipherstash/stack-prisma/v3` — the complete EQL v3 surface in one * import (decision 1b: v3 is a SEPARATE entry point from the v2 * `./runtime` / `./stack` composition — a client is v2 or v3, never * both; the two runtime descriptors collide if co-registered). diff --git a/packages/prisma-next/src/extension-metadata/codec-metadata.ts b/packages/stack-prisma/src/extension-metadata/codec-metadata.ts similarity index 100% rename from packages/prisma-next/src/extension-metadata/codec-metadata.ts rename to packages/stack-prisma/src/extension-metadata/codec-metadata.ts diff --git a/packages/prisma-next/src/extension-metadata/constants-v3.ts b/packages/stack-prisma/src/extension-metadata/constants-v3.ts similarity index 100% rename from packages/prisma-next/src/extension-metadata/constants-v3.ts rename to packages/stack-prisma/src/extension-metadata/constants-v3.ts diff --git a/packages/prisma-next/src/extension-metadata/constants.ts b/packages/stack-prisma/src/extension-metadata/constants.ts similarity index 100% rename from packages/prisma-next/src/extension-metadata/constants.ts rename to packages/stack-prisma/src/extension-metadata/constants.ts diff --git a/packages/prisma-next/src/extension-metadata/descriptor-meta.ts b/packages/stack-prisma/src/extension-metadata/descriptor-meta.ts similarity index 100% rename from packages/prisma-next/src/extension-metadata/descriptor-meta.ts rename to packages/stack-prisma/src/extension-metadata/descriptor-meta.ts diff --git a/packages/prisma-next/src/migration/cipherstash-codec-v3.ts b/packages/stack-prisma/src/migration/cipherstash-codec-v3.ts similarity index 100% rename from packages/prisma-next/src/migration/cipherstash-codec-v3.ts rename to packages/stack-prisma/src/migration/cipherstash-codec-v3.ts diff --git a/packages/prisma-next/src/migration/eql-bundle-v3.ts b/packages/stack-prisma/src/migration/eql-bundle-v3.ts similarity index 100% rename from packages/prisma-next/src/migration/eql-bundle-v3.ts rename to packages/stack-prisma/src/migration/eql-bundle-v3.ts diff --git a/packages/prisma-next/src/stack/from-stack-v3.ts b/packages/stack-prisma/src/stack/from-stack-v3.ts similarity index 96% rename from packages/prisma-next/src/stack/from-stack-v3.ts rename to packages/stack-prisma/src/stack/from-stack-v3.ts index c144d5c22..b17104c8c 100644 --- a/packages/prisma-next/src/stack/from-stack-v3.ts +++ b/packages/stack-prisma/src/stack/from-stack-v3.ts @@ -1,6 +1,6 @@ /** - * One-call setup for `@cipherstash/prisma-next` against the - * `@cipherstash/stack` EQL v3 client. `@cipherstash/prisma-next` is EQL + * One-call setup for `@cipherstash/stack-prisma` against the + * `@cipherstash/stack` EQL v3 client. `@cipherstash/stack-prisma` is EQL * v3 only; this is the sole `cipherstashFromStack` entry point. * * const cipherstash = await cipherstashFromStack({ contractJson }) @@ -89,7 +89,7 @@ export async function cipherstashFromStack( if (foreignIds.length > 0) { throw new Error( `cipherstashFromStack: contract.json contains non-v3 cipherstash codec ids [${foreignIds.join(', ')}]. ` + - '`@cipherstash/prisma-next` is EQL v3 only — author columns with the v3 ' + + '`@cipherstash/stack-prisma` is EQL v3 only — author columns with the v3 ' + '`cipherstash.*()` constructors and re-emit the contract (`prisma-next contract emit`).', ) } diff --git a/packages/prisma-next/src/types/codec-types.ts b/packages/stack-prisma/src/types/codec-types.ts similarity index 100% rename from packages/prisma-next/src/types/codec-types.ts rename to packages/stack-prisma/src/types/codec-types.ts diff --git a/packages/prisma-next/src/types/operation-types.ts b/packages/stack-prisma/src/types/operation-types.ts similarity index 100% rename from packages/prisma-next/src/types/operation-types.ts rename to packages/stack-prisma/src/types/operation-types.ts diff --git a/packages/prisma-next/src/v3/barrel.ts b/packages/stack-prisma/src/v3/barrel.ts similarity index 100% rename from packages/prisma-next/src/v3/barrel.ts rename to packages/stack-prisma/src/v3/barrel.ts diff --git a/packages/prisma-next/src/v3/bulk-encrypt-v3.ts b/packages/stack-prisma/src/v3/bulk-encrypt-v3.ts similarity index 100% rename from packages/prisma-next/src/v3/bulk-encrypt-v3.ts rename to packages/stack-prisma/src/v3/bulk-encrypt-v3.ts diff --git a/packages/prisma-next/src/v3/catalog.ts b/packages/stack-prisma/src/v3/catalog.ts similarity index 100% rename from packages/prisma-next/src/v3/catalog.ts rename to packages/stack-prisma/src/v3/catalog.ts diff --git a/packages/prisma-next/src/v3/codec-runtime-v3.ts b/packages/stack-prisma/src/v3/codec-runtime-v3.ts similarity index 99% rename from packages/prisma-next/src/v3/codec-runtime-v3.ts rename to packages/stack-prisma/src/v3/codec-runtime-v3.ts index 32e2965fa..ec5a5fe0f 100644 --- a/packages/prisma-next/src/v3/codec-runtime-v3.ts +++ b/packages/stack-prisma/src/v3/codec-runtime-v3.ts @@ -216,7 +216,7 @@ export class CipherstashV3CellCodec< ' extensions: [createCipherstashV3RuntimeDescriptor({ sdk })],\n' + ' middleware: [bulkEncryptMiddlewareV3(sdk)],\n' + ' });\n\n' + - 'Both must close over the SAME `sdk` reference. See the @cipherstash/prisma-next README for the full wiring example.', + 'Both must close over the SAME `sdk` reference. See the @cipherstash/stack-prisma README for the full wiring example.', { codecId: this.descriptor.codecId, reason: 'cipherstash-bulk-encrypt-middleware-not-registered', diff --git a/packages/prisma-next/src/v3/derive-schemas-v3.ts b/packages/stack-prisma/src/v3/derive-schemas-v3.ts similarity index 98% rename from packages/prisma-next/src/v3/derive-schemas-v3.ts rename to packages/stack-prisma/src/v3/derive-schemas-v3.ts index 5bc82a75c..c52d9e356 100644 --- a/packages/prisma-next/src/v3/derive-schemas-v3.ts +++ b/packages/stack-prisma/src/v3/derive-schemas-v3.ts @@ -136,7 +136,7 @@ export function deriveStackSchemasV3( throw new Error( `deriveStackSchemasV3: column "${tableName}"."${columnName}" has v3 codec id "${codecId}" ` + `but nativeType "${nativeType}" maps to no eql/v3 factory. ` + - 'Re-emit the contract with a current @cipherstash/prisma-next.', + 'Re-emit the contract with a current @cipherstash/stack-prisma.', ) } columns[columnName] = factory(columnName) diff --git a/packages/prisma-next/src/v3/envelope-number.ts b/packages/stack-prisma/src/v3/envelope-number.ts similarity index 100% rename from packages/prisma-next/src/v3/envelope-number.ts rename to packages/stack-prisma/src/v3/envelope-number.ts diff --git a/packages/prisma-next/src/v3/from-stack-v3-validate.ts b/packages/stack-prisma/src/v3/from-stack-v3-validate.ts similarity index 100% rename from packages/prisma-next/src/v3/from-stack-v3-validate.ts rename to packages/stack-prisma/src/v3/from-stack-v3-validate.ts diff --git a/packages/prisma-next/src/v3/operators-v3.ts b/packages/stack-prisma/src/v3/operators-v3.ts similarity index 99% rename from packages/prisma-next/src/v3/operators-v3.ts rename to packages/stack-prisma/src/v3/operators-v3.ts index 723204b7a..02957d278 100644 --- a/packages/prisma-next/src/v3/operators-v3.ts +++ b/packages/stack-prisma/src/v3/operators-v3.ts @@ -372,7 +372,7 @@ function requireQueryCast(ctx: ColumnContext, method: string): string { throw operatorError( ctx, method, - `cipherstash ${method}: domain ${ctx.meta.nativeType} passed its capability gate but has no eql_v3.query_* operand type. This is a bug in @cipherstash/prisma-next — please report it.`, + `cipherstash ${method}: domain ${ctx.meta.nativeType} passed its capability gate but has no eql_v3.query_* operand type. This is a bug in @cipherstash/stack-prisma — please report it.`, ) } return cast diff --git a/packages/prisma-next/src/v3/query-term.ts b/packages/stack-prisma/src/v3/query-term.ts similarity index 100% rename from packages/prisma-next/src/v3/query-term.ts rename to packages/stack-prisma/src/v3/query-term.ts diff --git a/packages/prisma-next/src/v3/runtime-v3.ts b/packages/stack-prisma/src/v3/runtime-v3.ts similarity index 100% rename from packages/prisma-next/src/v3/runtime-v3.ts rename to packages/stack-prisma/src/v3/runtime-v3.ts diff --git a/packages/prisma-next/src/v3/sdk-adapter-v3.ts b/packages/stack-prisma/src/v3/sdk-adapter-v3.ts similarity index 100% rename from packages/prisma-next/src/v3/sdk-adapter-v3.ts rename to packages/stack-prisma/src/v3/sdk-adapter-v3.ts diff --git a/packages/prisma-next/src/v3/wire-v3.ts b/packages/stack-prisma/src/v3/wire-v3.ts similarity index 100% rename from packages/prisma-next/src/v3/wire-v3.ts rename to packages/stack-prisma/src/v3/wire-v3.ts diff --git a/packages/prisma-next/test/abort.test.ts b/packages/stack-prisma/test/abort.test.ts similarity index 100% rename from packages/prisma-next/test/abort.test.ts rename to packages/stack-prisma/test/abort.test.ts diff --git a/packages/prisma-next/test/authoring.test.ts b/packages/stack-prisma/test/authoring.test.ts similarity index 100% rename from packages/prisma-next/test/authoring.test.ts rename to packages/stack-prisma/test/authoring.test.ts diff --git a/packages/prisma-next/test/bulk-encrypt-middleware.helpers.ts b/packages/stack-prisma/test/bulk-encrypt-middleware.helpers.ts similarity index 100% rename from packages/prisma-next/test/bulk-encrypt-middleware.helpers.ts rename to packages/stack-prisma/test/bulk-encrypt-middleware.helpers.ts diff --git a/packages/prisma-next/test/bundling-isolation.test.ts b/packages/stack-prisma/test/bundling-isolation.test.ts similarity index 98% rename from packages/prisma-next/test/bundling-isolation.test.ts rename to packages/stack-prisma/test/bundling-isolation.test.ts index a6d2ebdc2..fa7793799 100644 --- a/packages/prisma-next/test/bundling-isolation.test.ts +++ b/packages/stack-prisma/test/bundling-isolation.test.ts @@ -195,7 +195,7 @@ function isAllowedSharedChunk(chunk: string): boolean { } describe('bundling isolation', () => { - it('dist entry files exist (run `pnpm --filter @cipherstash/prisma-next build` first)', () => { + it('dist entry files exist (run `pnpm --filter @cipherstash/stack-prisma build` first)', () => { for (const entry of ENTRY_FILES) { expect(existsSync(join(DIST, entry)), `dist/${entry} is missing`).toBe( true, diff --git a/packages/prisma-next/test/column-types.test.ts b/packages/stack-prisma/test/column-types.test.ts similarity index 100% rename from packages/prisma-next/test/column-types.test.ts rename to packages/stack-prisma/test/column-types.test.ts diff --git a/packages/prisma-next/test/decrypt-all.test.ts b/packages/stack-prisma/test/decrypt-all.test.ts similarity index 100% rename from packages/prisma-next/test/decrypt-all.test.ts rename to packages/stack-prisma/test/decrypt-all.test.ts diff --git a/packages/prisma-next/test/descriptor.test.ts b/packages/stack-prisma/test/descriptor.test.ts similarity index 100% rename from packages/prisma-next/test/descriptor.test.ts rename to packages/stack-prisma/test/descriptor.test.ts diff --git a/packages/prisma-next/test/envelope-bigint.test.ts b/packages/stack-prisma/test/envelope-bigint.test.ts similarity index 100% rename from packages/prisma-next/test/envelope-bigint.test.ts rename to packages/stack-prisma/test/envelope-bigint.test.ts diff --git a/packages/prisma-next/test/envelope-boolean.test.ts b/packages/stack-prisma/test/envelope-boolean.test.ts similarity index 100% rename from packages/prisma-next/test/envelope-boolean.test.ts rename to packages/stack-prisma/test/envelope-boolean.test.ts diff --git a/packages/prisma-next/test/envelope-date.test.ts b/packages/stack-prisma/test/envelope-date.test.ts similarity index 100% rename from packages/prisma-next/test/envelope-date.test.ts rename to packages/stack-prisma/test/envelope-date.test.ts diff --git a/packages/prisma-next/test/envelope-json.test.ts b/packages/stack-prisma/test/envelope-json.test.ts similarity index 100% rename from packages/prisma-next/test/envelope-json.test.ts rename to packages/stack-prisma/test/envelope-json.test.ts diff --git a/packages/prisma-next/test/envelope-string.test.ts b/packages/stack-prisma/test/envelope-string.test.ts similarity index 100% rename from packages/prisma-next/test/envelope-string.test.ts rename to packages/stack-prisma/test/envelope-string.test.ts diff --git a/packages/prisma-next/test/envelope.types.test-d.ts b/packages/stack-prisma/test/envelope.types.test-d.ts similarity index 100% rename from packages/prisma-next/test/envelope.types.test-d.ts rename to packages/stack-prisma/test/envelope.types.test-d.ts diff --git a/packages/prisma-next/test/equality-trait-removal.test.ts b/packages/stack-prisma/test/equality-trait-removal.test.ts similarity index 100% rename from packages/prisma-next/test/equality-trait-removal.test.ts rename to packages/stack-prisma/test/equality-trait-removal.test.ts diff --git a/packages/prisma-next/test/live/bigint-live-pg.test.ts b/packages/stack-prisma/test/live/bigint-live-pg.test.ts similarity index 100% rename from packages/prisma-next/test/live/bigint-live-pg.test.ts rename to packages/stack-prisma/test/live/bigint-live-pg.test.ts diff --git a/packages/prisma-next/test/live/boolean-storage-live-pg.test.ts b/packages/stack-prisma/test/live/boolean-storage-live-pg.test.ts similarity index 100% rename from packages/prisma-next/test/live/boolean-storage-live-pg.test.ts rename to packages/stack-prisma/test/live/boolean-storage-live-pg.test.ts diff --git a/packages/prisma-next/test/live/bulk-encrypt-live-pg.test.ts b/packages/stack-prisma/test/live/bulk-encrypt-live-pg.test.ts similarity index 100% rename from packages/prisma-next/test/live/bulk-encrypt-live-pg.test.ts rename to packages/stack-prisma/test/live/bulk-encrypt-live-pg.test.ts diff --git a/packages/prisma-next/test/live/helpers/eql-v3.ts b/packages/stack-prisma/test/live/helpers/eql-v3.ts similarity index 100% rename from packages/prisma-next/test/live/helpers/eql-v3.ts rename to packages/stack-prisma/test/live/helpers/eql-v3.ts diff --git a/packages/prisma-next/test/live/helpers/harness.ts b/packages/stack-prisma/test/live/helpers/harness.ts similarity index 100% rename from packages/prisma-next/test/live/helpers/harness.ts rename to packages/stack-prisma/test/live/helpers/harness.ts diff --git a/packages/prisma-next/test/live/helpers/live-gate.ts b/packages/stack-prisma/test/live/helpers/live-gate.ts similarity index 100% rename from packages/prisma-next/test/live/helpers/live-gate.ts rename to packages/stack-prisma/test/live/helpers/live-gate.ts diff --git a/packages/prisma-next/test/live/migration-apply-live-pg.test.ts b/packages/stack-prisma/test/live/migration-apply-live-pg.test.ts similarity index 100% rename from packages/prisma-next/test/live/migration-apply-live-pg.test.ts rename to packages/stack-prisma/test/live/migration-apply-live-pg.test.ts diff --git a/packages/prisma-next/test/live/operators-live-pg.test.ts b/packages/stack-prisma/test/live/operators-live-pg.test.ts similarity index 100% rename from packages/prisma-next/test/live/operators-live-pg.test.ts rename to packages/stack-prisma/test/live/operators-live-pg.test.ts diff --git a/packages/prisma-next/test/live/operators-null-live-pg.test.ts b/packages/stack-prisma/test/live/operators-null-live-pg.test.ts similarity index 100% rename from packages/prisma-next/test/live/operators-null-live-pg.test.ts rename to packages/stack-prisma/test/live/operators-null-live-pg.test.ts diff --git a/packages/prisma-next/test/operation-types.types.test-d.ts b/packages/stack-prisma/test/operation-types.types.test-d.ts similarity index 100% rename from packages/prisma-next/test/operation-types.types.test-d.ts rename to packages/stack-prisma/test/operation-types.types.test-d.ts diff --git a/packages/prisma-next/test/psl-interpretation.test.ts b/packages/stack-prisma/test/psl-interpretation.test.ts similarity index 100% rename from packages/prisma-next/test/psl-interpretation.test.ts rename to packages/stack-prisma/test/psl-interpretation.test.ts diff --git a/packages/prisma-next/test/routing.test.ts b/packages/stack-prisma/test/routing.test.ts similarity index 100% rename from packages/prisma-next/test/routing.test.ts rename to packages/stack-prisma/test/routing.test.ts diff --git a/packages/prisma-next/test/sdk.types.test-d.ts b/packages/stack-prisma/test/sdk.types.test-d.ts similarity index 100% rename from packages/prisma-next/test/sdk.types.test-d.ts rename to packages/stack-prisma/test/sdk.types.test-d.ts diff --git a/packages/prisma-next/test/v3/bulk-encrypt-v3.test.ts b/packages/stack-prisma/test/v3/bulk-encrypt-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/bulk-encrypt-v3.test.ts rename to packages/stack-prisma/test/v3/bulk-encrypt-v3.test.ts diff --git a/packages/prisma-next/test/v3/catalog-invariants.test.ts b/packages/stack-prisma/test/v3/catalog-invariants.test.ts similarity index 100% rename from packages/prisma-next/test/v3/catalog-invariants.test.ts rename to packages/stack-prisma/test/v3/catalog-invariants.test.ts diff --git a/packages/prisma-next/test/v3/catalog.test.ts b/packages/stack-prisma/test/v3/catalog.test.ts similarity index 100% rename from packages/prisma-next/test/v3/catalog.test.ts rename to packages/stack-prisma/test/v3/catalog.test.ts diff --git a/packages/prisma-next/test/v3/codec-runtime-v3.test.ts b/packages/stack-prisma/test/v3/codec-runtime-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/codec-runtime-v3.test.ts rename to packages/stack-prisma/test/v3/codec-runtime-v3.test.ts diff --git a/packages/prisma-next/test/v3/codec-types-v3.test-d.ts b/packages/stack-prisma/test/v3/codec-types-v3.test-d.ts similarity index 100% rename from packages/prisma-next/test/v3/codec-types-v3.test-d.ts rename to packages/stack-prisma/test/v3/codec-types-v3.test-d.ts diff --git a/packages/prisma-next/test/v3/column-types.test-d.ts b/packages/stack-prisma/test/v3/column-types.test-d.ts similarity index 100% rename from packages/prisma-next/test/v3/column-types.test-d.ts rename to packages/stack-prisma/test/v3/column-types.test-d.ts diff --git a/packages/prisma-next/test/v3/constants-v3.test.ts b/packages/stack-prisma/test/v3/constants-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/constants-v3.test.ts rename to packages/stack-prisma/test/v3/constants-v3.test.ts diff --git a/packages/prisma-next/test/v3/derive-schemas-v3.test.ts b/packages/stack-prisma/test/v3/derive-schemas-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/derive-schemas-v3.test.ts rename to packages/stack-prisma/test/v3/derive-schemas-v3.test.ts diff --git a/packages/prisma-next/test/v3/envelope-number.test.ts b/packages/stack-prisma/test/v3/envelope-number.test.ts similarity index 100% rename from packages/prisma-next/test/v3/envelope-number.test.ts rename to packages/stack-prisma/test/v3/envelope-number.test.ts diff --git a/packages/prisma-next/test/v3/from-stack-divergence-v3.test.ts b/packages/stack-prisma/test/v3/from-stack-divergence-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/from-stack-divergence-v3.test.ts rename to packages/stack-prisma/test/v3/from-stack-divergence-v3.test.ts diff --git a/packages/prisma-next/test/v3/from-stack-v3.test.ts b/packages/stack-prisma/test/v3/from-stack-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/from-stack-v3.test.ts rename to packages/stack-prisma/test/v3/from-stack-v3.test.ts diff --git a/packages/prisma-next/test/v3/migration-v3.test.ts b/packages/stack-prisma/test/v3/migration-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/migration-v3.test.ts rename to packages/stack-prisma/test/v3/migration-v3.test.ts diff --git a/packages/prisma-next/test/v3/operator-gating-v3.test.ts b/packages/stack-prisma/test/v3/operator-gating-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/operator-gating-v3.test.ts rename to packages/stack-prisma/test/v3/operator-gating-v3.test.ts diff --git a/packages/prisma-next/test/v3/operator-lowering-v3-equality.test.ts b/packages/stack-prisma/test/v3/operator-lowering-v3-equality.test.ts similarity index 100% rename from packages/prisma-next/test/v3/operator-lowering-v3-equality.test.ts rename to packages/stack-prisma/test/v3/operator-lowering-v3-equality.test.ts diff --git a/packages/prisma-next/test/v3/operator-lowering-v3-json.test.ts b/packages/stack-prisma/test/v3/operator-lowering-v3-json.test.ts similarity index 100% rename from packages/prisma-next/test/v3/operator-lowering-v3-json.test.ts rename to packages/stack-prisma/test/v3/operator-lowering-v3-json.test.ts diff --git a/packages/prisma-next/test/v3/operator-lowering-v3-order-range.test.ts b/packages/stack-prisma/test/v3/operator-lowering-v3-order-range.test.ts similarity index 100% rename from packages/prisma-next/test/v3/operator-lowering-v3-order-range.test.ts rename to packages/stack-prisma/test/v3/operator-lowering-v3-order-range.test.ts diff --git a/packages/prisma-next/test/v3/operator-lowering-v3-text-search.test.ts b/packages/stack-prisma/test/v3/operator-lowering-v3-text-search.test.ts similarity index 100% rename from packages/prisma-next/test/v3/operator-lowering-v3-text-search.test.ts rename to packages/stack-prisma/test/v3/operator-lowering-v3-text-search.test.ts diff --git a/packages/prisma-next/test/v3/operator-lowering-v3.helpers.ts b/packages/stack-prisma/test/v3/operator-lowering-v3.helpers.ts similarity index 100% rename from packages/prisma-next/test/v3/operator-lowering-v3.helpers.ts rename to packages/stack-prisma/test/v3/operator-lowering-v3.helpers.ts diff --git a/packages/prisma-next/test/v3/properties.test.ts b/packages/stack-prisma/test/v3/properties.test.ts similarity index 100% rename from packages/prisma-next/test/v3/properties.test.ts rename to packages/stack-prisma/test/v3/properties.test.ts diff --git a/packages/prisma-next/test/v3/runtime-v3.test.ts b/packages/stack-prisma/test/v3/runtime-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/runtime-v3.test.ts rename to packages/stack-prisma/test/v3/runtime-v3.test.ts diff --git a/packages/prisma-next/test/v3/sdk-adapter-v3.test.ts b/packages/stack-prisma/test/v3/sdk-adapter-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/sdk-adapter-v3.test.ts rename to packages/stack-prisma/test/v3/sdk-adapter-v3.test.ts diff --git a/packages/prisma-next/test/v3/vendored-space-parity.test.ts b/packages/stack-prisma/test/v3/vendored-space-parity.test.ts similarity index 100% rename from packages/prisma-next/test/v3/vendored-space-parity.test.ts rename to packages/stack-prisma/test/v3/vendored-space-parity.test.ts diff --git a/packages/prisma-next/test/v3/wire-v3.test.ts b/packages/stack-prisma/test/v3/wire-v3.test.ts similarity index 100% rename from packages/prisma-next/test/v3/wire-v3.test.ts rename to packages/stack-prisma/test/v3/wire-v3.test.ts diff --git a/packages/prisma-next/tsconfig.json b/packages/stack-prisma/tsconfig.json similarity index 100% rename from packages/prisma-next/tsconfig.json rename to packages/stack-prisma/tsconfig.json diff --git a/packages/prisma-next/tsup.config.ts b/packages/stack-prisma/tsup.config.ts similarity index 100% rename from packages/prisma-next/tsup.config.ts rename to packages/stack-prisma/tsup.config.ts diff --git a/packages/prisma-next/turbo.json b/packages/stack-prisma/turbo.json similarity index 100% rename from packages/prisma-next/turbo.json rename to packages/stack-prisma/turbo.json diff --git a/packages/prisma-next/vitest.config.ts b/packages/stack-prisma/vitest.config.ts similarity index 100% rename from packages/prisma-next/vitest.config.ts rename to packages/stack-prisma/vitest.config.ts diff --git a/packages/stack/__tests__/logger-edge-safety.test.ts b/packages/stack/__tests__/logger-edge-safety.test.ts index 87e607f40..f6f441c67 100644 --- a/packages/stack/__tests__/logger-edge-safety.test.ts +++ b/packages/stack/__tests__/logger-edge-safety.test.ts @@ -3,7 +3,7 @@ * (`src/adapter-kit.ts:60`), and three first-party adapters value-import * adapter-kit: `packages/stack-supabase/src/column-map.ts:1`, * `packages/stack-drizzle/src/column.ts:1`, - * `packages/prisma-next/src/exports/column-types.ts:19`. A realm with no + * `packages/stack-prisma/src/exports/column-types.ts:19`. A realm with no * `process` binding turns an unguarded module-scope `process.env` read in the * logger into a `ReferenceError` at import time on exactly the runtimes those * builds exist to serve. diff --git a/packages/stack/__tests__/types-public-surface.test-d.ts b/packages/stack/__tests__/types-public-surface.test-d.ts index 68d3ac5c6..70886ae1f 100644 --- a/packages/stack/__tests__/types-public-surface.test-d.ts +++ b/packages/stack/__tests__/types-public-surface.test-d.ts @@ -9,7 +9,7 @@ * - REMOVING a name breaks consumers who legitimately need to NAME a type that * appears in a public signature (declaring a variable before the `await`, * typing an adapter's parameter). `@cipherstash/stack-drizzle`, - * `@cipherstash/stack-supabase` and `@cipherstash/prisma-next` all import from + * `@cipherstash/stack-supabase` and `@cipherstash/stack-prisma` all import from * this subpath. * - ADDING a name is how the EQL v2 authoring surface comes back. `src/types.ts` * still declares v2-shaped types — the client must keep DECRYPTING v2 payloads, diff --git a/packages/stack/__tests__/wasm-inline-bundle-isolation.test.ts b/packages/stack/__tests__/wasm-inline-bundle-isolation.test.ts index 2e8a65e27..38f6c5e64 100644 --- a/packages/stack/__tests__/wasm-inline-bundle-isolation.test.ts +++ b/packages/stack/__tests__/wasm-inline-bundle-isolation.test.ts @@ -23,7 +23,7 @@ import { describe, expect, it } from 'vitest' // see it — they mock the `/wasm-inline` subpath and run under Node, where the // native root resolves fine — so the assertion has to be on the built artifact. // -// Mirrors `packages/prisma-next/test/bundling-isolation.test.ts`. +// Mirrors `packages/stack-prisma/test/bundling-isolation.test.ts`. const packageRoot = path.resolve(fileURLToPath(import.meta.url), '../..') const distDir = path.join(packageRoot, 'dist') diff --git a/packages/wizard/src/lib/install-skills.ts b/packages/wizard/src/lib/install-skills.ts index 68c6831cf..a870652f2 100644 --- a/packages/wizard/src/lib/install-skills.ts +++ b/packages/wizard/src/lib/install-skills.ts @@ -36,7 +36,7 @@ export const SKILL_MAP: Record = { ], prisma: [ 'stash-encryption', - 'stash-prisma-next', + 'stash-prisma', 'stash-indexing', 'stash-deployment', 'stash-zerokms', diff --git a/packages/wizard/tsconfig.json b/packages/wizard/tsconfig.json index 7cc1059cb..d85358a58 100644 --- a/packages/wizard/tsconfig.json +++ b/packages/wizard/tsconfig.json @@ -14,7 +14,7 @@ // not include `node` by default, so without this the wizard's three // `auth.AutoStrategy` call sites fail to typecheck even though they run // fine — the wizard is a Node CLI and always loads the `node` branch. - // Matches `packages/stack`, `packages/prisma-next`, `packages/test-kit`, + // Matches `packages/stack`, `packages/stack-prisma`, `packages/test-kit`, // `packages/stack-drizzle` and `packages/stack-supabase`. "customConditions": ["node"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb4888fe8..8af502263 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,12 +142,12 @@ importers: examples/prisma: dependencies: - '@cipherstash/prisma-next': - specifier: workspace:* - version: link:../../packages/prisma-next '@cipherstash/stack': specifier: workspace:* version: link:../../packages/stack + '@cipherstash/stack-prisma': + specifier: workspace:* + version: link:../../packages/stack-prisma '@prisma-next/adapter-postgres': specifier: 0.16.0 version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) @@ -374,100 +374,6 @@ importers: specifier: 4.62.2 version: 4.62.2 - packages/prisma-next: - dependencies: - '@cipherstash/eql': - specifier: 3.0.2 - version: 3.0.2 - '@cipherstash/stack': - specifier: workspace:* - version: link:../stack - '@prisma-next/contract': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/family-sql': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/framework-components': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/migration-tools': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-contract': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-operations': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-relational-core': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-runtime': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/ts-render': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/utils': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - arktype: - specifier: ^2.2.3 - version: 2.2.3 - devDependencies: - '@cipherstash/test-kit': - specifier: workspace:* - version: link:../test-kit - '@prisma-next/adapter-postgres': - specifier: 0.16.0 - version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) - '@prisma-next/cli': - specifier: 0.16.0 - version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) - '@prisma-next/driver-postgres': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/extension-author-tools': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/psl-parser': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-contract-psl': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-contract-ts': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/sql-schema-ir': - specifier: 0.16.0 - version: 0.16.0(typescript@5.9.3) - '@prisma-next/target-postgres': - specifier: 0.16.0 - version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) - dotenv: - specifier: 17.4.2 - version: 17.4.2 - fast-check: - specifier: ^4.8.0 - version: 4.9.0 - pathe: - specifier: ^2.0.3 - version: 2.0.3 - postgres: - specifier: ^3.4.8 - version: 3.4.9 - tsup: - specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.14)(tsx@4.23.0)(typescript@5.9.3)(yaml@2.9.0) - typescript: - specifier: catalog:repo - version: 5.9.3 - vitest: - specifier: catalog:repo - version: 3.2.7(@types/node@26.1.1)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.0)(yaml@2.9.0) - packages/stack: dependencies: '@byteslice/result': @@ -603,6 +509,100 @@ importers: specifier: catalog:repo version: 3.2.7(@types/node@26.1.1)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.0)(yaml@2.9.0) + packages/stack-prisma: + dependencies: + '@cipherstash/eql': + specifier: 3.0.2 + version: 3.0.2 + '@cipherstash/stack': + specifier: workspace:* + version: link:../stack + '@prisma-next/contract': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/family-sql': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/framework-components': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/migration-tools': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-contract': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-operations': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-relational-core': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-runtime': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/ts-render': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/utils': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + arktype: + specifier: ^2.2.3 + version: 2.2.3 + devDependencies: + '@cipherstash/test-kit': + specifier: workspace:* + version: link:../test-kit + '@prisma-next/adapter-postgres': + specifier: 0.16.0 + version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) + '@prisma-next/cli': + specifier: 0.16.0 + version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) + '@prisma-next/driver-postgres': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/extension-author-tools': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/psl-parser': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-contract-psl': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-contract-ts': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/sql-schema-ir': + specifier: 0.16.0 + version: 0.16.0(typescript@5.9.3) + '@prisma-next/target-postgres': + specifier: 0.16.0 + version: 0.16.0(typanion@3.14.0)(typescript@5.9.3) + dotenv: + specifier: 17.4.2 + version: 17.4.2 + fast-check: + specifier: ^4.8.0 + version: 4.9.0 + pathe: + specifier: ^2.0.3 + version: 2.0.3 + postgres: + specifier: ^3.4.8 + version: 3.4.9 + tsup: + specifier: catalog:repo + version: 8.5.1(jiti@2.7.0)(postcss@8.5.14)(tsx@4.23.0)(typescript@5.9.3)(yaml@2.9.0) + typescript: + specifier: catalog:repo + version: 5.9.3 + vitest: + specifier: catalog:repo + version: 3.2.7(@types/node@26.1.1)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.0)(yaml@2.9.0) + packages/stack-supabase: dependencies: '@cipherstash/stack': diff --git a/scripts/__tests__/workflow-turbo-build-deps.test.mjs b/scripts/__tests__/workflow-turbo-build-deps.test.mjs index 82386574d..50261d4be 100644 --- a/scripts/__tests__/workflow-turbo-build-deps.test.mjs +++ b/scripts/__tests__/workflow-turbo-build-deps.test.mjs @@ -56,7 +56,7 @@ const WORKFLOWS = readdirSync(resolve(REPO_ROOT, '.github/workflows')) * not add to it. Route new steps through `turbo run` instead. */ const KNOWN_BARE = new Set([ - 'pnpm --filter @cipherstash/prisma-next run typecheck', + 'pnpm --filter @cipherstash/stack-prisma run typecheck', 'pnpm --filter @cipherstash/wizard run typecheck', ]) @@ -110,7 +110,7 @@ function invokedTask(line) { * Only ever consult this for an UNFILTERED invocation. `pnpm --filter * ` runs that package's script, so the root script's delegation says * nothing about it — reading it either way exempted a genuinely bare - * `pnpm --filter @cipherstash/prisma-next-example test:e2e` purely because the + * `pnpm --filter @cipherstash/prisma-example test:e2e` purely because the * root happens to define `"test:e2e": "turbo run test:e2e"` (#787 review * follow-up). */ diff --git a/skills/stash-deployment/SKILL.md b/skills/stash-deployment/SKILL.md index 1d32ba023..88285d4d0 100644 --- a/skills/stash-deployment/SKILL.md +++ b/skills/stash-deployment/SKILL.md @@ -14,7 +14,7 @@ user reads the row. This skill covers how to sequence that across deploys. For the API and the lifecycle model see `stash-encryption`; for the commands see `stash-cli`; for -framework specifics see `stash-drizzle` / `stash-supabase` / `stash-prisma-next`. +framework specifics see `stash-drizzle` / `stash-supabase` / `stash-prisma`. Everything here describes **EQL v3**, the only authoring generation. The EQL v2 rollout commands were removed — `stash encrypt cutover` (the old v2 rename swap) @@ -170,7 +170,7 @@ Then **build the `eql_v3.*` extractor indexes** for every capability you query a index maintenance during the backfill, and the switched reads engage an index from the first query. Ship the DDL through whatever migration flow owns the schema — a Drizzle or Supabase migration, an index migration in the Prisma Next graph -(never out-of-band there — see `stash-prisma-next`), or your SQL migration tool. +(never out-of-band there — see `stash-prisma`), or your SQL migration tool. Never ad-hoc against production. Recipes in `stash-indexing`. ### Deploy 2 — read cutover @@ -322,7 +322,7 @@ every deploy. Prisma Next is **contract-first**: `contract.prisma` is emitted to `contract.json` / `contract.d.ts`, and the database is advanced along a migration graph. CipherStash -integrates through `@cipherstash/prisma-next`, which contributes its own contract +integrates through `@cipherstash/stack-prisma`, which contributes its own contract space, so **EQL installs as part of your migration graph** — `prisma-next migrate` (the top-level apply verb) installs the bundle alongside your schema. Never `stash eql install`, which refuses on a Prisma Next project. @@ -468,4 +468,4 @@ id is printed in the check output itself. - **`stash-zerokms`** — the keyset/grant model that governs who can decrypt what - **`stash-auth`** — auth strategies, the `CS_*` variables, and credential resolution order - **`stash-edge`** — edge/serverless runtimes and the `@cipherstash/stack/wasm-inline` entry -- **`stash-prisma-next`** / **`stash-drizzle`** / **`stash-supabase`** — integration specifics +- **`stash-prisma`** / **`stash-drizzle`** / **`stash-supabase`** — integration specifics diff --git a/skills/stash-encryption/SKILL.md b/skills/stash-encryption/SKILL.md index b2b776c61..2999f217e 100644 --- a/skills/stash-encryption/SKILL.md +++ b/skills/stash-encryption/SKILL.md @@ -981,7 +981,7 @@ Useful when the backfill needs to run in a worker, on a schedule, or alongside a |---|---|---| | Drizzle ORM | `@cipherstash/stack-drizzle` — v3 column factories (each `types.*` factory emits its domain as the column's SQL type for `drizzle-kit generate`), schema extraction, auto-encrypting operators (`ops.eq`, `ops.matches`, `ops.contains`, `ops.selector`, `ops.asc`, ...) | `stash-drizzle` | | Supabase | `encryptedSupabase` from `@cipherstash/stack-supabase` — schema-aware query builder (`eq`, `matches`, `contains`, `selectorEq`/`selectorNe`, ...) that works through PostgREST, including as `anon` | `stash-supabase` | -| Prisma | `@cipherstash/prisma-next` — searchable field-level encryption for Postgres | — | +| Prisma | `@cipherstash/stack-prisma` — searchable field-level encryption for Postgres | — | | DynamoDB | `encryptedDynamoDB` from `@cipherstash/stack/dynamodb` — encrypt is **EQL v3 only**; decrypt still reads existing v2 items | `stash-dynamodb` | ## Complete API Reference diff --git a/skills/stash-indexing/SKILL.md b/skills/stash-indexing/SKILL.md index 08b803648..4dc3de8cd 100644 --- a/skills/stash-indexing/SKILL.md +++ b/skills/stash-indexing/SKILL.md @@ -255,7 +255,7 @@ Index not being used: **The integrations emit the query operators for you — none applies index DDL on its own. Making sure these indexes exist is always your job.** This skill is the general model — recipes, engagement rules, verification. How to apply it in a specific integration lives in that integration's skill: - **Drizzle** — `encryptedIndexes(t)` from `@cipherstash/stack-drizzle` derives the recommended indexes for every encrypted column in the table, or declare individual expression indexes in the schema DSL. See `stash-drizzle` § Indexing Encrypted Columns. -- **Prisma Next** — Prisma's schema language cannot express functional indexes; the DDL goes in a migration in the adapter's flow. See `stash-prisma-next`. +- **Prisma Next** — Prisma's schema language cannot express functional indexes; the DDL goes in a migration in the adapter's flow. See `stash-prisma`. - **Supabase** — a `supabase/migrations/` file; no superuser needed (see above). See `stash-supabase`. - **Raw SQL / plain PostgreSQL** — the recipes in this skill, in whatever migration tool owns the schema. Never ad-hoc in production. The predicates those indexes serve are in `stash-postgres`. @@ -270,6 +270,6 @@ Index not being used: - `stash-encryption` — the `types.*` domain catalog, wire-format operators and ordering, and the staged rollout lifecycle. - `stash-cli` — `stash eql install`, `stash db validate` (its "No indexes on an encrypted column" Info finding is resolved by this skill), and `stash encrypt backfill` / `drop`. -- `stash-drizzle`, `stash-supabase`, `stash-prisma-next` — per-integration query patterns; index DDL placement per the section above. +- `stash-drizzle`, `stash-supabase`, `stash-prisma` — per-integration query patterns; index DDL placement per the section above. - `stash-postgres` — the hand-written predicate forms these indexes serve (`pg` / `postgres-js`, no ORM). - `stash-edge` — the WASM entry, for apps whose queries run on Deno / Workers / Supabase Edge Functions. diff --git a/skills/stash-postgres/SKILL.md b/skills/stash-postgres/SKILL.md index 35f422d5c..4f01be7b7 100644 --- a/skills/stash-postgres/SKILL.md +++ b/skills/stash-postgres/SKILL.md @@ -20,7 +20,7 @@ An EQL v3 encrypted column is a **Postgres domain over `jsonb`** (`public.eql_v3 This covers the `pg` and `postgres-js` drivers with no ORM — plain Node services, Hono, edge functions. If you use Drizzle, Prisma Next, or the Supabase client, those integrations emit correct operands for you: see -`stash-drizzle`, `stash-prisma-next`, `stash-supabase` instead. +`stash-drizzle`, `stash-prisma`, `stash-supabase` instead. > **Using CipherStash Proxy? None of this applies.** This skill assumes the > app connects to Postgres **directly** and encrypts **client-side**: Stack diff --git a/skills/stash-prisma-next/SKILL.md b/skills/stash-prisma/SKILL.md similarity index 88% rename from skills/stash-prisma-next/SKILL.md rename to skills/stash-prisma/SKILL.md index 35f02688d..f91af86d1 100644 --- a/skills/stash-prisma-next/SKILL.md +++ b/skills/stash-prisma/SKILL.md @@ -1,17 +1,17 @@ --- -name: stash-prisma-next -description: Integrate CipherStash searchable field-level encryption with Prisma Next using @cipherstash/prisma-next (EQL v3). Covers the full 31-constructor catalog of domain-named encrypted column types in schema.prisma (per plaintext type × capability tier — Text/TextEq/TextOrd/TextMatch/TextSearch, Integer/Smallint/BigInt/Numeric/Real/Double × Eq/Ord, Date/Timestamp × Eq/Ord, Boolean, Json), the one-call cipherstashFromStack wiring, the runtime value envelopes (EncryptedString/Number/BigInt/Date/Boolean/Json) and decryptAll, the eql* query operators (eqlEq, eqlMatch, eqlGt, eqlBetween, eqlIn, eqlJsonContains, eqlAsc/eqlDesc, eqlJsonPathAsc/eqlJsonPathDesc), EQL bundle installation via prisma-next migrate, and authentication. Use when adding encryption to a Prisma Next project, choosing a column type, or querying encrypted columns. +name: stash-prisma +description: Integrate CipherStash searchable field-level encryption with Prisma Next using @cipherstash/stack-prisma (EQL v3). Covers the full 31-constructor catalog of domain-named encrypted column types in schema.prisma (per plaintext type × capability tier — Text/TextEq/TextOrd/TextMatch/TextSearch, Integer/Smallint/BigInt/Numeric/Real/Double × Eq/Ord, Date/Timestamp × Eq/Ord, Boolean, Json), the one-call cipherstashFromStack wiring, the runtime value envelopes (EncryptedString/Number/BigInt/Date/Boolean/Json) and decryptAll, the eql* query operators (eqlEq, eqlMatch, eqlGt, eqlBetween, eqlIn, eqlJsonContains, eqlAsc/eqlDesc, eqlJsonPathAsc/eqlJsonPathDesc), EQL bundle installation via prisma-next migrate, and authentication. Use when adding encryption to a Prisma Next project, choosing a column type, or querying encrypted columns. --- # CipherStash Stack — Prisma Next Integration Guide for searchable field-level encryption in a **Prisma Next** app with -`@cipherstash/prisma-next` (EQL v3), powered by `@cipherstash/stack`. You declare +`@cipherstash/stack-prisma` (EQL v3), powered by `@cipherstash/stack`. You declare encrypted columns directly in `schema.prisma`; Prisma Next's migration system installs the EQL bundle in the same sweep that creates your tables — there is no separate `stash eql install` step. -> `@cipherstash/prisma-next` is **EQL v3 only** — there is no EQL v2 surface. +> `@cipherstash/stack-prisma` is **EQL v3 only** — there is no EQL v2 surface. > Everything below is v3. In EQL v3 every encrypted column is a **concrete Postgres domain** @@ -30,7 +30,7 @@ capability semantics; this skill covers the Prisma-Next-specific surface. ## Installation ```bash -npm install @cipherstash/stack @cipherstash/prisma-next +npm install @cipherstash/stack @cipherstash/stack-prisma ``` Or run `npx stash init --prisma-next`, which detects Prisma Next, installs both @@ -101,7 +101,7 @@ sort needs the matching `*Eq` / `*Ord` / text-search domain. ### 2. Register the extension pack in `prisma-next.config.ts` ```typescript -import cipherstash from '@cipherstash/prisma-next/control' +import cipherstash from '@cipherstash/stack-prisma/control' import { defineConfig } from '@prisma-next/cli/config-types' import { prismaContract } from '@prisma-next/sql-contract-psl/provider' import postgresPack from '@prisma-next/target-postgres/pack' @@ -127,7 +127,7 @@ longer materialises a placeholder namespace. Omitting it fails at runtime with ```typescript import 'dotenv/config' -import { cipherstashFromStack } from '@cipherstash/prisma-next/v3' +import { cipherstashFromStack } from '@cipherstash/stack-prisma/v3' import postgres from '@prisma-next/postgres/runtime' import type { Contract } from './prisma/contract.d' import contractJson from './prisma/contract.json' with { type: 'json' } @@ -242,7 +242,7 @@ import { decryptAll, EncryptedString, EncryptedNumber, EncryptedBigInt, EncryptedDate, EncryptedBoolean, EncryptedJson, -} from '@cipherstash/prisma-next/runtime' +} from '@cipherstash/stack-prisma/runtime' await db.orm.public.User.create({ id: 'user-0', @@ -301,11 +301,11 @@ await db.orm.public.User.where((u) => u.preferences.eqlJsonPathEq('$.theme', 'da // JSONPath ordering (ciphertext-free selector + scalar term) await db.orm.public.User.where((u) => u.preferences.eqlJsonPathGte('$.score', 80)).all() // ordering -import { eqlAsc } from '@cipherstash/prisma-next/runtime' +import { eqlAsc } from '@cipherstash/stack-prisma/runtime' await db.orm.public.User.orderBy((u) => eqlAsc(u.salary)).all() // ordering by a JSONPath leaf; missing paths follow PostgreSQL NULL ordering -import { eqlJsonPathAsc } from '@cipherstash/prisma-next/runtime' +import { eqlJsonPathAsc } from '@cipherstash/stack-prisma/runtime' await db.orm.public.User.orderBy((u) => eqlJsonPathAsc(u.preferences, '$.score')).all() ``` @@ -339,11 +339,11 @@ Run Prisma Next apps on a Node runtime where the native module loads. | Subpath | Purpose | |---|---| -| `@cipherstash/prisma-next/v3` | The v3 surface: `cipherstashFromStack`, the SDK adapter, envelopes/middleware | -| `@cipherstash/prisma-next/control` | The extension pack for `extensionPacks: [...]` | -| `@cipherstash/prisma-next/runtime` | Envelope classes, `decryptAll`, `eql*` operators, `EncryptedString.from()`… | -| `@cipherstash/prisma-next/stack` | One-call setup against `@cipherstash/stack`: `cipherstashFromStack` | -| `@cipherstash/prisma-next/column-types` | camelCase factories (`textSearch`, `bigIntOrd`, …) for **TS-authored** contracts — emits byte-identical `contract.json` to the PSL constructors | +| `@cipherstash/stack-prisma/v3` | The v3 surface: `cipherstashFromStack`, the SDK adapter, envelopes/middleware | +| `@cipherstash/stack-prisma/control` | The extension pack for `extensionPacks: [...]` | +| `@cipherstash/stack-prisma/runtime` | Envelope classes, `decryptAll`, `eql*` operators, `EncryptedString.from()`… | +| `@cipherstash/stack-prisma/stack` | One-call setup against `@cipherstash/stack`: `cipherstashFromStack` | +| `@cipherstash/stack-prisma/column-types` | camelCase factories (`textSearch`, `bigIntOrd`, …) for **TS-authored** contracts — emits byte-identical `contract.json` to the PSL constructors | ## Gotchas