Giter Club home page Giter Club logo

Comments (6)

Bielik20 avatar Bielik20 commented on May 27, 2024 4

I want to bump that issue. postTargets are nice, but sometimes you want to retrieve version without creating a new release. I feel like this should be possible. The implementation details are open for discussion, but I feel like programmatic solution would be great start (since I assume it already exists internally). Something like:

import { getProjectVersion } from '@jscutlery/semver'

async function foo() {
  console.log(await getProjectVersion('my-project-name'));
}

would solve many problems for people who need something more "custom".

from semver.

edbzn avatar edbzn commented on May 27, 2024

Hi @harwee, actually there is no way to achieve this and we're not planning to add this feature right now as we're focusing on something else, but if this is needed by some other people we can plan it. I leave it open for now.

from semver.

yjaaidi avatar yjaaidi commented on May 27, 2024

Sounds like this can be solved using postTargets option that we are planning to add here #167

from semver.

Chowarmaan avatar Chowarmaan commented on May 27, 2024

I want to bump that issue. postTargets are nice, but sometimes you want to retrieve version without creating a new release. I feel like this should be possible. The implementation details are open for discussion, but I feel like programmatic solution would be great start (since I assume it already exists internally). Something like:

import { getProjectVersion } from '@jscutlery/semver'

async function foo() {
  console.log(await getProjectVersion('my-project-name'));
}

would solve many problems for people who need something more "custom".

This would be very useful, as I want to write information into a source file to include in the release. I want the tag version that would be used, to be added to a version.ts file per project/library, so I can export that in my code and then use it in UIs and other places.

from semver.

nicolomanni avatar nicolomanni commented on May 27, 2024

Hi, are there any news about this argument?
For now, I've prepared a little script that uses git-describe to write a json file into each application that needs to access the tag version.

const { gitDescribeSync } = require('git-describe')
const { writeFileSync } = require('fs')

const APPS_FOLDER = './apps/'
const APPS_VERSION = ['main-app', 'secondary-app']

function recordVersions() {
  APPS_VERSION.forEach((app) => {
    const appFolder = APPS_FOLDER + app
    recordVersion(appFolder, app)
  })
}

function recordVersion(appFolder, appName) {
  const gitInfo = gitDescribeSync({ match: `${appName}*` })
  const versionInfoJson = JSON.stringify(gitInfo, null, 2)

  writeFileSync(appFolder + '/git-version.json', versionInfoJson)
}

recordVersions()

There are several problems about this workaround:

  • the script must be called by hand each time an application has been released
  • the git-version.json files must be committed before pushing the updates

Is there a way to resolve these problems?

Thank you

from semver.

kodeine avatar kodeine commented on May 27, 2024

Is there any updates on this, i would like to access the version so i can use that in other executors.

from semver.

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.