mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-05 16:42:27 +03:00
feat: update all deps versions, move from babel to swc
- move all package commands to scripts/pkg-task - jest now uses swc - rollup now uses swc - move all benchmark packages to benchmark/package.json
This commit is contained in:
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,11 @@
|
||||
{
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"author": {
|
||||
"name": "Nikolay Kostyurin <jilizart@gmail.com>",
|
||||
"url": "https://artkost.ru/"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "8.2.0"
|
||||
}
|
||||
}
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
const { resolve } = require('path')
|
||||
const { spawn } = require('child_process')
|
||||
const { Command } = require('commander');
|
||||
|
||||
const program = new Command();
|
||||
const nmBinDir = resolve(`../../node_modules/.bin/`)
|
||||
const shell = { cmd: 'sh', arg: '-c' }
|
||||
|
||||
const actionCommand = (command) => () => {
|
||||
spawn(shell.cmd, [shell.arg, `${nmBinDir}/${command}`], {
|
||||
env: process.env,
|
||||
cwd: process.cwd(),
|
||||
stdio: 'inherit',
|
||||
})
|
||||
}
|
||||
|
||||
const commandMap = {
|
||||
'build-commonjs': `cross-env BABEL_ENV=commonjs NODE_ENV=production ${nmBinDir}/swc --config-file ../../.swcrc-commonjs --out-dir lib src`,
|
||||
'build-es': `cross-env BABEL_ENV=es NODE_ENV=production ${nmBinDir}/swc --out-dir es src`,
|
||||
'build-umd': `cross-env BABEL_ENV=rollup NODE_ENV=production ${nmBinDir}/rollup --config ../../rollup.config.js`,
|
||||
test: `jest`,
|
||||
cover: `jest --config ../../jest.config.js --coverage .`,
|
||||
lint: `eslint .`,
|
||||
bundlesize: `cross-env NODE_ENV=production ${nmBinDir}/bundlesize .`
|
||||
}
|
||||
|
||||
program.version('1.0.0')
|
||||
|
||||
for (const [key, command] of Object.entries(commandMap)) {
|
||||
program.command(key).action(actionCommand(command))
|
||||
}
|
||||
|
||||
program.parse();
|
||||
Reference in New Issue
Block a user