Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'd prefer committing it to the repo, so it can be upgraded only when I run
npm run convert-esm
.just pushed a commit to do it: 65f6b45, can you cherry pick it to your branch?
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 don't like the idea of including generated code in a git repo, but sort of I understand the reasons, but what about the removal of the
prepare
script? This way we are sure it's being used the same version that's defined inpackage.json
and not an old one because we forgot to generate it by hand... What do you think?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.
If we remove the
prepare
, a maintainer may forget to run theconvert-esm
before publishing, so pushing a broken package to npm.I think the safest way is to commit it in git, but provide a straightforward way to upgrade it, like:
npm i import-meta-resolve@latest -D npm run convert-esm git add ./convert-esm git commit -m "chore: upgrade import-meta-resolve"
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.
another point: it allows users to test an unpublished version from github:
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.
That doesn't makes sense. It could if we would have any modificación, but we are just transpiling It, so it's a verbatin copy and almost the same as if we would be using It from node_modules, so let's stick with the same workflow. Prepare script is run both when publising to npm registro, and when installing from git repositorio, so it's the same you are proposing. If you want to have a cozy on the git repo, it's superfluos and I disagree but that's fine in that case we should add a git hook to be sure it's being included the latests versión but that's cumbersome. What's mandatory is to generate It in the prepare script to be sure ALWAYS is being used the same versión defined on package.json, and prevent somebody forget to update It.
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.
We can pin it in the
package.json
file, there's no need to do anything else, everything can be safely automated.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.
it also makes sense! 👍
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.
ok, next steps to get this merged and published?
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.
will do it later. :)
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.
thank you :-)