nitropack-nightly 2.11.0-20250228-210425.a45b6fe7 → 2.11.0-20250301-081015.fcba06e1

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.
@@ -7,7 +7,7 @@ import { createUnimport, toExports } from 'unimport';
7
7
  import { watchConfig, loadConfig } from 'c12';
8
8
  import { resolveCompatibilityDatesFromEnv, formatDate, resolveCompatibilityDates, formatCompatibilityDate } from 'compatx';
9
9
  import { klona } from 'klona/full';
10
- import { isDebug, isTest, nodeMajorVersion, provider } from 'std-env';
10
+ import { isDebug, isTest, nodeMajorVersion, provider, isCI } from 'std-env';
11
11
  import { existsSync, promises } from 'node:fs';
12
12
  import defu$1, { defu } from 'defu';
13
13
  import { withLeadingSlash, withoutTrailingSlash, withTrailingSlash, withBase, parseURL, joinURL, withoutBase } from 'ufo';
@@ -2628,7 +2628,8 @@ class DevServer {
2628
2628
  }
2629
2629
  async getWorker() {
2630
2630
  let retry = 0;
2631
- while (this.building || ++retry < 10) {
2631
+ const maxRetries = isTest || isCI ? 100 : 10;
2632
+ while (this.building || ++retry < maxRetries) {
2632
2633
  if ((this.workers.length === 0 || this.buildError) && !this.building) {
2633
2634
  return;
2634
2635
  }
@@ -2636,7 +2637,7 @@ class DevServer {
2636
2637
  if (activeWorker) {
2637
2638
  return activeWorker;
2638
2639
  }
2639
- await new Promise((resolve2) => setTimeout(resolve2, 500));
2640
+ await new Promise((resolve2) => setTimeout(resolve2, 600));
2640
2641
  }
2641
2642
  }
2642
2643
  writeBuildInfo(_worker, addr) {
@@ -1,3 +1,3 @@
1
- const version = "2.11.0-20250228-210425.a45b6fe7";
1
+ const version = "2.11.0-20250301-081015.fcba06e1";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.0-20250228-210425.a45b6fe7";
1
+ const version = "2.11.0-20250301-081015.fcba06e1";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.0-20250228-210425.a45b6fe7";
1
+ const version = "2.11.0-20250301-081015.fcba06e1";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
1
  export declare const builtnNodeModules: string[];
2
- export declare const hybridNodeModules: string[];
2
+ export declare const hybridNodeModules: never[];
3
3
  export declare const unsupportedNodeModules: string[];
@@ -1,50 +1,14 @@
1
1
  export const builtnNodeModules = [
2
- "_stream_duplex",
3
- "_stream_passthrough",
4
- "_stream_readable",
5
- "_stream_transform",
6
- "_stream_writable",
7
2
  "assert",
8
3
  // Missing exports: CallTracker, partialDeepStrictEqual
9
- "assert/strict",
10
- // Missing exports: CallTracker, partialDeepStrictEqual
11
4
  "async_hooks",
12
5
  "buffer",
13
- "diagnostics_channel",
14
- "dns",
15
- "dns/promises",
16
6
  "events",
17
7
  // Missing exports: captureRejections, init
18
- "net",
19
- // Missing exports: Stream
20
- "path",
21
- "path/posix",
22
- "path/win32",
23
- "querystring",
24
- "stream",
25
- // Missing exports: duplexPair
26
- "stream/consumers",
27
- "stream/promises",
28
- "stream/web",
29
- "string_decoder",
30
- "timers",
31
- "timers/promises",
32
- "url",
33
- "util/types",
34
- "zlib"
35
- ];
36
- export const hybridNodeModules = [
37
- "console",
38
- "crypto",
39
- // Missing exports: Cipher, Cipheriv, Decipher, Decipheriv, ECDH, Sign, Verify, constants, createCipheriv, createDecipheriv, createECDH, createSign, createVerify, getCipherInfo, hash, privateDecrypt, privateEncrypt, publicDecrypt, publicEncrypt, sign, verify
40
- "module",
41
- // Missing exports: Module, SourceMap, constants, enableCompileCache, findPackageJSON, findSourceMap, flushCompileCache, getCompileCacheDir, getSourceMapsSupport, globalPaths, register, runMain, setSourceMapsSupport, stripTypeScriptTypes, syncBuiltinESMExports
42
- "perf_hooks",
43
- "process",
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
8
  "util"
46
9
  // Missing exports: isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined
47
10
  ];
11
+ export const hybridNodeModules = [];
48
12
  export const unsupportedNodeModules = [
49
13
  "_http_agent",
50
14
  "_http_client",
@@ -52,13 +16,24 @@ export const unsupportedNodeModules = [
52
16
  "_http_incoming",
53
17
  "_http_outgoing",
54
18
  "_http_server",
19
+ "_stream_duplex",
20
+ "_stream_passthrough",
21
+ "_stream_readable",
22
+ "_stream_transform",
55
23
  "_stream_wrap",
24
+ "_stream_writable",
56
25
  "_tls_common",
57
26
  "_tls_wrap",
27
+ "assert/strict",
58
28
  "child_process",
59
29
  "cluster",
30
+ "console",
60
31
  "constants",
32
+ "crypto",
61
33
  "dgram",
34
+ "diagnostics_channel",
35
+ "dns",
36
+ "dns/promises",
62
37
  "domain",
63
38
  "fs",
64
39
  "fs/promises",
@@ -67,18 +42,36 @@ export const unsupportedNodeModules = [
67
42
  "https",
68
43
  "inspector",
69
44
  "inspector/promises",
45
+ "module",
46
+ "net",
70
47
  "os",
48
+ "path",
49
+ "path/posix",
50
+ "path/win32",
51
+ "perf_hooks",
52
+ "process",
71
53
  "punycode",
54
+ "querystring",
72
55
  "readline",
73
56
  "readline/promises",
74
57
  "repl",
58
+ "stream",
59
+ "stream/consumers",
60
+ "stream/promises",
61
+ "stream/web",
62
+ "string_decoder",
75
63
  "sys",
64
+ "timers",
65
+ "timers/promises",
76
66
  "tls",
77
67
  "trace_events",
78
68
  "tty",
69
+ "url",
70
+ "util/types",
79
71
  "v8",
80
72
  "vm",
81
73
  "wasi",
82
74
  "worker_threads",
75
+ "zlib",
83
76
  "sqlite"
84
77
  ];
@@ -5,7 +5,7 @@ import {
5
5
  generateFunctionFiles,
6
6
  generateStaticFiles
7
7
  } from "./utils.mjs";
8
- import { hybridNodePlugin, unenvWorkerdPreset } from "../_unenv/preset-workerd.mjs";
8
+ import { builtnNodeModules } from "../_unenv/node-compat/vercel.mjs";
9
9
  const vercel = defineNitroPreset(
10
10
  {
11
11
  extends: "node",
@@ -48,9 +48,18 @@ const vercelEdge = defineNitroPreset(
48
48
  deploy: "",
49
49
  preview: ""
50
50
  },
51
- unenv: unenvWorkerdPreset,
51
+ unenv: {
52
+ external: builtnNodeModules.flatMap((m) => `node:${m}`),
53
+ alias: {
54
+ ...Object.fromEntries(
55
+ builtnNodeModules.flatMap((m) => [
56
+ [m, `node:${m}`],
57
+ [`node:${m}`, `node:${m}`]
58
+ ])
59
+ )
60
+ }
61
+ },
52
62
  rollupConfig: {
53
- plugins: [hybridNodePlugin],
54
63
  output: {
55
64
  format: "module"
56
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.11.0-20250228-210425.a45b6fe7",
3
+ "version": "2.11.0-20250301-081015.fcba06e1",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",