@appland/scanner 1.74.3 → 1.74.5

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [@appland/scanner-v1.74.5](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.74.4...@appland/scanner-v1.74.5) (2023-01-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fix a bug preventing 'Update in GET request' rule from working ([efd7d60](https://github.com/getappmap/appmap-js/commit/efd7d609361e79ef51d14e07c82e99e942e0c998))
7
+
8
+ # [@appland/scanner-v1.74.4](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.74.3...@appland/scanner-v1.74.4) (2023-01-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Make sure telemetry event aggregation doesn't prevent exit ([41b19ba](https://github.com/getappmap/appmap-js/commit/41b19ba27e64042b8e1b4757d41ee548c2710c9e))
14
+ * Make sure to watch the correct directory in the scanner ([8f6f96a](https://github.com/getappmap/appmap-js/commit/8f6f96a5f79d0feaf0064a7ee363e82c1b7dfe22))
15
+
1
16
  # [@appland/scanner-v1.74.3](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.74.2...@appland/scanner-v1.74.3) (2022-12-21)
2
17
 
3
18
 
@@ -92,13 +92,13 @@ class Watcher {
92
92
  this.configWatcher
93
93
  .on('add', this.reloadConfig.bind(this))
94
94
  .on('change', this.reloadConfig.bind(this));
95
- const appmapDir = path_1.default.resolve(this.options.appmapDir);
95
+ const cwd = process.cwd();
96
+ // note: sometimes path.resolve doesn't seem to use the correct cwd unless it's provided explicitly
97
+ const appmapDir = path_1.default.resolve(cwd, this.options.appmapDir);
96
98
  // If the appmap directory is a descendant of cwd, watch cwd (presumably project directory).
97
99
  // This ensures the watch will survive even if the appmap dir is removed and recreated.
98
100
  // Otherwise, make sure to use an existing directory. Chokidar struggles with missing directories.
99
- const watchDir = isAncestorPath(process.cwd(), appmapDir)
100
- ? process.cwd()
101
- : yield existingParent(appmapDir);
101
+ const watchDir = isAncestorPath(cwd, appmapDir) ? cwd : yield existingParent(appmapDir);
102
102
  // Custom ignore function needed to cut down the watch tree to just what we need.
103
103
  const ignored = (targetPath) => {
104
104
  // Ignore anything that isn't an ancestor or descendant of the appmap dir.
@@ -8,7 +8,7 @@ class EventAggregator {
8
8
  this.callback = callback;
9
9
  this.maxMsBetween = maxMsBetween;
10
10
  this.pending = [];
11
- process.on('exit', () => {
11
+ process.on('beforeExit', () => {
12
12
  if (this.timeout) {
13
13
  clearTimeout(this.timeout);
14
14
  this.emitPending();
@@ -22,7 +22,7 @@ class EventAggregator {
22
22
  refresh() {
23
23
  if (this.timeout)
24
24
  clearTimeout(this.timeout);
25
- this.timeout = setTimeout(this.emitPending.bind(this), this.maxMsBetween);
25
+ this.timeout = setTimeout(this.emitPending.bind(this), this.maxMsBetween).unref();
26
26
  }
27
27
  emitPending() {
28
28
  this.callback(this.pending);
@@ -57,6 +57,7 @@ exports.default = {
57
57
  id: 'update-in-get-request',
58
58
  title: 'Data update performed in GET or HEAD request',
59
59
  scope: 'http_server_request',
60
+ enumerateScope: true,
60
61
  labels: [Audit],
61
62
  impactDomain: 'Maintainability',
62
63
  description: (0, parseRuleDescription_1.default)('updateInGetRequest'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appland/scanner",
3
- "version": "1.74.3",
3
+ "version": "1.74.5",
4
4
  "description": "Analyze AppMaps for code flaws",
5
5
  "bin": "built/cli.js",
6
6
  "files": [