[Dev] Another fix for version management

This commit is contained in:
Alexander Zinchuk 2022-09-21 00:14:48 +02:00
parent 2ad7bd03a2
commit 312cb02ce6

View File

@ -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",