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: enforce pnpm 7.5.0 #1125

Merged
merged 5 commits into from
Aug 29, 2022
Merged

feat: enforce pnpm 7.5.0 #1125

merged 5 commits into from
Aug 29, 2022

Conversation

venarius
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    This fixes some issues with pnpm that I had while creating PRs for Novu:

    1. Newer versions of pnpm will break the CI and seem to install unneeded packages.

    Reference: refactor: use date-fns instead of moment #1122

    Solution: Enforce pnpm version of 7.5.0
    Screenshot 2022-08-25 144807

     

    2. When running npm run setup:project for the first time everything works as inteded. But if you run that command again it would downgrade your pnpm-lock.yaml to lockfileVersion 5.3

    Reference inside feat: enable custom theme to be provided to iframe embed #1048:

    Screenshot 2022-08-25 145941

    That was an issue because of the repos package.json having pnpm: 6.34.0 as devDependency and npx falling back to the local cached version instead of using the version number provided in the cli command:
    Screenshot 2022-08-25 145211

    Solution: Increase the devDependency version of pnpm to 7.5.0

@vercel
Copy link

vercel bot commented Aug 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
docs ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 1:09PM (UTC)

@netlify
Copy link

netlify bot commented Aug 25, 2022

Deploy Preview for docs-novu canceled.

Name Link
🔨 Latest commit 63f383c
🔍 Latest deploy log https://app.netlify.com/sites/docs-novu/deploys/630b684da72cff0008bbfb76

@venarius
Copy link
Contributor Author

venarius commented Aug 25, 2022

Reason for failing NX build command: nrwl/nx#10111
Due to upgrade of pnpm from 6.34.0 to 7.5.0 as devDependency. Issue fixed with NX version 14.5.10. Because of that I also upgraded NX from 14.5.4 to 14.5.10

Copy link
Contributor

@scopsy scopsy left a comment

Choose a reason for hiding this comment

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

This is great, a small comment on the setup:project command wdyt on that one?

package.json Outdated
"scripts": {
"bootstrap": "npm run setup:dev",
"start": "npm run jarvis",
"preinstall": "npx only-allow pnpm",
"prepare": "husky install",
"publish": "lerna publish from-package",
"setup:project": "npx pnpm@7.5.0 i && node scripts/setup-env-files.js && npx pnpm build",
"setup:project": "pnpm i && node scripts/setup-env-files.js && pnpm build",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"setup:project": "pnpm i && node scripts/setup-env-files.js && pnpm build",
"setup:project": "npx pnpm i && node scripts/setup-env-files.js && npm run build",

Wanted to have the initial setup of the project work without pnpm installed on your machine, and you would need it only if you want to add some dependencies. Wdyt, of only leaving the npx here?

Copy link
Contributor Author

@venarius venarius Aug 25, 2022

Choose a reason for hiding this comment

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

Yeah we can do that, true 🙂 But we still need to lock the version number then because it will otherwise install the latest pnpm and we can leave pnpm in the end because it is installed after running the pnpm i - I commited it

Copy link
Contributor

Choose a reason for hiding this comment

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

good point about the lock part. Agree with this.

@@ -111,7 +112,7 @@
"listr": "^0.14.3",
"meow": "^10.1.1",
"mississippi": "^4.0.0",
"pnpm": "^6.34.0",
"pnpm": "7.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is great!

@@ -1,13 +1,14 @@
{
"name": "novuhq",
"private": true,
"packageManager": "pnpm@7.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh nice didn't knew this prop existed

@scopsy
Copy link
Contributor

scopsy commented Aug 28, 2022

Oh Looks like vercel is failing :|





Cloning github.com/novuhq/novu (Branch: feat/enforce-pnpm-version, Commit: 310dec1)
23:36:18.232 | Cloning completed: 738.862ms
23:36:19.463 | Looking up build cache...
23:36:23.267 | Build cache downloaded [53.70 MB]: 3123.984ms
23:36:23.489 | Running "vercel build"
23:36:23.984 | Vercel CLI 28.1.2
23:36:24.537 | Detected `pnpm-lock.yaml` generated by pnpm 7...
23:36:24.537 | Running "install" command: `cd ../ && npm run install:docs`...
23:36:24.753 |  
23:36:24.754 | > novuhq@ install:docs /vercel/path0
23:36:24.754 | > pnpm install --filter @novu/docs
23:36:24.754 |  
23:36:25.319 | ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)
23:36:25.319 |  
23:36:25.320 | Your pnpm version is incompatible with "/vercel/path0".
23:36:25.320

We are looking right now to switch to netlify and they allow easily override the install script on their dashboard.

@scopsy
Copy link
Contributor

scopsy commented Aug 28, 2022

@andrewgolovanov this one is another reason we want to make the move to netlify for all our projects.

@venarius
Copy link
Contributor Author

venarius commented Aug 28, 2022

@scopsy maybe you can use this? https://vercel.com/changelog/corepack-experimental-is-now-available - thats why I added that packageManager field

@scopsy
Copy link
Contributor

scopsy commented Aug 28, 2022

It worked!

@vercel
Copy link

vercel bot commented Aug 28, 2022

@scopsy is attempting to deploy a commit to the Novu Team on Vercel.

A member of the Team first needs to authorize it.

@scopsy scopsy merged commit 38467f3 into novuhq:main Aug 29, 2022
@venarius venarius deleted the feat/enforce-pnpm-version branch August 29, 2022 07:22
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.

None yet

2 participants