spine-framework 0.1.3 → 0.1.5
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/spine-framework.cjs +19 -3
- package/package.json +1 -1
package/bin/spine-framework.cjs
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Thin shebang wrapper — invokes the TypeScript CLI via tsx.
|
|
3
3
|
// This file is the npm bin entry point for spine-framework.
|
|
4
|
-
const { execFileSync } = require('child_process')
|
|
4
|
+
const { execFileSync, spawnSync } = require('child_process')
|
|
5
5
|
const { resolve } = require('path')
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// __dirname = <project>/node_modules/spine-framework/bin
|
|
8
|
+
// tsx lives at <project>/node_modules/.bin/tsx
|
|
9
|
+
const pkgRoot = resolve(__dirname, '..')
|
|
10
|
+
const projectRoot = resolve(pkgRoot, '../..')
|
|
11
|
+
const entry = resolve(pkgRoot, '.framework/cli/index.ts')
|
|
12
|
+
|
|
13
|
+
// Find tsx: prefer consuming project's copy, fall back to our own
|
|
14
|
+
const tsxPaths = [
|
|
15
|
+
resolve(projectRoot, 'node_modules/.bin/tsx'),
|
|
16
|
+
resolve(pkgRoot, 'node_modules/.bin/tsx'),
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
const tsx = tsxPaths.find(p => { try { require('fs').accessSync(p); return true } catch { return false } })
|
|
20
|
+
|
|
21
|
+
if (!tsx) {
|
|
22
|
+
console.error('spine-framework: tsx not found. Run: npm install tsx')
|
|
23
|
+
process.exit(1)
|
|
24
|
+
}
|
|
9
25
|
|
|
10
26
|
try {
|
|
11
27
|
execFileSync(tsx, [entry, ...process.argv.slice(2)], { stdio: 'inherit' })
|