Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/bin/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cat << 'EOF' >> ~/.bashrc
eval "$(mise activate bash)"
EOF

mise run install
pnpm install
2 changes: 1 addition & 1 deletion .github/actions/determine-version/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ runs:

- name: Sync versions across packages
shell: bash
run: mise run check-versions --fix
run: moon run root:check.versions --fix
2 changes: 1 addition & 1 deletion .github/actions/setup-mise/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ runs:
- uses: jdx/mise-action@v2
with:
version: 2025.12.12
- run: mise run install
- run: pnpm install
shell: bash
17 changes: 7 additions & 10 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- uses: ./.github/actions/setup-mise
- name: Enable RabbitMQ consistent hash exchange plugin
run: docker exec ${{ job.services.rabbitmq.id }} rabbitmq-plugins enable rabbitmq_consistent_hash_exchange
- run: mise run --skip-deps test:deno -- --coverage=.cov --junit-path=.test-report.xml
- run: mise run test:deno -- --coverage=.cov --junit-path=.test-report.xml
env:
RUST_BACKTRACE: ${{ runner.debug }}
LOG: ${{ runner.debug && 'always' || '' }}
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- uses: ./.github/actions/setup-mise
- name: Enable RabbitMQ consistent hash exchange plugin
run: docker exec ${{ job.services.rabbitmq.id }} rabbitmq-plugins enable rabbitmq_consistent_hash_exchange
- run: mise run --skip-deps test:node
- run: moon run :test.node
env:
AMQP_ORDERING_TEST: "true"

Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
- uses: ./.github/actions/setup-mise
- name: Enable RabbitMQ consistent hash exchange plugin
run: docker exec ${{ job.services.rabbitmq.id }} rabbitmq-plugins enable rabbitmq_consistent_hash_exchange
- run: mise run --skip-deps test:bun
- run: moon run :test.bun
env:
AMQP_ORDERING_TEST: "true"

Expand All @@ -195,8 +195,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-mise
- run: deno task test:cfworkers
working-directory: ${{ github.workspace }}/packages/fedify/
- run: moon run fedify:test.cfworkers

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -247,8 +246,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-mise
- run: pnpm run build
working-directory: ${{ github.workspace }}/docs/
- run: moon run docs:build
- uses: actions/upload-artifact@v4
with:
name: docs-pr-${{ github.event.pull_request.number }}
Expand Down Expand Up @@ -454,20 +452,19 @@ jobs:
EXTRA_NAV_LINK="$UNSTABLE_DOCS_URL" \
SITEMAP_HOSTNAME="$STABLE_DOCS_URL" \
JSR_REF_VERSION=stable \
pnpm run build
moon run docs:build
else
EXTRA_NAV_TEXT=Stable \
EXTRA_NAV_LINK="$STABLE_DOCS_URL" \
SITEMAP_HOSTNAME="$UNSTABLE_DOCS_URL" \
JSR_REF_VERSION=unstable \
pnpm run build
moon run docs:build
fi
env:
SHORT_VERSION: ${{ needs.determine-version.outputs.short_version }}
PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_DOMAIN }}
STABLE_DOCS_URL: ${{ vars.STABLE_DOCS_URL }}
UNSTABLE_DOCS_URL: ${{ vars.UNSTABLE_DOCS_URL }}
working-directory: ${{ github.workspace }}/docs/
- uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,11 @@ jobs:
EXTRA_NAV_LINK="$STABLE_DOCS_URL" \
SITEMAP_HOSTNAME="$UNSTABLE_DOCS_URL" \
JSR_REF_VERSION=unstable \
pnpm run build
moon run docs:build
env:
PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_DOMAIN }}
STABLE_DOCS_URL: ${{ vars.STABLE_DOCS_URL }}
UNSTABLE_DOCS_URL: ${{ vars.UNSTABLE_DOCS_URL }}
working-directory: ${{ github.workspace }}/docs/
- id: wrangler
uses: cloudflare/wrangler-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ repomix-output.xml
t.ts
t2.ts
plan.md
.moon/cache/
21 changes: 21 additions & 0 deletions .moon/tasks/tag-tsdown-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
inheritedBy:
tags:
or:
- "tsdown-build"

tasks:
build:
script: "pnpm exec tsdown"
deps:
- "^:build"
toolchains:
- "node"
inputs:
- "src/**/*"
- "tsdown.config.ts"
- "file://tsconfig.json?optional"
- "/mise.toml"
outputs:
- "dist/"
options:
cache: true
6 changes: 6 additions & 0 deletions .moon/toolchains.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
javascript:
packageManager: "pnpm"
deno: {}
node: {}
bun: {}
pnpm: {}
11 changes: 11 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
projects:
- "packages/*"
- "docs"
- "."

vcs:
client: "git"
defaultBranch: main

pipeline:
cacheLifetime: "7 days"
14 changes: 8 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ integration, database adapters, and CLI toolchain.
Development environment
-----------------------

- Task runner: [mise] (required)
- Tool version manager: [mise] (required — manages Deno, Node.js, Bun, pnpm)
- Task orchestrator: [moon] (build caching, impact analysis)
- Primary environment: [Deno]
- Additional test environments: [Node.js] and [Bun]
- Recommended editor: [Visual Studio Code] with [Deno extension]
- **CRITICAL**: Run `mise run install` (or `pnpm install`) after checkout.
- **CRITICAL**: Run `pnpm install` after checkout.
This automatically runs code generation and builds all packages.
- Lockfiles: Both *deno.lock* and *pnpm-lock.yaml* are committed.
Update them when changing dependencies.

[mise]: https://mise.jdx.dev/
[moon]: https://moonrepo.dev/
[Deno]: https://deno.com/
[Node.js]: https://nodejs.org/
[Bun]: https://bun.sh/
Expand Down Expand Up @@ -118,11 +120,11 @@ Code patterns and principles
Development workflow
--------------------

- **Code Generation**: Run `mise run codegen` whenever vocabulary YAML files
or code generation scripts change.
- **Code Generation**: Run `mise run codegen` whenever vocabulary YAML
files or code generation scripts change.
- **Building Packages**: After installation, all packages are automatically
built. To rebuild a specific package and its dependencies, run `pnpm build`
in that package's directory.
built. To rebuild a specific package and its dependencies, run
`moon run <package>:build`.
- **Checking Code**: Run `mise run check` before committing.
- **Running Tests**: Use `mise run test:deno` for Deno tests or
`mise run test` for all environments.
Expand Down
46 changes: 22 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ changes.
To update both lockfiles at once, run:

~~~~ bash
mise run install
pnpm install
~~~~

When reviewing pull requests, please check that lockfile changes are included
Expand Down Expand Up @@ -392,15 +392,15 @@ see the [*Set Up Your Environment* section][1] in the Deno manual.
> [!CAUTION]
>
> Fedify heavily depends on code generation and all packages must be built
> before coding or testing. Running `mise run install` (or `pnpm install`)
> automatically handles code generation and builds all packages.
> before coding or testing. Running `pnpm install` automatically handles
> code generation and builds all packages.

Assuming you have Deno and Visual Studio Code installed, you can open
the repository in Visual Studio Code and get ready to hack on Fedify by running
the following commands at the *root* of the repository:

~~~~ bash
mise run install # This runs codegen and builds all packages
pnpm install # This runs codegen and builds all packages
code .
~~~~

Expand All @@ -413,10 +413,9 @@ code .
> mise run hooks:install
> ~~~~

Note that the `mise run install` command is required to run only once at
the very first time after checkout. When you update dependencies or code
generation scripts, run `mise run install` again. Otherwise, you can skip
the command and just run:
Note that `pnpm install` is required to run only once at the very first time
after checkout. When you update dependencies or code generation scripts,
run `pnpm install` again. Otherwise, you can skip the command and just run:

~~~~ bash
code .
Expand All @@ -442,8 +441,8 @@ Please click the *Install* button to install the Deno extension.
### Running the Fedify CLI

If you want to test your changes in the Fedify CLI, you can run
`mise run cli` command from the root. For example, if you want to test
the `fedify lookup` subcommand, you can run the following command:
`mise run cli` command from the root. For example, if you want to
test the `fedify lookup` subcommand, you can run the following command:

~~~~ bash
mise run cli -- lookup @fedify@hollo.social
Expand All @@ -452,8 +451,8 @@ mise run cli -- lookup @fedify@hollo.social
> [!NOTE]
>
> The Fedify CLI is tested with Deno, Node.js, and Bun like other packages.
> However, for quick local testing during development, `mise run cli` uses
> Deno directly without requiring a full multi-runtime test run.
> However, for quick local testing during development, `mise run cli`
> uses Deno directly without requiring a full multi-runtime test run.

#### Running the tests

Expand All @@ -467,14 +466,14 @@ mise run test:deno
Or you can test a specific package:

~~~~ bash
deno task -f @fedify/fedify test
moon run fedify:test
~~~~

You can use `--filter` option to run a specific test. For example, if you
want to run the `verifyRequest` test:

~~~~ bash
deno task -f @fedify/fedify test --filter verifyRequest
moon run fedify:test -- --filter verifyRequest
~~~~

If the tests pass, you should run `mise run test` command to test
Expand All @@ -488,10 +487,10 @@ To test individual packages with specific runtimes:

~~~~ bash
# Test with Node.js
mise run test:node
moon run :test.node

# Test with Bun
mise run test:bun
moon run :test.bun
~~~~

Of course, Node.js and Bun should be installed on your system to run the tests
Expand All @@ -506,27 +505,26 @@ the `fedify init` command with various combinations of web frameworks,
package managers, KvStore implementations, and MessageQueue implementations.

~~~~ bash
# From /packages/cli
deno task test-init
moon run cli:test-init
~~~~

You can also specify specific options to test:

~~~~ bash
# Test with specific web framework and package manager
deno task test-init -w hono -p deno
moon run cli:test-init -- -w hono -p deno

# Test with multiple options
deno task test-init -w hono -w express -p deno -p npm -k denokv -m denokv
moon run cli:test-init -- -w hono -w express -p deno -p npm -k denokv -m denokv
~~~~

If some options are not specified, all combinations are tested by default.

You can skip dry run or hydration tests:

~~~~ bash
deno task test-init --no-dry-run # Only run hydration tests
deno task test-init --no-hyd-run # Only run dry-run tests
moon run cli:test-init -- --no-dry-run # Only run hydration tests
moon run cli:test-init -- --no-hyd-run # Only run dry-run tests
~~~~

The test results are stored in `/tmp/fedify-init/<run-id>/`(UNIX).
Expand All @@ -545,8 +543,8 @@ in the browser. To do that, you need to install [Node.js] and [pnpm] first.
Then you can run the following commands at the repository root:

~~~~ bash
mise run install
mise run docs
pnpm install
moon run docs:dev
~~~~

Once the development server is running, you can open your browser and navigate
Expand Down
Loading
Loading