Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched to esbuild and bundle code into single file #149

Merged
merged 1 commit into from
Nov 11, 2024
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ typings/

# Activitypub V 3 Final Custom
.direnv

# Build
dist/
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ COPY tsconfig.json .
COPY src ./src

ENV NODE_ENV=production
RUN yarn build

EXPOSE 8080

CMD ["node", "--import", "tsx", "src/app.ts"]
CMD ["node", "dist/app.js"]
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- NODE_ENV=testing
- ALLOW_PRIVATE_ADDRESS=true
- SKIP_SIGNATURE_VERIFICATION=true
command: node --import tsx --watch src/app.ts
command: yarn build:watch
depends_on:
mysql:
condition: service_healthy
Expand Down Expand Up @@ -96,7 +96,7 @@ services:
- SKIP_SIGNATURE_VERIFICATION=true
- ALLOW_PRIVATE_ADDRESS=true
- NODE_TLS_REJECT_UNAUTHORIZED=0
command: node --import tsx --watch src/app.ts
command: yarn build:watch
depends_on:
mysql-testing:
condition: service_healthy
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"main": "src/app.ts",
"type": "module",
"scripts": {
"dev": "docker compose up activitypub nginx -d --no-recreate",
"build": "esbuild src/app.ts --platform=neutral --packages=external --bundle --outfile=dist/app.js",
"build:watch": "concurrently \"yarn build --watch\" \"node --watch dist/app.js\"",
"dev": "docker compose up activitypub nginx -d",
"stop": "docker compose stop",
"db": "docker compose exec mysql mysql -uroot -proot activitypub",
"fix": "docker compose rm activitypub nginx -sf && docker compose build activitypub nginx",
Expand All @@ -33,7 +35,8 @@
"@types/sinon": "17.0.3",
"@types/uuid": "10.0.0",
"@vitest/coverage-v8": "2.1.4",
"tsx": "4.19.2",
"concurrently": "9.1.0",
"esbuild": "0.24.0",
"typescript": "5.6.3",
"vitest": "2.1.4",
"wiremock-captain": "3.5.0"
Expand Down
Loading