Skip to content

Commit 05804eb

Browse files
authored
Merge pull request #378 from cipherstash/changeset-release/main
Version Packages
2 parents a41db4c + 480dedf commit 05804eb

3 files changed

Lines changed: 19 additions & 18 deletions

File tree

.changeset/cli-load-stash-config-unwrap.md

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

packages/cli/CHANGELOG.md

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

3+
## 0.10.0
4+
5+
### Minor Changes
6+
7+
- 79f4a0b: Fix `loadStashConfig` to correctly unwrap the default export from `stash.config.ts`. Previously, any database-touching command (`db install`, `db push`, `db validate`, `db status`, `db test-connection`, `schema build`) would fail validation against a perfectly valid config with:
8+
9+
```
10+
Error: Invalid stash.config.ts
11+
12+
- databaseUrl: Invalid input: expected nonoptional, received undefined
13+
```
14+
15+
The issue: in jiti 2.x, the `interopDefault: true` option passed to `createJiti(...)` only applies to the deprecated synchronous `jiti(id)` callable form. The async `jiti.import()` ignores it and always returns the full module namespace. With `export default defineConfig({...})` that meant Zod was validating `{ default: { databaseUrl, client } }` and reporting `databaseUrl` as undefined even when the user's config plainly set it.
16+
17+
Switched to jiti's per-call `{ default: true }` option, which does work on `jiti.import()`. Added an integration test that exercises real jiti against a real temp `stash.config.ts` so future regressions get caught — the previous mocked test was passing the bug straight through.
18+
19+
This bug surfaced after `db install` started loading `stash.config.ts` (during the onboarding overhaul), but affected every other command that reads the config.
20+
321
## 0.9.0
422

523
### Minor 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": "@cipherstash/cli",
3-
"version": "0.9.0",
3+
"version": "0.10.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>",

0 commit comments

Comments
 (0)