codepod-io / codepod

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

refactor: use pnpm workspace (monorepo) #467

Closed lihebi closed 1 year ago

lihebi commented 1 year ago

Several changes:

  1. Use monorepo (ref, ref) via npm/pnpm workspace, so that we can extract code into packages and reuse it across apps (server app, desktop app, across ui/api).

Before:

ui/package.json
api/package.json
proxy/package.json

After:

package.json
pnpm-workspace.yaml
apps/
   ui/package.json
   api/pacakge.json
   proxy/packages.json
packages/
  some-shared-component (TODO)
  some-shared-utils (TODO)
  1. use pnpm instead of yarn to manage pacakges. Apart from gaining in the speed and disk space, Yarn actually isn't "right": it treats dependencies as installed packages, thus there has been a lot of "silent" errors. Fixed in this PR.
  2. upgrade zustand to 4.4 to fix a bug in package importing https://github.com/pmndrs/zustand/issues/1528
lihebi commented 1 year ago

Note for developers:

  1. instead of using yarn and yarn add to install packages (for VSCode linting purpose), use pnpm install and pnpm add ....
  2. Instead of using npx prisma ..., use pnpx prisma ....
  3. the docker-compose stack workflow is not changed. But you need to remove your old ui-node-modules volumes.