Commit Graph

1925 Commits

Author SHA1 Message Date
Matt Silverlock 76fad51097 improve viguy agent triage, community PR evaluation, and known patterns (#168) 2026-02-27 16:57:48 +00:00
Steve Faulkner 9939063998 Clarify OpenNext language in README (#166) 2026-02-27 10:42:15 -06:00
Matt Silverlock 3679418f16 fix: add scope constraint to Bonk agent prompts (#163)
* fix: add scope constraint to Bonk agent prompts (#161)

* Apply suggestion from @elithrar

* Apply suggestion from @elithrar

* fix: reference $ISSUE_NUMBER/$PR_NUMBER env vars as ground truth in scope constraint
2026-02-27 09:34:57 -05:00
Fred K. Schott 7b050d2064 chore: suppress no-implied-eval warnings in codegen tests (#156)
These tests intentionally use new Function() to evaluate generated
middleware codegen output. Add eslint-disable-next-line comments to
fix --deny-warnings CI failures.
2026-02-27 08:18:26 +00:00
Fred K. Schott a498012970 Update README with new project setup instructions
Added instructions for starting a new vinext project.
2026-02-26 23:57:30 -08:00
ubugeeei 2c650ec089 feat: type aware linting with tsgolint (#38) 2026-02-27 07:37:12 +00:00
situ2001 8dc679eccd fix: remove some of any type annotations in index.ts (#63)
* refactor: wrap Vite configuration with `defineConfig`

* refactor: remove type any

* refactor: remove as any

* refactor: remove as any

* refactor: use UserConfig type instead of defineConfig for internal config object

defineConfig is an identity function meant for user-land vite.config files.
Frameworks should use the UserConfig type annotation directly, which provides
the same type inference without the semantic mismatch.

---------

Co-authored-by: Fred K. Schott <622227+FredKSchott@users.noreply.github.com>
2026-02-27 07:29:41 +00:00
nianyi(likai) 35757845d1 fix: eliminate react-dom/server.edge dual-import Rollup warning in SSR entry (#41)
* fix: use static import for renderToStaticMarkup to eliminate dual-import warning

The generated SSR entry imported renderToReadableStream statically from
react-dom/server.edge at the top level, but later used a dynamic
import() for renderToStaticMarkup from the same module. Rollup detects
this mixed static+dynamic import pattern and emits a warning for every
build:

  "react-dom/server.edge" is imported as both a static and dynamic
  import in the same module

Fix: add renderToStaticMarkup to the existing static import, removing
the redundant dynamic import(). The module was already loaded — the
dynamic import added no lazy-loading benefit since it runs
unconditionally during SSR.

* Remove comment on renderToStaticMarkup import

Removed comment about static import of renderToStaticMarkup.

* Remove unneccesary test

---------

Co-authored-by: Fred K. Schott <622227+FredKSchott@users.noreply.github.com>
2026-02-27 07:13:10 +00:00
ToddLiao a82478404d fix: detect src/app App Router (#90) 2026-02-27 07:08:00 +00:00
mohammad 2efc089183 fix: log errors from failed error reporting calls (#133)
* fix: log errors from failed error reporting calls

Previously, error reporting calls (.catch(() => {})) silently swallowed
errors, making debugging impossible when error reporting itself failed.

This fix adds proper error logging:
- Server action error reporting failures are now logged
- Route handler error reporting failures are now logged
- Async component errors in loading boundaries are logged in dev mode

The third case is intentional (loading boundaries handle errors), but
now logs in development for visibility.

* revert: keep silent .catch for loading boundary pre-render test

The testResult.catch() suppresses expected rejections from async
components with loading boundaries — redirect/notFound errors are
handled by rscOnError during streaming. Logging here would be noisy
since this is a normal code path, not an error condition. This matches
Next.js behavior where prospective render rejections are silent by
default.

---------

Co-authored-by: Fred K. Schott <622227+FredKSchott@users.noreply.github.com>
2026-02-27 06:42:27 +00:00
milkboy2564 1b5ecf7625 fix(rsc): include cookies in RSC navigation and prefetch requests (#123)
RSC navigation and prefetch fetches were missing ,
causing browsers to omit cookies from these requests. This silently broke
cookie-based authentication (Better Auth, NextAuth, etc.) during client-side
navigation: a full-page load would succeed (cookies sent normally) but any
subsequent <Link> navigation to a protected route would fail authentication
because the RSC fetch arrived without the session cookie.

Three fetch call sites are fixed:
- server/app-dev-server.ts — __VINEXT_RSC_NAVIGATE__ navigation fetch
- shims/link.tsx            — <Link> prefetch on viewport intersection
- shims/navigation.ts      — router.prefetch() call
2026-02-27 06:40:03 +00:00
Gentrit Biba 4a81f9ff6b fix: add missing react-server-dom-webpack to App Router examples (#132)
App Router examples were missing react-server-dom-webpack as an explicit
dependency. With pnpm's strict module resolution, this caused the Vite
dev server to fail resolving react-server-dom-webpack/client.browser,
breaking client-side hydration — "use client" components rendered as
static HTML with no interactivity.

The @vitejs/plugin-rsc correctly adds react-server-dom-webpack to
optimizeDeps.include, but the package must be resolvable from the
project root. Without it in package.json, pnpm cannot link it.
2026-02-27 06:39:23 +00:00
gembleman 083d765cec fix(navigation): cache getServerSnapshot fallback in useSearchParams (#79)
* fix(navigation): cache getServerSnapshot fallback in useSearchParams

useSyncExternalStore compares snapshots with Object.is. The previous
getServerSnapshot returned `new URLSearchParams()` on every call when no
server context was available, producing a new object reference each time
and triggering an infinite re-render loop in React.

Fix: introduce a module-level `_cachedServerSearchParams` that is
allocated once and reused, matching the same referential-stability
pattern already used by `getSearchParamsSnapshot` for the client
snapshot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Refactor cached search params and pathname logic

Refactor cached variables for search params and pathname for better referential stability. Consolidate logic to avoid infinite re-renders.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Fred K. Schott <622227+FredKSchott@users.noreply.github.com>
2026-02-27 06:37:46 +00:00
ask-bonk[bot] aff5d24449 fix(routing): allow hyphens in dynamic segment param names (#78)
* fix(routing): allow hyphens in dynamic segment param names

Catch-all and dynamic route params with hyphens (e.g. [[...sign-in]],
[auth-method]) caused 404 because the regex used \w+ which doesn't
match hyphens. Next.js allows hyphens in param directory names — this
is commonly used by Clerk ([[...sign-in]], [[...sign-up]]).

Changed all \w+ patterns to [\w-]+ across:
- app-router.ts (fileToAppRoute, discoverSlotSubRoutes, computeInterceptTarget)
- pages-router.ts (fileToRoute, patternToNextFormat)
- app-dev-server.ts (middleware matcher regex, config pattern matching)
- middleware.ts (pattern matching)

Closes #71

* fix(routing): allow hyphens in config matching and middleware-codegen param patterns

Addresses review feedback on PR #78: the same \w+ bug that was fixed in
routing/middleware also existed in the config pattern matching functions
(redirects, rewrites, headers) and the middleware-codegen tokenizer.

Updated all remaining param-related regex patterns to [\w-]+ across:
- index.ts: matchConfigPattern guard, tokenizer, catchAllMatch, applyHeaders
- config-matchers.ts: matchConfigPattern guard, tokenizer, catchAllMatch,
  escapeHeaderSource tokenizer
- app-dev-server.ts: __matchConfigPattern template (4 .replace() chains,
  catchAllMatch, __applyConfigHeaders)
- middleware-codegen.ts: generated matchMiddlewarePattern tokenizer

Subsumes PR #127 which fixed middleware-codegen.ts independently.

Co-authored-by: SeolJaeHyeok <milkboy2564@naver.com>

---------

Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: Fred K. Schott <622227+FredKSchott@users.noreply.github.com>
Co-authored-by: SeolJaeHyeok <milkboy2564@naver.com>
2026-02-26 22:15:45 -08:00
Stephen Zhou 2061ff61c1 fix(image-imports): get cache (#59) 2026-02-27 05:54:37 +00:00
Gentrit Biba 7f33c2432b fix: use fileURLToPath for metadata-routes import in RSC entry (#130)
URL.pathname returns percent-encoded strings (e.g. %20 for spaces),
which Vite cannot resolve as filesystem paths. This causes all App
Router tests to fail when the project is in a directory with spaces
(common on macOS with iCloud, Google Drive, OneDrive).

Replace .pathname with fileURLToPath() from node:url, which properly
decodes the URL to a filesystem path. This pattern is already used
elsewhere in the codebase (cloudflare/tpr.ts).

Fixes #129
2026-02-27 05:42:27 +00:00
luo jiyin dff6da26af fix: correct various typos (#114)
* fix: typo filesytem -> filesystem

* fix: typo filesytem -> filesystem

* fix: typo filesytem -> filesystem

* fix: typo Overwite -> Overwrite

* fix: typo hypen -> hyphen
2026-02-26 21:31:20 -08:00
Steve Faulkner 0c66d98fc8 fix: use decoded pathname for config matcher evaluation (#150)
Config matchers (redirects, rewrites, headers) now receive the decoded,
normalized pathname so that percent-encoded request paths like /%61bout
correctly match config rules defined for /about.

Both dev and prod servers rebuild the working URL from the decoded
pathname + original query string, ensuring all downstream consumers
operate on canonical paths.

Also adds unit and integration tests for percent-encoded path handling
in config matchers across App Router and Pages Router (dev + prod).
v0.0.13
2026-02-27 02:15:50 +00:00
Steve Faulkner 65f78a4db6 fix: strip internal routing headers from dev server responses (#149)
Strip all x-middleware-* prefixed headers from responses in both the
App Router and Pages Router dev servers before sending to clients.
These headers are internal routing signals (x-middleware-next,
x-middleware-rewrite, x-middleware-override-headers, etc.) and should
not be visible to end users.

The prod server already stripped these correctly. This brings the dev
servers into parity.
2026-02-26 20:05:30 -06:00
Steve Faulkner 6fb62b6017 fix: decode request pathname once at entry point for consistent routing (#148)
Ensures the pathname is decoded exactly once (via decodeURIComponent +
normalizePath) at the request entry point, and all downstream consumers
(middleware, config matchers, route matching) receive the same canonical
path. Previously, some code paths decoded the pathname a second time,
which could cause inconsistent matching between middleware and routing.

Also removes redundant decodeURIComponent calls from matchRoute and
matchConfigPattern catch-all branches that are no longer needed since
the caller now guarantees a pre-decoded pathname.
2026-02-26 20:04:40 -06:00
Sunil Pai c4f50b616f fix: fetch cache key generation — handle all body types, include all headers minus blocklist (#111)
* fix: fetch cache key generation — handle all body types, include all headers minus blocklist

- Make buildFetchCacheKey async to support stream/blob body serialization
- Handle all BodyInit types: string, Uint8Array, ReadableStream, FormData, Blob, URLSearchParams
- Switch header strategy from allowlist (3 auth headers) to blocklist (traceparent/tracestate), matching Next.js
- Include RequestInit fields (mode, redirect, credentials, etc.) in cache key
- SHA-256 hash the cache key for compact, deterministic storage
- Fix spent stream bug: restore _ogBody in stripNextFromInit so originalFetch gets usable body
- Add 19 new tests covering body types, header inclusion, body restoration, and URLSearchParams

* Improve fetch cache key generation

Replace simple auth-header extraction with a unified header collector, add a header blocklist and cache version prefix, and introduce async cache key building. serializeBody now handles various body types (Uint8Array, streams, URLSearchParams, FormData, Blob, string), preserves the original body on init._ogBody, and body content is included in the cache key. The cache key is generated by normalizing URL, method, headers and init options and hashing them with SHA-256. buildFetchCacheKey is now async and awaited where used, and stripNextFromInit restores the preserved original body. Also add hasAuthHeaders and move auth header list into a constant.

* PR #111 approved. 52 tests pass, 3 fixes correct.

Co-authored-by: threepointone <threepointone@users.noreply.github.com>

---------

Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: threepointone <threepointone@users.noreply.github.com>
v0.0.12
2026-02-26 12:33:37 +00:00
Sunil Pai de9b679f24 harden CI workflows: frozen-lockfile, checksum verification (#113)
- Add --frozen-lockfile to pnpm install in ci.yml, deploy-examples.yml, benchmarks.yml, preview-release.yml
- Add SHA256 checksum verification for hyperfine .deb download in benchmarks.yml
2026-02-26 12:24:27 +00:00
Sunil Pai 12b364705a chore: rebuild pages-basic fixture dist (#110)
Syncs the checked-in build artifact with current source. Notable
changes: middleware runner now wraps decodeURIComponent in try/catch,
jsx-dev-runtime switched to jsx-runtime for production build.
2026-02-26 11:24:05 +00:00
Sunil Pai 940af6895e fix: dev sanitizeDestination now normalizes leading backslashes (#108)
The dev server's __sanitizeDestination only collapsed leading '//' but
ignored leading backslashes (e.g. '\evil.com'). The prod version in
config-matchers.ts already used /^[\/]+/ to handle both. Align the
dev codegen to match.
2026-02-26 11:10:53 +00:00
Sunil Pai 8a618af9f6 fix: handle malformed percent-encoded URLs gracefully (#107)
Wrap all decodeURIComponent calls on user-controlled URL paths in
try/catch to return 400 Bad Request instead of throwing an uncaught
URIError that crashes the Node process.

A single request with a malformed percent-encoded path (e.g. /%E0%A4%A)
could terminate the entire server process. This affected all server
entry points: prod server (App + Pages Router), dev server middleware,
Cloudflare Worker entry, and generated RSC/middleware handlers.

Fixes:
- prod-server.ts: App Router and Pages Router request handlers
- app-router-entry.ts: Cloudflare Worker entry
- app-dev-server.ts: Generated RSC entry handler
- index.ts: Dev server connect middleware + generated middleware runner
  + generated NEXT_LOCALE cookie parser
- middleware.ts: Pages Router dev middleware runner

Includes 11 regression tests across app-router, pages-router, and
features test suites.
2026-02-26 10:52:57 +00:00
Sunil Pai fd01d7d8a6 fix: close security gaps in init.ts shell exec and app-dev-server external proxy (#106)
* fix: close security gaps in init.ts shell exec and app-dev-server external proxy

Gap 1 (GHSA-w7vc-6jjg-498h): migrate init.ts from execSync to execFileSync
with argument array, matching the pattern already applied in deploy.ts and
cli.ts. Inputs are hardcoded package names so practical risk is near zero,
but this eliminates the last instance of the flagged pattern.

Gap 2 (GHSA-pf96-3m7r-pv3j): harden the inline __proxyExternalRequest in
the generated RSC entry (app-dev-server.ts) to strip Cookie, Authorization,
x-api-key, proxy-authorization, and all x-middleware-* headers before
forwarding to external rewrite targets. Also adds a 30-second
AbortSignal.timeout. This brings the dev-server code path into parity with
the already-fixed proxyExternalRequest in config-matchers.ts.

Also fixes a missed GSP redirect path in dev-server.ts where backslash
normalization was not applied (GHSA-79rw-r8hc-qg8v — the GSSP path was
already committed).

Includes an integration test that verifies credential stripping end-to-end
via a mock HTTP server and a conditional external rewrite in next.config.ts.

* fix: unify isExternalUrl to detect all URL schemes and protocol-relative URLs

All four copies of isExternalUrl (config-matchers.ts, router.ts,
navigation.ts, app-dev-server.ts inline) now use the same RFC 3986
scheme regex: /^[a-z][a-z0-9+.-]*:/i.test(url) || url.startsWith('//')

Previously:
- config-matchers.ts and app-dev-server.ts only checked http:// and
  https:// (missing // protocol-relative)
- router.ts and navigation.ts checked http://, https://, and // but
  missed exotic schemes (data:, javascript:, blob:, ftp:, etc.)

Now all copies are consistent and detect any URL scheme per RFC 3986
plus protocol-relative URLs.

Adds test cases for exotic schemes, protocol-relative, hash-only, and
bare string inputs.

* fix: add shell: true to execFileSync for Windows .cmd file compat

On Windows, package managers (pnpm, npm, yarn) are .cmd batch files.
execFileSync without shell: true cannot execute them. Adding shell: true
lets the OS shell resolve .cmd files while still using the argument array
form for safer argument passing.
2026-02-26 10:33:08 +00:00
Sunil Pai 0e750f7934 Security hardening: redirect sanitization, header stripping, ALS isolation tests, and safer command execution (#105)
* Sanitize redirects/headers and use execFileSync

Replace execSync calls with execFileSync (pass argv arrays) to avoid shell interpolation and adjust package-install logic to split package manager and args. Sanitize redirect destinations in SSR paths to prevent protocol-relative open-redirects and use sanitizeDestinationLocal for Next.js redirects. Ensure middleware receives a cleaned pathname by stripping internal .rsc suffix before creating NextRequest and add a test for this behavior. Strip sensitive headers (cookie, authorization and x-middleware-*) from proxied external requests and add a test. Document cache key hazards for auth headers in fetch-cache, add a security note for dangerouslySetInnerHTML in head SSR, and set the Draft Mode cookie to include Secure in production (with tests for production/dev behavior).

* Rename middleware header to x-custom-middleware

Change middleware header name from x-middleware-test to x-custom-middleware across fixtures and tests, and clarify server comment about stripping x-middleware-* headers from responses (reserved for internal routing signals). Files updated: packages/vinext/src/server/prod-server.ts (comment tweak), tests/fixtures/pages-basic/middleware.ts (header set), and tests/pages-router.test.ts (expectations and test titles/comments). This ensures tests reflect the new public header name while preserving internal x-middleware-* semantics.

* Normalize leading slashes and strip headers

Normalize redirect/rewrite destinations by collapsing any leading slashes or backslashes to a single "/" to avoid protocol-relative redirects and handle browser-backslash behavior. Strip additional sensitive headers (x-api-key, proxy-authorization) from proxied requests and ensure all x-middleware-* internal headers are removed from responses (broadened from x-middleware-request-*). Update dev/server sanitization logic accordingly. Update tests and fixture middleware to use shortened x-mw-* header names and add tests covering backslash normalization.
v0.0.11
2026-02-26 08:50:12 +00:00
Dane 98b243493f fix: resolve CodeQL security alerts (ReDoS, incomplete sanitization, bad code gen) (#87)
Refactor chained .replace() to single-pass tokenizers in pattern matching:
- matchConfigPattern in config-matchers.ts and index.ts
- escapeHeaderSource (new) replaces inline chained escaping in matchHeaders/applyHeaders
- matchMiddlewarePattern in prod server entry template
- matchPattern in middleware.ts

Also:
- escapeHeaderSource correctly handles :param(constraint) patterns
- Fix decodeURIComponent parity gap in index.ts matchConfigPattern
- Fix redundant dot in middleware.ts tokenizer char class
- Add lgtm suppression comments for false positives in test files
- Add unit tests for escapeHeaderSource
2026-02-26 00:18:46 -06:00
Steve Faulkner 83495447ae fix: normalize request pathname before middleware and route matching (#102)
- Add normalizePath utility that collapses consecutive slashes,
  resolves . and .. segments, and ensures a leading slash
- Apply decodeURIComponent + normalizePath before middleware matching
  and route matching in all entry points (dev server, prod server,
  Cloudflare Worker entry, codegen entries)
- Extract shared middleware codegen module (middleware-codegen.ts) as
  single source of truth for pattern matching logic, replacing
  hand-copied inline implementations in index.ts and app-dev-server.ts
- Fix default middleware matcher to return true when no matcher is
  configured, matching Next.js behavior
- Fix regex pattern corruption in middleware matcher: patterns containing
  parentheses or backslashes are now passed to RegExp directly without
  dot-escaping
v0.0.10
2026-02-26 05:39:36 +00:00
Steve Faulkner 6986e1017f fix: validate image optimization content types and width bounds (#101)
- Add Content-Security-Policy and X-Content-Type-Options headers to image responses
- Validate Content-Type allowlist (reject SVG, HTML, non-image types)
- Bound width parameter to configured deviceSizes/imageSizes with 3840px max
- Add deviceSizes and imageSizes to NextConfig type
- Apply to all image paths: Workers, Node.js prod server (App + Pages Router)
- Fix benchmarks limit param NaN handling
2026-02-26 05:08:44 +00:00
Steve Faulkner 16988a5403 fix: add request validation to dev server (#98) 2026-02-25 22:51:16 -06:00
Steve Faulkner abad2e4431 fix: use AsyncLocalStorage.run() for request context isolation (#99) 2026-02-25 22:51:05 -06:00
Steve Faulkner 75742312bb fix: sanitize error messages in production mode (#97) 2026-02-26 04:24:54 +00:00
Steve Faulkner 708d85e36d fix: enforce body size limit on App Router server actions (#96) 2026-02-26 04:23:40 +00:00
Steve Faulkner aca46417d9 fix: use Host header for server action origin check (#95) 2026-02-26 04:22:31 +00:00
Steve Faulkner af485aec24 fix: validate module paths during client-side navigation (#94) 2026-02-26 04:19:43 +00:00
Steve Faulkner dda10590d7 fix: include relevant headers in fetch cache key (#93) 2026-02-26 04:17:18 +00:00
Steve Faulkner 3ff59fa6d4 fix: sanitize redirect destinations and digest parsing (#92) 2026-02-26 04:14:56 +00:00
Steve Faulkner 3f406045aa fix: add Vary header to SSR and RSC responses (#91)
* fix: add Vary: RSC, Accept header to prevent CDN cache poisoning

Add Vary: RSC, Accept to all App Router RSC stream and HTML SSR
responses to prevent CDN cache poisoning. Without this header, a CDN
or reverse proxy may cache an RSC stream response and serve it to a
browser expecting HTML (or vice versa), breaking the page.

Affected response types in app-dev-server.ts:
- Main RSC stream responses (client-side navigation)
- HTML SSR responses (all cache control variants)
- Not-found/forbidden/unauthorized fallback pages (RSC and HTML)
- Error boundary pages (RSC and HTML)
- Server action redirect and re-render responses
- Intercepting route RSC stream responses

Fix Vary header merging in prod-server.ts:
- sendWebResponse: merge Accept-Encoding with existing Vary values
  instead of overwriting (preserves RSC, Accept from upstream)
- sendCompressed: same merge behavior for buffered responses

Scope analysis (intentionally NOT changed):
- Pages Router: no RSC/HTML content negotiation on same URL
- Route handler responses: content type is handler-controlled
- Metadata routes: serve single content type per URL
- Static assets: no content negotiation
- Error/redirect responses: not cached or content-negotiated
- Worker entry (app-router-entry.ts): passes through RSC handler
  responses which already include the Vary header

Closes GHSA-jgqv-mvrh-hv36
Related: GHSA-r2fc-ccr8-96c4 (Next.js equivalent)

* remove advisory reference from code comment

---------

Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com>
2026-02-25 22:12:55 -06:00
Steve Faulkner a151f3da6b chore: upgrade vitest from v3 to v4 (#65)
No breaking changes affect this project — config and test code
required no modifications.
2026-02-25 22:17:48 +00:00
Steve Faulkner 8dac26c0e5 fix(dotenv): load .env files with Next.js precedence (#70)
* feat(cli): load .env files with Next.js precedence

* fix(dotenv): address review feedback on .env loading

- Document Vite double-loading interaction in loadDotenv JSDoc
- Fix escaped dollar sign bug ($100 was not unescaped when $ wasn't
  followed by a valid variable name)
- Add type cast for parseEnv return value
- Expand test coverage: loadedEnv assertions, production mode
  precedence, ${VAR} expansion, escaped dollars, circular refs,
  missing files, empty result
- Add getDotenvFiles unit tests for all three modes
- Add 'Prefer Node.js Built-in APIs' guideline to AGENTS.md

Co-authored-by: liuxiaopai-ai <liuxiaopai-ai@users.noreply.github.com>

* test(dotenv): add cross-file expansion and multi-line value tests

Address review suggestions: test that .env can reference vars from
higher-priority .env.development.local, and that parseEnv handles
quoted multi-line values correctly.

---------

Co-authored-by: root <root@localhost.localdomain>
Co-authored-by: liuxiaopai-ai <liuxiaopai-ai@users.noreply.github.com>
v0.0.9
2026-02-25 14:21:48 -06:00
Steve Faulkner f1e5c31c2e Fix AI Gateway auth (use cf-aig-authorization) and show Google Chat error body (#69) 2026-02-25 13:47:39 -06:00
Steve Faulkner bc75de3548 Skip deploy previews for fork PRs that lack Cloudflare secrets (#67)
Fork PRs don't have access to repository secrets (CLOUDFLARE_API_TOKEN,
CLOUDFLARE_ACCOUNT_ID), so deploy/smoke-test/comment steps always fail.
Add a fork detection condition to skip these steps gracefully. The build
steps still run, so example builds are still validated for fork PRs.
2026-02-25 13:47:24 -06:00
Steve Faulkner 4d0a008644 Add AI-generated release summary + Google Chat notification to publish workflow (#68)
* Skip deploy previews for fork PRs that lack Cloudflare secrets

Fork PRs don't have access to repository secrets (CLOUDFLARE_API_TOKEN,
CLOUDFLARE_ACCOUNT_ID), so deploy/smoke-test/comment steps always fail.
Add a fork detection condition to skip these steps gracefully. The build
steps still run, so example builds are still validated for fork PRs.

* Add AI-generated release summary + Google Chat notification to publish workflow
v0.0.8
2026-02-25 13:09:16 -06:00
Ivan Torres 36ab8b0f18 fix: replace glob npm package with native node:fs/promises glob (#52)
* fix: replace glob npm package with native node:fs/promises glob

Migrate pagesRouter, apiRouter, and appRouter from the third-party 'glob'
package to Node.js built-in glob (node:fs/promises), available since
Node 22. This removes a dependency and fixes path handling issues on
Windows where dynamic route segments (e.g. [slug]) were incorrectly
parsed due to premature path separator normalization.

Changes:
- Use for-await with glob() from node:fs/promises
- Use exclude callbacks instead of post-filtering
- Normalize pagePath/routePath with replaceAll('\\', '/') in output
- Remove glob dependency from package.json

* fix: address review feedback on native glob migration

- Fix excludePrivate over-exclusion: the native glob exclude callback
  fires at every directory depth, not just the root. Replace with
  post-filtering on the first path segment to match the old glob
  package's root-relative ignore behavior.
- Remove redundant .replaceAll('\\', '/') normalization from
  pagePath/routePath in app-router.ts — consumers already normalize
  backslashes, and this was inconsistent with pages-router.ts.
- Add engines field (node >= 22) since fs.glob requires Node 22+.

* refactor: use glob pattern arrays instead of callbacks for exclude

- app-router: replace hasSlotSegment callback with ['**/@*'] pattern
- pages-router: replace excludePrivate callback with ['api', '**/_*'] patterns
- Simplify iteration: process glob results directly instead of collecting into intermediate arrays

---------

Co-authored-by: Steve Faulkner <sfaulkner@cloudflare.com>
2026-02-25 12:31:41 -06:00
Skywalker512 cb15a16aaa fix: link to Vite RSC plugin in README (#39)
Updated the link for the Vite RSC plugin to point to the correct repository.
2026-02-25 10:55:21 -06:00
Steve Faulkner f6ba607258 fix: make chat notification non-fatal and add charset to content-type (#62) 2026-02-25 16:21:08 +00:00
Steve Faulkner c0acaa6e57 fix: read CLI version from package.json instead of hardcoded value (#61) 2026-02-25 16:14:19 +00:00
Steve Faulkner 8558c2d68e ci: notify Google Chat on npm publish (#55) v0.0.7 2026-02-25 15:41:11 +00:00
Steve Faulkner 0866ddaa2f ci: wire up npm publishing with OIDC trusted publishing (#54)
- Add version bump input (patch/minor/major) to publish workflow
- Gate publish on full CI suite (lint, typecheck, vitest, e2e)
- Use npm OIDC trusted publishing instead of long-lived NPM_TOKEN
- Tag releases in git after publish
- Make ci.yml callable via workflow_call
- Fix repository URL format in package.json for OIDC validation
v0.0.6
2026-02-25 09:03:57 -06:00