vtex / toolbelt

CLI for creating and managing VTEX apps
MIT License
59 stars 20 forks source link

Allow specific builder config to override the common config for pinned dependencies #1209

Closed mairatma closed 3 months ago

mairatma commented 9 months ago

What is the purpose of this pull request?

Change the logic that handles pinned dependencies to allow configs for specific builders to have higher precedence than the common configs.

This won't cause any problems, since the Typescript is currently the only common pinned dep and there are currently no builders trying to change its value either. You can see the current pinned dependencies config here.

What problem is this solving?

With the current logic it's impossible to allow other Typescript versions to be used in any builders. A new node builder major is being created (PR here) to upgrade TS and it needs this change to properly work.

How should this be manually tested?

First test the existing use cases:

  1. Load the repo of an existing Node.js app.
  2. Bump typescript to ^5.0.0 within the app's node/package.json.
  3. Link the app with this version of the toolbelt.
  4. Verify that the typescript version was fixed back to 3.9.7.

Afterwards, you can test with the new builder:

  1. Link the builder-hub version in this PR.
  2. Change the app's manifest.json to point to the new builder.
  3. Bump @types/node to ^16.0.0 within the app's node/package.json.
  4. Bump typescript to ^5.0.0 within the app's node/package.json.
  5. Link the app with this version of the toolbelt.
  6. Verify that the typescript version was not changed back to 3.9.7.

Screenshots or example usage

Types of changes

Chores checklist