Remove generated JavaScript bundle from the project.

This commit is contained in:
2025-10-02 08:01:59 +01:00
parent 128bc60726
commit e8a69077b3
6 changed files with 207 additions and 171 deletions

View File

@@ -6,6 +6,7 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-json-pretty": "^2.2.0",
},
"devDependencies": {
"bun-types": "latest",
@@ -25,10 +26,18 @@
"loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="],
"object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
"prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="],
"react": ["react@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="],
"react-dom": ["react-dom@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="],
"react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],
"react-json-pretty": ["react-json-pretty@2.2.0", "", { "dependencies": { "prop-types": "^15.6.2" }, "peerDependencies": { "react": ">=15.0", "react-dom": ">=15.0" } }, "sha512-3UMzlAXkJ4R8S4vmkRKtvJHTewG4/rn1Q18n0zqdu/ipZbUPLVZD+QwC7uVcD/IAY3s8iNVHlgR2dMzIUS0n1A=="],
"scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="],
"undici-types": ["undici-types@7.12.0", "", {}, "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ=="],

File diff suppressed because one or more lines are too long

161
app/web/dist/index-kk1m7jg4.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nostr Relay</title>
<link rel="stylesheet" crossorigin href="./index-q4cwd1fy.css"><script type="module" crossorigin src="./index-4xsq3yxw.js"></script></head>
<link rel="stylesheet" crossorigin href="./index-q4cwd1fy.css"><script type="module" crossorigin src="./index-kk1m7jg4.js"></script></head>
<body>
<script>
// Apply system theme preference immediately to avoid flash of wrong theme

View File

@@ -10,7 +10,8 @@
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-json-pretty": "^2.2.0"
},
"devDependencies": {
"bun-types": "latest"

View File

@@ -1,4 +1,22 @@
import React, { useState, useEffect, useRef } from 'react';
import JSONPretty from 'react-json-pretty';
function PrettyJSONView({ jsonString, maxHeightClass = 'max-h-64' }) {
let data;
try {
data = JSON.parse(jsonString);
} catch (_) {
data = jsonString;
}
return (
<div
className={`text-xs p-2 rounded overflow-auto ${maxHeightClass} break-all break-words whitespace-pre-wrap bg-gray-950 text-white`}
style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }}
>
<JSONPretty data={data} space={2} />
</div>
);
}
function App() {
const [user, setUser] = useState(null);
@@ -1195,11 +1213,22 @@ function App() {
function copyEventJSON(eventJSON) {
try {
navigator.clipboard.writeText(eventJSON);
// Ensure minified JSON is copied regardless of input format
let toCopy = eventJSON;
try {
toCopy = JSON.stringify(JSON.parse(eventJSON));
} catch (_) {
// if not valid JSON string, fall back to original
}
navigator.clipboard.writeText(toCopy);
} catch (error) {
// Fallback for older browsers
const textArea = document.createElement('textarea');
textArea.value = eventJSON;
let toCopy = eventJSON;
try {
toCopy = JSON.stringify(JSON.parse(eventJSON));
} catch (_) {}
textArea.value = toCopy;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
@@ -1910,7 +1939,7 @@ function App() {
Copy JSON
</button>
</div>
<pre className={`text-xs overflow-auto max-h-64 ${getThemeClasses('bg-white text-black', 'bg-gray-950 text-gray-200')} p-2 rounded`}>{event.raw_json}</pre>
<PrettyJSONView jsonString={event.raw_json} maxHeightClass="max-h-64" />
</div>
)}
</div>
@@ -2048,9 +2077,7 @@ function App() {
Copy
</button>
</div>
<pre className={`text-xs p-2 rounded overflow-auto max-h-40 break-all whitespace-pre-wrap ${getPanelBgClass()} ${getTextClass()}`}>
{JSON.stringify(JSON.parse(event.raw_json), null, 2)}
</pre>
<PrettyJSONView jsonString={event.raw_json} maxHeightClass="max-h-40" />
</div>
)}
</div>
@@ -2197,9 +2224,7 @@ function App() {
Copy
</button>
</div>
<pre className={`text-xs p-2 rounded overflow-auto max-h-40 break-all whitespace-pre-wrap ${getPanelBgClass()} ${getTextClass()}`}>
{JSON.stringify(JSON.parse(event.raw_json), null, 2)}
</pre>
<PrettyJSONView jsonString={event.raw_json} maxHeightClass="max-h-40" />
</div>
)}
</div>