nitropack-nightly 2.11.7-20250318-123444.96e0b73b → 2.11.7-20250318-220432.9d20c538

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.
@@ -2248,9 +2248,15 @@ function createHTTPProxy(defaults = {}) {
2248
2248
  event._handled = true;
2249
2249
  await proxy.web(event.node.req, event.node.res, opts);
2250
2250
  } catch (error) {
2251
- if (error?.code !== "ECONNRESET") {
2252
- throw error;
2251
+ try {
2252
+ event.node.res.setHeader("refresh", "3");
2253
+ } catch {
2253
2254
  }
2255
+ throw createError({
2256
+ statusCode: 503,
2257
+ message: "Dev server is unavailable.",
2258
+ cause: error
2259
+ });
2254
2260
  }
2255
2261
  };
2256
2262
  return {
@@ -2333,11 +2339,10 @@ class NodeDevWorker {
2333
2339
  this.closed = true;
2334
2340
  this.#hooks.onClose?.(this, cause);
2335
2341
  this.#hooks = {};
2336
- await Promise.all(
2337
- [this.#closeProxy(), this.#closeSocket(), this.#closeWorker()].map(
2338
- (p) => p.catch((error) => consola.error(error))
2339
- )
2340
- );
2342
+ const onError = (error) => consola.error(error);
2343
+ await this.#closeWorker().catch(onError);
2344
+ await this.#closeProxy().catch(onError);
2345
+ await this.#closeSocket().catch(onError);
2341
2346
  }
2342
2347
  async #closeProxy() {
2343
2348
  this.#proxy?.proxy?.close(() => {
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250318-123444.96e0b73b";
1
+ const version = "2.11.7-20250318-220432.9d20c538";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250318-123444.96e0b73b";
1
+ const version = "2.11.7-20250318-220432.9d20c538";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250318-123444.96e0b73b";
1
+ const version = "2.11.7-20250318-220432.9d20c538";
2
2
 
3
3
  export { version };
@@ -4,6 +4,8 @@ export const builtnNodeModules = [
4
4
  "_stream_readable",
5
5
  "_stream_transform",
6
6
  "_stream_writable",
7
+ "_tls_wrap",
8
+ // Missing exports: Server, createServer
7
9
  "assert",
8
10
  // Missing exports: CallTracker, partialDeepStrictEqual
9
11
  "assert/strict",
@@ -35,11 +37,13 @@ export const builtnNodeModules = [
35
37
  export const hybridNodeModules = [
36
38
  "console",
37
39
  "crypto",
38
- // Missing exports: Cipher, Cipheriv, Decipher, Decipheriv, ECDH, constants, createCipheriv, createDecipheriv, createECDH, getCipherInfo, hash, privateDecrypt, privateEncrypt, publicDecrypt, publicEncrypt
40
+ // Missing exports: Cipher, Decipher
39
41
  "module",
40
42
  // Missing exports: Module, SourceMap, constants, enableCompileCache, findPackageJSON, findSourceMap, flushCompileCache, getCompileCacheDir, getSourceMapsSupport, globalPaths, register, runMain, setSourceMapsSupport, stripTypeScriptTypes, syncBuiltinESMExports
41
43
  "process",
42
44
  // Missing exports: abort, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, availableMemory, binding, chdir, config, constrainedMemory, cpuUsage, cwd, debugPort, dlopen, domain, emitWarning, execArgv, execPath, exitCode, features, finalization, getActiveResourcesInfo, getegid, geteuid, getgid, getgroups, getuid, hasUncaughtExceptionCaptureCallback, hrtime, initgroups, kill, loadEnvFile, memoryUsage, moduleLoadList, openStdin, pid, ppid, reallyExit, ref, release, report, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, setegid, seteuid, setgid, setgroups, setuid, sourceMapsEnabled, stderr, stdin, stdout, title, umask, unref, uptime, version, versions
45
+ "tls",
46
+ // Missing exports: CLIENT_RENEG_LIMIT, CLIENT_RENEG_WINDOW, DEFAULT_CIPHERS, DEFAULT_ECDH_CURVE, DEFAULT_MAX_VERSION, DEFAULT_MIN_VERSION, SecureContext, Server, checkServerIdentity, convertALPNProtocols, createSecureContext, createSecurePair, createServer, getCiphers, rootCertificates
43
47
  "util"
44
48
  // Missing exports: isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined
45
49
  ];
@@ -52,7 +56,6 @@ export const unsupportedNodeModules = [
52
56
  "_http_server",
53
57
  "_stream_wrap",
54
58
  "_tls_common",
55
- "_tls_wrap",
56
59
  "child_process",
57
60
  "cluster",
58
61
  "constants",
@@ -72,7 +75,6 @@ export const unsupportedNodeModules = [
72
75
  "readline/promises",
73
76
  "repl",
74
77
  "sys",
75
- "tls",
76
78
  "trace_events",
77
79
  "tty",
78
80
  "v8",
@@ -1,34 +1,57 @@
1
+ export const webcrypto: any;
1
2
  export const Certificate: any;
3
+ export const Cipheriv: any;
4
+ export const Decipheriv: any;
2
5
  export const DiffieHellman: any;
3
6
  export const DiffieHellmanGroup: any;
7
+ export const ECDH: any;
4
8
  export const Hash: any;
5
9
  export const Hmac: any;
6
10
  export const KeyObject: any;
11
+ export const PrivateKeyObject: any;
12
+ export const PublicKeyObject: any;
13
+ export const SecretKeyObject: any;
14
+ export const Sign: any;
15
+ export const Verify: any;
7
16
  export const X509Certificate: any;
8
17
  export const checkPrime: any;
9
18
  export const checkPrimeSync: any;
19
+ export const constants: any;
20
+ export const createCipheriv: any;
21
+ export const createDecipheriv: any;
10
22
  export const createDiffieHellman: any;
11
23
  export const createDiffieHellmanGroup: any;
24
+ export const createECDH: any;
12
25
  export const createHash: any;
13
26
  export const createHmac: any;
14
27
  export const createPrivateKey: any;
15
28
  export const createPublicKey: any;
16
29
  export const createSecretKey: any;
30
+ export const createSign: any;
31
+ export const createVerify: any;
32
+ export const diffieHellman: any;
33
+ export const fips: any;
17
34
  export const generateKey: any;
18
35
  export const generateKeyPair: any;
19
36
  export const generateKeyPairSync: any;
20
37
  export const generateKeySync: any;
21
38
  export const generatePrime: any;
22
39
  export const generatePrimeSync: any;
40
+ export const getCipherInfo: any;
23
41
  export const getCiphers: any;
24
42
  export const getCurves: any;
25
43
  export const getDiffieHellman: any;
26
44
  export const getFips: any;
27
45
  export const getHashes: any;
46
+ export const hash: any;
28
47
  export const hkdf: any;
29
48
  export const hkdfSync: any;
30
49
  export const pbkdf2: any;
31
50
  export const pbkdf2Sync: any;
51
+ export const privateDecrypt: any;
52
+ export const privateEncrypt: any;
53
+ export const publicDecrypt: any;
54
+ export const publicEncrypt: any;
32
55
  export const randomBytes: any;
33
56
  export const randomFill: any;
34
57
  export const randomFillSync: any;
@@ -39,93 +62,85 @@ export const scryptSync: any;
39
62
  export const secureHeapUsed: any;
40
63
  export const setEngine: any;
41
64
  export const setFips: any;
65
+ export const sign: any;
42
66
  export const subtle: any;
43
67
  export const timingSafeEqual: any;
44
- export const fips: any;
45
- export const Sign: any;
46
- export const Verify: any;
47
- export const createSign: any;
48
- export const createVerify: any;
49
- export const sign: any;
50
68
  export const verify: any;
51
69
  export const getRandomValues: any;
52
- export namespace webcrypto {
53
- export let CryptoKey: any;
54
- export { getRandomValues };
55
- export { randomUUID };
56
- export { subtle };
57
- }
58
70
  declare namespace _default {
59
- export { Certificate };
60
71
  export { Cipher };
61
- export { Cipheriv };
62
72
  export { Decipher };
63
- export { Decipheriv };
64
- export { ECDH };
65
- export { Sign };
66
- export { Verify };
67
- export { X509Certificate };
68
- export { constants };
69
- export { createCipheriv };
70
- export { createDecipheriv };
71
- export { createECDH };
72
- export { createSign };
73
- export { createVerify };
74
- export { diffieHellman };
75
- export { getCipherInfo };
76
- export { hash };
77
- export { privateDecrypt };
78
- export { privateEncrypt };
79
- export { publicDecrypt };
80
- export { publicEncrypt };
81
- export { scrypt };
82
- export { scryptSync };
83
- export { sign };
84
- export { verify };
85
- export { createCipher };
86
- export { createDecipher };
73
+ export { rng };
74
+ export { prng };
87
75
  export { pseudoRandomBytes };
76
+ export { webcrypto };
77
+ export { getRandomValues };
78
+ export { Certificate };
79
+ export { Cipheriv };
80
+ export { Decipheriv };
88
81
  export { DiffieHellman };
89
82
  export { DiffieHellmanGroup };
83
+ export { ECDH };
90
84
  export { Hash };
91
85
  export { Hmac };
92
86
  export { KeyObject };
87
+ export { PrivateKeyObject };
88
+ export { PublicKeyObject };
89
+ export { SecretKeyObject };
90
+ export { Sign };
91
+ export { Verify };
92
+ export { X509Certificate };
93
93
  export { checkPrime };
94
94
  export { checkPrimeSync };
95
+ export { constants };
96
+ export { createCipheriv };
97
+ export { createDecipheriv };
95
98
  export { createDiffieHellman };
96
99
  export { createDiffieHellmanGroup };
100
+ export { createECDH };
97
101
  export { createHash };
98
102
  export { createHmac };
99
103
  export { createPrivateKey };
100
104
  export { createPublicKey };
101
105
  export { createSecretKey };
106
+ export { createSign };
107
+ export { createVerify };
108
+ export { diffieHellman };
109
+ export { fips };
102
110
  export { generateKey };
103
111
  export { generateKeyPair };
104
112
  export { generateKeyPairSync };
105
113
  export { generateKeySync };
106
114
  export { generatePrime };
107
115
  export { generatePrimeSync };
116
+ export { getCipherInfo };
108
117
  export { getCiphers };
109
118
  export { getCurves };
110
119
  export { getDiffieHellman };
111
120
  export { getFips };
112
121
  export { getHashes };
113
- export { getRandomValues };
122
+ export { hash };
114
123
  export { hkdf };
115
124
  export { hkdfSync };
116
125
  export { pbkdf2 };
117
126
  export { pbkdf2Sync };
127
+ export { privateDecrypt };
128
+ export { privateEncrypt };
129
+ export { publicDecrypt };
130
+ export { publicEncrypt };
118
131
  export { randomBytes };
119
132
  export { randomFill };
120
133
  export { randomFillSync };
121
134
  export { randomInt };
122
135
  export { randomUUID };
136
+ export { scrypt };
137
+ export { scryptSync };
123
138
  export { secureHeapUsed };
124
139
  export { setEngine };
125
140
  export { setFips };
141
+ export { sign };
126
142
  export { subtle };
127
143
  export { timingSafeEqual };
128
- export { fips };
129
- export { webcrypto };
144
+ export { verify };
130
145
  }
131
146
  export default _default;
@@ -4,78 +4,75 @@ import workerdCrypto from "#workerd/node:crypto";
4
4
 
5
5
  import {
6
6
  Cipher,
7
- Cipheriv,
8
- constants,
9
- createCipher,
10
- createCipheriv,
11
- createDecipher,
12
- createDecipheriv,
13
- createECDH,
14
7
  Decipher,
15
- Decipheriv,
16
- diffieHellman,
17
- ECDH,
18
- getCipherInfo,
19
- hash,
20
- privateDecrypt,
21
- privateEncrypt,
8
+ rng,
9
+ prng,
22
10
  pseudoRandomBytes,
23
- publicDecrypt,
24
- publicEncrypt,
25
- webcrypto as unenvCryptoWebcrypto,
26
11
  } from "unenv/node/crypto";
27
12
 
28
13
  export {
29
14
  Cipher,
30
- Cipheriv,
31
15
  Decipher,
32
- Decipheriv,
33
- ECDH,
34
- constants,
35
- createCipheriv,
36
- createDecipheriv,
37
- createECDH,
38
- diffieHellman,
39
- getCipherInfo,
40
- hash,
41
- privateDecrypt,
42
- privateEncrypt,
43
- publicDecrypt,
44
- publicEncrypt,
16
+ rng,
17
+ prng,
18
+ pseudoRandomBytes,
45
19
  } from "unenv/node/crypto";
46
20
 
47
21
  export const {
22
+ webcrypto,
48
23
  Certificate,
24
+ Cipheriv,
25
+ Decipheriv,
49
26
  DiffieHellman,
50
27
  DiffieHellmanGroup,
28
+ ECDH,
51
29
  Hash,
52
30
  Hmac,
53
31
  KeyObject,
32
+ PrivateKeyObject,
33
+ PublicKeyObject,
34
+ SecretKeyObject,
35
+ Sign,
36
+ Verify,
54
37
  X509Certificate,
55
38
  checkPrime,
56
39
  checkPrimeSync,
40
+ constants,
41
+ createCipheriv,
42
+ createDecipheriv,
57
43
  createDiffieHellman,
58
44
  createDiffieHellmanGroup,
45
+ createECDH,
59
46
  createHash,
60
47
  createHmac,
61
48
  createPrivateKey,
62
49
  createPublicKey,
63
50
  createSecretKey,
51
+ createSign,
52
+ createVerify,
53
+ diffieHellman,
54
+ fips,
64
55
  generateKey,
65
56
  generateKeyPair,
66
57
  generateKeyPairSync,
67
58
  generateKeySync,
68
59
  generatePrime,
69
60
  generatePrimeSync,
61
+ getCipherInfo,
70
62
  getCiphers,
71
63
  getCurves,
72
64
  getDiffieHellman,
73
65
  getFips,
74
66
  getHashes,
67
+ hash,
75
68
  hkdf,
76
69
  hkdfSync,
77
70
  pbkdf2,
78
71
  pbkdf2Sync,
72
+ privateDecrypt,
73
+ privateEncrypt,
74
+ publicDecrypt,
75
+ publicEncrypt,
79
76
  randomBytes,
80
77
  randomFill,
81
78
  randomFillSync,
@@ -86,14 +83,9 @@ export const {
86
83
  secureHeapUsed,
87
84
  setEngine,
88
85
  setFips,
86
+ sign,
89
87
  subtle,
90
88
  timingSafeEqual,
91
- fips,
92
- Sign,
93
- Verify,
94
- createSign,
95
- createVerify,
96
- sign,
97
89
  verify,
98
90
  } = workerdCrypto;
99
91
 
@@ -101,83 +93,81 @@ export const getRandomValues = workerdCrypto.getRandomValues.bind(
101
93
  workerdCrypto.webcrypto
102
94
  );
103
95
 
104
- export const webcrypto = {
105
- CryptoKey: unenvCryptoWebcrypto.CryptoKey,
106
- getRandomValues,
107
- randomUUID,
108
- subtle,
109
- };
110
-
111
96
  export default {
112
- Certificate,
97
+ // Polyfill
113
98
  Cipher,
114
- Cipheriv,
115
99
  Decipher,
116
- Decipheriv,
117
- ECDH,
118
- Sign,
119
- Verify,
120
- X509Certificate,
121
- constants,
122
- createCipheriv,
123
- createDecipheriv,
124
- createECDH,
125
- createSign,
126
- createVerify,
127
- diffieHellman,
128
- getCipherInfo,
129
- hash,
130
- privateDecrypt,
131
- privateEncrypt,
132
- publicDecrypt,
133
- publicEncrypt,
134
- scrypt,
135
- scryptSync,
136
- sign,
137
- verify,
138
- createCipher,
139
- createDecipher,
100
+ rng,
101
+ prng,
140
102
  pseudoRandomBytes,
103
+ // Native
104
+ webcrypto,
105
+ getRandomValues,
106
+ Certificate,
107
+ Cipheriv,
108
+ Decipheriv,
141
109
  DiffieHellman,
142
110
  DiffieHellmanGroup,
111
+ ECDH,
143
112
  Hash,
144
113
  Hmac,
145
114
  KeyObject,
115
+ PrivateKeyObject,
116
+ PublicKeyObject,
117
+ SecretKeyObject,
118
+ Sign,
119
+ Verify,
120
+ X509Certificate,
146
121
  checkPrime,
147
122
  checkPrimeSync,
123
+ constants,
124
+ createCipheriv,
125
+ createDecipheriv,
148
126
  createDiffieHellman,
149
127
  createDiffieHellmanGroup,
128
+ createECDH,
150
129
  createHash,
151
130
  createHmac,
152
131
  createPrivateKey,
153
132
  createPublicKey,
154
133
  createSecretKey,
134
+ createSign,
135
+ createVerify,
136
+ diffieHellman,
137
+ fips,
155
138
  generateKey,
156
139
  generateKeyPair,
157
140
  generateKeyPairSync,
158
141
  generateKeySync,
159
142
  generatePrime,
160
143
  generatePrimeSync,
144
+ getCipherInfo,
161
145
  getCiphers,
162
146
  getCurves,
163
147
  getDiffieHellman,
164
148
  getFips,
165
149
  getHashes,
166
- getRandomValues,
150
+ hash,
167
151
  hkdf,
168
152
  hkdfSync,
169
153
  pbkdf2,
170
154
  pbkdf2Sync,
155
+ privateDecrypt,
156
+ privateEncrypt,
157
+ publicDecrypt,
158
+ publicEncrypt,
171
159
  randomBytes,
172
160
  randomFill,
173
161
  randomFillSync,
174
162
  randomInt,
175
163
  randomUUID,
164
+ scrypt,
165
+ scryptSync,
176
166
  secureHeapUsed,
177
167
  setEngine,
178
168
  setFips,
169
+ sign,
179
170
  subtle,
180
171
  timingSafeEqual,
181
- fips,
182
- webcrypto,
172
+ verify,
183
173
  };
@@ -0,0 +1,22 @@
1
+ export const TLSSocket: any;
2
+ export const connect: any;
3
+ declare namespace _default {
4
+ export { TLSSocket };
5
+ export { connect };
6
+ export { CLIENT_RENEG_LIMIT };
7
+ export { CLIENT_RENEG_WINDOW };
8
+ export { DEFAULT_CIPHERS };
9
+ export { DEFAULT_ECDH_CURVE };
10
+ export { DEFAULT_MAX_VERSION };
11
+ export { DEFAULT_MIN_VERSION };
12
+ export { SecureContext };
13
+ export { Server };
14
+ export { checkServerIdentity };
15
+ export { convertALPNProtocols };
16
+ export { createSecureContext };
17
+ export { createSecurePair };
18
+ export { createServer };
19
+ export { getCiphers };
20
+ export { rootCertificates };
21
+ }
22
+ export default _default;
@@ -0,0 +1,63 @@
1
+ // https://github.com/cloudflare/workerd/blob/main/src/node/tls.ts
2
+
3
+ import workerdTLS from "#workerd/node:tls";
4
+
5
+ import {
6
+ CLIENT_RENEG_LIMIT,
7
+ CLIENT_RENEG_WINDOW,
8
+ DEFAULT_CIPHERS,
9
+ DEFAULT_ECDH_CURVE,
10
+ DEFAULT_MAX_VERSION,
11
+ DEFAULT_MIN_VERSION,
12
+ SecureContext,
13
+ Server,
14
+ checkServerIdentity,
15
+ convertALPNProtocols,
16
+ createSecureContext,
17
+ createSecurePair,
18
+ createServer,
19
+ getCiphers,
20
+ rootCertificates,
21
+ } from "unenv/node/tls";
22
+
23
+ export {
24
+ CLIENT_RENEG_LIMIT,
25
+ CLIENT_RENEG_WINDOW,
26
+ DEFAULT_CIPHERS,
27
+ DEFAULT_ECDH_CURVE,
28
+ DEFAULT_MAX_VERSION,
29
+ DEFAULT_MIN_VERSION,
30
+ SecureContext,
31
+ Server,
32
+ checkServerIdentity,
33
+ convertALPNProtocols,
34
+ createSecureContext,
35
+ createSecurePair,
36
+ createServer,
37
+ getCiphers,
38
+ rootCertificates,
39
+ } from "unenv/node/tls";
40
+
41
+ export const { TLSSocket, connect } = workerdTLS;
42
+
43
+ export default {
44
+ // native
45
+ TLSSocket,
46
+ connect,
47
+ // polyfill
48
+ CLIENT_RENEG_LIMIT,
49
+ CLIENT_RENEG_WINDOW,
50
+ DEFAULT_CIPHERS,
51
+ DEFAULT_ECDH_CURVE,
52
+ DEFAULT_MAX_VERSION,
53
+ DEFAULT_MIN_VERSION,
54
+ SecureContext,
55
+ Server,
56
+ checkServerIdentity,
57
+ convertALPNProtocols,
58
+ createSecureContext,
59
+ createSecurePair,
60
+ createServer,
61
+ getCiphers,
62
+ rootCertificates,
63
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.11.7-20250318-123444.96e0b73b",
3
+ "version": "2.11.7-20250318-220432.9d20c538",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",