mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-07-27 04:31:57 +00:00
fix(build): declare the env the docs build reads so turbo stops stripping it
turbo runs tasks in strict env mode (2.x default): a task only sees the env
vars declared for it. `build` declared none, so every var the deploy workflow
exports was dropped before the build ran:
NEXT_EXPORT -> next.config gates `output: 'export'` on it. Stripped, the
build emits no out/, and the next workflow step is
`wrangler pages deploy out`.
HANZO_DOCS_SYNC -> pre-build gates the project-docs sync on it. Stripped, the
sync runs — the workflow sets it to 0 precisely so the
committed snapshot is used instead.
NODE_OPTIONS -> the heap ceiling the workflow raises for this build.
`turbo run build --filter=docs --dry=json` reported envMode "strict" with
configured [] and passthrough null; it now lists NEXT_EXPORT, HANZO_DOCS_SYNC
and NODE_OPTIONS.
This regressed in 6167d746c, which moved NEXT_EXPORT and NODE_OPTIONS out of the
app's build script — where they were inline and immune to turbo's env filter —
into the workflow's env block.
The two vars that select what is built (NEXT_EXPORT, HANZO_DOCS_SYNC) belong in
`env`, where they also key the cache: a non-export build and an export build are
not interchangeable artifacts. NODE_OPTIONS only shapes how the build runs, so
it is passThroughEnv and stays out of the hash. The wildcards cover the rest of
the HANZO_DOCS_*/HANZO_SEARCH_* knobs the build scripts read, so the next one
added does not silently vanish.
This commit is contained in:
@@ -10,6 +10,15 @@
|
||||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"env": [
|
||||
"NEXT_EXPORT",
|
||||
"GITHUB_PAGES",
|
||||
"DOCS_SECTION",
|
||||
"ANALYZE",
|
||||
"HANZO_DOCS_*",
|
||||
"HANZO_SEARCH_*"
|
||||
],
|
||||
"passThroughEnv": ["NODE_OPTIONS"],
|
||||
"outputs": [
|
||||
".output",
|
||||
"public/registry",
|
||||
|
||||
Reference in New Issue
Block a user