oathbound 0.11.0 → 0.11.1
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/cli.ts +32 -2
- package/package.json +1 -1
package/cli.ts
CHANGED
|
@@ -24,9 +24,9 @@ import { push } from './push';
|
|
|
24
24
|
// Re-exports for tests
|
|
25
25
|
export { stripJsoncComments, writeOathboundConfig, mergeClaudeSettings, type MergeResult } from './config';
|
|
26
26
|
export { isNewer } from './update';
|
|
27
|
-
export { installDevDependency, type InstallResult, setup, addPrepareScript, type PrepareResult };
|
|
27
|
+
export { installDevDependency, type InstallResult, setup, addPrepareScript, type PrepareResult, addTrustedDependency, type TrustedDepResult };
|
|
28
28
|
|
|
29
|
-
const VERSION = '0.11.
|
|
29
|
+
const VERSION = '0.11.1';
|
|
30
30
|
|
|
31
31
|
// --- Supabase ---
|
|
32
32
|
const SUPABASE_URL = 'https://mjnfqagwuewhgwbtrdgs.supabase.co';
|
|
@@ -106,6 +106,27 @@ function setup(): void {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
type TrustedDepResult = 'added' | 'skipped';
|
|
110
|
+
|
|
111
|
+
function addTrustedDependency(): TrustedDepResult {
|
|
112
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
113
|
+
if (!existsSync(pkgPath)) return 'skipped';
|
|
114
|
+
|
|
115
|
+
let pkg: Record<string, unknown>;
|
|
116
|
+
try {
|
|
117
|
+
pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
118
|
+
} catch {
|
|
119
|
+
return 'skipped';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const trusted = Array.isArray(pkg.trustedDependencies) ? pkg.trustedDependencies as string[] : [];
|
|
123
|
+
if (trusted.includes('oathbound')) return 'skipped';
|
|
124
|
+
|
|
125
|
+
pkg.trustedDependencies = [...trusted, 'oathbound'];
|
|
126
|
+
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
127
|
+
return 'added';
|
|
128
|
+
}
|
|
129
|
+
|
|
109
130
|
type PrepareResult = 'added' | 'appended' | 'skipped';
|
|
110
131
|
|
|
111
132
|
function addPrepareScript(): PrepareResult {
|
|
@@ -194,6 +215,15 @@ async function init(): Promise<void> {
|
|
|
194
215
|
process.exit(1);
|
|
195
216
|
}
|
|
196
217
|
|
|
218
|
+
// For bun/pnpm: add trustedDependencies so postinstall runs
|
|
219
|
+
const pm = detectPackageManager();
|
|
220
|
+
if (pm === 'bun' || pm === 'pnpm') {
|
|
221
|
+
const trustResult = addTrustedDependency();
|
|
222
|
+
if (trustResult === 'added') {
|
|
223
|
+
process.stderr.write(`${GREEN} ✓ Added oathbound to trustedDependencies (required by ${pm})${RESET}\n`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
197
227
|
// Add prepare script to package.json
|
|
198
228
|
const prepareResult = addPrepareScript();
|
|
199
229
|
if (prepareResult === 'added' || prepareResult === 'appended') {
|