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: pnpm #161

Closed
wants to merge 1 commit into from
Closed

feat: pnpm #161

wants to merge 1 commit into from

Conversation

tyrauber
Copy link
Collaborator

@tyrauber tyrauber commented Nov 12, 2023

Remove yarn / pnp, in favor of pnpm.

✅ $ pnpm unittest
✅ $ pnpm test:plugin
✅ $ pnpm build:plugin
✅ $ pnpm generate
🚩 $ pnpm lint

Checklist

  • I have tested this on a device/simulator for each compatible OS
  • I formatted JS and TS files with running yarn lint:fix in the root folder
  • I have run tests via yarn test in the root folder
  • I updated the documentation with running yarn generate in the root folder
  • I mentioned this change in CHANGELOG.md
  • I updated the typings files (index.d.ts)
  • I added/updated a sample (/example)

Remove yarn / pnp, in favor of pnpm.

 ✅ $ pnpm unittest
 ✅ $ pnpm test:plugin
 ✅ $ pnpm build:plugin
 ✅ $ pnpm generate
 🚩 $ pnpm lint
@tyrauber tyrauber mentioned this pull request Nov 13, 2023
7 tasks
@sarahsporck
Copy link
Collaborator

What would be tha advantage of pnpm in this repo? Could you work out some more context?

@tyrauber
Copy link
Collaborator Author

Hi @sarahsporck, the primary motivation was to reduce the amount of build complexity with the current setup of yarn and pnp. I believe, and please correct me if I am wrong, but this PR eliminates a whole lot of unnecessary code and configuration - 45,000 lines. Please confirm. Tests run, lint works and the plugin and library build.

There are additional benefits of PNPM over yarn and npm. It works well out of the box with monorepos and is really good at managing dependency disk space. I might be able to get both yarn and pnpm working in the same repo, if you think that is beneficial.

Take a look at #162 that builds upon this PR to implement Expo in a Monorepo environment.

Copy link
Collaborator

@sarahsporck sarahsporck left a comment

Choose a reason for hiding this comment

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

Could you run pnpm install in the example repo, too? It also seems there is a missing peer dependency here. I guess it could also make sense to set up the example repo as a workspace, but I'll keep that for you to decide.

@@ -22,17 +22,17 @@
},
"scripts": {
"fetch:style:spec": "./scripts/download-style-spec.sh",
"generate": "yarn node ./scripts/autogenerate",
"test": "npm run lint && npm run unittest",
"generate": "npx node ./scripts/autogenerate",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need npx here?

Suggested change
"generate": "npx node ./scripts/autogenerate",
"generate": "node ./scripts/autogenerate",

"test:plugin": "jest plugin",
"build:plugin": "tsc --build plugin",
"lint:plugin": "eslint plugin/src/*",
"postinstall": "husky install",
"_postinstall": "husky install",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doing this in postinstall was a yarn 2+ workaround. Look here how to properly configure husky for pnpm https://typicode.github.io/husky/getting-started.html#automatic-recommended

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.

2 participants