spine-framework 0.1.3 → 0.1.6
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/.framework/cli/index.ts +0 -21
- package/bin/spine-framework.cjs +23 -2
- package/package.json +1 -1
package/.framework/cli/index.ts
CHANGED
|
@@ -41,21 +41,6 @@
|
|
|
41
41
|
|
|
42
42
|
import './env-loader.ts'
|
|
43
43
|
import { Command } from 'commander'
|
|
44
|
-
import { createRequire } from 'module'
|
|
45
|
-
import { resolve, dirname } from 'path'
|
|
46
|
-
import { fileURLToPath } from 'url'
|
|
47
|
-
|
|
48
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
49
|
-
const __dirname = dirname(__filename)
|
|
50
|
-
|
|
51
|
-
function printWelcome() {
|
|
52
|
-
const require = createRequire(import.meta.url)
|
|
53
|
-
try {
|
|
54
|
-
require(resolve(__dirname, '../../bin/welcome.cjs'))
|
|
55
|
-
} catch {
|
|
56
|
-
console.log('Spine Framework — run `spine-framework --help` for commands.')
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
44
|
|
|
60
45
|
const program = new Command()
|
|
61
46
|
|
|
@@ -115,12 +100,6 @@ registerInstallAppCommands(program)
|
|
|
115
100
|
registerStatusCommands(program)
|
|
116
101
|
registerUninstallAppCommands(program)
|
|
117
102
|
|
|
118
|
-
// Show welcome when run with no arguments
|
|
119
|
-
if (process.argv.length === 2) {
|
|
120
|
-
printWelcome()
|
|
121
|
-
process.exit(0)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
103
|
program.parseAsync(process.argv).catch((err) => {
|
|
125
104
|
console.error('Error:', err.message)
|
|
126
105
|
process.exit(1)
|
package/bin/spine-framework.cjs
CHANGED
|
@@ -4,8 +4,29 @@
|
|
|
4
4
|
const { execFileSync } = require('child_process')
|
|
5
5
|
const { resolve } = require('path')
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const pkgRoot = resolve(__dirname, '..')
|
|
8
|
+
const projectRoot = resolve(pkgRoot, '../..')
|
|
9
|
+
|
|
10
|
+
// Handle no-args case here — before spawning tsx or loading db.ts
|
|
11
|
+
if (process.argv.length === 2) {
|
|
12
|
+
require(resolve(__dirname, 'welcome.cjs'))
|
|
13
|
+
process.exit(0)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const entry = resolve(pkgRoot, '.framework/cli/index.ts')
|
|
17
|
+
|
|
18
|
+
// Find tsx: prefer consuming project's copy, fall back to our own
|
|
19
|
+
const fs = require('fs')
|
|
20
|
+
const tsxPaths = [
|
|
21
|
+
resolve(projectRoot, 'node_modules/.bin/tsx'),
|
|
22
|
+
resolve(pkgRoot, 'node_modules/.bin/tsx'),
|
|
23
|
+
]
|
|
24
|
+
const tsx = tsxPaths.find(p => { try { fs.accessSync(p); return true } catch { return false } })
|
|
25
|
+
|
|
26
|
+
if (!tsx) {
|
|
27
|
+
console.error('spine-framework: tsx not found. Run: npm install tsx')
|
|
28
|
+
process.exit(1)
|
|
29
|
+
}
|
|
9
30
|
|
|
10
31
|
try {
|
|
11
32
|
execFileSync(tsx, [entry, ...process.argv.slice(2)], { stdio: 'inherit' })
|