avo 3.2.6 → 3.2.7-beta.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 (3) hide show
  1. package/README.md +1 -1
  2. package/cli.js +8 -14
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -45,4 +45,4 @@ For more documentation, visit [https://www.avo.app/docs/implementation/cli](http
45
45
 
46
46
  **Caught a Bug?** Thank you, you are precious to us :hug: Please create a issue on the GitHub repo or send an email to friends@avo.app. We'll do our best to resolve it quickly!
47
47
 
48
- **To create a release:** 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 • Update the semantic version in `package.json` to match the one you just created in the changelog • Commit with the message "Release <version>" and push the changes • Publish the package to npm (you'll need to be a maintainer of the avo project in npm): `npm publish`
48
+ **To create a release:** 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 • Update the semantic version in `package.json` to match the one you just created in the changelog • Commit with the message `Release <version>` and push the changes • Publish the package to npm (you'll need to be a maintainer of the avo project in npm): `npm publish`
package/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import ora from 'ora';
3
3
  import chalk from 'chalk';
4
- import minimatch from 'minimatch';
4
+ import { Minimatch } from 'minimatch';
5
5
  import dateFns from 'date-fns';
6
6
  import fs from 'fs';
7
7
  import http from 'http';
@@ -32,7 +32,6 @@ import httpShutdown from 'http-shutdown';
32
32
  import fuzzypath from 'inquirer-fuzzy-path';
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
- const { Minimatch } = minimatch;
36
35
  /// //////////////////////////////////////////////////////////////////////
37
36
  // LOGGING
38
37
  const { cyan, gray, red, bold, underline } = chalk;
@@ -463,17 +462,8 @@ function promptPullMaster(json) {
463
462
  return Promise.resolve(json);
464
463
  });
465
464
  }
466
- function installIdOrUserId() {
467
- const installId = conf.get('avo_install_id');
468
- const user = conf.get('user');
469
- if (user && user.user_id) {
470
- return user.user_id;
471
- }
472
- return installId;
473
- }
474
- function invokedByCi() {
475
- return process.env.CI !== undefined;
476
- }
465
+ const installIdOrUserId = () => conf.get('user')?.user_id ?? conf.get('avo_install_id');
466
+ const invokedByCi = () => process.env.CI !== undefined;
477
467
  function requireAuth(argv, cb) {
478
468
  const tokens = conf.get('tokens');
479
469
  const user = conf.get('user');
@@ -1347,10 +1337,14 @@ yargs(hideBin(process.argv)) // eslint-disable-line no-unused-expressions
1347
1337
  .command({
1348
1338
  command: 'track-install',
1349
1339
  desc: false,
1350
- handler: () => {
1340
+ handler: async (argv) => {
1351
1341
  Avo.cliInstalled({
1352
1342
  userId_: installIdOrUserId(),
1353
1343
  cliInvokedByCi: invokedByCi(),
1344
+ }).catch((error) => {
1345
+ if (argv.verbose) {
1346
+ console.error('Failed to track cli installed', error);
1347
+ }
1354
1348
  });
1355
1349
  },
1356
1350
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo",
3
- "version": "3.2.6",
3
+ "version": "3.2.7-beta.1",
4
4
  "type": "module",
5
5
  "description": "The command-line interface for Avo",
6
6
  "author": "Avo (https://www.avo.app)",
@@ -17,7 +17,7 @@
17
17
  "node": ">=14.16"
18
18
  },
19
19
  "scripts": {
20
- "postinstall": "node cli.js track-install; true",
20
+ "postinstall": "node cli.js track-install",
21
21
  "prepublishOnly": "npm run compile",
22
22
  "lint": "eslint cli.ts",
23
23
  "format": "prettier --write cli.ts",
@@ -40,7 +40,7 @@
40
40
  "jsonwebtoken": "^9.0.0",
41
41
  "load-json-file": "^7.0.1",
42
42
  "log-symbols": "^5.1.0",
43
- "minimatch": "^5.1.0",
43
+ "minimatch": "^7.0.0",
44
44
  "node-avo-inspector": "^1.0.1",
45
45
  "open": "^8.4.0",
46
46
  "ora": "^6.0.1",
@@ -64,7 +64,7 @@
64
64
  "eslint-config-airbnb-base": "^15.0.0",
65
65
  "eslint-config-prettier": "^8.5.0",
66
66
  "eslint-plugin-import": "^2.25.2",
67
- "prettier": "2.8.2",
67
+ "prettier": "2.8.4",
68
68
  "typescript": "^4.7.4"
69
69
  }
70
70
  }