-
Notifications
You must be signed in to change notification settings - Fork 14
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
2966: Migrating to Modern Yarn #2968
base: main
Are you sure you want to change the base?
Conversation
Thank you, I probably won't manage to have time today to take a look at it but maybe also check out this old PR that was never merged to see what went wrong there and if this PR fixes the issues: #2588 |
I found out it needs to be bit more in the oven.. sorry.. yarn test is not working I'm investigating...I will convert this PR to Draft for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small comments, as discussed on Mattermost, next thing to do is get the commands in the package.json
files to work in their respective folders.
native/package.json
Outdated
"ts:check": "tsc --build", | ||
"prettier:check": "yarn prettier --ignore-path ../.prettierignore --check .", | ||
"prettier:write": "yarn prettier --ignore-path ../.prettierignore --write .", | ||
"ts:check": "yarn ts:check", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ That looks like a pretty circular reference to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, sorry, but I don't understand what sharing scripts between different workspaces has to do with it being a circular reference. This command would run in the folder it is run in, in this case /native
, not in the root
. Is this maybe the wrong link? Or if not, could you elaborate a little on why you think this applies here?
Also, I thought we agreed that we want the commands that are run in a folder to only run in that folder? I guess we could add global commands to each package.json
but I'm not sure that's necessary, you can always just do cd ..
and then run the command globally there.
@@ -39,7 +39,7 @@ def determineBuildConfigName() { | |||
} | |||
|
|||
def createYarnProcess(buildConfigName, platform, command) { | |||
return execCommand("yarn workspace --silent build-configs --silent manage $command $buildConfigName $platform") | |||
return execCommand("yarn workspace build-configs manage $command $buildConfigName $platform") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Why did you remove the silent flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yarn complains about them and I didn't find any mention of it in the docs.
And I tried this also:
yarnpkg/yarn#788 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, looks like it has been completely removed, thanks for looking into it!
yarnpkg/berry#3542
native/package.json
Outdated
@@ -31,16 +31,15 @@ | |||
"android:reverse": "adb reverse tcp:8081 tcp:8081", | |||
"android:reinit": "adb shell pm clear com.integreat && adb shell am start com.integreat/com.integreat.MainActivity", | |||
"android:start-avd": "bash -c '$ANDROID_HOME/emulator/emulator -avd $($ANDROID_HOME/emulator/emulator -list-avds | head -n 1)'", | |||
"test": "jest", | |||
"test": "yarn g:test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Those are not the same thing, we want to be able to run only the native tests while in the native
folder.
native/package.json
Outdated
"test:changed": "yarn run test -o", | ||
"test:e2e": "yarn workspace e2e test:native:browserstack", | ||
"lint": "yarn stylelint && eslint --cache --cache-location ../.eslintcache .", | ||
"stylelint": "stylelint --config stylelint.config.js \"src/**/*.{ts,tsx,css}\"", | ||
"lint": "yarn g:lint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Same here
native/package.json
Outdated
"prettier:check": "yarn g:prettier:check", | ||
"prettier:write": "yarn g:prettier:write", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ And here
package.json
Outdated
"lint": "yarn g:lint", | ||
"g:lint": "eslint --cache --cache-location .eslintcache . && yarn workspace web stylelint && yarn workspace native stylelint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Why did you decide on those two different commands that do the same thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 one for the current dir and the other for other workspaces...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
- This is at root, so there isn't really any code in this directory to be linted.
- If I now execute
yarn lint
in the root directory, yarn checks inpackage.json
what to do for the commandlint
and sees that it should executeyarn g:lint
. Which is the command in line 18. So both commands do the same thing with line 17 just being a reference to line 18. I don't think that's necessary.
shared/package.json
Outdated
@@ -24,6 +21,7 @@ | |||
"minisearch": "^7.1.0", | |||
"normalize-path": "^3.0.0", | |||
"normalize-strings": "^1.1.1", | |||
"react": "workspaces:web", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Why did you decide to not keep that as a peer dependency?
@@ -36,6 +35,7 @@ | |||
"build-configs": "0.0.1", | |||
"dompurify": "^3.1.6", | |||
"focus-trap-react": "^10.2.3", | |||
"htmlparser2": "^9.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Why did you add this?
@@ -87,6 +87,7 @@ | |||
"raf": "^3.4.1", | |||
"react-refresh": "^0.14.2", | |||
"react-refresh-typescript": "^2.0.9", | |||
"rrule": "2.8.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ And this?
Short description
Upgraded to
[email protected]
Proposed changes
yarnrc.yml will have
nodeLinker: node-modules
meaning its not depending on pnp more on that at (https://yarnpkg.com/features/pnp)Note we can do hybrid pnp in the future look at https://yarnpkg.com/getting-started/recipes#hybrid-pnp--node_modules-mono-repo
nohoist
is deprecated so I removed it and addednmHoistingLimits: workspaces
This yarn version at some places it complains about
--silent
so I removed some of them. Still looking for a way to silent these warnings.Note: not tested on iOS and focused mainly on integrate native and integrate web app.
Side effects
Not sure
Testing
I used this time: Node 22.9.0 you can install by nvm
before
yarn install
make sure to runcorepack enable
once to activate Corepack.I suggest to delete all node modules files from the repo then do yarn install.
Resolved issues
Fixes: #2966