(absWorkingDir: string, pkg: PackageJson)
| 171 | } |
| 172 | |
| 173 | export function runBuildScript(absWorkingDir: string, pkg: PackageJson): Plugin { |
| 174 | return { |
| 175 | name: `build-${pkg.name || 'unknown'}`, |
| 176 | setup(build) { |
| 177 | build.onEnd(async () => { |
| 178 | const child = cp.spawn('pnpm', |
| 179 | ['run', 'build'], |
| 180 | { cwd: absWorkingDir, stdio: 'inherit' } |
| 181 | ) |
| 182 | child.on('exit', (code) => { |
| 183 | if (code !== 0) { |
| 184 | console.log(`${l.name(pkg.name)} ❌ Failed run build script for ${pkg.name}`) |
| 185 | return |
| 186 | } |
| 187 | console.log(`${l.name(pkg.name)} ✅ Successfully ran build script for ${pkg.name}: "${pkg.scripts?.build}"`) |
| 188 | }) |
| 189 | }) |
| 190 | } |
| 191 | } |
| 192 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…