Serve the build-independent web assets from the backend (#2181)

* Serve the build-independent web assets from the backend

`privacy.html`, `markdown-help.html` and the `400x400.jpeg` it embeds carry
no template variable, link no script or stylesheet, and are imported by
nothing in the widget. They now live in `backend/app/webassets/assets`,
embedded there, and are served under `/web` alongside the frontend build.

`/web` reads the frontend build first and falls back to them, which is what
lets an operator replace one by dropping a file into `--web-root`. That is
what `privacy.html` needs: it describes remark42.com, while the
authorization guide tells operators to hand its URL to Google and Facebook
as their own application's privacy policy.

Only a missing file falls through. An unreadable file in the web root keeps
reporting as unreadable rather than being silently replaced by the embedded
copy, and a name the filesystem rejects reports as missing rather than as a
server error, both matching what `http.Dir` did.

The dev server serves the same directory, so the Markdown help link in the
comment form resolves on the dev port as well as in production.

The two pages are served as they are written. `markdown-help.html` was
minified before, and its formatted inline stylesheet is most of its 8.5 kB;
that is 2.4 kB more over the wire, behind the hour-long cache header the
file server already sets.

Drops `copy-webpack-plugin`, which had no other pattern, and the stylelint
entries that only ever matched these files.

* Make pnpm dev:app start again

The dev server has been failing to start on two counts, so the flow the
contributing guide documents does not run at all.

`webpack-cli` 4 drives `webpack-dev-server` 5 through the argument order
of an older major, handing it the compiler where it expects the options
object. It rejects that against its schema and exits, complaining about an
unknown `_assetEmittingPreviousFiles` property, which is a field of the
compiler. `webpack-cli` 7 is the release that declares
`webpack-dev-server` 5 as a peer.

Past that, `http-proxy-middleware` resolves to 4.1.1, which no longer
accepts the two-argument call `webpack-dev-server` makes, so the `/api`
and `/auth` proxies throw on startup. It is pulled in by the security
override for CVE-2025-32996, the only override in the file with no upper
bound: `>=2.0.10` matches every later major. Bounding it to the 2.x line
keeps the fix and the API `webpack-dev-server` calls.

With both in place `pnpm dev:app` serves the widget and the pages under
`/web` on port 9000.
This commit is contained in:
Dmitry Verkhoturov
2026-08-21 18:43:06 -05:00
committed by GitHub
parent 123b9328d9
commit fb7b6c2cdd
21 changed files with 667 additions and 220 deletions
+5
View File
@@ -77,3 +77,8 @@ For local artifact runs, install GoReleaser, Go 1.25, Node 20+, PNPM 10, and Per
## Repository Structure
- Backend: Go server using BoltDB for storage
- Frontend: Preact/Redux-based UI with iframe embedding
- `/web` is served from two sources, in lookup order: the frontend build output
(`frontend/apps/remark42/public`, embedded at `backend/app/cmd/web` or read from `--web-root`),
then `backend/app/webassets/assets`, embedded in the binary. A plain page or image the bundler
does not process belongs in `webassets`; anything needing templating or the widget's CSS/JS goes
through webpack. A name present in both is served from the frontend build.
+19 -11
View File
@@ -3,7 +3,6 @@ package api
import (
"bytes"
"context"
"embed"
"encoding/json"
"fmt"
"io/fs"
@@ -27,6 +26,7 @@ import (
"github.com/umputun/remark42/backend/app/store"
"github.com/umputun/remark42/backend/app/store/image"
"github.com/umputun/remark42/backend/app/store/service"
"github.com/umputun/remark42/backend/app/webassets"
)
// Rest is a rest access server
@@ -45,7 +45,7 @@ type Rest struct {
AnonVote bool
WebRoot string
WebFS embed.FS
WebFS fs.FS
RemarkURL string
ReadOnlyAge int
SharedSecret string
@@ -385,8 +385,16 @@ func (s *Rest) routes() http.Handler {
rroot.HandleFunc("POST /email/unsubscribe.html", s.privRest.emailUnsubscribeCtrl)
})
// file server for static content from s.WebRoot on path /web
addFileServer(router, s.WebFS, s.WebRoot, s.Version)
// file server for /web: the frontend build first, then the assets embedded in the binary.
// the build is embedded under web/ by app/cmd, so that prefix is stripped here. fs.Sub only
// fails for an fs.SubFS that refuses, and a nil result would panic on the first request, so
// serve nothing from the frontend rather than serving it at the wrong paths
embeddedFrontend, err := fs.Sub(s.WebFS, "web")
if err != nil {
log.Printf("[WARN] no embedded frontend, serving built-in assets only: %v", err)
embeddedFrontend = emptyFS{}
}
addFileServer(router, embeddedFrontend, s.WebRoot, s.Version)
return router
}
@@ -499,20 +507,20 @@ func (s *Rest) configCtrl(w http.ResponseWriter, r *http.Request) {
R.RenderJSON(w, cnf)
}
// serves static files from the webRoot directory or files embedded into the compiled binary if that directory is absent
func addFileServer(r *routegroup.Bundle, embedFS embed.FS, webRoot, version string) {
var webFS http.Handler
// serves /web from the frontend build, falling back to the assets embedded in the binary for
// names the build does not produce. the frontend build is read from webRoot on disk, or from the
// copy embedded at app/cmd/web when that directory is absent.
func addFileServer(r *routegroup.Bundle, embeddedFrontend fs.FS, webRoot, version string) {
frontendFS := embeddedFrontend
if _, err := os.Stat(webRoot); err == nil {
log.Printf("[INFO] run file server from %s from the disk", webRoot)
webFS = http.FileServer(http.Dir(webRoot))
frontendFS = os.DirFS(webRoot)
} else {
log.Printf("[INFO] run file server, embedded")
var contentFS, _ = fs.Sub(embedFS, "web")
webFS = http.FileServer(http.FS(contentFS))
}
webFS = http.StripPrefix("/web", webFS)
webFS := http.StripPrefix("/web", http.FileServer(http.FS(webFiles{frontend: frontendFS, embedded: webassets.FS})))
r.HandleFunc("GET /web", http.RedirectHandler("/web/", http.StatusMovedPermanently).ServeHTTP)
r.With(rateLimiter(20),
+182
View File
@@ -4,16 +4,20 @@ import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io"
"io/fs"
"math/rand"
"net"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"testing/fstest"
"time"
"github.com/go-pkgz/auth/v2"
@@ -22,6 +26,7 @@ import (
"github.com/go-pkgz/auth/v2/token"
cache "github.com/go-pkgz/lcw/v2"
R "github.com/go-pkgz/rest"
"github.com/go-pkgz/routegroup"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
bolt "go.etcd.io/bbolt"
@@ -36,6 +41,7 @@ import (
"github.com/umputun/remark42/backend/app/store/engine"
"github.com/umputun/remark42/backend/app/store/image"
"github.com/umputun/remark42/backend/app/store/service"
"github.com/umputun/remark42/backend/app/webassets"
)
// To generate a token, enter one of the tokens here into https://jwt.io, change the secret to one you're using in your test
@@ -118,6 +124,182 @@ func TestRest_FileServerStaticAssets(t *testing.T) {
})
}
// TestRest_FileServerBackendAssets covers the assets embedded in the binary and the rule that a
// name the frontend build provides is served from there instead. WebRoot is a fresh empty
// directory so the frontend side is known, rather than the shared temp dir startupT defaults to.
func TestRest_FileServerBackendAssets(t *testing.T) {
ts, srv, teardown := startupT(t, func(srv *Rest) { srv.WebRoot = t.TempDir() })
defer teardown()
t.Run("serves every embedded asset byte for byte", func(t *testing.T) {
for _, name := range []string{"privacy.html", "markdown-help.html", "400x400.jpeg"} {
t.Run(name, func(t *testing.T) {
want, err := fs.ReadFile(webassets.FS, name)
require.NoError(t, err)
body, code := get(t, ts.URL+"/web/"+name)
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, string(want), body, "the bytes must come from the embedded assets")
})
}
})
t.Run("serves the image with its own content type", func(t *testing.T) {
resp, err := http.Get(ts.URL + "/web/400x400.jpeg")
require.NoError(t, err)
defer resp.Body.Close()
assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Equal(t, "image/jpeg", resp.Header.Get("Content-Type"))
})
t.Run("head is served", func(t *testing.T) {
resp, err := http.Head(ts.URL + "/web/privacy.html")
require.NoError(t, err)
defer resp.Body.Close()
assert.Equal(t, http.StatusOK, resp.StatusCode)
})
t.Run("frontend output wins over the embedded copy", func(t *testing.T) {
require.NoError(t, os.WriteFile(srv.WebRoot+"/privacy.html", []byte("operator's own policy"), 0o600))
t.Cleanup(func() { _ = os.Remove(srv.WebRoot + "/privacy.html") })
body, code := get(t, ts.URL+"/web/privacy.html")
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, "operator's own policy", body)
})
t.Run("traversal out of the asset root is refused", func(t *testing.T) {
for _, p := range []string{"/web/../../etc/passwd", "/web/..%2f..%2fetc%2fpasswd", "/web/%2e%2e/%2e%2e/etc/passwd"} {
t.Run(p, func(t *testing.T) {
body, code := get(t, ts.URL+p)
assert.NotContains(t, body, "root:", "must never serve a file outside the served roots")
assert.NotEqual(t, http.StatusInternalServerError, code, "a rejected name must not surface as 500")
})
}
})
t.Run("missing in both still returns 404", func(t *testing.T) {
_, code := get(t, ts.URL+"/web/neither-source-has-this.html")
assert.Equal(t, http.StatusNotFound, code)
})
}
// TestRest_FileServerEmbeddedFrontend covers the branch taken when no web root exists on disk,
// which is how the released binary runs. The frontend stands in for the copy embedded at
// app/cmd/web, so a name it provides and a name only the assets provide are both exercised.
func TestRest_FileServerEmbeddedFrontend(t *testing.T) {
frontend := fstest.MapFS{"index.html": {Data: []byte("embedded frontend index")}}
router := routegroup.New(http.NewServeMux())
addFileServer(router, frontend, filepath.Join(t.TempDir(), "absent"), "test-version")
ts := httptest.NewServer(router)
defer ts.Close()
t.Run("serves the embedded frontend", func(t *testing.T) {
body, code := get(t, ts.URL+"/web/index.html")
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, "embedded frontend index", body)
})
for _, name := range []string{"privacy.html", "markdown-help.html", "400x400.jpeg"} {
t.Run("falls back to "+name, func(t *testing.T) {
want, err := fs.ReadFile(webassets.FS, name)
require.NoError(t, err)
body, code := get(t, ts.URL+"/web/"+name)
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, string(want), body)
})
}
t.Run("a name neither source has is missing", func(t *testing.T) {
_, code := get(t, ts.URL+"/web/nothing-here.html")
assert.Equal(t, http.StatusNotFound, code)
})
t.Run("a name the operating system rejects is missing, not an error", func(t *testing.T) {
_, code := get(t, ts.URL+"/web/a%00b.html")
assert.Equal(t, http.StatusNotFound, code)
})
}
// TestRest_FileServerRoutesEmbedded drives the whole router the released binary runs: no web root
// on disk, and the frontend read from WebFS. It is what pins the web/ prefix routes() strips, which
// a test calling addFileServer directly cannot see.
func TestRest_FileServerRoutesEmbedded(t *testing.T) {
frontend := fstest.MapFS{
"web/index.html": {Data: []byte("embedded index")},
"web/iframe.html": {Data: []byte("embedded iframe")},
"web/remark.mjs": {Data: []byte("embedded bundle")},
}
ts, _, teardown := startupT(t, func(srv *Rest) {
srv.WebRoot = filepath.Join(t.TempDir(), "absent")
srv.WebFS = frontend
})
defer teardown()
t.Run("serves the frontend from under the web prefix", func(t *testing.T) {
for name, want := range map[string]string{
"index.html": "embedded index",
"iframe.html": "embedded iframe",
"remark.mjs": "embedded bundle",
} {
t.Run(name, func(t *testing.T) {
body, code := get(t, ts.URL+"/web/"+name)
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, want, body)
})
}
})
t.Run("the prefix is stripped rather than exposed", func(t *testing.T) {
_, code := get(t, ts.URL+"/web/web/index.html")
assert.Equal(t, http.StatusNotFound, code, "the web/ prefix must not be reachable as a path")
})
t.Run("the embedded assets still answer alongside it", func(t *testing.T) {
want, err := fs.ReadFile(webassets.FS, "privacy.html")
require.NoError(t, err)
body, code := get(t, ts.URL+"/web/privacy.html")
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, string(want), body)
})
}
// refusingSubFS is an fs.FS whose Sub refuses, which is the only way fs.Sub returns a nil
// filesystem. routes() has to survive it, since a nil frontend would panic on the first request.
type refusingSubFS struct{}
func (refusingSubFS) Open(name string) (fs.File, error) {
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist}
}
func (refusingSubFS) Sub(string) (fs.FS, error) { return nil, errors.New("refused") }
// TestRest_FileServerFrontendSourceRefused covers the branch where the frontend source cannot be
// sub-rooted: /web must keep serving the embedded assets rather than panicking.
func TestRest_FileServerFrontendSourceRefused(t *testing.T) {
ts, _, teardown := startupT(t, func(srv *Rest) {
srv.WebRoot = filepath.Join(t.TempDir(), "absent")
srv.WebFS = refusingSubFS{}
})
defer teardown()
t.Run("the embedded assets still serve", func(t *testing.T) {
want, err := fs.ReadFile(webassets.FS, "privacy.html")
require.NoError(t, err)
body, code := get(t, ts.URL+"/web/privacy.html")
assert.Equal(t, http.StatusOK, code)
assert.Equal(t, string(want), body)
})
t.Run("a frontend name is missing rather than fatal", func(t *testing.T) {
_, code := get(t, ts.URL+"/web/iframe.html")
assert.Equal(t, http.StatusNotFound, code)
})
}
// TestRest_RejectHeadOnDestructiveGET verifies that HEAD is blocked on the state-mutating
// GET routes (which stdlib http.ServeMux would otherwise route to the GET handler) while
// still being served for safe, read-only routes.
+46
View File
@@ -0,0 +1,46 @@
package api
import (
"errors"
"io/fs"
"path/filepath"
)
// webFiles serves /web from two sources: a name present in the frontend build is served from there,
// and any other name from the assets embedded in the binary.
type webFiles struct {
frontend fs.FS
embedded fs.FS
}
// Open looks the name up in the frontend build first. Only a missing file falls through to the
// embedded assets; every other error is returned so an unreadable file keeps reporting as one
// rather than being replaced by the embedded copy or reported as missing.
func (w webFiles) Open(name string) (fs.File, error) {
// fs.ValidPath alone is not enough: it accepts names the operating system rejects, NUL among
// them, and os.DirFS turns those into fs.ErrInvalid, which renders as 500 rather than 404
if _, err := filepath.Localize(name); err != nil || !fs.ValidPath(name) {
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist}
}
f, err := w.frontend.Open(name)
if err == nil {
return f, nil
}
if !errors.Is(err, fs.ErrNotExist) {
return nil, err
}
if name == "." {
// the embedded set is a flat list of files; only the frontend build answers for the
// directory itself, so a missing web root reports as missing rather than listing them
return nil, err
}
return w.embedded.Open(name)
}
// emptyFS stands in for a frontend source that could not be opened, so a misconfigured one serves
// nothing instead of panicking or serving the build at paths it does not belong at
type emptyFS struct{}
func (emptyFS) Open(name string) (fs.File, error) {
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist}
}
+147
View File
@@ -0,0 +1,147 @@
package api
import (
"io"
"io/fs"
"os"
"path/filepath"
"testing"
"testing/fstest"
"github.com/umputun/remark42/backend/app/webassets"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestWebFiles_Open(t *testing.T) {
frontend := fstest.MapFS{
"both.html": {Data: []byte("from the frontend build")},
"only-frontend.html": {Data: []byte("frontend only")},
}
embedded := fstest.MapFS{
"both.html": {Data: []byte("from the embedded assets")},
"only-embedded.html": {Data: []byte("embedded only")},
}
w := webFiles{frontend: frontend, embedded: embedded}
tbl := []struct {
name string
lookup string
want string
wantErr error
}{
{name: "present in both is served from the frontend build", lookup: "both.html", want: "from the frontend build"},
{name: "frontend only", lookup: "only-frontend.html", want: "frontend only"},
{name: "embedded only", lookup: "only-embedded.html", want: "embedded only"},
{name: "missing in both", lookup: "neither.html", wantErr: fs.ErrNotExist},
}
for _, tt := range tbl {
t.Run(tt.name, func(t *testing.T) {
f, err := w.Open(tt.lookup)
if tt.wantErr != nil {
require.Error(t, err)
assert.ErrorIs(t, err, tt.wantErr)
return
}
require.NoError(t, err)
defer f.Close()
b, err := io.ReadAll(f)
require.NoError(t, err)
assert.Equal(t, tt.want, string(b))
})
}
}
// TestEmptyFS_ServesNothing pins the stand-in used when the frontend source cannot be opened:
// every name must report as missing rather than panicking, since it backs a nil-free fallback.
func TestEmptyFS_ServesNothing(t *testing.T) {
for _, name := range []string{".", "index.html", "web/index.html"} {
t.Run(name, func(t *testing.T) {
f, err := emptyFS{}.Open(name)
require.Error(t, err)
assert.ErrorIs(t, err, fs.ErrNotExist)
assert.Nil(t, f)
})
}
}
// TestWebFiles_EmptyFrontendFallsThrough covers the shape routes() builds when fs.Sub refuses:
// the embedded assets must still answer even though the frontend source serves nothing.
func TestWebFiles_EmptyFrontendFallsThrough(t *testing.T) {
w := webFiles{frontend: emptyFS{}, embedded: webassets.FS}
want, err := fs.ReadFile(webassets.FS, "privacy.html")
require.NoError(t, err)
f, err := w.Open("privacy.html")
require.NoError(t, err)
defer f.Close()
got, err := io.ReadAll(f)
require.NoError(t, err)
assert.Equal(t, string(want), string(got))
}
// TestWebFiles_OpenRootIsNotListed keeps the embedded assets from being browsable: they answer
// for their own names only, so a web root that has gone missing reports as missing.
func TestWebFiles_OpenRootIsNotListed(t *testing.T) {
w := webFiles{frontend: os.DirFS(filepath.Join(t.TempDir(), "absent")), embedded: webassets.FS}
f, err := w.Open(".")
require.Error(t, err, "the embedded assets must not answer for the directory itself")
assert.ErrorIs(t, err, fs.ErrNotExist)
if err == nil {
_ = f.Close()
}
// the assets themselves still serve
f, err = w.Open("privacy.html")
require.NoError(t, err)
require.NoError(t, f.Close())
}
// TestWebFiles_OpenInvalidName pins that a name fs rejects reports as missing rather than invalid.
// os.DirFS returns fs.ErrInvalid for these, which http.FileServer renders as 500, so the check has
// to happen before the lookup. A memory filesystem cannot show this: it reports missing either way.
func TestWebFiles_OpenInvalidName(t *testing.T) {
dir := t.TempDir()
require.NoError(t, os.WriteFile(filepath.Join(dir, "privacy.html"), []byte("frontend"), 0o600))
w := webFiles{frontend: os.DirFS(dir), embedded: webassets.FS}
for _, name := range []string{"../escape.html", "/etc/passwd", "a\x00b.html", "./privacy.html"} {
t.Run(name, func(t *testing.T) {
f, err := w.Open(name)
require.Error(t, err)
assert.ErrorIs(t, err, fs.ErrNotExist)
assert.NotErrorIs(t, err, fs.ErrInvalid, "an invalid name must not surface as 500")
if err == nil {
_ = f.Close()
}
})
}
}
// TestWebFiles_OpenUnreadableFrontendFile pins the rule that only a missing file falls through:
// a frontend file that cannot be read must report that, not be masked by the embedded copy.
func TestWebFiles_OpenUnreadableFrontendFile(t *testing.T) {
if os.Geteuid() == 0 {
t.Skip("root ignores file permissions")
}
dir := t.TempDir()
require.NoError(t, os.WriteFile(filepath.Join(dir, "privacy.html"), []byte("operator's own"), 0o000))
w := webFiles{
frontend: os.DirFS(dir),
embedded: fstest.MapFS{"privacy.html": {Data: []byte("built in")}},
}
f, err := w.Open("privacy.html")
require.Error(t, err, "an unreadable frontend file must not be replaced by the embedded copy")
assert.NotErrorIs(t, err, fs.ErrNotExist, "the error must stay a permission error so it does not render as 404")
assert.ErrorIs(t, err, fs.ErrPermission)
if err == nil {
_ = f.Close()
}
}

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@@ -7,7 +7,6 @@
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
/* stylelint-disable mavrin/stylelint-declaration-use-css-custom-properties */
html {
color: #222;
font-size: 1em;
+18
View File
@@ -0,0 +1,18 @@
// Package webassets holds the files served under /web that the frontend build does not produce:
// plain pages and images with no dependency on the bundler's output, embedded into the binary.
// A file of the same name in the frontend output, on disk under --web-root or embedded at
// app/cmd/web, is served instead, which is how an operator replaces one of these.
// Email and error-page templates are a separate set and live in app/templates.
package webassets
import (
"embed"
"io/fs"
)
//go:embed assets
var embedded embed.FS
// FS holds the assets, each named by its path under /web. fs.Sub cannot fail for a constant
// valid path on an embed.FS, so the error is dropped the same way app/cmd/web's is.
var FS, _ = fs.Sub(embedded, "assets")
+78
View File
@@ -0,0 +1,78 @@
package webassets
import (
"io/fs"
"regexp"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestFS_Contents(t *testing.T) {
entries, err := fs.ReadDir(FS, ".")
require.NoError(t, err)
names := make([]string, 0, len(entries))
for _, e := range entries {
assert.False(t, e.IsDir(), "the assets are served flat under /web, %s is a directory", e.Name())
info, err := e.Info()
require.NoError(t, err)
assert.NotZero(t, info.Size(), "%s is empty", e.Name())
names = append(names, e.Name())
}
assert.Equal(t, []string{"400x400.jpeg", "markdown-help.html", "privacy.html"}, names)
}
// TestFS_ContentShape catches an asset that has been truncated or replaced by something of the
// wrong kind, which a size check alone lets through.
func TestFS_ContentShape(t *testing.T) {
tbl := []struct {
name string
prefix []byte
want string
}{
{name: "400x400.jpeg", prefix: []byte{0xff, 0xd8, 0xff}},
{name: "markdown-help.html", want: "<!DOCTYPE html>"},
{name: "privacy.html", want: "<!DOCTYPE html>"},
}
for _, tt := range tbl {
t.Run(tt.name, func(t *testing.T) {
b, err := fs.ReadFile(FS, tt.name)
require.NoError(t, err)
if tt.prefix != nil {
require.GreaterOrEqual(t, len(b), len(tt.prefix))
assert.Equal(t, tt.prefix, b[:len(tt.prefix)], "not a JPEG")
return
}
assert.True(t, strings.HasPrefix(strings.TrimSpace(string(b)), tt.want), "not an HTML document")
assert.Contains(t, string(b), "</html>", "the document is truncated")
})
}
}
// TestFS_RelativeReferencesResolve keeps the pages self-contained: every relative src and href
// they use has to name a sibling that ships alongside them, since nothing else supplies one.
func TestFS_RelativeReferencesResolve(t *testing.T) {
ref := regexp.MustCompile(`(?:src|href)="([^"]+)"`)
external := regexp.MustCompile(`^(?:[a-z]+:|//|#|mailto:)`)
for _, page := range []string{"markdown-help.html", "privacy.html"} {
t.Run(page, func(t *testing.T) {
b, err := fs.ReadFile(FS, page)
require.NoError(t, err)
for _, m := range ref.FindAllStringSubmatch(string(b), -1) {
target := m[1]
if external.MatchString(target) {
continue
}
_, err := fs.Stat(FS, target)
assert.NoError(t, err, "%s references %q, which ships nowhere", page, target)
}
})
}
}
+10
View File
@@ -55,6 +55,16 @@ These were deliberately not bumped because each is a config-migration or bundle-
- `eslint` 8 (9/10 need flat-config migration), `stylelint` 14 (16 has breaking rule changes), `babel` 7, `jest` 28 (30 needs config changes)
- `redux` 4
## `/web` has a second source
`privacy.html`, `markdown-help.html` and `400x400.jpeg` live in `backend/app/webassets/assets` and
are embedded in the Go binary. The frontend build wins for any name present in both, which is what
lets an operator override one by dropping a file next to the frontend files in `--web-root`. That
directory replaces the embedded frontend outright when it exists, so an override belongs in a
populated one. These three sit outside this toolchain: prettier, stylelint and `pnpm lint` do not
see them, and they are served unminified. `devServer.static` lists the build output first and that
directory second, matching the backend's order, so links to them resolve on the dev port too.
## Verifying a build didn't regress
There's no automated build-output diff in CI. Before merging a dependency PR that touches the bundler/build tooling, manually diff the build output against a clean `master` checkout:
-1
View File
@@ -1,4 +1,3 @@
node_modules
public
extracted-messages
*.jpeg
+1 -1
View File
@@ -39,7 +39,7 @@ module.exports = {
},
overrides: [
{
files: ['*.html', '**/*.html', '*.ejs', '**/*.ejs'],
files: ['*.ejs', '**/*.ejs'],
customSyntax: 'postcss-html',
},
],
+1 -2
View File
@@ -67,7 +67,6 @@
"babel-loader": "^8.2.5",
"babel-plugin-jsx-remove-data-test-id": "^3.0.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.0.0",
@@ -115,7 +114,7 @@
"url-loader": "^4.1.1",
"webpack": "^5.108.3",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.10.0",
"webpack-cli": "^7.2.2",
"webpack-dev-server": "^5.2.5"
}
}
+11 -30
View File
@@ -5,7 +5,6 @@ const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const RefreshPlugin = require('@prefresh/webpack');
@@ -20,6 +19,7 @@ const PORT = process.env.PORT || 9000;
const REMARK_API_BASE_URL = process.env.REMARK_API_BASE_URL || 'http://127.0.0.1:8080';
const DEVSERVER_BASE_PATH = process.env.DEVSERVER_BASE_PATH || `http://127.0.0.1:${PORT}`;
const PUBLIC_FOLDER_PATH = path.resolve(__dirname, 'public');
const WEB_ASSETS_PATH = path.resolve(__dirname, '../../../backend/app/webassets/assets');
const CUSTOM_PROPERTIES_PATH = path.resolve(__dirname, './app/styles/custom-properties.css');
const genId = incstr.idGenerator();
@@ -209,15 +209,16 @@ module.exports = (_, { mode, analyze }) => {
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
},
static: {
staticOptions: {
contentBase: PUBLIC_FOLDER_PATH,
watchOptions: {
ignored: [PUBLIC_FOLDER_PATH, path.resolve(__dirname, 'node_modules')],
},
},
watch: true,
},
static: [
// entries are consulted in order, so the build output comes first here for the same reason
// it does in the backend's file server
// the bundler serves its own output from memory and wipes this directory on every dev build,
// so watching it would only ever fire on the build's own writes
{ directory: PUBLIC_FOLDER_PATH, publicPath: PUBLIC_PATH, watch: false },
// the assets the bundler does not build are served by the backend in production, so the dev
// server reads them straight from where they live, or links to them 404 on this port
{ directory: WEB_ASSETS_PATH, publicPath: PUBLIC_PATH, watch: false },
],
allowedHosts: 'all',
hot: true,
proxy: [
@@ -295,14 +296,6 @@ module.exports = (_, { mode, analyze }) => {
},
plugins: [
...plugins,
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, 'templates/400x400.jpeg'),
to: PUBLIC_FOLDER_PATH,
},
],
}),
new ForkTsCheckerWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'templates/iframe.ejs'),
@@ -340,18 +333,6 @@ module.exports = (_, { mode, analyze }) => {
REMARK_URL,
minify: htmlMinifyOptions,
}),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'templates/markdown-help.html'),
filename: 'markdown-help.html',
inject: false,
minify: htmlMinifyOptions,
}),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'templates/privacy.html'),
filename: 'privacy.html',
inject: false,
minify: htmlMinifyOptions,
}),
...(analyze
? [
new BundleAnalyzerPlugin({
+1 -1
View File
@@ -65,7 +65,7 @@
"launch-editor@<=2.14.0": ">=2.14.1",
"@babel/core@<=7.29.0": ">=7.29.6 <8.0.0",
"webpack-dev-server@<5.2.6": ">=5.2.6 <6.0.0",
"http-proxy-middleware@>=0.16.0 <2.0.10": ">=2.0.10",
"http-proxy-middleware@>=0.16.0 <2.0.10": ">=2.0.10 <3.0.0",
"yaml@>=1.0.0 <2.0.0": ">=1.10.3 <2.0.0",
"yaml@>=2.0.0 <3.0.0": ">=2.9.0 <3.0.0",
"js-yaml@>=3.0.0 <4.0.0": ">=3.15.1 <4.0.0",
+134 -170
View File
@@ -50,7 +50,7 @@ overrides:
launch-editor@<=2.14.0: '>=2.14.1'
'@babel/core@<=7.29.0': '>=7.29.6 <8.0.0'
webpack-dev-server@<5.2.6: '>=5.2.6 <6.0.0'
http-proxy-middleware@>=0.16.0 <2.0.10: '>=2.0.10'
http-proxy-middleware@>=0.16.0 <2.0.10: '>=2.0.10 <3.0.0'
yaml@>=1.0.0 <2.0.0: '>=1.10.3 <2.0.0'
yaml@>=2.0.0 <3.0.0: '>=2.9.0 <3.0.0'
js-yaml@>=3.0.0 <4.0.0: '>=3.15.1 <4.0.0'
@@ -200,9 +200,6 @@ importers:
clean-webpack-plugin:
specifier: ^4.0.0
version: 4.0.0(webpack@5.108.3)
copy-webpack-plugin:
specifier: ^12.0.2
version: 12.0.2(webpack@5.108.3)
cross-env:
specifier: ^7.0.3
version: 7.0.3
@@ -340,16 +337,16 @@ importers:
version: 4.1.1(file-loader@6.2.0(webpack@5.108.3))(webpack@5.108.3)
webpack:
specifier: ^5.108.3
version: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
version: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
webpack-bundle-analyzer:
specifier: ^4.5.0
version: 4.10.2
webpack-cli:
specifier: ^4.10.0
version: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
specifier: ^7.2.2
version: 7.2.2(js-yaml@5.3.0)(json5@2.2.3)(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
webpack-dev-server:
specifier: '>=5.2.6 <6.0.0'
version: 5.2.6(tslib@2.8.1)(webpack-cli@4.10.0)(webpack@5.108.3)
version: 5.2.6(tslib@2.8.1)(webpack-cli@7.2.2)(webpack@5.108.3)
packages:
@@ -1164,6 +1161,10 @@ packages:
resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==}
engines: {node: '>=10.0.0'}
'@discoveryjs/json-ext@1.1.0':
resolution: {integrity: sha512-Xc3VhU02wqZ1HvHRJUwL09HkZSTvidqY5Ya0NXBSYOxAp+Ln9dcJr9fySI+CkONzP3PekQo9WdzCv0PGER/mOA==}
engines: {node: '>=14.17.0'}
'@eslint-community/eslint-utils@4.9.1':
resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -1557,10 +1558,6 @@ packages:
'@sinclair/typebox@0.34.49':
resolution: {integrity: sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==}
'@sindresorhus/merge-streams@2.3.0':
resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}
engines: {node: '>=18'}
'@sinonjs/commons@1.8.6':
resolution: {integrity: sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==}
@@ -1752,6 +1749,9 @@ packages:
'@types/http-errors@2.0.5':
resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==}
'@types/http-proxy@1.17.17':
resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==}
'@types/istanbul-lib-coverage@2.0.6':
resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==}
@@ -2037,26 +2037,6 @@ packages:
'@webassemblyjs/wast-printer@1.14.1':
resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==}
'@webpack-cli/configtest@1.2.0':
resolution: {integrity: sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==}
peerDependencies:
webpack: 4.x.x || 5.x.x
webpack-cli: 4.x.x
'@webpack-cli/info@1.5.0':
resolution: {integrity: sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==}
peerDependencies:
webpack-cli: 4.x.x
'@webpack-cli/serve@1.7.0':
resolution: {integrity: sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==}
peerDependencies:
webpack-cli: 4.x.x
webpack-dev-server: '*'
peerDependenciesMeta:
webpack-dev-server:
optional: true
'@xtuc/ieee754@1.2.0':
resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==}
@@ -2573,6 +2553,10 @@ packages:
resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
engines: {node: '>=16'}
commander@14.0.3:
resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==}
engines: {node: '>=20'}
commander@2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
@@ -2626,12 +2610,6 @@ packages:
resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
engines: {node: '>= 0.6'}
copy-webpack-plugin@12.0.2:
resolution: {integrity: sha512-SNwdBeHyII+rWvee/bTnAYyO8vfVdcSTud4EIb6jcZ8inLeWucJE0DnxXQBjlQ5zlteuuvooGQy3LIyGxhvlOA==}
engines: {node: '>= 18.12.0'}
peerDependencies:
webpack: ^5.1.0
core-js-compat@3.49.0:
resolution: {integrity: sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==}
@@ -3293,6 +3271,9 @@ packages:
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
engines: {node: '>= 0.6'}
eventemitter3@4.0.7:
resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==}
eventemitter3@5.0.4:
resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==}
@@ -3406,6 +3387,15 @@ packages:
flatted@3.4.2:
resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==}
follow-redirects@1.16.0:
resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
for-each@0.3.5:
resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==}
engines: {node: '>= 0.4'}
@@ -3531,10 +3521,6 @@ packages:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
globby@14.1.0:
resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==}
engines: {node: '>=18'}
globby@6.1.0:
resolution: {integrity: sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==}
engines: {node: '>=0.10.0'}
@@ -3663,17 +3649,23 @@ packages:
resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
engines: {node: '>= 6'}
http-proxy-middleware@4.1.1:
resolution: {integrity: sha512-KX5ZofGXLFXqFAkQoOWZ+rTtaLTut7m0gyL+QzJrdejtIZ+F4bPPDoe7reISg2+v0CAz5OfVwEJEhty7X+e57g==}
engines: {node: ^22.15.0 || ^24.0.0 || >=26.0.0}
http-proxy-middleware@2.0.10:
resolution: {integrity: sha512-RKzRWNPxUZqbuk3BC5mGVJbBnWgr+diEnjJexIOytFbBzDy88Fbh/YvBr3DsNrl1jYAfjWfpATEv0NO35FDuPQ==}
engines: {node: '>=12.0.0'}
peerDependencies:
'@types/express': ^4.17.13
peerDependenciesMeta:
'@types/express':
optional: true
http-proxy@1.18.1:
resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==}
engines: {node: '>=8.0.0'}
https-proxy-agent@5.0.1:
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
engines: {node: '>= 6'}
httpxy@0.5.4:
resolution: {integrity: sha512-URfeibL0kTH6VuIxxaJDXWQWEk8fKr+9L8MGv6CuAiNy0fGnoVhWbXBvJR1mkdsvCDUxvhX9cW60k2AhtH5s6w==}
human-signals@2.1.0:
resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
engines: {node: '>=10.17.0'}
@@ -3755,9 +3747,9 @@ packages:
resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==}
engines: {node: '>= 0.4'}
interpret@2.2.0:
resolution: {integrity: sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==}
engines: {node: '>= 0.10'}
interpret@3.1.1:
resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==}
engines: {node: '>=10.13.0'}
ipaddr.js@1.9.1:
resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
@@ -3892,9 +3884,9 @@ packages:
resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==}
engines: {node: '>=0.10.0'}
is-plain-obj@4.1.0:
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
is-plain-obj@3.0.0:
resolution: {integrity: sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==}
engines: {node: '>=10'}
is-plain-object@2.0.4:
resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==}
@@ -4792,10 +4784,6 @@ packages:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
path-type@6.0.0:
resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==}
engines: {node: '>=18'}
picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -5361,9 +5349,9 @@ packages:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
rechoir@0.7.1:
resolution: {integrity: sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==}
engines: {node: '>= 0.10'}
rechoir@0.8.0:
resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==}
engines: {node: '>= 10.13.0'}
redent@3.0.0:
resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
@@ -5426,6 +5414,9 @@ packages:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
requires-port@1.0.0:
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
resolve-cwd@3.0.0:
resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==}
engines: {node: '>=8'}
@@ -5623,10 +5614,6 @@ packages:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
slash@5.1.0:
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
engines: {node: '>=14.16'}
slice-ansi@4.0.0:
resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==}
engines: {node: '>=10'}
@@ -6072,10 +6059,6 @@ packages:
resolution: {integrity: sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==}
engines: {node: '>=4'}
unicorn-magic@0.3.0:
resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==}
engines: {node: '>=18'}
universalify@2.0.1:
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
engines: {node: '>= 10.0.0'}
@@ -6164,20 +6147,23 @@ packages:
engines: {node: '>= 10.13.0'}
hasBin: true
webpack-cli@4.10.0:
resolution: {integrity: sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==}
engines: {node: '>=10.13.0'}
webpack-cli@7.2.2:
resolution: {integrity: sha512-lD0pALneslq8FfV+rwvm1BMW0AFAJrHHhNupAGN4asYjMvqrtRsenU4iKpiBo09gS4ntMxKGUxl9jhTEzVt0oA==}
engines: {node: '>=20.9.0'}
hasBin: true
peerDependencies:
'@webpack-cli/generators': '*'
'@webpack-cli/migrate': '*'
webpack: 4.x.x || 5.x.x
webpack-bundle-analyzer: '*'
webpack-dev-server: '*'
js-yaml: '>=5.2.2 <6.0.0'
json5: ^2.2.3
toml: ^3.0.0 || ^4.0.0
webpack: ^5.101.0
webpack-bundle-analyzer: ^4.0.0 || ^5.0.0
webpack-dev-server: '>=5.2.6 <6.0.0'
peerDependenciesMeta:
'@webpack-cli/generators':
js-yaml:
optional: true
'@webpack-cli/migrate':
json5:
optional: true
toml:
optional: true
webpack-bundle-analyzer:
optional: true
@@ -6206,9 +6192,9 @@ packages:
webpack-cli:
optional: true
webpack-merge@5.10.0:
resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==}
engines: {node: '>=10.0.0'}
webpack-merge@6.0.1:
resolution: {integrity: sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==}
engines: {node: '>=18.0.0'}
webpack-sources@3.5.0:
resolution: {integrity: sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ==}
@@ -7361,6 +7347,8 @@ snapshots:
'@discoveryjs/json-ext@0.5.7': {}
'@discoveryjs/json-ext@1.1.0': {}
'@eslint-community/eslint-utils@4.9.1(eslint@8.57.1)':
dependencies:
eslint: 8.57.1
@@ -7908,7 +7896,7 @@ snapshots:
'@prefresh/core': 1.5.10(preact@10.29.8)
'@prefresh/utils': 1.2.1
preact: 10.29.8
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
'@rtsao/scc@1.1.0': {}
@@ -7920,8 +7908,6 @@ snapshots:
'@sinclair/typebox@0.34.49': {}
'@sindresorhus/merge-streams@2.3.0': {}
'@sinonjs/commons@1.8.6':
dependencies:
type-detect: 4.0.8
@@ -8125,6 +8111,10 @@ snapshots:
'@types/http-errors@2.0.5': {}
'@types/http-proxy@1.17.17':
dependencies:
'@types/node': 26.0.1
'@types/istanbul-lib-coverage@2.0.6': {}
'@types/istanbul-lib-report@3.0.3':
@@ -8503,22 +8493,6 @@ snapshots:
'@webassemblyjs/ast': 1.14.1
'@xtuc/long': 4.2.2
'@webpack-cli/configtest@1.2.0(webpack-cli@4.10.0)(webpack@5.108.3)':
dependencies:
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
'@webpack-cli/info@1.5.0(webpack-cli@4.10.0)':
dependencies:
envinfo: 7.21.0
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
'@webpack-cli/serve@1.7.0(webpack-cli@4.10.0)(webpack-dev-server@5.2.6)':
dependencies:
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
optionalDependencies:
webpack-dev-server: 5.2.6(tslib@2.8.1)(webpack-cli@4.10.0)(webpack@5.108.3)
'@xtuc/ieee754@1.2.0': {}
'@xtuc/long@4.2.2': {}
@@ -8769,7 +8743,7 @@ snapshots:
loader-utils: 2.0.4
make-dir: 3.1.0
schema-utils: 2.7.1
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
babel-plugin-istanbul@6.1.1:
dependencies:
@@ -9046,7 +9020,7 @@ snapshots:
clean-webpack-plugin@4.0.0(webpack@5.108.3):
dependencies:
del: 4.1.1
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
cli-cursor@4.0.0:
dependencies:
@@ -9099,6 +9073,8 @@ snapshots:
commander@11.1.0: {}
commander@14.0.3: {}
commander@2.20.3: {}
commander@7.2.0: {}
@@ -9143,16 +9119,6 @@ snapshots:
cookie@0.7.2: {}
copy-webpack-plugin@12.0.2(webpack@5.108.3):
dependencies:
fast-glob: 3.3.3
glob-parent: 6.0.2
globby: 14.1.0
normalize-path: 3.0.0
schema-utils: 4.3.3
serialize-javascript: 7.0.7
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
core-js-compat@3.49.0:
dependencies:
browserslist: 4.28.4
@@ -9223,7 +9189,7 @@ snapshots:
postcss-value-parser: 4.2.0
semver: 7.8.5
optionalDependencies:
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
css-minimizer-webpack-plugin@4.2.2(webpack@5.108.3):
dependencies:
@@ -9233,7 +9199,7 @@ snapshots:
schema-utils: 4.3.3
serialize-javascript: 7.0.7
source-map: 0.6.1
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
css-prefers-color-scheme@6.0.3(postcss@8.5.26):
dependencies:
@@ -10016,6 +9982,8 @@ snapshots:
etag@1.8.1: {}
eventemitter3@4.0.7: {}
eventemitter3@5.0.4: {}
events@3.3.0: {}
@@ -10139,7 +10107,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
fill-range@7.1.1:
dependencies:
@@ -10183,6 +10151,8 @@ snapshots:
flatted@3.4.2: {}
follow-redirects@1.16.0: {}
for-each@0.3.5:
dependencies:
is-callable: 1.2.7
@@ -10202,7 +10172,7 @@ snapshots:
semver: 7.8.5
tapable: 2.3.3
typescript: 5.9.3
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
form-data@4.0.6:
dependencies:
@@ -10330,15 +10300,6 @@ snapshots:
merge2: 1.4.1
slash: 3.0.0
globby@14.1.0:
dependencies:
'@sindresorhus/merge-streams': 2.3.0
fast-glob: 3.3.3
ignore: 7.0.5
path-type: 6.0.0
slash: 5.1.0
unicorn-magic: 0.3.0
globby@6.1.0:
dependencies:
array-union: 1.0.2
@@ -10430,7 +10391,7 @@ snapshots:
pretty-error: 4.0.0
tapable: 2.3.3
optionalDependencies:
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
htmlparser2@6.1.0:
dependencies:
@@ -10474,15 +10435,25 @@ snapshots:
transitivePeerDependencies:
- supports-color
http-proxy-middleware@4.1.1:
http-proxy-middleware@2.0.10(@types/express@4.17.25):
dependencies:
debug: 4.4.3
httpxy: 0.5.4
'@types/http-proxy': 1.17.17
http-proxy: 1.18.1
is-glob: 4.0.3
is-plain-obj: 4.1.0
is-plain-obj: 3.0.0
micromatch: 4.0.8
optionalDependencies:
'@types/express': 4.17.25
transitivePeerDependencies:
- supports-color
- debug
http-proxy@1.18.1:
dependencies:
eventemitter3: 4.0.7
follow-redirects: 1.16.0
requires-port: 1.0.0
transitivePeerDependencies:
- debug
https-proxy-agent@5.0.1:
dependencies:
@@ -10491,8 +10462,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
httpxy@0.5.4: {}
human-signals@2.1.0: {}
human-signals@4.3.1: {}
@@ -10554,7 +10523,7 @@ snapshots:
hasown: 2.0.4
side-channel: 1.1.1
interpret@2.2.0: {}
interpret@3.1.1: {}
ipaddr.js@1.9.1: {}
@@ -10672,7 +10641,7 @@ snapshots:
is-plain-obj@1.1.0: {}
is-plain-obj@4.1.0: {}
is-plain-obj@3.0.0: {}
is-plain-object@2.0.4:
dependencies:
@@ -11442,7 +11411,7 @@ snapshots:
dependencies:
schema-utils: 4.3.3
tapable: 2.3.3
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
minimalistic-assert@1.0.1: {}
@@ -11468,7 +11437,7 @@ snapshots:
jest-worker: 27.5.1
schema-utils: 4.3.3
terser: 5.48.0
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
optionalDependencies:
'@swc/core': 1.2.205
cssnano: 5.1.15(postcss@8.5.26)
@@ -11753,8 +11722,6 @@ snapshots:
path-type@4.0.0: {}
path-type@6.0.0: {}
picocolors@1.1.1: {}
picomatch@2.3.2: {}
@@ -11932,7 +11899,7 @@ snapshots:
jiti: 1.21.7
postcss: 8.5.26
semver: 7.8.5
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
transitivePeerDependencies:
- typescript
@@ -12315,7 +12282,7 @@ snapshots:
dependencies:
picomatch: 2.3.2
rechoir@0.7.1:
rechoir@0.8.0:
dependencies:
resolve: 1.22.12
@@ -12394,6 +12361,8 @@ snapshots:
require-from-string@2.0.2: {}
requires-port@1.0.0: {}
resolve-cwd@3.0.0:
dependencies:
resolve-from: 5.0.0
@@ -12634,8 +12603,6 @@ snapshots:
slash@3.0.0: {}
slash@5.1.0: {}
slice-ansi@4.0.0:
dependencies:
ansi-styles: 4.3.0
@@ -12832,7 +12799,7 @@ snapshots:
style-loader@3.3.4(webpack@5.108.3):
dependencies:
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
style-search@0.1.0: {}
@@ -13020,7 +12987,7 @@ snapshots:
picomatch: 4.0.4
source-map: 0.7.6
typescript: 5.9.3
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
optionalDependencies:
loader-utils: 2.0.4
@@ -13150,8 +13117,6 @@ snapshots:
unicode-property-aliases-ecmascript@2.2.0: {}
unicorn-magic@0.3.0: {}
universalify@2.0.1: {}
unpipe@1.0.0: {}
@@ -13171,7 +13136,7 @@ snapshots:
loader-utils: 2.0.4
mime-types: 2.1.35
schema-utils: 3.3.0
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
optionalDependencies:
file-loader: 6.2.0(webpack@5.108.3)
@@ -13242,24 +13207,22 @@ snapshots:
- bufferutil
- utf-8-validate
webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3):
webpack-cli@7.2.2(js-yaml@5.3.0)(json5@2.2.3)(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3):
dependencies:
'@discoveryjs/json-ext': 0.5.7
'@webpack-cli/configtest': 1.2.0(webpack-cli@4.10.0)(webpack@5.108.3)
'@webpack-cli/info': 1.5.0(webpack-cli@4.10.0)
'@webpack-cli/serve': 1.7.0(webpack-cli@4.10.0)(webpack-dev-server@5.2.6)
colorette: 2.0.20
commander: 7.2.0
'@discoveryjs/json-ext': 1.1.0
commander: 14.0.3
cross-spawn: 7.0.6
fastest-levenshtein: 1.0.16
envinfo: 7.21.0
import-local: 3.2.0
interpret: 2.2.0
rechoir: 0.7.1
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack-merge: 5.10.0
interpret: 3.1.1
rechoir: 0.8.0
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
webpack-merge: 6.0.1
optionalDependencies:
js-yaml: 5.3.0
json5: 2.2.3
webpack-bundle-analyzer: 4.10.2
webpack-dev-server: 5.2.6(tslib@2.8.1)(webpack-cli@4.10.0)(webpack@5.108.3)
webpack-dev-server: 5.2.6(tslib@2.8.1)(webpack-cli@7.2.2)(webpack@5.108.3)
webpack-dev-middleware@7.4.5(tslib@2.8.1)(webpack@5.108.3):
dependencies:
@@ -13270,11 +13233,11 @@ snapshots:
range-parser: 1.3.0
schema-utils: 4.3.3
optionalDependencies:
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
transitivePeerDependencies:
- tslib
webpack-dev-server@5.2.6(tslib@2.8.1)(webpack-cli@4.10.0)(webpack@5.108.3):
webpack-dev-server@5.2.6(tslib@2.8.1)(webpack-cli@7.2.2)(webpack@5.108.3):
dependencies:
'@types/bonjour': 3.5.13
'@types/connect-history-api-fallback': 1.5.4
@@ -13292,7 +13255,7 @@ snapshots:
connect-history-api-fallback: 2.0.0
express: 4.22.2
graceful-fs: 4.2.11
http-proxy-middleware: 4.1.1
http-proxy-middleware: 2.0.10(@types/express@4.17.25)
ipaddr.js: 2.4.0
launch-editor: 2.14.1
open: 10.2.0
@@ -13305,15 +13268,16 @@ snapshots:
webpack-dev-middleware: 7.4.5(tslib@2.8.1)(webpack@5.108.3)
ws: 8.21.0
optionalDependencies:
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0)
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
webpack: 5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2)
webpack-cli: 7.2.2(js-yaml@5.3.0)(json5@2.2.3)(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
transitivePeerDependencies:
- bufferutil
- debug
- supports-color
- tslib
- utf-8-validate
webpack-merge@5.10.0:
webpack-merge@6.0.1:
dependencies:
clone-deep: 4.0.1
flat: 5.0.2
@@ -13321,7 +13285,7 @@ snapshots:
webpack-sources@3.5.0: {}
webpack@5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@4.10.0):
webpack@5.108.3(@swc/core@1.2.205)(cssnano@5.1.15(postcss@8.5.26))(postcss@8.5.26)(webpack-cli@7.2.2):
dependencies:
'@types/estree': 1.0.9
'@types/json-schema': 7.0.15
@@ -13346,7 +13310,7 @@ snapshots:
watchpack: 2.5.2
webpack-sources: 3.5.0
optionalDependencies:
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
webpack-cli: 7.2.2(js-yaml@5.3.0)(json5@2.2.3)(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.2.6)(webpack@5.108.3)
transitivePeerDependencies:
- '@minify-html/node'
- '@swc/core'
@@ -53,7 +53,7 @@ After completing the previous steps, you can configure the Apple auth provider.
- Upload a logo, if you want to
- In the **App Domain** section:
- **Application home page** - your site URL, e.g., `https://mysite.com`
- **Application privacy policy link** - `/web/privacy.html` of your Remark42 installation, e.g. `https://remark42.mysite.com/web/privacy.html` (please check that it works)
- **Application privacy policy link** - `/web/privacy.html` of your Remark42 installation, e.g. `https://remark42.mysite.com/web/privacy.html` (please check that it works). The page shipped with Remark42 describes remark42.com rather than your site; to serve your own, add a `privacy.html` alongside the frontend files in the `web-root` / `REMARK_WEB_ROOT` directory (`/srv/web` in the Docker image), which is served in preference to the built-in one. Add it to that directory rather than creating one: once the directory exists it supplies the whole frontend, so a web root holding only a `privacy.html` leaves the widget unreachable
- **Terms of service** - leave empty
- **Authorized domains** - your site domain, e.g., `mysite.com`
- **Developer contact information** - add your email, and then click **Save and continue**
@@ -170,7 +170,7 @@ services:
| allowed-hosts | ALLOWED_HOSTS | enable all | limit hosts/sources allowed to embed comments via CSP 'frame-ancestors' |
| address | REMARK_ADDRESS | all interfaces | web server listening address |
| port | REMARK_PORT | `8080` | web server port |
| web-root | REMARK_WEB_ROOT | `./web` | web server root directory |
| web-root | REMARK_WEB_ROOT | `./web` | web server root, supplies the frontend when it exists |
| update-limit | UPDATE_LIMIT | `0.5` | updates/sec limit |
| trusted-proxy | TRUSTED_PROXY | none (trust any) | reverse-proxy networks (CIDR/IP, comma-separated) trusted to set the client IP; see [Trusted proxies and client IP](#trusted-proxies-and-client-ip) |
| subscribers-only | SUBSCRIBERS_ONLY | `false` | enable commenting only for Patreon subscribers |
@@ -34,7 +34,7 @@ Run tests in your IDE, and re-run `make rundev` each time you want to see how yo
You have to [install](https://golang.org/doc/install) the latest stable `go` toolchain to run the backend locally.
In order to have working Remark42 installation you need once to copy frontend static files to `./backend/web` directory from `master` docker image, as it is expected to be where application compiles:
In order to have working Remark42 installation you need once to copy frontend static files to `./backend/app/cmd/web` directory from `master` docker image, as it is expected to be where application compiles:
```shell
# frontend files
@@ -49,6 +49,11 @@ find -E ./backend/app/cmd/web -regex '.*\.(html|js|mjs)$' -print -exec sed -i ''
find ./backend/app/cmd/web -regex '.*\.\(html\|js\|mjs\)$' -print -exec sed -i "s|{% REMARK_URL %}|http://127.0.0.1:8080|g" {} \;
```
The assets under `/web` the frontend does not build (`privacy.html`, `markdown-help.html`,
`400x400.jpeg`) come from `backend/app/webassets/assets` and are embedded in the binary, so the copy
above neither covers them nor needs to. At runtime a file of the same name under `web-root` /
`REMARK_WEB_ROOT` is served in preference to the embedded one.
To run backend - `cd backend; go run app/main.go server --dbg --secret=12345 --url=http://127.0.0.1:8080 --admin-passwd=password --site=remark`. It stars backend service with embedded bolt store on port `8080` with basic auth, allowing to authenticate and run requests directly, like this:
`HTTP http://admin:password@127.0.0.1:8080/api/v1/find?site=remark&sort=-active&format=tree&url=http://127.0.0.1:8080`
@@ -88,6 +88,12 @@ Remark42 frontend can be built statically, and that's how the production version
Run `pnpm build` inside `./frontend`, and result files will be saved in `./frontend/apps/remark42/public`.
`/web` is served from two sources. This build output comes first; anything it does not emit is
served from `backend/app/webassets/assets`, embedded in the backend binary, which is where
`privacy.html`, `markdown-help.html` and `400x400.jpeg` live. A plain page or image the bundler
does not process belongs there rather than here. Those files sit outside the frontend toolchain,
so prettier, stylelint and `pnpm lint` do not see them.
## Code Style
- The project uses TypeScript to analyze code statically