Comments (7)
i typically use prepack
to do tasks like building a bundle before publishing. i've also successfully used prepublishOnly
, but prefer prepack
because it runs when packing locally too. would those scripts accomplish what you're looking for?
from npm.
What @travi described is the recommended approach.
For info, that's also mentioned in our FAQ: https://github.com/semantic-release/semantic-release/blob/caribou/docs/support/FAQ.md#how-can-i-use-a-npm-build-script-that-requires-the-packagejsons-version-
Please let us know if that answer your question, and close the issue if it does.
from npm.
Thanks for your quick replies!
The root confusion to me is that some npm scripts during the release process appear to run, and some don't, which seems inconsistent.
-
preversion
/version
/postversion
would happen in theprepare
step, if it was supported. -
prepublishOnly
/prepack
happen in thepublish
step.
As far as I can tell, since @semantic-release/git
makes a release commit during the prepare
step, there isn't an easy way of including file changes from the versioning step of the release process in the release commit.
from npm.
The root confusion to me is that some npm scripts during the release process appear to run, and some don't, which seems inconsistent.
Well yes, the only npm command ran by @semantic-release/npm
is npm publish
. I guess we could use npm version
to update the package.json
. I can't remember why we made the choice of using custom code there. I'll look into it and see if we can switch to npm version
.
As far as I can tell, since @semantic-release/git makes a release commit during the prepare step, there isn't an easy way of including file changes from the versioning step of the release process in the release commit.
I'm not sure I'm following...You can run @semantic-release/npm
then @semantic-release/git
so the updated package.json
will be included in the commit. That's explained in this example.
from npm.
I can't remember why we made the choice of using custom code there.
I'm guessing npm version
isn't used because it does too much: it also makes a git tag and a commit, but I believe it can be disabled via npm --no-git-tag-version <version>
.
from npm.
🎉 This issue has been resolved in version 5.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from npm.
I'm not sure I'm following...
Yeah, sorry, that was written hastily.
I am running @semantic-release/npm
before @semantic-release/git
. package.json
is being included in the commit. I was trying to explain that I can't use prepublishOnly
/prepack
because those run in the publish
step, and the release commit is made in the prepare
step. I have additional file changes needed during the prepare
step before the release commit is made, but the only way to accomplish that was to use @semantic-release/exec
.
I will try 5.1.0 😄
from npm.
Related Issues (20)
- HIGH SEVERITY security problem CVE-2021-3795 (semver-regex and find-versions) HOT 3
- You cannot publish over the previously published versions
- Provide a better error message in case of an E400 bad request without further explanation from npm
- semantic-release/npm forced npm version in scripts HOT 2
- Why is `npm version` used to set the version? HOT 1
- Add support for npm v9 HOT 7
- `prepack` run twice when set `tarballDir` HOT 1
- npm publish looks for package.json at disk root HOT 3
- Incompatible with Yarn (Berry) HOT 1
- a `Cannot read properties of null (reading 'matches'` error when using multi-semantic-release HOT 8
- Use clean-publish
- fix vulnerability with http-cache-semantics <4.1.0 HOT 4
- Why support of legacy auth was dropped? HOT 2
- pkgRoot property not working HOT 1
- Provenance support not working? HOT 1
- npm whoami failing HOT 3
- `package.json` version not updated, despite correct plugin ordering HOT 1
- Set --no-workspaces with npm version HOT 2
- Command failed with exit code 1: npm version 0.22.2 --userconfig HOT 2
- error on publishing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm.