@soulbatical/tetra-dev-toolkit 1.8.6 → 1.8.8
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/bin/tetra-check-rls.js +14 -12
- package/package.json +1 -1
package/bin/tetra-check-rls.js
CHANGED
|
@@ -34,17 +34,18 @@ import chalk from 'chalk'
|
|
|
34
34
|
|
|
35
35
|
// Load tetra-core dynamically (it's a peer/workspace dep)
|
|
36
36
|
async function loadTetraCore() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
37
|
+
// Try multiple paths: direct import, monorepo sibling, backend workspace
|
|
38
|
+
const attempts = [
|
|
39
|
+
() => import('@soulbatical/tetra-core'),
|
|
40
|
+
() => import('../../core/dist/index.js'),
|
|
41
|
+
() => import(join(process.cwd(), 'backend', 'node_modules', '@soulbatical', 'tetra-core', 'dist', 'index.js')),
|
|
42
|
+
() => import(join(process.cwd(), 'node_modules', '@soulbatical', 'tetra-core', 'dist', 'index.js')),
|
|
43
|
+
]
|
|
44
|
+
for (const attempt of attempts) {
|
|
45
|
+
try { return await attempt() } catch { /* next */ }
|
|
47
46
|
}
|
|
47
|
+
console.error(chalk.red('ERROR: @soulbatical/tetra-core not found. Install it first.'))
|
|
48
|
+
process.exit(1)
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
function findSupabaseConfig() {
|
|
@@ -91,8 +92,9 @@ program
|
|
|
91
92
|
process.exit(1)
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
// Supabase keys can be JWT (eyJ...) or new format (sb_se..., sbp_...)
|
|
96
|
+
if (key === url || key.length < 20) {
|
|
97
|
+
console.error(chalk.red('ERROR: Key does not look like a valid Supabase service key.'))
|
|
96
98
|
console.error(chalk.gray('Make sure you are using the SERVICE_ROLE key, not the anon key.'))
|
|
97
99
|
process.exit(1)
|
|
98
100
|
}
|