From f6abe06215a6e05758a19ea5f8ae3c28fbf3b035 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 4 Mar 2026 23:07:58 +0900 Subject: [PATCH 1/4] Add @fedify/mysql to the package list in CONTRIBUTING.md The @fedify/mysql package was omitted from the list of packages in the contributing guide, while all other database adapter packages (@fedify/postgres, @fedify/redis, @fedify/sqlite) were already listed. https://github.com/fedify-dev/fedify/issues/587 --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 618409b3..974daafd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -352,6 +352,7 @@ The repository is organized as a monorepo with the following packages: `npm init @fedify`. - *packages/koa/*: Koa integration (@fedify/koa) for Fedify. - *packages/lint/*: Linting utilities (@fedify/lint) for Fedify. + - *packages/mysql/*: MySQL/MariaDB drivers (@fedify/mysql) for Fedify. - *packages/postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify. - *packages/redis/*: Redis drivers (@fedify/redis) for Fedify. - *packages/relay/*: ActivityPub relay support (@fedify/relay) for Fedify. From 9d42e35713539a8df152919291d39094e2aae7cd Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 4 Mar 2026 23:08:23 +0900 Subject: [PATCH 2/4] Add MysqlMessageQueue option to fedify init scaffolder The mq.json configuration for @fedify/init was missing the MySQL/MariaDB entry, even though the KV store side (kv.json) already had it. This meant that `fedify init` / `npm init @fedify` did not offer MySQL as a message queue backend option when scaffolding a new project. https://github.com/fedify-dev/fedify/issues/587 --- packages/init/src/json/mq.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/init/src/json/mq.json b/packages/init/src/json/mq.json index 2dd6143e..627d1832 100644 --- a/packages/init/src/json/mq.json +++ b/packages/init/src/json/mq.json @@ -49,6 +49,31 @@ "POSTGRES_URL": "postgres://postgres@localhost:5432/postgres" } }, + "mysql": { + "label": "MySQL/MariaDB", + "packageManagers": [ + "deno", + "bun", + "npm", + "yarn", + "pnpm" + ], + "dependencies": { + "npm:mysql2": "^3.18.0" + }, + "imports": { + "@fedify/mysql": { + "MysqlMessageQueue": "MysqlMessageQueue" + }, + "mysql2/promise": { + "default": "mysql" + } + }, + "object": "new MysqlMessageQueue(mysql.createPool(process.env.MYSQL_URL))", + "env": { + "MYSQL_URL": "mysql://root@localhost/fedify" + } + }, "amqp": { "label": "AMQP (e.g., RabbitMQ)", "packageManagers": [ From 6b8da9c5f8fb55838e40bbf4e481066cd9495c93 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 4 Mar 2026 23:23:59 +0900 Subject: [PATCH 3/4] Sort package list in CONTRIBUTING.md alphabetically Two packages were out of alphabetical order: *packages/nestjs/* and *packages/next/* were listed after *packages/relay/* instead of before *packages/postgres/*, and *packages/fixture/* was at the very end instead of between *packages/fastify/* and *packages/fresh/*. --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 974daafd..4c241e3c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -344,6 +344,8 @@ The repository is organized as a monorepo with the following packages: - *packages/elysia/*: Elysia integration (@fedify/elysia) for Fedify. - *packages/express/*: Express integration (@fedify/express) for Fedify. - *packages/fastify/*: Fastify integration (@fedify/fastify) for Fedify. + - *packages/fixture/*: Testing utilities (@fedify/fixture) providing + runtime-agnostic test adapters. - *packages/fresh/*: Fresh integration (@fedify/fresh) for Fedify. - *packages/h3/*: h3 framework integration (@fedify/h3) for Fedify. - *packages/hono/*: Hono integration (@fedify/hono) for Fedify. @@ -353,11 +355,11 @@ The repository is organized as a monorepo with the following packages: - *packages/koa/*: Koa integration (@fedify/koa) for Fedify. - *packages/lint/*: Linting utilities (@fedify/lint) for Fedify. - *packages/mysql/*: MySQL/MariaDB drivers (@fedify/mysql) for Fedify. + - *packages/nestjs/*: NestJS integration (@fedify/nestjs) for Fedify. + - *packages/next/*: Next.js integration (@fedify/next) for Fedify. - *packages/postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify. - *packages/redis/*: Redis drivers (@fedify/redis) for Fedify. - *packages/relay/*: ActivityPub relay support (@fedify/relay) for Fedify. - - *packages/nestjs/*: NestJS integration (@fedify/nestjs) for Fedify. - - *packages/next/*: Next.js integration (@fedify/next) for Fedify. - *packages/sqlite/*: SQLite driver (@fedify/sqlite) for Fedify. - *packages/sveltekit/*: SvelteKit integration (@fedify/sveltekit) for Fedify. - *packages/testing/*: Testing utilities (@fedify/testing) for Fedify. @@ -368,8 +370,6 @@ The repository is organized as a monorepo with the following packages: (@fedify/vocab-tools) for Fedify. - *packages/webfinger/*: WebFinger client library (@fedify/webfinger) for ActivityPub. - - *packages/fixture/*: Testing utilities (@fedify/fixture) providing - runtime-agnostic test adapters. - *docs/*: The Fedify docs. The docs are built with [Node.js] and [VitePress]. - *examples/*: The example projects. Some examples are built with Deno, and From d0c19c5ab44b9ebf1d2d522f8c96c145f95a0cca Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Mar 2026 10:54:24 +0900 Subject: [PATCH 4/4] Add mysql to MESSAGE_QUEUE, KV_STORE, and DB_TO_CHECK in @fedify/init Without this, the mysql entries in mq.json and kv.json were silently ignored because the MessageQueue and KvStore types are derived from the MESSAGE_QUEUE and KV_STORE constant arrays respectively, and mysql was not listed in either. As a result, fedify init never offered MySQL/MariaDB as a selectable backend option despite the JSON entries being present. Also added mysql to DB_TO_CHECK and the corresponding db-to-check.json so that the test suite can check whether a MySQL instance is running before running integration tests. https://github.com/fedify-dev/fedify/pull/600#discussion_r2884253728 --- packages/init/src/const.ts | 12 +++++++++--- packages/init/src/json/db-to-check.json | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/init/src/const.ts b/packages/init/src/const.ts index 6b0b8760..f9e332e8 100644 --- a/packages/init/src/const.ts +++ b/packages/init/src/const.ts @@ -12,13 +12,19 @@ export const WEB_FRAMEWORK = [ ] as const; /** All supported message queue backend identifiers. */ -export const MESSAGE_QUEUE = ["denokv", "redis", "postgres", "amqp"] as const; +export const MESSAGE_QUEUE = [ + "denokv", + "redis", + "postgres", + "mysql", + "amqp", +] as const; /** All supported key-value store backend identifiers. */ -export const KV_STORE = ["denokv", "redis", "postgres"] as const; +export const KV_STORE = ["denokv", "redis", "postgres", "mysql"] as const; /** * External database services that need to be running for integration tests. * Used by the test suite to check service availability before running tests. */ -export const DB_TO_CHECK = ["redis", "postgres", "amqp"] as const; +export const DB_TO_CHECK = ["redis", "postgres", "mysql", "amqp"] as const; diff --git a/packages/init/src/json/db-to-check.json b/packages/init/src/json/db-to-check.json index 46a64c36..c66ac291 100644 --- a/packages/init/src/json/db-to-check.json +++ b/packages/init/src/json/db-to-check.json @@ -9,6 +9,11 @@ "defaultPort": 5432, "documentation": "https://www.postgresql.org/download/" }, + "mysql": { + "name": "MySQL/MariaDB", + "defaultPort": 3306, + "documentation": "https://dev.mysql.com/doc/mysql-installation-excerpt/en/" + }, "amqp": { "name": "RabbitMQ", "defaultPort": 5672,