Skip to content

Commit 8e4bd2e

Browse files
committed
Merge branch 'monorepo'
2 parents ac1d5b5 + e1a1a80 commit 8e4bd2e

File tree

324 files changed

+335
-301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+335
-301
lines changed

.github/workflows/build.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ jobs:
216216
node-version: lts/*
217217
cache: pnpm
218218
- run: deno task test:cfworkers
219-
working-directory: ${{ github.workspace }}/fedify/
219+
working-directory: ${{ github.workspace }}/packages/fedify/
220220

221221
lint:
222222
runs-on: ubuntu-latest
@@ -257,7 +257,7 @@ jobs:
257257
node-version: lts/*
258258
cache: pnpm
259259
- run: '[[ "$(jq -r .version deno.json)" = "$(jq -r .version package.json)" ]]'
260-
working-directory: ${{ github.workspace }}/fedify/
260+
working-directory: ${{ github.workspace }}/packages/fedify/
261261
- run: deno task -f @fedify/fedify codegen
262262
- run: deno publish --dry-run
263263
- run: pnpm install
@@ -299,7 +299,7 @@ jobs:
299299
'.version = .version + "-dev." + $build + "+" + $commit' \
300300
deno.json > deno.json.tmp
301301
mv deno.json.tmp deno.json
302-
working-directory: ${{ github.workspace }}/fedify/
302+
working-directory: ${{ github.workspace }}/packages/fedify/
303303
- if: github.event_name == 'pull_request_target'
304304
run: |
305305
jq \
@@ -309,7 +309,7 @@ jobs:
309309
'.version = .version + "-pr." + $pr_number + "." + $build + "+" + $commit' \
310310
deno.json > deno.json.tmp
311311
mv deno.json.tmp deno.json
312-
working-directory: ${{ github.workspace }}/fedify/
312+
working-directory: ${{ github.workspace }}/packages/fedify/
313313
env:
314314
PR_NUMBER: ${{ github.event.pull_request.number }}
315315
PR_SHA: ${{ github.event.pull_request.head.sha }}
@@ -318,26 +318,26 @@ jobs:
318318
set -ex
319319
echo version="$(jq -r .version deno.json)" >> $GITHUB_OUTPUT
320320
echo short_version="$(jq -r .version deno.json | sed 's/[+].*//')" >> $GITHUB_OUTPUT
321-
working-directory: ${{ github.workspace }}/fedify/
321+
working-directory: ${{ github.workspace }}/packages/fedify/
322322
- run: deno task check-versions --fix
323323
- if: github.ref_type == 'tag'
324324
run: |
325325
set -ex
326326
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
327327
! grep -i "to be released" CHANGES.md
328-
working-directory: ${{ github.workspace }}/fedify/
328+
working-directory: ${{ github.workspace }}/packages/fedify/
329329
# Don't know why, but the .gitignore list is not overridden by include list
330330
# in deno.json:
331-
- run: rm vocab/.gitignore
332-
working-directory: ${{ github.workspace }}/fedify/
331+
- run: rm src/vocab/.gitignore
332+
working-directory: ${{ github.workspace }}/packages/fedify/
333333
- run: |
334334
pnpm install
335335
pnpm pack --recursive --filter='!./examples/**'
336336
if [[ "$GITHUB_REF_TYPE" != tag ]]; then
337337
rm fedify-cli-*.tgz
338338
fi
339339
- run: deno task pack
340-
working-directory: ${{ github.workspace }}/cli/
340+
working-directory: ${{ github.workspace }}/packages/cli/
341341
- id: extract-changelog
342342
uses: dahlia/submark@5a5ff0a58382fb812616a5801402f5aef00f90ce
343343
with:
@@ -469,7 +469,7 @@ jobs:
469469
with:
470470
deno-version: v2.x
471471
- run: deno task codegen
472-
working-directory: ${{ github.workspace }}/fedify/
472+
working-directory: ${{ github.workspace }}/packages/fedify/
473473
- uses: denoland/deployctl@v1
474474
with:
475475
project: fedify-blog

AGENTS.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,27 @@ Repository Structure
5050

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

53-
- *fedify/*: Main Fedify library (@fedify/fedify)
54-
- *codegen/*: Code generation scripts
55-
- *compat/*: Compatibility layer
56-
- *federation/*: Core federation functionality
57-
- *nodeinfo/*: NodeInfo protocol implementation
58-
- *runtime/*: Runtime utilities
59-
- *shim/*: Platform abstraction layer
60-
- *sig/*: Signature implementation
61-
- *testing/*: Testing utilities
62-
- *vocab/*: ActivityPub vocabulary implementation
63-
- *webfinger/*: WebFinger protocol implementation
64-
- *x/*: Framework integrations
65-
- *cli/*: Fedify CLI implementation (@fedify/cli, built with Deno)
66-
- *amqp/*: AMQP/RabbitMQ driver (@fedify/amqp)
67-
- *express/*: Express.js integration (@fedify/express)
68-
- *h3/*: h3 framework integration (@fedify/h3)
69-
- *postgres/*: PostgreSQL drivers (@fedify/postgres)
70-
- *redis/*: Redis drivers (@fedify/redis)
53+
- *packages/fedify/*: Main Fedify library (@fedify/fedify)
54+
- *src/codegen/*: Code generation scripts
55+
- *src/compat/*: Compatibility layer
56+
- *src/federation/*: Core federation functionality
57+
- *src/nodeinfo/*: NodeInfo protocol implementation
58+
- *src/runtime/*: Runtime utilities
59+
- *src/shim/*: Platform abstraction layer
60+
- *src/sig/*: Signature implementation
61+
- *src/testing/*: Testing utilities
62+
- *src/vocab/*: ActivityPub vocabulary implementation
63+
- *src/webfinger/*: WebFinger protocol implementation
64+
- *src/x/*: Framework integrations
65+
- *packages/cli/*: Fedify CLI implementation (@fedify/cli, built with Deno)
66+
- *packages/amqp/*: AMQP/RabbitMQ driver (@fedify/amqp)
67+
- *packages/express/*: Express.js integration (@fedify/express)
68+
- *packages/h3/*: h3 framework integration (@fedify/h3)
69+
- *packages/postgres/*: PostgreSQL drivers (@fedify/postgres)
70+
- *packages/redis/*: Redis drivers (@fedify/redis)
71+
- *packages/nestjs/*: NestJS integration (@fedify/nestjs)
72+
- *packages/sqlite/*: SQLite driver (@fedify/sqlite)
73+
- *packages/testing/*: Testing utilities (@fedify/testing)
7174
- *docs/*: Documentation built with Node.js and VitePress
7275
- *examples/*: Example projects demonstrating Fedify usage
7376

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

133136
### Adding ActivityPub Vocabulary Types
134137

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

139142
### Implementing Framework Integrations
140143

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

146149
### Creating Database Adapters
147150

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

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

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

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

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

257263
Ensure changes work across all distribution formats and target environments.

CONTRIBUTING.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,19 @@ Build
181181

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

184-
- *fedify/*: The main Fedify library (@fedify/fedify). The library is built
185-
with Deno, and tested with Deno, Node.js, and [Bun].
186-
- *codegen/*: The code generation scripts.
187-
- *cli/*: The Fedify CLI (@fedify/cli). The CLI is built with [Deno].
188-
- *amqp/*: AMQP/RabbitMQ driver (@fedify/amqp) for Fedify.
189-
- *express/*: Express.js integration (@fedify/express) for Fedify.
190-
- *h3/*: h3 framework integration (@fedify/h3) for Fedify.
191-
- *postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify.
192-
- *redis/*: Redis drivers (@fedify/redis) for Fedify.
184+
- *packages/fedify/*: The main Fedify library (@fedify/fedify). The library
185+
is built with Deno, and tested with Deno, Node.js, and [Bun].
186+
- *src/codegen/*: The code generation scripts.
187+
- *packages/cli/*: The Fedify CLI (@fedify/cli). The CLI is built with
188+
[Deno].
189+
- *packages/amqp/*: AMQP/RabbitMQ driver (@fedify/amqp) for Fedify.
190+
- *packages/express/*: Express.js integration (@fedify/express) for Fedify.
191+
- *packages/h3/*: h3 framework integration (@fedify/h3) for Fedify.
192+
- *packages/postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify.
193+
- *packages/redis/*: Redis drivers (@fedify/redis) for Fedify.
194+
- *packages/nestjs/*: NestJS integration (@fedify/nestjs) for Fedify.
195+
- *packages/sqlite/*: SQLite driver (@fedify/sqlite) for Fedify.
196+
- *packages/testing/*: Testing utilities (@fedify/testing) for Fedify.
193197
- *docs/*: The Fedify docs. The docs are built with [Node.js] and
194198
[VitePress].
195199
- *examples/*: The example projects. Some examples are built with Deno, and

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fedify/README.md
1+
packages/fedify/README.md

deno.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"workspace": [
3-
"./fedify",
4-
"./cli",
5-
"./amqp",
6-
"./express",
7-
"./h3",
8-
"./postgres",
9-
"./redis",
10-
"./testing",
11-
"./sqlite",
3+
"./packages/fedify",
4+
"./packages/cli",
5+
"./packages/amqp",
6+
"./packages/express",
7+
"./packages/h3",
8+
"./packages/postgres",
9+
"./packages/redis",
10+
"./packages/sqlite",
11+
"./packages/testing",
1212
"./examples/blog",
1313
"./examples/cloudflare-workers",
1414
"./examples/hono-sample"
@@ -86,7 +86,6 @@
8686
"test:bun"
8787
]
8888
},
89-
"publish": "deno task -f @fedify/fedify publish && deno task -f @fedify/cli publish",
9089
"cli": "deno task -f @fedify/cli run",
9190
"hooks:install": "deno run --allow-read=deno.json,.git/hooks/ --allow-write=.git/hooks/ jsr:@hongminhee/deno-task-hooks",
9291
"hooks:pre-commit": {

fedify/.gitignore

Lines changed: 0 additions & 17 deletions
This file was deleted.

fedify/wrangler.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.
File renamed without changes.

amqp/deno.json renamed to packages/amqp/deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.8.1",
44
"license": "MIT",
55
"exports": {
6-
".": "./mod.ts",
7-
"./mq": "./mq.ts"
6+
".": "./src/mod.ts",
7+
"./mq": "./src/mq.ts"
88
},
99
"imports": {
1010
"@alinea/suite": "jsr:@alinea/suite@^0.6.3"

amqp/package.json renamed to packages/amqp/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"repository": {
1818
"type": "git",
1919
"url": "git+https://github.com/fedify-dev/fedify.git",
20-
"directory": "amqp"
20+
"directory": "packages/amqp"
2121
},
2222
"bugs": {
2323
"url": "https://github.com/fedify-dev/fedify/issues"
@@ -36,6 +36,11 @@
3636
"import": "./dist/mod.js",
3737
"default": "./dist/mod.js"
3838
},
39+
"./mq": {
40+
"types": "./dist/mq.d.ts",
41+
"import": "./dist/mq.js",
42+
"default": "./dist/mq.js"
43+
},
3944
"./package.json": "./package.json"
4045
},
4146
"peerDependencies": {

0 commit comments

Comments
 (0)