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

2966: Migrating to Modern Yarn #2968

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bahaaTuffaha
Copy link
Contributor

Short description

Upgraded to [email protected]

Proposed changes

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 run corepack enable once to activate Corepack.

  • I suggest to delete all node modules files from the repo then do yarn install.

Resolved issues

Fixes: #2966


@LeandraH
Copy link
Contributor

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

@bahaaTuffaha
Copy link
Contributor Author

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

@bahaaTuffaha bahaaTuffaha marked this pull request as draft October 22, 2024 11:25
Copy link
Contributor

@LeandraH LeandraH left a 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.

"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",
Copy link
Contributor

@LeandraH LeandraH Oct 28, 2024

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@LeandraH LeandraH Oct 29, 2024

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")
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Contributor

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

@@ -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",
Copy link
Contributor

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.

"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",
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ Same here

Comment on lines 41 to 42
"prettier:check": "yarn g:prettier:check",
"prettier:write": "yarn g:prettier:write",
Copy link
Contributor

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
Comment on lines 17 to 18
"lint": "yarn g:lint",
"g:lint": "eslint --cache --cache-location .eslintcache . && yarn workspace web stylelint && yarn workspace native stylelint",
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Two things:

  1. This is at root, so there isn't really any code in this directory to be linted.
  2. If I now execute yarn lint in the root directory, yarn checks in package.json what to do for the command lint and sees that it should execute yarn 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.

@@ -24,6 +21,7 @@
"minisearch": "^7.1.0",
"normalize-path": "^3.0.0",
"normalize-strings": "^1.1.1",
"react": "workspaces:web",
Copy link
Contributor

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",
Copy link
Contributor

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",
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ And this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrating yarn from classic to modern
2 participants