Skip to content

Commit dd4a30e

Browse files
authored
Merge pull request #13 from ara-framework/fix/upgrade-execa
Fix/upgrade execa
2 parents 855fd6f + 93fa145 commit dd4a30e

6 files changed

Lines changed: 23 additions & 13 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ara-cli",
3-
"version": "1.0.0-alpha.2",
3+
"version": "1.0.0-alpha.3",
44
"description": "Ara Framework Command Line Interface",
55
"keywords": [
66
"ara",
@@ -25,7 +25,7 @@
2525
"cac": "^6.5.2",
2626
"chalk": "^2.4.2",
2727
"download": "^7.1.0",
28-
"execa": "^2.0.4",
28+
"execa": "^3.3.0",
2929
"majo": "^0.8.0",
3030
"ora": "^3.4.0",
3131
"s3rver": "^3.3.0",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const runProxy = require('./run/proxy');
1010
const runCluster = require('./run/cluster');
1111

1212
cli.command('new:project <outDir>', 'New Project')
13-
.action(outDir => generateProject(outDir));
13+
.action((outDir) => generateProject(outDir));
1414

1515
cli.command('new:nova <outDir>', 'New Micro-Frontend')
1616
.option('-t, --template <template>', 'Template Type')

src/run/asset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const corsConfig = require.resolve('s3rver/example/cors.xml');
77
const defaultBucket = 'assets';
88

99
module.exports = (webpackConf) => {
10-
const [clientConf] = webpackConf.filter(conf => conf.target === 'web');
10+
const [clientConf] = webpackConf.filter((conf) => conf.target === 'web');
1111

1212
if (!clientConf) {
1313
throw Error('Missing webpack configuration with target set as "web"');
@@ -62,7 +62,7 @@ module.exports = (webpackConf) => {
6262
ContentType: 'text/javascript',
6363
Body: fs.readFileSync(path.join(outputPath, fileName)),
6464
}).promise()
65-
.catch(e => console.error(e))
65+
.catch((e) => console.error(e))
6666
.then(() => console.log(chalk.green(`Client script in "${defaultBucket}" bucket`)));
6767
});
6868
}

src/run/cluster.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ module.exports = async (config, dest) => {
2727
fs.chmodSync(executable, 755);
2828
spinner.succeed('Downloaded nova-cluster');
2929
} catch (error) {
30-
spinner.fail('Downloadind nova-cluster failed');
30+
console.error(error);
31+
spinner.fail('Downloading nova-cluster failed');
3132
return null;
3233
}
3334
} else {
@@ -38,9 +39,13 @@ module.exports = async (config, dest) => {
3839
try {
3940
process.env.CONFIG_FILE = process.env.CONFIG_FILE || config;
4041

41-
execa(executable).stdout.pipe(process.stdout);
42+
const child = execa(executable);
43+
44+
child.stdout.pipe(process.stdout);
45+
child.stderr.pipe(process.stderr);
4246
} catch (error) {
43-
console.error(chalk.red(error.stderr || 'Nova cluster failed when running'));
47+
console.error(error);
48+
console.error(chalk.red('Nova cluster failed when running'));
4449
}
4550

4651
return null;

src/run/lambda.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = (handler, webpackConf) => {
88
const webpack = require('webpack');
99
const ServerlessOffline = require('serverless-offline/src/ServerlessOffline');
1010

11-
const [serverConf] = webpackConf.filter(conf => conf.target === 'node');
11+
const [serverConf] = webpackConf.filter((conf) => conf.target === 'node');
1212

1313
if (!serverConf) {
1414
throw Error('Missing webpack configuration with target set as "node"');
@@ -86,7 +86,7 @@ module.exports = (handler, webpackConf) => {
8686
isWatching = true;
8787

8888
return Promise.resolve(slsOffline._buildServer())
89-
.then(server => server.start());
89+
.then((server) => server.start());
9090
});
9191

9292
return compiler;

src/run/proxy.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ module.exports = async (config, dest) => {
2727
fs.chmodSync(executable, 755);
2828
spinner.succeed('Downloaded nova-proxy');
2929
} catch (error) {
30-
spinner.fail('Downloadind nova-proxy failed');
30+
console.error(error);
31+
spinner.fail('Downloading nova-proxy failed');
3132
return null;
3233
}
3334
} else {
@@ -42,9 +43,13 @@ module.exports = async (config, dest) => {
4243
return console.error(chalk.red('HYPERNOVA_BATCH environment variable is required'));
4344
}
4445
console.log(chalk.green('Nova proxy running!!'));
45-
await execa(executable);
46+
const child = execa(executable);
47+
48+
child.stdout.pipe(process.stdout);
49+
child.stderr.pipe(process.stderr);
4650
} catch (error) {
47-
console.error(chalk.red(error.stderr || 'Nova proxy failed when running'));
51+
console.error(error);
52+
console.error(chalk.red('Nova proxy failed when running'));
4853
}
4954

5055
return null;

0 commit comments

Comments
 (0)