spine-framework 0.1.5 → 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.
@@ -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)
@@ -1,22 +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, spawnSync } = require('child_process')
4
+ const { execFileSync } = require('child_process')
5
5
  const { resolve } = require('path')
6
6
 
7
- // __dirname = <project>/node_modules/spine-framework/bin
8
- // tsx lives at <project>/node_modules/.bin/tsx
9
7
  const pkgRoot = resolve(__dirname, '..')
10
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
+
11
16
  const entry = resolve(pkgRoot, '.framework/cli/index.ts')
12
17
 
13
18
  // Find tsx: prefer consuming project's copy, fall back to our own
19
+ const fs = require('fs')
14
20
  const tsxPaths = [
15
21
  resolve(projectRoot, 'node_modules/.bin/tsx'),
16
22
  resolve(pkgRoot, 'node_modules/.bin/tsx'),
17
23
  ]
18
-
19
- const tsx = tsxPaths.find(p => { try { require('fs').accessSync(p); return true } catch { return false } })
24
+ const tsx = tsxPaths.find(p => { try { fs.accessSync(p); return true } catch { return false } })
20
25
 
21
26
  if (!tsx) {
22
27
  console.error('spine-framework: tsx not found. Run: npm install tsx')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "description": "Spine — enterprise application framework built on Supabase + Netlify + React",
6
6
  "type": "module",