Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix minor issues in build scripts #7458

Merged
merged 3 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')
const consola = require('consola')
const execa = require('execa')
const fs = require('fs-extra')
const glob = require('pify')(require('glob').glob)
const glob = require('pify')(require('glob'))

async function main () {
const packageDirs = await glob('+(packages|distributions)/*')
Expand Down
2 changes: 1 addition & 1 deletion scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function main () {
// Step 1: Apply suffixes
for (const pkg of workspacePackages) {
if (pkg.options.suffix && pkg.options.suffix.length) {
await pkg.suffixAndVersion()
pkg.suffixAndVersion()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an async method.

await pkg.writePackage()
}
}
Expand Down
9 changes: 2 additions & 7 deletions scripts/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import spawn from 'cross-spawn'
import { existsSync, readJSONSync, writeFile, copy, remove } from 'fs-extra'
import _ from 'lodash'
import { rollup, watch } from 'rollup'
import { glob as _glob } from 'glob'
import _glob from 'glob'
import pify from 'pify'
import sortPackageJson from 'sort-package-json'

Expand Down Expand Up @@ -239,11 +239,6 @@ export default class Package {
this.formatError(event.error)
return this.logger.error(event.error)

// Encountered an unrecoverable error
case 'FATAL':
this.formatError(event.error)
return this.logger.fatal(event.error)

Comment on lines -242 to -246
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no longer a FATAL event.

rollup/rollup#3336

// Unknown event
default:
return this.logger.info(JSON.stringify(event))
Expand Down Expand Up @@ -330,7 +325,7 @@ export default class Package {
}

exec (command, args, silent = false) {
const r = spawn.sync(command, args.split(' '), { cwd: this.options.rootDir }, { env: process.env })
const r = spawn.sync(command, args.split(' '), { cwd: this.options.rootDir, env: process.env })
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cross-spawn doesn't take a third parameter


if (!silent) {
const fullCommand = command + ' ' + args
Expand Down