@powerlines/plugin-cloudflare 0.5.4 → 0.5.7
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/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/components/cloudflare-builtin.cjs +917 -0
- package/dist/components/cloudflare-builtin.d.cts +13 -0
- package/dist/components/cloudflare-builtin.d.cts.map +1 -0
- package/dist/components/cloudflare-builtin.d.mts +13 -0
- package/dist/components/cloudflare-builtin.d.mts.map +1 -0
- package/dist/components/cloudflare-builtin.mjs +915 -0
- package/dist/components/cloudflare-builtin.mjs.map +1 -0
- package/dist/components/env-builtin.cjs +32 -0
- package/dist/components/env-builtin.d.cts +13 -0
- package/dist/components/env-builtin.d.cts.map +1 -0
- package/dist/components/env-builtin.d.mts +13 -0
- package/dist/components/env-builtin.d.mts.map +1 -0
- package/dist/components/env-builtin.mjs +30 -0
- package/dist/components/env-builtin.mjs.map +1 -0
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.cts +4 -0
- package/dist/components/index.d.mts +4 -0
- package/dist/components/index.mjs +5 -0
- package/dist/components/worker-entry.cjs +203 -0
- package/dist/components/worker-entry.d.cts +16 -0
- package/dist/components/worker-entry.d.cts.map +1 -0
- package/dist/components/worker-entry.d.mts +16 -0
- package/dist/components/worker-entry.d.mts.map +1 -0
- package/dist/components/worker-entry.mjs +201 -0
- package/dist/components/worker-entry.mjs.map +1 -0
- package/dist/index.cjs +168 -0
- package/dist/index.d.cts +20 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +160 -0
- package/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@cloudflare_unenv-preset@2.15.0_unenv@2.0.0-rc.24/node_modules/@cloudflare/unenv-preset/dist/index.cjs +370 -0
- package/dist/node_modules/.pnpm/@cloudflare_unenv-preset@2.15.0_unenv@2.0.0-rc.24/node_modules/@cloudflare/unenv-preset/dist/index.mjs +367 -0
- package/dist/node_modules/.pnpm/@cloudflare_unenv-preset@2.15.0_unenv@2.0.0-rc.24/node_modules/@cloudflare/unenv-preset/dist/index.mjs.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +76 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +76 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/types/worker-module.cjs +0 -0
- package/dist/types/worker-module.d.cts +35 -0
- package/dist/types/worker-module.d.cts.map +1 -0
- package/dist/types/worker-module.d.mts +35 -0
- package/dist/types/worker-module.d.mts.map +1 -0
- package/dist/types/worker-module.mjs +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
const require_runtime = require('../../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let node_url = require("node:url");
|
|
3
|
+
node_url = require_runtime.__toESM(node_url);
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_runtime.__toESM(node_path);
|
|
6
|
+
let node_module = require("node:module");
|
|
7
|
+
node_module = require_runtime.__toESM(node_module);
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.15.0_unenv@2.0.0-rc.24/node_modules/@cloudflare/unenv-preset/dist/index.mjs
|
|
10
|
+
const __filename$1 = node_url.default.fileURLToPath(require("url").pathToFileURL(__filename).href);
|
|
11
|
+
node_path.default.dirname(__filename$1);
|
|
12
|
+
node_module.default.createRequire(require("url").pathToFileURL(__filename).href);
|
|
13
|
+
const version = "2.15.0";
|
|
14
|
+
const defaultNativeModules = [
|
|
15
|
+
"_stream_duplex",
|
|
16
|
+
"_stream_passthrough",
|
|
17
|
+
"_stream_readable",
|
|
18
|
+
"_stream_transform",
|
|
19
|
+
"_stream_writable",
|
|
20
|
+
"_tls_common",
|
|
21
|
+
"_tls_wrap",
|
|
22
|
+
"assert",
|
|
23
|
+
"assert/strict",
|
|
24
|
+
"async_hooks",
|
|
25
|
+
"buffer",
|
|
26
|
+
"constants",
|
|
27
|
+
"crypto",
|
|
28
|
+
"diagnostics_channel",
|
|
29
|
+
"dns",
|
|
30
|
+
"dns/promises",
|
|
31
|
+
"events",
|
|
32
|
+
"net",
|
|
33
|
+
"path",
|
|
34
|
+
"path/posix",
|
|
35
|
+
"path/win32",
|
|
36
|
+
"querystring",
|
|
37
|
+
"module",
|
|
38
|
+
"stream",
|
|
39
|
+
"stream/consumers",
|
|
40
|
+
"stream/promises",
|
|
41
|
+
"stream/web",
|
|
42
|
+
"string_decoder",
|
|
43
|
+
"sys",
|
|
44
|
+
"timers",
|
|
45
|
+
"timers/promises",
|
|
46
|
+
"tls",
|
|
47
|
+
"url",
|
|
48
|
+
"util",
|
|
49
|
+
"util/types",
|
|
50
|
+
"zlib"
|
|
51
|
+
];
|
|
52
|
+
function getCloudflarePreset({ compatibilityDate = "2024-09-03", compatibilityFlags = [] }) {
|
|
53
|
+
const compat = {
|
|
54
|
+
compatibilityDate,
|
|
55
|
+
compatibilityFlags
|
|
56
|
+
};
|
|
57
|
+
const overrides = [
|
|
58
|
+
getHttpOverrides(compat),
|
|
59
|
+
getHttp2Overrides(compat),
|
|
60
|
+
getOsOverrides(compat),
|
|
61
|
+
getFsOverrides(compat),
|
|
62
|
+
getPunycodeOverrides(compat),
|
|
63
|
+
getClusterOverrides(compat),
|
|
64
|
+
getTraceEventsOverrides(compat),
|
|
65
|
+
getDomainOverrides(compat),
|
|
66
|
+
getWasiOverrides(compat),
|
|
67
|
+
getConsoleOverrides(compat),
|
|
68
|
+
getVmOverrides(compat),
|
|
69
|
+
getInspectorOverrides(compat),
|
|
70
|
+
getSqliteOverrides(compat),
|
|
71
|
+
getDgramOverrides(compat),
|
|
72
|
+
getStreamWrapOverrides(compat),
|
|
73
|
+
getReplOverrides(compat),
|
|
74
|
+
getProcessOverrides(compat),
|
|
75
|
+
getV8Overrides(compat),
|
|
76
|
+
getTtyOverrides(compat),
|
|
77
|
+
getChildProcessOverrides(compat),
|
|
78
|
+
getWorkerThreadsOverrides(compat),
|
|
79
|
+
getReadlineOverrides(compat),
|
|
80
|
+
getPerfHooksOverrides(compat)
|
|
81
|
+
];
|
|
82
|
+
const nativeModules = [...defaultNativeModules, ...overrides.flatMap((o) => o.nativeModules)];
|
|
83
|
+
const hybridModules = overrides.flatMap((o) => o.hybridModules);
|
|
84
|
+
const injects = Object.assign({}, ...overrides.map((o) => o.inject ?? {}));
|
|
85
|
+
const polyfills = overrides.flatMap((o) => o.polyfills ?? []);
|
|
86
|
+
return {
|
|
87
|
+
meta: {
|
|
88
|
+
name: "unenv:cloudflare",
|
|
89
|
+
version,
|
|
90
|
+
url: __filename$1
|
|
91
|
+
},
|
|
92
|
+
alias: {
|
|
93
|
+
...Object.fromEntries(nativeModules.flatMap((p) => [[p, p], [`node:${p}`, `node:${p}`]])),
|
|
94
|
+
...Object.fromEntries(hybridModules.flatMap((m) => [[m, `@cloudflare/unenv-preset/node/${m}`], [`node:${m}`, `@cloudflare/unenv-preset/node/${m}`]]))
|
|
95
|
+
},
|
|
96
|
+
inject: {
|
|
97
|
+
Buffer: false,
|
|
98
|
+
global: false,
|
|
99
|
+
clearImmediate: false,
|
|
100
|
+
setImmediate: false,
|
|
101
|
+
...injects
|
|
102
|
+
},
|
|
103
|
+
polyfill: polyfills,
|
|
104
|
+
external: nativeModules.flatMap((p) => [p, `node:${p}`])
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function getHttpOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
108
|
+
const httpDisabledByFlag = compatibilityFlags.includes("disable_nodejs_http_modules");
|
|
109
|
+
if (!((compatibilityFlags.includes("enable_nodejs_http_modules") || compatibilityDate >= "2025-08-15") && !httpDisabledByFlag)) return {
|
|
110
|
+
nativeModules: [],
|
|
111
|
+
hybridModules: []
|
|
112
|
+
};
|
|
113
|
+
const httpServerEnabledByFlag = compatibilityFlags.includes("enable_nodejs_http_server_modules");
|
|
114
|
+
const httpServerDisabledByFlag = compatibilityFlags.includes("disable_nodejs_http_server_modules");
|
|
115
|
+
return {
|
|
116
|
+
nativeModules: [
|
|
117
|
+
"_http_agent",
|
|
118
|
+
"_http_client",
|
|
119
|
+
"_http_common",
|
|
120
|
+
"_http_incoming",
|
|
121
|
+
"_http_outgoing",
|
|
122
|
+
...(httpServerEnabledByFlag || compatibilityDate >= "2025-09-01") && !httpServerDisabledByFlag ? ["_http_server"] : [],
|
|
123
|
+
"http",
|
|
124
|
+
"https"
|
|
125
|
+
],
|
|
126
|
+
hybridModules: []
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function getHttp2Overrides({ compatibilityDate, compatibilityFlags }) {
|
|
130
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_http2_module");
|
|
131
|
+
return (compatibilityFlags.includes("enable_nodejs_http2_module") || compatibilityDate >= "2025-09-01") && !disabledByFlag ? {
|
|
132
|
+
nativeModules: ["http2"],
|
|
133
|
+
hybridModules: []
|
|
134
|
+
} : {
|
|
135
|
+
nativeModules: [],
|
|
136
|
+
hybridModules: []
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function getOsOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
140
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_os_module");
|
|
141
|
+
return (compatibilityFlags.includes("enable_nodejs_os_module") || compatibilityDate >= "2025-09-15") && !disabledByFlag ? {
|
|
142
|
+
nativeModules: ["os"],
|
|
143
|
+
hybridModules: []
|
|
144
|
+
} : {
|
|
145
|
+
nativeModules: [],
|
|
146
|
+
hybridModules: []
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function getFsOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
150
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_fs_module");
|
|
151
|
+
return (compatibilityFlags.includes("enable_nodejs_fs_module") || compatibilityDate >= "2025-09-15") && !disabledByFlag ? {
|
|
152
|
+
nativeModules: ["fs/promises", "fs"],
|
|
153
|
+
hybridModules: []
|
|
154
|
+
} : {
|
|
155
|
+
nativeModules: [],
|
|
156
|
+
hybridModules: []
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function getPunycodeOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
160
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_punycode_module");
|
|
161
|
+
return (compatibilityFlags.includes("enable_nodejs_punycode_module") || compatibilityDate >= "2025-12-04") && !disabledByFlag ? {
|
|
162
|
+
nativeModules: ["punycode"],
|
|
163
|
+
hybridModules: []
|
|
164
|
+
} : {
|
|
165
|
+
nativeModules: [],
|
|
166
|
+
hybridModules: []
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function getClusterOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
170
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_cluster_module");
|
|
171
|
+
return (compatibilityFlags.includes("enable_nodejs_cluster_module") || compatibilityDate >= "2025-12-04") && !disabledByFlag ? {
|
|
172
|
+
nativeModules: ["cluster"],
|
|
173
|
+
hybridModules: []
|
|
174
|
+
} : {
|
|
175
|
+
nativeModules: [],
|
|
176
|
+
hybridModules: []
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function getTraceEventsOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
180
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_trace_events_module");
|
|
181
|
+
return (compatibilityFlags.includes("enable_nodejs_trace_events_module") || compatibilityDate >= "2025-12-04") && !disabledByFlag ? {
|
|
182
|
+
nativeModules: ["trace_events"],
|
|
183
|
+
hybridModules: []
|
|
184
|
+
} : {
|
|
185
|
+
nativeModules: [],
|
|
186
|
+
hybridModules: []
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function getDomainOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
190
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_domain_module");
|
|
191
|
+
return (compatibilityFlags.includes("enable_nodejs_domain_module") || compatibilityDate >= "2025-12-04") && !disabledByFlag ? {
|
|
192
|
+
nativeModules: ["domain"],
|
|
193
|
+
hybridModules: []
|
|
194
|
+
} : {
|
|
195
|
+
nativeModules: [],
|
|
196
|
+
hybridModules: []
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function getWasiOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
200
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_wasi_module");
|
|
201
|
+
return (compatibilityFlags.includes("enable_nodejs_wasi_module") || compatibilityDate >= "2025-12-04") && !disabledByFlag ? {
|
|
202
|
+
nativeModules: ["wasi"],
|
|
203
|
+
hybridModules: []
|
|
204
|
+
} : {
|
|
205
|
+
nativeModules: [],
|
|
206
|
+
hybridModules: []
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function getConsoleOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
210
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_console_module");
|
|
211
|
+
return (compatibilityFlags.includes("enable_nodejs_console_module") || compatibilityDate >= "2025-09-21") && !disabledByFlag ? {
|
|
212
|
+
nativeModules: ["console"],
|
|
213
|
+
hybridModules: [],
|
|
214
|
+
inject: {}
|
|
215
|
+
} : {
|
|
216
|
+
nativeModules: [],
|
|
217
|
+
hybridModules: ["console"],
|
|
218
|
+
inject: { console: "@cloudflare/unenv-preset/node/console" }
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function getVmOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
222
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_vm_module");
|
|
223
|
+
return (compatibilityFlags.includes("enable_nodejs_vm_module") || compatibilityDate >= "2025-10-01") && !disabledByFlag ? {
|
|
224
|
+
nativeModules: ["vm"],
|
|
225
|
+
hybridModules: []
|
|
226
|
+
} : {
|
|
227
|
+
nativeModules: [],
|
|
228
|
+
hybridModules: []
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function getInspectorOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
232
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_inspector_module");
|
|
233
|
+
return (compatibilityFlags.includes("enable_nodejs_inspector_module") || compatibilityDate >= "2026-01-29") && !disabledByFlag ? {
|
|
234
|
+
nativeModules: ["inspector/promises", "inspector"],
|
|
235
|
+
hybridModules: []
|
|
236
|
+
} : {
|
|
237
|
+
nativeModules: [],
|
|
238
|
+
hybridModules: []
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function getSqliteOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
242
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_sqlite_module");
|
|
243
|
+
return (compatibilityFlags.includes("enable_nodejs_sqlite_module") || compatibilityDate >= "2026-01-29") && !disabledByFlag ? {
|
|
244
|
+
nativeModules: ["sqlite"],
|
|
245
|
+
hybridModules: []
|
|
246
|
+
} : {
|
|
247
|
+
nativeModules: [],
|
|
248
|
+
hybridModules: []
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function getDgramOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
252
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_dgram_module");
|
|
253
|
+
return (compatibilityFlags.includes("enable_nodejs_dgram_module") || compatibilityDate >= "2026-01-29") && !disabledByFlag ? {
|
|
254
|
+
nativeModules: ["dgram"],
|
|
255
|
+
hybridModules: []
|
|
256
|
+
} : {
|
|
257
|
+
nativeModules: [],
|
|
258
|
+
hybridModules: []
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function getStreamWrapOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
262
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_stream_wrap_module");
|
|
263
|
+
return (compatibilityFlags.includes("enable_nodejs_stream_wrap_module") || compatibilityDate >= "2026-01-29") && !disabledByFlag ? {
|
|
264
|
+
nativeModules: ["_stream_wrap"],
|
|
265
|
+
hybridModules: []
|
|
266
|
+
} : {
|
|
267
|
+
nativeModules: [],
|
|
268
|
+
hybridModules: []
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function getReplOverrides({ compatibilityFlags }) {
|
|
272
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_repl_module");
|
|
273
|
+
return compatibilityFlags.includes("enable_nodejs_repl_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
274
|
+
nativeModules: ["repl"],
|
|
275
|
+
hybridModules: []
|
|
276
|
+
} : {
|
|
277
|
+
nativeModules: [],
|
|
278
|
+
hybridModules: []
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function getProcessOverrides({ compatibilityDate, compatibilityFlags }) {
|
|
282
|
+
const disabledV2ByFlag = compatibilityFlags.includes("disable_nodejs_process_v2");
|
|
283
|
+
const enabledV2ByFlag = compatibilityFlags.includes("enable_nodejs_process_v2");
|
|
284
|
+
const enabledV2ByDate = compatibilityDate >= "2025-09-15";
|
|
285
|
+
return hasFetchIterableFixes({
|
|
286
|
+
compatibilityDate,
|
|
287
|
+
compatibilityFlags
|
|
288
|
+
}) && (enabledV2ByFlag || enabledV2ByDate) && !disabledV2ByFlag ? {
|
|
289
|
+
nativeModules: ["process"],
|
|
290
|
+
hybridModules: [],
|
|
291
|
+
inject: { process: false }
|
|
292
|
+
} : {
|
|
293
|
+
nativeModules: [],
|
|
294
|
+
hybridModules: ["process"],
|
|
295
|
+
inject: { process: "@cloudflare/unenv-preset/node/process" }
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function hasFetchIterableFixes({ compatibilityDate, compatibilityFlags }) {
|
|
299
|
+
const supportEnabledByFlag = compatibilityFlags.includes("fetch_iterable_type_support");
|
|
300
|
+
const supportDisabledByFlag = compatibilityFlags.includes("no_fetch_iterable_type_support");
|
|
301
|
+
if (!((compatibilityDate >= "2026-02-19" || supportEnabledByFlag) && !supportDisabledByFlag)) return false;
|
|
302
|
+
const adjustmentEnabledByFlag = compatibilityFlags.includes("fetch_iterable_type_support_override_adjustment");
|
|
303
|
+
const adjustmentDisabledByFlag = compatibilityFlags.includes("no_fetch_iterable_type_support_override_adjustment");
|
|
304
|
+
return (adjustmentEnabledByFlag || compatibilityDate >= "2026-01-15") && !adjustmentDisabledByFlag;
|
|
305
|
+
}
|
|
306
|
+
function getV8Overrides({ compatibilityFlags }) {
|
|
307
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_v8_module");
|
|
308
|
+
return compatibilityFlags.includes("enable_nodejs_v8_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
309
|
+
nativeModules: ["v8"],
|
|
310
|
+
hybridModules: []
|
|
311
|
+
} : {
|
|
312
|
+
nativeModules: [],
|
|
313
|
+
hybridModules: []
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
function getTtyOverrides({ compatibilityFlags }) {
|
|
317
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_tty_module");
|
|
318
|
+
return compatibilityFlags.includes("enable_nodejs_tty_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
319
|
+
nativeModules: ["tty"],
|
|
320
|
+
hybridModules: []
|
|
321
|
+
} : {
|
|
322
|
+
nativeModules: [],
|
|
323
|
+
hybridModules: []
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function getChildProcessOverrides({ compatibilityFlags }) {
|
|
327
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_child_process_module");
|
|
328
|
+
return compatibilityFlags.includes("enable_nodejs_child_process_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
329
|
+
nativeModules: ["child_process"],
|
|
330
|
+
hybridModules: []
|
|
331
|
+
} : {
|
|
332
|
+
nativeModules: [],
|
|
333
|
+
hybridModules: []
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function getWorkerThreadsOverrides({ compatibilityFlags }) {
|
|
337
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_worker_threads_module");
|
|
338
|
+
return compatibilityFlags.includes("enable_nodejs_worker_threads_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
339
|
+
nativeModules: ["worker_threads"],
|
|
340
|
+
hybridModules: []
|
|
341
|
+
} : {
|
|
342
|
+
nativeModules: [],
|
|
343
|
+
hybridModules: []
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function getReadlineOverrides({ compatibilityFlags }) {
|
|
347
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_readline_module");
|
|
348
|
+
return compatibilityFlags.includes("enable_nodejs_readline_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
349
|
+
nativeModules: ["readline", "readline/promises"],
|
|
350
|
+
hybridModules: []
|
|
351
|
+
} : {
|
|
352
|
+
nativeModules: [],
|
|
353
|
+
hybridModules: []
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function getPerfHooksOverrides({ compatibilityFlags }) {
|
|
357
|
+
const disabledByFlag = compatibilityFlags.includes("disable_nodejs_perf_hooks_module");
|
|
358
|
+
return compatibilityFlags.includes("enable_nodejs_perf_hooks_module") && compatibilityFlags.includes("experimental") && !disabledByFlag ? {
|
|
359
|
+
nativeModules: ["perf_hooks"],
|
|
360
|
+
hybridModules: []
|
|
361
|
+
} : {
|
|
362
|
+
nativeModules: [],
|
|
363
|
+
hybridModules: [],
|
|
364
|
+
polyfills: ["@cloudflare/unenv-preset/polyfill/performance"]
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
const cloudflare = getCloudflarePreset({});
|
|
368
|
+
|
|
369
|
+
//#endregion
|
|
370
|
+
exports.getCloudflarePreset = getCloudflarePreset;
|