@gallop.software/studio 1.6.1 → 1.6.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.
@@ -0,0 +1 @@
1
+ export { GET, POST, DELETE } from '@gallop.software/studio/handlers'
package/app/layout.js ADDED
@@ -0,0 +1,14 @@
1
+ export const metadata = {
2
+ title: 'Studio - Media Manager',
3
+ description: 'Manage images and media files for your project',
4
+ }
5
+
6
+ export default function RootLayout({ children }) {
7
+ return (
8
+ <html lang="en">
9
+ <body style={{ margin: 0, padding: 0, backgroundColor: '#0a0a0a' }}>
10
+ {children}
11
+ </body>
12
+ </html>
13
+ )
14
+ }
package/app/page.js ADDED
@@ -0,0 +1,77 @@
1
+ 'use client'
2
+
3
+ import dynamic from 'next/dynamic'
4
+
5
+ const StudioUI = dynamic(
6
+ () => import('@gallop.software/studio').then((m) => m.StudioUI),
7
+ {
8
+ ssr: false,
9
+ loading: () => (
10
+ <div style={styles.loading}>
11
+ <div style={styles.loadingContent}>
12
+ <div style={styles.spinner} />
13
+ <p style={styles.loadingText}>Loading Studio...</p>
14
+ </div>
15
+ </div>
16
+ ),
17
+ }
18
+ )
19
+
20
+ const styles = {
21
+ container: {
22
+ position: 'fixed',
23
+ top: 0,
24
+ left: 0,
25
+ right: 0,
26
+ bottom: 0,
27
+ background: '#0a0a0a',
28
+ fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,
29
+ },
30
+ loading: {
31
+ display: 'flex',
32
+ alignItems: 'center',
33
+ justifyContent: 'center',
34
+ height: '100vh',
35
+ background: '#0a0a0a',
36
+ fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,
37
+ },
38
+ loadingContent: {
39
+ display: 'flex',
40
+ flexDirection: 'column',
41
+ alignItems: 'center',
42
+ gap: '16px',
43
+ },
44
+ spinner: {
45
+ width: '36px',
46
+ height: '36px',
47
+ borderRadius: '50%',
48
+ border: '3px solid #2a2a2a',
49
+ borderTopColor: '#635bff',
50
+ animation: 'spin 0.8s linear infinite',
51
+ },
52
+ loadingText: {
53
+ color: '#888888',
54
+ fontSize: '14px',
55
+ fontWeight: 500,
56
+ margin: 0,
57
+ },
58
+ }
59
+
60
+ export default function StudioPage() {
61
+ const workspace = process.env.NEXT_PUBLIC_STUDIO_WORKSPACE || 'Unknown'
62
+
63
+ return (
64
+ <div style={styles.container}>
65
+ <style>{`
66
+ @keyframes spin {
67
+ to { transform: rotate(360deg); }
68
+ }
69
+ `}</style>
70
+ <StudioUI
71
+ isVisible={true}
72
+ standaloneMode={true}
73
+ workspacePath={workspace}
74
+ />
75
+ </div>
76
+ )
77
+ }
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.3",
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,9 @@
18
21
  }
19
22
  },
20
23
  "files": [
21
- "dist"
24
+ "dist",
25
+ "bin",
26
+ "app"
22
27
  ],
23
28
  "scripts": {
24
29
  "build": "tsup",
@@ -33,7 +38,8 @@
33
38
  "cloudflare-r2",
34
39
  "nextjs",
35
40
  "gallop",
36
- "cdn"
41
+ "cdn",
42
+ "cli"
37
43
  ],
38
44
  "author": "Gallop Software",
39
45
  "license": "MIT",