diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 618409b3..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. @@ -352,11 +354,12 @@ 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/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. @@ -367,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 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, 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": [