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

Post version script #90

Closed
mauroerta opened this issue Oct 30, 2021 · 0 comments · Fixed by #91
Closed

Post version script #90

mauroerta opened this issue Oct 30, 2021 · 0 comments · Fixed by #91
Assignees
Labels
enhancement New feature or request

Comments

@mauroerta
Copy link
Collaborator

The problem

Some Morfeo's packages assumes that you already have have other packages installed, for example @morfeo/styled-components-web assume that you already have @morfeo/react in your dependencies; This behaviour it's simply implement by putting (in the previous example) @morfeo/react as peerDependency of @morfeo/styled-components-web.

Unfortunately, lerna does not handle peerDependencies pretty good, in fact for every package that has another Morfeo package as peerDependency we have to:

  • During development: Always add the dependency not only in peer but also inside the devDependencies
  • During versioning: Manually update peerDependencies according to the new version.

This issue is caused by the process of sym-linking of lerna that doesn't care about peerDependencies.

Solution

My idea it's to create a simple script to run post-versioning where we syncronized the new version of the morfeo's packages in all the peerDependecies.
To do this we can simply read what the new version is from the lerna.json file and wherever we find Morfeo's peerDependency inside any package.json, we put this new version: ^${versionReadFromLernaJson}.

Additional

All the custom scripts we currently have are written in .mjs files, it could be good to convert them in Typescript and use ts-node to run them, I think it could be good to integrate this activity in this task.

@mauroerta mauroerta added the enhancement New feature or request label Oct 30, 2021
@mauroerta mauroerta self-assigned this Oct 30, 2021
mauroerta added a commit that referenced this issue Oct 30, 2021
Post-Versioning script and all scripts converted in Typescript

closes #90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant