ci: use npm ci and drop the unused jest toolchain#981
Open
Anexus5919 wants to merge 1 commit into
Open
Conversation
|
@Anexus5919 is attempting to deploy a commit to the somiljain2024-4175's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@Somil450 @diksha78dev Kindly have a review on this pr. Thanks! |
4d8f420 to
db338cb
Compare
CI installed deps with npm install (ignores the lockfile); switch the frontend and backend steps to npm ci for reproducible installs. Sync the root lockfile (adds the missing TensorFlow tree) so npm ci passes; both package-lock files verify with npm ci --dry-run. Remove the unused jest devDeps (jest, jest-environment-jsdom, ts-jest, @types/jest) and jest.config.cjs: the test runner is vitest and nothing references jest. Add @vitest/coverage-v8 (required by the test:coverage script) and @testing-library/dom as a direct devDep so npm ci keeps it for the React Testing Library setup.
db338cb to
999af0a
Compare
Contributor
Author
|
@Somil450 @diksha78dev Kindly have a review on this pr. Thanks! |
Contributor
Author
|
This failing check is from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 Related Issue
Fixes #897
Fixes #900
Fixes #901
📝 Description
Dependency, lockfile, and test-toolchain hygiene. These three are bundled because they all regenerate the root
package-lock.jsonand depend on the same@testing-library/domfix, so splitting them would mean three mutually-conflicting lockfiles.🔹 What has been changed?
npm install, lockfile out of sync): CI installed withnpm install, which ignores the lockfile (non-reproducible). Switching tonpm cirequirespackage.jsonand the lockfile to be in sync, which they were not:@tensorflow/tfjs/@tensorflow/tfjs-layersare inpackage.jsonbut were absent from the root lockfile, sonpm cifailed on the frontend (theserver/lockfile was already in sync). Regenerated the root lockfile so it is in sync, and switched both CI install steps (frontend and backend) tonpm ci.jest.config.cjsand thejest/ts-jest/jest-environment-jsdom/@types/jestdevDependencies were left behind (the CHANGELOG already claims they were removed). Deleted the config file and the four orphan devDependencies. Kept@testing-library/jest-dom(the jest-dom matchers, used by the vitest setup).test:coverageprovider missing):test:coveragerunsvitest run --coverage, but no coverage provider was installed. Added@vitest/coverage-v8pinned to vitest's version (4.1.7).@testing-library/domas a direct devDependency: regenerating with npm 10 otherwise drops it (it is only a transitive dep of@testing-library/react), which breaks React Testing Library undernpm ci.🔹 Why are these changes needed?
npm cigives reproducible, lockfile-pinned installs and is the correct command for CI, but it only works oncepackage.jsonand the lockfile agree, which is the same out-of-sync state issue CI uses npm install, not npm ci (and the root lockfile is out of sync, blocking npm ci) #897 reports. The orphan Jest packages are dead weight after the vitest migration, andtest:coverageis currently broken without the v8 provider. Pinning@testing-library/domkeeps the RTL setup working across lockfile regenerations.🛠️ Type of Change
🧪 Testing
✅ Tests Performed
npm ci --dry-runexits 0 for both the repo root andserver/.@testing-library/dom@10.4.1present;@tensorflow/tfjs@4.22.0now present (was missing);vitestand@vitest/coverage-v8both4.1.7;jest/ts-jest/jest-environment-jsdom/@types/jestabsent.vitest run).🔹 Note on automated tests
Lockfile regenerated with
npm install --package-lock-only(nonode_moduleswrite), so the local environment is untouched and the diff is limited to the lockfile metadata.🌐 Browsers Tested
Not applicable (CI / dependency configuration).
📷 Screenshots / Demo (if applicable)
Not applicable.
📋 Checklist
💬 Additional Notes
Branched fresh from
upstream/mainand the lockfile regenerated against the current base, so it merges cleanly (the previous version of this branch conflicted only on the regenerated lockfile). Declaring@testing-library/domdirectly also resolves the long-standing eviction, so React Testing Library component tests can run again undernpm ci.