Skip to content

Commit

Permalink
chore(deps): upgrade turbo to v2 (#6985)
Browse files Browse the repository at this point in the history
* chore: run `clean-globs` codemod

* chore: run `rename-output-mode` codemod

* chore: run `rename-pipeline` codemod

* refactor: declare all env deps and bump turbo to v2

* chore: inspect failing exports test

* chore: identified the issue
  • Loading branch information
stipsan authored Jun 30, 2024
1 parent 868a44b commit 2fb8f9b
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 128 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const config = {
'plugin:react/jsx-runtime',
'prettier',
'@sanity/eslint-config-i18n',
'turbo',
],
parser: '@typescript-eslint/parser',
plugins: [
Expand Down Expand Up @@ -261,6 +262,17 @@ const config = {
'react-compiler/react-compiler': 'off',
},
},
// Don't lint Turbo undeclared process env variables in code that is used in the CLI at runtime
{
files: [
'packages/@sanity/cli/**',
'packages/sanity/src/_internal/cli/**',
'packages/sanity/playwright-ct/**',
],
rules: {
'turbo/no-undeclared-env-vars': 'off',
},
},
],
}

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/testExports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ jobs:
run: pnpm install

- name: Check export conditions in native node ESM and CJS
# Adds the github reporter on the CI to highlight in diffs failling tests
run: pnpm test:exports -- --test-reporter spec --test-reporter-destination stdout --test-reporter node-test-github-reporter --test-reporter-destination stdout
run: pnpm test:exports
2 changes: 1 addition & 1 deletion dev/page-building-studio/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": ["./sanity/**", "dist/**"]
}
Expand Down
10 changes: 10 additions & 0 deletions dev/studio-e2e-testing/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"build": {
"env": ["SANITY_E2E_PROJECT_ID", "SANITY_E2E_DATASET"],
"outputs": [".sanity/**", "dist/**"]
}
}
}
4 changes: 2 additions & 2 deletions dev/test-next-studio/turbo.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"env": ["NEXT_PUBLIC_SANITY_*", "NEXT_PUBLIC_VERCEL_ENV", "SANITY_*", "REACT_COMPILER"],
"env": ["REACT_COMPILER"],
"outputs": [".next/**", "!.next/cache/**", "out/**"],
"dependsOn": ["^build"]
},
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": [".sanity/**", "dist/**", "workshop/scopes.js"]
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-sanity": "^7.1.2",
"eslint-config-turbo": "^2.0.4",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-boundaries": "^4.2.1",
"eslint-plugin-import": "^2.29.1",
Expand Down Expand Up @@ -161,7 +162,7 @@
"rxjs": "^7.8.1",
"sanity": "workspace:*",
"semver": "^7.3.5",
"turbo": "^1.13.4",
"turbo": "^2.0.4",
"typescript": "5.4.5",
"vite": "^4.5.3",
"vite-tsconfig-paths": "^4.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/test-exports/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"test": {
"dependsOn": ["^build"]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/schema/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": ["lib/**", "index.js", "_internal.js"]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/util/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": [
"lib/**",
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/_internal/cli/server/renderDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {type SanityMonorepo} from './sanityMonorepo'
const debug = serverDebug.extend('renderDocument')

// Don't use threads in the jest world
// eslint-disable-next-line no-process-env
// eslint-disable-next-line no-process-env, turbo/no-undeclared-env-vars
const useThreads = typeof process.env.JEST_WORKER_ID === 'undefined'
const hasWarnedAbout = new Set<string>()

Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": [
"lib/**",
Expand Down
2 changes: 1 addition & 1 deletion perf/studio/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": [".sanity/**", "dist/**"]
}
Expand Down
2 changes: 1 addition & 1 deletion perf/tests/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"outputs": [".sanity/**", "dist/**"]
}
Expand Down
Loading

0 comments on commit 2fb8f9b

Please sign in to comment.