@appland/appmap-agent-js
Advanced tools
Comparing version 11.2.0 to 11.3.0
@@ -1,3 +0,2 @@ | ||
const Module = require("module"); | ||
const { copyFileSync, readFileSync, realpathSync } = require("fs"); | ||
const { renameSync, realpathSync, existsSync, symlinkSync } = require("fs"); | ||
const { | ||
@@ -11,37 +10,17 @@ extname: getExtension, | ||
// https://github.com/nodejs/node/blob/2cc7a91a5d855b4ff78f21f1bb8d4e55131d0615/lib/internal/modules/run_main.js | ||
// TODO this prevents the original runMain to suppport --preserve-symlinks-main | ||
const { runMain } = Module; | ||
const readFileMaybe = (path) => { | ||
try { | ||
return readFileSync(path, "utf8"); | ||
} catch (error) { | ||
if (error.code === "ENOENT") { | ||
return null; | ||
} else { | ||
throw error; | ||
} | ||
const path = realpathSync(process.argv[1]); | ||
const directory = getDirectory(path); | ||
const extension = getExtension(path); | ||
const basename = getBasename(path, extension); | ||
if (extension === "" || extension === ".node") { | ||
const modified_path = joinPath(directory, `${basename}.cjs`); | ||
if (existsSync(modified_path)) { | ||
throw new Error( | ||
"Unable to solve the file extension issue of ESM loader -- see: https://github.com/nodejs/node/issues/41465", | ||
); | ||
} | ||
}; | ||
Module.runMain = function executeUserEntryPoint(main = process.argv[1]) { | ||
// TODO this prevents the original runMain to suppport --preserve-symlinks-main | ||
const path = realpathSync(main); | ||
const directory = getDirectory(path); | ||
const extension = getExtension(path); | ||
const basename = getBasename(path, extension); | ||
if (extension === "" || extension === ".node") { | ||
const modified_path = joinPath(directory, `${basename}.cjs`); | ||
const maybe_content = readFileMaybe(modified_path); | ||
if (maybe_content === null) { | ||
copyFileSync(path, modified_path); | ||
} else if (readFileSync(path, "utf8") !== maybe_content) { | ||
throw new Error( | ||
"Unable to solve the file extension issue of ESM loader -- see: https://github.com/nodejs/node/issues/41465", | ||
); | ||
} | ||
return runMain(modified_path); | ||
} else { | ||
return runMain(path); | ||
} | ||
}; | ||
renameSync(path, modified_path); | ||
symlinkSync(modified_path, path, "file"); | ||
} |
{ | ||
"name": "@appland/appmap-agent-js", | ||
"version": "11.2.0", | ||
"version": "11.3.0", | ||
"bin": { | ||
@@ -29,4 +29,4 @@ "appmap-agent-js": "bin/appmap-agent-js" | ||
"scripts": { | ||
"pre-build": "node build/await/index.mjs", | ||
"build": "node build/index.mjs", | ||
"prepare": "npm run build", | ||
"build": "node build/await/index.mjs && node build/index.mjs", | ||
"lint": "npx eslint '**/*.@(mjs|js|cjs)'", | ||
@@ -51,3 +51,3 @@ "test-unit-cov": "npx test-turtle --layout alongside -- /bin/sh test/unit/test-cov.sh", | ||
"ajv-error-tree": "0.0.5", | ||
"escodegen": "^2.0.0", | ||
"astring": "^1.8.3", | ||
"glob": "^7.2.0", | ||
@@ -60,2 +60,3 @@ "klaw-sync": "^6.0.0", | ||
"semver": "^7.3.5", | ||
"source-map": "^0.6.1", | ||
"treeify": "^1.1.0", | ||
@@ -80,3 +81,2 @@ "yaml": "^1.10.2" | ||
"sinon": "^12.0.1", | ||
"source-map": "^0.6.1", | ||
"sqlite3": "^5.0.2", | ||
@@ -83,0 +83,0 @@ "tap": "^15.0.10", |
@@ -194,3 +194,3 @@ # appmap-agent-js reference | ||
### `appmap.recordBeginBundle()` | ||
<!-- ### `appmap.recordBeginBundle()` | ||
@@ -249,3 +249,3 @@ * Returns `recordEndBundle()` | ||
Same type signature as `appmap.recordServerResponse` but without `route` property. Note that this method records a jump whereas `appmap.recordServerResponse` records a bundle. | ||
Same type signature as `appmap.recordServerResponse` but without `route` property. Note that this method records a jump whereas `appmap.recordServerResponse` records a bundle. --> | ||
@@ -338,2 +338,3 @@ ## Configuration | ||
* `esm <boolean>` Indicates whether native modules should be instrumented to record function applications. *Default*: `true` for the CLI and `false` for the API. | ||
* `eval <boolean> | <String[]>` Defines the call expressions that should be considered as eval calls. More precisely, if a call expression has an identitifier as callee whose name appears in `hooks.eval` then its first argument will be instrumented as an `eval` code. `true` is a shorthand for `["eval"]` and `false` is a shorthand for `[]`. *Default*: `false`. | ||
* `group <boolean>` Indicates whether asynchronous resources should be monitored to infer causality link between events. This provides more accurate appmaps but comes at the price of performance overhead. *Default*: `true`. | ||
@@ -348,10 +349,10 @@ * `http <boolean>` Indicates whether [`http`](https://nodejs.org/api/http.html) should be monkey patched to monitor http traffic. *Default*: `true`. | ||
* `pruning <boolean>` Remove elements of the classmap which did not trigger any function application event. *Default*: `true`. | ||
* `serialization <object>` Serialization options. Many options focus on defining how agressive the serialization should be. Pure serialization is faster and avoid disturbing the flow of the observed application but is less detailled than impure serialization. | ||
* `maximum-print-length <number> | null` the maximum length of the string representation of runtime values before being truncated. `null` indicates no limitation. *Default* `100`. | ||
* `serialization <object>` Serialization options. Many options focus on defining how aggressive the serialization should be. Pure serialization is faster and avoids disturbing the flow of the observed application but is less detailed than impure serialization. | ||
* `maximum-print-length <number> | null` the maximum length of the string representation of values before being truncated. `null` indicates no limitation. *Default* `100`. | ||
* `maximum-properties-length <number> | null` the maximum of amount of properties serialized for hash objects. Objects are considered as hashes if their prototype is either `null` or `Object.prototype`. `null` indicates no limitation. *Default* `10`. | ||
* `impure-printing <boolean>` indicates whether to use a pure printing algorithm or not. For instance, an object can be printed either using `Object.prototype.toString.call(object)` which is pure or `object.toString()` which is impure. *Default* `true`. | ||
* `impure-constructor-naming <boolean>` indicates whether the constructor name should be retrieved using `Object.prototype.toString.call(object)` which is pure or using `object.constructor.name` which is impure. *Default* `true`. | ||
* `impure-array-inspection <boolean>` indicates whether the length of an array should be retreived which is an impure operation. *Default* `true`. | ||
* `impure-array-inspection <boolean>` indicates whether the length of an array should be retrieved which is an impure operation. *Default* `true`. | ||
* `impure-error-inspection <boolean>` indicates whether the message and stack of an error should be retrieved which is an impure operation. *Default* `true`. | ||
* `impure-hash-inspection <boolean>` indicates whether the message and stack of an error should be retrieved which is an impure operation. *Default* `true`. | ||
* `impure-hash-inspection <boolean>` indicates whether the properties of an hash object should be inspected which is an impure operation. *Default* `true`. | ||
* `hidden-identifier <string>` The prefix of hidden variables used by the agent. The instrumentation will fail if variables from the program under recording starts with this prefix. *Default*: `"APPMAP"`. | ||
@@ -358,0 +359,0 @@ * `function-name-placeholder <string>` The placeholder name for classmap function elements. *Default* `"()"`. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
516556
19
180
12895
18
+ Addedastring@^1.8.3
+ Addedsource-map@^0.6.1
+ Addedastring@1.9.0(transitive)
- Removedescodegen@^2.0.0
- Removedescodegen@2.1.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@5.3.0(transitive)
- Removedesutils@2.0.3(transitive)