Unverified Commit 8e4bd2e7 authored by Hong Minhee's avatar Hong Minhee
Browse files

Merge branch 'monorepo'

parents ac1d5b5c e1a1a80e
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ jobs:
        node-version: lts/*
        cache: pnpm
    - run: deno task test:cfworkers
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/

  lint:
    runs-on: ubuntu-latest
@@ -257,7 +257,7 @@ jobs:
        node-version: lts/*
        cache: pnpm
    - run: '[[ "$(jq -r .version deno.json)" = "$(jq -r .version package.json)" ]]'
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/
    - run: deno task -f @fedify/fedify codegen
    - run: deno publish --dry-run
    - run: pnpm install
@@ -299,7 +299,7 @@ jobs:
          '.version = .version + "-dev." + $build + "+" + $commit' \
          deno.json > deno.json.tmp
        mv deno.json.tmp deno.json
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/
    - if: github.event_name == 'pull_request_target'
      run: |
        jq \
@@ -309,7 +309,7 @@ jobs:
          '.version = .version + "-pr." + $pr_number + "." + $build + "+" + $commit' \
          deno.json > deno.json.tmp
        mv deno.json.tmp deno.json
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/
      env:
        PR_NUMBER: ${{ github.event.pull_request.number }}
        PR_SHA: ${{ github.event.pull_request.head.sha }}
@@ -318,18 +318,18 @@ jobs:
        set -ex
        echo version="$(jq -r .version deno.json)" >> $GITHUB_OUTPUT
        echo short_version="$(jq -r .version deno.json | sed 's/[+].*//')" >> $GITHUB_OUTPUT
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/
    - run: deno task check-versions --fix
    - if: github.ref_type == 'tag'
      run: |
        set -ex
        [[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
        ! grep -i "to be released" CHANGES.md
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/
    # Don't know why, but the .gitignore list is not overridden by include list
    # in deno.json:
    - run: rm vocab/.gitignore
      working-directory: ${{ github.workspace }}/fedify/
    - run: rm src/vocab/.gitignore
      working-directory: ${{ github.workspace }}/packages/fedify/
    - run: |
        pnpm install
        pnpm pack --recursive --filter='!./examples/**'
@@ -337,7 +337,7 @@ jobs:
          rm fedify-cli-*.tgz
        fi
    - run: deno task pack
      working-directory: ${{ github.workspace }}/cli/
      working-directory: ${{ github.workspace }}/packages/cli/
    - id: extract-changelog
      uses: dahlia/submark@5a5ff0a58382fb812616a5801402f5aef00f90ce
      with:
@@ -469,7 +469,7 @@ jobs:
      with:
        deno-version: v2.x
    - run: deno task codegen
      working-directory: ${{ github.workspace }}/fedify/
      working-directory: ${{ github.workspace }}/packages/fedify/
    - uses: denoland/deployctl@v1
      with:
        project: fedify-blog
+30 −24
Original line number Diff line number Diff line
@@ -50,24 +50,27 @@ Repository Structure

The repository is organized as a monorepo with the following packages:

 -  *fedify/*: Main Fedify library (@fedify/fedify)
    -  *codegen/*: Code generation scripts
    -  *compat/*: Compatibility layer
    -  *federation/*: Core federation functionality
    -  *nodeinfo/*: NodeInfo protocol implementation
    -  *runtime/*: Runtime utilities
    -  *shim/*: Platform abstraction layer
    -  *sig/*: Signature implementation
    -  *testing/*: Testing utilities
    -  *vocab/*: ActivityPub vocabulary implementation
    -  *webfinger/*: WebFinger protocol implementation
    -  *x/*: Framework integrations
 -  *cli/*: Fedify CLI implementation (@fedify/cli, built with Deno)
 -  *amqp/*: AMQP/RabbitMQ driver (@fedify/amqp)
 -  *express/*: Express.js integration (@fedify/express)
 -  *h3/*: h3 framework integration (@fedify/h3)
 -  *postgres/*: PostgreSQL drivers (@fedify/postgres)
 -  *redis/*: Redis drivers (@fedify/redis)
 -  *packages/fedify/*: Main Fedify library (@fedify/fedify)
    -  *src/codegen/*: Code generation scripts
    -  *src/compat/*: Compatibility layer
    -  *src/federation/*: Core federation functionality
    -  *src/nodeinfo/*: NodeInfo protocol implementation
    -  *src/runtime/*: Runtime utilities
    -  *src/shim/*: Platform abstraction layer
    -  *src/sig/*: Signature implementation
    -  *src/testing/*: Testing utilities
    -  *src/vocab/*: ActivityPub vocabulary implementation
    -  *src/webfinger/*: WebFinger protocol implementation
    -  *src/x/*: Framework integrations
 -  *packages/cli/*: Fedify CLI implementation (@fedify/cli, built with Deno)
 -  *packages/amqp/*: AMQP/RabbitMQ driver (@fedify/amqp)
 -  *packages/express/*: Express.js integration (@fedify/express)
 -  *packages/h3/*: h3 framework integration (@fedify/h3)
 -  *packages/postgres/*: PostgreSQL drivers (@fedify/postgres)
 -  *packages/redis/*: Redis drivers (@fedify/redis)
 -  *packages/nestjs/*: NestJS integration (@fedify/nestjs)
 -  *packages/sqlite/*: SQLite driver (@fedify/sqlite)
 -  *packages/testing/*: Testing utilities (@fedify/testing)
 -  *docs/*: Documentation built with Node.js and VitePress
 -  *examples/*: Example projects demonstrating Fedify usage

@@ -132,21 +135,23 @@ Common Tasks

### Adding ActivityPub Vocabulary Types

1. Create a new YAML file in *fedify/vocab/* following existing patterns
1. Create a new YAML file in *packages/fedify/src/vocab/* following existing patterns
2. Run `deno task codegen` to generate TypeScript classes
3. Export the new types from appropriate module files

### Implementing Framework Integrations

1. Add new integrations in the *fedify/x/* directory
1. Add new integrations in the *packages/fedify/src/x/* directory
2. Follow pattern from existing integrations (hono.ts, sveltekit.ts)
3. Use standard request/response interfaces for compatibility
4. Consider creating a dedicated package for substantial integrations

### Creating Database Adapters

1. For core KV/MQ interfaces: implement in *fedify/federation/kv.ts* and *fedify/federation/mq.ts*
2. For specific database adapters: create dedicated packages (*postgres/*, *redis/*, *amqp/*)
1. For core KV/MQ interfaces: implement in *packages/fedify/src/federation/kv.ts*
   and *packages/fedify/src/federation/mq.ts*
2. For specific database adapters: create dedicated packages
   (*packages/sqlite/*, *packages/postgres/*, *packages/redis/*, *packages/amqp/*)
3. Follow the pattern from existing database adapter packages
4. Implement both KV store and message queue interfaces as needed

@@ -167,7 +172,7 @@ Testing Requirements

1. Write unit tests for all new functionality
2. Follow the pattern of existing tests
3. Use the testing utilities in *fedify/testing/*
3. Use the testing utilities in *packages/fedify/src/testing/* or *packages/testing/*
4. Consider interoperability with other fediverse software
5. For package-specific tests, follow the testing patterns in each package

@@ -251,7 +256,8 @@ The monorepo uses different build processes for different packages:
2. **@fedify/cli**: Built with Deno, distributed via JSR and npm

3. **Database adapters and integrations**: Use tsdown for TypeScript compilation:
   - *amqp/*, *express/*, *h3/*, *postgres/*, *redis/*
   - *packages/amqp/*, *packages/express/*, *packages/h3/*, *packages/sqlite/*,
     *packages/postgres/*, *packages/redis/*, *packages/nestjs/*
   - Built to support Node.js and Bun environments

Ensure changes work across all distribution formats and target environments.
+13 −9
Original line number Diff line number Diff line
@@ -181,15 +181,19 @@ Build

The repository is organized as a monorepo with the following packages:

 -  *fedify/*: The main Fedify library (@fedify/fedify).  The library is built
    with Deno, and tested with Deno, Node.js, and [Bun].
     -  *codegen/*: The code generation scripts.
 -  *cli/*: The Fedify CLI (@fedify/cli).  The CLI is built with [Deno].
 -  *amqp/*: AMQP/RabbitMQ driver (@fedify/amqp) for Fedify.
 -  *express/*: Express.js integration (@fedify/express) for Fedify.
 -  *h3/*: h3 framework integration (@fedify/h3) for Fedify.
 -  *postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify.
 -  *redis/*: Redis drivers (@fedify/redis) for Fedify.
 -  *packages/fedify/*: The main Fedify library (@fedify/fedify).  The library
    is built with Deno, and tested with Deno, Node.js, and [Bun].
     -  *src/codegen/*: The code generation scripts.
 -  *packages/cli/*: The Fedify CLI (@fedify/cli).  The CLI is built with
    [Deno].
 -  *packages/amqp/*: AMQP/RabbitMQ driver (@fedify/amqp) for Fedify.
 -  *packages/express/*: Express.js integration (@fedify/express) for Fedify.
 -  *packages/h3/*: h3 framework integration (@fedify/h3) for Fedify.
 -  *packages/postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify.
 -  *packages/redis/*: Redis drivers (@fedify/redis) for Fedify.
 -  *packages/nestjs/*: NestJS integration (@fedify/nestjs) for Fedify.
 -  *packages/sqlite/*: SQLite driver (@fedify/sqlite) for Fedify.
 -  *packages/testing/*: Testing utilities (@fedify/testing) for Fedify.
 -  *docs/*: The Fedify docs.  The docs are built with [Node.js] and
    [VitePress].
 -  *examples/*: The example projects.  Some examples are built with Deno, and
+1 −1
Original line number Diff line number Diff line
fedify/README.md
 No newline at end of file
packages/fedify/README.md
 No newline at end of file
+9 −10
Original line number Diff line number Diff line
{
  "workspace": [
    "./fedify",
    "./cli",
    "./amqp",
    "./express",
    "./h3",
    "./postgres",
    "./redis",
    "./testing",
    "./sqlite",
    "./packages/fedify",
    "./packages/cli",
    "./packages/amqp",
    "./packages/express",
    "./packages/h3",
    "./packages/postgres",
    "./packages/redis",
    "./packages/sqlite",
    "./packages/testing",
    "./examples/blog",
    "./examples/cloudflare-workers",
    "./examples/hono-sample"
@@ -86,7 +86,6 @@
        "test:bun"
      ]
    },
    "publish": "deno task -f @fedify/fedify publish && deno task -f @fedify/cli publish",
    "cli": "deno task -f @fedify/cli run",
    "hooks:install": "deno run --allow-read=deno.json,.git/hooks/ --allow-write=.git/hooks/ jsr:@hongminhee/deno-task-hooks",
    "hooks:pre-commit": {
Loading