@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.
@@ -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 require = createRequire(join(process.cwd(), 'node_modules', '_'));
14
+ const projectRequire = createRequire(join(process.cwd(), 'node_modules', '_'));
15
15
  let tracingChannels = null;
16
16
  try {
17
- const adonisApp = require('@adonisjs/application');
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
- // @adonisjs/application not available - provider tracing will be disabled
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@densetsuuu/docteur",
3
3
  "description": "AdonisJS cold start profiler - analyze and optimize your application boot time",
4
- "version": "0.1.1-beta.6",
4
+ "version": "0.2.0",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
7
7
  },