Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ To be released.
corresponding `@fedify/init` update, which skips automatic dependency
installation after scaffolding. [[#720], [#776] by fru1tworld]

- Switched Node.js and Bun projects generated by `fedify init` from Biome
plus ESLint to Oxfmt plus Oxlint. New projects now get *.oxfmtrc.json*,
*.oxlintrc.json*, Oxc editor recommendations, and package scripts for
`format`, `format:check`, and `lint`; the Oxlint config loads Fedify's
rules through `@fedify/lint/oxlint`. [[#703], [#818]]

- Added the `fedify bench` command for benchmarking Fedify federation
workloads. It acts as a synthetic remote actor that drives
ActivityPub-specific load (signed inbox deliveries and WebFinger lookups)
Expand Down Expand Up @@ -328,6 +334,7 @@ To be released.
results. This change is published as benchmark report schema version 3
and comparison report schema version 1. [[#744], [#786], [#804]]

[#703]: https://github.com/fedify-dev/fedify/issues/703
[#720]: https://github.com/fedify-dev/fedify/issues/720
[#776]: https://github.com/fedify-dev/fedify/pull/776
[#783]: https://github.com/fedify-dev/fedify/issues/783
Expand All @@ -337,6 +344,7 @@ To be released.
[#801]: https://github.com/fedify-dev/fedify/pull/801
[#802]: https://github.com/fedify-dev/fedify/pull/802
[#804]: https://github.com/fedify-dev/fedify/pull/804
[#818]: https://github.com/fedify-dev/fedify/pull/818

### @fedify/fixture

Expand Down Expand Up @@ -390,6 +398,12 @@ To be released.
root, or when you want to inspect the generated files before
installing. [[#720], [#776] by fru1tworld]

- Switched generated Node.js and Bun projects from Biome plus ESLint to
Oxfmt plus Oxlint. New projects now get *.oxfmtrc.json*,
*.oxlintrc.json*, Oxc editor recommendations, and package scripts for
`format`, `format:check`, and `lint`; the Oxlint config loads Fedify's
rules through `@fedify/lint/oxlint`. [[#703], [#818]]

### @fedify/lint

- Added official Oxlint support through a new `@fedify/lint/oxlint` subpath
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"hono": "jsr:@hono/hono@^4.8.3",
"ioredis": "npm:ioredis@^5.8.2",
"json-preserve-indent": "npm:json-preserve-indent@^1.1.3",
"jsonc-parser": "npm:jsonc-parser@^3.3.1",
"mysql2": "npm:mysql2@^3.22.3",
"mysql2/promise": "npm:mysql2@^3.22.3/promise",
"postgres": "npm:postgres@^3.4.7",
Expand Down
9 changes: 8 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ project. It will ask you a few questions to set up the project:
> [!TIP]
> Projects created with `fedify init` automatically include [`@fedify/lint`]
> for consistent code linting. Deno projects get a lint plugin configured in
> *deno.json*, while Node.js and Bun projects get an *eslint.config.ts* with
> `@fedify/lint`.
> *deno.json*, while Node.js and Bun projects get an *.oxlintrc.json* with
> `@fedify/lint/oxlint`.

> [!NOTE]
> If you find the full `@fedify/cli` toolchain too heavy for your needs, you
Expand Down
46 changes: 14 additions & 32 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,53 +230,36 @@ it as the default formatter for JavaScript and TypeScript:
Deno's [*Set up your environment*] guide covers other editors and shells.

*For Node.js/Bun projects*, `fedify init` writes a *.vscode/extensions.json*
that recommends the [Biome extension] and the [ESLint extension]:
that recommends the [Oxc extension]:

~~~~ json [.vscode/extensions.json]
{ "recommendations": ["biomejs.biome", "dbaeumer.vscode-eslint"] }
{ "recommendations": ["oxc.oxc-vscode"] }
~~~~

The matching *.vscode/settings.json* sets Biome as the default formatter and
runs Biome's import organiser on save:
The matching *.vscode/settings.json* sets Oxfmt as the default formatter and
enables Oxc's fix-all action on save:

~~~~ jsonc [.vscode/settings.json]
{
"editor.detectIndentation": false,
"editor.indentSize": 2,
"editor.insertSpaces": true,
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "always"
}
}
// The same block applies to [javascript], [javascriptreact],
// [typescriptreact], [json], and [jsonc].
}
~~~~

If you prefer [Oxc] over Biome and ESLint, install the [oxc-vscode]
extension and swap the formatter:

~~~~ jsonc [.vscode/settings.json]
{
"oxc.fmt.configPath": ".oxfmtrc.json",
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "always"
}
}
// The same block applies to [javascript], [javascriptreact],
// [typescriptreact], [json], and [jsonc].
}
~~~~

[Deno extension]: https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
[*Set up your environment*]: https://docs.deno.com/runtime/getting_started/setup_your_environment/
[Biome extension]: https://marketplace.visualstudio.com/items?itemName=biomejs.biome
[ESLint extension]: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
[Oxc]: https://oxc.rs/
[oxc-vscode]: https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
[Oxc extension]: https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode

### Zed

Expand Down Expand Up @@ -319,10 +302,9 @@ Zed's [Deno language docs][zed-deno] cover the available options.
[Hackers' Pub] is a real-world reference.

*For Node.js/Bun projects*, Zed enables its bundled TypeScript language
server out of the box; the typical addition is wiring up Biome (or the
formatter you chose) for `editor.formatOnSave`-style behaviour. See Zed's
[TypeScript language docs][zed-ts] for setup. If you prefer [Oxc] instead,
set Oxc as the language server and turn on its fix-all action on format:
server out of the box; the typical addition is wiring up Oxc for formatting
and lint fixes. See Zed's [TypeScript language docs][zed-ts] for setup.
Set Oxc as the language server and turn on its fix-all action on format:

~~~~ jsonc [.zed/settings.json]
{
Expand All @@ -343,9 +325,9 @@ Linting

`fedify init` configures the [`@fedify/lint`] plugin automatically: Deno
projects pick it up through `lint.plugins` in *deno.json*, and Node.js/Bun
projects through a generated *eslint.config.ts*. For the full rule list,
configuration options, and how to run the linter, see the
[*Linting*](./manual/lint.md) chapter.
projects through a generated *.oxlintrc.json* using `@fedify/lint/oxlint`.
For the full rule list, configuration options, and how to run the linter, see
the [*Linting*](./manual/lint.md) chapter.

[`@fedify/lint`]: https://jsr.io/@fedify/lint

Expand Down
11 changes: 6 additions & 5 deletions docs/tutorial/astro-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ After a moment, you'll have a working project with the following structure:
- *middleware.ts* — Connects Fedify to Astro's request pipeline
- *public/* — Files served as-is (favicon, etc.)
- *astro.config.ts* — Astro configuration
- *biome.json* — Code formatter and linter settings
- *.oxfmtrc.json* — Code formatter settings
- *.oxlintrc.json* — Code linter settings
- *package.json* — Package metadata and scripts
- *tsconfig.json* — TypeScript settings

Expand All @@ -215,9 +216,9 @@ includes settings for it.
After [installing VS Code], open the project folder: *File* → *Open Folder…*.

If a popup asks you to install the recommended extensions, click *Install
All*. This installs the [Biome extension] (formats and lints your code on
save) and the [Astro extension] (syntax highlighting and IntelliSense for
*.astro* files).
All*. This installs the [Oxc extension] (formats and lints JavaScript and
TypeScript on save) and the [Astro extension] (syntax highlighting and
IntelliSense for *.astro* files).

Let's verify the project works. First, install the dependencies:

Expand Down Expand Up @@ -284,7 +285,7 @@ Stop the dev server with <kbd>Ctrl</kbd>+<kbd>C</kbd> for now.

[Visual Studio Code]: https://code.visualstudio.com/
[installing VS Code]: https://code.visualstudio.com/docs/setup/setup-overview
[Biome extension]: https://marketplace.visualstudio.com/items?itemName=biomejs.biome
[Oxc extension]: https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
[Astro extension]: https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode
[actor]: https://www.w3.org/TR/activitypub/#actors

Expand Down
12 changes: 8 additions & 4 deletions docs/tutorial/content-sharing.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ The most interesting files and directories are:
- *nuxt.config.ts*: Nuxt's configuration file; already has `@fedify/nuxt`
wired up as a module.
- *package.json*: npm metadata and dependencies.
- *biome.json*: [Biome] formatter and import-sorting configuration.
- *.oxfmtrc.json*: [Oxfmt] formatter configuration.
- *.oxlintrc.json*: [Oxlint] configuration, including Fedify lint rules.
- *tsconfig.json*: TypeScript compiler references to the generated Nuxt
type files.

Expand All @@ -233,7 +234,8 @@ TypeScript in their `<script>` blocks).

[LogTape]: https://logtape.org/
[Nitro server plugin]: https://nitro.build/guide/plugins
[Biome]: https://biomejs.dev/
[Oxfmt]: https://oxc.rs/docs/guide/usage/formatter/
[Oxlint]: https://oxc.rs/docs/guide/usage/linter/

### Running the dev server for the first time

Expand Down Expand Up @@ -313,7 +315,7 @@ That tells us a few important things at once:
while following this tutorial. We are about to write a lot of TypeScript
and Vue, and VS Code is currently the smoothest editor for both. The
scaffolded project even ships with a *.vscode/* directory that recommends
the right extensions (Biome for formatting, Volar for Vue).
the right extensions (Oxc for formatting and linting, Volar for Vue).

> [!WARNING]
> Don't confuse Visual Studio Code with Visual Studio. The two share a
Expand Down Expand Up @@ -772,7 +774,9 @@ to type the tool's name directly. Edit *package.json*:
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint": "eslint .",
"format": "oxfmt",
"format:check": "oxfmt --check",
"lint": "oxlint .",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio"
}
Expand Down
25 changes: 13 additions & 12 deletions docs/tutorial/microblog.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ the following structure:
- *federation.ts* — ActivityPub server
- *index.ts* — Entry point
- *logging.ts* — Logging configuration
- *biome.json* — Formatter and linter settings
- *.oxfmtrc.json* — Formatter settings
- *.oxlintrc.json* — Linter settings
- *package.json* — Package metadata
- *tsconfig.json* — TypeScript settings

Expand Down Expand Up @@ -297,11 +298,11 @@ linters.
After [installing Visual Studio Code], open the working directory by selecting
*File* → *Open Folder…* from the menu.

If you see a popup in the bottom right asking <q>Do you want to install
the recommended ‘Biome’ extension from biomejs for this repository?</q>,
click the *Install* button to install the extension. Installing this extension
will automatically format your TypeScript code, so you don't have to wrestle
with code styles like indentation or spacing when writing TypeScript code.
If you see a popup in the bottom right asking you to install the recommended
Oxc extension for this repository, click the *Install* button to install the
extension. Installing this extension will automatically format your TypeScript
code, so you don't have to wrestle with code styles like indentation or
spacing when writing TypeScript code.

> [!TIP]
> If you're a loyal Emacs or Vim user, we won't discourage you from using your
Expand Down Expand Up @@ -2417,7 +2418,7 @@ app.get("/users/:username", async (c) => {
// ... omitted ...
if (user == null) return c.notFound();

// biome-ignore lint/style/noNonNullAssertion: Always returns a single record
// oxlint-disable-next-line typescript/no-non-null-assertion -- Always returns a single record
const { followers } = db
.prepare<unknown[], { followers: number }>(
`
Expand Down Expand Up @@ -3025,7 +3026,7 @@ export const PostView: FC<PostViewProps> = ({ post }) => (
<header>
<ActorLink actor={post} />
</header>
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: */}
{/* oxlint-disable-next-line react/no-danger -- The post content is sanitized before storage */}
<div dangerouslySetInnerHTML={{ __html: post.content }} />
<footer>
<a href={post.url ?? post.uri}>
Expand Down Expand Up @@ -3090,7 +3091,7 @@ app.get("/users/:username/posts/:id", (c) => {
.get(c.req.param("username"), c.req.param("id"));
if (post == null) return c.notFound();

// biome-ignore lint/style/noNonNullAssertion: Always returns a single record
// oxlint-disable-next-line typescript/no-non-null-assertion -- Always returns a single record
const { followers } = db
.prepare<unknown[], { followers: number }>(
`
Expand Down Expand Up @@ -3494,7 +3495,7 @@ export const Home: FC<HomeProps> = ({ user }) => (
{/* ... omitted ... */}
</hgroup>
<form method="post" action={`/users/${user.username}/following`}>
{/* biome-ignore lint/a11y/noRedundantRoles: PicoCSS requires role=group */}
{/* oxlint-disable-next-line jsx-a11y/no-redundant-roles -- PicoCSS requires role=group */}
<fieldset role="group">
<input
type="text"
Expand Down Expand Up @@ -4026,7 +4027,7 @@ app.get("/users/:username", async (c) => {
// ... omitted ...
if (user == null) return c.notFound();

// biome-ignore lint/style/noNonNullAssertion: Always returns a single record
// oxlint-disable-next-line typescript/no-non-null-assertion -- Always returns a single record
const { following } = db
.prepare<unknown[], { following: number }>(
`
Expand Down Expand Up @@ -4081,7 +4082,7 @@ app.get("/users/:username/posts/:id", (c) => {
// ... omitted ...
if (post == null) return c.notFound();

// biome-ignore lint/style/noNonNullAssertion: Always returns a single record
// oxlint-disable-next-line typescript/no-non-null-assertion -- Always returns a single record
const { following, followers } = db
.prepare<unknown[], { following: number; followers: number }>(
`
Expand Down
Loading