@densetsuuu/docteur 0.1.1-beta.6 → 0.2.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/build/src/profiler/loader.js +13 -3
- package/package.json +1 -1
|
@@ -11,14 +11,24 @@ import { createRequire, register } from 'node:module';
|
|
|
11
11
|
import { join } from 'node:path';
|
|
12
12
|
import { performance } from 'node:perf_hooks';
|
|
13
13
|
import { MessageChannel } from 'node:worker_threads';
|
|
14
|
-
const
|
|
14
|
+
const projectRequire = createRequire(join(process.cwd(), 'node_modules', '_'));
|
|
15
15
|
let tracingChannels = null;
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
// Try direct require first (works when @adonisjs/application is a direct dependency)
|
|
18
|
+
const adonisApp = projectRequire('@adonisjs/application');
|
|
18
19
|
tracingChannels = adonisApp.tracingChannels;
|
|
19
20
|
}
|
|
20
21
|
catch {
|
|
21
|
-
//
|
|
22
|
+
// Try to resolve through @adonisjs/core (for pnpm strict mode)
|
|
23
|
+
try {
|
|
24
|
+
const corePath = projectRequire.resolve('@adonisjs/core');
|
|
25
|
+
const coreRequire = createRequire(corePath);
|
|
26
|
+
const adonisApp = coreRequire('@adonisjs/application');
|
|
27
|
+
tracingChannels = adonisApp.tracingChannels;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// @adonisjs/application not available - provider tracing will be disabled
|
|
31
|
+
}
|
|
22
32
|
}
|
|
23
33
|
/**
|
|
24
34
|
* Module timing data collected via ESM hooks
|