workflow: include commit link in template explorer

This commit is contained in:
Evan You
2019-10-04 22:40:54 -04:00
parent ea4a352ee6
commit a0f442f1d4
6 changed files with 38 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ const formats = args.formats || args.f
const devOnly = args.devOnly || args.d
const prodOnly = !devOnly && (args.prodOnly || args.p)
const buildAllMatching = args.all || args.a
const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
;(async () => {
if (!targets.length) {
await buildAll(allTargets)
@@ -60,11 +61,16 @@ async function build(target) {
[
'-c',
'--environment',
`NODE_ENV:${env},` +
`TARGET:${target}` +
(formats ? `,FORMATS:${formats}` : ``) +
(args.types ? `,TYPES:true` : ``) +
(prodOnly ? `,PROD_ONLY:true` : ``)
[
`COMMIT:${commit}`,
`NODE_ENV:${env}`,
`TARGET:${target}`,
formats ? `FORMATS:${formats}` : ``,
args.types ? `TYPES:true` : ``,
prodOnly ? `PROD_ONLY:true` : ``
]
.filter(_ => _)
.join(',')
],
{ stdio: 'inherit' }
)

View File

@@ -22,10 +22,19 @@ const { targets, fuzzyMatchTarget } = require('./utils')
const args = require('minimist')(process.argv.slice(2))
const target = args._.length ? fuzzyMatchTarget(args._)[0] : 'vue'
const formats = args.formats || args.f
const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
execa(
'rollup',
['-wc', '--environment', `TARGET:${target},FORMATS:${formats || 'global'}`],
[
'-wc',
'--environment',
[
`COMMIT:${commit}`,
`TARGET:${target}`,
`FORMATS:${formats || 'global'}`
].join(',')
],
{
stdio: 'inherit'
}