UNPKG

@onereach/get-version-data

Version:
92 lines (67 loc) 2.13 kB
# @onereach/get-version-data CLI tool to get version data for deploy ## How to use For more details on how to use the install and use the tool run: ```sh npx @onereach/get-version-data --help ``` To get the version info: ```sh npx @onereach/get-version-data --version ``` Which will return JSON with service version data like this ```json { "service": "@onereach/flow-builder", "version": "2.31.6", "feature": "master", "tools": { "deploy-platform": { "version": "2.0.177" } }, "deploymentTime": "2022-06-15T14:59:32.798Z", "git": { "branch": "master", "bundleTags": [], "commitHash": "8531cf8aef3180c48fb7d0779a3dc231d4af95f8", "isDirty": false }, "packages": { "@onereach/auth-ui-module": "1.5.0", "@onereach/ckeditor5-build-full": "1.1.10", "@onereach/external-steps-sdk": "0.2.2", "@onereach/or-i18n": "0.0.3", "@onereach/sdk": "2.0.276", "@onereach/service-navigation": "1.1.3", "@onereach/time-interpreter": "1.0.18", "@onereach/ui": "2.0.218", "@onereach/ui-config": "1.0.8", "@onereach/ws-client": "1.1.8" } } ``` You can use it inside shell scripts like this for example: ```sh #!/usr/bin/env bash set -eo pipefail # exit on error #... # example of getting version info into env variable VERSION_DATA=$(npx @onereach/get-version-data --dir "$PROJECT_DIR" --no-prettify) echo $VERSION_DATA # example of creating a file with version info npx @onereach/get-version-data --dir "$PROJECT_DIR" --output "$PROJECT_DIR/src/version.json" #... ``` ## How to contribute? When you start working on something that should be added into changelog run: ```sh pnpm changeset add ``` Choose what type of change is it: `patch`, `minor` or `major` and add summary (will end up being actual line in the changelog) ## How to publish package? Everything is automated, all you need is run: ```sh pnpm release ``` Version of the package will be set based on changeset files. Then package will be published and tags will be pushed to git