@gallop.software/studio 2.0.6 → 2.1.0
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/studio.mjs +16 -59
- package/dist/client/assets/index-TPS3nigu.js +74 -0
- package/dist/client/index.html +19 -0
- package/dist/{handlers/index.mjs → server/index.js} +232 -427
- package/dist/server/index.js.map +1 -0
- package/package.json +16 -32
- package/app/api/studio/[...path]/route.js +0 -1
- package/app/layout.jsx +0 -19
- package/app/page.jsx +0 -90
- package/dist/chunk-TRYWHLJ2.mjs +0 -32
- package/dist/chunk-TRYWHLJ2.mjs.map +0 -1
- package/dist/chunk-VI6QG6WT.js +0 -32
- package/dist/chunk-VI6QG6WT.js.map +0 -1
- package/dist/components/StudioUI.d.mts +0 -15
- package/dist/components/StudioUI.d.ts +0 -15
- package/dist/components/StudioUI.js +0 -6572
- package/dist/components/StudioUI.js.map +0 -1
- package/dist/components/StudioUI.mjs +0 -6572
- package/dist/components/StudioUI.mjs.map +0 -1
- package/dist/handlers/index.d.mts +0 -22
- package/dist/handlers/index.d.ts +0 -22
- package/dist/handlers/index.js +0 -2587
- package/dist/handlers/index.js.map +0 -1
- package/dist/handlers/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -90
- package/dist/index.d.ts +0 -90
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -11
- package/dist/index.mjs.map +0 -1
- package/next.config.mjs +0 -20
package/bin/studio.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { resolve, dirname } from 'path'
|
|
5
|
-
import { fileURLToPath } from 'url'
|
|
3
|
+
import { resolve } from 'path'
|
|
6
4
|
import { existsSync } from 'fs'
|
|
7
5
|
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
9
|
-
const __dirname = dirname(__filename)
|
|
10
|
-
|
|
11
6
|
// Parse command line arguments
|
|
12
7
|
const args = process.argv.slice(2)
|
|
13
8
|
let workspace = process.cwd()
|
|
9
|
+
let port = 3001
|
|
14
10
|
let shouldOpen = false
|
|
15
11
|
|
|
16
12
|
for (let i = 0; i < args.length; i++) {
|
|
17
13
|
if (args[i] === '--workspace' && args[i + 1]) {
|
|
18
14
|
workspace = resolve(args[i + 1])
|
|
19
15
|
i++
|
|
16
|
+
} else if (args[i] === '--port' && args[i + 1]) {
|
|
17
|
+
port = parseInt(args[i + 1], 10)
|
|
18
|
+
i++
|
|
20
19
|
} else if (args[i] === '--open' || args[i] === '-o') {
|
|
21
20
|
shouldOpen = true
|
|
22
21
|
} else if (args[i] === '--help' || args[i] === '-h') {
|
|
@@ -28,13 +27,14 @@ Usage:
|
|
|
28
27
|
|
|
29
28
|
Options:
|
|
30
29
|
--workspace <path> Path to the project workspace (default: current directory)
|
|
30
|
+
--port <number> Port to run the server on (default: 3001)
|
|
31
31
|
--open, -o Open browser automatically
|
|
32
32
|
--help, -h Show this help message
|
|
33
33
|
|
|
34
34
|
Examples:
|
|
35
35
|
studio # Run in current directory
|
|
36
36
|
studio --workspace ~/my-project # Run for specific project
|
|
37
|
-
studio --
|
|
37
|
+
studio --port 3002 --open # Use custom port and open browser
|
|
38
38
|
`)
|
|
39
39
|
process.exit(0)
|
|
40
40
|
}
|
|
@@ -54,57 +54,14 @@ if (!existsSync(publicPath)) {
|
|
|
54
54
|
process.exit(1)
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// Find the next binary
|
|
67
|
-
const studioRoot = resolve(__dirname, '..')
|
|
68
|
-
const nextBin = resolve(studioRoot, 'node_modules', '.bin', 'next')
|
|
69
|
-
|
|
70
|
-
if (!existsSync(nextBin)) {
|
|
71
|
-
console.error('Error: Next.js not found. Please run: npm install')
|
|
57
|
+
// Start the server
|
|
58
|
+
import('../dist/server/index.js').then((mod) => {
|
|
59
|
+
mod.startServer({
|
|
60
|
+
port,
|
|
61
|
+
workspace,
|
|
62
|
+
open: shouldOpen,
|
|
63
|
+
})
|
|
64
|
+
}).catch((error) => {
|
|
65
|
+
console.error('Failed to start Studio server:', error)
|
|
72
66
|
process.exit(1)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Set up environment
|
|
76
|
-
const env = {
|
|
77
|
-
...process.env,
|
|
78
|
-
STUDIO_WORKSPACE: workspace,
|
|
79
|
-
NODE_ENV: 'development',
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Start Next.js dev server
|
|
83
|
-
const child = spawn(nextBin, ['dev', '-p', '3001'], {
|
|
84
|
-
stdio: 'inherit',
|
|
85
|
-
cwd: studioRoot,
|
|
86
|
-
env,
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
// Open browser if requested
|
|
90
|
-
if (shouldOpen) {
|
|
91
|
-
setTimeout(async () => {
|
|
92
|
-
const open = (await import('open')).default
|
|
93
|
-
open('http://localhost:3001')
|
|
94
|
-
}, 2000)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Handle process termination
|
|
98
|
-
process.on('SIGINT', () => {
|
|
99
|
-
child.kill('SIGINT')
|
|
100
|
-
process.exit(0)
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
process.on('SIGTERM', () => {
|
|
104
|
-
child.kill('SIGTERM')
|
|
105
|
-
process.exit(0)
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
child.on('close', (code) => {
|
|
109
|
-
process.exit(code || 0)
|
|
110
67
|
})
|