-
Notifications
You must be signed in to change notification settings - Fork 4.6k
🪟 🔧 Switch to pnpm
for package managing
#22053
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
Conversation
@@ -1,28 +1,46 @@ | |||
plugins { | |||
id "base" | |||
id "com.github.node-gradle.node" version "3.3.0" | |||
id "com.github.node-gradle.node" version "3.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Required to have PnpmTask
available.
"start:cloud": "AB_ENV=${AB_ENV-frontend-dev} node -r ./scripts/environment.js -r ./scripts/dev-overwrites.js ./node_modules/.bin/vite", | ||
"prebuild": "npm run generate-client", | ||
"prestart": "pnpm run generate-client", | ||
"start": "NODE_OPTIONS='-r ./scripts/dev-overwrites.js' vite", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ With pnpm
the node_modules/.bin/vite
script is actually a wrapping Bash script not the js
file of vite
directly anymore, so we can't call it with node
anymore, so using NODE_OPTIONS
to pass down the -r
parameter to the node
process that will execute vite
.
@@ -203,18 +200,18 @@ function manifestStreamSlicerToBuilder( | |||
} | |||
|
|||
if (manifestStreamSlicer.type === "DatetimeStreamSlicer") { | |||
const datetimeStreamSlicer = manifestStreamSlicer as DatetimeStreamSlicer; | |||
const datetimeStreamSlicer = manifestStreamSlicer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ I believe pnpm
pulled now in a newer version of orval
which generates the types slightly better, so this isn't needed anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray!
@@ -11,7 +10,7 @@ import styles from "./admonitions.module.scss"; | |||
const SUPPORTED_ADMONITION_NAMES: Readonly<string[]> = ["note", "tip", "info", "caution", "warning", "danger"]; | |||
const SUPPORTED_NODE_TYPES: Readonly<string[]> = ["textDirective", "leafDirective", "containerDirective"]; | |||
|
|||
export const remarkAdmonitionsPlugin: Plugin<[], Root> = () => (tree) => { | |||
export const remarkAdmonitionsPlugin: Plugin<[]> = () => (tree) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Typings works very fine with the Root
so no need to pull in mdast
(which is also the deprecated version of remark) for that.
@@ -26,7 +27,7 @@ export const NextTable = <TData,>({ columns, data, onClickRow, className }: Prop | |||
{headerGroup.headers.map((header) => ( | |||
<th | |||
colSpan={header.colSpan} | |||
className={classNames(styles.th, header.column.columnDef.meta?.thClassName)} | |||
className={classNames(styles.th, (header.column.columnDef.meta as ColumnMeta | undefined)?.thClassName)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ The type overwrite via declare
doesn't work with pnpm
anymore (I don't fully understand why, yet), so moving it into an in place cast instead.
@@ -9,7 +9,7 @@ module.exports = { | |||
"plugin:jsx-a11y/recommended", | |||
"plugin:@airbyte/recommended", | |||
], | |||
plugins: ["react", "@typescript-eslint", "prettier", "unused-imports", "css-modules", "jsx-a11y", "@airbyte"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This is with pnpm
now conflicting with the react
plugin already being pulled in by eslint-config-react-app
which we extend above. Since that plugin pulls in the react
plugin also no need for us to pull it in explicitally.
@@ -1 +1,2 @@ | |||
engine-strict=true | |||
enable-pre-post-scripts=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Required for pnpm
to execute the prestart
etc scripts. It doesn't do so by default, but we're using the heavily for Orval compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and everything still seems to work, lgtm.
Should we switch over the e2e test package as well for consistency reasons?
- Install the `pnpm` package manager in the required version: | ||
|
||
```bash | ||
# <version> must be the exact version from airbyte-webapp/package.json > engines.pnpm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker for this PR, but it looks like pnpm ships with a node version manager too, should we just use that one? One tool less
Didn't look into it in detail though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked a bit into it, but currently didn't saw much of a benefit over keep using nvm
(also we anyway need npm
first to install pnpm
, so we either need to guide to nvm
or a local node installation in our docs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can install pnpm without npm, right? https://pnpm.io/installation
Given we barely update anything in there and don't have much problems with |
A user needs to make sure to call either npm or pnpm, depending on whether they are working in e2e or regular webapp (and keep both of them around and up to date) |
Problem is, we already have some other modules (the doc system) using yarn anyway, so I feel it's not that bad having |
Good thing you mention this, that was a little annoying as well :) There's a lot of different technologies in this repo, would be nice to consolidate where possible. But I don't think it's a big deal - as you say, it's not a big cost in day-to-day development |
* master: Discover worker starts to use API to write schema result (#21875) 🪟 🎉 Connector Builder Landing Page (#22122) Fix pnpm cache path (#22418) Add additional shorter setup guides (#22318) Source Amazon Ads: fix reports stream records primary keys (#21677) Connector acceptance test: Fix discovered catalog caching for different configs (#22301) 🪟🐛 Make modal scrollable (#21973) only compute diff if the schema discovery actually succeeded (#22377) Source Klaviyo: fix schema (#22071) 🪟 🔧 Switch to `pnpm` for package managing (#22053) Source Sentry: turn on default availability strategy (#22303) Source freshdesk: deduplicate table names (#22164)
* master: (86 commits) Discover worker starts to use API to write schema result (#21875) 🪟 🎉 Connector Builder Landing Page (#22122) Fix pnpm cache path (#22418) Add additional shorter setup guides (#22318) Source Amazon Ads: fix reports stream records primary keys (#21677) Connector acceptance test: Fix discovered catalog caching for different configs (#22301) 🪟🐛 Make modal scrollable (#21973) only compute diff if the schema discovery actually succeeded (#22377) Source Klaviyo: fix schema (#22071) 🪟 🔧 Switch to `pnpm` for package managing (#22053) Source Sentry: turn on default availability strategy (#22303) Source freshdesk: deduplicate table names (#22164) Update connector-acceptance-tests-reference.md (#22370) Update the default security groups for the EC2 runner (#22347) Trace refresh schema operations (#22326) Remove manual docker upgrades from workflows (#22344) Update CODEOWNERS for connector acceptance tests to connector ops (#22341) 🐛 source: airtable - handle singleSelect types (#22311) Source tiktok: chunk advertiser IDs (#22309) 🪟 🧪 E2E Tests for auto-detect schema changes (#20682) ...
* master: (24 commits) Discover worker starts to use API to write schema result (#21875) 🪟 🎉 Connector Builder Landing Page (#22122) Fix pnpm cache path (#22418) Add additional shorter setup guides (#22318) Source Amazon Ads: fix reports stream records primary keys (#21677) Connector acceptance test: Fix discovered catalog caching for different configs (#22301) 🪟🐛 Make modal scrollable (#21973) only compute diff if the schema discovery actually succeeded (#22377) Source Klaviyo: fix schema (#22071) 🪟 🔧 Switch to `pnpm` for package managing (#22053) Source Sentry: turn on default availability strategy (#22303) Source freshdesk: deduplicate table names (#22164) Update connector-acceptance-tests-reference.md (#22370) Update the default security groups for the EC2 runner (#22347) Trace refresh schema operations (#22326) Remove manual docker upgrades from workflows (#22344) Update CODEOWNERS for connector acceptance tests to connector ops (#22341) 🐛 source: airtable - handle singleSelect types (#22311) Source tiktok: chunk advertiser IDs (#22309) 🪟 🧪 E2E Tests for auto-detect schema changes (#20682) ...
What
Switches from using
npm
topnpm
for package managing inairbyte-webapp
.To use it locally you need to install the exact matching
pnpm
version:Closes #21482
How
package-lock.json
with thepnpm-lock.yaml
file.pnpm
instead ofnpm
, also add an additional task that runs beforepnpmInstall
that validates we only have thepnpm-lock.yml
file and no other lock file (to prevent accidental committing of a newpackage-lock.json
file).pnpm
has a patch mechanism built in, so I could remove the nastyreact-virtualize
patch code from Vite and instead use the properpnpm
patch mechanism for it.pnpm
pulling in slightly newer versions.