ref(cli): Give dev/self build targets their own output dirs#44
Merged
Conversation
Each build target now emits to a distinct, gitignored directory so prod, dev, and self builds never overwrite one another: - prod (`pnpm build`) -> dist/ (`npx @taskless/cli`) - dev (`pnpm build:dev`) -> dist-dev/ (absolute path, cross-repo) - self (`pnpm build:self`) -> dist-self/ (repo-relative, dogfooding) vite.config.ts maps the target to its outDir via a shared OUT_DIRS table that also drives the baked dev/self invocation paths, keeping the output location and the embedded CLI path in sync from one source. Prod is unchanged (still dist/), so the published package, `pnpm cli`, and all test binPaths keep working as-is. turbo outputs, .gitignore, eslint ignores, and both tsconfig excludes cover the two new dirs; README and the infrastructure spec document the three-target layout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the CLI build plumbing so the prod/dev/self build targets no longer clobber each other by emitting to separate output directories, while keeping the production artifact unchanged (dist/).
Changes:
- Split CLI build outputs by
TASKLESS_BUILD_TARGETintodist/,dist-dev/, anddist-self/(single source of truth invite.config.ts). - Update repo tooling/config to recognize the new output directories (turbo cache outputs, TS excludes, ESLint ignores, gitignore).
- Document the three-target layout in the root README and infrastructure spec.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
turbo.json |
Cache build outputs for dist-dev/** and dist-self/** in addition to dist/**. |
tsconfig.json |
Exclude new build output directories at the repo root. |
README.md |
Document per-target output directories and updated baked invocation paths. |
packages/cli/vite.config.ts |
Centralize target→outDir mapping and ensure baked dev/self invocations point at the correct output dir. |
packages/cli/tsconfig.json |
Exclude new CLI build output directories. |
package.json |
Update build:self:install to run from dist-self/ output. |
openspec/specs/infrastructure/spec.md |
Update infrastructure spec to reflect cached build outputs. |
eslint.config.js |
Ignore new output directories. |
.gitignore |
Ignore dist-dev/ and dist-self/ outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Each build target now emits to a distinct, gitignored directory so prod, dev, and self builds never overwrite one another:
pnpm builddist/npx @taskless/clipnpm build:devdist-dev/node <abs>/…/dist-dev/index.jspnpm build:selfdist-self/node packages/cli/dist-self/index.jsWhy
Previously all three targets wrote to
dist/, so abuild:devorbuild:selfwould clobber the prod artifact (and each other). Splitting the output directories makes the three reliable and independent — you can have a prod build and a self-install build coexisting without re-running.How
vite.config.tsmapsTASKLESS_BUILD_TARGETto itsoutDirvia a sharedOUT_DIRStable that also drives the baked dev/self invocation paths — output location and embedded CLI path stay in sync from one source.dist/), so the published package,pnpm cli, and every testbinPathkeep working untouched — the diff only adds the two new dirs.turbooutputs,.gitignore, eslint ignores, and bothtsconfigexcludes coverdist-dev//dist-self/.No changeset: the published artifact is byte-identical (prod still
dist/), so this is consumer-invisible build plumbing.Verification
pnpm build/build:dev/build:selfeach land in their own dir with the correct baked invocation string (verified prod=npx @taskless/cli, dev=absolute, self=repo-relative).pnpm typecheck,pnpm lint,pnpm test(299 tests) all green.🤖 Generated with Claude Code