Skip to content

ref(cli): Give dev/self build targets their own output dirs#44

Merged
thecodedrift merged 1 commit into
mainfrom
feat/per-target-build-dirs
Jun 15, 2026
Merged

ref(cli): Give dev/self build targets their own output dirs#44
thecodedrift merged 1 commit into
mainfrom
feat/per-target-build-dirs

Conversation

@thecodedrift

Copy link
Copy Markdown
Member

What

Each build target now emits to a distinct, gitignored directory so prod, dev, and self builds never overwrite one another:

Command Output dir Baked invocation Use for
pnpm build dist/ npx @taskless/cli Production / published builds (default)
pnpm build:dev dist-dev/ node <abs>/…/dist-dev/index.js Validating this build from another repo
pnpm build:self dist-self/ node packages/cli/dist-self/index.js Dogfooding in this repo

Why

Previously all three targets wrote to dist/, so a build:dev or build:self would 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.ts maps TASKLESS_BUILD_TARGET to its outDir via a shared OUT_DIRS table that also drives the baked dev/self invocation paths — output location and embedded CLI path stay in sync from one source.
  • Prod is unchanged (still dist/), so the published package, pnpm cli, and every test binPath keep working untouched — the diff only adds the two new dirs.
  • turbo outputs, .gitignore, eslint ignores, and both tsconfig excludes cover dist-dev//dist-self/.
  • README table + the infrastructure spec document the three-target layout.

No changeset: the published artifact is byte-identical (prod still dist/), so this is consumer-invisible build plumbing.

Verification

  • pnpm build / build:dev / build:self each 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

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>
Copilot AI review requested due to automatic review settings June 15, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TARGET into dist/, dist-dev/, and dist-self/ (single source of truth in vite.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.

@thecodedrift thecodedrift merged commit 0fbd6f0 into main Jun 15, 2026
4 checks passed
@thecodedrift thecodedrift deleted the feat/per-target-build-dirs branch June 15, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants