diff --git a/CHANGES.md b/CHANGES.md index e31c26545..db42f5448 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/deno.json b/deno.json index c7412369b..03f1f929b 100644 --- a/deno.json +++ b/deno.json @@ -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", diff --git a/deno.lock b/deno.lock index 601e31b62..8d3d97c57 100644 --- a/deno.lock +++ b/deno.lock @@ -145,6 +145,7 @@ "npm:jimp@^1.6.1": "1.6.1", "npm:json-canon@^1.0.1": "1.0.1", "npm:json-preserve-indent@^1.1.3": "1.1.3", + "npm:jsonc-parser@^3.3.1": "3.3.1", "npm:jsonld@9": "9.0.0", "npm:koa@2": "2.16.4", "npm:miniflare@^4.20250523.0": "4.20250906.0", @@ -6160,6 +6161,9 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": true }, + "jsonc-parser@3.3.1": { + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==" + }, "jsonld@9.0.0": { "integrity": "sha512-pjMIdkXfC1T2wrX9B9i2uXhGdyCmgec3qgMht+TDj+S0qX3bjWMQUfL7NeqEhuRTi8G5ESzmL9uGlST7nzSEWg==", "dependencies": [ @@ -8611,6 +8615,7 @@ "optionalPeers": [ "typescript" ], + "deprecated": true, "bin": true }, "tsdown@0.22.0_tsx@4.21.0": { @@ -9488,6 +9493,7 @@ "npm:h3@^1.15.0", "npm:ioredis@^5.8.2", "npm:json-preserve-indent@^1.1.3", + "npm:jsonc-parser@^3.3.1", "npm:mysql2@^3.22.3", "npm:postgres@^3.4.7", "npm:preact@10.19.6", @@ -9664,7 +9670,8 @@ "dependencies": [ "npm:@inquirer/prompts@^7.8.4", "npm:dax@~0.46.1", - "npm:inquirer-toggle@^1.0.1" + "npm:inquirer-toggle@^1.0.1", + "npm:jsonc-parser@^3.3.1" ] } }, diff --git a/docs/cli.md b/docs/cli.md index 394ebf845..588803b74 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -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 diff --git a/docs/install.md b/docs/install.md index e41382153..ab767d3e9 100644 --- a/docs/install.md +++ b/docs/install.md @@ -230,37 +230,21 @@ 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, @@ -268,15 +252,14 @@ extension and swap the formatter: "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 @@ -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] { @@ -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 diff --git a/docs/tutorial/astro-blog.md b/docs/tutorial/astro-blog.md index c83e3515e..e99a1e88f 100644 --- a/docs/tutorial/astro-blog.md +++ b/docs/tutorial/astro-blog.md @@ -198,8 +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 - - *package.json* — Package metadata and scripts + - *.oxlintrc.json* — Code linter settings + - *package.json* — Package metadata, scripts, and Prettier formatter setup - *tsconfig.json* — TypeScript settings Because we're using TypeScript instead of plain JavaScript, source files have @@ -215,9 +215,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: @@ -284,7 +284,7 @@ Stop the dev server with Ctrl+C 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 diff --git a/docs/tutorial/content-sharing.md b/docs/tutorial/content-sharing.md index 9967007a2..eef00b083 100644 --- a/docs/tutorial/content-sharing.md +++ b/docs/tutorial/content-sharing.md @@ -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. @@ -233,7 +234,8 @@ TypeScript in their `