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

Improve Migration Command by Managing Version with Reference to package.json and Update connect-query Version #837

Merged
merged 5 commits into from
Oct 2, 2023

Conversation

mkusaka
Copy link
Contributor

@mkusaka mkusaka commented Sep 25, 2023

In this PR, I've made the following updates:

  • The versions, which were originally managed inline within the code, have been modified to refer to the version specified in package.json for @connectrpc/connectrelated packages.
  • I've also updated the @connectrpc/connect-query to the latest version.

Previously, running npx @connectrpc/connect-migrate@latest would migrate @bufbuild/connect to "@connectrpc/connect: "^1.0.0-rc1". However, the latest versions of @connectrpc/connect-related packages are '1.0.0', and this version is equivalent to the one in package.json. Therefore, in this PR, the inline versions have been changed to refer to the version in package.json.

This alteration also induces a structural change specifically in the output directory (dist). For further details on this transformation, please refer to the displayed ‘before’ and ‘after’ tree command outputs below.

before
❯ tree dist
dist
└── cjs
    ├── arguments.js
    ├── cli.js
    ├── lib
    │   ├── logger.js
    │   ├── migrate-lock-files.js
    │   ├── migrate-packages.js
    │   ├── migrate-source-files.js
    │   ├── package-json.js
    │   ├── package-json.spec.js
    │   ├── replace-dependencies.js
    │   ├── replace-dependencies.spec.js
    │   ├── run.js
    │   ├── scan.js
    │   └── update-source-file.js
    ├── migration.js
    └── migrations
        ├── v0.13.1-transform.js
        ├── v0.13.1-transform.spec.js
        ├── v0.13.1.js
        └── v0.13.1.spec.js

3 directories, 18 files
after
❯ tree dist
dist
└── cjs
    ├── package.json
    └── src
        ├── arguments.js
        ├── cli.js
        ├── lib
        │   ├── logger.js
        │   ├── migrate-lock-files.js
        │   ├── migrate-packages.js
        │   ├── migrate-source-files.js
        │   ├── package-json.js
        │   ├── package-json.spec.js
        │   ├── replace-dependencies.js
        │   ├── replace-dependencies.spec.js
        │   ├── run.js
        │   ├── scan.js
        │   └── update-source-file.js
        ├── migration.js
        └── migrations
            ├── v0.13.1-transform.js
            ├── v0.13.1-transform.spec.js
            ├── v0.13.1.js
            └── v0.13.1.spec.js

4 directories, 19 files

Moreover, migration command updates @bufbuild/connect-query to @connectrpc/connect-query: "0.4.3", but its latest version is actually 0.5.1.

@CLAassistant
Copy link

CLAassistant commented Sep 25, 2023

CLA assistant check
All committers have signed the CLA.

@srikrsna-buf
Copy link
Member

Hey! Thank you for the PR! Thank you for updating the versions to the latest.

Regarding reading the version from package.json, the idea is to update to the latest version of the next non-breaking change or rather handle the migration in steps based on breaking changes (like 0.13.1). I think it will be better if we just have the version in the file rather than read it from package.json. Can you update the PR accordingly?

@mkusaka
Copy link
Contributor Author

mkusaka commented Sep 30, 2023

@srikrsna-buf Thank you for the review! I understood the need for changes and have made the necessary adjustments :)

@srikrsna-buf srikrsna-buf merged commit d07926a into connectrpc:main Oct 2, 2023
3 of 4 checks passed
@mkusaka mkusaka deleted the patch branch October 3, 2023 04:03
@srikrsna-buf srikrsna-buf mentioned this pull request Oct 4, 2023
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

3 participants