From 312cb02ce69bf4cd4c4d1ca10d6f8bf5b357c4d4 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 21 Sep 2022 00:14:48 +0200 Subject: [PATCH] [Dev] Another fix for version management --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 57f854f2..74028f81 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "description": "", "main": "index.js", "scripts": { - "dev": "cross-env APP_ENV=development APP_VERSION=$(npm run inc_version --silent) webpack serve --mode development", + "version:print": "echo \"$(node -p -e \"require('./package.json').version.match(/^\\d+\\.\\d+/)[0]\").$(cat .patch-version || echo 0)\"", + "version:update": "npm run version:print --silent > ./public/version.txt", + "version:inc": "echo $((`cat .patch-version || echo -1` + 1)) > .patch-version && npm run version:update && npm run version:print", + "dev": "cross-env APP_ENV=development APP_VERSION=$(npm run version:print --silent) webpack serve --mode development", "dev:mocked": "cross-env APP_ENV=test APP_MOCKED_CLIENT=1 webpack serve --mode development --port 1235", "build:mocked": "cross-env APP_ENV=test APP_MOCKED_CLIENT=1 webpack --mode development", - "build:staging": "APP_ENV=staging APP_VERSION=$(npm run inc_version --silent) webpack --mode development && ./deploy/copy_to_dist.sh", - "build:production": "npm i && APP_VERSION=$(npm run inc_version --silent) webpack && ./deploy/copy_to_dist.sh", + "build:staging": "APP_ENV=staging APP_VERSION=$(npm run version:inc --silent) webpack --mode development && ./deploy/copy_to_dist.sh", + "build:production": "npm i && APP_VERSION=$(npm run version:inc --silent) webpack && ./deploy/copy_to_dist.sh", "deploy:production": "npm run build:production && git add -A && git commit -a -m '[Build]' --no-verify && git push", - "update_version": "npm run print_version --silent > ./public/version.txt", - "print_version": "echo \"$(node -p -e \"require('./package.json').version.match(/^\\d+\\.\\d+/)[0]\").$(cat .patch-version || echo 0)\"", - "inc_version": "echo $((`cat .patch-version || echo -1` + 1)) > .patch-version && npm run update_version --silent && npm run print_version", "telegraph:update_changelog": "node ./dev/telegraphChangelog.js", "check": "tsc && stylelint \"**/*.{css,scss}\" && eslint . --ext .ts,.tsx,.js --ignore-pattern src/lib/gramjs", "check:fix": "npm run check -- --fix",