Skip to content

Commit 81403bb

Browse files
committed
chore: use dev command
1 parent e92e28d commit 81403bb

File tree

8 files changed

+67
-67
lines changed

8 files changed

+67
-67
lines changed

deps.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
dependencies:
2-
bun.sh: 1.2.3
2+
bun.sh: 1.2.16

packages/launchpad/bin/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ cli
520520
})
521521

522522
cli
523-
.command('dev:dump [dir]', 'Set up development environment for project dependencies')
523+
.command('dev [dir]', 'Set up development environment for project dependencies')
524524
.option('--dry-run', 'Show packages that would be installed without installing them')
525525
.option('--quiet', 'Suppress non-error output')
526526
.action(async (dir?: string, options?: { dryRun?: boolean, quiet?: boolean }) => {
@@ -532,7 +532,7 @@ cli
532532
})
533533
}
534534
catch (error) {
535-
console.error('Failed to dump dev environment:', error instanceof Error ? error.message : String(error))
535+
console.error('Failed to set up dev environment:', error instanceof Error ? error.message : String(error))
536536
process.exit(1)
537537
}
538538
})
@@ -555,7 +555,7 @@ cli
555555
})
556556

557557
cli
558-
.command('dev:on [dir]', 'Activate development environment')
558+
.command('dev:on [dir]', 'Activate development environment (use `launchpad dev` instead)')
559559
.option('--silent', 'Suppress output messages')
560560
.action(async (dir?: string, options?: { silent?: boolean }) => {
561561
try {

packages/launchpad/src/dev/shellcode.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@ console.log(hash.toString(16).padStart(16, '0').slice(0, 8));
364364
export _PKGX_ACTIVATING="$PWD"
365365
366366
if [[ "${dev_cmd}" == *"launchpad"* ]]; then
367-
# Try to run launchpad dev:dump with proper error handling
367+
# Try to run launchpad dev with proper error handling
368368
local launchpad_output=""
369369
local exit_code=0
370370
# Capture only stdout, let stderr (progress bars) pass through to user
371-
launchpad_output=$(eval "${dev_cmd} dev:dump \\"$PWD\\"") || exit_code=$?
371+
launchpad_output=$(eval "${dev_cmd} dev \\"$PWD\\"") || exit_code=$?
372372
373373
if [ $exit_code -eq 0 ] && [ -n "$launchpad_output" ]; then
374374
# If launchpad succeeds, extract just the shell script part using system sed
@@ -387,7 +387,7 @@ console.log(hash.toString(16).padStart(16, '0').slice(0, 8));
387387
echo "💡 To fix this:" >&2
388388
echo " • Install bun: curl -fsSL https://bun.sh/install | bash" >&2
389389
echo " • Or compile launchpad globally: bun run compile" >&2
390-
echo " • Or run manually: launchpad dev:dump" >&2
390+
echo " • Or run manually: launchpad dev" >&2
391391
fi
392392
else
393393
# For other dev commands, try with basic error handling
@@ -485,7 +485,7 @@ _launchpad_show_help() {
485485
echo "💡 To fix this:" >&2
486486
echo " • Install bun: curl -fsSL https://bun.sh/install | bash" >&2
487487
echo " • Or compile launchpad globally: bun run compile" >&2
488-
echo " • Or run manually: launchpad dev:dump" >&2
488+
echo " • Or run manually: launchpad dev" >&2
489489
}
490490
491491
dev() {
@@ -501,11 +501,11 @@ dev() {
501501
eval "${dev_cmd} \\"$@\\""
502502
elif ! type -f _pkgx_dev_try_bye >/dev/null 2>&1; then
503503
if [[ "${dev_cmd}" == *"launchpad"* ]]; then
504-
# Try to run launchpad dev:dump with proper error handling
504+
# Try to run launchpad dev with proper error handling
505505
local launchpad_output=""
506506
local exit_code=0
507507
# Capture only stdout, let stderr (progress bars) pass through to user
508-
launchpad_output=$(eval "${dev_cmd} dev:dump \\"$PWD\\"") || exit_code=$?
508+
launchpad_output=$(eval "${dev_cmd} dev \\"$PWD\\"") || exit_code=$?
509509
510510
if [ $exit_code -eq 0 ] && [ -n "$launchpad_output" ]; then
511511
# If launchpad succeeds, extract just the shell script part using system sed
@@ -515,7 +515,7 @@ dev() {
515515
eval "$shell_script"
516516
else
517517
echo "⚠️ Launchpad succeeded but no shell script found" >&2
518-
echo " Try running: launchpad dev:dump" >&2
518+
echo " Try running: launchpad dev" >&2
519519
fi
520520
else
521521
# If launchpad fails, show generic error message
@@ -524,7 +524,7 @@ dev() {
524524
echo "💡 To fix this:" >&2
525525
echo " • Install bun: curl -fsSL https://bun.sh/install | bash" >&2
526526
echo " • Or compile launchpad globally: bun run compile" >&2
527-
echo " • Or run manually: launchpad dev:dump" >&2
527+
echo " • Or run manually: launchpad dev" >&2
528528
fi
529529
else
530530
# For other dev commands, try with basic error handling

packages/launchpad/test/binary-stub-isolation.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('Binary Stub Isolation', () => {
8282
fs.mkdirSync(projectDir, { recursive: true })
8383
createDepsFile(projectDir, ['[email protected]'])
8484

85-
const result = await runCLI(['dev:dump'], projectDir)
85+
const result = await runCLI(['dev'], projectDir)
8686

8787
// Accept either success or failure
8888
if (result.exitCode === 0) {
@@ -108,7 +108,7 @@ describe('Binary Stub Isolation', () => {
108108
// Binary stubs only include pkgx environment variables, not custom project ones
109109
})
110110

111-
const result = await runCLI(['dev:dump'], projectDir)
111+
const result = await runCLI(['dev'], projectDir)
112112

113113
// Accept either success or failure
114114
if (result.exitCode === 0) {
@@ -144,7 +144,7 @@ describe('Binary Stub Isolation', () => {
144144
// Use a package that has multiple binaries
145145
createDepsFile(projectDir, ['[email protected]'])
146146

147-
const result = await runCLI(['dev:dump'], projectDir)
147+
const result = await runCLI(['dev'], projectDir)
148148

149149
// Accept either success or failure
150150
if (result.exitCode === 0) {
@@ -167,7 +167,7 @@ describe('Binary Stub Isolation', () => {
167167
LD_LIBRARY_PATH: '/custom/lib:/another/lib',
168168
})
169169

170-
const result = await runCLI(['dev:dump'], projectDir)
170+
const result = await runCLI(['dev'], projectDir)
171171

172172
// Accept either success or failure
173173
if (result.exitCode === 0) {
@@ -200,7 +200,7 @@ describe('Binary Stub Isolation', () => {
200200
fs.mkdirSync(projectDir, { recursive: true })
201201
createDepsFile(projectDir, ['[email protected]'])
202202

203-
const result = await runCLI(['dev:dump'], projectDir)
203+
const result = await runCLI(['dev'], projectDir)
204204

205205
// Accept either success or failure
206206
if (result.exitCode === 0) {
@@ -239,7 +239,7 @@ describe('Binary Stub Isolation', () => {
239239
fs.mkdirSync(projectDir, { recursive: true })
240240
createDepsFile(projectDir, ['[email protected]'])
241241

242-
const result = await runCLI(['dev:dump'], projectDir)
242+
const result = await runCLI(['dev'], projectDir)
243243

244244
// Accept either success or failure
245245
if (result.exitCode === 0) {
@@ -269,7 +269,7 @@ describe('Binary Stub Isolation', () => {
269269
// Don't expect SPECIAL_VAR in binary stubs - they only contain pkgx environment variables
270270
})
271271

272-
const result = await runCLI(['dev:dump'], projectDir)
272+
const result = await runCLI(['dev'], projectDir)
273273

274274
// Accept either success or failure
275275
if (result.exitCode === 0) {
@@ -302,7 +302,7 @@ describe('Binary Stub Isolation', () => {
302302
fs.mkdirSync(projectDir, { recursive: true })
303303
createDepsFile(projectDir, ['[email protected]'])
304304

305-
const result = await runCLI(['dev:dump'], projectDir)
305+
const result = await runCLI(['dev'], projectDir)
306306

307307
// Accept either success or failure
308308
if (result.exitCode === 0) {
@@ -335,7 +335,7 @@ describe('Binary Stub Isolation', () => {
335335
// Use a library-only package that doesn't provide binaries
336336
createDepsFile(projectDir, ['[email protected]']) // This is a library-only package
337337

338-
const result = await runCLI(['dev:dump'], projectDir)
338+
const result = await runCLI(['dev'], projectDir)
339339
// The package should install but no binary stubs will be created
340340
// This might fail if the package version doesn't exist, which is expected
341341
if (result.exitCode === 0) {
@@ -355,7 +355,7 @@ describe('Binary Stub Isolation', () => {
355355
fs.mkdirSync(projectDir, { recursive: true })
356356
createDepsFile(projectDir, ['[email protected]'])
357357

358-
const result = await runCLI(['dev:dump'], projectDir)
358+
const result = await runCLI(['dev'], projectDir)
359359

360360
// Accept either success or failure
361361
if (result.exitCode === 0) {
@@ -373,7 +373,7 @@ describe('Binary Stub Isolation', () => {
373373
fs.mkdirSync(projectDir, { recursive: true })
374374
createDepsFile(projectDir, ['[email protected]'])
375375

376-
const result = await runCLI(['dev:dump'], projectDir)
376+
const result = await runCLI(['dev'], projectDir)
377377

378378
// Accept either success or failure
379379
if (result.exitCode === 0) {
@@ -395,7 +395,7 @@ describe('Binary Stub Isolation', () => {
395395
fs.mkdirSync(projectDir, { recursive: true })
396396
createDepsFile(projectDir, ['[email protected]'])
397397

398-
const result = await runCLI(['dev:dump'], projectDir)
398+
const result = await runCLI(['dev'], projectDir)
399399

400400
// Accept either success or failure
401401
if (result.exitCode === 0) {
@@ -433,7 +433,7 @@ describe('Binary Stub Isolation', () => {
433433
BUILD_ENV: 'production',
434434
})
435435

436-
const result = await runCLI(['dev:dump'], projectDir)
436+
const result = await runCLI(['dev'], projectDir)
437437

438438
// Accept either success or failure
439439
if (result.exitCode === 0) {

packages/launchpad/test/dev.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ describe('Dev Commands', () => {
235235
}, 30000)
236236
})
237237

238-
describe('dev:dump', () => {
238+
describe('dev', () => {
239239
it('should report no devenv when no dependency files exist', async () => {
240-
const result = await runCLI(['dev:dump', tempDir])
240+
const result = await runCLI(['dev', tempDir])
241241

242242
expect(result.exitCode).toBe(1)
243243
expect(result.stderr).toContain('no devenv detected')
@@ -250,7 +250,7 @@ describe('Dev Commands', () => {
250250
TEST_VAR: 'test_value',
251251
})
252252

253-
const result = await runCLI(['dev:dump', tempDir])
253+
const result = await runCLI(['dev', tempDir])
254254

255255
// Accept either successful installation or graceful failure
256256
if (result.exitCode === 0) {
@@ -271,7 +271,7 @@ describe('Dev Commands', () => {
271271
'gnu.org/wget': '^1.21',
272272
})
273273

274-
const result = await runCLI(['dev:dump', tempDir])
274+
const result = await runCLI(['dev', tempDir])
275275

276276
// Accept either successful installation or graceful failure
277277
if (result.exitCode === 0) {
@@ -299,7 +299,7 @@ describe('Dev Commands', () => {
299299
'nonexistent-package-12345': '^1.0',
300300
})
301301

302-
const result = await runCLI(['dev:dump', tempDir])
302+
const result = await runCLI(['dev', tempDir])
303303

304304
// Should fail with exit code 1 when all packages fail to install
305305
expect(result.exitCode).toBe(1)
@@ -333,7 +333,7 @@ describe('Dev Commands', () => {
333333
fs.copyFileSync(fixturePath, path.join(testDir, path.basename(fixturePath)))
334334
}
335335

336-
const result = await runCLI(['dev:dump', testDir])
336+
const result = await runCLI(['dev', testDir])
337337
return result
338338
}
339339

@@ -591,7 +591,7 @@ describe('Dev Commands', () => {
591591
TEST_VAR: 'integration_test',
592592
})
593593

594-
const result = await runCLI(['dev:dump', tempDir])
594+
const result = await runCLI(['dev', tempDir])
595595

596596
// Accept either success or failure
597597
if (result.exitCode === 0) {
@@ -622,7 +622,7 @@ describe('Dev Commands', () => {
622622
},
623623
}))
624624

625-
const result = await runCLI(['dev:dump', tempDir])
625+
const result = await runCLI(['dev', tempDir])
626626

627627
// Accept either success or failure
628628
if (result.exitCode === 0) {
@@ -642,7 +642,7 @@ describe('Dev Commands', () => {
642642
'gnu.org/wget': '^1.21',
643643
})
644644

645-
const result = await runCLI(['dev:dump', nestedDir])
645+
const result = await runCLI(['dev', nestedDir])
646646

647647
// Accept either success or failure
648648
if (result.exitCode === 0) {
@@ -657,15 +657,15 @@ describe('Dev Commands', () => {
657657

658658
describe('Error Handling', () => {
659659
it('should handle invalid directory paths', async () => {
660-
const result = await runCLI(['dev:dump', '/nonexistent/path'])
660+
const result = await runCLI(['dev', '/nonexistent/path'])
661661
expect(result.exitCode).toBe(1)
662662
expect(result.stderr).toContain('not a directory')
663663
}, 30000)
664664

665665
it('should handle malformed dependencies.yaml', async () => {
666666
fs.writeFileSync(path.join(tempDir, 'dependencies.yaml'), 'invalid: yaml: content: [')
667667

668-
const result = await runCLI(['dev:dump', tempDir])
668+
const result = await runCLI(['dev', tempDir])
669669
expect(result.exitCode).toBe(1)
670670
}, 30000)
671671

@@ -676,7 +676,7 @@ describe('Dev Commands', () => {
676676
fs.chmodSync(tempDir, 0o444)
677677

678678
try {
679-
const result = await runCLI(['dev:dump', tempDir])
679+
const result = await runCLI(['dev', tempDir])
680680
// Should handle permission errors gracefully
681681
expect(result.exitCode).toBe(1)
682682
}
@@ -715,7 +715,7 @@ describe('Dev Commands', () => {
715715
createDependenciesYaml(tempDir, largeDeps)
716716

717717
const start = Date.now()
718-
const result = await runCLI(['dev:dump', tempDir])
718+
const result = await runCLI(['dev', tempDir])
719719
const duration = Date.now() - start
720720

721721
// Should complete even with many packages (though some may fail)

0 commit comments

Comments
 (0)