Allow post install script#31
Conversation
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| directory: '/' |
5a4b755 to
def30cd
Compare
vividviolet
left a comment
There was a problem hiding this comment.
👍 This is a good addition to snapit
|
@robin-drexler why not just include it in your package as a Seems like it's just adding an extra place for functions to run that is unnecessary. |
We don't want to run this every time after dependencies are installed. Only when running in the snapit gh action because you can't create a snapshot version if you're in pre mode so we're temporarily disabling it in the snapit action. |
alex-page
left a comment
There was a problem hiding this comment.
I want to be careful about adding multiple lifecycle hooks and focus on keeping snapit extremely simple. This makes sense though, thanks @robin-drexler
Snapit does a checkout of the code instead of running in the existing action context, which makes it hard to make changes to files before snapit runs.
build_scriptexists, but it runs after snapit has already ranchangeset versionwhich might be too late in certain cases.This PR introduces a
post_install_scriptoptional input param that allows to pass a script that runs right after dependencies have been installed.In our specific instance we want to run
changeset pre exitto allow snaphots for a package that is currently in pre mode.More on this: https://changesets-docs.vercel.app/en/prereleases
You can't version snapshot packages when pre mode is on.
We do have pre mode on for the next RC in https://github.com/Shopify/ui-extensions/ because it allows us to release versions like
2025-10.rc-1and add~2025-10.rc-0to extension templates as a workaround to not being able to put a tag there in npm: npm/cli#8252We might want to have snapit do
changeset pre exitby itself at some point, but I think it's too early to add this.We're still in the process of figuring out how pre mode works exactly and I think having a more generic post install hook is a sensible addition regardless of our current use case.
🎩
Tested successfully in the ui-extensions repo:
Shopify/ui-extensions#2901 (comment)
https://github.com/Shopify/ui-extensions/actions/runs/15144950812