@tsonic/nodejs 10.0.41 → 10.0.42
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 +27 -11
- package/index.d.ts +0 -2
- package/node-aliases.d.ts +57 -0
- package/package.json +4 -4
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
|
-
|
|
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 {
|
|
98
|
+
import { createHash } from "node:crypto";
|
|
94
99
|
|
|
95
|
-
const
|
|
96
|
-
void
|
|
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 {
|
|
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
|
package/index.d.ts
CHANGED
|
@@ -28,8 +28,6 @@ export { ChildProcess as ChildProcess } from './index/internal/index.js';
|
|
|
28
28
|
export { ExecOptions as ExecOptions } from './index/internal/index.js';
|
|
29
29
|
export { child_process$instance as child_process } from './index/internal/index.js';
|
|
30
30
|
export { SpawnSyncReturns_1 as SpawnSyncReturns } from './index/internal/index.js';
|
|
31
|
-
export { console$instance as console } from './index/internal/index.js';
|
|
32
|
-
export { ConsoleConstructor as ConsoleConstructor } from './index/internal/index.js';
|
|
33
31
|
export { Certificate$instance as Certificate } from './index/internal/index.js';
|
|
34
32
|
export { X509CertificateExtensions$instance as X509CertificateExtensions } from './index/internal/index.js';
|
|
35
33
|
export { X509CertificateInfo as X509CertificateInfo } from './index/internal/index.js';
|
package/node-aliases.d.ts
CHANGED
|
@@ -43,6 +43,19 @@ declare module "node:fs" {
|
|
|
43
43
|
|
|
44
44
|
declare module "fs" {
|
|
45
45
|
export { fs } from "@tsonic/nodejs/index.js";
|
|
46
|
+
export const existsSync: typeof import("@tsonic/nodejs/index.js").fs.existsSync;
|
|
47
|
+
export const readFileSync: typeof import("@tsonic/nodejs/index.js").fs.readFileSync;
|
|
48
|
+
export const readFile: typeof import("@tsonic/nodejs/index.js").fs.readFile;
|
|
49
|
+
export const readFileSyncBytes: typeof import("@tsonic/nodejs/index.js").fs.readFileSyncBytes;
|
|
50
|
+
export const readdirSync: typeof import("@tsonic/nodejs/index.js").fs.readdirSync;
|
|
51
|
+
export const readdir: typeof import("@tsonic/nodejs/index.js").fs.readdir;
|
|
52
|
+
export const copyFileSync: typeof import("@tsonic/nodejs/index.js").fs.copyFileSync;
|
|
53
|
+
export const mkdirSync: typeof import("@tsonic/nodejs/index.js").fs.mkdirSync;
|
|
54
|
+
export const realpathSync: typeof import("@tsonic/nodejs/index.js").fs.realpathSync;
|
|
55
|
+
export const rmSync: typeof import("@tsonic/nodejs/index.js").fs.rmSync;
|
|
56
|
+
export const statSync: typeof import("@tsonic/nodejs/index.js").fs.statSync;
|
|
57
|
+
export const writeFileSync: typeof import("@tsonic/nodejs/index.js").fs.writeFileSync;
|
|
58
|
+
export const writeFileSyncBytes: typeof import("@tsonic/nodejs/index.js").fs.writeFileSyncBytes;
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
declare module "node:path" {
|
|
@@ -62,15 +75,29 @@ declare module "node:path" {
|
|
|
62
75
|
|
|
63
76
|
declare module "path" {
|
|
64
77
|
export { path } from "@tsonic/nodejs/index.js";
|
|
78
|
+
export const join: typeof import("@tsonic/nodejs/index.js").path.join;
|
|
79
|
+
export const extname: typeof import("@tsonic/nodejs/index.js").path.extname;
|
|
80
|
+
export const basename: typeof import("@tsonic/nodejs/index.js").path.basename;
|
|
81
|
+
export const dirname: typeof import("@tsonic/nodejs/index.js").path.dirname;
|
|
82
|
+
export const parse: typeof import("@tsonic/nodejs/index.js").path.parse;
|
|
83
|
+
export const isAbsolute: typeof import("@tsonic/nodejs/index.js").path.isAbsolute;
|
|
84
|
+
export const normalize: typeof import("@tsonic/nodejs/index.js").path.normalize;
|
|
85
|
+
export const relative: typeof import("@tsonic/nodejs/index.js").path.relative;
|
|
86
|
+
export const resolve: typeof import("@tsonic/nodejs/index.js").path.resolve;
|
|
87
|
+
export const sep: typeof import("@tsonic/nodejs/index.js").path.sep;
|
|
88
|
+
export const delimiter: typeof import("@tsonic/nodejs/index.js").path.delimiter;
|
|
65
89
|
}
|
|
66
90
|
|
|
67
91
|
declare module "node:crypto" {
|
|
68
92
|
export { crypto } from "@tsonic/nodejs/index.js";
|
|
93
|
+
export const createHash: typeof import("@tsonic/nodejs/index.js").crypto.createHash;
|
|
69
94
|
export const randomUUID: typeof import("@tsonic/nodejs/index.js").crypto.randomUUID;
|
|
70
95
|
}
|
|
71
96
|
|
|
72
97
|
declare module "crypto" {
|
|
73
98
|
export { crypto } from "@tsonic/nodejs/index.js";
|
|
99
|
+
export const createHash: typeof import("@tsonic/nodejs/index.js").crypto.createHash;
|
|
100
|
+
export const randomUUID: typeof import("@tsonic/nodejs/index.js").crypto.randomUUID;
|
|
74
101
|
}
|
|
75
102
|
|
|
76
103
|
declare module "node:dgram" {
|
|
@@ -113,6 +140,8 @@ declare module "node:os" {
|
|
|
113
140
|
|
|
114
141
|
declare module "os" {
|
|
115
142
|
export { os } from "@tsonic/nodejs/index.js";
|
|
143
|
+
export const homedir: typeof import("@tsonic/nodejs/index.js").os.homedir;
|
|
144
|
+
export const tmpdir: typeof import("@tsonic/nodejs/index.js").os.tmpdir;
|
|
116
145
|
}
|
|
117
146
|
|
|
118
147
|
declare module "node:process" {
|
|
@@ -135,6 +164,20 @@ declare module "node:process" {
|
|
|
135
164
|
|
|
136
165
|
declare module "process" {
|
|
137
166
|
export { process } from "@tsonic/nodejs/index.js";
|
|
167
|
+
export const argv: typeof import("@tsonic/nodejs/index.js").process.argv;
|
|
168
|
+
export const argv0: typeof import("@tsonic/nodejs/index.js").process.argv0;
|
|
169
|
+
export const arch: typeof import("@tsonic/nodejs/index.js").process.arch;
|
|
170
|
+
export const cwd: typeof import("@tsonic/nodejs/index.js").process.cwd;
|
|
171
|
+
export const chdir: typeof import("@tsonic/nodejs/index.js").process.chdir;
|
|
172
|
+
export const env: typeof import("@tsonic/nodejs/index.js").process.env;
|
|
173
|
+
export const execPath: typeof import("@tsonic/nodejs/index.js").process.execPath;
|
|
174
|
+
export const exit: typeof import("@tsonic/nodejs/index.js").process.exit;
|
|
175
|
+
export const exitCode: typeof import("@tsonic/nodejs/index.js").process.exitCode;
|
|
176
|
+
export const kill: typeof import("@tsonic/nodejs/index.js").process.kill;
|
|
177
|
+
export const pid: typeof import("@tsonic/nodejs/index.js").process.pid;
|
|
178
|
+
export const ppid: typeof import("@tsonic/nodejs/index.js").process.ppid;
|
|
179
|
+
export const platform: typeof import("@tsonic/nodejs/index.js").process.platform;
|
|
180
|
+
export const version: typeof import("@tsonic/nodejs/index.js").process.version;
|
|
138
181
|
}
|
|
139
182
|
|
|
140
183
|
declare module "node:querystring" {
|
|
@@ -163,10 +206,22 @@ declare module "stream" {
|
|
|
163
206
|
|
|
164
207
|
declare module "node:timers" {
|
|
165
208
|
export { timers } from "@tsonic/nodejs/index.js";
|
|
209
|
+
export const clearImmediate: typeof import("@tsonic/nodejs/index.js").timers.clearImmediate;
|
|
210
|
+
export const clearInterval: typeof import("@tsonic/nodejs/index.js").timers.clearInterval;
|
|
211
|
+
export const clearTimeout: typeof import("@tsonic/nodejs/index.js").timers.clearTimeout;
|
|
212
|
+
export const setImmediate: typeof import("@tsonic/nodejs/index.js").timers.setImmediate;
|
|
213
|
+
export const setInterval: typeof import("@tsonic/nodejs/index.js").timers.setInterval;
|
|
214
|
+
export const setTimeout: typeof import("@tsonic/nodejs/index.js").timers.setTimeout;
|
|
166
215
|
}
|
|
167
216
|
|
|
168
217
|
declare module "timers" {
|
|
169
218
|
export { timers } from "@tsonic/nodejs/index.js";
|
|
219
|
+
export const clearImmediate: typeof import("@tsonic/nodejs/index.js").timers.clearImmediate;
|
|
220
|
+
export const clearInterval: typeof import("@tsonic/nodejs/index.js").timers.clearInterval;
|
|
221
|
+
export const clearTimeout: typeof import("@tsonic/nodejs/index.js").timers.clearTimeout;
|
|
222
|
+
export const setImmediate: typeof import("@tsonic/nodejs/index.js").timers.setImmediate;
|
|
223
|
+
export const setInterval: typeof import("@tsonic/nodejs/index.js").timers.setInterval;
|
|
224
|
+
export const setTimeout: typeof import("@tsonic/nodejs/index.js").timers.setTimeout;
|
|
170
225
|
}
|
|
171
226
|
|
|
172
227
|
declare module "node:tls" {
|
|
@@ -187,6 +242,8 @@ declare module "node:url" {
|
|
|
187
242
|
declare module "url" {
|
|
188
243
|
export { url } from "@tsonic/nodejs/index.js";
|
|
189
244
|
export { URL, URLSearchParams } from "@tsonic/nodejs/index.js";
|
|
245
|
+
export const fileURLToPath: typeof import("@tsonic/nodejs/index.js").url.fileURLToPath;
|
|
246
|
+
export const pathToFileURL: typeof import("@tsonic/nodejs/index.js").url.pathToFileURL;
|
|
190
247
|
}
|
|
191
248
|
|
|
192
249
|
declare module "node:http" {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsonic/nodejs",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.42",
|
|
4
4
|
"description": "TypeScript type definitions for Node.js CLR library",
|
|
5
5
|
"main": "index.d.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"url": "https://github.com/tsoniclang/nodejs.git"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@tsonic/dotnet": "10.0.
|
|
34
|
-
"@tsonic/core": "10.0.
|
|
35
|
-
"@tsonic/js": "10.0.
|
|
33
|
+
"@tsonic/dotnet": "10.0.38",
|
|
34
|
+
"@tsonic/core": "10.0.38",
|
|
35
|
+
"@tsonic/js": "10.0.42"
|
|
36
36
|
}
|
|
37
37
|
}
|