Coder Social home page Coder Social logo

Comments (3)

TheUnderScorer avatar TheUnderScorer commented on June 27, 2024

Hey @mklueh!

Usually, this can be achieved by creating package.json in your application directory. For example:

{
  "name": "my-app",
  "version": "1.0.0"
  "private" true
}

You will also need to set npm: true in your semantic-release configuration. Because the private is set to true, it won't be published to NPM, but during release the version in package.json will be bumped, and you will be able to access it in your app like this:

import { version } from './package.json';

console.log(version);

I hope that it helps!

from nx-semantic-release.

mklueh avatar mklueh commented on June 27, 2024

@TheUnderScorer thank you! I'll try that

from nx-semantic-release.

mklueh avatar mklueh commented on June 27, 2024

@TheUnderScorer I've finally managed to try it and failed to far. The only thing that is changed and pushed is the changelog, but not the versions.

My config is within the package.json and in all my package.jsons private is set to true and I've tried setting npm: true in the root package.json as well as the application one's with no effect. The version is set to 0.0.1 in the application only.

It seems the npm plugin is not running after the changelog plugin, despite having explicitly installed it

[8:09:59 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[8:09:59 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[8:09:59 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
[8:09:59 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"

Edit: my mistake

I've set the option in nxrelease config instead of the executor options

from nx-semantic-release.

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.