fix(dev-server,security): repair two defects that only appear in a published build

The dev server shipped two entries, index and serve-entry, bundled
independently because the publish build set splitting:false. They share
pipeline.ts, which holds mutable module state -- compileCacheDir, set once
at startup by the bootstrap, and browserArtifactPaths, populated during
compilation and read when serving /__wrnexus/client/*. Duplicating the
module duplicated the state, so the writer and the reader addressed
different copies: every component client module 404'd and .wrn compilation
wrote nothing. It works from source, where there is one module instance,
which is why it reached a release. Emitting a shared chunk fixes it for
every package at once.

resetDevCache also ran several hundred lines after the plugin virtual
modules were written into the same directory, deleting them at every boot.
An app with no plugins never noticed; an app with one lost them every time.

Separately, secureCookieOptions spread ...options after its path default,
and setSecureCookie always forwards an explicit path key -- so omitting
path emitted a cookie with no Path at all, which the browser then scoped to
the request's directory.

Verified end to end against a real app installing the published packages:
17 artifacts written, client modules 200, and the sign-in form submits from
the UI and reaches /dashboard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-21 09:04:12 +05:30
co-authored by Claude Opus 5
parent ef6de302e9
commit eeef2d79df
6 changed files with 117 additions and 8 deletions
+6
View File
@@ -13,6 +13,12 @@
],
"port": 3520
},
{
"name": "sendline",
"runtimeExecutable": "bun",
"runtimeArgs": ["run", "--cwd", "D:/Company/sendline", "dev", "--port=3610"],
"port": 3610
},
{
"name": "component-showcase",
"runtimeExecutable": "bun",