Commit 5293ee6
committed
fix: properly handle import.meta.url with ESM support
Use import.meta.url to resolve SDK paths from file location instead of
process.cwd(). This ensures templates are found correctly whether kitdot
is run from source or installed as a global package.
Changes:
- Use import.meta.url with fileURLToPath to get current file directory
- Search upward from file location to find package.json with name='kitdot'
- Fallback to cwd search if file-based search fails (for test compat)
- Enable Node's experimental VM modules for Jest ESM support
- Inline TypeScript config in jest.config.cjs (remove tsconfig.test.json)
- Configure ts-jest with ES2022 module support
All 73 tests passing locally.1 parent 92a4544 commit 5293ee6
File tree
4 files changed
+41
-21
lines changed- src/utils
4 files changed
+41
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | | - | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | | - | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
17 | | - | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
30 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
31 | 57 | | |
32 | 58 | | |
33 | 59 | | |
| |||
This file was deleted.
0 commit comments