fix(cli): resolve every CLI bin through a committed compile-cache shim - #1960
Conversation
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 detectedLatest commit: f9a7171 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
@tailor-platform/create-sdk
@tailor-platform/eslint-plugin-sdk
@tailor-platform/sdk
@tailor-platform/sdk-plugin-seed
@tailor-platform/sdk-plugin-tailordb-erd
commit: |
This comment has been minimized.
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".
Code Metrics Report (packages/sdk)
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
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
There was a problem hiding this comment.
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’stailorbin target fromdist/cli/index.mjsto the committedbin/tailor.mjsshim (and update e2e/tests/workflow call sites). - Switch
@tailor-platform/sdk-plugin-seedand@tailor-platform/sdk-plugin-tailordb-erdbins to committed shims underbin/that enable the compile cache before loadingdist/. - 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.
Summary
tailor-seednever reachednode_modules/.bin, sotailor seedcould not dispatch until the workspace was reinstalled after a build.politty generate-shimand commit them underbin/:@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).tailorCLI had.install-depsno longer needs to re-link workspace bins after the build.Notes
link::tailor,tailor-seed, andtailor-tailordb-erdare all linked — including when the seed package has nodist/at install time.dist/cli/index.mjs) now usebin/tailor.mjs: three e2e tests and the Bun CLI bootstrap smoke step inpkg-pr-new.yml.