-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore (package): Specify Node version and document versions. #3352
base: main
Are you sure you want to change the base?
Conversation
addb571
to
5e6ae5d
Compare
5e6ae5d
to
1876d57
Compare
Developers can unintentionally install and build with Node or `pnpm` versions we don't officially support. Currently our CI runs with Node v18 and v20, and we're using `pnpm` v8. This change adds an `engines` field to the top level `package.json` file. This will output a warning on install/build if the engine version doesn't match the specified range. The `pnpm` version is already specified in `packageManager` to reflect the version we use in CI, although it is not enforced or warned if, for example, the developer is on v9. This change also updates the README to note supported Node engine versions and `pnpm` version used. We can consider for the future but choose not to pursue for now: - placing `engine-strict=true` in the top level `.npmrc` to hard-fail on incompatible engine versions - adding a preinstall/prebuild command that checks versions with more explicit failures, messaging, etc.
1876d57
to
f9ecd85
Compare
@@ -8,10 +8,15 @@ To learn more about how to use the AI SDK, check out our [API Reference](https:/ | |||
|
|||
## Installation | |||
|
|||
You will need Node.js 18+ and pnpm installed on your local development machine. |
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 README is for using the AI SDK and should not be changed. We have a separate contribution guide ( CONTRIBUTING.md in root ) that should contain this information.
|
||
```shell | ||
npm install ai |
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.
NPM is fine for using the AI SDK ( as is pnpm, bun, etc) - only NPM here for illustration purposes.
"engines": { | ||
"node": "^18.0.0 || ^20.0.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.
What effect does the engine spec have on the root level in the day-to-day usage for maintainers, i.e. when will the warning show up?
Developers can unintentionally install and build with Node or
pnpm
versions we don't officially support. Currently our CI runs with Node
v18 and v20, and we're using
pnpm
v8.This change adds an
engines
field to the top levelpackage.json
file. This will output a warning on install/build if the engine
version doesn't match the specified range.
The
pnpm
version is already specified inpackageManager
to reflectthe version we use in CI, although it is not enforced or warned if,
for example, the developer is on v9.
This change also updates the README to note supported Node engine
versions and
pnpm
version used.We can consider for the future but choose not to pursue for now:
engine-strict=true
in the top level.npmrc
tohard-fail on incompatible engine versions
more explicit failures, messaging, etc.