spine-framework 0.1.1 → 0.1.3

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,6 +41,21 @@
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
+ }
44
59
 
45
60
  const program = new Command()
46
61
 
@@ -100,6 +115,12 @@ registerInstallAppCommands(program)
100
115
  registerStatusCommands(program)
101
116
  registerUninstallAppCommands(program)
102
117
 
118
+ // Show welcome when run with no arguments
119
+ if (process.argv.length === 2) {
120
+ printWelcome()
121
+ process.exit(0)
122
+ }
123
+
103
124
  program.parseAsync(process.argv).catch((err) => {
104
125
  console.error('Error:', err.message)
105
126
  process.exit(1)
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ // Thin shebang wrapper — invokes the TypeScript CLI via tsx.
3
+ // This file is the npm bin entry point for spine-framework.
4
+ const { execFileSync } = require('child_process')
5
+ const { resolve } = require('path')
6
+
7
+ const tsx = resolve(__dirname, '../node_modules/.bin/tsx')
8
+ const entry = resolve(__dirname, '../.framework/cli/index.ts')
9
+
10
+ try {
11
+ execFileSync(tsx, [entry, ...process.argv.slice(2)], { stdio: 'inherit' })
12
+ } catch (e) {
13
+ process.exit(e.status ?? 1)
14
+ }
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ // Postinstall welcome message — runs automatically after npm install spine-framework.
3
+ // Tells the agent (or developer) exactly what to do next.
4
+ // Uses only Node built-ins — no dependencies.
5
+
6
+ const lines = [
7
+ '',
8
+ '╭──────────────────────────────────────────────────────────────╮',
9
+ '│ │',
10
+ '│ ███████╗██████╗ ██╗███╗ ██╗███████╗ │',
11
+ '│ ██╔════╝██╔══██╗██║████╗ ██║██╔════╝ │',
12
+ '│ ███████╗██████╔╝██║██╔██╗ ██║█████╗ │',
13
+ '│ ╚════██║██╔═══╝ ██║██║╚██╗██║██╔══╝ │',
14
+ '│ ███████║██║ ██║██║ ╚████║███████╗ │',
15
+ '│ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝ Framework v0.1 │',
16
+ '│ │',
17
+ '╰──────────────────────────────────────────────────────────────╯',
18
+ '',
19
+ ' Spine Framework installed successfully!',
20
+ '',
21
+ ' To complete setup you need a Supabase project.',
22
+ ' ─────────────────────────────────────────────',
23
+ ' If you have one already, run:',
24
+ '',
25
+ ' spine-framework init \\',
26
+ ' --url https://<project>.supabase.co \\',
27
+ ' --anon-key <anon-key> \\',
28
+ ' --service-role-key <service-role-key>',
29
+ '',
30
+ ' Your credentials are at:',
31
+ ' Supabase Dashboard → Your Project → Settings → API',
32
+ '',
33
+ ' ─────────────────────────────────────────────',
34
+ ' If you need a Supabase project, create one at:',
35
+ ' https://supabase.com/dashboard → New project',
36
+ '',
37
+ ' After init:',
38
+ ' spine-framework install-app <app-slug> # optional apps',
39
+ ' npm run assemble && netlify dev # start dev server',
40
+ '',
41
+ ' Docs: https://github.com/art-mojo-admin/spine',
42
+ '',
43
+ ]
44
+
45
+ console.log(lines.join('\n'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "Spine — enterprise application framework built on Supabase + Netlify + React",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "node": ">=18.0.0"
27
27
  },
28
28
  "bin": {
29
- "spine-framework": "./.framework/cli/bin.cjs"
29
+ "spine-framework": "./bin/spine-framework.cjs"
30
30
  },
31
31
  "exports": {
32
32
  ".": {
@@ -47,9 +47,8 @@
47
47
  }
48
48
  },
49
49
  "files": [
50
+ "bin/",
50
51
  "dist/",
51
- ".framework/cli/bin.cjs",
52
- ".framework/cli/welcome.cjs",
53
52
  ".framework/cli/",
54
53
  ".framework/functions/",
55
54
  ".framework/migrations/",
@@ -82,7 +81,7 @@
82
81
  "test:integration": "vitest run .framework/tests/integration",
83
82
  "test:boundary": "bash scripts/boundary-check.sh",
84
83
  "test:custom": "vitest run custom/tests",
85
- "postinstall": "node .framework/cli/welcome.cjs || true",
84
+ "postinstall": "node bin/welcome.cjs || true",
86
85
  "docs": "typedoc --config config/typedoc.json"
87
86
  },
88
87
  "dependencies": {