fix: Use correct version resolution (like src/server.ts) in the tracing state#113
Conversation
Greptile SummaryThis PR replaces the
Confidence Score: 5/5Safe to merge — the single-file change aligns The change removes a CJS-style shim in favour of a native ESM import assertion already proven to work in No files require special attention.
|
| Filename | Overview |
|---|---|
| src/trace/state.ts | Replaces CJS-style createRequire hack for reading package.json with a proper ESM import assertion, matching the pattern already used in src/server.ts. Path depth is correct for the file's location. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["src/trace/state.ts"] -->|"import pkg from '../../package.json'\nwith { type: 'json' }"| B["package.json\n(version: 3.5.0)"]
B --> C["pkg.version → libraryVersion"]
C --> D["createTraceSession()\nevent: context-options\nlibraryVersion field"]
E["src/server.ts"] -->|"import pkg from '../package.json'\nwith { type: 'json' }"| B
style A fill:#d4edda,stroke:#28a745
style E fill:#cce5ff,stroke:#004085
Reviews (1): Last reviewed commit: "fix: Use correct version resolution (lik..." | Re-trigger Greptile
Proposed changes
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers