avo 1.6.0 → 1.8.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.
Files changed (4) hide show
  1. package/README.md +4 -1
  2. package/cli.js +31 -6
  3. package/package.json +6 -19
  4. package/CHANGELOG.md +0 -182
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
@@ -685,6 +685,7 @@ function codegen(json, result) {
685
685
  let targets = result.sources;
686
686
  let newJson = Object.assign({}, _.cloneDeep(json), {schema: schema});
687
687
  let warnings = result.warnings;
688
+ let errors = result.errors;
688
689
 
689
690
  newJson.sources = newJson.sources.map(source => {
690
691
  let target = _.find(targets, target => target.id === source.id);
@@ -711,6 +712,10 @@ function codegen(json, result) {
711
712
  let avoJsonTask = writeAvoJson(newJson);
712
713
 
713
714
  Promise.all(_.concat([avoJsonTask], sourceTasks)).then(() => {
715
+ if (errors !== undefined && errors !== null && errors !== "") {
716
+ report.warn(errors + "\n");
717
+ }
718
+
714
719
  if (warnings !== undefined && warnings !== null && Array.isArray(warnings)) {
715
720
  warnings.forEach(warning => {
716
721
  report.warn(warning);
@@ -969,11 +974,13 @@ function pull(sourceFilter, json) {
969
974
  branchId: json.branch.id,
970
975
  sources: _.map(sources, source => {
971
976
  return {id: source.id, path: source.path};
972
- })
977
+ }),
978
+ force: json.force || false
973
979
  }
974
980
  });
975
981
  })
976
982
  .then(res => {
983
+
977
984
  cancelWait();
978
985
  let result = res.body;
979
986
  if (result.ok) {
@@ -1135,9 +1142,30 @@ function status(source, json, argv) {
1135
1142
  moduleMap || sourcePath.name || 'Avo'
1136
1143
  );
1137
1144
 
1145
+ let sourcePathExts = [];
1146
+
1147
+ if (sourcePath.ext === ".js" || sourcePath.ext === ".ts") {
1148
+ sourcePathExts.push("js");
1149
+ sourcePathExts.push("jsx");
1150
+ sourcePathExts.push("ts");
1151
+ sourcePathExts.push("tsx");
1152
+ } else if (sourcePath.ext === ".java" || sourcePath.ext === ".kt") {
1153
+ sourcePathExts.push("java");
1154
+ sourcePathExts.push("kt");
1155
+ } else if (sourcePath.ext === ".m" || sourcePath.ext === ".swift") {
1156
+ sourcePathExts.push("m");
1157
+ sourcePathExts.push("swift");
1158
+ } else {
1159
+ sourcePathExts.push(sourcePath.ext.substring(1));
1160
+ }
1161
+
1162
+ if (argv.verbose) {
1163
+ console.log("Looking in files with extensions:" , sourcePathExts);
1164
+ }
1165
+
1138
1166
  let globs = [
1139
1167
  new Minimatch(
1140
- _.get(source, 'analysis.glob', '**/*' + sourcePath.ext),
1168
+ _.get(source, 'analysis.glob', '**/*.+(' + sourcePathExts.join("|") + ")"),
1141
1169
  {}
1142
1170
  ),
1143
1171
  new Minimatch('!' + source.path, {})
@@ -1149,7 +1177,7 @@ function status(source, json, argv) {
1149
1177
 
1150
1178
  return Promise.all(
1151
1179
  eventMap.map(eventName => {
1152
- let re = new RegExp(moduleName + '\\.' + eventName);
1180
+ let re = new RegExp('(' + moduleName + '\\.' + eventName + '|\\[' + moduleName + " " + eventName +')');
1153
1181
  let results = _.flatMap(lookup, (data, path) => {
1154
1182
  if (argv.verbose) {
1155
1183
  report.info(`Looking for events in ${path}`);
@@ -1634,9 +1662,6 @@ require('yargs')
1634
1662
  report.info(`Currently on branch '${json.branch.name}'`);
1635
1663
  return getSource(argv, json);
1636
1664
  })
1637
- .then(([source, json]) => {
1638
- return writeAvoJson(json).then(json => [source, json]);
1639
- })
1640
1665
  .then(([source, json]) => {
1641
1666
  return status(source, json, argv);
1642
1667
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "The command-line interface for Avo",
5
5
  "author": "Avo (https://www.avo.app)",
6
6
  "repository": {
@@ -16,8 +16,6 @@
16
16
  "node": ">=6"
17
17
  },
18
18
  "scripts": {
19
- "commit": "git-cz",
20
- "release": "release-it",
21
19
  "postinstall": "node cli.js track-install"
22
20
  },
23
21
  "files": [
@@ -30,11 +28,11 @@
30
28
  "date-fns": "1.30.1",
31
29
  "http-shutdown": "1.2.0",
32
30
  "ignore-walk": "3.0.1",
33
- "inquirer": "6.2.0",
31
+ "inquirer": "8.2",
34
32
  "inquirer-fuzzy-path": "2.3.0",
35
33
  "jsonwebtoken": "8.4.0",
36
34
  "load-json-file": "5.1.0",
37
- "lodash": "4.17.19",
35
+ "lodash": "4.17.21",
38
36
  "log-symbols": "2.2.0",
39
37
  "minimatch": "3.0.4",
40
38
  "node-avo-inspector": "^1.0.1",
@@ -44,22 +42,11 @@
44
42
  "portfinder": "1.0.19",
45
43
  "request": "2.88.0",
46
44
  "semver": "5.6.0",
47
- "update-notifier": "2.5.0",
45
+ "update-notifier": "5.1",
48
46
  "uuid": "3.3.2",
49
47
  "write": "1.0.3",
50
48
  "write-json-file": "3.0.2",
51
- "yargs": "12.0.5",
52
- "yurnalist": "1.0.5"
53
- },
54
- "devDependencies": {
55
- "commitizen": "3.0.5",
56
- "conventional-changelog-cli": "2.0.11",
57
- "cz-conventional-changelog": "2.1.0",
58
- "release-it": "8.2.0"
59
- },
60
- "config": {
61
- "commitizen": {
62
- "path": "cz-conventional-changelog"
63
- }
49
+ "yargs": "17.2",
50
+ "yurnalist": "2"
64
51
  }
65
52
  }
package/CHANGELOG.md DELETED
@@ -1,182 +0,0 @@
1
- ## [1.5.1](https://github.com/avohq/avo/compare/1.5.0...1.5.1) (2021-03-16)
2
-
3
- * Fix a bug preventing users from being not able to pick a location for their avo.json file
4
-
5
- ## [1.5.0](https://github.com/avohq/avo/compare/1.4.2...1.5.0) (2021-03-16)
6
-
7
- * Rename the master branch to main
8
- * Update dependencies
9
- * Faster autocompletion in big projects
10
-
11
- ## [1.4.2](https://github.com/avohq/avo/compare/1.4.1...1.4.2) (2020-06-10)
12
-
13
-
14
-
15
- ## [1.4.1](https://github.com/avohq/avo/compare/1.4.1-beta.0...1.4.1) (2019-11-20)
16
-
17
-
18
-
19
- ## [1.4.1-beta.0](https://github.com/avohq/avo/compare/1.4.0...1.4.1-beta.0) (2019-11-20)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * Fix postinstall crash on Windows ([8b13c83](https://github.com/avohq/avo/commit/8b13c83))
25
-
26
-
27
-
28
- # [1.4.0](https://github.com/avohq/avo/compare/1.4.0-beta.3...1.4.0) (2019-10-29)
29
-
30
-
31
-
32
- # [1.4.0-beta.3](https://github.com/avohq/avo/compare/1.4.0-beta.2...1.4.0-beta.3) (2019-10-21)
33
-
34
-
35
- ### Bug Fixes
36
-
37
- * Updated analytics for merge conflict resolver ([07b0958](https://github.com/avohq/avo/commit/07b0958))
38
-
39
-
40
-
41
- # [1.4.0-beta.2](https://github.com/avohq/avo/compare/1.4.0-beta.1...1.4.0-beta.2) (2019-10-21)
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * Fix authentication when resolving merge conflicts ([efda141](https://github.com/avohq/avo/commit/efda141))
47
-
48
-
49
-
50
- # [1.4.0-beta.1](https://github.com/avohq/avo/compare/1.4.0-beta.0...1.4.0-beta.1) (2019-10-21)
51
-
52
-
53
-
54
- # [1.4.0-beta.0](https://github.com/avohq/avo/compare/1.3.6...1.4.0-beta.0) (2019-10-21)
55
-
56
-
57
- ### Features
58
-
59
- * Resolve simple merge conflicts in Avo files automatically ([886cc7f](https://github.com/avohq/avo/commit/886cc7f))
60
-
61
-
62
-
63
- ## [1.3.6](https://github.com/avohq/avo/compare/1.3.5...1.3.6) (2019-08-21)
64
-
65
-
66
- ### Bug Fixes
67
-
68
- * Request and handle gzipped responses ([c108ccf](https://github.com/avohq/avo/commit/c108ccf))
69
-
70
-
71
-
72
- ## [1.3.5](https://github.com/avohq/avo/compare/1.3.4...1.3.5) (2019-07-01)
73
-
74
-
75
- ### Bug Fixes
76
-
77
- * Suggest a command if provided command is unknown ([24f9345](https://github.com/avohq/avo/commit/24f9345))
78
-
79
-
80
-
81
- ## [1.3.4](https://github.com/avohq/avo/compare/1.3.3...1.3.4) (2019-07-01)
82
-
83
-
84
- ### Bug Fixes
85
-
86
- * Fixes issue where switching branch doesn't carry which source is being generated ([f851f0e](https://github.com/avohq/avo/commit/f851f0e))
87
-
88
-
89
-
90
- ## [1.3.3](https://github.com/avohq/avo/compare/1.3.2...1.3.3) (2019-04-05)
91
-
92
-
93
- ### Bug Fixes
94
-
95
- * Prevent crash if analytics endpoint fails ([a38e608](https://github.com/avohq/avo/commit/a38e608))
96
-
97
-
98
-
99
- ## [1.3.2](https://github.com/avohq/avo/compare/1.3.1...1.3.2) (2019-03-10)
100
-
101
-
102
- ### Bug Fixes
103
-
104
- * Use object.assign instead of spread syntax ([1b50034](https://github.com/avohq/avo/commit/1b50034))
105
-
106
-
107
-
108
- ## [1.3.1](https://github.com/avohq/avo/compare/1.3.0...1.3.1) (2019-02-26)
109
-
110
-
111
- ### Bug Fixes
112
-
113
- * Fix module map parsing for multi-line comments ([eb9796b](https://github.com/avohq/avo/commit/eb9796b))
114
-
115
-
116
-
117
- # [1.3.0](https://github.com/avohq/avo/compare/1.2.4...1.3.0) (2019-02-25)
118
-
119
-
120
- ### Features
121
-
122
- * Read analytics wrapper module name from source file ([3867652](https://github.com/avohq/avo/commit/3867652))
123
-
124
-
125
-
126
- ## [1.2.4](https://github.com/avohq/avo/compare/1.2.3...1.2.4) (2019-02-18)
127
-
128
-
129
-
130
- ## [1.2.3](https://github.com/avohq/avo/compare/1.2.2...1.2.3) (2019-02-18)
131
-
132
-
133
-
134
- ## [1.2.2](https://github.com/avohq/avo/compare/1.2.1...1.2.2) (2019-02-18)
135
-
136
-
137
-
138
- ## [1.2.1](https://github.com/avohq/avo/compare/1.2.0...1.2.1) (2019-02-17)
139
-
140
-
141
- ### Bug Fixes
142
-
143
- * Non-destructive changes to sources json when pulling ([171851e](https://github.com/avohq/avo/commit/171851e))
144
-
145
-
146
-
147
- # [1.2.0](https://github.com/avohq/avo/compare/1.1.2...1.2.0) (2019-02-17)
148
-
149
-
150
- ### Features
151
-
152
- * avo status with simple linting ([#2](https://github.com/avohq/avo/issues/2)) ([51adb92](https://github.com/avohq/avo/commit/51adb92))
153
-
154
-
155
-
156
- ## [1.1.2](https://github.com/avohq/avo/compare/1.1.1...1.1.2) (2019-02-16)
157
-
158
-
159
- ### Bug Fixes
160
-
161
- * avo pull source does not pull all sources if it is missing ([80c1048](https://github.com/avohq/avo/commit/80c1048))
162
-
163
-
164
-
165
- ## [1.1.1](https://github.com/avohq/avo/compare/1.1.0...1.1.1) (2019-02-12)
166
-
167
-
168
-
169
- # [1.1.0](https://github.com/avohq/avo/compare/1.0.1...1.1.0) (2019-02-12)
170
-
171
-
172
- ### Features
173
-
174
- * Add avo status command ([9d32c1f](https://github.com/avohq/avo/commit/9d32c1f))
175
-
176
-
177
-
178
- ## [1.0.1](https://github.com/avohq/avo/compare/1.0.0...1.0.1) (2019-01-18)
179
-
180
-
181
-
182
- # 1.0.0 (2019-01-18)