nitro-nightly 4.0.0-20251010-091516-7cafddba → 4.0.0-20251030-121649-98b56dfe

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.
Files changed (252) hide show
  1. package/dist/_build/common.mjs +763 -0
  2. package/dist/_build/rolldown.mjs +216 -0
  3. package/dist/_build/rollup.mjs +359 -0
  4. package/dist/_build/vite.build.mjs +67 -0
  5. package/dist/_build/vite.plugin.mjs +747 -0
  6. package/dist/_chunks/B-7HiF0V.mjs +1303 -0
  7. package/dist/_chunks/B3asVbT4.mjs +151 -0
  8. package/dist/_chunks/B5ooyfLk.mjs +372 -0
  9. package/dist/_chunks/DXMHy5ca.mjs +43 -0
  10. package/dist/_dev.d.mts +12 -0
  11. package/dist/_dev.mjs +675 -0
  12. package/dist/_libs/acorn.mjs +5034 -0
  13. package/dist/_libs/c12.mjs +2798 -0
  14. package/dist/_libs/chokidar.mjs +1560 -0
  15. package/dist/_libs/citty.mjs +333 -0
  16. package/dist/_libs/commondir.mjs +22 -0
  17. package/dist/_libs/compatx.mjs +46 -0
  18. package/dist/_libs/confbox.mjs +2920 -0
  19. package/dist/_libs/debug.mjs +848 -0
  20. package/dist/_libs/deepmerge.mjs +86 -0
  21. package/dist/_libs/depd.mjs +314 -0
  22. package/dist/_libs/dot-prop.mjs +138 -0
  23. package/dist/_libs/duplexer.mjs +71 -0
  24. package/dist/_libs/ee-first.mjs +68 -0
  25. package/dist/_libs/encodeurl.mjs +49 -0
  26. package/dist/_libs/escape-html.mjs +58 -0
  27. package/dist/_libs/escape-string-regexp.mjs +8 -0
  28. package/dist/_libs/estree-walker.mjs +330 -0
  29. package/dist/_libs/etag.mjs +75 -0
  30. package/dist/_libs/fdir.mjs +514 -0
  31. package/dist/_libs/fresh.mjs +85 -0
  32. package/dist/_libs/function-bind.mjs +63 -0
  33. package/dist/_libs/gen-mapping.mjs +612 -0
  34. package/dist/_libs/giget.mjs +19076 -0
  35. package/dist/_libs/gzip-size.mjs +21 -0
  36. package/dist/_libs/hasown.mjs +14 -0
  37. package/dist/_libs/http-errors.mjs +436 -0
  38. package/dist/_libs/httpxy.mjs +410 -0
  39. package/dist/_libs/is-core-module.mjs +220 -0
  40. package/dist/_libs/is-module.mjs +13 -0
  41. package/dist/_libs/is-reference.mjs +32 -0
  42. package/dist/_libs/js-tokens.mjs +382 -0
  43. package/dist/_libs/klona.mjs +90 -0
  44. package/dist/_libs/knitwork.mjs +124 -0
  45. package/dist/_libs/local-pkg.mjs +1686 -0
  46. package/dist/_libs/magic-string.mjs +939 -0
  47. package/dist/_libs/mime-db.mjs +7642 -0
  48. package/dist/_libs/mime-types.mjs +162 -0
  49. package/dist/_libs/mime.mjs +1391 -0
  50. package/dist/_libs/node-fetch-native.mjs +173 -0
  51. package/dist/_libs/on-finished.mjs +170 -0
  52. package/dist/_libs/parseurl.mjs +103 -0
  53. package/dist/_libs/path-parse.mjs +47 -0
  54. package/dist/_libs/pathe.mjs +41 -0
  55. package/dist/_libs/picomatch.mjs +1673 -0
  56. package/dist/_libs/plugin-alias.mjs +64 -0
  57. package/dist/_libs/plugin-commonjs.mjs +1489 -0
  58. package/dist/_libs/plugin-inject.mjs +135 -0
  59. package/dist/_libs/plugin-json.mjs +36 -0
  60. package/dist/_libs/plugin-node-resolve.mjs +1553 -0
  61. package/dist/_libs/plugin-replace.mjs +104 -0
  62. package/dist/_libs/pretty-bytes.mjs +116 -0
  63. package/dist/_libs/range-parser.mjs +102 -0
  64. package/dist/_libs/remapping.mjs +117 -0
  65. package/dist/_libs/rou3.mjs +311 -0
  66. package/dist/_libs/send.mjs +857 -0
  67. package/dist/_libs/serve-static.mjs +124 -0
  68. package/dist/_libs/std-env.mjs +158 -0
  69. package/dist/_libs/strip-literal.mjs +51 -0
  70. package/dist/_libs/tinyglobby.mjs +292 -0
  71. package/dist/_libs/ultrahtml.mjs +138 -0
  72. package/dist/_libs/unimport.mjs +3520 -0
  73. package/dist/_libs/untyped.mjs +271 -0
  74. package/dist/_libs/unwasm.mjs +5825 -0
  75. package/dist/_libs/vite-plugin-fullstack.mjs +561 -0
  76. package/dist/_presets.mjs +1723 -0
  77. package/dist/builder.d.mts +54 -0
  78. package/dist/builder.mjs +45 -0
  79. package/dist/cli/_chunks/build.mjs +43 -0
  80. package/dist/cli/_chunks/common.mjs +15 -0
  81. package/dist/cli/_chunks/detect-acorn.mjs +12 -0
  82. package/dist/cli/_chunks/dev.mjs +79 -0
  83. package/dist/cli/_chunks/dist.mjs +3 -0
  84. package/dist/cli/_chunks/dist2.mjs +4 -0
  85. package/dist/cli/_chunks/esm.mjs +3 -0
  86. package/dist/cli/_chunks/json5.mjs +4 -0
  87. package/dist/cli/_chunks/jsonc.mjs +4 -0
  88. package/dist/cli/_chunks/list.mjs +27 -0
  89. package/dist/cli/_chunks/multipart-parser.mjs +6 -0
  90. package/dist/cli/_chunks/prepare.mjs +19 -0
  91. package/dist/cli/_chunks/run.mjs +55 -0
  92. package/dist/cli/_chunks/task.mjs +16 -0
  93. package/dist/cli/_chunks/toml.mjs +4 -0
  94. package/dist/cli/_chunks/yaml.mjs +4 -0
  95. package/dist/cli/index.d.mts +1 -1
  96. package/dist/cli/index.mjs +20 -476
  97. package/dist/node_modules/@speed-highlight/core/dist/index.js +1 -1
  98. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +1 -1
  99. package/dist/node_modules/@speed-highlight/core/package.json +7 -3
  100. package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
  101. package/dist/node_modules/cookie-es/package.json +37 -0
  102. package/dist/node_modules/hookable/dist/index.mjs +243 -266
  103. package/dist/node_modules/hookable/package.json +29 -26
  104. package/dist/node_modules/rendu/dist/index.mjs +380 -0
  105. package/dist/node_modules/rendu/package.json +47 -0
  106. package/dist/presets/_nitro/runtime/nitro-dev.d.mts +1 -0
  107. package/dist/presets/_nitro/runtime/nitro-dev.mjs +44 -38
  108. package/dist/presets/_nitro/runtime/nitro-prerenderer.d.mts +2 -2
  109. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +9 -12
  110. package/dist/presets/_nitro/runtime/service-worker.d.mts +1 -0
  111. package/dist/presets/_nitro/runtime/service-worker.mjs +14 -11
  112. package/dist/presets/aws-amplify/runtime/aws-amplify.d.mts +1 -0
  113. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +6 -5
  114. package/dist/presets/aws-lambda/runtime/_utils.d.mts +8 -13
  115. package/dist/presets/aws-lambda/runtime/_utils.mjs +95 -81
  116. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.mts +1 -2
  117. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +25 -27
  118. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +7 -7
  119. package/dist/presets/azure/runtime/_utils.mjs +43 -43
  120. package/dist/presets/azure/runtime/azure-swa.d.mts +2 -2
  121. package/dist/presets/azure/runtime/azure-swa.mjs +22 -21
  122. package/dist/presets/bun/runtime/bun.d.mts +1 -0
  123. package/dist/presets/bun/runtime/bun.mjs +18 -17
  124. package/dist/presets/cloudflare/runtime/_module-handler.d.mts +10 -7
  125. package/dist/presets/cloudflare/runtime/_module-handler.mjs +79 -87
  126. package/dist/presets/cloudflare/runtime/cloudflare-durable.d.mts +6 -14
  127. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +55 -61
  128. package/dist/presets/cloudflare/runtime/cloudflare-module.d.mts +1 -7
  129. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +12 -14
  130. package/dist/presets/cloudflare/runtime/cloudflare-pages.d.mts +12 -12
  131. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +35 -39
  132. package/dist/presets/cloudflare/runtime/plugin.dev.d.mts +2 -2
  133. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +89 -82
  134. package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
  135. package/dist/presets/deno/runtime/deno-deploy.d.mts +1 -0
  136. package/dist/presets/deno/runtime/deno-deploy.mjs +12 -11
  137. package/dist/presets/deno/runtime/deno-server.d.mts +2 -1
  138. package/dist/presets/deno/runtime/deno-server.mjs +31 -39
  139. package/dist/presets/netlify/runtime/netlify-edge.d.mts +2 -1
  140. package/dist/presets/netlify/runtime/netlify-edge.mjs +14 -11
  141. package/dist/presets/netlify/runtime/netlify.mjs +11 -17
  142. package/dist/presets/node/runtime/node-cluster.mjs +49 -48
  143. package/dist/presets/node/runtime/node-middleware.d.mts +3 -2
  144. package/dist/presets/node/runtime/node-middleware.mjs +7 -6
  145. package/dist/presets/node/runtime/node-server.mjs +34 -24
  146. package/dist/presets/standard/runtime/server.d.mts +1 -3
  147. package/dist/presets/standard/runtime/server.mjs +1 -3
  148. package/dist/presets/stormkit/runtime/stormkit.d.mts +13 -13
  149. package/dist/presets/stormkit/runtime/stormkit.mjs +20 -20
  150. package/dist/presets/vercel/runtime/vercel.d.mts +3 -3
  151. package/dist/presets/vercel/runtime/vercel.mjs +15 -14
  152. package/dist/presets/winterjs/runtime/winterjs.d.mts +2 -0
  153. package/dist/presets/winterjs/runtime/winterjs.mjs +72 -68
  154. package/dist/presets/zeabur/runtime/zeabur.d.mts +1 -1
  155. package/dist/runtime/index.d.mts +13 -2
  156. package/dist/runtime/index.mjs +13 -8
  157. package/dist/runtime/internal/app.d.mts +3 -1
  158. package/dist/runtime/internal/app.mjs +179 -140
  159. package/dist/runtime/internal/cache.d.mts +10 -4
  160. package/dist/runtime/internal/cache.mjs +247 -216
  161. package/dist/runtime/internal/context.d.mts +9 -9
  162. package/dist/runtime/internal/context.mjs +17 -10
  163. package/dist/runtime/internal/database.mjs +8 -10
  164. package/dist/runtime/internal/error/dev.d.mts +5 -4
  165. package/dist/runtime/internal/error/dev.mjs +106 -105
  166. package/dist/runtime/internal/error/prod.d.mts +5 -4
  167. package/dist/runtime/internal/error/prod.mjs +51 -59
  168. package/dist/runtime/internal/error/utils.d.mts +4 -4
  169. package/dist/runtime/internal/error/utils.mjs +1 -1
  170. package/dist/runtime/internal/index.d.mts +2 -0
  171. package/dist/runtime/internal/index.mjs +2 -0
  172. package/dist/runtime/internal/lib/http-graceful-shutdown.d.mts +14 -14
  173. package/dist/runtime/internal/lib/http-graceful-shutdown.mjs +248 -209
  174. package/dist/runtime/internal/meta.d.mts +1 -1
  175. package/dist/runtime/internal/meta.mjs +1 -1
  176. package/dist/runtime/internal/plugin.d.mts +2 -2
  177. package/dist/runtime/internal/plugin.mjs +1 -1
  178. package/dist/runtime/internal/renderer.mjs +40 -32
  179. package/dist/runtime/internal/route-rules.d.mts +8 -8
  180. package/dist/runtime/internal/route-rules.mjs +53 -51
  181. package/dist/runtime/internal/routes/dev-tasks.d.mts +1 -2
  182. package/dist/runtime/internal/routes/dev-tasks.mjs +15 -17
  183. package/dist/runtime/internal/routes/openapi.d.mts +1 -0
  184. package/dist/runtime/internal/routes/openapi.mjs +81 -87
  185. package/dist/runtime/internal/routes/renderer-template.d.mts +1 -1
  186. package/dist/runtime/internal/routes/renderer-template.dev.d.mts +1 -2
  187. package/dist/runtime/internal/routes/renderer-template.dev.mjs +10 -17
  188. package/dist/runtime/internal/routes/renderer-template.mjs +1 -1
  189. package/dist/runtime/internal/routes/scalar.d.mts +1 -0
  190. package/dist/runtime/internal/routes/scalar.mjs +22 -23
  191. package/dist/runtime/internal/routes/swagger.d.mts +1 -0
  192. package/dist/runtime/internal/routes/swagger.mjs +9 -11
  193. package/dist/runtime/internal/runtime-config.d.mts +4 -4
  194. package/dist/runtime/internal/runtime-config.mjs +40 -35
  195. package/dist/runtime/internal/shutdown.d.mts +2 -8
  196. package/dist/runtime/internal/shutdown.mjs +32 -30
  197. package/dist/runtime/internal/static.mjs +63 -74
  198. package/dist/runtime/internal/storage.mjs +2 -2
  199. package/dist/runtime/internal/task.d.mts +6 -6
  200. package/dist/runtime/internal/task.mjs +56 -60
  201. package/dist/runtime/internal/utils.d.mts +1 -1
  202. package/dist/runtime/internal/utils.mjs +4 -10
  203. package/dist/types/index.d.mts +2594 -2286
  204. package/dist/types/index.mjs +1 -1
  205. package/dist/vite.d.mts +56 -47
  206. package/dist/vite.mjs +55 -68
  207. package/lib/index.d.mts +1 -0
  208. package/lib/index.mjs +1 -0
  209. package/lib/runtime/meta.mjs +35 -0
  210. package/package.json +49 -50
  211. package/dist/_chunks/app.mjs +0 -19797
  212. package/dist/_chunks/build.mjs +0 -84
  213. package/dist/_chunks/build2.mjs +0 -318
  214. package/dist/_chunks/build3.mjs +0 -6452
  215. package/dist/_chunks/detect-acorn.mjs +0 -503
  216. package/dist/_chunks/index.mjs +0 -22242
  217. package/dist/_chunks/index2.mjs +0 -297
  218. package/dist/_chunks/index3.mjs +0 -1058
  219. package/dist/_chunks/index4.mjs +0 -1206
  220. package/dist/_chunks/info.mjs +0 -11157
  221. package/dist/_chunks/json5.mjs +0 -68
  222. package/dist/_chunks/jsonc.mjs +0 -51
  223. package/dist/_chunks/pathe.M-eThtNZ.mjs +0 -204
  224. package/dist/_chunks/plugin.mjs +0 -960
  225. package/dist/_chunks/server.mjs +0 -254
  226. package/dist/_chunks/snapshot.mjs +0 -284
  227. package/dist/_chunks/toml.mjs +0 -259
  228. package/dist/_chunks/yaml.mjs +0 -86
  229. package/dist/cli/build.mjs +0 -54
  230. package/dist/cli/common.mjs +0 -13
  231. package/dist/cli/dev.mjs +0 -95
  232. package/dist/cli/index2.mjs +0 -17
  233. package/dist/cli/list.mjs +0 -34
  234. package/dist/cli/prepare.mjs +0 -24
  235. package/dist/cli/run.mjs +0 -60
  236. package/dist/index.d.mts +0 -52
  237. package/dist/index.mjs +0 -55
  238. package/dist/node_modules/klona/dist/index.mjs +0 -81
  239. package/dist/node_modules/klona/full/index.mjs +0 -53
  240. package/dist/node_modules/klona/package.json +0 -74
  241. package/dist/node_modules/std-env/dist/index.mjs +0 -1
  242. package/dist/node_modules/std-env/package.json +0 -46
  243. package/dist/presets.mjs +0 -2460
  244. package/dist/runtime/internal/debug.d.mts +0 -2
  245. package/dist/runtime/internal/debug.mjs +0 -5
  246. package/dist/runtime/internal/empty.d.mts +0 -0
  247. package/dist/runtime/internal/vite/dev-entry.d.mts +0 -1
  248. package/dist/runtime/internal/vite/dev-worker.d.mts +0 -1
  249. package/dist/runtime/internal/vite/prod-setup.d.mts +0 -4
  250. package/dist/runtime/internal/vite/ssr-renderer.d.mts +0 -4
  251. package/lib/runtime-meta.mjs +0 -38
  252. /package/lib/{runtime-meta.d.mts → runtime/meta.d.mts} +0 -0
package/dist/cli/list.mjs DELETED
@@ -1,34 +0,0 @@
1
- import { d as defineCommand } from './index.mjs';
2
- import { consola } from 'consola';
3
- import { loadOptions, listTasks } from 'nitro';
4
- import { r as resolve } from '../_chunks/pathe.M-eThtNZ.mjs';
5
- import 'consola/utils';
6
- import 'nitro/meta';
7
-
8
- const list = defineCommand({
9
- meta: {
10
- name: "run",
11
- description: "List available tasks (experimental)"
12
- },
13
- args: {
14
- dir: {
15
- type: "string",
16
- description: "project root directory"
17
- }
18
- },
19
- async run({ args }) {
20
- const cwd = resolve(args.dir || args.cwd || ".");
21
- const options = await loadOptions({ rootDir: cwd }).catch(() => void 0);
22
- const tasks = await listTasks({
23
- cwd,
24
- buildDir: options?.buildDir || ".nitro"
25
- });
26
- for (const [name, task] of Object.entries(tasks)) {
27
- consola.log(
28
- ` - \`${name}\`${task.meta?.description ? ` - ${task.meta.description}` : ""}`
29
- );
30
- }
31
- }
32
- });
33
-
34
- export { list as default };
@@ -1,24 +0,0 @@
1
- import { d as defineCommand } from './index.mjs';
2
- import { createNitro, writeTypes } from 'nitro';
3
- import { c as commonArgs } from './common.mjs';
4
- import { r as resolve } from '../_chunks/pathe.M-eThtNZ.mjs';
5
- import 'consola';
6
- import 'consola/utils';
7
- import 'nitro/meta';
8
-
9
- const prepare = defineCommand({
10
- meta: {
11
- name: "prepare",
12
- description: "Generate types for the project"
13
- },
14
- args: {
15
- ...commonArgs
16
- },
17
- async run({ args }) {
18
- const rootDir = resolve(args.dir || args._dir || ".");
19
- const nitro = await createNitro({ rootDir });
20
- await writeTypes(nitro);
21
- }
22
- });
23
-
24
- export { prepare as default };
package/dist/cli/run.mjs DELETED
@@ -1,60 +0,0 @@
1
- import { d as defineCommand } from './index.mjs';
2
- import { consola } from 'consola';
3
- import destr from 'destr';
4
- import { loadOptions, runTask } from 'nitro';
5
- import { r as resolve } from '../_chunks/pathe.M-eThtNZ.mjs';
6
- import 'consola/utils';
7
- import 'nitro/meta';
8
-
9
- const run = defineCommand({
10
- meta: {
11
- name: "run",
12
- description: "Run a runtime task in the currently running dev server (experimental)"
13
- },
14
- args: {
15
- name: {
16
- type: "positional",
17
- description: "task name",
18
- required: true
19
- },
20
- dir: {
21
- type: "string",
22
- description: "project root directory"
23
- },
24
- payload: {
25
- type: "string",
26
- description: "payload json to pass to the task"
27
- }
28
- },
29
- async run({ args }) {
30
- const cwd = resolve(args.dir || args.cwd || ".");
31
- const options = await loadOptions({ rootDir: cwd }).catch(() => void 0);
32
- consola.info(`Running task \`${args.name}\`...`);
33
- let payload = destr(args.payload || "{}");
34
- if (typeof payload !== "object") {
35
- consola.error(
36
- `Invalid payload: \`${args.payload}\` (it should be a valid JSON object)`
37
- );
38
- payload = void 0;
39
- }
40
- try {
41
- const { result } = await runTask(
42
- {
43
- name: args.name,
44
- context: {},
45
- payload
46
- },
47
- {
48
- cwd,
49
- buildDir: options?.buildDir || ".nitro"
50
- }
51
- );
52
- consola.success("Result:", result);
53
- } catch (error) {
54
- consola.error(`Failed to run task \`${args.name}\`: ${error}`);
55
- process.exit(1);
56
- }
57
- }
58
- });
59
-
60
- export { run as default };
package/dist/index.d.mts DELETED
@@ -1,52 +0,0 @@
1
- import { NitroConfig, LoadConfigOptions, Nitro, DevRPCHooks, DevMessageListener, NitroOptions, TaskEvent, TaskRunnerOptions } from 'nitro/types';
2
- import { IncomingMessage, OutgoingMessage } from 'node:http';
3
- import { Duplex } from 'node:stream';
4
- import { ServerOptions, Server } from 'srvx';
5
- import { HTTPHandler } from 'h3';
6
-
7
- declare function createNitro(config?: NitroConfig, opts?: LoadConfigOptions): Promise<Nitro>;
8
-
9
- declare function prerender(nitro: Nitro): Promise<void>;
10
-
11
- declare class NitroDevApp {
12
- #private;
13
- nitro: Nitro;
14
- fetch: (req: Request) => Response | Promise<Response>;
15
- constructor(nitro: Nitro, catchAllHandler?: HTTPHandler);
16
- }
17
-
18
- declare function createDevServer(nitro: Nitro): NitroDevServer;
19
- declare class NitroDevServer extends NitroDevApp implements DevRPCHooks {
20
- #private;
21
- constructor(nitro: Nitro);
22
- upgrade(req: IncomingMessage, socket: OutgoingMessage<IncomingMessage> | Duplex, head: any): Promise<void>;
23
- listen(opts?: Partial<Omit<ServerOptions, "fetch">>): Server;
24
- close(): Promise<void>;
25
- reload(): void;
26
- sendMessage(message: unknown): void;
27
- onMessage(listener: DevMessageListener): void;
28
- offMessage(listener: DevMessageListener): void;
29
- }
30
-
31
- declare function loadOptions(configOverrides?: NitroConfig, opts?: LoadConfigOptions): Promise<NitroOptions>;
32
-
33
- /** @experimental */
34
- declare function runTask(taskEvent: TaskEvent, opts?: TaskRunnerOptions): Promise<{
35
- result: unknown;
36
- }>;
37
- /** @experimental */
38
- declare function listTasks(opts?: TaskRunnerOptions): Promise<Record<string, {
39
- meta: {
40
- description: string;
41
- };
42
- }>>;
43
-
44
- declare function build(nitro: Nitro): Promise<void>;
45
-
46
- declare function copyPublicAssets(nitro: Nitro): Promise<void>;
47
-
48
- declare function prepare(nitro: Nitro): Promise<void>;
49
-
50
- declare function writeTypes(nitro: Nitro): Promise<void>;
51
-
52
- export { build, copyPublicAssets, createDevServer, createNitro, listTasks, loadOptions, prepare, prerender, runTask, writeTypes };
package/dist/index.mjs DELETED
@@ -1,55 +0,0 @@
1
- export { d as copyPublicAssets, i as createNitro, D as listTasks, A as loadOptions, j as prepare, B as runTask } from './_chunks/index.mjs';
2
- export { b as build, p as prerender, w as writeTypes } from './_chunks/index3.mjs';
3
- export { c as createDevServer } from './_chunks/server.mjs';
4
- import 'consola';
5
- import 'hookable';
6
- import 'nitro/runtime/meta';
7
- import 'node:fs';
8
- import 'node:fs/promises';
9
- import 'node:url';
10
- import 'node:os';
11
- import 'node:path';
12
- import 'node:assert';
13
- import 'node:process';
14
- import 'node:v8';
15
- import 'node:util';
16
- import 'jiti';
17
- import 'destr';
18
- import 'defu';
19
- import './_chunks/pathe.M-eThtNZ.mjs';
20
- import 'fs';
21
- import 'path';
22
- import 'os';
23
- import 'crypto';
24
- import './_chunks/app.mjs';
25
- import 'node:worker_threads';
26
- import 'std-env';
27
- import 'fs/promises';
28
- import 'events';
29
- import 'node:stream';
30
- import 'h3';
31
- import 'url';
32
- import 'tty';
33
- import 'util';
34
- import 'stream';
35
- import 'ufo';
36
- import 'node:http';
37
- import 'node:https';
38
- import 'node:events';
39
- import 'undici';
40
- import 'youch-core';
41
- import 'youch';
42
- import 'source-map';
43
- import 'srvx';
44
- import 'klona/full';
45
- import 'node:module';
46
- import 'ofetch';
47
- import 'klona';
48
- import 'unstorage';
49
- import 'ohash';
50
- import 'scule';
51
- import 'module';
52
- import 'consola/utils';
53
- import 'node:zlib';
54
- import 'nitro/meta';
55
- import 'srvx/node';
@@ -1,81 +0,0 @@
1
- export function klona(x) {
2
- if (typeof x !== 'object') return x;
3
-
4
- var k, tmp, str=Object.prototype.toString.call(x);
5
-
6
- if (str === '[object Object]') {
7
- if (x.constructor !== Object && typeof x.constructor === 'function') {
8
- tmp = new x.constructor();
9
- for (k in x) {
10
- if (x.hasOwnProperty(k) && tmp[k] !== x[k]) {
11
- tmp[k] = klona(x[k]);
12
- }
13
- }
14
- } else {
15
- tmp = {}; // null
16
- for (k in x) {
17
- if (k === '__proto__') {
18
- Object.defineProperty(tmp, k, {
19
- value: klona(x[k]),
20
- configurable: true,
21
- enumerable: true,
22
- writable: true,
23
- });
24
- } else {
25
- tmp[k] = klona(x[k]);
26
- }
27
- }
28
- }
29
- return tmp;
30
- }
31
-
32
- if (str === '[object Array]') {
33
- k = x.length;
34
- for (tmp=Array(k); k--;) {
35
- tmp[k] = klona(x[k]);
36
- }
37
- return tmp;
38
- }
39
-
40
- if (str === '[object Set]') {
41
- tmp = new Set;
42
- x.forEach(function (val) {
43
- tmp.add(klona(val));
44
- });
45
- return tmp;
46
- }
47
-
48
- if (str === '[object Map]') {
49
- tmp = new Map;
50
- x.forEach(function (val, key) {
51
- tmp.set(klona(key), klona(val));
52
- });
53
- return tmp;
54
- }
55
-
56
- if (str === '[object Date]') {
57
- return new Date(+x);
58
- }
59
-
60
- if (str === '[object RegExp]') {
61
- tmp = new RegExp(x.source, x.flags);
62
- tmp.lastIndex = x.lastIndex;
63
- return tmp;
64
- }
65
-
66
- if (str === '[object DataView]') {
67
- return new x.constructor( klona(x.buffer) );
68
- }
69
-
70
- if (str === '[object ArrayBuffer]') {
71
- return x.slice(0);
72
- }
73
-
74
- // ArrayBuffer.isView(x)
75
- // ~> `new` bcuz `Buffer.slice` => ref
76
- if (str.slice(-6) === 'Array]') {
77
- return new x.constructor(x);
78
- }
79
-
80
- return x;
81
- }
@@ -1,53 +0,0 @@
1
- function set(obj, key, val) {
2
- if (typeof val.value === 'object') val.value = klona(val.value);
3
- if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
4
- Object.defineProperty(obj, key, val);
5
- } else obj[key] = val.value;
6
- }
7
-
8
- export function klona(x) {
9
- if (typeof x !== 'object') return x;
10
-
11
- var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
12
-
13
- if (str === '[object Object]') {
14
- tmp = Object.create(x.__proto__ || null);
15
- } else if (str === '[object Array]') {
16
- tmp = Array(x.length);
17
- } else if (str === '[object Set]') {
18
- tmp = new Set;
19
- x.forEach(function (val) {
20
- tmp.add(klona(val));
21
- });
22
- } else if (str === '[object Map]') {
23
- tmp = new Map;
24
- x.forEach(function (val, key) {
25
- tmp.set(klona(key), klona(val));
26
- });
27
- } else if (str === '[object Date]') {
28
- tmp = new Date(+x);
29
- } else if (str === '[object RegExp]') {
30
- tmp = new RegExp(x.source, x.flags);
31
- } else if (str === '[object DataView]') {
32
- tmp = new x.constructor( klona(x.buffer) );
33
- } else if (str === '[object ArrayBuffer]') {
34
- tmp = x.slice(0);
35
- } else if (str.slice(-6) === 'Array]') {
36
- // ArrayBuffer.isView(x)
37
- // ~> `new` bcuz `Buffer.slice` => ref
38
- tmp = new x.constructor(x);
39
- }
40
-
41
- if (tmp) {
42
- for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
43
- set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
44
- }
45
-
46
- for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
47
- if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
48
- set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
49
- }
50
- }
51
-
52
- return tmp || x;
53
- }
@@ -1,74 +0,0 @@
1
- {
2
- "name": "klona",
3
- "version": "2.0.6",
4
- "repository": "lukeed/klona",
5
- "description": "A tiny (240B to 501B) and fast utility to \"deep clone\" Objects, Arrays, Dates, RegExps, and more!",
6
- "module": "dist/index.mjs",
7
- "unpkg": "dist/index.min.js",
8
- "main": "dist/index.js",
9
- "types": "index.d.ts",
10
- "license": "MIT",
11
- "author": {
12
- "name": "Luke Edwards",
13
- "email": "luke.edwards05@gmail.com",
14
- "url": "https://lukeed.com"
15
- },
16
- "files": [
17
- "*.d.ts",
18
- "dist",
19
- "full",
20
- "json",
21
- "lite"
22
- ],
23
- "exports": {
24
- ".": {
25
- "types": "./index.d.ts",
26
- "import": "./dist/index.mjs",
27
- "require": "./dist/index.js"
28
- },
29
- "./json": {
30
- "types": "./index.d.ts",
31
- "import": "./json/index.mjs",
32
- "require": "./json/index.js"
33
- },
34
- "./lite": {
35
- "types": "./index.d.ts",
36
- "import": "./lite/index.mjs",
37
- "require": "./lite/index.js"
38
- },
39
- "./full": {
40
- "types": "./index.d.ts",
41
- "import": "./full/index.mjs",
42
- "require": "./full/index.js"
43
- },
44
- "./package.json": "./package.json"
45
- },
46
- "modes": {
47
- "json": "src/json.js",
48
- "lite": "src/lite.js",
49
- "default": "src/index.js",
50
- "full": "src/full.js"
51
- },
52
- "engines": {
53
- "node": ">= 8"
54
- },
55
- "scripts": {
56
- "build": "bundt",
57
- "pretest": "npm run build",
58
- "postbuild": "echo \"lite full json\" | xargs -n1 cp -v index.d.ts",
59
- "test": "uvu -r esm test -i suites"
60
- },
61
- "keywords": [
62
- "clone",
63
- "copy",
64
- "deep",
65
- "extend",
66
- "recursive",
67
- "object"
68
- ],
69
- "devDependencies": {
70
- "bundt": "1.0.2",
71
- "esm": "3.2.25",
72
- "uvu": "0.5.2"
73
- }
74
- }
@@ -1 +0,0 @@
1
- const r=Object.create(null),i=e=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?r:globalThis),o=new Proxy(r,{get(e,s){return i()[s]??r[s]},has(e,s){const E=i();return s in E||s in r},set(e,s,E){const B=i(!0);return B[s]=E,!0},deleteProperty(e,s){if(!s)return!1;const E=i(!0);return delete E[s],!0},ownKeys(){const e=i(!0);return Object.keys(e)}}),t=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",f=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function b(){if(globalThis.process?.env)for(const e of f){const s=e[1]||e[0];if(globalThis.process?.env[s])return{name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const l=b(),p=l.name;function n(e){return e?e!=="false":!1}const I=globalThis.process?.platform||"",T=n(o.CI)||l.ci!==!1,R=n(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),U=typeof window<"u",d=n(o.DEBUG),a=t==="test"||n(o.TEST),g=t==="production",h=t==="dev"||t==="development",v=n(o.MINIMAL)||T||a||!R,A=/^win/i.test(I),M=/^linux/i.test(I),m=/^darwin/i.test(I),Y=!n(o.NO_COLOR)&&(n(o.FORCE_COLOR)||(R||A)&&o.TERM!=="dumb"||T),C=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null,V=Number(C?.split(".")[0])||null,W=globalThis.process||Object.create(null),_={versions:{}},y=new Proxy(W,{get(e,s){if(s==="env")return o;if(s in e)return e[s];if(s in _)return _[s]}}),O=globalThis.process?.release?.name==="node",c=!!globalThis.Bun||!!globalThis.process?.versions?.bun,D=!!globalThis.Deno,L=!!globalThis.fastly,S=!!globalThis.Netlify,u=!!globalThis.EdgeRuntime,N=globalThis.navigator?.userAgent==="Cloudflare-Workers",F=[[S,"netlify"],[u,"edge-light"],[N,"workerd"],[L,"fastly"],[D,"deno"],[c,"bun"],[O,"node"]];function G(){const e=F.find(s=>s[0]);if(e)return{name:e[1]}}const P=G(),K=P?.name||"";export{o as env,R as hasTTY,U as hasWindow,c as isBun,T as isCI,Y as isColorSupported,d as isDebug,D as isDeno,h as isDevelopment,u as isEdgeLight,L as isFastly,M as isLinux,m as isMacOS,v as isMinimal,S as isNetlify,O as isNode,g as isProduction,a as isTest,A as isWindows,N as isWorkerd,t as nodeENV,V as nodeMajorVersion,C as nodeVersion,I as platform,y as process,p as provider,l as providerInfo,K as runtime,P as runtimeInfo};
@@ -1,46 +0,0 @@
1
- {
2
- "name": "std-env",
3
- "version": "3.9.0",
4
- "description": "Runtime agnostic JS utils",
5
- "repository": "unjs/std-env",
6
- "license": "MIT",
7
- "sideEffects": false,
8
- "exports": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.cjs"
12
- },
13
- "main": "./dist/index.cjs",
14
- "types": "./dist/index.d.ts",
15
- "files": [
16
- "dist"
17
- ],
18
- "scripts": {
19
- "build": "unbuild",
20
- "dev": "vitest",
21
- "lint": "eslint . && prettier -c src test",
22
- "lint:fix": "eslint --fix . && prettier -w src test",
23
- "prepack": "unbuild",
24
- "play:bun": "bun playground/bun.ts",
25
- "play:deno": "pnpm build && deno run -A playground/deno.ts",
26
- "play:node": "pnpm build && node playground/node.mjs",
27
- "release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
28
- "test": "pnpm lint && pnpm typecheck && vitest run --coverage",
29
- "typecheck": "tsc --noEmit"
30
- },
31
- "devDependencies": {
32
- "@types/node": "^22.14.0",
33
- "@vitest/coverage-v8": "^3.1.1",
34
- "changelogen": "^0.6.1",
35
- "esbuild": "^0.25.2",
36
- "eslint": "^9.23.0",
37
- "eslint-config-unjs": "^0.4.2",
38
- "jiti": "^2.4.2",
39
- "prettier": "^3.5.3",
40
- "rollup": "^4.39.0",
41
- "typescript": "^5.8.2",
42
- "unbuild": "^3.5.0",
43
- "vitest": "^3.1.1"
44
- },
45
- "packageManager": "pnpm@10.7.1"
46
- }