@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.
Files changed (3) hide show
  1. package/README.md +10 -12
  2. package/package.json +1 -1
  3. package/src/index.cjs +0 -4
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://github.com/samchon/ttsc/tree/master/docs)
10
10
  [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
11
11
 
12
- `@ttsc/paths` rewrites source and declaration module specifiers that match `compilerOptions.paths` into relative JavaScript paths.
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
- { "transform": "@ttsc/paths" }
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 imports are rewritten with the same path rule.
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 source/emit hook order.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/paths",
3
- "version": "0.8.0-dev.20260505",
3
+ "version": "0.8.0",
4
4
  "description": "First-party ttsc plugin that rewrites emitted module specifiers from tsconfig paths.",
5
5
  "main": "src/index.cjs",
6
6
  "exports": {
package/src/index.cjs CHANGED
@@ -8,9 +8,5 @@ module.exports = function createTtscPaths() {
8
8
  name: "@ttsc/paths",
9
9
  source: path.resolve(__dirname, "..", "plugin"),
10
10
  stage: "transform",
11
- hooks: {
12
- source: true,
13
- declaration: true,
14
- },
15
11
  };
16
12
  };