Giter Site home page Giter Site logo

Comments (7)

travi avatar travi commented on July 19, 2024 1

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.

pvdlg avatar pvdlg commented on July 19, 2024

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.

imhoffd avatar imhoffd commented on July 19, 2024

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 the prepare step, if it was supported.
  • prepublishOnly/prepack happen in the publish 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.

pvdlg avatar pvdlg commented on July 19, 2024

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.

imhoffd avatar imhoffd commented on July 19, 2024

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.

semantic-release-bot avatar semantic-release-bot commented on July 19, 2024

🎉 This issue has been resolved in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from npm.

imhoffd avatar imhoffd commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.