Skip to content

Commit

Permalink
chore(turbo): include schema in turbo package (#9714)
Browse files Browse the repository at this point in the history
### Description

Add a new `@turbo/types#copy-schema` task which will copy the current
schema into `packages/turbo`. We do this since we explicitly exclude the
`turbo` package from our workspace so it's easier to have this hang off
of `@turbo/types`.

We then add this task to the `build` target which is a dependency of the
`publish-turbo` target which is what gets run on release:
https://github.com/vercel/turborepo/actions/runs/12796720464/job/35678219119#step:11:2

Resolves #7466

### Testing Instructions

Do a test run of the release and make sure we end up running the new
`copy-schema` task. [Started
here](https://github.com/vercel/turborepo/actions/runs/12812613189),
will take a sec to get to the point in the release where we hit this
codepath.

You can see schema gets copied into the `turbo` package
[here](https://github.com/vercel/turborepo/actions/runs/12812613189/job/35726384650#step:11:42)
  • Loading branch information
chris-olszewski authored Jan 17, 2025
1 parent e0e9297 commit 09b62a5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CLI_DIR = $(shell pwd)

# This only builds JS packages
build:
cd $(CLI_DIR)/../ && turbo build \
cd $(CLI_DIR)/../ && turbo build copy-schema \
--filter=create-turbo \
--filter=@turbo/codemod \
--filter=turbo-ignore \
Expand Down
3 changes: 2 additions & 1 deletion packages/turbo-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"build": "tsc && pnpm generate-schema",
"lint": "eslint src/",
"lint:prettier": "prettier -c . --cache",
"generate-schema": "tsx scripts/generate-schema.ts"
"generate-schema": "tsx scripts/generate-schema.ts",
"copy-schema": "cp schemas/schema.json ../turbo/schema.json"
},
"devDependencies": {
"@turbo/eslint-config": "workspace:*",
Expand Down
4 changes: 4 additions & 0 deletions packages/turbo-types/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"build": {
"outputs": ["schemas/**"],
"dependsOn": ["^topo"]
},
"copy-schema": {
"dependsOn": ["build"],
"outputs": ["../turbo/schema.json"]
}
}
}
1 change: 1 addition & 0 deletions packages/turbo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
schema.json
3 changes: 2 additions & 1 deletion packages/turbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"turbo": "./bin/turbo"
},
"files": [
"bin"
"bin",
"schema.json"
],
"optionalDependencies": {
"turbo-darwin-64": "2.3.4-canary.8",
Expand Down

0 comments on commit 09b62a5

Please sign in to comment.