Contributing
Contributing
Fresh is organized as a monorepo with multiple packages:
packages/fresh/- Core Fresh framework (@fresh/core)packages/plugin-vite/- Vite integration plugin (@fresh/plugin-vite)packages/plugin-tailwindcss/- Tailwind CSS v4 pluginpackages/plugin-tailwindcss-v3/- Tailwind CSS v3 pluginpackages/init/- Project scaffolding toolpackages/update/- Fresh update utilitieswww/- Documentation website (fresh.deno.dev)
Getting Started
Prerequisites: Deno (latest version) and Git.
git clone https://github.com/denoland/fresh.git
cd fresh
deno task okdeno task ok runs formatting, linting, type checking, and the full test suite.
Run it before submitting any pull request.
The repository uses Deno
workspaces so all
packages in packages/ are automatically available to each other using their
published names (@fresh/core, @fresh/plugin-vite, etc.).
Development
The www/ directory and the Vite plugin demo both use local Fresh packages,
making them good integration tests:
deno task www # docs site dev server
deno task build-www # docs site production build
deno task demo # vite demo dev server
deno task demo:build # vite demo production build
deno task demo:start # serve vite demo production buildTesting in External Projects
To use your local Fresh checkout in a separate project, add
links to
the project’s deno.json:
{
"imports": {
"@fresh/core": "jsr:@fresh/core@^2.0.0",
"@fresh/plugin-vite": "jsr:@fresh/plugin-vite@^1.0.0"
},
"links": [
"../path/to/fresh/packages/fresh",
"../path/to/fresh/packages/plugin-vite"
]
}This overrides the JSR packages with your local versions. Changes are reflected immediately without rebuilding.
Testing
# All tests (parallel)
deno task test
# A specific test file
deno test -A packages/fresh/src/app_test.ts
# Filter by test name
deno test -A --filter "test name pattern"
# Update snapshots after intentional output changes
deno test -A --update-snapshots path/to/test.tsTests use @std/expect for assertions, follow the *_test.ts naming
convention, and require the -A flag. Snapshot tests are stored in
__snapshots__/ directories.
Some tests may fail locally but pass in CI (Could not find server address,
Text file busy (os error 26)) — these can be safely ignored.