mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +03:00
feat: update core deps (#120)
* feat: use swc.rs instead of babel * BREAKING CHANGE: now we use swc.rs as main bundler and transpiler instead of babel - jest now uses swc - rollup now uses swc * feat: benchmark now separate package with `npm start` and colored output - benchmark as separate package with error throw if package drops performance * feat: all lerna packages now using scripts/pkg-task * feat(github): publish to npm and github registry - when release was created this action automaticly publish packages to npm and github * feat(github): move all from Travis CI to Github Actions - code analysis and tests now using github actions * test: increase tests coverage - add more tests for @bbob/react, @bbob/vue2 and @bbob/parser
This commit is contained in:
committed by
GitHub
parent
86d1dde106
commit
da6709d437
Generated
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-8.2.0.tgz",
|
||||
"integrity": "sha512-LLKxDvHeL91/8MIyTAD5BFMNtoIwztGPMiM/7Bl8rIPmHCZXRxmSWr91h57dpOpnQ6jIUqEWdXE/uBYMfiVZDA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "scripts",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"author": {
|
||||
"name": "Nikolay Kostyurin <jilizart@gmail.com>",
|
||||
"url": "https://artkost.ru/"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "8.2.0"
|
||||
}
|
||||
}
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
const { resolve } = require('path')
|
||||
const { spawn } = require('child_process')
|
||||
const { Command } = require('commander');
|
||||
const pkg = require(resolve(__dirname, '../package.json'))
|
||||
|
||||
const program = new Command();
|
||||
const nmBinDir = resolve(__dirname, '../node_modules/.bin/')
|
||||
const shell = { cmd: 'sh', arg: '-c' }
|
||||
|
||||
const replaceTokens = str => String(str).replace(new RegExp('@\\/', 'gi'), `${nmBinDir}/`)
|
||||
|
||||
const actionCommand = (command) => () => {
|
||||
const proc = spawn(shell.cmd, [shell.arg, replaceTokens(command)], {
|
||||
env: process.env,
|
||||
cwd: process.cwd(),
|
||||
stdio: 'inherit',
|
||||
})
|
||||
|
||||
proc.on('close', (code) => {
|
||||
if (code !== 0) {
|
||||
console.log(`command:"${command}" exited with code ${code}`);
|
||||
}
|
||||
|
||||
process.exit(code)
|
||||
});
|
||||
}
|
||||
|
||||
program.version('1.0.0')
|
||||
|
||||
for (const [key, command] of Object.entries(pkg.pkgTasks)) {
|
||||
program.command(key).action(actionCommand(command))
|
||||
}
|
||||
|
||||
program.parse();
|
||||
Reference in New Issue
Block a user