Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/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))
#!/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)
})
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}
)
.option('-P, --pattern
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))
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)
.then(() => serialSpawn(docCommands))
.then(() => {
.then(() => serialSpawn(publishCommands, {cwd}))
.then(resolve)
.add(() => serialSpawn(commands))
.then(() => {