@gallop.software/studio 1.6.1 → 1.6.2

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.
Files changed (2) hide show
  1. package/bin/studio.mjs +63 -0
  2. package/package.json +8 -3
package/bin/studio.mjs ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { resolve } from 'path'
4
+ import { existsSync } from 'fs'
5
+
6
+ // Parse command line arguments
7
+ const args = process.argv.slice(2)
8
+ let workspace = process.cwd()
9
+ let shouldOpen = false
10
+
11
+ for (let i = 0; i < args.length; i++) {
12
+ if (args[i] === '--workspace' && args[i + 1]) {
13
+ workspace = resolve(args[i + 1])
14
+ i++
15
+ } else if (args[i] === '--open' || args[i] === '-o') {
16
+ shouldOpen = true
17
+ } else if (args[i] === '--help' || args[i] === '-h') {
18
+ console.log(`
19
+ Studio - Media Manager
20
+
21
+ Usage:
22
+ studio [options]
23
+
24
+ Options:
25
+ --workspace <path> Path to the project workspace (default: current directory)
26
+ --open, -o Open browser automatically
27
+ --help, -h Show this help message
28
+
29
+ Examples:
30
+ studio # Run in current directory
31
+ studio --workspace ~/my-project # Run for specific project
32
+ studio --workspace . --open # Open browser automatically
33
+ `)
34
+ process.exit(0)
35
+ }
36
+ }
37
+
38
+ // Validate workspace exists
39
+ if (!existsSync(workspace)) {
40
+ console.error(`Error: Workspace path does not exist: ${workspace}`)
41
+ process.exit(1)
42
+ }
43
+
44
+ // Check for public folder
45
+ const publicPath = resolve(workspace, 'public')
46
+ if (!existsSync(publicPath)) {
47
+ console.error(`Error: No 'public' folder found in workspace: ${workspace}`)
48
+ console.error('Studio requires a public folder to manage media files.')
49
+ process.exit(1)
50
+ }
51
+
52
+ console.log(`
53
+ ┌─────────────────────────────────────┐
54
+ │ Studio - Media Manager │
55
+ ├─────────────────────────────────────┤
56
+ │ Workspace: ${workspace.length > 24 ? '...' + workspace.slice(-21) : workspace.padEnd(24)}│
57
+ │ URL: http://localhost:3001 │
58
+ └─────────────────────────────────────┘
59
+ `)
60
+
61
+ // Placeholder for Stage 6 - will launch Next.js dev server
62
+ console.log('Server launching will be implemented in Stage 6.')
63
+ console.log('For now, run the embedded version with npm run dev.')
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@gallop.software/studio",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Media manager for Gallop templates - upload, process, and sync images to CDN",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "studio": "./bin/studio.mjs"
10
+ },
8
11
  "exports": {
9
12
  ".": {
10
13
  "types": "./dist/index.d.ts",
@@ -18,7 +21,8 @@
18
21
  }
19
22
  },
20
23
  "files": [
21
- "dist"
24
+ "dist",
25
+ "bin"
22
26
  ],
23
27
  "scripts": {
24
28
  "build": "tsup",
@@ -33,7 +37,8 @@
33
37
  "cloudflare-r2",
34
38
  "nextjs",
35
39
  "gallop",
36
- "cdn"
40
+ "cdn",
41
+ "cli"
37
42
  ],
38
43
  "author": "Gallop Software",
39
44
  "license": "MIT",