Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Switch from lerna to pnpm #888

Merged
merged 16 commits into from Nov 3, 2020
Merged

Switch from lerna to pnpm #888

merged 16 commits into from Nov 3, 2020

Conversation

evantahler
Copy link
Member

@evantahler evantahler commented Oct 23, 2020

pnpm is faster, shares dependencies and can still support monorepos.

Tasks:

  • Install PNPM
  • Change install scripts
  • Change CI scripts
  • Enforce PNPM usage
  • Revisit CI Cache
  • Tests Pass
  • Sort out Publishing (we can continue to use Lerna)

Notes:

  • We can still use Lerna to publish and update versons... just not for managing dependencies.

Closes T-655

@evantahler evantahler added the dependencies Pull requests that update a dependency file label Oct 23, 2020
@evantahler
Copy link
Member Author

Currently blocked when running tests against a next.js error:

    ReferenceError: URL is not defined

      at Object.<anonymous> (../../node_modules/.pnpm/next@9.5.6-canary.13_8276e7ef4e4bcb622af0fe7b5225f62d/node_modules/next/next-server/lib/router/utils/parse-relative-url.ts:8:1)
      at Object.<anonymous> (../../node_modules/.pnpm/next@9.5.6-canary.13_8276e7ef4e4bcb622af0fe7b5225f62d/node_modules/next/next-server/lib/router/utils/prepare-destination.ts:4:1)
      at Object.<anonymous> (../../node_modules/.pnpm/next@9.5.6-canary.13_8276e7ef4e4bcb622af0fe7b5225f62d/node_modules/next/next-server/server/next-server.ts:65:1)
      at Object.<anonymous> (../../node_modules/.pnpm/next@9.5.6-canary.13_8276e7ef4e4bcb622af0fe7b5225f62d/node_modules/next/server/next.ts:3:1)
      at Object.<anonymous> (../../node_modules/.pnpm/ah-next-plugin@0.3.0_5139af8b50ead0a453273331284dbaed/node_modules/ah-next-plugin/dist/initializers/next.js:8:32)

@evantahler evantahler added the BLOCKED do not merge label Oct 23, 2020
@evantahler evantahler mentioned this pull request Oct 27, 2020
@evantahler
Copy link
Member Author

The Next error was resolved by actionhero/ah-next-plugin#115

@height
Copy link

height bot commented Oct 27, 2020

This pull request has been linked to and will mark 1 task as "Delivered" when merged:

💡Tip: You can link multiple Height tasks to a pull request.

@evantahler evantahler marked this pull request as ready for review October 27, 2020 18:55
@evantahler
Copy link
Member Author

@bleonard can you give this branch a whirl to make sure everything works for you? start with npm run nuke and then try pnpm install. It should install all the deps and build all the packages... but faster! Also, check out both npm run start and npm run dev... which should preform about the same as they do on master.

@evantahler evantahler removed the BLOCKED do not merge label Oct 29, 2020
@evantahler
Copy link
Member Author

If this PR is merged - Update https://www.grouparoo.com/docs/development

@bleonard
Copy link
Member

bleonard commented Oct 29, 2020

Started with fresh directory
> npm i -g pnpm
> pnpm install

apps/staging-public> npm run dev seems to work.

apps/staging-public> npm start has this error:

➜  staging-public git:(pnpm) npm start

> @grouparoo/app-staging-public@0.1.23 start /Users/brian/grouparoo/test/grouparoo/apps/staging-public
> cd node_modules/@grouparoo/core && GROUPAROO_MONOREPO_APP=staging-public ./api/bin/start

modified your runtime environment with /Users/brian/grouparoo/test/grouparoo/apps/staging-public/.env

!!! plugin @grouparoo/files-s3 requires environment variable S3_ACCESS_KEY to be set !!!


!!! plugin @grouparoo/files-s3 requires environment variable S3_SECRET_ACCESS_KEY to be set !!!


!!! plugin @grouparoo/files-s3 requires environment variable S3_REGION to be set !!!


!!! plugin @grouparoo/files-s3 requires environment variable S3_BUCKET to be set !!!


!!! plugin @grouparoo/newrelic requires environment variable NEW_RELIC_LICENSE_KEY to be set !!!


!!! plugin @grouparoo/newrelic requires environment variable NEW_RELIC_APP_NAME to be set !!!

not injecting newrelic because NEW_RELIC_LICENSE_KEY is not set
2020-10-29T23:55:41.902Z - notice: Starting Grouparoo 0.1.23 on node.js v12.16.3 
2020-10-29T23:55:42.395Z - info: UNHANDLED REJECTION: Error: Cannot find module 'validator/lib/isURL'
Require stack:
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/modules/ops/profileProperty.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/ProfileProperty.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/ProfilePropertyRule.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/GroupRule.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/Group.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/GroupMember.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/Profile.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/Run.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/Schedule.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/Source.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/models/App.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/modules/plugin.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/index.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/initializers/events.js
- /Users/brian/grouparoo/test/grouparoo/node_modules/.pnpm/actionhero@24.0.1/node_modules/actionhero/dist/classes/process.js
- /Users/brian/grouparoo/test/grouparoo/node_modules/.pnpm/actionhero@24.0.1/node_modules/actionhero/dist/index.js
- /Users/brian/grouparoo/test/grouparoo/core/api/dist/grouparoo.js

@bleonard
Copy link
Member

Stats from my computer.
master: npm install 1028.81s user 236.01s system 138% cpu 15:16.08 total
pnpm: pnpm install 537.00s user 53.32s system 166% cpu 5:54.92 total

3x faster 🎉

@bleonard
Copy link
Member

npm start is looking good now.

- "clients/**"
- "plugins/**"
- "apps/**"
- "!apps/local-public"
Copy link
Member

Choose a reason for hiding this comment

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

why not this one?

Copy link
Member Author

Choose a reason for hiding this comment

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

We ignore it in Lerna-land as well https://github.com/grouparoo/grouparoo/blob/master/lerna.json#L11-L13

Just so we don't need to wait for 2 apps to build when installing

@evantahler evantahler merged commit 7afc2bd into master Nov 3, 2020
@evantahler evantahler deleted the pnpm branch November 3, 2020 20:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants