@tsonic/express 10.0.35 → 10.0.39

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 CHANGED
@@ -6,6 +6,12 @@ This package is part of Tsonic: https://tsonic.org.
6
6
 
7
7
  Use this package to write Express-like apps in TypeScript and compile them to native binaries with `tsonic`.
8
8
 
9
+ The project surface should be `@tsonic/js`. `@tsonic/express` remains a normal imported package, but its public API is JS-facing:
10
+
11
+ - `Date`, `Uint8Array`, `number`
12
+ - `Record<string, ...>` and arrays
13
+ - no CLR collection/runtime types in the TS-facing contract
14
+
9
15
  ## Prerequisites
10
16
 
11
17
  - Install the .NET 10 SDK (required by Tsonic): https://dotnet.microsoft.com/download
@@ -15,7 +21,7 @@ Use this package to write Express-like apps in TypeScript and compile them to na
15
21
 
16
22
  ```bash
17
23
  mkdir my-api && cd my-api
18
- npx --yes tsonic@latest init
24
+ npx --yes tsonic@latest init --surface @tsonic/js
19
25
 
20
26
  # Install Express runtime + bindings (installs required ASP.NET Core deps too)
21
27
  npx --yes tsonic@latest add npm @tsonic/express
@@ -2,6 +2,8 @@
2
2
 
3
3
  This package reflects the `express-clr` runtime behavior.
4
4
 
5
+ The TS-facing contract is JS-native even though the runtime implementation is CLR-backed. That means some deviations are about runtime semantics, not about leaking CLR types into authored TypeScript.
6
+
5
7
  Authoritative deviations live in:
6
8
 
7
9
  - `../express-clr/docs/deviations.md`
@@ -16,5 +18,6 @@ Key current items:
16
18
  6. Cookie signing/signed-cookie behavior is best-effort, not a full `cookie-parser` edge-case clone.
17
19
  7. Handler dispatch in runtime is reflection-free; unsupported delegate signatures are ignored instead of reflection invocation.
18
20
  8. Runtime JSON support is reflection-free and guarantees primitives, dictionaries, arrays/lists, and `JsonElement`/`JsonDocument` shapes. Arbitrary CLR object/anonymous-object reflection serialization is intentionally not provided.
21
+ 9. Public package types intentionally use JS-native shapes (`Date`, `Uint8Array`, `Record<string, ...>`, `number`, `Promise<...>`) even when the runtime uses validated CLR backing types internally.
19
22
 
20
23
  Deviations should shrink over time and are validated through the runtime test matrix in `express-clr`.
@@ -2,6 +2,12 @@
2
2
 
3
3
  This repository publishes generated TypeScript bindings for `express-clr`.
4
4
 
5
+ The generated package is intentionally JS-facing:
6
+
7
+ - JS-surface ambient types come from `@tsonic/js`
8
+ - `@tsonic/express` stays a normal package
9
+ - generated `.d.ts` must not leak CLR collection/runtime types
10
+
5
11
  ## Prerequisites
6
12
 
7
13
  - `../express-clr` exists and is built in `Release`.
@@ -28,8 +34,10 @@ Equivalent script:
28
34
  2. Cleans `versions/<major>/` generated output.
29
35
  3. Builds `tsbindgen` in `Release`.
30
36
  4. Generates bindings from `express-clr` assembly.
31
- 5. Copies `README.md` and `LICENSE`.
32
- 6. Prunes output to package-focused files:
37
+ 5. Post-processes the generated declarations into a JS-native surface.
38
+ 6. Syncs package metadata and runtime package version.
39
+ 7. Copies `README.md` and `LICENSE`.
40
+ 8. Prunes output to package-focused files:
33
41
  - `index.d.ts`
34
42
  - `index.js`
35
43
  - `index/bindings.json`
@@ -39,6 +47,8 @@ Equivalent script:
39
47
  - `README.md`
40
48
  - `LICENSE`
41
49
 
50
+ Post-processing is not optional. It is part of the contract: the published package must expose JS-native types (`Date`, `Uint8Array`, `Record<string, ...>`, `number`, `Promise<...>`) rather than raw CLR/tsbindgen internals.
51
+
42
52
  ## Environment Overrides
43
53
 
44
54
  - `DOTNET_HOME`
package/docs/release.md CHANGED
@@ -5,16 +5,31 @@ This repo publishes one package per .NET major under `versions/<major>/`.
5
5
  ## .NET 10 Release Steps
6
6
 
7
7
  1. Ensure `express-clr` changes are merged and pulled to `main`.
8
- 2. Regenerate bindings:
8
+ 2. Run the publish gate:
9
+
10
+ ```bash
11
+ npm run selftest
12
+ ```
13
+
14
+ This gate must pass before publish. It covers:
15
+
16
+ - `dotnet test` in `express-clr`
17
+ - `dotnet pack` in `express-clr`
18
+ - regeneration in this repo
19
+ - README/doc checks
20
+ - generated-surface contract checks
21
+ - JS-surface E2E from `tsonic init --surface @tsonic/js`
22
+
23
+ 3. Regenerate bindings if needed:
9
24
 
10
25
  ```bash
11
26
  npm run generate:10
12
27
  ```
13
28
 
14
- 3. Review generated diffs in `versions/10/`.
15
- 4. Update `versions/10/package.json` version if needed.
16
- 5. Validate package metadata and README.
17
- 6. Publish:
29
+ 4. Review generated diffs in `versions/10/`.
30
+ 5. Update `versions/10/package.json` version if needed.
31
+ 6. Validate package metadata and README.
32
+ 7. Publish:
18
33
 
19
34
  ```bash
20
35
  npm run publish:10
@@ -35,3 +50,4 @@ npm i @tsonic/express@10
35
50
 
36
51
  - Runtime behavior changes belong to `express-clr`.
37
52
  - This repo should only contain generated API/package-facing artifacts and docs.
53
+ - JS-surface correctness is part of the publish contract, not a best-effort property.
package/families.json CHANGED
@@ -47,5 +47,12 @@
47
47
  "minArity": 1,
48
48
  "maxArity": 6,
49
49
  "isDelegate": false
50
+ },
51
+ "Tsonic.Runtime.Union": {
52
+ "stem": "Union",
53
+ "namespace": "Tsonic.Runtime",
54
+ "minArity": 2,
55
+ "maxArity": 8,
56
+ "isDelegate": false
50
57
  }
51
58
  }