Skip to content

Commit af78001

Browse files
authored
Merge pull request #383 from cipherstash/changeset-release/main
Version Packages
2 parents 209aabe + 3897c2e commit af78001

16 files changed

Lines changed: 122 additions & 89 deletions

.changeset/breezy-cloths-wave.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

.changeset/cli-database-url-resolution.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.changeset/sweet-balloons-relate.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/tighten-supply-chain-security.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/basic/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @cipherstash/basic-example
22

3+
## 1.2.9
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [afe6810]
8+
- @cipherstash/stack@0.15.3
9+
310
## 1.2.8
411

512
### Patch Changes

examples/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@cipherstash/basic-example",
33
"private": true,
4-
"version": "1.2.8",
4+
"version": "1.2.9",
55
"type": "module",
66
"scripts": {
77
"start": "tsx index.ts"

packages/cli/CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# @cipherstash/cli
22

3+
## 0.11.0
4+
5+
### Minor Changes
6+
7+
- de9c02c: Rename the CLI package from `@cipherstash/cli` to `stash`. The published code, commands, and flags are unchanged — this is a pure rename so the day-to-day invocation drops from `npx @cipherstash/cli ...` to `npx stash ...`.
8+
9+
**Migration**
10+
11+
1. Update your `package.json` devDependencies:
12+
13+
```diff
14+
- "@cipherstash/cli": "^0.10.0"
15+
+ "stash": "^0.10.1"
16+
```
17+
18+
2. Update the `defineConfig` import in `stash.config.ts`:
19+
20+
```diff
21+
- import { defineConfig } from '@cipherstash/cli'
22+
+ import { defineConfig } from 'stash'
23+
```
24+
25+
3. Update any `npx @cipherstash/cli ...` / `bunx @cipherstash/cli ...` / `pnpm dlx @cipherstash/cli ...` / `yarn dlx @cipherstash/cli ...` invocations in scripts, CI, READMEs, and team docs to use `stash` instead. Programmatic exports (`defineConfig`, `loadStashConfig`, `EQLInstaller`, `loadBundledEqlSql`, `downloadEqlSql`, `PermissionCheckResult`) are re-exported from `stash` with the same shapes.
26+
27+
**Wizard impact (`@cipherstash/wizard`)**
28+
29+
The wizard's post-agent step and its prerequisite / agent-error hints now reference `stash` (e.g. `Run: bunx stash auth login`, `Running bunx stash db install...`) rather than `@cipherstash/cli`. The wizard package name and `stash-wizard` binary are unchanged — only the strings the wizard prints and the commands it shells out to are affected.
30+
31+
- 8ee11fd: Layered `DATABASE_URL` resolution for DB / schema commands.
32+
33+
Previously, any DB-touching command (`db install`, `db push`, `db upgrade`, `db status`, `db validate`, `db test-connection`, `schema build`) failed with the cryptic Zod error:
34+
35+
```
36+
Error: Invalid stash.config.ts
37+
- databaseUrl: Invalid input: expected nonoptional, received undefined
38+
```
39+
40+
if `DATABASE_URL` wasn't already in the environment. The CLI auto-loaded `.env.local` / `.env.development.local` / `.env.development` / `.env`, but had no story for `--database-url` flags, local Supabase, or pasted-once values.
41+
42+
The scaffolded `stash.config.ts` now calls a resolver directly:
43+
44+
```ts
45+
import { defineConfig, resolveDatabaseUrl } from "stash";
46+
47+
export default defineConfig({
48+
databaseUrl: await resolveDatabaseUrl(),
49+
client: "./src/encryption/index.ts",
50+
});
51+
```
52+
53+
`resolveDatabaseUrl()` walks sources in order; first hit wins:
54+
55+
1. `--database-url <url>` flag — new, accepted on all seven DB / schema commands. Used for this run only; never written to disk.
56+
2. `process.env.DATABASE_URL` — covers shell exports, mise, direnv, dotenv-cli, the existing dotenv loads.
57+
3. `supabase status --output env``DB_URL` — auto-engaged when `--supabase` is set or a `supabase/config.toml` is detected. Useful for local Supabase users who haven't exported the URL yet.
58+
4. Interactive prompt — opens with a tip listing the alternatives (flag, env, the user's actual dotenv file). Skipped under `CI=true` or non-TTY stdin.
59+
5. Hard fail with a source-naming error message.
60+
61+
The connection string is **never persisted to disk**`stash.config.ts` only contains the `await resolveDatabaseUrl()` call, never a literal URL. The resolver also doesn't mutate `process.env`; CLI flag context is threaded into the config evaluation via `AsyncLocalStorage` so concurrent loads stay isolated. Source labels are logged on non-env paths (`Using DATABASE_URL from --database-url flag` / `from supabase status` / `from prompt`) but the URL itself is never echoed.
62+
63+
`db test-connection`'s connection-failure hint is now source-aware: it points users at `--database-url`, the env var, and the actual dotenv file in their project (`.env.local` if present, `.env` otherwise) — not the misleading `stash.config.ts` it used to suggest.
64+
365
## 0.10.1
466

567
### Patch Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stash",
3-
"version": "0.10.1",
3+
"version": "0.11.0",
44
"description": "CipherStash CLI — the one stash command for auth, init, encryption schema, database setup, and secrets.",
55
"license": "MIT",
66
"author": "CipherStash <hello@cipherstash.com>",

packages/protect-dynamodb/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @cipherstash/protect-dynamodb
22

3+
## 11.0.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [afe6810]
8+
- @cipherstash/protect@11.1.1
9+
310
## 11.0.0
411

512
### Patch Changes

packages/protect-dynamodb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cipherstash/protect-dynamodb",
3-
"version": "11.0.0",
3+
"version": "11.0.1",
44
"description": "Protect.js DynamoDB Helpers",
55
"keywords": [
66
"dynamodb",

0 commit comments

Comments
 (0)