avo 1.7.0 → 2.0.1

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.
Files changed (4) hide show
  1. package/Avo.js +780 -773
  2. package/README.md +4 -1
  3. package/cli.js +42 -44
  4. package/package.json +11 -10
package/README.md CHANGED
@@ -48,7 +48,10 @@ yarn commit
48
48
 
49
49
  ## How to Create a Release
50
50
 
51
+ 1. Update the semantic version in `package.json`
52
+ 2. Publish the package to npm
53
+
51
54
  ```
52
- npm run release-it
55
+ npm publish
53
56
  ```
54
57
 
package/cli.js CHANGED
@@ -1,35 +1,42 @@
1
1
  #!/usr/bin/env node
2
- const _ = require('lodash');
3
- const {cyan, gray, red, bold, underline} = require('chalk');
4
- const dateFns = require('date-fns');
5
- const fs = require('fs');
6
- const http = require('http');
7
- const inquirer = require('inquirer');
8
- const jwt = require('jsonwebtoken');
9
- const loadJsonFile = require('load-json-file');
10
- const logSymbols = require('log-symbols');
11
- const opn = require('opn');
12
- const ora = require('ora');
13
- const path = require('path');
14
- const pify = require('pify');
15
- const portfinder = require('portfinder');
16
- const querystring = require('querystring');
17
- const request = require('request');
18
- const report = require('yurnalist');
19
- const semver = require('semver');
20
- const updateNotifier = require('update-notifier');
21
- const url = require('url');
22
- const util = require('util');
23
- const uuidv4 = require('uuid/v4');
24
- const walk = require('ignore-walk');
25
- const writeFile = require('write');
26
- const writeJsonFile = require('write-json-file');
27
- const Configstore = require('configstore');
28
- const Minimatch = require('minimatch').Minimatch;
29
- const Inspector = require('node-avo-inspector');
30
-
31
- const pkg = require('./package.json');
32
- const Avo = require('./Avo.js');
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', require('inquirer-fuzzy-path'));
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.promise(code.path, code.content))
709
+ target.code.map(code => writeFile(code.path, code.content))
709
710
  );
710
711
  });
711
712
 
@@ -1289,7 +1290,7 @@ function status(source, json, argv) {
1289
1290
  });
1290
1291
  }
1291
1292
 
1292
- require('yargs')
1293
+ yargs(hideBin(process.argv))
1293
1294
  .usage('$0 command')
1294
1295
  .scriptName('avo')
1295
1296
  .option('v', {
@@ -1662,9 +1663,6 @@ require('yargs')
1662
1663
  report.info(`Currently on branch '${json.branch.name}'`);
1663
1664
  return getSource(argv, json);
1664
1665
  })
1665
- .then(([source, json]) => {
1666
- return writeAvoJson(json).then(json => [source, json]);
1667
- })
1668
1666
  .then(([source, json]) => {
1669
1667
  return status(source, json, argv);
1670
1668
  })
@@ -2147,7 +2145,7 @@ function _loginWithLocalhost(port) {
2147
2145
  _respondWithRedirect(req, res, api.authOrigin + '/auth/cli/error');
2148
2146
  });
2149
2147
 
2150
- server = require('http-shutdown')(server);
2148
+ server = httpShutdown(server);
2151
2149
 
2152
2150
  server.listen(port, function() {
2153
2151
  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": "1.7.0",
3
+ "version": "2.0.1",
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": ">=6"
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": "6.2.0",
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": "3.0.0",
41
+ "ora": "6.0.1",
41
42
  "pify": "4.0.1",
42
- "portfinder": "1.0.19",
43
+ "portfinder": "1.0.28",
43
44
  "request": "2.88.0",
44
45
  "semver": "5.6.0",
45
- "update-notifier": "2.5.0",
46
- "uuid": "3.3.2",
47
- "write": "1.0.3",
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": "12.0.5",
50
- "yurnalist": "1.0.5"
50
+ "yargs": "17.2.1",
51
+ "yurnalist": "2.1.0"
51
52
  }
52
53
  }