Skip to content

fix(cli): resolve every CLI bin through a committed compile-cache shim - #1960

Merged
toiroakr merged 2 commits into
mainfrom
chore/politty
Aug 7, 2026
Merged

fix(cli): resolve every CLI bin through a committed compile-cache shim#1960
toiroakr merged 2 commits into
mainfrom
chore/politty

Conversation

@toiroakr

@toiroakr toiroakr commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pnpm only links a package bin whose target exists at install time, so a bin pointing at a build artifact stays unlinked on a clean checkout. tailor-seed never reached node_modules/.bin, so tailor seed could not dispatch until the workspace was reinstalled after a build.
  • Generate the launchers with politty generate-shim and commit them under bin/: @tailor-platform/sdk (bin/tailor.mjs), @tailor-platform/sdk-plugin-seed (bin/cli.mjs), and @tailor-platform/sdk-plugin-tailordb-erd (bin/cli.mjs, replacing the hand-written launcher).
  • The seed and ERD plugin CLIs now also enable Node's on-disk compile cache, which previously only the tailor CLI had.
  • With every bin target committed, install-deps no longer needs to re-link workspace bins after the build.

Notes

  • Verified with a probe project that consumes the three packages via link:: tailor, tailor-seed, and tailor-tailordb-erd are all linked — including when the seed package has no dist/ at install time.
  • Callers that spawned the CLI through the old shim path (dist/cli/index.mjs) now use bin/tailor.mjs: three e2e tests and the Bun CLI bootstrap smoke step in pkg-pr-new.yml.

pnpm only links a package bin whose target exists at install time, so a
bin pointing at a build artifact stays unlinked on a clean checkout:
tailor-seed never reached node_modules/.bin, and `tailor seed` failed to
dispatch until the workspace was reinstalled after a build.

Generate the launchers with `politty generate-shim` and commit them under
bin/, so package managers link them before the package is built. The seed
and ERD plugin CLIs now also get the on-disk compile cache that only the
tailor CLI had, and install-deps no longer needs to re-link workspace bins
after the build.
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f9a7171

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/sdk-plugin-seed Patch
@tailor-platform/sdk-plugin-tailordb-erd Patch
@tailor-platform/create-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tailor-platform/create-sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/create-sdk@f9a7171

@tailor-platform/eslint-plugin-sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/eslint-plugin-sdk@f9a7171

@tailor-platform/sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk@f9a7171

@tailor-platform/sdk-plugin-seed

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk-plugin-seed@f9a7171

@tailor-platform/sdk-plugin-tailordb-erd

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk-plugin-tailordb-erd@f9a7171

commit: f9a7171

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🗺️ ERD preview

Self-contained ERD viewer HTML built for this run. Each viewer can switch between the current schema and a diff against base branch main.

@github-actions

This comment has been minimized.

The tailor bin moved from dist/cli/index.mjs to the committed bin/tailor.mjs
shim, but this step still spawned the old path, so both Bun smoke jobs failed
with "Module not found".
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (de87fc1) #1960 (49262cd) +/-
Coverage 78.5% 78.5% 0.0%
Code to Test Ratio 1:0.4 1:0.4 0.0
Details
  |                    | main (de87fc1) | #1960 (49262cd) | +/-  |
  |--------------------|----------------|-----------------|------|
  | Coverage           |          78.5% |           78.5% | 0.0% |
  |   Files            |            462 |             462 |    0 |
  |   Lines            |          17731 |           17731 |    0 |
  |   Covered          |          13920 |           13920 |    0 |
  | Code to Test Ratio |          1:0.4 |           1:0.4 |  0.0 |
  |   Code             |         126564 |          126564 |    0 |
  |   Test             |          61875 |           61875 |    0 |

SDK Configure Bundle Size

main (de87fc1) #1960 (49262cd) +/-
configure-index-size 39.25KB 39.25KB 0KB
dependency-chunks-size 24.96KB 24.96KB 0KB
total-bundle-size 64.22KB 64.22KB 0KB

Runtime Performance

main (de87fc1) #1960 (49262cd) +/-
Generate Median 1,898ms 2,484ms 586ms
Generate Max 2,043ms 2,535ms 492ms
Apply Build Median 1,949ms 2,551ms 602ms
Apply Build Max 1,983ms 2,569ms 586ms

Type Performance (instantiations)

main (de87fc1) #1960 (49262cd) +/-
tailordb-basic 40,450 40,450 0
tailordb-optional 4,535 4,535 0
tailordb-relation 3,854 3,854 0
tailordb-validate 666 666 0
tailordb-hooks 5,499 5,499 0
tailordb-object 16,345 16,345 0
tailordb-enum 1,538 1,538 0
resolver-basic 12,120 12,120 0
resolver-nested 35,419 35,419 0
resolver-array 24,056 24,056 0
executor-schedule 4,489 4,489 0
executor-webhook 1,130 1,130 0
executor-record 4,542 4,542 0
executor-resolver 5,808 5,808 0
executor-operation-function 1,118 1,118 0
executor-operation-gql 1,126 1,126 0
executor-operation-webhook 1,137 1,137 0
executor-operation-workflow 1,931 1,931 0

Reported by octocov

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 makes all CLI executables resolvable via committed “compile-cache” shims under bin/, so package managers (notably pnpm) can link the workspace bins at install time even before dist/ exists. It also extends the Node on-disk compile cache warm-start optimization to the seed and ERD plugin CLIs, and removes the CI workaround that re-linked bins post-build.

Changes:

  • Move @tailor-platform/sdk’s tailor bin target from dist/cli/index.mjs to the committed bin/tailor.mjs shim (and update e2e/tests/workflow call sites).
  • Switch @tailor-platform/sdk-plugin-seed and @tailor-platform/sdk-plugin-tailordb-erd bins to committed shims under bin/ that enable the compile cache before loading dist/.
  • Simplify CI install action by removing the post-build “re-link workspace bin entries” step.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/sdk/package.json Points tailor bin at committed bin/tailor.mjs and ensures bin/ is published; updates shim generation entry path.
packages/sdk/e2e/migration.test.ts Updates CLI invocation path to use bin/tailor.mjs instead of the old dist/cli/index.mjs.
packages/sdk/e2e/function-test-run.test.ts Updates CLI invocation path and prerequisite comment to reflect the new shim/main split.
packages/sdk/e2e/compile-cache-shim.test.ts Updates assertions and paths to validate the committed shim at bin/tailor.mjs.
packages/sdk/bin/tailor.mjs Adds the committed compile-cache shim that loads ../dist/cli/main.mjs.
packages/sdk-plugin-tailordb-erd/package.json Ensures build regenerates the committed shim via politty generate-shim.
packages/sdk-plugin-tailordb-erd/bin/cli.mjs Replaces the hand-written launcher with a compile-cache-enabled shim importing ../dist/cli.js.
packages/sdk-plugin-seed/package.json Moves tailor-seed bin to ./bin/cli.mjs, publishes bin/, and regenerates shim in build.
packages/sdk-plugin-seed/bin/cli.mjs Adds committed compile-cache shim importing ../dist/index.js.
.github/workflows/pkg-pr-new.yml Updates Bun bootstrap smoke step to execute the committed shim path.
.github/actions/install-deps/action.yml Removes the post-build re-link step since bins are now committed and linkable at install time.
.changeset/cli-bin-compile-cache-shim.md Adds a changeset covering the three packages impacted by the bin/shim change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@toiroakr
toiroakr marked this pull request as ready for review August 3, 2026 05:21
@toiroakr
toiroakr requested review from a team as code owners August 3, 2026 05:21

@dqn dqn 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.

LGTM!

@dqn dqn assigned remiposo and unassigned dqn Aug 5, 2026
@toiroakr
toiroakr merged commit 64b1a21 into main Aug 7, 2026
53 checks passed
@toiroakr
toiroakr deleted the chore/politty branch August 7, 2026 00:52
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.

4 participants