1
0
Fork 0

fix(build): replace app with package in version data

This commit is contained in:
ssube 2019-09-30 08:10:57 -05:00
parent c528e523a2
commit c76781b113
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
4 changed files with 8 additions and 9 deletions

View File

@ -51,13 +51,13 @@ const bundle = {
replace({ replace({
delimiters: ['{{ ', ' }}'], delimiters: ['{{ ', ' }}'],
values: { values: {
APP_NAME: metadata.name,
APP_VERSION: metadata.version,
BUILD_JOB: process.env['CI_JOB_ID'], BUILD_JOB: process.env['CI_JOB_ID'],
BUILD_RUNNER: process.env['CI_RUNNER_DESCRIPTION'], BUILD_RUNNER: process.env['CI_RUNNER_DESCRIPTION'],
GIT_BRANCH: process.env['CI_COMMIT_REF_SLUG'], GIT_BRANCH: process.env['CI_COMMIT_REF_SLUG'],
GIT_COMMIT: process.env['CI_COMMIT_SHA'], GIT_COMMIT: process.env['CI_COMMIT_SHA'],
NODE_VERSION: process.env['NODE_VERSION'], NODE_VERSION: process.env['NODE_VERSION'],
PACKAGE_NAME: metadata.name,
PACKAGE_VERSION: metadata.version,
}, },
}), }),
resolve({ resolve({

View File

@ -104,7 +104,6 @@
"no-submodule-imports": false, "no-submodule-imports": false,
"no-unbound-method": true, "no-unbound-method": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true, "no-var-keyword": true,
"no-void-expression": true, "no-void-expression": true,
"prefer-conditional-expression": false, "prefer-conditional-expression": false,

View File

@ -85,7 +85,7 @@ export function parseArgs(argv: Array<string>): ParseResults {
}, },
}) })
.option(CONFIG_ARGS_NAME, { .option(CONFIG_ARGS_NAME, {
default: `.${VERSION_INFO.app.name}.yml`, default: `.${VERSION_INFO.package.name}.yml`,
group: 'Config:', group: 'Config:',
type: 'string', type: 'string',
}) })
@ -131,7 +131,7 @@ export function parseArgs(argv: Array<string>): ParseResults {
alias: ['t', 'tag'], alias: ['t', 'tag'],
}) })
.help() .help()
.version(VERSION_INFO.app.version) .version(VERSION_INFO.package.version)
.alias('version', 'v'); .alias('version', 'v');
// @TODO: this should not need a cast but argv's type only has the last option (include-tag) // @TODO: this should not need a cast but argv's type only has the last option (include-tag)

View File

@ -1,8 +1,4 @@
export const VERSION_INFO = { export const VERSION_INFO = {
app: {
name: '{{ APP_NAME }}',
version: '{{ APP_VERSION }}',
},
build: { build: {
job: '{{ BUILD_JOB }}', job: '{{ BUILD_JOB }}',
node: '{{ NODE_VERSION }}', node: '{{ NODE_VERSION }}',
@ -12,4 +8,8 @@ export const VERSION_INFO = {
branch: '{{ GIT_BRANCH }}', branch: '{{ GIT_BRANCH }}',
commit: '{{ GIT_COMMIT }}', commit: '{{ GIT_COMMIT }}',
}, },
package: {
name: '{{ PACKAGE_NAME }}',
version: '{{ PACKAGE_VERSION }}',
},
}; };