avo 1.7.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Avo.js +780 -773
- package/README.md +4 -1
- package/cli.js +43 -41
- package/package.json +11 -10
package/README.md
CHANGED
package/cli.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
import minimatch from 'minimatch';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import dateFns from 'date-fns';
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import http from 'http';
|
|
9
|
+
import inquirer from 'inquirer';
|
|
10
|
+
import jwt from 'jsonwebtoken';
|
|
11
|
+
import loadJsonFile from 'load-json-file';
|
|
12
|
+
import logSymbols from 'log-symbols';
|
|
13
|
+
import opn from 'opn';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
import pify from 'pify';
|
|
16
|
+
import portfinder from 'portfinder';
|
|
17
|
+
import querystring from 'querystring';
|
|
18
|
+
import request from 'request';
|
|
19
|
+
import report from 'yurnalist';
|
|
20
|
+
import semver from 'semver';
|
|
21
|
+
import updateNotifier from 'update-notifier';
|
|
22
|
+
import url from 'url';
|
|
23
|
+
import util from 'util';
|
|
24
|
+
import {v4 as uuidv4} from 'uuid';
|
|
25
|
+
import walk from 'ignore-walk';
|
|
26
|
+
import writeFile from 'write';
|
|
27
|
+
import writeJsonFile from 'write-json-file';
|
|
28
|
+
import Configstore from 'configstore';
|
|
29
|
+
import Inspector from 'node-avo-inspector';
|
|
30
|
+
import yargs from 'yargs';
|
|
31
|
+
import { hideBin } from 'yargs/helpers'
|
|
32
|
+
import httpShutdown from 'http-shutdown';
|
|
33
|
+
import fuzzypath from 'inquirer-fuzzy-path';
|
|
34
|
+
|
|
35
|
+
import Avo from './Avo.js';
|
|
36
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('package.json', import.meta.url)));
|
|
37
|
+
|
|
38
|
+
const Minimatch = minimatch.Minimatch;
|
|
39
|
+
const {cyan, gray, red, bold, underline} = chalk;
|
|
33
40
|
|
|
34
41
|
const customAnalyticsDestination = {
|
|
35
42
|
make: function make(production) {
|
|
@@ -65,7 +72,7 @@ Avo.initAvo(
|
|
|
65
72
|
);
|
|
66
73
|
|
|
67
74
|
// register inquirer-file-path
|
|
68
|
-
inquirer.registerPrompt('fuzzypath',
|
|
75
|
+
inquirer.registerPrompt('fuzzypath', fuzzypath);
|
|
69
76
|
|
|
70
77
|
updateNotifier({pkg: pkg}).notify();
|
|
71
78
|
|
|
@@ -122,12 +129,6 @@ function _request(options, logOptions) {
|
|
|
122
129
|
qsLog = JSON.stringify(options.qs);
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
if (!logOptions.skipRequestBody) {
|
|
126
|
-
bodyLog = options.body || options.form || '';
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// logger.debug(">>> HTTP REQUEST", options.method, options.url, qsLog, "\n", bodyLog);
|
|
130
|
-
|
|
131
132
|
return new Promise(function(resolve, reject) {
|
|
132
133
|
var req = request(options, function(err, response, body) {
|
|
133
134
|
if (err) {
|
|
@@ -705,7 +706,7 @@ function codegen(json, result) {
|
|
|
705
706
|
|
|
706
707
|
let sourceTasks = targets.map(target => {
|
|
707
708
|
return Promise.all(
|
|
708
|
-
target.code.map(code => writeFile
|
|
709
|
+
target.code.map(code => writeFile(code.path, code.content))
|
|
709
710
|
);
|
|
710
711
|
});
|
|
711
712
|
|
|
@@ -1289,9 +1290,10 @@ function status(source, json, argv) {
|
|
|
1289
1290
|
});
|
|
1290
1291
|
}
|
|
1291
1292
|
|
|
1292
|
-
|
|
1293
|
+
yargs(hideBin(process.argv))
|
|
1293
1294
|
.usage('$0 command')
|
|
1294
1295
|
.scriptName('avo')
|
|
1296
|
+
.version(pkg.version)
|
|
1295
1297
|
.option('v', {
|
|
1296
1298
|
alias: 'verbose',
|
|
1297
1299
|
default: false,
|
|
@@ -2144,7 +2146,7 @@ function _loginWithLocalhost(port) {
|
|
|
2144
2146
|
_respondWithRedirect(req, res, api.authOrigin + '/auth/cli/error');
|
|
2145
2147
|
});
|
|
2146
2148
|
|
|
2147
|
-
server =
|
|
2149
|
+
server = httpShutdown(server);
|
|
2148
2150
|
|
|
2149
2151
|
server.listen(port, function() {
|
|
2150
2152
|
report.info(`Visit this URL on any device to login: ${link(authUrl)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "The command-line interface for Avo",
|
|
5
6
|
"author": "Avo (https://www.avo.app)",
|
|
6
7
|
"repository": {
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
"avo": "cli.js"
|
|
14
15
|
},
|
|
15
16
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
17
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
17
18
|
},
|
|
18
19
|
"scripts": {
|
|
19
20
|
"postinstall": "node cli.js track-install"
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"date-fns": "1.30.1",
|
|
29
30
|
"http-shutdown": "1.2.0",
|
|
30
31
|
"ignore-walk": "3.0.1",
|
|
31
|
-
"inquirer": "
|
|
32
|
+
"inquirer": "8.2",
|
|
32
33
|
"inquirer-fuzzy-path": "2.3.0",
|
|
33
34
|
"jsonwebtoken": "8.4.0",
|
|
34
35
|
"load-json-file": "5.1.0",
|
|
@@ -37,16 +38,16 @@
|
|
|
37
38
|
"minimatch": "3.0.4",
|
|
38
39
|
"node-avo-inspector": "^1.0.1",
|
|
39
40
|
"opn": "5.4.0",
|
|
40
|
-
"ora": "
|
|
41
|
+
"ora": "6.0.1",
|
|
41
42
|
"pify": "4.0.1",
|
|
42
|
-
"portfinder": "1.0.
|
|
43
|
+
"portfinder": "1.0.28",
|
|
43
44
|
"request": "2.88.0",
|
|
44
45
|
"semver": "5.6.0",
|
|
45
|
-
"update-notifier": "
|
|
46
|
-
"uuid": "
|
|
47
|
-
"write": "
|
|
46
|
+
"update-notifier": "5.1",
|
|
47
|
+
"uuid": "8.3.2",
|
|
48
|
+
"write": "2.0.0",
|
|
48
49
|
"write-json-file": "3.0.2",
|
|
49
|
-
"yargs": "
|
|
50
|
-
"yurnalist": "1.0
|
|
50
|
+
"yargs": "17.2.1",
|
|
51
|
+
"yurnalist": "2.1.0"
|
|
51
52
|
}
|
|
52
53
|
}
|