Commit 5ab8cce
committed
refactor: derive project root in config.ts from __dirname
Replace the hardcoded `../../package.json` lookup with a
layout-aware project-root resolution that works for both the
source tree (modules/) and the compiled output (dist/modules/).
The new helper detects the `dist/modules/` shape and walks up
one extra level; otherwise it falls back to the parent of
__dirname, which matches the previous behaviour for source.
No behavioural change under the current tsconfig (rootDir: "."
with outDir: "./dist" produces dist/modules/config.js, where
both the old and new expressions resolve to the same path).
The refactor future-proofs the lookup against a `rootDir:
"modules"` change that would otherwise break version reads
from the compiled bundle.1 parent cb7ff3c commit 5ab8cce
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
105 | | - | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| |||
0 commit comments