@appland/scanner 1.71.1 → 1.71.2

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,10 @@
1
+ # [@appland/scanner-v1.71.2](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.71.1...@appland/scanner-v1.71.2) (2022-10-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Use default configuration timestamp in scan --watch if none provided ([3d246f2](https://github.com/getappmap/appmap-js/commit/3d246f2b350af2dd14a097519ea9af6fe410e543))
7
+
1
8
  # [@appland/scanner-v1.71.1](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.71.0...@appland/scanner-v1.71.1) (2022-10-04)
2
9
 
3
10
 
@@ -94,7 +94,6 @@ class Watcher {
94
94
  scan(mtimePath) {
95
95
  return __awaiter(this, void 0, void 0, function* () {
96
96
  (0, assert_1.default)(this.config, `config should always be loaded before appmapWatcher triggers a scan`);
97
- (0, assert_1.default)(this.configTime);
98
97
  const appmapFile = mtimePath.replace(/\/mtime$/, '.appmap.json');
99
98
  const reportFile = mtimePath.replace(/mtime$/, 'appmap-findings.json');
100
99
  const [appmapStats, reportStats] = yield Promise.all([appmapFile, reportFile].map((f) => (0, promises_1.stat)(f).catch(() => null)));
@@ -102,7 +101,7 @@ class Watcher {
102
101
  return;
103
102
  if (reportStats &&
104
103
  reportStats.mtimeMs > appmapStats.mtimeMs &&
105
- reportStats.mtimeMs > this.configTime)
104
+ reportStats.mtimeMs > this.config.timestampMs)
106
105
  return; // report is up to date
107
106
  const scanner = yield (0, scanner_1.default)(true, this.config, [appmapFile]);
108
107
  const rawScanResults = yield scanner.scan();
@@ -113,7 +112,6 @@ class Watcher {
113
112
  reloadConfig() {
114
113
  return __awaiter(this, void 0, void 0, function* () {
115
114
  this.config = yield (0, configurationProvider_1.parseConfigFile)(this.options.configFile);
116
- this.configTime = (yield (0, promises_1.stat)(this.options.configFile)).mtimeMs;
117
115
  });
118
116
  }
119
117
  }
@@ -211,10 +211,12 @@ function parseConfigFile(configPath) {
211
211
  configPath = (0, path_1.join)(__dirname, '../sampleConfig/default.yml');
212
212
  }
213
213
  console.log(`Using scanner configuration file ${configPath}`);
214
+ const timestampMs = (yield fs_1.promises.stat(configPath)).mtimeMs;
214
215
  const yamlConfig = yield fs_1.promises.readFile(configPath, 'utf-8');
215
- return js_yaml_1.default.load(yamlConfig, {
216
+ const config = js_yaml_1.default.load(yamlConfig, {
216
217
  filename: configPath,
217
218
  });
219
+ return Object.assign(Object.assign({}, config), { timestampMs });
218
220
  });
219
221
  }
220
222
  exports.parseConfigFile = parseConfigFile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appland/scanner",
3
- "version": "1.71.1",
3
+ "version": "1.71.2",
4
4
  "description": "",
5
5
  "bin": "built/cli.js",
6
6
  "files": [