diff --git a/.changeset/marko-e2e-consolidation.md b/.changeset/marko-e2e-consolidation.md new file mode 100644 index 00000000..fcf8c26d --- /dev/null +++ b/.changeset/marko-e2e-consolidation.md @@ -0,0 +1,12 @@ +--- +'@tanstack/marko-virtual': patch +--- + +Stop publishing the tags build's incremental state: `marko-type-check` writes +`dist/tsconfig.tags.tsbuildinfo`, which the `files` field shipped to npm and nx +cached as part of `dist`. Because `@marko/type-check` always runs incrementally, a +`dist` that carried that file but not `dist/tags` (which `marko.json` points at) +made every subsequent build a silent no-op — exit 0, nothing emitted — and any +consumer then failed to compile with +`ENOENT: no such file or directory, scandir '.../dist/tags'`. The build now removes +the file after emitting, so a build always produces `dist/tags`. diff --git a/.gitignore b/.gitignore index 8b0d0de9..36fee550 100644 --- a/.gitignore +++ b/.gitignore @@ -46,4 +46,7 @@ vite.config.ts.timestamp-* test-results/ playwright-report/ *.log -**/*.tsbuildinfo \ No newline at end of file +**/*.tsbuildinfo + +# Marko Run generated route types +.marko-run/ diff --git a/examples/marko/chat-pretext/.marko-run/routes.d.ts b/examples/marko/chat-pretext/.marko-run/routes.d.ts deleted file mode 100644 index 89bb36bd..00000000 --- a/examples/marko/chat-pretext/.marko-run/routes.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - WARNING: This file is automatically generated and any changes made to it will be overwritten without warning. - Do NOT manually edit this file or your changes will be lost. -*/ - -import { - NotHandled, - NotMatched, - GetPaths, - PostPaths, - GetablePath, - GetableHref, - PostablePath, - PostableHref, - Platform, -} from '@marko/run/namespace' -import type * as Run from '@marko/run' - -declare module '@marko/run' { - interface AppData extends Run.DefineApp<{ - routes: { - '/': { verb: 'get' } - '/api/reply': { verb: 'post' } - } - }> {} -} - -declare module '../src/routes/api/reply/+handler' { - namespace MarkoRun { - export { - NotHandled, - NotMatched, - GetPaths, - PostPaths, - GetablePath, - GetableHref, - PostablePath, - PostableHref, - Platform, - } - export type Route = Run.Routes['/api/reply'] - export type Context = Run.MultiRouteContext - export type Handler = Run.HandlerLike - export type GET = Run.HandlerLike - export type HEAD = Run.HandlerLike - export type POST = Run.HandlerLike - export type PUT = Run.HandlerLike - export type DELETE = Run.HandlerLike - export type PATCH = Run.HandlerLike - export type OPTIONS = Run.HandlerLike - /** @deprecated use `((context, next) => { ... }) satisfies MarkoRun.Handler` instead */ - export const route: Run.HandlerTypeFn - } -} - -declare module '../src/routes/+page.marko' { - namespace MarkoRun { - export { - NotHandled, - NotMatched, - GetPaths, - PostPaths, - GetablePath, - GetableHref, - PostablePath, - PostableHref, - Platform, - } - export type Route = Run.Routes['/'] - export type Context = Run.MultiRouteContext & Marko.Global - export type Handler = Run.HandlerLike - export type GET = Run.HandlerLike - export type HEAD = Run.HandlerLike - export type POST = Run.HandlerLike - export type PUT = Run.HandlerLike - export type DELETE = Run.HandlerLike - export type PATCH = Run.HandlerLike - export type OPTIONS = Run.HandlerLike - /** @deprecated use `((context, next) => { ... }) satisfies MarkoRun.Handler` instead */ - export const route: Run.HandlerTypeFn - } -} diff --git a/examples/marko/chat-pretext/e2e/README.md b/examples/marko/chat-pretext/e2e/README.md deleted file mode 100644 index 785422f2..00000000 --- a/examples/marko/chat-pretext/e2e/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Chat + Pretext example — browser tests - -In the monorepo: install at the repo root as usual (`pnpm install` — the workspace -brings in this example's `@playwright/test` and `@chenglou/pretext` too). Then, from -this directory (examples/marko/chat-pretext): - - npx playwright install chromium # one-time browser download - npm run test:e2e # starts the dev server itself, runs 9 tests, tears down - -Standalone (this folder copied out of the monorepo): run `pnpm install` (or -`npm install`) inside the folder first, then the same two commands. - -The suite carries the Chat example's seven scroll-behavior gates (calculated heights -must not regress any of them) plus this example's two headline assertions: prepending -history produces NO measurement-correction kick (at most the single intended anchor -compensation), and the streamed reply's growth is delivered through v.resizeItem with -a calculated height that matches the rendered DOM within a pixel. diff --git a/examples/marko/chat-pretext/package.json b/examples/marko/chat-pretext/package.json index 21239ad0..b465d069 100644 --- a/examples/marko/chat-pretext/package.json +++ b/examples/marko/chat-pretext/package.json @@ -6,7 +6,6 @@ "dev": "marko-run dev", "build": "marko-run build", "preview": "marko-run preview", - "test:e2e": "playwright test", "test:types": "marko-type-check" }, "dependencies": { @@ -18,7 +17,6 @@ "devDependencies": { "@marko/language-tools": "^2.6.2", "@marko/type-check": "3.1.1", - "@playwright/test": "^1.53.1", "typescript": "5.9.3", "vite": "^6.4.2" } diff --git a/examples/marko/chat-pretext/playwright.config.ts b/examples/marko/chat-pretext/playwright.config.ts deleted file mode 100644 index 8a71d30d..00000000 --- a/examples/marko/chat-pretext/playwright.config.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { defineConfig } from '@playwright/test' - -// Unique per-example port. CI runs several example e2e suites in parallel, so a -// port shared across examples collides: one suite claims it and the rest either -// fail to start ("port already used") or attach to a different example's app and -// then miss the elements they assert on. Override with MARKO_E2E_PORT to point a -// run at a manually started server. -const PORT = Number(process.env.MARKO_E2E_PORT ?? 4174) -const baseURL = `http://localhost:${PORT}` - -export default defineConfig({ - testDir: './e2e', - timeout: 30_000, - retries: 0, - workers: 1, - use: { - baseURL, - }, - webServer: { - command: `npm run dev -- --port ${PORT}`, - url: baseURL, - // Reuse a manually-started dev server (npm run dev -- --port 4174) if one is - // already up — simpler to debug; CI should start its own. - reuseExistingServer: !process.env.CI, - // Surface the dev server's output in the test terminal so a crashing or - // slow-compiling server is visible instead of a silent stall. - stdout: 'pipe', - stderr: 'pipe', - timeout: 120_000, - }, -}) diff --git a/examples/marko/chat-pretext/src/routes/+page.marko b/examples/marko/chat-pretext/src/routes/+page.marko index 34ac6d7c..1a14ede0 100644 --- a/examples/marko/chat-pretext/src/routes/+page.marko +++ b/examples/marko/chat-pretext/src/routes/+page.marko @@ -133,6 +133,14 @@ static function messageHeight(message: Message, viewportWidth: number) { pinnedInitially: false, autoHistoryArmed: false, autoHistoryEnabled: false, + // "Latest" in flight: keep re-pinning until the end is actually reached. A + // single scrollToEnd() can land and then be carried away — e.g. an in-flight + // history prepend (180ms timer) resolving AFTER the jump grows the content + // above the viewport, and if core's offset read is stale at that moment its + // at-end compensation is skipped — so the view strands ~12 rows short with no + // scroll event to recover it. The reactive