@ttsc/paths 0.8.0-dev.20260505 → 0.8.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/README.md +10 -12
- package/package.json +1 -1
- package/src/index.cjs +0 -4
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://github.com/samchon/ttsc/tree/master/docs)
|
|
10
10
|
[](https://discord.gg/E94XhzrUCZ)
|
|
11
11
|
|
|
12
|
-
`@ttsc/paths` rewrites source
|
|
12
|
+
`@ttsc/paths` rewrites source module specifiers that match `compilerOptions.paths` into relative JavaScript paths. TypeScript-Go carries those source AST changes into declaration emit.
|
|
13
13
|
|
|
14
14
|
## Setup
|
|
15
15
|
|
|
@@ -26,14 +26,12 @@ Open your project's `tsconfig.json`, then configure `paths`, `rootDir`, `outDir`
|
|
|
26
26
|
"compilerOptions": {
|
|
27
27
|
"paths": {
|
|
28
28
|
"@/*": ["./src/*"],
|
|
29
|
-
"@lib/*": ["./src/modules/*"]
|
|
29
|
+
"@lib/*": ["./src/modules/*"],
|
|
30
30
|
},
|
|
31
31
|
"rootDir": "src",
|
|
32
32
|
"outDir": "dist",
|
|
33
|
-
"plugins": [
|
|
34
|
-
|
|
35
|
-
]
|
|
36
|
-
}
|
|
33
|
+
"plugins": [{ "transform": "@ttsc/paths" }],
|
|
34
|
+
},
|
|
37
35
|
}
|
|
38
36
|
```
|
|
39
37
|
|
|
@@ -43,7 +41,7 @@ Run your normal `ttsc` command:
|
|
|
43
41
|
npx ttsc
|
|
44
42
|
```
|
|
45
43
|
|
|
46
|
-
An import such as `import { value } from "@lib/value"` becomes a relative JavaScript import such as `import { value } from "./modules/value.js"`. Declaration
|
|
44
|
+
An import such as `import { value } from "@lib/value"` becomes a relative JavaScript import such as `import { value } from "./modules/value.js"`. Declaration output follows the same source rewrite.
|
|
47
45
|
|
|
48
46
|
## Notes
|
|
49
47
|
|
|
@@ -53,7 +51,7 @@ No separate plugin options are required. `@ttsc/paths` reads the same `compilerO
|
|
|
53
51
|
{
|
|
54
52
|
"compilerOptions": {
|
|
55
53
|
"paths": {
|
|
56
|
-
"@lib/*": ["./src/modules/*"]
|
|
54
|
+
"@lib/*": ["./src/modules/*"],
|
|
57
55
|
},
|
|
58
56
|
"rootDir": "src",
|
|
59
57
|
"outDir": "dist",
|
|
@@ -61,11 +59,11 @@ No separate plugin options are required. `@ttsc/paths` reads the same `compilerO
|
|
|
61
59
|
// Keep lint first.
|
|
62
60
|
{ "transform": "@ttsc/lint", "config": { "no-var": "error" } },
|
|
63
61
|
|
|
64
|
-
// First-party utilities use their documented
|
|
62
|
+
// First-party utilities use their documented transform order.
|
|
65
63
|
{ "transform": "@ttsc/banner", "banner": "License MIT" },
|
|
66
64
|
{ "transform": "@ttsc/paths" },
|
|
67
|
-
{ "transform": "@ttsc/strip", "calls": ["console.log"] }
|
|
68
|
-
]
|
|
69
|
-
}
|
|
65
|
+
{ "transform": "@ttsc/strip", "calls": ["console.log"] },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
70
68
|
}
|
|
71
69
|
```
|
package/package.json
CHANGED