getappmap/appmap-node

Mapping "archive" command doesn't include a top-level command function in the AppMap

kgilpin opened this issue · 4 comments

npx appmap-node node ./built/cli.js archive

I'm expecting to see the archive command at the root of the AppMap.

2024-01-17T15_16_04.479Z.appmap.json

appmap.yml.zip

Do you mean the handler here? https://github.com/getappmap/appmap-js/blob/ad1903178c2f321f1078a4131acd1ba7516d7d95/packages/cli/src/cmds/archive/archive.ts#L110

We're only capturing functions currently; this was kind of a deliberate in the hope of skipping some cruft utility functions. Do you think we should expand to named const lambdas? (Perhaps top-level only?)

IMO hooking a const lambda is only necessary if it’s exported. I guess I can see why this is missing from the map. I forgot that the yargs mechanism is kind of weird.

I believe this is resolved, since we are now capturing lambdas as well. This is captured as "handler" in the AppMap.

image

I believe this is resolved, since we are now capturing lambdas as well. This is captured as "handler" in the AppMap.

Yup, thanks for the triage! Fixed by #109