Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .snapshots/7f8b6c257a075df56e54361c8433cb48/0.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"const { tracingChannel: tr_ch_apm_tracingChannel } = require(\"diagnostics_channel\");\nconst tr_ch_apm$unitTestCjs = tr_ch_apm_tracingChannel(\"orchestrion:pkg-1:unitTestCjs\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestCjs.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestCjs.tracePromise(__apm$traced, {\n arguments,\n self: this\n });\n }\n}\nmodule.exports = Foo;\n"
"const { tracingChannel: tr_ch_apm_tracingChannel } = require(\"diagnostics_channel\");\nconst tr_ch_apm$unitTestCjs = tr_ch_apm_tracingChannel(\"orchestrion:pkg-1:unitTestCjs\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestCjs.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestCjs.tracePromise(__apm$traced, {\n arguments,\n self: this,\n moduleVersion: \"1.0.0\"\n });\n }\n}\nmodule.exports = Foo;\n"
2 changes: 1 addition & 1 deletion .snapshots/814238ad8cda0e2502409f2591339137/0.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"const { tracingChannel: tr_ch_apm_tracingChannel } = require(\"diagnostics_channel\");\nconst tr_ch_apm$unitTestCjs = tr_ch_apm_tracingChannel(\"orchestrion:pkg-1:unitTestCjs\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestCjs.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestCjs.tracePromise(__apm$traced, {\n arguments,\n self: this\n });\n }\n}\nmodule.exports = Foo;\n"
"const { tracingChannel: tr_ch_apm_tracingChannel } = require(\"diagnostics_channel\");\nconst tr_ch_apm$unitTestCjs = tr_ch_apm_tracingChannel(\"orchestrion:pkg-1:unitTestCjs\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestCjs.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestCjs.tracePromise(__apm$traced, {\n arguments,\n self: this,\n moduleVersion: \"1.0.0\"\n });\n }\n}\nmodule.exports = Foo;\n"
2 changes: 1 addition & 1 deletion .snapshots/e9d3709e54638f0a8fb975da4ec13452/0.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"import { tracingChannel as tr_ch_apm_tracingChannel } from \"diagnostics_channel\";\nconst tr_ch_apm$unitTestEsm = tr_ch_apm_tracingChannel(\"orchestrion:esm-pkg:unitTestEsm\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestEsm.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestEsm.tracePromise(__apm$traced, {\n arguments,\n self: this\n });\n }\n}\nexport default Foo;\n"
"import { tracingChannel as tr_ch_apm_tracingChannel } from \"diagnostics_channel\";\nconst tr_ch_apm$unitTestEsm = tr_ch_apm_tracingChannel(\"orchestrion:esm-pkg:unitTestEsm\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestEsm.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestEsm.tracePromise(__apm$traced, {\n arguments,\n self: this,\n moduleVersion: \"1.0.0\"\n });\n }\n}\nexport default Foo;\n"
2 changes: 1 addition & 1 deletion .snapshots/f9e55bce8f9e3f3009403bfd870b4e79/0.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"class Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTest.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTest.tracePromise(__apm$traced, {\n arguments,\n self: this\n });\n }\n}"
"class Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTest.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTest.tracePromise(__apm$traced, {\n arguments,\n self: this,\n moduleVersion: \"1.0.0\"\n });\n }\n}"
2 changes: 1 addition & 1 deletion hook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function load(url, context, nextLoad) {
const transformer = transformers.get(url)
try {
const transformedCode = transformer.transform(code.toString('utf8'), 'unknown')
result.source = transformedCode
result.source = transformedCode?.code
result.shortCircuit = true
} catch(err) {
debug('Error transforming module %s: %o', url, err)
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ModulePatch {
const transformer = self.transformers.get(filename)
try {
const transformedCode = transformer.transform(content, 'unknown')
args[0] = transformedCode
args[0] = transformedCode?.code
} catch (error) {
debug('Error transforming module %s: %o', filename, error)
} finally {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lib"
],
"dependencies": {
"@apm-js-collab/code-transformer": "^0.6.0",
"@apm-js-collab/code-transformer": "^0.7.0",
"debug": "^4.4.1",
"module-details-from-path": "^1.0.4"
},
Expand Down
Loading