Comparing version 0.1.14 to 0.1.15
{ | ||
"name": "hjsx", | ||
"version": "0.1.14", | ||
"version": "0.1.15", | ||
"module": "hjsx.ts", | ||
@@ -5,0 +5,0 @@ "main": "hjsx.js", |
@@ -47,5 +47,4 @@ import { colors } from "./util"; | ||
async function main() { | ||
await build(); | ||
const [oldVersion, newVersion] = await updatePkgVersion(); | ||
const testsPassed = await runTests(); | ||
const promiseResults = await Promise.all([build(), updatePkgVersion(), runTests()]); | ||
const [buildSuccessful, [oldVersion, newVersion], testsPassed] = promiseResults; | ||
const readmeUpdated = await updateReadmeTestsBadge(testsPassed); | ||
@@ -69,9 +68,10 @@ const changedFiles = await getChangedFiles(); | ||
async function build() { | ||
async function build(): Promise<boolean> { | ||
console.log("building..."); | ||
const { exited } = Bun.spawn(["bun", "run", "build"]); | ||
const { exited } = Bun.spawn(["bun", "run", "build"], quietSpawnOptions); | ||
const exitCode = await exited; | ||
if (exitCode !== 0) { | ||
throw new Error("build failed"); | ||
} | ||
const success = exitCode === 0; | ||
const message = success ? colors.green("build successful!") : colors.red("build failed!"); | ||
console.log(message); | ||
return success; | ||
} | ||
@@ -140,2 +140,9 @@ | ||
await writer.end(); | ||
if (version === newVersion) { | ||
console.log("package version is already up to date"); | ||
return [version, newVersion]; | ||
} | ||
console.log( | ||
`${colors.green("updated version")} ${colors.gray(version)} → ${colors.gray(newVersion)}`, | ||
); | ||
return [version, newVersion]; | ||
@@ -142,0 +149,0 @@ } |
96662
1993