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

feat: update yarn to v2, update typescript #4402

Merged
merged 10 commits into from
Sep 20, 2022
Merged

Conversation

aweiss-dev
Copy link
Member

@aweiss-dev aweiss-dev commented Sep 20, 2022

This PR concentrates on workspace/tooling improvements and dependency updates.

The following has been done:

  • update yarn to v2 (https://yarnpkg.com/)
  • use yarn 2 typescript-plugin (https://yarnpkg.com/features/plugins/#official-plugins)
  • update typescript globally to the latest version
  • update other dependencies to match typescript (ts-node, karma etc.)
  • move some dev-dependencies from the dependencies array in package.json to devDepenendencies
  • fix a lot of missing dependency problems in the packages (yarn2 is more strict)
  • fix some ts related errors
  • fix most of yarns resolution warnings
  • link workspace dependencies accordingly
  • remove lerna bootsrap from the pipeline (Lerna Bootstrap Breaks When Using Yarn Version 2+ lerna/lerna#2910)
  • remove keyword 'type' from imports, since it was problematic together with ts-node

@@ -49,7 +49,7 @@ Collection of npm modules created by Wire's web team:

```bash
## Download dependencies and link packages
yarn && yarn boot
yarn
Copy link
Contributor

Choose a reason for hiding this comment

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

does yarn2 provides the exact same feature as lerna bootstrap? Why did we need the bootstrap before?

Copy link
Member Author

Choose a reason for hiding this comment

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

as far as i understand, lerna bootstrap is from ancient times when npm had no workspaces and yarn didn't exist.
Yarn2 has a very good workspace integration that takes care of the things lerna bootstrap was supposed to do.

Comment on lines -56 to -62
"nohoist": [
"**/@jest/**/*",
"**/@types/!(long)**/*",
"**/emotion-normalize",
"**/jest-emotion",
"**/react"
],
Copy link
Contributor

Choose a reason for hiding this comment

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

What was this?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is yarn hoisting (decides where to place npm modules). Its handled different in yarn2 (take a look into the yarn.yml), so this code is not needed anymore (yarn actually warns you that is deprecated)

"@wireapp/priority-queue": "1.7.0",
"@wireapp/protocol-messaging": "1.37.0",
"@wireapp/commons": "workspace:^",
"@wireapp/priority-queue": "workspace:^",
Copy link
Contributor

@atomrc atomrc Sep 20, 2022

Choose a reason for hiding this comment

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

What is going to happen to workspace:^ when we release this on NPM?

Copy link
Member Author

@aweiss-dev aweiss-dev Sep 20, 2022

Choose a reason for hiding this comment

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

https://yarnpkg.com/features/workspaces/#publishing-workspaces

TLDR: Gets replaced with latest version number

Copy link
Contributor

@atomrc atomrc left a comment

Choose a reason for hiding this comment

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

Super nice, this feels quite clean.
Thanks man good job

@aweiss-dev aweiss-dev marked this pull request as ready for review September 20, 2022 13:54
@aweiss-dev aweiss-dev merged commit 9b1cf1f into main Sep 20, 2022
@aweiss-dev aweiss-dev deleted the chore/update_typescript branch September 20, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants