Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: switch from yarn to npm #9169

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Conversation

Yohh
Copy link
Contributor

@Yohh Yohh commented Oct 3, 2024

close #9143

@emersion emersion self-requested a review October 3, 2024 09:33
@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch from 0845e2d to 068566f Compare October 10, 2024 15:20
@github-actions github-actions bot added area:front Work on Standard OSRD Interface modules area:integration-tests Work on Integration test, by nature related to different services labels Oct 10, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.14%. Comparing base (83fbe09) to head (d443e01).
Report is 13 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##              dev    #9169       +/-   ##
===========================================
+ Coverage   37.82%   91.14%   +53.32%     
===========================================
  Files         994      773      -221     
  Lines       91103    82300     -8803     
  Branches     1176     1168        -8     
===========================================
+ Hits        34459    75015    +40556     
+ Misses      56190     7248    -48942     
+ Partials      454       37      -417     
Flag Coverage Δ
editoast ?
front 99.18% <ø> (+79.06%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@emersion
Copy link
Member

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.

@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch 5 times, most recently from f93eaa3 to 01593dc Compare October 24, 2024 18:38
@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch 2 times, most recently from fd7c55e to 6e85906 Compare November 6, 2024 14:46
@Yohh Yohh requested a review from ElysaSrc November 18, 2024 10:42
@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch 6 times, most recently from a351913 to 4ef8616 Compare November 18, 2024 15:58
@emersion
Copy link
Member

emersion commented Nov 19, 2024

  • Running npm install before renaming resolutions to overrides in package.json makes npm use @rtk-query/oazapfts-patched instead of our fork.
  • Running npm install after renaming resolutions to overrides in package.json makes npm die with ".git can't be found" in husky install.
  • Trying to upgrade oazapfts to the latest version won't work because it uses a monorepo and Git repo dependencies can't target a subdir.

@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch from fe429c1 to 32d76db Compare November 20, 2024 14:20
Signed-off-by: Yohh <durandyohan@zaclys.net>
@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch from 32d76db to cb4fea5 Compare November 20, 2024 14:33
@Yohh Yohh marked this pull request as ready for review November 20, 2024 14:33
@Yohh Yohh requested review from a team as code owners November 20, 2024 14:33
Copy link
Contributor

@shenriotpro shenriotpro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the README update

@@ -125,7 +126,7 @@
"@vitejs/plugin-react-swc": "^3.6.0",
"@vitest/coverage-v8": "^2.0.0",
"dotenv": "^16.4.5",
"eslint": "^8.56.0",
"eslint": "^8.57.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why did the version constraints in package.json change? I'd expect the package.json to stay as-is except for the overrides rename.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, unless I'm missing something, I still see these package.json changes?

Copy link
Contributor Author

@Yohh Yohh Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure your branch is up to date? I don"t see it anymore...

edit: ok I missed some packages

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

front/tsconfig.json Outdated Show resolved Hide resolved
@Khoyo
Copy link
Contributor

Khoyo commented Nov 21, 2024

[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.

@Yohh
Copy link
Contributor Author

Yohh commented Nov 21, 2024

[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

@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch from d622b9c to 487659a Compare November 21, 2024 12:00
@emersion
Copy link
Member

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.

@Yohh Yohh force-pushed the yoh/front-switch-from-yarn-to-npm branch from 487659a to ee40939 Compare November 21, 2024 12:07
@Yohh Yohh requested a review from emersion November 21, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules area:integration-tests Work on Integration test, by nature related to different services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

front: switch from yarn to npm
5 participants