@appland/appmap 3.111.0 → 3.112.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.
- package/CHANGELOG.md +26 -0
- package/LICENSE.txt +25 -0
- package/built/cli.js +4 -50
- package/built/cli.js.map +1 -1
- package/built/cmds/index/index.js +92 -0
- package/built/cmds/index/index.js.map +1 -0
- package/built/cmds/index/rpcServer.js +64 -0
- package/built/cmds/index/rpcServer.js.map +1 -0
- package/built/cmds/search/search.js +172 -0
- package/built/cmds/search/search.js.map +1 -0
- package/built/cmds/search/searchAppMaps.js +13 -0
- package/built/cmds/search/searchAppMaps.js.map +1 -0
- package/built/cmds/search/searchSingleAppMap.js +19 -0
- package/built/cmds/search/searchSingleAppMap.js.map +1 -0
- package/built/fingerprint/canonicalize/parameters.js +14 -0
- package/built/fingerprint/canonicalize/parameters.js.map +1 -0
- package/built/fingerprint/canonicalize.js +1 -0
- package/built/fingerprint/canonicalize.js.map +1 -1
- package/built/fingerprint/fingerprintWatchCommand.js +4 -1
- package/built/fingerprint/fingerprintWatchCommand.js.map +1 -1
- package/built/fingerprint/fingerprinter.js +5 -1
- package/built/fingerprint/fingerprinter.js.map +1 -1
- package/built/fingerprint/globber.js.map +1 -1
- package/built/fulltext/FindAppMaps.js +117 -0
- package/built/fulltext/FindAppMaps.js.map +1 -0
- package/built/fulltext/FindEvents.js +125 -0
- package/built/fulltext/FindEvents.js.map +1 -0
- package/built/fulltext/collectParameters.js +33 -0
- package/built/fulltext/collectParameters.js.map +1 -0
- package/built/html/appmap.js +100 -92
- package/built/html/appmap.js.map +3 -3
- package/built/html/sequenceDiagram.js +100 -92
- package/built/html/sequenceDiagram.js.map +3 -3
- package/built/rpc/appmap/appmapFile.js +10 -0
- package/built/rpc/appmap/appmapFile.js.map +1 -0
- package/built/rpc/appmap/filter.js +27 -0
- package/built/rpc/appmap/filter.js.map +1 -0
- package/built/rpc/appmap/interpretFilter.js +10 -0
- package/built/rpc/appmap/interpretFilter.js.map +1 -0
- package/built/rpc/appmap/metadata.js +24 -0
- package/built/rpc/appmap/metadata.js.map +1 -0
- package/built/rpc/appmap/sequenceDiagram.js +37 -0
- package/built/rpc/appmap/sequenceDiagram.js.map +1 -0
- package/built/rpc/index/numProcessed.js +12 -0
- package/built/rpc/index/numProcessed.js.map +1 -0
- package/built/rpc/rpc.js +22 -0
- package/built/rpc/rpc.js.map +1 -0
- package/built/rpc/search/search.js +55 -0
- package/built/rpc/search/search.js.map +1 -0
- package/built/utils.js +2 -1
- package/built/utils.js.map +1 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [@appland/appmap-v3.112.0](https://github.com/getappmap/appmap-js/compare/@appland/appmap-v3.111.1...@appland/appmap-v3.112.0) (2023-11-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Refactor index command ([f9aff32](https://github.com/getappmap/appmap-js/commit/f9aff320b300b939014fff9601ceb1b86f036925))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* 'search' command ([961c4c0](https://github.com/getappmap/appmap-js/commit/961c4c0f23267833398f384ad751317e14b499f0))
|
|
12
|
+
* Add JSON-RPC interface ([c41c417](https://github.com/getappmap/appmap-js/commit/c41c417e97693014a9c37bcf0c50f4ae1bb5df37))
|
|
13
|
+
* Fetch AppMap metadata via RPC ([f81944b](https://github.com/getappmap/appmap-js/commit/f81944b47b82cb7d2271a91d3bf274df16c3f596))
|
|
14
|
+
* Include parameter names in the index ([3bab0f2](https://github.com/getappmap/appmap-js/commit/3bab0f25a0ac61eda6824fb14625191ce69519ce))
|
|
15
|
+
* JSON-RPC server ([309ca96](https://github.com/getappmap/appmap-js/commit/309ca96c3efaf94b32b7ec1e89c3c8db91106e89))
|
|
16
|
+
* RPC accepts port = 0 ([60ce4d7](https://github.com/getappmap/appmap-js/commit/60ce4d781153938ff5a2ce02d84daac9821dfe4a))
|
|
17
|
+
* RPC function to build a sequence diagram ([45f0abc](https://github.com/getappmap/appmap-js/commit/45f0abcbc45ff6aa160a2f3b7c150f947d6d86cf))
|
|
18
|
+
* Support sequence diagram format via RPC ([101ca7e](https://github.com/getappmap/appmap-js/commit/101ca7e4bf5ed0cd417b313ae37f8fec686ccec0))
|
|
19
|
+
|
|
20
|
+
# [@appland/appmap-v3.111.1](https://github.com/getappmap/appmap-js/compare/@appland/appmap-v3.111.0...@appland/appmap-v3.111.1) (2023-11-15)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* Gracefully handle filesystem symlink loops ([980e7ba](https://github.com/getappmap/appmap-js/commit/980e7baee56258aa023fa5ea11f3c3f96f035b3c))
|
|
26
|
+
|
|
1
27
|
# [@appland/appmap-v3.111.0](https://github.com/getappmap/appmap-js/compare/@appland/appmap-v3.110.0...@appland/appmap-v3.111.0) (2023-11-10)
|
|
2
28
|
|
|
3
29
|
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
|
|
2
|
+
|
|
3
|
+
Without limiting other conditions in the License, the grant of rights under the License will not include,
|
|
4
|
+
and the License does not grant to you, the right to Sell the Software.
|
|
5
|
+
|
|
6
|
+
For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties,
|
|
7
|
+
for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software),
|
|
8
|
+
a product or service whose value derives, entirely or substantially, from the functionality of the Software.
|
|
9
|
+
Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.
|
|
10
|
+
|
|
11
|
+
Software: @appland/appmap
|
|
12
|
+
|
|
13
|
+
License: MIT License
|
|
14
|
+
|
|
15
|
+
Copyright 2023, AppLand Inc
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
|
18
|
+
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
19
|
+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/built/cli.js
CHANGED
|
@@ -11,15 +11,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
const yargs = require('yargs');
|
|
14
|
-
const yaml = require('js-yaml');
|
|
15
14
|
const { promises: fsp, readFileSync } = require('fs');
|
|
16
15
|
const { queue } = require('async');
|
|
17
|
-
const readline = require('readline');
|
|
18
16
|
const { join } = require('path');
|
|
19
17
|
const models_1 = require("@appland/models");
|
|
20
18
|
const { verbose } = require('./utils');
|
|
21
|
-
const
|
|
22
|
-
const FingerprintWatchCommand = require('./fingerprint/fingerprintWatchCommand').default;
|
|
19
|
+
const IndexCommand = require('./cmds/index/index');
|
|
23
20
|
const Depends = require('./depends');
|
|
24
21
|
const install_agent_1 = __importDefault(require("./cmds/agentInstaller/install-agent"));
|
|
25
22
|
const status_1 = __importDefault(require("./cmds/agentInstaller/status"));
|
|
@@ -39,6 +36,7 @@ const CompareCommand = require('./cmds/compare/compare');
|
|
|
39
36
|
const CompareReportCommand = require('./cmds/compare-report/compareReport');
|
|
40
37
|
const InventoryCommand = require('./cmds/inventory/inventory');
|
|
41
38
|
const InventoryReportCommand = require('./cmds/inventory-report/inventoryReport');
|
|
39
|
+
const SearchCommand = require('./cmds/search/search');
|
|
42
40
|
const upload_1 = __importDefault(require("./cmds/upload"));
|
|
43
41
|
const sqlErrorLog_1 = __importDefault(require("./lib/sqlErrorLog"));
|
|
44
42
|
(0, models_1.setSQLErrorHandler)(sqlErrorLog_1.default);
|
|
@@ -116,52 +114,7 @@ yargs(process.argv.slice(2))
|
|
|
116
114
|
}
|
|
117
115
|
console.log(Array.from(new Set(values)).sort().join('\n'));
|
|
118
116
|
})
|
|
119
|
-
.command(
|
|
120
|
-
args.showHidden();
|
|
121
|
-
args.option('directory', {
|
|
122
|
-
describe: 'program working directory',
|
|
123
|
-
type: 'string',
|
|
124
|
-
alias: 'd',
|
|
125
|
-
});
|
|
126
|
-
args.option('appmap-dir', {
|
|
127
|
-
describe: 'directory to recursively inspect for AppMaps',
|
|
128
|
-
});
|
|
129
|
-
args.option('watch', {
|
|
130
|
-
describe: 'watch the directory for changes to appmaps',
|
|
131
|
-
boolean: true,
|
|
132
|
-
});
|
|
133
|
-
args.options('watch-stat-delay', {
|
|
134
|
-
type: 'number',
|
|
135
|
-
default: 10,
|
|
136
|
-
describe: 'delay between stat calls when watching, in milliseconds',
|
|
137
|
-
hidden: true,
|
|
138
|
-
});
|
|
139
|
-
return args.strict();
|
|
140
|
-
}, async (argv) => {
|
|
141
|
-
verbose(argv.verbose);
|
|
142
|
-
(0, handleWorkingDirectory_1.handleWorkingDirectory)(argv.directory);
|
|
143
|
-
const appmapDir = await (0, locateAppMapDir_1.locateAppMapDir)(argv.appmapDir);
|
|
144
|
-
if (argv.watch) {
|
|
145
|
-
const cmd = new FingerprintWatchCommand(appmapDir);
|
|
146
|
-
await cmd.execute({ statDelayMs: argv.watchDelay });
|
|
147
|
-
if (!argv.verbose && process.stdout.isTTY) {
|
|
148
|
-
process.stdout.write('\x1B[?25l');
|
|
149
|
-
const consoleLabel = 'AppMaps processed: 0';
|
|
150
|
-
process.stdout.write(consoleLabel);
|
|
151
|
-
setInterval(() => {
|
|
152
|
-
readline.cursorTo(process.stdout, consoleLabel.length - 1);
|
|
153
|
-
process.stdout.write(`${cmd.numProcessed}`);
|
|
154
|
-
}, 1000);
|
|
155
|
-
process.on('beforeExit', ( /* _code */) => {
|
|
156
|
-
process.stdout.write(`\x1B[?25h`);
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
const cmd = new FingerprintDirectoryCommand(appmapDir);
|
|
162
|
-
await cmd.execute();
|
|
163
|
-
}
|
|
164
|
-
})
|
|
117
|
+
.command(IndexCommand)
|
|
165
118
|
.command(openapi_1.default)
|
|
166
119
|
.command(install_agent_1.default)
|
|
167
120
|
.command(OpenCommand)
|
|
@@ -179,6 +132,7 @@ yargs(process.argv.slice(2))
|
|
|
179
132
|
.command(CompareReportCommand)
|
|
180
133
|
.command(InventoryCommand)
|
|
181
134
|
.command(InventoryReportCommand)
|
|
135
|
+
.command(SearchCommand)
|
|
182
136
|
.option('verbose', {
|
|
183
137
|
alias: 'v',
|
|
184
138
|
type: 'boolean',
|
package/built/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AACA,yCAAyC;AACzC,qCAAqC;AACrC,yCAAyC;AACzC,0CAA0C;AAC1C,+BAA+B;AAC/B,yCAAyC;;;;;AAEzC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AACA,yCAAyC;AACzC,qCAAqC;AACr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,CAAC,oBAAoB,CAAC;KAC7B,OAAO,CAAC,gBAAgB,CAAC;KACzB,OAAO,CAAC,sBAAsB,CAAC;KAC/B,OAAO,CAAC,aAAa,CAAC;KACtB,MAAM,CAAC,SAAS,EAAE;IACjB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,0BAA0B;CACxC,CAAC;KACD,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IACxB,IAAI,GAAG,EAAE;QACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAClB;SAAM,IAAI,GAAG,EAAE;QACd,IAAI,GAAG,CAAC,KAAK,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC1B;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;KACF;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;KACD,MAAM,EAAE;KACR,aAAa,EAAE;KACf,IAAI,EAAE,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
7
|
+
const readline_1 = __importDefault(require("readline"));
|
|
8
|
+
const fingerprintDirectoryCommand_1 = __importDefault(require("../../fingerprint/fingerprintDirectoryCommand"));
|
|
9
|
+
const fingerprintWatchCommand_1 = __importDefault(require("../../fingerprint/fingerprintWatchCommand"));
|
|
10
|
+
const handleWorkingDirectory_1 = require("../../lib/handleWorkingDirectory");
|
|
11
|
+
const locateAppMapDir_1 = require("../../lib/locateAppMapDir");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const console_1 = require("console");
|
|
14
|
+
const numProcessed_1 = require("../../rpc/index/numProcessed");
|
|
15
|
+
const search_1 = require("../../rpc/search/search");
|
|
16
|
+
const filter_1 = __importDefault(require("../../rpc/appmap/filter"));
|
|
17
|
+
const metadata_1 = __importDefault(require("../../rpc/appmap/metadata"));
|
|
18
|
+
const sequenceDiagram_1 = __importDefault(require("../../rpc/appmap/sequenceDiagram"));
|
|
19
|
+
const rpcServer_1 = __importDefault(require("./rpcServer"));
|
|
20
|
+
exports.command = 'index';
|
|
21
|
+
exports.describe = 'Compute fingerprints and update index files for all appmaps in a directory';
|
|
22
|
+
const builder = (args) => {
|
|
23
|
+
args.showHidden();
|
|
24
|
+
args.option('directory', {
|
|
25
|
+
describe: 'program working directory',
|
|
26
|
+
type: 'string',
|
|
27
|
+
alias: 'd',
|
|
28
|
+
});
|
|
29
|
+
args.option('appmap-dir', {
|
|
30
|
+
describe: 'directory to recursively inspect for AppMaps',
|
|
31
|
+
});
|
|
32
|
+
args.option('watch', {
|
|
33
|
+
describe: 'watch the directory for changes to appmaps',
|
|
34
|
+
boolean: true,
|
|
35
|
+
alias: 'w',
|
|
36
|
+
});
|
|
37
|
+
args.option('port', {
|
|
38
|
+
describe: 'port to listen on for JSON-RPC requests',
|
|
39
|
+
type: 'number',
|
|
40
|
+
alias: 'p',
|
|
41
|
+
});
|
|
42
|
+
args.options('watch-stat-delay', {
|
|
43
|
+
type: 'number',
|
|
44
|
+
default: 10,
|
|
45
|
+
describe: 'delay between stat calls when watching, in milliseconds',
|
|
46
|
+
hidden: true,
|
|
47
|
+
});
|
|
48
|
+
return args.strict();
|
|
49
|
+
};
|
|
50
|
+
exports.builder = builder;
|
|
51
|
+
const handler = async (argv) => {
|
|
52
|
+
(0, utils_1.verbose)(argv.verbose);
|
|
53
|
+
(0, handleWorkingDirectory_1.handleWorkingDirectory)(argv.directory);
|
|
54
|
+
const appmapDir = await (0, locateAppMapDir_1.locateAppMapDir)(argv.appmapDir);
|
|
55
|
+
const { watchStatDelay, watch, port } = argv;
|
|
56
|
+
const runServer = watch || port !== undefined;
|
|
57
|
+
if (port && !watch)
|
|
58
|
+
(0, console_1.warn)(`Note: --port option implies --watch`);
|
|
59
|
+
if (runServer) {
|
|
60
|
+
(0, console_1.log)(`Running indexer in watch mode`);
|
|
61
|
+
const cmd = new fingerprintWatchCommand_1.default(appmapDir);
|
|
62
|
+
await cmd.execute(watchStatDelay);
|
|
63
|
+
if (port !== undefined) {
|
|
64
|
+
const rpcMethods = [
|
|
65
|
+
(0, numProcessed_1.numProcessed)(cmd),
|
|
66
|
+
(0, search_1.search)(appmapDir),
|
|
67
|
+
(0, filter_1.default)(),
|
|
68
|
+
(0, metadata_1.default)(),
|
|
69
|
+
(0, sequenceDiagram_1.default)(),
|
|
70
|
+
];
|
|
71
|
+
const rpcServer = new rpcServer_1.default(port, rpcMethods);
|
|
72
|
+
rpcServer.start();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (!argv.verbose && process.stdout.isTTY) {
|
|
76
|
+
process.stdout.write('\x1B[?25l');
|
|
77
|
+
const consoleLabel = 'AppMaps processed: 0';
|
|
78
|
+
process.stdout.write(consoleLabel);
|
|
79
|
+
setInterval(() => {
|
|
80
|
+
readline_1.default.cursorTo(process.stdout, consoleLabel.length - 1);
|
|
81
|
+
process.stdout.write(`${cmd.numProcessed}`);
|
|
82
|
+
}, 1000);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const cmd = new fingerprintDirectoryCommand_1.default(appmapDir);
|
|
88
|
+
await cmd.execute();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
exports.handler = handler;
|
|
92
|
+
//# sourceMappingURL=index.js.map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E;oBACf,kBAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBAC3D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;gBAC9C,CAAC,EAAE,IAAI,CAAC,CAAC;aACV;SACF;KACF;SAAM;QACL,MAAM,GAAG,GAAG,IAAI,qCAA2B,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;KACrB;AACH,CAAC,CAAC;AAxCW,QAAA,OAAO,WAwClB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 jayson_1 = __importDefault(require("jayson"));
|
|
7
|
+
const console_1 = require("console");
|
|
8
|
+
const rpc_1 = require("../../rpc/rpc");
|
|
9
|
+
const assert_1 = __importDefault(require("assert"));
|
|
10
|
+
function handlerMiddleware(name, handler) {
|
|
11
|
+
return async (args, callback) => {
|
|
12
|
+
(0, console_1.warn)(`Handling JSON-RPC request for ${name} (${JSON.stringify(args)})`);
|
|
13
|
+
try {
|
|
14
|
+
callback(null, await handler(args));
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
let error;
|
|
18
|
+
if (err instanceof rpc_1.RpcError) {
|
|
19
|
+
error = err;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
error = new rpc_1.RpcError(500, rpc_1.RpcError.errorMessage(err));
|
|
23
|
+
}
|
|
24
|
+
callback(error);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
class RPCServer {
|
|
29
|
+
constructor(port, rpcHandlers) {
|
|
30
|
+
this.rpcHandlers = rpcHandlers;
|
|
31
|
+
this.bindPort = port;
|
|
32
|
+
}
|
|
33
|
+
start() {
|
|
34
|
+
(0, assert_1.default)(this.server === undefined, 'RPC server already started');
|
|
35
|
+
const rpcMethods = this.rpcHandlers.reduce((acc, handler) => {
|
|
36
|
+
acc[handler.name] = handlerMiddleware(handler.name, handler.handler);
|
|
37
|
+
return acc;
|
|
38
|
+
}, {});
|
|
39
|
+
(0, console_1.log)(`Available JSON-RPC methods: ${Object.keys(rpcMethods).sort().join(', ')}`);
|
|
40
|
+
(0, console_1.warn)(`Consult @appland/rpc for request and response data types.`);
|
|
41
|
+
this.server = new jayson_1.default.Server(rpcMethods).http();
|
|
42
|
+
this.server.listen(this.bindPort).on('listening', () => {
|
|
43
|
+
(0, assert_1.default)(this.server);
|
|
44
|
+
const address = this.server.address();
|
|
45
|
+
if (address === null) {
|
|
46
|
+
throw new Error(`Failed to listen on port ${this.port} (address is null)`);
|
|
47
|
+
}
|
|
48
|
+
else if (typeof address === 'string') {
|
|
49
|
+
(0, console_1.log)(`Running JSON-RPC server on: ${address}`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.port = address.port;
|
|
53
|
+
(0, console_1.log)(`Running JSON-RPC server on port: ${this.port}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
stop() {
|
|
58
|
+
if (this.server) {
|
|
59
|
+
this.server.close();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = RPCServer;
|
|
64
|
+
//# sourceMappingURL=rpcServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcServer.js","sourceRoot":"","sources":["../../../src/cmds/index/rpcServer.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4C;AAC5C,qCAAoC;AAEpC,uCAAkE;AAClE,oDAA4B;AAE5B,SAAS,iBAAiB,CACxB,IAAY,EACZ,OAAkD;IAElD,OAAO,KAAK,E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AAC,MAAM,GAAG,IAAI,gBAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YACrD,IAAA,gBAAM,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACtC,IAAI,OAAO,KAAK,IAAI,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,IAAI,oBAAoB,CAAC,CAAC;aAC5E;iBAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;gBACtC,IAAA,aAAG,EAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;aAC/C;iBAAM;gBACL,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACzB,IAAA,aAAG,EAAC,oCAAoC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;aACtD;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;SACrB;IACH,CAAC;CACF;AAzCD,4BAyCC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
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
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
7
|
+
const assert_1 = __importDefault(require("assert"));
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const promises_1 = require("fs/promises");
|
|
10
|
+
const models_1 = require("@appland/models");
|
|
11
|
+
const handleWorkingDirectory_1 = require("../../lib/handleWorkingDirectory");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const locateAppMapDir_1 = require("../../lib/locateAppMapDir");
|
|
14
|
+
const searchSingleAppMap_1 = __importDefault(require("./searchSingleAppMap"));
|
|
15
|
+
const searchAppMaps_1 = __importDefault(require("./searchAppMaps"));
|
|
16
|
+
const openers_1 = require("../open/openers");
|
|
17
|
+
exports.command = 'search <query>';
|
|
18
|
+
exports.describe = 'Search AppMaps, or a single AppMap, for search matches to a full-text query.';
|
|
19
|
+
const builder = (args) => {
|
|
20
|
+
args.positional('query', {
|
|
21
|
+
describe: 'full-text query',
|
|
22
|
+
type: 'string',
|
|
23
|
+
demandOption: true,
|
|
24
|
+
});
|
|
25
|
+
args.option('directory', {
|
|
26
|
+
describe: 'program working directory',
|
|
27
|
+
type: 'string',
|
|
28
|
+
alias: 'd',
|
|
29
|
+
});
|
|
30
|
+
args.option('find-events', {
|
|
31
|
+
describe: 'find events within AppMap search results',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
});
|
|
34
|
+
args.option('context-depth', {
|
|
35
|
+
describe: 'depth of call stack context to include around search matches',
|
|
36
|
+
type: 'number',
|
|
37
|
+
default: 2,
|
|
38
|
+
});
|
|
39
|
+
args.option('appmap', {
|
|
40
|
+
describe: 'AppMap to search',
|
|
41
|
+
type: 'string',
|
|
42
|
+
alias: 'a',
|
|
43
|
+
});
|
|
44
|
+
args.option('max-results', {
|
|
45
|
+
describe: 'maximum number of search results to return',
|
|
46
|
+
type: 'number',
|
|
47
|
+
});
|
|
48
|
+
args.option('max-size', {
|
|
49
|
+
describe: 'prune AppMap to a maximum size before searching (used only with --appmap option)',
|
|
50
|
+
type: 'string',
|
|
51
|
+
});
|
|
52
|
+
args.option('filter', {
|
|
53
|
+
describe: 'serialized AppMap filter to apply to the AppMap (used only with --appmap option)',
|
|
54
|
+
type: 'string',
|
|
55
|
+
});
|
|
56
|
+
args.option('show', {
|
|
57
|
+
describe: 'open AppMaps in a visual tool such as VSCode or the browser',
|
|
58
|
+
boolean: false,
|
|
59
|
+
});
|
|
60
|
+
args.option('format', {
|
|
61
|
+
describe: 'output format to use for printing the output. json: JSON serialization of the search results. appmap: AppMap data focused on the search results (only available with --appmap or --find-events options)',
|
|
62
|
+
choices: ['json', 'appmap'],
|
|
63
|
+
default: 'json',
|
|
64
|
+
alias: 'f',
|
|
65
|
+
});
|
|
66
|
+
return args.strict();
|
|
67
|
+
};
|
|
68
|
+
exports.builder = builder;
|
|
69
|
+
const handler = async (argv) => {
|
|
70
|
+
(0, utils_1.verbose)(argv.verbose);
|
|
71
|
+
const { directory, query, appmap, contextDepth, show, maxResults, findEvents, format } = argv;
|
|
72
|
+
(0, handleWorkingDirectory_1.handleWorkingDirectory)(directory);
|
|
73
|
+
function printResultsJSON(response) {
|
|
74
|
+
console.log(JSON.stringify(response, null, 2));
|
|
75
|
+
}
|
|
76
|
+
async function printResultsAppMap(response) {
|
|
77
|
+
if (response.type === 'appmap')
|
|
78
|
+
throw new Error(`Cannot output appmap format for appmap search results`);
|
|
79
|
+
const { results } = response;
|
|
80
|
+
const fqidsByAppMap = new Map();
|
|
81
|
+
for (const result of results) {
|
|
82
|
+
const fqids = fqidsByAppMap.get(result.appmap) || [];
|
|
83
|
+
fqids.push(result.fqid);
|
|
84
|
+
fqidsByAppMap.set(result.appmap, fqids);
|
|
85
|
+
}
|
|
86
|
+
const filterAppMap = (appmapId) => {
|
|
87
|
+
const fqids = fqidsByAppMap.get(appmapId);
|
|
88
|
+
(0, assert_1.default)(fqids);
|
|
89
|
+
const appmap = (0, models_1.buildAppMap)()
|
|
90
|
+
.source((0, fs_1.readFileSync)(appmapId + '.appmap.json', 'utf-8'))
|
|
91
|
+
.build();
|
|
92
|
+
const filter = new models_1.AppMapFilter();
|
|
93
|
+
filter.declutter.context.on = true;
|
|
94
|
+
filter.declutter.context.names = fqids;
|
|
95
|
+
filter.declutter.context.depth = contextDepth;
|
|
96
|
+
return filter.filter(appmap, []);
|
|
97
|
+
};
|
|
98
|
+
const appmaps = new Array();
|
|
99
|
+
let count = 0;
|
|
100
|
+
const sanitize = (str) => str.replace(/[^a-zA-Z0-9]/g, '_').slice(0, 100);
|
|
101
|
+
// const outputDir = `.appmap/search-results/${sanitize(query)}`;
|
|
102
|
+
for (const appmapId of fqidsByAppMap.keys()) {
|
|
103
|
+
const filteredAppMap = filterAppMap(appmapId);
|
|
104
|
+
if (show) {
|
|
105
|
+
const appmapFile = `${sanitize(query)}_${count}.appmap.json`;
|
|
106
|
+
await (0, promises_1.writeFile)(appmapFile, JSON.stringify(filteredAppMap, null, 2));
|
|
107
|
+
await (0, openers_1.openInBrowser)(appmapFile, false);
|
|
108
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
appmaps.push(filteredAppMap);
|
|
112
|
+
}
|
|
113
|
+
count += 1;
|
|
114
|
+
}
|
|
115
|
+
if (appmaps.length > 0)
|
|
116
|
+
console.log(JSON.stringify(appmaps));
|
|
117
|
+
}
|
|
118
|
+
async function presentResults(response) {
|
|
119
|
+
if (format === 'json') {
|
|
120
|
+
printResultsJSON(response);
|
|
121
|
+
}
|
|
122
|
+
else if (format === 'appmap') {
|
|
123
|
+
await printResultsAppMap(response);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
throw new Error(`Unknown format: ${format}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (appmap) {
|
|
130
|
+
const options = {
|
|
131
|
+
maxResults,
|
|
132
|
+
};
|
|
133
|
+
const { maxSize, filter: filterStr } = argv;
|
|
134
|
+
if (maxSize)
|
|
135
|
+
options.maxSize = maxSize;
|
|
136
|
+
if (filterStr)
|
|
137
|
+
options.filter = (0, models_1.deserializeFilter)(filterStr);
|
|
138
|
+
const response = await (0, searchSingleAppMap_1.default)(appmap, query, options);
|
|
139
|
+
await presentResults(response);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const options = {
|
|
143
|
+
maxResults,
|
|
144
|
+
};
|
|
145
|
+
const appmapDir = await (0, locateAppMapDir_1.locateAppMapDir)();
|
|
146
|
+
const response = await (0, searchAppMaps_1.default)(appmapDir, query, options);
|
|
147
|
+
if (findEvents) {
|
|
148
|
+
const eventOptions = { maxResults };
|
|
149
|
+
const { maxSize, filter: filterStr } = argv;
|
|
150
|
+
if (maxSize)
|
|
151
|
+
eventOptions.maxSize = maxSize;
|
|
152
|
+
if (filterStr)
|
|
153
|
+
eventOptions.filter = (0, models_1.deserializeFilter)(filterStr);
|
|
154
|
+
const { results } = response;
|
|
155
|
+
let eventResults = new Array();
|
|
156
|
+
for (const result of results) {
|
|
157
|
+
const response = await (0, searchSingleAppMap_1.default)(result.appmap, query, options);
|
|
158
|
+
eventResults.push(...response.results);
|
|
159
|
+
}
|
|
160
|
+
const numResults = eventResults.length;
|
|
161
|
+
eventResults.sort((a, b) => b.score - a.score);
|
|
162
|
+
if (eventResults.length > maxResults)
|
|
163
|
+
eventResults = eventResults.slice(0, maxResults);
|
|
164
|
+
await presentResults({ type: 'event', numResults: numResults, results: eventResults });
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
await presentResults(response);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
exports.handler = handler;
|
|
172
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/cmds/search/search.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAC5B,2BAAkC;AAClC,0CAAwC;AACxC,4CAAuF;AAEvF,6EAA0E;AAC1E,uCAAsC;AACtC,+DAA4D;AAC5D,8EAAgG;AAChG,oEAAqF;AAMrF,6CAAgD;AAEnC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAC3B,QAAA,QAAQ,GACnB,8EAA8E,CAAC;AAE1E,MAAM,OAAO,GAAG,CAAC,IAAgB,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od.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const FindAppMaps_1 = __importDefault(require("../../fulltext/FindAppMaps"));
|
|
7
|
+
async function searchAppMaps(appmapDir, query, options = {}) {
|
|
8
|
+
const findAppMaps = new FindAppMaps_1.default(appmapDir);
|
|
9
|
+
await findAppMaps.initialize();
|
|
10
|
+
return findAppMaps.search(query, { maxResults: options.maxResults });
|
|
11
|
+
}
|
|
12
|
+
exports.default = searchAppMaps;
|
|
13
|
+
//# sourceMappingURL=searchAppMaps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchAppMaps.js","sourceRoot":"","sources":["../../../src/cmds/search/searchAppMaps.ts"],"names":[],"mappings":";;;;;AAAA,6EAAyE;AAM1D,KAAK,UAAU,aAAa,CACzC,SAAiB,EACjB,KAAa,EACb,UAAyB,EAAE;IAE3B,MAAM,WAAW,GAAG,IAAI,qBAAW,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,WAAW,CAAC,UAAU,EAAE,CAAC;IAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AACvE,CAAC;AARD,gCAQC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 FindEvents_1 = __importDefault(require("../../fulltext/FindEvents"));
|
|
7
|
+
async function searchSingleAppMap(appmap, query, options = {}) {
|
|
8
|
+
if (appmap.endsWith('.appmap.json'))
|
|
9
|
+
appmap = appmap.slice(0, -'.appmap.json'.length);
|
|
10
|
+
const findEvents = new FindEvents_1.default(appmap);
|
|
11
|
+
if (options.maxSize)
|
|
12
|
+
findEvents.maxSize = options.maxSize;
|
|
13
|
+
if (options.filter)
|
|
14
|
+
findEvents.filter = options.filter;
|
|
15
|
+
await findEvents.initialize();
|
|
16
|
+
return findEvents.search(query, { maxResults: options.maxResults });
|
|
17
|
+
}
|
|
18
|
+
exports.default = searchSingleAppMap;
|
|
19
|
+
//# sourceMappingURL=searchSingleAppMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchSingleAppMap.js","sourceRoot":"","sources":["../../../src/cmds/search/searchSingleAppMap.ts"],"names":[],"mappings":";;;;;AACA,2EAAuE;AAQxD,KAAK,UAAU,kBAAkB,CAC9C,MAAc,EACd,KAAa,EACb,UAAyB,EAAE;IAE3B,IAAI,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;QAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAEtF,MAAM,UAAU,GAAG,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,OAAO,CAAC,OAAO;QAAE,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAC1D,IAAI,OAAO,CAAC,MAAM;QAAE,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IACvD,MAAM,UAAU,CAAC,UAAU,EAAE,CAAC;IAC9B,OAAO,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AACtE,CAAC;AAZD,qCAYC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable class-methods-use-this */
|
|
3
|
+
const Unique = require('./unique');
|
|
4
|
+
const { collectParameters } = require('../../fulltext/collectParameters');
|
|
5
|
+
class Canonicalize extends Unique {
|
|
6
|
+
functionCall(event) {
|
|
7
|
+
return collectParameters(event);
|
|
8
|
+
}
|
|
9
|
+
httpServerRequest(event) {
|
|
10
|
+
return collectParameters(event);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
module.exports = (appmap) => new Canonicalize(appmap).execute();
|
|
14
|
+
//# sourceMappingURL=parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/fingerprint/canonicalize/parameters.js"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACnC,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAE1E,MAAM,YAAa,SAAQ,MAAM;IAC/B,YAAY,CAAC,KAAK;QAChB,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,iBAAiB,CAAC,KAAK;QACrB,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC"}
|
|
@@ -11,6 +11,7 @@ const algorithms = {
|
|
|
11
11
|
packageDependencies: require('./canonicalize/packageDependencies'),
|
|
12
12
|
sqlNormalized: require('./canonicalize/sqlNormalized'),
|
|
13
13
|
sqlTables: require('./canonicalize/sqlTables'),
|
|
14
|
+
parameters: require('./canonicalize/parameters'),
|
|
14
15
|
};
|
|
15
16
|
/* eslint-enable global-require */
|
|
16
17
|
function httpServerRequestsOnly(appmap) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize.js","sourceRoot":"","sources":["../../src/fingerprint/canonicalize.js"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,MAAM,UAAU,GAAG;IACjB,iBAAiB,EAAE,OAAO,CAAC,kCAAkC,CAAC;IAC9D,OAAO,EAAE,OAAO,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AAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,iBAAiB,EAAE;YAC7C,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;SACtD;QAED,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE;YACrC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC5B;QAED,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,KAAK,CAAC,kBAAkB,EAAE;YAChD,sBAAsB,CAAC,GAAG,EAAE,CAAC;SAC9B;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/B,2DAA2D;QAC3D,OAAO,MAAM,CAAC;KACf;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC;IACtC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,aAAa,EAAE,MAAM;IACzC,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,uCAAuC,aAAa,EAAE,CAAC,CAAC;KACzE;IAED,qFAAqF;IACrF,sFAAsF;IACtF,uFAAuF;IACvF,sFAAsF;IACtF,yBAAyB;IACzB,OAAO,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,UAAU;IACV,YAAY;CACb,CAAC"}
|
|
@@ -186,7 +186,10 @@ class FingerprintWatchCommand {
|
|
|
186
186
|
const watchReady = new Promise((r) => { var _a; return (_a = this.watcher) === null || _a === void 0 ? void 0 : _a.once('ready', r); });
|
|
187
187
|
this.watcher.add(glob);
|
|
188
188
|
await watchReady;
|
|
189
|
-
|
|
189
|
+
const globberOptions = {};
|
|
190
|
+
if (statDelayMs)
|
|
191
|
+
globberOptions.statDelayMs = statDelayMs;
|
|
192
|
+
this.poller = new globber_1.default(glob, globberOptions)
|
|
190
193
|
.on('add', this.added.bind(this))
|
|
191
194
|
.on('change', this.changed.bind(this))
|
|
192
195
|
.on('unlink', this.removed.bind(this));
|