Merge pull request #185 from spotify/patriko/cli-packaging

cli: fixes to scripts and packaging + bump
This commit is contained in:
Patrik Oldsberg
2020-03-07 10:58:55 +01:00
committed by GitHub
5 changed files with 21 additions and 10 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ const path = require('path');
// Figure out whether we're running inside the backstage repo or as an installed dependency
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));
if (!isLocal) {
require('../cjs');
require('../dist');
} else {
require('ts-node').register({
project: path.resolve(__dirname, '../tsconfig.json'),
+5 -6
View File
@@ -1,19 +1,17 @@
{
"name": "@spotify-backstage/cli",
"version": "1.3.0",
"main": "src/index.ts",
"main:src": "src/index.ts",
"version": "1.4.0",
"main": "dist",
"license": "Apache-2.0",
"private": false,
"scripts": {
"exec": "npx ts-node ./src",
"build": "web-scripts build",
"build": "tsc --outDir dist --noEmit false --module CommonJS",
"lint": "web-scripts lint",
"test": "web-scripts test",
"start": "nodemon ."
},
"devDependencies": {
"@spotify/web-scripts": "^6.0.0",
"@types/fs-extra": "^8.1.0",
"@types/html-webpack-plugin": "^3.2.2",
"@types/inquirer": "^6.5.0",
@@ -33,6 +31,7 @@
"dependencies": {
"@lerna/package-graph": "^3.18.5",
"@lerna/project": "^3.18.0",
"@spotify/web-scripts": "^6.0.0",
"chokidar": "^3.3.1",
"commander": "^4.1.1",
"dashify": "^2.0.0",
@@ -52,7 +51,7 @@
"files": [
"templates",
"bin",
"cjs"
"dist"
],
"nodemonConfig": {
"watch": "./src",
+5 -1
View File
@@ -17,7 +17,11 @@ export default async (cmd: Command) => {
}
try {
spawnSync('tsc', args, { stdio: 'inherit' });
const result = spawnSync('tsc', args, { stdio: 'inherit' });
if (result.error) {
throw result.error;
}
process.exit(result.status ?? 0);
} catch (error) {
process.stderr.write(`${chalk.red(error.message)}\n`);
process.exit(1);
+5 -1
View File
@@ -5,7 +5,11 @@ export default async () => {
const args = ['lint'];
try {
spawnSync('web-scripts', args, { stdio: 'inherit' });
const result = spawnSync('web-scripts', args, { stdio: 'inherit' });
if (result.error) {
throw result.error;
}
process.exit(result.status ?? 0);
} catch (error) {
process.stderr.write(`${chalk.red(error.message)}\n`);
process.exit(1);
+5 -1
View File
@@ -10,7 +10,11 @@ export default async (cmd: Command) => {
}
try {
spawnSync('web-scripts', args, { stdio: 'inherit' });
const result = spawnSync('web-scripts', args, { stdio: 'inherit' });
if (result.error) {
throw result.error;
}
process.exit(result.status ?? 0);
} catch (error) {
process.stderr.write(`${chalk.red(error.message)}\n`);
process.exit(1);