Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Should packages be explicit dependencies? #5

Open
thlmenezes opened this issue Jul 17, 2022 · 3 comments
Open

Should packages be explicit dependencies? #5

thlmenezes opened this issue Jul 17, 2022 · 3 comments

Comments

@thlmenezes
Copy link

thlmenezes commented Jul 17, 2022

Because it is a monorepo, I know that importing directly the packages will work because of the symlink inside node_modules; but shouldn't it be listed explicitly in the packages.json's dependencies?

Example:
package api uses db, but db is not inside package.json

packages/api/src/routers/context.ts

import { PrismaClient } from "db";

packages/api/package.json

"dependencies": {
  "@trpc/server": "^9.15.0",
  "zod": "^3.17.2"
}
@juliusmarminge
Copy link
Owner

but shouldn't it be listed explicitly in the dependencies of the packages or apps?

Yes they should. This is one of the main things that I disliked about zart, all the dependencies just magically hoist together and it is definetely something I want to fix. Haven't had any time for this repo in a while now but if you want to hack on it feel free!

@thlmenezes
Copy link
Author

thlmenezes commented Jul 17, 2022

Thanks for the reply and the awesome work with the repo, love the packages ideas (api and db packages specially); I've been hacking my own starter for my company so not much time either; but will come back later when finished and PR. Although it's way more opinionated, if you are curious it's on GitHub here.

I saw your work in the create-t3-app@next and got to this repo. Just starting on trpc and loving it.

@juliusmarminge
Copy link
Owner

Thanks for the reply and the awesome work with the repo, love the packages ideas (api and db packages specially); I've been hacking my own starter for my company so not much time either; but will come back later when finished and PR. Although it's way more opinionated, if you are curious it's on GitHub here.

I saw your work in the create-t3-app@next and got to this repo. Just starting on trpc and loving it.

Please checkout create-t3-turbo which has a much cleaner dependency tree imo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants