-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add version checks for the CLI #789
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexis Rico <[email protected]>
🦋 Changeset detectedLatest commit: 355c9c3 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR 💥 An error occurred when fetching the changed packages and changesets in this PR
|
size-limit report 📦
|
Your pull request has been published to npm. You can install it by running:
To test the CLI, run:
|
Signed-off-by: Alexis Rico <[email protected]>
|
||
if (!semver.satisfies(installedVersion, `^${sdkVersion}`)) { | ||
return this.error( | ||
`The installed version of @xata.io/client (${installedVersion}) does not satisfy the required version (${sdkVersion}). Please update your package.json.` |
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 installed version of @xata.io/client (${installedVersion}) does not satisfy the required version (${sdkVersion}). Please update your package.json.` | |
`The installed version of the SDK (${installedVersion}) does not satisfy the CLI version (${sdkVersion}). Please update the packages to run the codegen.` |
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 would like to:
- If SDK is outdated, offer to update it with a question
- If CLI is outdated, show command to update (or when we have auto update, offer to update it with a question)
Also:
- Add
--force
to ignore the errors and continue if user knows what they're doing
Make sure the CLI and codegen use the same version or a semver compatible one.
Criteria: