build: Add HTMX copy step to build:ts script

- Modified package.json build:ts to copy htmx.min.js from node_modules to web/static/
- This fixes the 404 error for /static/htmx.min.js that occurred after ESBuild migration
- Added htmx.min.js to static files

See ESBUILD_MIGRATION_PLAN.md for migration context.
This commit is contained in:
2026-03-08 21:35:35 -04:00
parent a84ffb253e
commit 0af319fef9
5 changed files with 331 additions and 35 deletions
+7 -7
View File
@@ -8,18 +8,18 @@ RUN apk add --no-cache nodejs npm curl git
# Install Go tools (cached well)
RUN --mount=type=cache,target=/root/go/pkg/mod \
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest && \
go install github.com/a-h/templ/cmd/templ@latest
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest && \
go install github.com/a-h/templ/cmd/templ@latest
# Copy package files and install npm dependencies (cached unless package.json changes)
COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm \
npm ci
npm ci
# Copy Go mod files (cached unless go.mod changes)
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/go/pkg/mod \
go mod download
go mod download
# Copy source code (this layer changes frequently)
COPY . .
@@ -34,7 +34,7 @@ RUN npm run build:ts
# Build Go binary (cached unless Go files or generated code changes)
RUN --mount=type=cache,target=/root/go/pkg/mod \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd/server
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd/server
# Test runner stage - includes Go runtime and test dependencies
# This stage is ONLY used for running tests, never deployed to production
@@ -49,7 +49,7 @@ COPY --from=builder /app ./
# Install kepubify for conversion tests
RUN wget -O /usr/bin/kepubify https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit \
&& chmod +x /usr/bin/kepubify
&& chmod +x /usr/bin/kepubify
# Set test environment variables
ENV TEST_MODE=true
@@ -66,7 +66,7 @@ RUN apk --no-cache add ca-certificates curl
# Install kepubify for EPUB→KEPUB conversion
RUN wget -O /usr/bin/kepubify https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit \
&& chmod +x /usr/bin/kepubify
&& chmod +x /usr/bin/kepubify
WORKDIR /root/