Thanks to visit codestin.com
Credit goes to github.com

Skip to content

+ sveltekit, cloudflare runtime, --quiet flag#5

Merged
skibidiskib merged 15 commits into
skibidiskib:masterfrom
raiden076:master
May 12, 2026
Merged

+ sveltekit, cloudflare runtime, --quiet flag#5
skibidiskib merged 15 commits into
skibidiskib:masterfrom
raiden076:master

Conversation

@raiden076

Copy link
Copy Markdown
Contributor
  1. Add support for sveltekit
  2. Add support for cloudflare runtime
  3. Minor restructure

…kInfo, SchemaSource, Config §V1,V2,V5,V14,V15,V16 §I.adapter,I.info
…dDirsNamed, DEFAULT_SKIP_DIRS, ROOT, TODAY (C7)
- Create src/generators/schema.ts: parsePrismaSchema, parseDrizzleSchema,
  generateSchema (framework-agnostic per V4)
- Add parseWranglerBindings: JSONC/TOML → binding metadata (V11)
- generateSchema emits bindings comment in schema.md header when present
- Add src/lib/server/db to drizzle detection paths (V10)
- Update monolith to import generateSchema from generators
- Add 12 unit tests covering Prisma parse, Drizzle parse, wrangler parse,
  and generateSchema output with/without bindings
- Install vitest for test runner
- Created src/adapters/nextjs.ts implementing FrameworkAdapter
- detect(): next.config.* → app/pages router detection, component dirs
- generateRoutes(): API routes for both app & pages router
- generatePages(): page tree with [client]/[server] tags
- generateComponents(): component index with UI primitive filtering
- pathToRoute() adapter-owned per V3
- Schema/lib detection left for core (T6) per V4/C18
- Adapter registry: loops adapters, first non-null detect wins (V1)
- Core imports adapters by name — new framework = new file + one import (V2)
- Schema source detection (prisma/drizzle) in core, framework-agnostic (V4,V18)
- Lib dir detection in core, framework-agnostic (V18)
- Main generation loop: adapter generators + framework-agnostic generators
- CLI output formatting
- Added @types/node for clean type-check
METHOD_REGEX only matched `export function GET` style.
Added match for `export const GET: RequestHandler = async` (const-arrow form).

- Fix regex in sveltekit adapter generateRoutes
- Add const-export fixture (+server.ts in api/items)
- Add test for const-export detection
- Backprop: V18 invariant, B1 bug entry in SPEC.md
Suppresses all console.log output. Errors and warnings still visible.
Non-zero exit on failure preserved.
skibidiskib pushed a commit that referenced this pull request May 12, 2026
Original PR by @raiden076 with three maintainer patches applied on top:

- exclude test files from npm tarball
- fix [[optional]] SvelteKit route params
- add Next.js pipeline integration snapshot test

19 commits total. 53/53 tests passing. Zero Next.js regressions.
@skibidiskib skibidiskib merged commit 8a3bb4c into skibidiskib:master May 12, 2026
@skibidiskib

Copy link
Copy Markdown
Owner

Merged as part of master, lands as v1.3.0. Thank you for the careful work, @raiden076. The per-task commit discipline (T1 through T12 with SPEC invariant references, plus the B1 fix loop) made this very easy to review.

I applied three small patches on top before the final merge commit:

  1. fix(npm): exclude test files from published tarball. src/generators/schema.test.ts was being shipped via files: ["src/", ...]. Added !src/**/*.test.ts negation patterns inside files, plus a .npmignore defense-in-depth layer. Tarball is now 12 files, 18.9 kB, no test code.

  2. fix(sveltekit): handle [[optional]] route params. The existing \[([^\]]+)\] regex in src/adapters/sveltekit.ts was matching [[opt]] and emitting :opt] with a trailing bracket. Added a [[...]] pre-pass that mirrors what nextjs.ts:28 already does for Next.js.

  3. test(nextjs): pipeline integration snapshot test. To make SPEC V5 ("byte-identical Next.js output after refactor") actually enforceable in CI. Runs the full CLI against tests/fixtures/nextjs-app/ and byte-compares the four generated .md files to checked-in expected snapshots, with date-stamp normalization.

All 53 tests pass.

Two SvelteKit limitations I noticed but haven't fixed (good follow-up issues if you want them): matcher syntax [slug=type] is currently passed through verbatim, and +error.svelte isn't surfaced anywhere in the index. Also worth deciding: the runtime: 'cloudflare-workers' tag is set during detection but doesn't change any output downstream. Either wire it per-route or stop printing it.

Tag v1.3.0 and npm publish landing shortly. Thanks again. This set up the adapter architecture cleanly and made adding the next framework (Remix? Astro?) a single-file affair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants