Repository navigation
Refactor Environment Resolution into Language-Specific Modules - #280
Conversation
Refactor resolve-environment.ts into a thin language-agnostic orchestration layer delegating JavaScript-specific runtime parsing, version resolution, and compatibility validation to javascript-env.ts.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🦋 Changeset detectedLatest commit: 453971d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Consolidate JavaScript environment resolution into src/javascript-env.ts (resolveJsEnvironment) and Python environment resolution into src/python-env.ts (resolvePythonEnvironment). Refactor resolve-environment.ts so writeOutput consumes resolved environment data directly without re-running detection. Update tests and dist artifacts.
Remove legacy fallback logic from writeOutput() in resolve-environment.ts so that writeOutput strictly consumes env.js and env.python directly without re-inspecting the workspace file system or re-resolving environments. Clean up obsolete inspectProjectEnvironment and resolvePackageManager wrappers.
…aries
Remove legacy top-level JS duplicate fields from ResolvedEnvironment, making
ResolvedEnvironment { js, python } the single source of truth. Update
setup-adapters.ts and writeOutput() to consume env.js and env.python
directly. Remove obsolete compatibility wrappers and re-exports from
resolve-environment.ts. Update unit/integration tests and rebuild dist.
- Strengthen validateEnvironment() in src/resolve-environment.ts to validate both env.js and env.python structure and types (including pmInfo and installCommands array shape). - Restore parser regression test coverage in __tests__/javascript-env.test.ts including whitespace/case normalization, malformed commas, duplicate specifiers, and token sanitization. - Fix temporary-directory cleanup ordering in integration tests so process.chdir(originalCwd) executes before fs.rmSync(tempDir) inside finally blocks for Windows compatibility. - Rebuild dist/resolve-environment.mjs.
…operty requirement
Refactored environment resolution into language-specific modules by moving JavaScript-specific detection, parsing, validation, and resolution into
src/javascript-env.ts.src/resolve-environment.tsnow acts as a thin orchestration layer coordinating JavaScript and Python environment resolution while preserving backward-compatible exports. All build artifacts and tests have been updated and verified.PR created automatically by Jules for task 11441921226944981691 started by @torn4dom4n