@tsonic/nodejs 10.0.41 → 10.0.44

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
@@ -37,11 +37,10 @@ npm run dev
37
37
  ## Existing project
38
38
 
39
39
  ```bash
40
- npx --yes tsonic@latest init --surface @tsonic/js
41
40
  npx --yes tsonic@latest add npm @tsonic/nodejs
42
41
  ```
43
42
 
44
- `@tsonic/nodejs` is a regular package, not a surface. Use `@tsonic/js` for the ambient JavaScript world, and add `@tsonic/nodejs` when you want `node:*` module imports.
43
+ `@tsonic/nodejs` is a regular package, not a surface. Use `@tsonic/js` for the ambient JavaScript world, and add `@tsonic/nodejs` when you want `node:*` module imports. If your workspace is still on CLR, switch its `surface` to `@tsonic/js` first.
45
44
 
46
45
  ## Versioning
47
46
 
@@ -49,7 +48,13 @@ This repo is versioned by runtime major:
49
48
 
50
49
  - `10` → `versions/10/` → npm: `@tsonic/nodejs@10.x`
51
50
 
52
- When publishing, run: `npm publish versions/10 --access public`
51
+ Before publishing, run `npm run selftest`.
52
+
53
+ Publish with:
54
+
55
+ ```bash
56
+ npm run publish:10
57
+ ```
53
58
 
54
59
  ## Core Modules (what you get)
55
60
 
@@ -90,10 +95,10 @@ emitter.on("data", (chunk) => console.log(chunk));
90
95
  ### Crypto
91
96
 
92
97
  ```ts
93
- import { randomUUID } from "node:crypto";
98
+ import { createHash } from "node:crypto";
94
99
 
95
- const id = randomUUID();
96
- void id;
100
+ const hash = createHash("sha256").update("hello").digest("hex");
101
+ void hash;
97
102
  ```
98
103
 
99
104
  ### Process
@@ -108,7 +113,14 @@ void cwd;
108
113
  ### HTTP
109
114
 
110
115
  ```typescript
111
- import { http } from "@tsonic/nodejs/nodejs.Http.js";
116
+ import { createServer } from "node:http";
117
+
118
+ const server = createServer((_req, res) => {
119
+ res.writeHead(200, "OK");
120
+ res.end("Hello from Tsonic!");
121
+ });
122
+
123
+ void server;
112
124
  ```
113
125
 
114
126
  ## Imports (important)
@@ -120,10 +132,6 @@ For JS-surface projects with `@tsonic/nodejs` installed, prefer Node-style impor
120
132
 
121
133
  Direct ESM imports from `@tsonic/nodejs/index.js` are still supported.
122
134
 
123
- `node:http` is currently not mapped by the surface alias set; use:
124
-
125
- - `@tsonic/nodejs/nodejs.Http.js`
126
-
127
135
  ## Relationship to `@tsonic/js`
128
136
 
129
137
  - `@tsonic/js` provides JavaScript runtime APIs (JS-style `console`, `JSON`, timers, etc.)
@@ -144,6 +152,14 @@ Direct ESM imports from `@tsonic/nodejs/index.js` are still supported.
144
152
 
145
153
  See `__build/` for regeneration scripts.
146
154
 
155
+ Run the publish-gated validation suite with:
156
+
157
+ ```bash
158
+ npm run selftest
159
+ ```
160
+
161
+ When sibling `@tsonic/*` repos are checked out locally, the selftest installs those local packages first, whether they are versioned package repos (for example `../js/versions/10`) or root-package repos (for example `../aspnetcore`). That keeps the consumer validation coherent across a local release wave instead of mixing one local package with stale published transitive dependencies. The selftest also fails on peer-dependency warnings, so stale local release waves are caught before publish.
162
+
147
163
  ## License
148
164
 
149
165
  MIT