-
Notifications
You must be signed in to change notification settings - Fork 20
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
chore(deps): upgrade to turbo v2, pnpm v9 & improve dev scripts #1720
Conversation
It's not very useful when it all comes down to it
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
.github/workflows/browserslist.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action doesn't really work well with pnpm
@@ -23,12 +22,11 @@ jobs: | |||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |||
steps: | |||
- uses: actions/checkout@v4 | |||
- uses: pnpm/action-setup@v2 | |||
- uses: pnpm/action-setup@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v4 automatically supports packageManager
in package.json
, so the corepack command is no longer necessary
@@ -23,7 +22,7 @@ jobs: | |||
with: | |||
app-id: ${{ secrets.ECOSPARK_APP_ID }} | |||
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }} | |||
- uses: connor-baer/action-sync-branch@main | |||
- uses: connor-baer/action-sync-branch@v1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know why renovate missed pinning this one, it's pinned now though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workaround is no longer needed, as Google fixed this back in May googleapis/release-please#2281 🥳
const sanityExports = {} | ||
for (const key of Object.keys(sanityPkg.exports)) { | ||
if (key === '.') continue | ||
const subexport = path.join('sanity', key) | ||
sanityExports[subexport] = requireResolve(subexport) | ||
} | ||
sanityExports['sanity'] = requireResolve('sanity') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll ship a first class utility for this in next-sanity
later. This feature is based on the new aliasing that sanity dev
does since v3.53.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Also TIL about Import Assertions
@@ -5,9 +5,9 @@ | |||
|
|||
import {visionTool} from '@sanity/vision' | |||
import {defineConfig} from 'sanity' | |||
import {presentationTool} from 'sanity/presentation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to the link-workspace-packages = deep
in the root .npmrc
we can use e2e tests that import from sanity/presentation
and still have it use the workspace version instead of npm 🥳
a72c5b9
to
50f8a00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No obvious issues that I could find in the code changes. Tested locally and it seems work great, big improvement. I left one query about the per branch env vars but not a blocker, can discuss that later on.
Thanks!
To improve dev scripts the new
turbo watch
command is used, it re-runs thedev
commands inpackages/*
that currently runspkg build --strict
.Once
@sanity/pkg-utils
handles TS types with itswatch
command we can move to a simplified setup withturbo run dev
again instead ofturbo watch dev
, that handles runningbuild
commands during warm up. The reason we manually runbuild
beforeturbo watch
is due toturbo
runningwatch
tasks all in parallel, which means you easily havesanity dev
happening before packages it uses, like@sanity/presentation
, is built.While at it I've bumped
@sanity/ui
,sanity
packages, and enabled testing our@sanity/styled-components
temporary fork (related studio PR).