Skip to content

Commit

Permalink
fix: mv yarn install to build.js
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jun 25, 2022
1 parent 9d465d1 commit 3d49325
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/main/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ini from 'ini'
import {traverseDeps} from './deps.js'
import {parseEnv} from './publish.js'

export const build = (pkg, packages) => ctx(async ($) => {
export const build = (pkg, packages, root) => ctx(async ($) => {
if (pkg.built) return true

await traverseDeps(pkg, packages, async (_, {pkg}) => build(pkg, packages))
Expand All @@ -22,6 +22,9 @@ export const build = (pkg, packages) => ctx(async ($) => {
console.log(`tested '${pkg.name}'`)
}
}

$.cwd = root
await $`yarn`
}

pkg.built = true
Expand Down
9 changes: 3 additions & 6 deletions src/main/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {getSemanticChanges, resolvePkgVersion} from './analyze.js'
import {publish, getLatest} from './publish.js'
import {build} from './build.js'

export const run = ({cwd = process.cwd(), env = process.env, flags = {}} = {}) => ctx(async ($) => {
export const run = async ({cwd = process.cwd(), env = process.env, flags = {}} = {}) => {
const {packages, queue, root} = await topo({cwd})
const dryRun = flags['dry-run'] || flags.dryRun

Expand All @@ -24,14 +24,11 @@ export const run = ({cwd = process.cwd(), env = process.env, flags = {}} = {}) =
if (changes.length === 0) continue
console.log(`semantic changes of '${name}'`, changes)

pkg.build = await build(pkg, packages)

$.cwd = cwd
await $`yarn`
pkg.build = await build(pkg, packages, cwd)

if (dryRun) continue

await fs.writeJson(pkg.manifestPath, pkg.manifest, {spaces: 2})
await publish(pkg, env)
}
})
}

0 comments on commit 3d49325

Please sign in to comment.