From c76781b113e323d7773930d03c0252698b68fd68 Mon Sep 17 00:00:00 2001 From: ssube Date: Mon, 30 Sep 2019 08:10:57 -0500 Subject: [PATCH] fix(build): replace app with package in version data --- config/rollup.js | 4 ++-- config/tslint.cc.json | 1 - src/config/args.ts | 4 ++-- src/version.ts | 8 ++++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/config/rollup.js b/config/rollup.js index bebe0a7..b45c6b5 100644 --- a/config/rollup.js +++ b/config/rollup.js @@ -51,13 +51,13 @@ const bundle = { replace({ delimiters: ['{{ ', ' }}'], values: { - APP_NAME: metadata.name, - APP_VERSION: metadata.version, BUILD_JOB: process.env['CI_JOB_ID'], BUILD_RUNNER: process.env['CI_RUNNER_DESCRIPTION'], GIT_BRANCH: process.env['CI_COMMIT_REF_SLUG'], GIT_COMMIT: process.env['CI_COMMIT_SHA'], NODE_VERSION: process.env['NODE_VERSION'], + PACKAGE_NAME: metadata.name, + PACKAGE_VERSION: metadata.version, }, }), resolve({ diff --git a/config/tslint.cc.json b/config/tslint.cc.json index cc00c50..81b32b6 100755 --- a/config/tslint.cc.json +++ b/config/tslint.cc.json @@ -104,7 +104,6 @@ "no-submodule-imports": false, "no-unbound-method": true, "no-unused-expression": true, - "no-use-before-declare": true, "no-var-keyword": true, "no-void-expression": true, "prefer-conditional-expression": false, diff --git a/src/config/args.ts b/src/config/args.ts index ed935cd..be9ef45 100644 --- a/src/config/args.ts +++ b/src/config/args.ts @@ -85,7 +85,7 @@ export function parseArgs(argv: Array): ParseResults { }, }) .option(CONFIG_ARGS_NAME, { - default: `.${VERSION_INFO.app.name}.yml`, + default: `.${VERSION_INFO.package.name}.yml`, group: 'Config:', type: 'string', }) @@ -131,7 +131,7 @@ export function parseArgs(argv: Array): ParseResults { alias: ['t', 'tag'], }) .help() - .version(VERSION_INFO.app.version) + .version(VERSION_INFO.package.version) .alias('version', 'v'); // @TODO: this should not need a cast but argv's type only has the last option (include-tag) diff --git a/src/version.ts b/src/version.ts index 6c949a3..03518c3 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,8 +1,4 @@ export const VERSION_INFO = { - app: { - name: '{{ APP_NAME }}', - version: '{{ APP_VERSION }}', - }, build: { job: '{{ BUILD_JOB }}', node: '{{ NODE_VERSION }}', @@ -12,4 +8,8 @@ export const VERSION_INFO = { branch: '{{ GIT_BRANCH }}', commit: '{{ GIT_COMMIT }}', }, + package: { + name: '{{ PACKAGE_NAME }}', + version: '{{ PACKAGE_VERSION }}', + }, };