feat: core package build#139
feat: core package build#139marcalexiei wants to merge 12 commits intostats-organization:npm-packagefrom
core package build#139Conversation
|
@marcalexiei is attempting to deploy a commit to the martin-mfg's projects Team on Vercel. A member of the Team first needs to authorize it. |
| @@ -0,0 +1,21 @@ | |||
| { | |||
| "$schema": "./node_modules/turbo/schema.json", | |||
There was a problem hiding this comment.
I'm curious why you use a local path here while the documentation proposes to use https://turborepo.dev/schema.json.
There was a problem hiding this comment.
The remote version will be always the last version so it might not be in sync with the locally installed version.
Using the local version eliminates this potential discrepancy.
https://turborepo.dev/blog/turbo-2-4#schemajson-in-node_modules
packages/core/src/index.ts
Outdated
| @@ -1,19 +1,36 @@ | |||
| // We need this file to be in ts to allow custom conditions to work | |||
| // At the moment we only | |||
There was a problem hiding this comment.
It seems the end of this sentence is missing.
| "exports": { | ||
| ".": "./src/index.js" | ||
| ".": { | ||
| "@stats/source": "./src/index.ts", |
There was a problem hiding this comment.
I roughly understand what this does, but I wonder why it's necessary. If we omit @stats/source everywhere and just export the *js files, isn't the result the same?
There was a problem hiding this comment.
This article should give you a good overview: https://colinhacks.com/essays/live-types-typescript-monorepo
Check 5. Custom conditions in "exports"
It basically allows realtime type checking in the IDE without the need to rebuild them every time.
turbo.json
Outdated
| "dev": { | ||
| "persistent": true | ||
| }, | ||
| "test": { |
There was a problem hiding this comment.
I started learning about turbo yesterday, so I might well be wrong, but I think we do not run test via turbo. So we don't need this config, right?
Also, I noticed that when I change something in the code of core, the test results of pnpm test don' reflect these changes. I have to run pnpm build:packages first and pnpm test afterwards for the test results to reflect my code changes. Imo this is a pitfall we should avoid. Can we make pnpm test execute build:packages first?
There was a problem hiding this comment.
I added resolve.conditions to relevant vitest.config files.
Now when you are running vitest in watch mode and editing core files a test rerun is triggered.
Done via d36564a
customConditionsturboto handle repo tasks