@dfosco/storyboard 0.5.0-alpha.13 → 0.5.0-alpha.15
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/package.json +1 -1
- package/src/core/cli/dev.js +6 -0
- package/src/core/cli/setup.js +29 -28
- package/src/internals/Icon.jsx +15 -0
- package/src/internals/Viewfinder.jsx +19 -3
package/package.json
CHANGED
package/src/core/cli/dev.js
CHANGED
|
@@ -167,6 +167,12 @@ async function resolveDevTarget(branchArg, { allowCreate = true } = {}) {
|
|
|
167
167
|
|
|
168
168
|
const root = repoRoot()
|
|
169
169
|
|
|
170
|
+
// Already inside the requested worktree — just use cwd
|
|
171
|
+
const detectedName = detectWorktreeName()
|
|
172
|
+
if (detectedName === branchArg) {
|
|
173
|
+
return { worktreeName: branchArg, targetCwd: process.cwd(), created: false }
|
|
174
|
+
}
|
|
175
|
+
|
|
170
176
|
// "main" → repo root
|
|
171
177
|
if (branchArg === 'main') {
|
|
172
178
|
return { worktreeName: 'main', targetCwd: root, created: false }
|
package/src/core/cli/setup.js
CHANGED
|
@@ -30,7 +30,7 @@ if (flags.nuke) {
|
|
|
30
30
|
const nukeCmd = [
|
|
31
31
|
'sudo pkill caddy 2>/dev/null',
|
|
32
32
|
'brew uninstall caddy gh git 2>/dev/null',
|
|
33
|
-
'rm -f ~/.local/bin/copilot /usr/local/bin/copilot',
|
|
33
|
+
'rm -f ~/.local/bin/copilot /usr/local/bin/copilot ~/.local/bin/code /usr/local/bin/code',
|
|
34
34
|
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"',
|
|
35
35
|
'sudo rm -rf /Library/Developer/CommandLineTools',
|
|
36
36
|
'xcode-select --reset',
|
|
@@ -171,39 +171,40 @@ if (hasBrew) {
|
|
|
171
171
|
if (isInstalled('code')) {
|
|
172
172
|
p.log.success('VS Code CLI installed')
|
|
173
173
|
} else {
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',
|
|
177
|
-
'/usr/local/bin/code',
|
|
178
|
-
]
|
|
174
|
+
const vsCodeApp = '/Applications/Visual Studio Code.app'
|
|
175
|
+
const shellScript = `${vsCodeApp}/Contents/Resources/app/bin/code`
|
|
179
176
|
let installed = false
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
|
|
178
|
+
if (existsSync(shellScript)) {
|
|
179
|
+
// Try /usr/local/bin first, then ~/.local/bin as fallback
|
|
180
|
+
const localBin = `${process.env.HOME}/.local/bin`
|
|
181
|
+
const targets = ['/usr/local/bin/code', `${localBin}/code`]
|
|
182
|
+
|
|
183
|
+
for (const target of targets) {
|
|
184
|
+
try {
|
|
185
|
+
const dir = path.dirname(target)
|
|
186
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true })
|
|
187
|
+
run(`ln -sf "${shellScript}" "${target}"`)
|
|
188
|
+
// Add ~/.local/bin to PATH if that's where we installed
|
|
189
|
+
if (target.includes('.local/bin') && !process.env.PATH.includes(localBin)) {
|
|
190
|
+
process.env.PATH = `${localBin}:${process.env.PATH}`
|
|
191
|
+
}
|
|
192
|
+
p.log.success(`VS Code CLI installed (${target})`)
|
|
193
|
+
installed = true
|
|
194
|
+
break
|
|
195
|
+
} catch {
|
|
196
|
+
// Try next target
|
|
197
|
+
}
|
|
185
198
|
}
|
|
186
199
|
}
|
|
200
|
+
|
|
187
201
|
if (!installed) {
|
|
188
|
-
// Try the VS Code shell command installer
|
|
189
|
-
const vsCodeApp = '/Applications/Visual Studio Code.app'
|
|
190
202
|
if (existsSync(vsCodeApp)) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// Create symlink in /usr/local/bin
|
|
195
|
-
run(`ln -sf "${shellScript}" /usr/local/bin/code`)
|
|
196
|
-
p.log.success('VS Code CLI installed (symlinked to /usr/local/bin/code)')
|
|
197
|
-
installed = true
|
|
198
|
-
} catch {
|
|
199
|
-
// Fall through to manual instructions
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
if (!installed) {
|
|
204
|
-
p.log.warning('VS Code CLI not found. Open VS Code and run:')
|
|
205
|
-
p.log.info(' Cmd+Shift+P → "Shell Command: Install \'code\' command in PATH"')
|
|
203
|
+
p.log.warning('VS Code found but could not create symlink. Open VS Code and run:')
|
|
204
|
+
} else {
|
|
205
|
+
p.log.warning('VS Code not found. Install VS Code, then run:')
|
|
206
206
|
}
|
|
207
|
+
p.log.info(' Cmd+Shift+P → "Shell Command: Install \'code\' command in PATH"')
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
|
package/src/internals/Icon.jsx
CHANGED
|
@@ -76,6 +76,21 @@ const customIcons = {
|
|
|
76
76
|
'M2 19L11 12L2 5L2 19Z',
|
|
77
77
|
],
|
|
78
78
|
},
|
|
79
|
+
// Component icon (puzzle piece / brick)
|
|
80
|
+
'component': {
|
|
81
|
+
viewBox: '0 0 24 24',
|
|
82
|
+
strokeWidth: '1.5',
|
|
83
|
+
strokePaths: [
|
|
84
|
+
'M3.5 10.5V5.5C3.5 4.94772 3.94772 4.5 4.5 4.5H9.5',
|
|
85
|
+
'M14.5 4.5H19.5C20.0523 4.5 20.5 4.94772 20.5 5.5V10.5',
|
|
86
|
+
'M20.5 13.5V18.5C20.5 19.0523 20.0523 19.5 19.5 19.5H14.5',
|
|
87
|
+
'M9.5 19.5H4.5C3.94772 19.5 3.5 19.0523 3.5 18.5V13.5',
|
|
88
|
+
'M12 4.5V7.5',
|
|
89
|
+
'M12 16.5V19.5',
|
|
90
|
+
'M20.5 12H17.5',
|
|
91
|
+
'M6.5 12H3.5',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
79
94
|
}
|
|
80
95
|
|
|
81
96
|
/* ─── Iconoir icons (stroke-based unless fill: true) ─── */
|
|
@@ -1051,6 +1051,10 @@ export default function Workspace({
|
|
|
1051
1051
|
basePath,
|
|
1052
1052
|
title = 'Storyboard',
|
|
1053
1053
|
subtitle,
|
|
1054
|
+
showAllArtifacts = false,
|
|
1055
|
+
showPrototypes = true,
|
|
1056
|
+
showCanvases = true,
|
|
1057
|
+
showComponents = true,
|
|
1054
1058
|
}) {
|
|
1055
1059
|
const themeAttrs = useToolbarTheme()
|
|
1056
1060
|
const ghUser = useGitHubUser(basePath)
|
|
@@ -1158,8 +1162,20 @@ export default function Workspace({
|
|
|
1158
1162
|
|
|
1159
1163
|
const itemMap = useMemo(() => Object.fromEntries(allItems.map(i => [i.id, i])), [allItems])
|
|
1160
1164
|
|
|
1161
|
-
//
|
|
1162
|
-
const
|
|
1165
|
+
// Filter nav items based on visibility props
|
|
1166
|
+
const visibleNavItems = useMemo(() => {
|
|
1167
|
+
const visibility = {
|
|
1168
|
+
all: showAllArtifacts,
|
|
1169
|
+
prototypes: showPrototypes,
|
|
1170
|
+
canvases: showCanvases,
|
|
1171
|
+
components: showComponents,
|
|
1172
|
+
}
|
|
1173
|
+
return NAV_ITEMS.filter(nav => visibility[nav.id])
|
|
1174
|
+
}, [showAllArtifacts, showPrototypes, showCanvases, showComponents])
|
|
1175
|
+
|
|
1176
|
+
// State - default to first visible nav item
|
|
1177
|
+
const defaultNav = visibleNavItems[0]?.id || 'prototypes'
|
|
1178
|
+
const [activeNav, setActiveNav] = useState(defaultNav)
|
|
1163
1179
|
const [activeTab, setActiveTab] = useState('All')
|
|
1164
1180
|
const [showCreate, setShowCreate] = useState(false)
|
|
1165
1181
|
const isLocalDev = typeof window !== 'undefined' && window.__SB_LOCAL_DEV__ === true
|
|
@@ -1307,7 +1323,7 @@ export default function Workspace({
|
|
|
1307
1323
|
<aside className={`${css.sidebar}${sidebarOpen ? ` ${css.sidebarOpen}` : ''}`}>
|
|
1308
1324
|
<div className={css.sidebarContent}>
|
|
1309
1325
|
<nav className={css.navSection}>
|
|
1310
|
-
{
|
|
1326
|
+
{visibleNavItems.map(nav => (
|
|
1311
1327
|
<button
|
|
1312
1328
|
key={nav.id}
|
|
1313
1329
|
className={activeNav === nav.id ? css.navItemActive : css.navItem}
|