avo 3.2.10 → 3.2.11-alpha.0

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Better event tracking, **faster**.
4
4
 
5
- ![https://www.avo.app](https://cdn.avo.app/assets/avo-cado.png)
5
+ ![https://www.avo.app](https://cdn.avo.app/assets/avo-find-fix-prevent.png)
6
6
 
7
7
  The Avo CLI gives you access to [Avo Codegen](https://www.avo.app/docs/implementation/devs-101) right from your command line. It allows you to pull [your Avo tracking plan](http://avo.app/schemas/default) as type-safe functions for each of your events, making analytics implementation quick and seamless. Avo Codegen supports a variety of [platforms, programming languages and destinations](https://www.avo.app/docs/implementation/supported-programming-languages).
8
8
 
@@ -47,6 +47,6 @@ For more documentation, visit [https://www.avo.app/docs/implementation/cli](http
47
47
 
48
48
  **To create a release:**
49
49
  1. Verify that the changes in the _Unreleased_ section in CHANGELOG.md are accurate, create a new heading with the correct semantic version then move the content from the _Unreleased_ section there
50
- 2. Udate the semantic version in `package.json` to match the one you just created in the changelog
50
+ 2. Update the semantic version in `package.json` to match the one you just created in the changelog
51
51
  3. Commit with the message `Release <version>` and push the changes
52
52
  4. Publish the package to npm (you'll need to be a maintainer of the avo project in npm): `npm publish`
package/cli.js CHANGED
@@ -15,7 +15,6 @@ import pify from 'pify';
15
15
  import portfinder from 'portfinder';
16
16
  import querystring from 'querystring';
17
17
  import got from 'got'; // eslint-disable-line import/no-unresolved
18
- import report from 'yurnalist';
19
18
  import semver from 'semver';
20
19
  import updateNotifier from 'update-notifier';
21
20
  import url from 'url';
@@ -30,6 +29,7 @@ import yargs from 'yargs';
30
29
  import { hideBin } from 'yargs/helpers';
31
30
  import httpShutdown from 'http-shutdown';
32
31
  import fuzzypath from 'inquirer-fuzzy-path';
32
+ import * as report from './reporter.js';
33
33
  import Avo from './Avo.js';
34
34
  const pkg = JSON.parse(fs.readFileSync(new URL('package.json', import.meta.url), 'utf-8'));
35
35
  /// //////////////////////////////////////////////////////////////////////
@@ -1103,15 +1103,15 @@ function status(source, json, argv) {
1103
1103
  }
1104
1104
  return pify(fs.readFile)(resultPath, 'utf8')
1105
1105
  .then((data) => [resultPath, data])
1106
- .catch((error) => {
1106
+ .catch(() => {
1107
1107
  if (argv.verbose) {
1108
- report.warn(`Failed to parse file: ${resultPath}`, error);
1108
+ report.warn(`Failed to parse file: ${resultPath}`);
1109
1109
  }
1110
1110
  });
1111
1111
  })
1112
- .catch((error) => {
1112
+ .catch(() => {
1113
1113
  if (argv.verbose) {
1114
- report.warn(`Failed to read file stats: ${resultPath}`, error);
1114
+ report.warn(`Failed to read file stats: ${resultPath}`);
1115
1115
  }
1116
1116
  }))).then((cachePairs) => Object.fromEntries(cachePairs)));
1117
1117
  fileCache
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo",
3
- "version": "3.2.10",
3
+ "version": "3.2.11-alpha.0",
4
4
  "type": "module",
5
5
  "description": "The command-line interface for Avo",
6
6
  "author": "Avo (https://www.avo.app)",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "files": [
28
28
  "cli.js",
29
+ "reporter.js",
29
30
  "Avo.js"
30
31
  ],
31
32
  "dependencies": {
@@ -51,8 +52,7 @@
51
52
  "uuid": "^9.0.0",
52
53
  "write": "^2.0.0",
53
54
  "write-json-file": "^5.0.0",
54
- "yargs": "^17.2.1",
55
- "yurnalist": "^2.1.0"
55
+ "yargs": "^17.2.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/ignore-walk": "^4.0.0",
package/reporter.js ADDED
@@ -0,0 +1,28 @@
1
+ import chalk from 'chalk';
2
+ export function log(text) {
3
+ console.log(text);
4
+ }
5
+ export function info(text) {
6
+ console.log(chalk.blue('info'), text);
7
+ }
8
+ export function success(text) {
9
+ console.log(chalk.green('success'), text);
10
+ }
11
+ export function warn(text) {
12
+ console.log(chalk.yellow('warn'), text);
13
+ }
14
+ export function error(text) {
15
+ console.log(chalk.red('error'), text);
16
+ }
17
+ export function tree(text, children) {
18
+ function recursiveTree(name = '', nodes = [], prefix = '') {
19
+ nodes.sort((a, b) => a.name.localeCompare(b.name));
20
+ return `${name}\n${nodes
21
+ .map((node, index) => {
22
+ const last = index === nodes.length - 1;
23
+ return `${prefix}${last ? '└' : '├'}─ ${recursiveTree(node.name, node.children, `${prefix}${last ? ' ' : '│'} `)}`;
24
+ })
25
+ .join('')}`;
26
+ }
27
+ console.log(recursiveTree(text, children));
28
+ }