codepod-io / codepod

Codepod IDE: Scalable Interactive Coding
https://codepod.io
MIT License
69 stars 16 forks source link

replace pnpm with bun #555

Closed lihebi closed 9 months ago

lihebi commented 9 months ago

Pnpm has one major problem: the .pnpm-store is not compatible with docker-stack. The problem is due to pnpm's choice to link folders instead of copying. Ref from https://pnpm.io/docker:

It is impossible to create reflinks or hardlinks between a Docker container and the host filesystem during build time.

This creates the problem that one can either install packages in docker stack, or on the host, but not both. This is pretty inconvenient.

Now bun 1.0 is available, and it seems to work well across the host and docker-stack.

Therefore, this PR uses bun as a package manager to replace pnpm.

TODOs:

lihebi commented 9 months ago

Update: the setup container is removed. We need to install node packages on the host for IDE linting anyway.

The new developer workflow:

  1. install node_modules in your host OS
bun install
  1. migrate DB if this is the first time:
cd packages/prisma
# e.g., "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public"
export DATABASE_URL=...
bunx prisma migrate dev
  1. start docker stack
cd compose/web
docker compose up -d

TODOS: