Skip to content
Merged
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 .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ jobs:
- run: '[[ "$(jq -r .version deno.json)" = "$(jq -r .version package.json)" ]]'
working-directory: ${{ github.workspace }}/packages/fedify/
- run: mise run codegen
- run: deno publish --dry-run
- run: deno publish --dry-run --allow-slow-types
- run: pnpm publish --recursive --dry-run --no-git-checks --ignore-scripts

# ===========================================================================
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
plans/
1 change: 1 addition & 0 deletions .hongdown.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exclude = [
"WARP.md",
"packages/fedify/src/cfworkers/**",
"plan.md",
"**/plans/**",
]

[heading]
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ for the complete package list.

### Other key directories

- *packages/init/*: Project initializer (`@fedify/init`) for Fedify.
Separated from `@fedify/cli` to enable standalone use.
- *packages/create/*: Standalone CLI (`@fedify/create`)
for creating new Fedify projects via `npm init @fedify`.
- *docs/*: Documentation built with VitePress (see *docs/README.md*)
- *examples/*: Example projects

Expand Down
28 changes: 28 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,34 @@ To be released.
- Requires a Workers KV namespace for lock management.
- Due to Workers KV eventual consistency, ordering is best-effort.

### @fedify/init

- Created project initializer as the *@fedify/init* package. Separated
the `fedify init` functionality from *@fedify/cli* into a standalone
package to improve modularity and enable reuse by other tools such as
`@fedify/create`. [[#482] by Chanhaeng Lee]

- Added `runInit()` function as the main initialization action handler.
- Added `initCommand` and `initOptions` for CLI integration.
- Added `testInitCommand` for comprehensive testing of all init
combinations.

[#482]: https://github.com/fedify-dev/fedify/issues/482

### @fedify/create

- Created standalone project scaffolding CLI as the *@fedify/create*
package. This enables creating new Fedify projects without installing
the full `@fedify/cli` toolchain. [[#351] by Chanhaeng Lee]

- Supports `npm init @fedify`, `pnpm create @fedify`,
`yarn create @fedify`, and `bunx @fedify/create`.
- Uses `@fedify/init` internally for all initialization logic.
- Supports the same interactive prompts and CLI options as
`fedify init`.

[#351]: https://github.com/fedify-dev/fedify/issues/351


Version 1.10.3
--------------
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ The repository is organized as a monorepo with the following packages:
- *packages/cli/*: The Fedify CLI (@fedify/cli). Built with [Deno] and
tested with Deno, Node.js, and [Bun]. Uses `deno compile` to create
standalone executables.
- *packages/create/*: Standalone CLI (@fedify/create) for
creating new Fedify projects. Wraps @fedify/init.
- *packages/amqp/*: AMQP/RabbitMQ driver (@fedify/amqp) for Fedify.
- *packages/cfworkers/*: Cloudflare Workers integration (@fedify/cfworkers) for
Fedify.
Expand All @@ -344,6 +346,9 @@ The repository is organized as a monorepo with the following packages:
- *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.
- *packages/init/*: Project initializer (@fedify/init) for Fedify.
Separated from @fedify/cli to enable standalone use and
`npm init @fedify`.
- *packages/koa/*: Koa integration (@fedify/koa) for Fedify.
- *packages/lint/*: Linting utilities (@fedify/lint) for Fedify.
- *packages/postgres/*: PostgreSQL drivers (@fedify/postgres) for Fedify.
Expand Down
6 changes: 5 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"./packages/fixture",
"./packages/fresh",
"./packages/h3",
"./packages/init",
"./packages/hono",
"./packages/koa",
"./packages/lint",
Expand Down Expand Up @@ -40,6 +41,8 @@
"@opentelemetry/core": "npm:@opentelemetry/core@^2.5.0",
"@opentelemetry/sdk-trace-base": "npm:@opentelemetry/sdk-trace-base@^2.5.0",
"@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.39.0",
"@optique/core": "jsr:@optique/core@^0.9.0",
"@optique/run": "jsr:@optique/run@^0.9.0",
"@std/assert": "jsr:@std/assert@^1.0.13",
"@std/async": "jsr:@std/async@^1.0.13",
"@std/encoding": "jsr:@std/encoding@^1.0.10",
Expand All @@ -50,6 +53,7 @@
"@types/node": "npm:@types/node@^22.16.0",
"amqplib": "npm:amqplib@^0.10.9",
"byte-encodings": "npm:byte-encodings@^1.0.11",
"chalk": "npm:chalk@^5.6.2",
"es-toolkit": "npm:es-toolkit@^1.43.0",
"h3": "npm:h3@^1.15.0",
"hono": "jsr:@hono/hono@^4.8.3",
Expand Down Expand Up @@ -162,7 +166,7 @@
"./packages"
],
"exclude": [
"./packages/cli/src/init/templates/**"
"./packages/init/src/templates/**"
]
}
}
71 changes: 16 additions & 55 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ project. It will ask you a few questions to set up the project:
- Message queue: In-memory, [Redis], [PostgreSQL], [AMQP] (e.g., [RabbitMQ]),
or [Deno KV] (if Deno)

> [!TIP]
> Projects created with `fedify init` automatically include [`@fedify/lint`]
> for consistent code linting. Deno projects get a lint plugin configured in
> *deno.json*, while Node.js and Bun projects get an *eslint.config.ts* with
> `@fedify/lint`.

> [!NOTE]
> If you find the full `@fedify/cli` toolchain too heavy for your needs, you
> can use [`@fedify/create`] instead to scaffold a new Fedify project without
> installing the CLI globally. See the
> [*Alternative: Using `@fedify/create`*](./install.md#alternative-using-fedify-create)
> section for details.

Alternatively, you can specify the options in the command line to skip some of
interactive prompts:

Expand All @@ -142,6 +155,8 @@ interactive prompts:
[Deno KV]: https://deno.com/kv
[AMQP]: https://www.amqp.org/
[RabbitMQ]: https://www.rabbitmq.com/
[`@fedify/lint`]: /manual/lint
[`@fedify/create`]: https://www.npmjs.com/package/@fedify/create

### `-r`/`--runtime`: JavaScript runtime

Expand Down
28 changes: 28 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@ in the *CLI toolchain* docs.

[![The “fedify init” command demo](https://asciinema.org/a/671658.svg)](https://asciinema.org/a/671658)

### Alternative: Using `@fedify/create`

If you don't want to install the `fedify` CLI globally, you can use
`@fedify/create` directly:

::: code-group

~~~~ sh [npm]
npm init @fedify your-project-dir
~~~~

~~~~ sh [pnpm]
pnpm create @fedify your-project-dir
~~~~

~~~~ sh [Yarn]
yarn create @fedify your-project-dir
~~~~

~~~~ sh [Bun]
bunx @fedify/create your-project-dir
~~~~

:::

This works the same way as `fedify init` and will guide you through the same
project setup wizard.


Manual installation
-------------------
Expand Down
Loading
Loading