@appland/scanner 1.74.4 → 1.74.6

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,17 @@
1
+ # [@appland/scanner-v1.74.6](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.74.5...@appland/scanner-v1.74.6) (2023-01-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Scan-watching directories on other than the current drive ([8cd131a](https://github.com/getappmap/appmap-js/commit/8cd131ae99ba649a710fff1ae41ef16aa3b2d4b0))
7
+
8
+ # [@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)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Fix a bug preventing 'Update in GET request' rule from working ([efd7d60](https://github.com/getappmap/appmap-js/commit/efd7d609361e79ef51d14e07c82e99e942e0c998))
14
+
1
15
  # [@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)
2
16
 
3
17
 
@@ -48,6 +48,7 @@ const configurationProvider_1 = require("../../configuration/configurationProvid
48
48
  const telemetry_1 = __importDefault(require("../../telemetry"));
49
49
  const events_1 = __importDefault(require("events"));
50
50
  const watchScanTelemetry_1 = require("./watchScanTelemetry");
51
+ const isAncestorPath_1 = __importDefault(require("../../lib/isAncestorPath"));
51
52
  function isDir(targetPath) {
52
53
  return __awaiter(this, void 0, void 0, function* () {
53
54
  try {
@@ -68,9 +69,6 @@ function existingParent(targetPath) {
68
69
  return targetPath;
69
70
  });
70
71
  }
71
- function isAncestorPath(ancestor, descendant) {
72
- return !path_1.default.relative(ancestor, descendant).startsWith('..');
73
- }
74
72
  class Watcher {
75
73
  constructor(options) {
76
74
  this.options = options;
@@ -98,11 +96,11 @@ class Watcher {
98
96
  // If the appmap directory is a descendant of cwd, watch cwd (presumably project directory).
99
97
  // This ensures the watch will survive even if the appmap dir is removed and recreated.
100
98
  // Otherwise, make sure to use an existing directory. Chokidar struggles with missing directories.
101
- const watchDir = isAncestorPath(cwd, appmapDir) ? cwd : yield existingParent(appmapDir);
99
+ const watchDir = (0, isAncestorPath_1.default)(cwd, appmapDir) ? cwd : yield existingParent(appmapDir);
102
100
  // Custom ignore function needed to cut down the watch tree to just what we need.
103
101
  const ignored = (targetPath) => {
104
102
  // Ignore anything that isn't an ancestor or descendant of the appmap dir.
105
- if (!(isAncestorPath(targetPath, appmapDir) || isAncestorPath(appmapDir, targetPath)))
103
+ if (!((0, isAncestorPath_1.default)(targetPath, appmapDir) || (0, isAncestorPath_1.default)(appmapDir, targetPath)))
106
104
  return true;
107
105
  // Also make sure to not try to recurse down node_modules or .git
108
106
  const basename = path_1.default.basename(targetPath);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ function isAncestorPath(ancestor, descendant) {
8
+ const relative = path_1.default.relative(ancestor, descendant);
9
+ return !relative.startsWith('..') && !path_1.default.isAbsolute(relative);
10
+ }
11
+ exports.default = isAncestorPath;
@@ -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.4",
3
+ "version": "1.74.6",
4
4
  "description": "Analyze AppMaps for code flaws",
5
5
  "bin": "built/cli.js",
6
6
  "files": [