ttsc 0.8.0 → 0.8.1
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 +45 -7
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -20,12 +20,16 @@ A `typescript-go` toolchain for compiler-powered transforms and type-safe execut
|
|
|
20
20
|
|
|
21
21
|
## Setup
|
|
22
22
|
|
|
23
|
+
### Install
|
|
24
|
+
|
|
23
25
|
Install the native TypeScript preview package with `ttsc`:
|
|
24
26
|
|
|
25
27
|
```bash
|
|
26
28
|
npm i -D ttsc @typescript/native-preview
|
|
27
29
|
```
|
|
28
30
|
|
|
31
|
+
### Commands
|
|
32
|
+
|
|
29
33
|
Run TypeScript directly with `ttsx` (CLI command):
|
|
30
34
|
|
|
31
35
|
```bash
|
|
@@ -40,14 +44,46 @@ npx ttsc --noEmit
|
|
|
40
44
|
npx ttsc --watch
|
|
41
45
|
```
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
### Bundlers
|
|
48
|
+
|
|
49
|
+
Use `@ttsc/unplugin` when a bundler owns your build.
|
|
50
|
+
|
|
51
|
+
It runs the same `compilerOptions.plugins` that `ttsc` and `ttsx` use.
|
|
44
52
|
|
|
45
53
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
npm i -D ttsc @typescript/native-preview
|
|
55
|
+
npm i -D @ttsc/unplugin
|
|
48
56
|
```
|
|
49
57
|
|
|
50
|
-
|
|
58
|
+
Minimal Vite setup:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
// vite.config.ts
|
|
62
|
+
import ttsc from "@ttsc/unplugin/vite";
|
|
63
|
+
import { defineConfig } from "vite";
|
|
64
|
+
|
|
65
|
+
export default defineConfig({
|
|
66
|
+
plugins: [ttsc()],
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Supported bundlers:
|
|
71
|
+
|
|
72
|
+
- Vite
|
|
73
|
+
- Rollup
|
|
74
|
+
- Rolldown
|
|
75
|
+
- esbuild
|
|
76
|
+
- Webpack
|
|
77
|
+
- Rspack
|
|
78
|
+
- Next.js
|
|
79
|
+
- Farm
|
|
80
|
+
- Bun
|
|
81
|
+
|
|
82
|
+
See [`@ttsc/unplugin`](https://github.com/samchon/ttsc/tree/master/packages/unplugin) for full setup and adapter options.
|
|
83
|
+
|
|
84
|
+
## Plugins
|
|
85
|
+
|
|
86
|
+
### Configuration
|
|
51
87
|
|
|
52
88
|
Add plugin entries under `compilerOptions.plugins` in your `tsconfig.json`.
|
|
53
89
|
|
|
@@ -82,7 +118,7 @@ npx ttsx src/index.ts
|
|
|
82
118
|
|
|
83
119
|
This gives compiler-powered libraries one transform path for both build-time and runtime execution.
|
|
84
120
|
|
|
85
|
-
|
|
121
|
+
### What Is a Transform?
|
|
86
122
|
|
|
87
123
|
A transform uses TypeScript types to generate JavaScript before runtime.
|
|
88
124
|
|
|
@@ -126,7 +162,8 @@ It is transformed into dedicated JavaScript:
|
|
|
126
162
|
> __typia_transform__isTypeUint32._isTypeUint32(input.age) &&
|
|
127
163
|
> 19 < input.age &&
|
|
128
164
|
> input.age <= 100;
|
|
129
|
-
> return (input) =>
|
|
165
|
+
> return (input) =>
|
|
166
|
+
> "object" === typeof input && null !== input && _io0(input);
|
|
130
167
|
> })()({
|
|
131
168
|
> id: v4(),
|
|
132
169
|
> email: "samchon.github@gmail.com",
|
|
@@ -137,7 +174,7 @@ It is transformed into dedicated JavaScript:
|
|
|
137
174
|
|
|
138
175
|
`ttsc` applies this transform at build time; `ttsx` applies the same transform when running the file.
|
|
139
176
|
|
|
140
|
-
|
|
177
|
+
### List of Plugins
|
|
141
178
|
|
|
142
179
|
`ttsc` ships a few small utility plugins in this repository.
|
|
143
180
|
|
|
@@ -145,6 +182,7 @@ It is transformed into dedicated JavaScript:
|
|
|
145
182
|
- [`@ttsc/lint`](https://github.com/samchon/ttsc/tree/master/packages/lint): type-check + lint in one compile pass, ~20x faster than `eslint` in theory.
|
|
146
183
|
- [`@ttsc/paths`](https://github.com/samchon/ttsc/tree/master/packages/paths): rewrites source path aliases so JS and declaration emit receive relative imports.
|
|
147
184
|
- [`@ttsc/strip`](https://github.com/samchon/ttsc/tree/master/packages/strip): removes configured calls and `debugger` statements.
|
|
185
|
+
- [`@ttsc/unplugin`](https://github.com/samchon/ttsc/tree/master/packages/unplugin): runs configured `ttsc` source transforms inside bundlers supported by `unplugin`.
|
|
148
186
|
|
|
149
187
|
Plugin authors should start from the [`Guide Documents`](https://github.com/samchon/ttsc/tree/master/docs).
|
|
150
188
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ttsc",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "General-purpose TypeScript-Go compiler, plugin host, and runtime.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"homepage": "https://github.com/samchon/ttsc",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^25.3.0",
|
|
30
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
30
|
+
"@typescript/native-preview": "7.0.0-dev.20260506.1",
|
|
31
31
|
"rimraf": "^6.1.2"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@ttsc/linux-
|
|
35
|
-
"@ttsc/
|
|
36
|
-
"@ttsc/
|
|
37
|
-
"@ttsc/
|
|
38
|
-
"@ttsc/
|
|
39
|
-
"@ttsc/
|
|
40
|
-
"@ttsc/
|
|
34
|
+
"@ttsc/linux-arm": "0.8.1",
|
|
35
|
+
"@ttsc/linux-x64": "0.8.1",
|
|
36
|
+
"@ttsc/linux-arm64": "0.8.1",
|
|
37
|
+
"@ttsc/darwin-arm64": "0.8.1",
|
|
38
|
+
"@ttsc/darwin-x64": "0.8.1",
|
|
39
|
+
"@ttsc/win32-arm64": "0.8.1",
|
|
40
|
+
"@ttsc/win32-x64": "0.8.1"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"files": [
|