Skip to content

Commit 51f2721

Browse files
committed
chore: wip
1 parent 0d8ac79 commit 51f2721

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

packages/launchpad/src/dev/dump.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ export async function dump(dir: string, options: DumpOptions = {}): Promise<void
674674
console.log(`Global packages: ${globalPackages.join(', ')} (${globalStatus})`)
675675
}
676676
if (localPackages.length > 0) {
677-
// Check if constraints are satisfied (either by installed packages or system binaries)
677+
// Check if constraints are satisfied (either by installed packages or system binaries)
678678
const localConstraintsSatisfied = localReadyResult.missingPackages?.length === 0
679679
const localStatus = (localReady || localConstraintsSatisfied) ? 'satisfied by existing installations' : 'would install locally'
680680
console.log(`Local packages: ${localPackages.join(', ')} (${localStatus})`)
@@ -718,14 +718,19 @@ export async function dump(dir: string, options: DumpOptions = {}): Promise<void
718718
return
719719
}
720720
else {
721-
// No fallback available - require installation
721+
// No fallback available - but still generate shell code for development workflows
722722
process.stderr.write(`❌ Environment not ready: local=${localReady}, global=${globalReady}\n`)
723723
if (!localReady && localPackages.length > 0) {
724724
process.stderr.write(`💡 Local packages need installation: ${localPackages.join(', ')}\n`)
725725
}
726726
if (!globalReady && globalPackages.length > 0) {
727727
process.stderr.write(`💡 Global packages need installation: ${globalPackages.join(', ')}\n`)
728728
}
729+
process.stderr.write(`⚠️ Generating minimal shell environment for development\n`)
730+
731+
// Generate basic shell code even when packages aren't installed
732+
// This allows development workflows to continue with system binaries
733+
outputShellCode(dir, envBinPath, envSbinPath, projectHash, sniffResult, globalBinPath, globalSbinPath)
729734
return
730735
}
731736
}

packages/launchpad/test/environment-activation.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Environment Activation Behavior', () => {
2626
}
2727
})
2828

29-
test('should not activate environment when required packages are missing from environment directories', async () => {
29+
test('should generate shell code with warnings when required packages are missing from environment directories', async () => {
3030
// Create a project with dependency requirements
3131
const projectDir = path.join(tempDir, 'project')
3232
fs.mkdirSync(projectDir)
@@ -63,13 +63,14 @@ dependencies:
6363
skipGlobal: true // Focus on local environment for this test
6464
})
6565

66-
// Shell output should be empty or contain error messages, not environment setup
67-
expect(shellOutput).not.toContain('export PATH=')
68-
expect(shellOutput).not.toContain('LAUNCHPAD_ORIGINAL_PATH')
66+
// Shell output should be generated for development workflows even when packages missing
67+
expect(shellOutput).toContain('export PATH=')
68+
expect(shellOutput).toContain('LAUNCHPAD_ORIGINAL_PATH')
6969

7070
// Should have error messages about missing packages
7171
expect(errorOutput).toContain('Environment not ready')
7272
expect(errorOutput).toContain('Local packages need installation')
73+
expect(errorOutput).toContain('Generating minimal shell environment for development')
7374

7475
} finally {
7576
// Restore original stdout/stderr
@@ -78,7 +79,7 @@ dependencies:
7879
}
7980
})
8081

81-
test('should activate environment only when required packages are actually installed in environment directories', async () => {
82+
test('should generate shell code with warnings when environment directories are empty', async () => {
8283
// Create a project directory
8384
const projectDir = path.join(tempDir, 'project')
8485
fs.mkdirSync(projectDir)
@@ -128,9 +129,10 @@ dependencies:
128129
skipGlobal: true
129130
})
130131

131-
// With empty environment, should not activate
132-
expect(shellOutput).not.toContain('export PATH=')
132+
// With empty environment, should still generate shell code for development workflows
133+
expect(shellOutput).toContain('export PATH=')
133134
expect(errorOutput).toContain('Environment not ready')
135+
expect(errorOutput).toContain('Generating minimal shell environment for development')
134136

135137
} finally {
136138
process.stdout.write = originalStdout

0 commit comments

Comments
 (0)