Comments (6)
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.
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.
Sounds like this can be solved using postTargets
option that we are planning to add here #167
from semver.
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.
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.
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)
- Gitlab CI/CD - `src refspec main does not match any` HOT 4
- [Help] Unable to execute `nx run workspace:version` with Nx v14.8.8 HOT 3
- create CHANGELOG.md on install so that nx version does not fail because no CHANGELOG.md is present
- `--trackDeps` doesn't account for NPM package version changes
- Question: How does semver fit with the following workflow? HOT 2
- Squash merging breaks versioning without warning or documentation HOT 5
- Is there any working example? HOT 2
- Gitflow and semver
- Upcoming release date HOT 1
- Git hook fails with new prettier HOT 1
- Question: how can I trigger changes/release to app when updating dependency using `*`
- projectName is interpolated by NX now HOT 2
- Drop Angular CLI compatibility HOT 1
- targetDependencies is removed in Nx 16+ HOT 2
- Question: How to proceed if NPM publish fails HOT 1
- Custom headerPattern doesn't get picked up by changelog conventional-commit-parser HOT 1
- Preset Schema doesn't match the DOCs HOT 2
- Support pnpm in install generator (husky) HOT 2
- Drop old `${var}` interpolation syntax
- Bug: Changelog template not included in npm package HOT 2
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 semver.