How to use the @s-ui/helpers/cli.serialSpawn function in @s-ui/helpers

To help you get started, we’ve selected a few @s-ui/helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SUI-Components / sui / packages / sui-studio / bin / sui-studio-build.js View on Github external
#!/usr/bin/env node
/* eslint no-console:0 */

const {serialSpawn} = require('@s-ui/helpers/cli')
const {join} = require('path')
const fs = require('fs-extra')

console.log('\n', process.env.NODE_ENV, '\n')
process.env.NODE_ENV = process.env.NODE_ENV || 'production'

const bundlerBuildPath = require.resolve('@s-ui/bundler/bin/sui-bundler-build')

serialSpawn([
  [
    bundlerBuildPath,
    ['-C', '--context', join(__dirname, '..', 'src')],
    {shell: false, env: process.env}
  ]
])
  .then(() => fs.copy('public/index.html', 'public/200.html'))
  .then(code => process.exit(code))
  .catch(code => process.exit(code))
github SUI-Components / sui / packages / sui-precommit / bin / sui-precommit-run.js View on Github external
#!/usr/bin/env node

const {serialSpawn} = require('@s-ui/helpers/cli')
const BIN_PATH = require.resolve('@s-ui/lint/bin/sui-lint')

serialSpawn([
  [BIN_PATH, ['js', '--staged']],
  [BIN_PATH, ['sass', '--staged']],
  ['npm', ['run', 'test']]
])
  .then(code => process.exit(code))
  .catch(error => {
    // eslint-disable-next-line no-console
    console.error(error)
    process.exit(1)
  })
github SUI-Components / sui / packages / sui-mono / bin / sui-mono-release.js View on Github external
let releaseCommands = [
      ['npm', ['--no-git-tag-version', 'version', `${RELEASE_CODES[code]}`]],
      ['git', ['add', path.join(cwd, 'package.json')]]
    ]
    let docCommands = [
      [suiMonoBinPath, ['changelog', cwd]],
      ['git', ['add', path.join(cwd, changelogFilename)]],
      ['git', ['commit --amend --no-verify --no-edit']]
    ]
    let publishCommands = [
      scripts['build'] && ['npm', ['run', 'build']],
      !pkgInfo.private && ['npm', ['publish', `--access=${publishAccess}`]],
      ['git', ['push', '--tags', 'origin', 'HEAD']]
    ].filter(Boolean)

    serialSpawn(releaseCommands, {cwd})
      .then(() => {
        // Create release commit
        const {version} = getPackageJson(cwd, true)
        return serialSpawn(
          [['git', [`commit -m "release(${packageScope}): v${version}"`]]],
          {cwd}
        )
      })
      .then(() => serialSpawn(docCommands))
      .then(() => {
        // Create release tag
        const {version} = getPackageJson(cwd)
        return serialSpawn(
          [['git', [`tag -a ${tagPrefix}${version} -m "v${version}"`]]],
          {cwd}
        )
github SUI-Components / sui / packages / sui-mono / bin / sui-mono-run.js View on Github external
program
  .on('--help', () => {
    console.log('  Description:')
    console.log('')
    console.log('    Runs the given command on all the packages')
    console.log('    Commands are run in series, preserving output stream')
    console.log('')
    console.log('  Examples:')
    console.log('')
    console.log('    $ sui-mono run npm i')
    console.log('    $ sui-mono run --help')
    console.log('')
  })
  .parse(process.argv)

serialSpawn(getAllTaskArrays())
  .then(code => process.exit(code))
  .catch(code => process.exit(code))
github SUI-Components / sui / packages / sui-mono / bin / sui-mono-phoenix.js View on Github external
scopes.length
            } packages installed`
          )
        }
      })
      .catch(err => {
        console.error(err)
      })
  })

  return queue
    .onIdle()
    .then(() => logUpdate(`${figures.tick} Installed all packages`))
}

serialSpawn(rootExecution)
  .then(executePhoenixOnPackages)
  .catch(showError)
github SUI-Components / sui / packages / sui-mono / bin / sui-mono-release.js View on Github external
      .then(() => serialSpawn(publishCommands, {cwd}))
      .then(resolve)