Browse Source

patch unenv

pull/2619/head
Bernd Storath 3 weeks ago
parent
commit
12450e4369
  1. 3
      Dockerfile
  2. 3
      Dockerfile.dev
  3. 23
      src/patches/unenv.patch
  4. 9
      src/pnpm-lock.yaml
  5. 2
      src/pnpm-workspace.yaml

3
Dockerfile

@ -8,6 +8,7 @@ RUN corepack enable pnpm
# Copy Web UI
COPY src/package.json src/pnpm-lock.yaml src/pnpm-workspace.yaml ./
COPY src/patches ./patches
RUN pnpm install
# Build UI
@ -72,7 +73,7 @@ RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables
RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save
# Set Environment
ENV DEBUG=Server,WireGuard,Database,CMD
ENV DEBUG=Server,WireGuard,Database,CMD,Firewall
ENV PORT=51821
ENV HOST=0.0.0.0
ENV INSECURE=false

3
Dockerfile.dev

@ -24,7 +24,7 @@ RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables
RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save
# Set Environment
ENV DEBUG=Server,WireGuard,Database,CMD
ENV DEBUG=Server,WireGuard,Database,CMD,Firewall
ENV PORT=51821
ENV HOST=0.0.0.0
ENV INSECURE=true
@ -33,6 +33,7 @@ ENV DISABLE_IPV6=false
# Install Dependencies
COPY src/package.json src/pnpm-lock.yaml src/pnpm-workspace.yaml ./
COPY src/patches ./patches
RUN pnpm install
# Copy Project

23
src/patches/unenv.patch

@ -0,0 +1,23 @@
diff --git a/dist/runtime/npm/debug.mjs b/dist/runtime/npm/debug.mjs
index 62fa13e3a5e96ee835dfe7363e7451e987ef11bc..85b923f5f5597519486b5a11604af6dbfadb0a0d 100644
--- a/dist/runtime/npm/debug.mjs
+++ b/dist/runtime/npm/debug.mjs
@@ -1,7 +1,17 @@
function createDebug(namespace) {
return Object.assign((...args) => {
const env = globalThis.process?.env.DEBUG;
- if (!env || env !== "*" && !env.startsWith(namespace)) return;
+ if (!env) return;
+ if (env !== "*") {
+ const patterns = env.split(",").map((n) => n.trim());
+ const isMatch = patterns.some((pattern) => {
+ if (pattern.endsWith("*")) {
+ return namespace.startsWith(pattern.slice(0, -1));
+ }
+ return pattern === namespace;
+ });
+ if (!isMatch) return;
+ }
console.debug(...args);
}, {
color: "#000000",

9
src/pnpm-lock.yaml

@ -4,6 +4,9 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
patchedDependencies:
unenv: 0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d
importers:
.:
@ -7739,7 +7742,7 @@ snapshots:
seroval: 1.5.4
std-env: 4.1.0
ufo: 1.6.4
unenv: 2.0.0-rc.24
unenv: 2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d)
vite: 7.3.3(@types/[email protected])([email protected])([email protected])([email protected])([email protected])
vite-node: 5.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])
vite-plugin-checker: 0.13.0([email protected]([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))
@ -10850,7 +10853,7 @@ snapshots:
ultrahtml: 1.6.0
uncrypto: 0.1.3
unctx: 2.5.0
unenv: 2.0.0-rc.24
unenv: 2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d)
unimport: 6.3.0([email protected])
unplugin-utils: 0.3.1
unstorage: 1.17.5([email protected](@libsql/[email protected])([email protected](@libsql/[email protected])))([email protected])
@ -12175,7 +12178,7 @@ snapshots:
[email protected]: {}
[email protected]:
[email protected](patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d):
dependencies:
pathe: 2.0.3

2
src/pnpm-workspace.yaml

@ -4,3 +4,5 @@ allowBuilds:
esbuild: false
unrs-resolver: false
vue-demi: false
patchedDependencies:
unenv: patches/unenv.patch

Loading…
Cancel
Save