Skip to content

Add SvelteKit support to fedify init - #971

Open
Palcimer wants to merge 6 commits into
fedify-dev:mainfrom
Palcimer:issue-892-add-sveltekit-fedify-init
Open

Add SvelteKit support to fedify init#971
Palcimer wants to merge 6 commits into
fedify-dev:mainfrom
Palcimer:issue-892-add-sveltekit-fedify-init

Conversation

@Palcimer

Copy link
Copy Markdown
Contributor

Summary

Fedify already has a SvelteKit integration package and an example app, but fedify init command could not scaffold a SvelteKit project. Added a SvelteKit web framework option to @fedify/init.

Assisted-by: Claude Code:claude-sonnet-5

Related issue

Changes

  • Added webframeworks/sveltekit.ts which defines the WebFrameworkDescription and scaffolding command for SvelteKit.
  • Added a template file(hooks.server.ts) that integrates Fedify into a SvelteKit app.
  • Updated @fedify/init README.md and a tutorial document to include SvelteKit support.
  • Skipped the deno lookup test for SvelteKit, matching Astro, Nuxt and SolidStart, since Vite can't resolve @fedify/* packages that are only linked through Deno's local workspace links.

Benefits

  • Users can generate a SvelteKit app using fedify init.

Checklist

  • Did you add a changelog entry to the CHANGES.md?
  • Did you write some relevant docs about this change (if it's a new feature)?
  • [] Did you write a regression test to reproduce the bug (if it's a bug fix)?
  • [] Did you write some tests for this change (if it's a new feature)?
  • Did you run mise test on your machine?

Palcimer added 2 commits July 27, 2026 19:39
Fedify already ships a SvelteKit integration package and example app,
but `fedify init` couldn't scaffold one, so add a `sveltekit` option
via `sv create`.

fedify-dev#892

Assisted-by: Claude Code:claude-sonnet-5
@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

👷 Deploy Preview for fedify-json-schema processing.

Name Link
🔨 Latest commit df7e087
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a67359e19422c0008ff2e1f

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema canceled.

Name Link
🔨 Latest commit 4f016f6
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a6ca1f15126fc0008a6c841

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 46b5f5f4-3f36-4ad4-8761-d01168107ab7

📥 Commits

Reviewing files that changed from the base of the PR and between d7e7c77 and 4f016f6.

📒 Files selected for processing (6)
  • CHANGES.md
  • packages/init/src/json/deps.json
  • packages/init/src/json/kv.json
  • packages/init/src/json/mq.json
  • packages/init/src/types.ts
  • packages/init/src/webframeworks/sveltekit.ts

📝 Walkthrough

Walkthrough

fedify init now supports SvelteKit project scaffolding, including package-manager commands, Fedify hook generation, registry wiring, test handling, dependency updates, and documentation.

Changes

SvelteKit init support

Layer / File(s) Summary
SvelteKit scaffolding and registration
packages/init/src/const.ts, packages/init/src/types.ts, packages/init/src/webframeworks/*, packages/init/src/templates/sveltekit/*, packages/init/src/json/*
Adds SvelteKit to the framework registry. It defines project creation commands, dependencies, tasks, and a Fedify hooks.server.ts integration.
Test and configuration handling
packages/init/src/test/*
Updates SvelteKit port replacement, records the unsupported Deno remote-package case, and adjusts import typing.
Documentation and release notes
packages/init/README.md, docs/tutorial/microblog.md, CHANGES.md
Documents SvelteKit in supported options, the interactive prompt, and the 2.4.0 changelog.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant FedifyInit
  participant SvelteKitCLI
  participant GeneratedApp
  User->>FedifyInit: Select SvelteKit and package manager
  FedifyInit->>SvelteKitCLI: Run the SvelteKit create command
  SvelteKitCLI->>GeneratedApp: Create the project
  FedifyInit->>GeneratedApp: Write the Fedify SvelteKit hook
Loading

Possibly related issues

Possibly related PRs

Suggested labels: component/cli, integration/sveltekit

Suggested reviewers: dahlia, sij411

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: adding SvelteKit support to fedify init.
Description check ✅ Passed The description directly explains the SvelteKit scaffolding changes, documentation updates, testing decision, and user benefit.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch issue-892-add-sveltekit-fedify-init
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.25806% with 11 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/init/src/webframeworks/sveltekit.ts 87.03% 3 Missing and 4 partials ⚠️
packages/init/src/test/port.ts 0.00% 4 Missing ⚠️
Files with missing lines Coverage Δ
packages/init/src/const.ts 100.00% <100.00%> (ø)
packages/init/src/test/lookup.ts 24.06% <100.00%> (+0.57%) ⬆️
packages/init/src/webframeworks/mod.ts 100.00% <100.00%> (ø)
packages/init/src/test/port.ts 14.28% <0.00%> (-0.25%) ⬇️
packages/init/src/webframeworks/sveltekit.ts 87.03% <87.03%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@2chanhaeng 2chanhaeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This PR can merge to main if you fix few points. First, please update the dependencies using mise run update-init-deps.

files: {
"src/hooks.server.ts": await readTemplate("sveltekit/hooks.server.ts"),
},
tasks: getNodeBunDevToolTasks(pm),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vite does not inject environment variables from .env into process.env, which causes errors during testing using mysql. You can test it with mise test:init -w sveltekit -p pnpm -m mysql -k mysql --no-dry-run. Add dotenvx as a dependency and ensure that if the package manager is not Deno, the task is modified to dotenvx run -- <command>. For example, if dev: "vite dev" is automatically generated, it should be changed to dev: "dotenvx run -- vite dev".

@Palcimer
Palcimer force-pushed the issue-892-add-sveltekit-fedify-init branch from df7e087 to 68d5a9a Compare July 31, 2026 13:13
Palcimer added 4 commits July 31, 2026 22:23
Vite does not inject `.env` variables into `process.env`, so
non-Deno SvelteKit projects failed during `mise test:init` runs
that need KV/MQ connection settings (e.g. with `mysql`). Add
`@dotenvx/dotenvx` as a dev dependency and wrap the
`dev`/`build`/`preview` tasks with `dotenvx run --` for every
non-Deno package manager.

fedify-dev#892

Assisted-by: Claude Code:claude-sonnet-5
@Palcimer
Palcimer force-pushed the issue-892-add-sveltekit-fedify-init branch from d7e7c77 to 4f016f6 Compare July 31, 2026 13:24
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.

Add SvelteKit support to fedify init

2 participants