Skip to content

Commit

Permalink
log build / publish time used
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 11, 2024
1 parent 08e7fc4 commit 9e9e78f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ export async function buildVue({ verify = false, publish = false }) {
const runBuild = getCommand('pnpm', 'run', ['build', '--release'])
const runBuildDts = getCommand('pnpm', 'run', ['build-dts'])
const runTest = getCommand('pnpm', 'run', ['test'])

let s = performance.now()

// Prefix with `corepack` because pnpm 7 & 8's lockfile formats differ
await $`corepack ${install}`
await $`${runBuild}`
Expand All @@ -418,7 +421,13 @@ export async function buildVue({ verify = false, publish = false }) {
await $`${runTest}`
}

console.log()
console.log(`Built in ${(performance.now() - s).toFixed(0)}ms`)
console.log()

if (publish) {
s = performance.now()

// TODO: prompt for `pnpm clean` if the same version already exists
// TODO: it's better to update the release script in the core repo than hacking it here
for (const pkg of packages) {
Expand Down Expand Up @@ -453,6 +462,10 @@ export async function buildVue({ verify = false, publish = false }) {
)
await $`pnpm publish --access public --registry ${REGISTRY_ADDRESS} --no-git-checks`
}

console.log()
console.log(`Published in ${(performance.now() - s).toFixed(0)}ms`)
console.log()
}
}

Expand Down

0 comments on commit 9e9e78f

Please sign in to comment.