-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(build): Rename pack
npm scripts to build:npm
#4715
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
Conversation
size-limit report
|
packages/ember/package.json
Outdated
"pack": "npm pack", | ||
"package": "run-s prepack && npm pack && run-s postpack", |
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.
Looking at this, it probably makes more sense to inline the pre/postpack
scripts under package
instead of having three scripts here... is there anything I'm missing that would break if I did this?
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.
Nope, don't think so. Good idea.
pack
npm scripts to package
pack
npm scripts to createTarball
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.
This looks good, and you explained it well!
One small suggestion (and yes, I know this is different than my off-the-cuff suggestion this morning - sorry! Reading it now I'm thinking about it more.): Without context, it might not be clear to all readers that "tarball" === "publishable npm package". Would you be good with yarn build:npm
?
Generally yes. It's clear, short and captures what the script is doing. My only concern is that building for me entails some sort of compilation/transpilation going on whereas what This might be just me though, so I'm happy to change it to EDIT: went with |
pack
npm scripts to createTarball
pack
npm scripts to build:npm
I hear what you're saying, but I think that's focusing too much on implementation details. For me, it all falls under the general heading of "putting stuff together so we can publish it." Looked at in that light, |
rename `pack` npm scripts in all `package.json`s to `package`. Previously, these `pack` scripts could cause confusion in connection with yarn, as `yarn pack` and `yarn run pack` would do different things: While running the former would trigger the pack command of yarn (as in `npm pack`), the latter would execute whatever is defined in the resp. `package.json` undder `pack`. Up to recently, this difference was not noticable in most SDKs because the `pack` npm script would simply be `npm pack`. However given that we're moving everything build-related into its own `build` directory, the pack script must point to the `package.json` inside `build`. As a consequence, `yarn run pack` and `yarn pack` will behave differently which can cause confusion when creating a tarball.
This PR renames the
pack
npm scripts in allpackage.json
s tobuild:npm
. Previously, thesepack
scripts could cause confusion in connection with yarn, asyarn pack
andyarn run pack
would do different things: While running the former would trigger the pack command of yarn (as innpm pack
), the latter would execute whatever is defined in the resp.package.json
underpack
.Up to recently, this difference was not noticeable in most SDKs because the
pack
npm script would simply benpm pack
. However, given that we're moving everything build-related into its ownbuild
directory (#4688, #4641), the pack script must point to thepackage.json
insidebuild
. As a consequence,yarn run pack
andyarn pack
will behave differently which can cause confusion when creating a tarball.With this PR,
yarn (run) build:npm
will create an NPM package (tarball). Besides modifying all SDKpackage.json
s, this PR also adjusts the packing script in the root-levelpackage.json
and hence in the the packaging command in thebuild.yml
file.It should be noted that the purpose of this PR is to avoid confusion when creating NPM packages, not to fix anything that would otherwise be "broken". CI also works currently with the
build
directory change as the artifact creation job does not callyarn pack
butyarn pack:changed
.The motivation for making this change emerged after a conversation about adjusting
yarn pack
toyarn run pack
to get a correct tarball.ref: https://getsentry.atlassian.net/browse/WEB-688