osrd
osrd copied to clipboard
front: switch from yarn to npm
close #9143
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 79.84%. Comparing base (
c98d385) to head (8bef3dc). Report is 22 commits behind head on dev.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## dev #9169 +/- ##
===========================================
+ Coverage 38.19% 79.84% +41.64%
===========================================
Files 998 1053 +55
Lines 92197 105088 +12891
Branches 1192 757 -435
===========================================
+ Hits 35219 83909 +48690
+ Misses 56522 21138 -35384
+ Partials 456 41 -415
| Flag | Coverage Δ | |
|---|---|---|
| editoast | 73.35% <ø> (-0.04%) |
:arrow_down: |
| front | 89.34% <ø> (+69.18%) |
:arrow_up: |
| gateway | 2.18% <ø> (ø) |
|
| osrdyne | 3.28% <ø> (ø) |
|
| railjson_generator | 87.49% <ø> (ø) |
|
| tests | 87.00% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I had success running https://github.com/imsnif/synp
I think we'd be less likely to run into issues if we can use this tool instead of crossing fingers.
- Running
npm installbefore renamingresolutionstooverridesinpackage.jsonmakes npm use@rtk-query/oazapfts-patchedinstead of our fork. - Running
npm installafter renamingresolutionstooverridesinpackage.jsonmakes npm die with ".git can't be found" inhusky install. - Trying to upgrade
oazapftsto the latest version won't work because it uses a monorepo and Git repo dependencies can't target a subdir.
[khoyo@odin osrd-hotfix]$ git grep yarn
front/README.md:- Install playwright dependencies `cd ./front/ && yarn playwright install --with-deps`
front/README.md:this script as you would to `yarn e2e-tests` or `yarn playwright test`.
front/docker/Dockerfile.playwright:COPY front/package.json front/yarn.lock /app/front/
front/docker/Dockerfile.playwright:RUN yarn install --frozen-lockfile
front/package-lock.json: "yarn": "^1.7.0"
front/package-lock.json: "yarn": ">=1"
front/package-lock.json: "yarn": ">=1"
front/package-lock.json: "yarn": "*"
front/package-lock.json: "node_modules/yarn": {
front/package-lock.json: "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz",
front/package-lock.json: "yarn": "bin/yarn.js",
front/package-lock.json: "yarnpkg": "bin/yarn.js"
scripts/run-front-playwright-container.sh:VERSION=$(yarn list --pattern playwright --json | jq -r '.data.trees[].name | split("@")[-1]' | sort -u)
scripts/run-front-playwright-container.sh: osrd-playwright:latest yarn playwright test "${args[@]}"
The dependency in the lockfile is probably valid, the rest probably isn't.
[khoyo@odin osrd-hotfix]$ git grep yarn front/README.md:- Install playwright dependencies `cd ./front/ && yarn playwright install --with-deps` front/README.md:this script as you would to `yarn e2e-tests` or `yarn playwright test`. front/docker/Dockerfile.playwright:COPY front/package.json front/yarn.lock /app/front/ front/docker/Dockerfile.playwright:RUN yarn install --frozen-lockfile front/package-lock.json: "yarn": "^1.7.0" front/package-lock.json: "yarn": ">=1" front/package-lock.json: "yarn": ">=1" front/package-lock.json: "yarn": "*" front/package-lock.json: "node_modules/yarn": { front/package-lock.json: "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz", front/package-lock.json: "yarn": "bin/yarn.js", front/package-lock.json: "yarnpkg": "bin/yarn.js" scripts/run-front-playwright-container.sh:VERSION=$(yarn list --pattern playwright --json | jq -r '.data.trees[].name | split("@")[-1]' | sort -u) scripts/run-front-playwright-container.sh: osrd-playwright:latest yarn playwright test "${args[@]}"The dependency in the lockfile is probably valid, the rest probably isn't.
you're right, I removed the useless mentions in package-lock.json and updated the playwright script, thank you
The package-lock.json references should be retained. In general this file shouldn't be edited by hand. It has "yarn" references because some of our dependencies depend on yarn.
Some platform-specific optional dependencies were missing from package-lock.json due to https://github.com/npm/cli/issues/4828, causing breakage on platforms other than Linux amd64. To fix it, dependencies with platform-specific sub-packages need to be re-installed to force npm to not look at node_modules/. I did the following:
npm install --save-dev [email protected] @swc/[email protected]
git restore package.json
npm install
everything works fine for me on macos and linux