fix: move vitest from dependencies to devDependencies in compiler package #1116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: move vitest from dependencies to devDependencies in compiler package
Summary
Fixed issue #1115 by moving
vitestfrom production dependencies to dev dependencies in the@lingo.dev/_compilerpackage. Thevitestpackage was incorrectly listed as a production dependency, which introduced a security vulnerability through its dependency chain (vulnerableesbuildversion viavitest@2.1.9 → vite@5.4.19 → esbuild@0.21.5).After analyzing the codebase, I confirmed that
vitestis only used in test files (*.spec.ts,*.test.ts) and thevitest.config.tsconfiguration file, making it safe to move to devDependencies.Changes:
vitest: "^2.1.4"fromdependenciestodevDependenciesinpackages/compiler/package.jsonpnpm-lock.yamlto reflect the new dependency structureReview & Testing Checklist for Human
@lingo.dev/_compileras a dependency still work correctly (the most critical test)esbuildversion is no longer pulled into the dependency tree for production installationsRecommended Test Plan:
npm lsorpnpm ls) to confirm vitest and its vulnerable dependencies are not included in production installsDiagram
%%{ init : { "theme" : "default" }}%% flowchart TD subgraph "Compiler Package" PJ["packages/compiler/<br/>package.json"]:::major-edit VC["vitest.config.ts"]:::context Tests["*.spec.ts & *.test.ts<br/>files"]:::context end subgraph "Root" Lock["pnpm-lock.yaml"]:::minor-edit end subgraph "Security Issue" Vitest["vitest@2.1.4"]:::context Vite["vite@5.4.19"]:::context Esbuild["esbuild@0.21.5<br/>(vulnerable)"]:::context end PJ -->|"moved to devDependencies"| Vitest Vitest --> Vite Vite --> Esbuild Tests -->|"imports from"| Vitest VC -->|"configures"| Vitest PJ -->|"updated"| Lock subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#f9f9f9Notes
@lingo.dev/_compilerpackage and should not impact other packages in the monorepoSession Info: