nitropack-nightly 2.11.4-20250306-154657.153f7328 → 2.11.4-20250306-165704.142d8fac
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/cli/build.mjs
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import nodeCrypto from 'node:crypto';
|
|
1
2
|
import { defineCommand } from 'citty';
|
|
2
3
|
import { createNitro, prepare, copyPublicAssets, prerender, build as build$1 } from 'nitropack/core';
|
|
3
4
|
import { resolve } from 'pathe';
|
|
4
5
|
import { c as commonArgs } from './common.mjs';
|
|
5
6
|
|
|
7
|
+
if (!globalThis.crypto) {
|
|
8
|
+
globalThis.crypto = nodeCrypto;
|
|
9
|
+
}
|
|
6
10
|
const build = defineCommand({
|
|
7
11
|
meta: {
|
|
8
12
|
name: "build",
|
package/dist/cli/dev.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import nodeCrypto from 'node:crypto';
|
|
1
2
|
import { defineCommand } from 'citty';
|
|
2
3
|
import { consola } from 'consola';
|
|
3
4
|
import { getArgs, parseArgs } from 'listhen/cli';
|
|
@@ -6,6 +7,9 @@ import { resolve } from 'pathe';
|
|
|
6
7
|
import { c as commonArgs } from './common.mjs';
|
|
7
8
|
|
|
8
9
|
const hmrKeyRe = /^runtimeConfig\.|routeRules\./;
|
|
10
|
+
if (!globalThis.crypto) {
|
|
11
|
+
globalThis.crypto = nodeCrypto;
|
|
12
|
+
}
|
|
9
13
|
const dev = defineCommand({
|
|
10
14
|
meta: {
|
|
11
15
|
name: "dev",
|
package/dist/core/index.mjs
CHANGED
|
@@ -43,6 +43,7 @@ import { walk, parse } from 'ultrahtml';
|
|
|
43
43
|
import { createError, getRequestURL, getRequestHeader, getResponseHeader, getRequestHeaders, setResponseHeaders, setResponseStatus, send, eventHandler, getRequestIP, toNodeListener, createApp, fromNodeMiddleware } from 'h3';
|
|
44
44
|
import { Worker } from 'node:worker_threads';
|
|
45
45
|
import { createProxyServer } from 'httpxy';
|
|
46
|
+
import nodeCrypto from 'node:crypto';
|
|
46
47
|
import { resolve as resolve$1, dirname as dirname$1 } from 'node:path';
|
|
47
48
|
import { ErrorParser } from 'youch-core';
|
|
48
49
|
import { Youch } from 'youch';
|
|
@@ -2447,6 +2448,9 @@ async function defaultHandler(error, event, opts) {
|
|
|
2447
2448
|
if (statusCode === 404 || !getResponseHeader(event, "cache-control")) {
|
|
2448
2449
|
headers["cache-control"] = "no-cache";
|
|
2449
2450
|
}
|
|
2451
|
+
if (!globalThis.crypto && !useJSON) {
|
|
2452
|
+
globalThis.crypto = nodeCrypto;
|
|
2453
|
+
}
|
|
2450
2454
|
const body = useJSON ? {
|
|
2451
2455
|
error: true,
|
|
2452
2456
|
url,
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/meta/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
setResponseHeaders,
|
|
8
8
|
setResponseStatus
|
|
9
9
|
} from "h3";
|
|
10
|
+
import nodeCrypto from "node:crypto";
|
|
10
11
|
import { readFile } from "node:fs/promises";
|
|
11
12
|
import { resolve, dirname } from "node:path";
|
|
12
13
|
import consola from "consola";
|
|
@@ -69,6 +70,9 @@ export async function defaultHandler(error, event, opts) {
|
|
|
69
70
|
if (statusCode === 404 || !getResponseHeader(event, "cache-control")) {
|
|
70
71
|
headers["cache-control"] = "no-cache";
|
|
71
72
|
}
|
|
73
|
+
if (!globalThis.crypto && !useJSON) {
|
|
74
|
+
globalThis.crypto = nodeCrypto;
|
|
75
|
+
}
|
|
72
76
|
const body = useJSON ? {
|
|
73
77
|
error: true,
|
|
74
78
|
url,
|
package/package.json
CHANGED