Browse Source

rebuild web app with build-script

imwald-v0.58.5
silberengel 4 months ago
parent
commit
a22194e97e
  1. 8
      Dockerfile.with-web
  2. 91
      app/web/dist/bundle.css
  3. 25
      app/web/dist/bundle.js
  4. 1
      app/web/dist/bundle.js.map
  5. BIN
      app/web/dist/favicon.png
  6. 69
      app/web/dist/global.css
  7. 45
      app/web/dist/index.html
  8. BIN
      app/web/dist/orly.png
  9. 2
      app/web/src/App.svelte
  10. 2
      app/web/src/EventsView.svelte
  11. 2
      app/web/src/FilterBuilder.svelte
  12. 2
      app/web/src/FilterDisplay.svelte
  13. 37
      app/web/src/helpers.js
  14. 18
      build-image-v0.58.5.sh

8
Dockerfile.with-web

@ -20,8 +20,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends git make && rm
# Set working directory # Set working directory
WORKDIR /build WORKDIR /build
# Copy go mod files # Copy go mod files and build context first (needed for replace directives in go.mod)
COPY go.mod go.sum ./ COPY go.mod go.sum ./
COPY .docker-build-context/ ./docker-build-context/
# Copy vendored dependencies (created by build script)
COPY vendor/ ./vendor/
# Download dependencies (will use vendor if available)
RUN go mod download RUN go mod download
# Copy source code # Copy source code

91
app/web/dist/bundle.css vendored

File diff suppressed because one or more lines are too long

25
app/web/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

1
app/web/dist/bundle.js.map vendored

File diff suppressed because one or more lines are too long

BIN
app/web/dist/favicon.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 KiB

69
app/web/dist/global.css vendored

@ -1,69 +0,0 @@
html,
body {
position: relative;
width: 100%;
height: 100%;
}
body {
color: #333;
margin: 0;
padding: 8px;
box-sizing: border-box;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
Cantarell, "Helvetica Neue", sans-serif;
}
a {
color: rgb(0, 100, 200);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:visited {
color: rgb(0, 80, 160);
}
label {
display: block;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
-webkit-padding: 0.4em 0;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
}
input:disabled {
color: #ccc;
}
button {
color: #333;
background-color: #f4f4f4;
outline: none;
}
button:disabled {
color: #999;
}
button:not(:disabled):active {
background-color: #ddd;
}
button:focus {
border-color: #666;
}

45
app/web/dist/index.html vendored

@ -1,44 +1 @@
<!doctype html> <!-- Placeholder - will be replaced by Docker build -->
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<title>ORLY?</title>
<style>
:root {
color-scheme: light dark;
}
html, body {
background-color: #fff;
color: #000;
}
@media (prefers-color-scheme: dark) {
html, body {
background-color: #000;
color: #fff;
}
}
</style>
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/icon-192.png" />
<meta name="theme-color" content="#000000" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" href="/global.css" />
<link rel="stylesheet" href="/bundle.css" />
<script defer src="/bundle.js"></script>
</head>
<body></body>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js');
}
</script>
</html>

BIN
app/web/dist/orly.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 KiB

2
app/web/src/App.svelte

@ -24,7 +24,7 @@
import { isStandaloneMode, relayUrl, relayInfo as relayInfoStore, relayConnectionStatus, isOrlyRelay } from "./stores.js"; import { isStandaloneMode, relayUrl, relayInfo as relayInfoStore, relayConnectionStatus, isOrlyRelay } from "./stores.js";
// Utility imports // Utility imports
import { buildFilter } from "./helpers.tsx"; import { buildFilter } from "./helpers.js";
import { replaceableKinds, kindNames, CACHE_DURATION } from "./constants.js"; import { replaceableKinds, kindNames, CACHE_DURATION } from "./constants.js";
import { getKindName, truncatePubkey, truncateContent, formatTimestamp, escapeHtml, aboutToHtml, copyToClipboard, showCopyFeedback } from "./utils.js"; import { getKindName, truncatePubkey, truncateContent, formatTimestamp, escapeHtml, aboutToHtml, copyToClipboard, showCopyFeedback } from "./utils.js";
import * as api from "./api.js"; import * as api from "./api.js";

2
app/web/src/EventsView.svelte

@ -11,7 +11,7 @@
import { createEventDispatcher, onMount } from "svelte"; import { createEventDispatcher, onMount } from "svelte";
import FilterBuilder from "./FilterBuilder.svelte"; import FilterBuilder from "./FilterBuilder.svelte";
import { fetchUserProfile } from "./nostr.js"; import { fetchUserProfile } from "./nostr.js";
import { getKindName, truncatePubkey } from "./helpers.tsx"; import { getKindName, truncatePubkey } from "./helpers.js";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
// Profile cache to avoid fetching the same profile multiple times // Profile cache to avoid fetching the same profile multiple times

2
app/web/src/FilterBuilder.svelte

@ -1,6 +1,6 @@
<script> <script>
import { createEventDispatcher, onDestroy } from "svelte"; import { createEventDispatcher, onDestroy } from "svelte";
import { KIND_NAMES, isValidPubkey, isValidEventId, isValidTagName, formatDateTimeLocal, parseDateTimeLocal } from "./helpers.tsx"; import { KIND_NAMES, isValidPubkey, isValidEventId, isValidTagName, formatDateTimeLocal, parseDateTimeLocal } from "./helpers.js";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();

2
app/web/src/FilterDisplay.svelte

@ -1,6 +1,6 @@
<script> <script>
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import { prettyPrintFilter } from "./helpers.tsx"; import { prettyPrintFilter } from "./helpers.js";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();

37
app/web/src/helpers.tsx → app/web/src/helpers.js

@ -86,7 +86,7 @@ export function getKindName(kind) {
} }
// Validate hex string (for pubkeys and event IDs) // Validate hex string (for pubkeys and event IDs)
export function isValidHex(str: string | null | undefined, length: number | null = null): boolean { export function isValidHex(str, length = null) {
if (!str || typeof str !== "string") return false; if (!str || typeof str !== "string") return false;
const hexRegex = /^[0-9a-fA-F]+$/; const hexRegex = /^[0-9a-fA-F]+$/;
if (!hexRegex.test(str)) return false; if (!hexRegex.test(str)) return false;
@ -95,12 +95,12 @@ export function isValidHex(str: string | null | undefined, length: number | null
} }
// Validate pubkey (64 character hex) // Validate pubkey (64 character hex)
export function isValidPubkey(pubkey: string | null | undefined): boolean { export function isValidPubkey(pubkey) {
return isValidHex(pubkey, 64); return isValidHex(pubkey, 64);
} }
// Validate event ID (64 character hex) // Validate event ID (64 character hex)
export function isValidEventId(eventId: string | null | undefined): boolean { export function isValidEventId(eventId) {
return isValidHex(eventId, 64); return isValidHex(eventId, 64);
} }
@ -143,33 +143,6 @@ export function truncateContent(content, maxLength = 100) {
} }
// Build Nostr filter from form data // Build Nostr filter from form data
interface FilterTag {
name: string;
value: string;
}
interface FilterOptions {
searchText?: string | null;
kinds?: number[];
authors?: string[];
ids?: string[];
tags?: FilterTag[];
since?: number | null;
until?: number | null;
limit?: number | null;
}
interface NostrFilter {
search?: string;
kinds?: number[];
authors?: string[];
ids?: string[];
[key: string]: any; // For dynamic tag keys like #e, #p, #a
since?: number;
until?: number;
limit?: number;
}
export function buildFilter({ export function buildFilter({
searchText = null, searchText = null,
kinds = [], kinds = [],
@ -179,8 +152,8 @@ export function buildFilter({
since = null, since = null,
until = null, until = null,
limit = null, limit = null,
}: FilterOptions = {}): NostrFilter { } = {}) {
const filter: NostrFilter = {}; const filter = {};
if (searchText && searchText.trim()) { if (searchText && searchText.trim()) {
filter.search = searchText.trim(); filter.search = searchText.trim();

18
build-image-v0.58.5.sh

@ -33,15 +33,21 @@ if [ "$CURRENT_TAG" != "v0.58.5" ]; then
echo "Continuing anyway..." echo "Continuing anyway..."
fi fi
# Check if app/web/dist exists (web UI already built) # Always rebuild web UI to ensure latest changes are included
# Remove old dist folder if it exists to force fresh build
if [ -d "app/web/dist" ]; then if [ -d "app/web/dist" ]; then
echo "Web UI already built, using existing Dockerfile..." echo "Removing old web UI build to force fresh rebuild..."
DOCKERFILE="Dockerfile" rm -rf app/web/dist
else
echo "Web UI not found, using Dockerfile.with-web (will build web UI in Docker)..."
DOCKERFILE="Dockerfile.with-web"
fi fi
# Create minimal placeholder for Go embed directive (needed for local development)
# Docker will replace this with the actual build
mkdir -p app/web/dist
echo "<!-- Placeholder - will be replaced by Docker build -->" > app/web/dist/index.html
echo "Using Dockerfile.with-web (will build web UI in Docker with latest changes)..."
DOCKERFILE="Dockerfile.with-web"
# Check if local nostr clone exists and prepare it for Docker build # Check if local nostr clone exists and prepare it for Docker build
NOSTR_PATH="${NOSTR_PATH:-/home/firefly/Dokumente/repos/nostr}" NOSTR_PATH="${NOSTR_PATH:-/home/firefly/Dokumente/repos/nostr}"
mkdir -p .docker-build-context mkdir -p .docker-build-context

Loading…
Cancel
Save