Skip to content

Commit

Permalink
Bun to Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia authored and 0marSalah committed Dec 18, 2024
1 parent ac5e3b0 commit 952fbe9
Show file tree
Hide file tree
Showing 27 changed files with 5,208 additions and 125 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
with:
bun-version: latest
- run: bun install
- run: bun check
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 23
cache: pnpm
- run: pnpm install
- run: pnpm run check
- if: github.ref_type == 'tag'
run: |
set -ex
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/oven/bun:1.1.38-alpine
FROM docker.io/node:23.4-alpine

LABEL org.opencontainers.image.title="Hollo"
LABEL org.opencontainers.image.description="Federated single-user \
Expand All @@ -7,11 +7,11 @@ LABEL org.opencontainers.image.url="https://docs.hollo.social/"
LABEL org.opencontainers.image.source="https://github.com/dahlia/hollo"
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"

RUN apk add --no-cache ffmpeg jq libstdc++
RUN apk add --no-cache ffmpeg jq libstdc++ pnpm

COPY bun.lockb package.json /app/
COPY pnpm-lock.yaml package.json /app/
WORKDIR /app/
RUN bun install --frozen-lockfile --no-cache
RUN pnpm install --frozen-lockfile --prod

COPY . /app/

Expand All @@ -24,4 +24,4 @@ RUN \
fi

EXPOSE 3000
CMD ["bun", "run", "prod"]
CMD ["pnpm", "run", "prod"]
Binary file removed bun.lockb
Binary file not shown.
5 changes: 1 addition & 4 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
[Misskey]: https://misskey-hub.net/
[Akkoma]: https://akkoma.social/
</Card>
<Card title="Powered by Fedify &amp; Bun" icon="bun">
<Card title="Powered by Fedify" icon="deno">
Hollo is powered by [Fedify], an ActivityPub server framework for TypeScript.
It's built on top of [Bun], an alternative super-fast JavaScript runtime
to Node.js.

[Fedify]: https://fedify.dev/
[Bun]: https://bun.sh/
</Card>
</CardGrid>
16 changes: 9 additions & 7 deletions docs/src/content/docs/install/manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ Before you start, make sure you have the following software installed on your
server:

- [Git]
- [Bun]
- [Node.js]
- [pnpm]
- [ffmpeg]
- [PostgreSQL]
- L7 load balancer (e.g., [nginx], [Caddy])
- A domain name pointing to your server

[Git]: https://git-scm.com/
[Bun]: https://bun.sh/
[Node.js]: https://nodejs.org/
[pnpm]: https://pnpm.io/
[ffmpeg]: https://www.ffmpeg.org/
[PostgreSQL]: https://www.postgresql.org/
[nginx]: https://nginx.org/
Expand All @@ -53,10 +55,10 @@ import { Steps } from "@astrojs/starlight/components";
cd hollo/
~~~~

2. Install the dependencies using Bun:
2. Install the dependencies using pnpm:

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. Create a PostgreSQL user and database for Hollo:
Expand Down Expand Up @@ -92,7 +94,7 @@ Starting the server
To start the server, run the following command:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~


Expand All @@ -112,12 +114,12 @@ dependencies:
2. Reinstall the dependencies:

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. Restart the server:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~
</Steps>
6 changes: 2 additions & 4 deletions docs/src/content/docs/ja/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
[Misskey]: https://misskey-hub.net/ja/
[Akkoma]: https://akkoma.social/
</Card>
<Card title="FedifyとBunベース" icon="bun">
HolloはTypeScript向けのActivityPubサーバーフレームワークである[Fedify]で作られており、
Node.jsの代替となる超高速JavaScriptランタイムである[Bun]上で動作します。
<Card title="Fedifyベース" icon="deno">
HolloはTypeScript向けのActivityPubサーバーフレームワークである[Fedify]で作られています。

[Fedify]: https://fedify.dev/
[Bun]: https://bun.sh/
</Card>
</CardGrid>
18 changes: 10 additions & 8 deletions docs/src/content/docs/ja/install/manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ Holloは手動でインストールすることもできます。
始める前に、サーバーに以下のソフトウェアがインストールされていることを確認してください:

- [Git]
- [Bun]
- [Node.js]
- [pnpm]
- [ffmpeg]
- [PostgreSQL]
- L7ロードバランサー(例:[nginx][Caddy]
- あなたのサーバーを指しているドメイン名

[Git]: https://git-scm.com/
[Bun]: https://bun.sh/
[Node.js]: https://nodejs.org/
[pnpm]: https://pnpm.io/
[ffmpeg]: https://www.ffmpeg.org/
[PostgreSQL]: https://www.postgresql.org/
[nginx]: https://nginx.org/
Expand All @@ -51,10 +53,10 @@ import { Steps } from "@astrojs/starlight/components";
cd hollo/
~~~~

2. Bunで依存関係をインストールします
2. pnpmで依存関係をインストールします

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. HolloのためにPostgreSQLユーザーとデータベースを作成します:
Expand Down Expand Up @@ -89,7 +91,7 @@ Holloをインストールしたら、設定を行う必要があります。
サーバーを起動する準備が整ったら、以下のコマンドを実行します:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~


Expand All @@ -106,15 +108,15 @@ GitHubリポジトリから最新のコードを取得し、依存関係を再
git pull
~~~~

2. Bunで依存関係を再インストールします
2. pnpmで依存関係を再インストールします

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. サーバーを再起動します:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~
</Steps>
6 changes: 2 additions & 4 deletions docs/src/content/docs/ko/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
[Misskey]: https://misskey-hub.net/
[Akkoma]: https://akkoma.social/
</Card>
<Card title="Fedify 및 Bun으로 제작됨" icon="bun">
Hollo는 TypeScript를 위한 ActivityPub 서버 프레임워크인 [Fedify]로 제작되었으며,
Node.js의 대안인 초고속 JavaScript 런타임인 [Bun] 위에서 돌아갑니다.
<Card title="Fedify로 제작됨" icon="deno">
Hollo는 TypeScript를 위한 ActivityPub 서버 프레임워크인 [Fedify]로 제작되었습니다.

[Fedify]: https://fedify.dev/
[Bun]: https://bun.sh/
</Card>
</CardGrid>
16 changes: 9 additions & 7 deletions docs/src/content/docs/ko/install/manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ Hollo는 수동으로도 설치할 수 있습니다.
시작하기에 앞서, 서버에 다음 소프트웨어가 설치되어 있는지 확인하세요:

- [Git]
- [Bun]
- [Node.js]
- [pnpm]
- [ffmpeg]
- [PostgreSQL]
- L7 로드 밸런서 (e.g., [nginx], [Caddy])
- 여러분의 서버를 가리키고 있는 도메인 이름

[Git]: https://git-scm.com/
[Bun]: https://bun.sh/
[Node.js]: https://nodejs.org/
[pnpm]: https://pnpm.io/
[ffmpeg]: https://www.ffmpeg.org/
[PostgreSQL]: https://www.postgresql.org/
[nginx]: https://nginx.org/
Expand All @@ -52,10 +54,10 @@ import { Steps } from "@astrojs/starlight/components";
cd hollo/
~~~~

2. Bun으로 의존성을 설치합니다:
2. pnpm으로 의존성을 설치합니다:

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. Hollo에서 쓸 PostgreSQL 사용자와 데이터베이스를 만듭니다:
Expand Down Expand Up @@ -90,7 +92,7 @@ Hollo가 설치되었다면, 설정을 해야 합니다.
서버를 시작하려면 다음 명령을 실행하세요:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~


Expand All @@ -110,12 +112,12 @@ GitHub 저장소에서 최신 코드를 받고 의존성을 다시 설치하면
2. 의존성을 재설치합니다:

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. 서버를 다시 시작합니다:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~
</Steps>
4 changes: 1 addition & 3 deletions docs/src/content/docs/zh-cn/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
[Misskey]: https://misskey-hub.net/cn/
[Akkoma]: https://akkoma.social/
</Card>
<Card title="由 Fedify 和 Bun 提供支持" icon="bun">
<Card title="由 Fedify 提供支持" icon="deno">
Hollo 由 [Fedify] 提供支持,这是一个用于 TypeScript 的 ActivityPub 服务端框架。
它构建在 [Bun] 之上,这是 Node.js 的超快速 JavaScript 运行时替代方案。

[Fedify]: https://fedify.dev/
[Bun]: https://bun.sh/
</Card>
</CardGrid>
16 changes: 9 additions & 7 deletions docs/src/content/docs/zh-cn/install/manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ Hollo 可以手动安装在您的服务器上。本指南将引导您完成在
开始之前,请确保您的服务器上安装了以下软件:

- [Git]
- [Bun]
- [Node.js]
- [pnpm]
- [ffmpeg]
- [PostgreSQL]
- L7 负载均衡器(例如,[nginx][Caddy]
- 指向您服务器的域名

[Git]: https://git-scm.com/
[Bun]: https://bun.sh/
[Node.js]: https://nodejs.org/
[pnpm]: https://pnpm.io/
[ffmpeg]: https://www.ffmpeg.org/
[PostgreSQL]: https://www.postgresql.org/
[nginx]: https://nginx.org/
Expand All @@ -47,10 +49,10 @@ import { Steps } from "@astrojs/starlight/components";
cd hollo/
~~~~

2. 使用 Bun 安装依赖项:
2. 使用 pnpm 安装依赖项:

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. 为 Hollo 创建 PostgreSQL 用户和数据库:
Expand Down Expand Up @@ -84,7 +86,7 @@ import { Steps } from "@astrojs/starlight/components";
要启动服务端,请运行以下命令:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~


Expand All @@ -103,12 +105,12 @@ bun prod
2. 重新安装依赖项:

~~~~ sh frame="none"
bun install
pnpm install
~~~~

3. 重启服务端:

~~~~ sh frame="none"
bun prod
pnpm run prod
~~~~
</Steps>
3 changes: 2 additions & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[tools]
bun = "latest"
node = "23"
"npm:pnpm" = "latest"
Loading

0 comments on commit 952fbe9

Please sign in to comment.