@everystack/cli 0.4.74 → 0.4.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/cli/commands/db-adopt.ts +14 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@everystack/cli` are documented here.
|
|
|
4
4
|
|
|
5
5
|
Format based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
6
|
|
|
7
|
+
## [0.4.75] - 2026-09-06
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- db:adopt proof-compile renders inside the project, not $TMPDIR
|
|
12
|
+
|
|
7
13
|
## [0.4.74] - 2026-09-06
|
|
8
14
|
|
|
9
15
|
### BREAKING CHANGES
|
package/package.json
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import fs from 'node:fs/promises';
|
|
27
|
-
import os from 'node:os';
|
|
28
27
|
import path from 'node:path';
|
|
29
28
|
import { introspectSchema, type SchemaSnapshot } from '../schema-introspect';
|
|
30
29
|
import { introspectContract, type AuthzContract, type QueryRunner } from '../authz-contract';
|
|
@@ -186,7 +185,14 @@ export async function dbAdoptCommand(
|
|
|
186
185
|
process.exit(1);
|
|
187
186
|
}
|
|
188
187
|
|
|
189
|
-
|
|
188
|
+
// The proof-compile sandbox MUST live inside the project, never the OS temp dir. The rendered
|
|
189
|
+
// barrel imports `@everystack/model`, and Node resolves a bare specifier by walking UP from the
|
|
190
|
+
// importing file looking for node_modules. pnpm hoists workspace packages to the repo root (an
|
|
191
|
+
// app dir has no local copy), so a dir under $TMPDIR cannot reach them and the compile crashes
|
|
192
|
+
// with "Cannot find module '@everystack/model'". cwd is inside the project, so a sandbox under it
|
|
193
|
+
// resolves exactly as the real db/models barrel will. (Reported by a consumer on 0.4.74; the
|
|
194
|
+
// scratch-sweep harness documents the same rule: $TMPDIR → MODULE_NOT_FOUND, project dir resolves.)
|
|
195
|
+
const sandboxDir = opts.sandboxDir ?? await fs.mkdtemp(path.join(process.cwd(), '.everystack-adopt-'));
|
|
190
196
|
let exitCode: 0 | 1 = 1;
|
|
191
197
|
let end: (() => Promise<void>) | undefined;
|
|
192
198
|
try {
|
|
@@ -209,7 +215,12 @@ export async function dbAdoptCommand(
|
|
|
209
215
|
({ exitCode } = await applyAdoptVerdict(result, outDir));
|
|
210
216
|
} catch (err: any) {
|
|
211
217
|
fail(err.message);
|
|
212
|
-
|
|
218
|
+
// A failure to load the rendered barrel is a COMPILE error, not a connection or IAM problem —
|
|
219
|
+
// don't send the operator to check their credentials for it.
|
|
220
|
+
if (/Could not load models|Cannot find module/i.test(err.message ?? '')) {
|
|
221
|
+
info('This is the proof-compile step, not the database. The rendered Models could not be loaded —');
|
|
222
|
+
info('run db:adopt from inside your project (where @everystack/model resolves), and check the models compile.');
|
|
223
|
+
} else if (dbSource.kind === 'url') {
|
|
213
224
|
info('Check the connection string and that the database is accepting connections.');
|
|
214
225
|
} else {
|
|
215
226
|
for (const line of opsAdviceLines(err, [
|