@tsonic/tsbindgen 0.7.20 → 0.7.22
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 +57 -0
- package/lib/tsbindgen.dll +0 -0
- package/package.json +1 -1
- package/lib/cs/System.CommandLine.resources.dll +0 -0
- package/lib/de/System.CommandLine.resources.dll +0 -0
- package/lib/es/System.CommandLine.resources.dll +0 -0
- package/lib/fr/System.CommandLine.resources.dll +0 -0
- package/lib/it/System.CommandLine.resources.dll +0 -0
- package/lib/ja/System.CommandLine.resources.dll +0 -0
- package/lib/ko/System.CommandLine.resources.dll +0 -0
- package/lib/pl/System.CommandLine.resources.dll +0 -0
- package/lib/pt-BR/System.CommandLine.resources.dll +0 -0
- package/lib/ru/System.CommandLine.resources.dll +0 -0
- package/lib/tr/System.CommandLine.resources.dll +0 -0
- package/lib/tsbindgen +0 -0
- package/lib/tsbindgen.pdb +0 -0
- package/lib/zh-Hans/System.CommandLine.resources.dll +0 -0
- package/lib/zh-Hant/System.CommandLine.resources.dll +0 -0
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@ npx tsbindgen generate -a ./MyLibrary.dll -d $DOTNET_RUNTIME -o ./my-lib --lib .
|
|
|
78
78
|
| Command | Description |
|
|
79
79
|
|---------|-------------|
|
|
80
80
|
| `generate` | Generate TypeScript declarations from .NET assemblies |
|
|
81
|
+
| `resolve-closure` | Resolve transitive assembly dependency closure (JSON) |
|
|
81
82
|
|
|
82
83
|
### Generate Options
|
|
83
84
|
|
|
@@ -85,6 +86,7 @@ npx tsbindgen generate -a ./MyLibrary.dll -d $DOTNET_RUNTIME -o ./my-lib --lib .
|
|
|
85
86
|
|--------|-------|-------------|---------|
|
|
86
87
|
| `--assembly` | `-a` | Path to assembly file(s) to process | - |
|
|
87
88
|
| `--assembly-dir` | `-d` | Directory containing .NET runtime assemblies | - |
|
|
89
|
+
| `--ref-dir` | - | Additional directory to search for referenced assemblies (repeatable) | - |
|
|
88
90
|
| `--out-dir` | `-o` | Output directory for generated files | `out` |
|
|
89
91
|
| `--namespaces` | `-n` | Namespace filter (reserved; currently ignored) | (all) |
|
|
90
92
|
| `--naming` | - | Naming convention: `js` (camelCase) or `clr` (PascalCase) | `clr` |
|
|
@@ -95,12 +97,29 @@ npx tsbindgen generate -a ./MyLibrary.dll -d $DOTNET_RUNTIME -o ./my-lib --lib .
|
|
|
95
97
|
| `--logs` | - | Enable specific log categories (repeatable; space-separated values) | - |
|
|
96
98
|
| `--strict` | - | Enable strict mode validation | false |
|
|
97
99
|
|
|
100
|
+
### resolve-closure
|
|
101
|
+
|
|
102
|
+
Machine-readable dependency resolution for one or more seed assemblies. Useful for:
|
|
103
|
+
- Debugging missing dependencies before generation
|
|
104
|
+
- Tooling integrations (e.g. build systems) that need deterministic closure resolution
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx tsbindgen resolve-closure \
|
|
108
|
+
-a ./MyLibrary.dll \
|
|
109
|
+
--ref-dir $DOTNET_RUNTIME \
|
|
110
|
+
--ref-dir ./libs
|
|
111
|
+
```
|
|
112
|
+
|
|
98
113
|
### Examples
|
|
99
114
|
|
|
100
115
|
```bash
|
|
101
116
|
# Generate BCL with JavaScript naming
|
|
102
117
|
npx tsbindgen generate -d $DOTNET_RUNTIME -o ./out --naming js
|
|
103
118
|
|
|
119
|
+
# Generate a custom assembly when dependencies live outside the runtime directory
|
|
120
|
+
npx tsbindgen generate -a ./MyLibrary.dll -d $DOTNET_RUNTIME -o ./out \
|
|
121
|
+
--ref-dir ./libs
|
|
122
|
+
|
|
104
123
|
# Verbose output with specific log categories
|
|
105
124
|
npx tsbindgen generate -d $DOTNET_RUNTIME -o ./out -v --logs ImportPlanner FacadeEmitter
|
|
106
125
|
|
|
@@ -132,6 +151,44 @@ output/
|
|
|
132
151
|
└── metadata.json
|
|
133
152
|
```
|
|
134
153
|
|
|
154
|
+
### Publishing Bindings Packages (dist/ + npm `exports`)
|
|
155
|
+
|
|
156
|
+
When you publish bindings for your own assemblies (or generate them inside an npm workspace), you can keep generated artifacts out of git by writing them under `dist/` and exposing the facades via npm `exports`:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
dist/tsonic/bindings/
|
|
160
|
+
Acme.Domain.js
|
|
161
|
+
Acme.Domain.d.ts
|
|
162
|
+
Acme.Domain/
|
|
163
|
+
bindings.json
|
|
164
|
+
internal/
|
|
165
|
+
index.d.ts
|
|
166
|
+
metadata.json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`package.json`:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"type": "module",
|
|
174
|
+
"exports": {
|
|
175
|
+
"./package.json": "./package.json",
|
|
176
|
+
"./*.js": {
|
|
177
|
+
"types": "./dist/tsonic/bindings/*.d.ts",
|
|
178
|
+
"default": "./dist/tsonic/bindings/*.js"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Consumers can then import CLR namespaces ergonomically:
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
import { TodoItem } from "@acme/domain/Acme.Domain.js";
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Tsonic resolves the import using Node’s module resolution (including `exports`) and locates the nearest `bindings.json` for CLR discovery.
|
|
191
|
+
|
|
135
192
|
### Output Files
|
|
136
193
|
|
|
137
194
|
| File | Description |
|
package/lib/tsbindgen.dll
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/tsbindgen
DELETED
|
Binary file
|
package/lib/tsbindgen.pdb
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|