@appland/appmap 3.133.0 → 3.134.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 +13 -0
- package/built/cmds/index/index.js +3 -3
- package/built/cmds/index/index.js.map +1 -1
- package/built/cmds/index/rpc.js +18 -7
- package/built/cmds/index/rpc.js.map +1 -1
- package/built/cmds/navie/help.js +122 -0
- package/built/cmds/navie/help.js.map +1 -0
- package/built/docs/CLA Instructions.pdf +0 -0
- package/built/docs/Code of Conduct for Contributors.pdf +0 -0
- package/built/docs/analysis/rules-reference.html +27 -0
- package/built/docs/appmap-overview.md +54 -0
- package/built/docs/community.md +27 -0
- package/built/docs/diagrams/dependency-map.md +63 -0
- package/built/docs/diagrams/flamegraph.md +91 -0
- package/built/docs/diagrams/how-it-works.md +60 -0
- package/built/docs/diagrams/index.md +20 -0
- package/built/docs/diagrams/sequence-diagram.md +75 -0
- package/built/docs/diagrams/trace-view.md +55 -0
- package/built/docs/guides/configuring-analysis.md +157 -0
- package/built/docs/guides/handling-large-appmaps.md +43 -0
- package/built/docs/guides/index.md +17 -0
- package/built/docs/guides/openapi.md +104 -0
- package/built/docs/guides/reading-sql-in-appmaps.md +67 -0
- package/built/docs/guides/refine-appmaps.md +186 -0
- package/built/docs/guides/reverse-engineering.md +375 -0
- package/built/docs/guides/runtime-code-review.md +108 -0
- package/built/docs/integrations/atlassian-compass.md +24 -0
- package/built/docs/integrations/atlassian-confluence.md +50 -0
- package/built/docs/integrations/docker.md +108 -0
- package/built/docs/integrations/github-actions.md +24 -0
- package/built/docs/integrations/index.md +17 -0
- package/built/docs/integrations/plantuml.md +65 -0
- package/built/docs/integrations/postman.md +29 -0
- package/built/docs/integrations/readme.md +38 -0
- package/built/docs/integrations/smartbear-swaggerhub.md +125 -0
- package/built/docs/navie/bring-your-own-key.md +98 -0
- package/built/docs/navie/demo.md +49 -0
- package/built/docs/navie/how-navie-works.md +26 -0
- package/built/docs/navie/how-to-use-navie.md +152 -0
- package/built/docs/navie/index.md +20 -0
- package/built/docs/reference/analysis-labels.md +48 -0
- package/built/docs/reference/analysis-rules.md +60 -0
- package/built/docs/reference/appmap-agent-js.md +215 -0
- package/built/docs/reference/appmap-client-cli.md +527 -0
- package/built/docs/reference/appmap-gradle-plugin.md +140 -0
- package/built/docs/reference/appmap-java.md +310 -0
- package/built/docs/reference/appmap-maven-plugin.md +163 -0
- package/built/docs/reference/appmap-node.md +185 -0
- package/built/docs/reference/appmap-python.md +395 -0
- package/built/docs/reference/appmap-ruby.md +514 -0
- package/built/docs/reference/github-action.md +164 -0
- package/built/docs/reference/index.md +23 -0
- package/built/docs/reference/jetbrains.md +119 -0
- package/built/docs/reference/license-key-install.md +73 -0
- package/built/docs/reference/remote-recording-api.md +97 -0
- package/built/docs/reference/uninstalling-appmap.md +109 -0
- package/built/docs/reference/vscode.md +125 -0
- package/built/docs/setup-appmap-in-ci/example-projects.md +20 -0
- package/built/docs/setup-appmap-in-ci/how-it-works.md +42 -0
- package/built/docs/setup-appmap-in-ci/in-circleci.md +422 -0
- package/built/docs/setup-appmap-in-ci/in-github-actions.md +176 -0
- package/built/docs/setup-appmap-in-ci/index.md +21 -0
- package/built/docs/setup-appmap-in-ci/matrix-builds.md +224 -0
- package/built/docs/setup-appmap-in-ci/troubleshooting.md +70 -0
- package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +43 -0
- package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +76 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-from-tests.md +92 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-remote-recording.md +111 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-request-recording.md +79 -0
- package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +165 -0
- package/built/docs/setup-appmap-in-your-code-editor/index.md +23 -0
- package/built/docs/setup-appmap-in-your-code-editor/navigating-appmaps.md +58 -0
- package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +66 -0
- package/built/docs/unused_for_now_index.html +11 -0
- package/built/rpc/appmap/stats.js +1 -1
- package/built/rpc/appmap/stats.js.map +1 -1
- package/built/rpc/explain/explain.js +6 -1
- package/built/rpc/explain/explain.js.map +1 -1
- package/built/rpc/explain/navie/navie-local.js +6 -2
- package/built/rpc/explain/navie/navie-local.js.map +1 -1
- package/built/rpc/explain/navie/navie-remote.js +5 -1
- package/built/rpc/explain/navie/navie-remote.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Reference
|
|
4
|
+
toc: true
|
|
5
|
+
reference: true
|
|
6
|
+
name: AppMap Agent for JavaScript (legacy)
|
|
7
|
+
step: 8
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AppMap Agent for JavaScript (legacy)
|
|
11
|
+
|
|
12
|
+
**Note**: this agent is no longer in active development. For Node.js applications you should migrate to [appmap-node](/docs/reference/appmap-node). [Let](/docs/community) [us](/contact) [know](https://github.com/getappmap/appmap-node/issues)
|
|
13
|
+
if in your project `appmap-node` doesn't work while `appmap-agent-js` does.
|
|
14
|
+
|
|
15
|
+
- [AppMap Agent for JavaScript](#appmap-agent-for-javascript)
|
|
16
|
+
- [About](#about)
|
|
17
|
+
- [Supported versions](#supported-versions)
|
|
18
|
+
- [Installation](#installation)
|
|
19
|
+
- [Configuration](#configuration)
|
|
20
|
+
- [Tests recording](#tests-recording)
|
|
21
|
+
- [Recording mocha test cases:](#recording-mocha-test-cases)
|
|
22
|
+
- [Recording jest test cases:](#recording-jest-test-cases)
|
|
23
|
+
- [Remote recording](#remote-recording)
|
|
24
|
+
- [Process recording](#process-recording)
|
|
25
|
+
- [`appmap-agent-js` parameters](#appmap-agent-js-parameters)
|
|
26
|
+
- [Example](#example)
|
|
27
|
+
- [System Properties](#system-properties)
|
|
28
|
+
- [Viewing AppMaps](#viewing-appmaps)
|
|
29
|
+
- [GitHub repository](#github-repository)
|
|
30
|
+
|
|
31
|
+
## About
|
|
32
|
+
|
|
33
|
+
`appmap-agent-js` is a JavaScript package for recording [AppMaps](https://github.com/getappmap/appmap) of your code.
|
|
34
|
+
|
|
35
|
+
{% include docs/what_is_appmap_snippet.md %}
|
|
36
|
+
|
|
37
|
+
### Supported versions
|
|
38
|
+
|
|
39
|
+
{% include docs/javascript_support_matrix.html %}
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
Run this command in your Node.js project folder (where `package.json` is located):
|
|
44
|
+
```sh
|
|
45
|
+
npx @appland/appmap@latest install
|
|
46
|
+
```
|
|
47
|
+
{: .example-code}
|
|
48
|
+
|
|
49
|
+
You will be guided through a series of steps for installing and configuring the agent.
|
|
50
|
+
|
|
51
|
+
{% include docs/install_appmap_extension.md %}
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
When you run your program, the agent reads configuration settings from `appmap.yml`.
|
|
56
|
+
The `install` command creates a default `appmap.yml` file by scanning the project directories.
|
|
57
|
+
We recommend that you review the generated `appmap.yml` file and confirm your application name
|
|
58
|
+
and a list of directories that will be recorded.
|
|
59
|
+
|
|
60
|
+
Here's a sample configuration file for a typical JavaScript project:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
# 'name' should generally be the same as the code repo name.
|
|
64
|
+
name: MyApp
|
|
65
|
+
packages:
|
|
66
|
+
- path: src/server/controllers
|
|
67
|
+
- path: src/server/data
|
|
68
|
+
- path: src/server/models
|
|
69
|
+
- path: src/server/routes
|
|
70
|
+
- path: src/server/lib
|
|
71
|
+
shallow: true
|
|
72
|
+
exclude:
|
|
73
|
+
- src/server/lib/util
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- **name** Provides the project name (required)
|
|
77
|
+
- **packages** A list of packages, classes and methods which should be
|
|
78
|
+
instrumented.
|
|
79
|
+
|
|
80
|
+
**packages**
|
|
81
|
+
|
|
82
|
+
Each entry in the `packages` list is a YAML object which has the following keys:
|
|
83
|
+
|
|
84
|
+
- **path** A path to JavaScript sources files
|
|
85
|
+
- **For projects with JavaScript source maps**: add paths to sources to be recorded. For example:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
name: MyApp
|
|
89
|
+
packages:
|
|
90
|
+
- path: src/server/controllers
|
|
91
|
+
- path: src/server/routes
|
|
92
|
+
```
|
|
93
|
+
{: .example-code}
|
|
94
|
+
|
|
95
|
+
- **For projects without JavaScript source maps**: include build folders. For example:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
name: MyApp
|
|
99
|
+
packages:
|
|
100
|
+
- path: dist/controllers
|
|
101
|
+
- path: dist/routes
|
|
102
|
+
```
|
|
103
|
+
{: .example-code}
|
|
104
|
+
|
|
105
|
+
- **exclude** A list of sub-packages, sub-classes and sub-methods that will be ignored. The
|
|
106
|
+
exclude list only applies to the `path` specified in the same package entry.
|
|
107
|
+
- **shallow** When set to `true`, only the first function call entry into a package will be recorded. Subsequent function calls within
|
|
108
|
+
the same package are not recorded unless code execution leaves the package and re-enters it. Default: `false`.
|
|
109
|
+
|
|
110
|
+
## Tests recording
|
|
111
|
+
|
|
112
|
+
When running test cases with the agent attached to the JavaScript engine, a new
|
|
113
|
+
AppMap file will be created for each unique test case.
|
|
114
|
+
|
|
115
|
+
### Recording mocha test cases:
|
|
116
|
+
|
|
117
|
+
1. Run `appmap-agent-js` with the `mocha` command and its parameters following the `--` delimiter.
|
|
118
|
+
For example:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
npx appmap-agent-js -- mocha 'test/**/*.ts'
|
|
122
|
+
```
|
|
123
|
+
{: .example-code}
|
|
124
|
+
|
|
125
|
+
1. `appmap-agent-js` will run the tests. When the tests are complete, the AppMaps will be stored
|
|
126
|
+
in the default output directory `tmp/appmap/mocha`.
|
|
127
|
+
|
|
128
|
+
### Recording jest test cases:
|
|
129
|
+
|
|
130
|
+
1. Run `appmap-agent-js` with the `jest` command and its parameters following the `--` delimiter.
|
|
131
|
+
For example:
|
|
132
|
+
```sh
|
|
133
|
+
npx appmap-agent-js -- jest 'test/**/*.ts'
|
|
134
|
+
```
|
|
135
|
+
{: .example-code}
|
|
136
|
+
1. `appmap-agent-js` will run the tests. When the tests are complete, the AppMaps will be stored
|
|
137
|
+
in the default output directory `tmp/appmap/jest`.
|
|
138
|
+
|
|
139
|
+
## Remote recording
|
|
140
|
+
|
|
141
|
+
`appmap-agent-js` supports the [AppMap remote recording API](/docs/reference/remote-recording-api).
|
|
142
|
+
This functionality is provided by the AppMap agent. It will hook an existing HTTP engine,
|
|
143
|
+
serving HTTP requests to toggle recording on and off.
|
|
144
|
+
|
|
145
|
+
**Note** Your application must be using Express.js (directly or indirectly) for remote recording to work. Express.js is requried because AppMap injects its [control routes](/docs/reference/remote-recording-api) into the Express.js middleware stack. Express-based frameworks such as Nest.js will work, as long as they are using Express under the hood.
|
|
146
|
+
|
|
147
|
+
1. Run `appmap-agent-js` with the `--recorder=remote` argument, the application-starting command, and its parameters following the `--` delimiter. For example:
|
|
148
|
+
```sh
|
|
149
|
+
npx appmap-agent-js --recorder=remote -- node app/main.js --param1 hello --param2=world
|
|
150
|
+
```
|
|
151
|
+
{: .example-code}
|
|
152
|
+
2. `appmap-agent-js` will start the app and inject itself in its http stack. It will listen for [remote recording requests](/docs/reference/remote-recording-api) on all http ports of the application.
|
|
153
|
+
3. Start the remote recording:
|
|
154
|
+
- [in VS Code](/docs/reference/vscode.html#remote-recording)
|
|
155
|
+
- [in JetBrains IDEs](/docs/reference/jetbrains.html#remote-recording)
|
|
156
|
+
- [with curl](/docs/reference/remote-recording-api)
|
|
157
|
+
4. Interact with your application or service to exercise code included in `appmap.yml`
|
|
158
|
+
5. Stop the recording and save the new AppMap to disk.
|
|
159
|
+
|
|
160
|
+
## Process recording
|
|
161
|
+
|
|
162
|
+
`appmap-agent-js` can record an entire JavaScript process tree from start to finish.
|
|
163
|
+
|
|
164
|
+
Run the `appmap-agent-js` command and give it an argument for starting your application and an argument for starting process recording.
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
npx appmap-agent-js --command="put the command to start your app here" --recorder=process
|
|
168
|
+
```
|
|
169
|
+
{: .example-code}
|
|
170
|
+
|
|
171
|
+
Then interact with your app using its UI or API, and AppMaps will be generated automatically. You will see them appear in the 'AppMaps' tab in the left sidebar and on the 'Explore AppMaps' page of the instructions.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
## `appmap-agent-js` parameters
|
|
175
|
+
|
|
176
|
+
The most frequently used `appmap-agent-js` parameters are:
|
|
177
|
+
- `--recorder=[mocha|jest|remote|process]` : process recorder
|
|
178
|
+
- default recorder is inferred from the starting command:
|
|
179
|
+
- `mocha` if the the command contains `mocha`
|
|
180
|
+
- `jest` if the the command contains `jest`
|
|
181
|
+
- `process` in all other cases
|
|
182
|
+
- `mocha` and `jest` recorders record AppMaps from test cases automatically
|
|
183
|
+
- `remote` recorder has to be started and stopped manually with http requests
|
|
184
|
+
- `process` recorder records entire processes automatically, from start to finish
|
|
185
|
+
- `--command="_start command_"` : alternate method of specifying the app- or tests-starting command, wrapped in quotes
|
|
186
|
+
- `--log-level=[debug|info|warning|error]` : defaults to `info`
|
|
187
|
+
- `--log-file=_file_` : defaults to `stderr`
|
|
188
|
+
- `--output-dir=_directory_` : location of recorded AppMap files, default is `tmp/appmap/<recorder>` -- eg: `tmp/appmap/mocha`
|
|
189
|
+
- `--help` prints out help message to stdout
|
|
190
|
+
- `--version` installed version
|
|
191
|
+
|
|
192
|
+
### Example
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
npx appmap-agent-js --log-level=error --recorder=remote -- node built/app.js
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## System Properties
|
|
199
|
+
|
|
200
|
+
- `APPMAP_CONFIGURATION_PATH` Path to the `appmap.yml` config file. Default:
|
|
201
|
+
_appmap.yml_
|
|
202
|
+
- `APPMAP_REPOSITORY_DIRECTORY` Path to the project's local git folder. Default: .
|
|
203
|
+
|
|
204
|
+
## Viewing AppMaps
|
|
205
|
+
|
|
206
|
+
Recorded AppMap are saved as `.appmap.json` files in the project folders (default location: `tmp/appmap`.)
|
|
207
|
+
|
|
208
|
+
Follow the documentation for your IDE to open the recorded `.appmap.json` files:
|
|
209
|
+
- [in VS Code](/docs/reference/vscode)
|
|
210
|
+
- [in JetBrains IDEs](/docs/reference/jetbrains)
|
|
211
|
+
|
|
212
|
+
## GitHub repository
|
|
213
|
+
|
|
214
|
+
[https://github.com/getappmap/appmap-agent-js](https://github.com/getappmap/appmap-agent-js)
|
|
215
|
+
|