@dfosco/storyboard-core 4.2.5 → 4.2.7
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/dist/storyboard-ui.js +2245 -2230
- package/dist/storyboard-ui.js.map +1 -1
- package/package.json +1 -1
- package/scaffold/AGENTS.md +1 -1
- package/scaffold/skills/ship/SKILL.md +1 -1
- package/scaffold/skills/worktree/SKILL.md +7 -24
- package/src/CoreUIBar.jsx +37 -6
- package/src/HideChromeTrigger.jsx +8 -0
- package/src/canvas/terminal-config.js +2 -2
- package/src/cli/branch.js +6 -6
- package/src/cli/code.js +3 -3
- package/src/cli/dev.js +5 -5
- package/src/mountStoryboardCore.js +9 -2
- package/src/server/index.js +1 -1
- package/src/tools/handlers/hideToolbars.js +1 -0
- package/src/worktree/port.js +20 -20
- package/src/worktree/port.test.js +21 -21
|
@@ -43,27 +43,27 @@ describe('portsFilePath', () => {
|
|
|
43
43
|
rmSync(tempRoot, { recursive: true, force: true })
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
it('returns root
|
|
46
|
+
it('returns root worktrees/ports.json from repo root', () => {
|
|
47
47
|
const result = portsFilePath(tempRoot)
|
|
48
|
-
expect(result).toBe(join(tempRoot, '
|
|
48
|
+
expect(result).toBe(join(tempRoot, 'worktrees', 'ports.json'))
|
|
49
49
|
})
|
|
50
50
|
|
|
51
51
|
it('returns shared ports.json from inside a worktree dir', () => {
|
|
52
|
-
// Simulate
|
|
53
|
-
const worktreeDir = join(tempRoot, '
|
|
52
|
+
// Simulate worktrees/my-branch/
|
|
53
|
+
const worktreeDir = join(tempRoot, 'worktrees', 'my-branch')
|
|
54
54
|
mkdirSync(worktreeDir, { recursive: true })
|
|
55
55
|
const result = portsFilePath(worktreeDir)
|
|
56
|
-
expect(result).toBe(join(tempRoot, '
|
|
56
|
+
expect(result).toBe(join(tempRoot, 'worktrees', 'ports.json'))
|
|
57
57
|
})
|
|
58
58
|
|
|
59
59
|
it('returns shared ports.json from worktree even when ports.json does not exist', () => {
|
|
60
60
|
// This is the key bug fix — first run from a worktree with no ports.json
|
|
61
|
-
const worktreeDir = join(tempRoot, '
|
|
61
|
+
const worktreeDir = join(tempRoot, 'worktrees', 'first-run')
|
|
62
62
|
mkdirSync(worktreeDir, { recursive: true })
|
|
63
63
|
const result = portsFilePath(worktreeDir)
|
|
64
|
-
// Must point to root, NOT to
|
|
65
|
-
expect(result).toBe(join(tempRoot, '
|
|
66
|
-
expect(result).not.toContain('first-run
|
|
64
|
+
// Must point to root, NOT to worktrees/first-run/worktrees/ports.json
|
|
65
|
+
expect(result).toBe(join(tempRoot, 'worktrees', 'ports.json'))
|
|
66
|
+
expect(result).not.toContain('first-run/worktrees')
|
|
67
67
|
})
|
|
68
68
|
})
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ describe('getPort / resolvePort', () => {
|
|
|
73
73
|
|
|
74
74
|
beforeEach(() => {
|
|
75
75
|
tempRoot = realpathSync(mkdtempSync(join(tmpdir(), 'sb-port-test-')))
|
|
76
|
-
mkdirSync(join(tempRoot, '
|
|
76
|
+
mkdirSync(join(tempRoot, 'worktrees'), { recursive: true })
|
|
77
77
|
originalCwd = process.cwd()
|
|
78
78
|
process.chdir(tempRoot)
|
|
79
79
|
})
|
|
@@ -106,7 +106,7 @@ describe('getPort / resolvePort', () => {
|
|
|
106
106
|
|
|
107
107
|
it('persists to ports.json', () => {
|
|
108
108
|
getPort('persisted')
|
|
109
|
-
const portsFile = join(tempRoot, '
|
|
109
|
+
const portsFile = join(tempRoot, 'worktrees', 'ports.json')
|
|
110
110
|
expect(existsSync(portsFile)).toBe(true)
|
|
111
111
|
const data = JSON.parse(readFileSync(portsFile, 'utf8'))
|
|
112
112
|
expect(data.persisted).toBe(1235)
|
|
@@ -123,7 +123,7 @@ describe('getPort / resolvePort', () => {
|
|
|
123
123
|
})
|
|
124
124
|
|
|
125
125
|
it('handles corrupted ports.json gracefully', () => {
|
|
126
|
-
const portsFile = join(tempRoot, '
|
|
126
|
+
const portsFile = join(tempRoot, 'worktrees', 'ports.json')
|
|
127
127
|
writeFileSync(portsFile, 'not valid json')
|
|
128
128
|
// Should not throw — starts fresh
|
|
129
129
|
const port = getPort('recovery')
|
|
@@ -136,7 +136,7 @@ describe('repoRoot', () => {
|
|
|
136
136
|
|
|
137
137
|
beforeEach(() => {
|
|
138
138
|
tempRoot = realpathSync(mkdtempSync(join(tmpdir(), 'sb-root-test-')))
|
|
139
|
-
mkdirSync(join(tempRoot, '
|
|
139
|
+
mkdirSync(join(tempRoot, 'worktrees', 'my-branch'), { recursive: true })
|
|
140
140
|
})
|
|
141
141
|
|
|
142
142
|
afterEach(() => {
|
|
@@ -147,8 +147,8 @@ describe('repoRoot', () => {
|
|
|
147
147
|
expect(repoRoot(tempRoot)).toBe(tempRoot)
|
|
148
148
|
})
|
|
149
149
|
|
|
150
|
-
it('returns parent of
|
|
151
|
-
const wt = join(tempRoot, '
|
|
150
|
+
it('returns parent of worktrees when inside a worktree', () => {
|
|
151
|
+
const wt = join(tempRoot, 'worktrees', 'my-branch')
|
|
152
152
|
expect(repoRoot(wt)).toBe(tempRoot)
|
|
153
153
|
})
|
|
154
154
|
})
|
|
@@ -158,7 +158,7 @@ describe('worktreeDir', () => {
|
|
|
158
158
|
|
|
159
159
|
beforeEach(() => {
|
|
160
160
|
tempRoot = realpathSync(mkdtempSync(join(tmpdir(), 'sb-wtdir-test-')))
|
|
161
|
-
mkdirSync(join(tempRoot, '
|
|
161
|
+
mkdirSync(join(tempRoot, 'worktrees'), { recursive: true })
|
|
162
162
|
})
|
|
163
163
|
|
|
164
164
|
afterEach(() => {
|
|
@@ -169,8 +169,8 @@ describe('worktreeDir', () => {
|
|
|
169
169
|
expect(worktreeDir('main', tempRoot)).toBe(tempRoot)
|
|
170
170
|
})
|
|
171
171
|
|
|
172
|
-
it('returns
|
|
173
|
-
expect(worktreeDir('my-feature', tempRoot)).toBe(join(tempRoot, '
|
|
172
|
+
it('returns worktrees/<name> for branches', () => {
|
|
173
|
+
expect(worktreeDir('my-feature', tempRoot)).toBe(join(tempRoot, 'worktrees', 'my-feature'))
|
|
174
174
|
})
|
|
175
175
|
})
|
|
176
176
|
|
|
@@ -185,12 +185,12 @@ describe('listWorktrees', () => {
|
|
|
185
185
|
rmSync(tempRoot, { recursive: true, force: true })
|
|
186
186
|
})
|
|
187
187
|
|
|
188
|
-
it('returns empty array when
|
|
188
|
+
it('returns empty array when worktrees does not exist', () => {
|
|
189
189
|
expect(listWorktrees(tempRoot)).toEqual([])
|
|
190
190
|
})
|
|
191
191
|
|
|
192
192
|
it('returns only directories with a .git file', () => {
|
|
193
|
-
const wtDir = join(tempRoot, '
|
|
193
|
+
const wtDir = join(tempRoot, 'worktrees')
|
|
194
194
|
mkdirSync(wtDir)
|
|
195
195
|
|
|
196
196
|
// Valid worktree — has .git file
|
|
@@ -208,7 +208,7 @@ describe('listWorktrees', () => {
|
|
|
208
208
|
})
|
|
209
209
|
|
|
210
210
|
it('returns multiple worktrees', () => {
|
|
211
|
-
const wtDir = join(tempRoot, '
|
|
211
|
+
const wtDir = join(tempRoot, 'worktrees')
|
|
212
212
|
mkdirSync(wtDir)
|
|
213
213
|
|
|
214
214
|
for (const name of ['alpha', 'beta', 'gamma']) {
|