Skip to content

chore(sdk): rename CLI binary from tailor-sdk to tailor#1557

Merged
dqn merged 14 commits into
v2from
chore/rename-bin
Jun 26, 2026
Merged

chore(sdk): rename CLI binary from tailor-sdk to tailor#1557
dqn merged 14 commits into
v2from
chore/rename-bin

Conversation

@toiroakr

@toiroakr toiroakr commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rename the bin key in packages/sdk/package.json from tailor-sdk to tailor
  • Change the default output directory from .tailor-sdk to .tailor
  • Rename the GitHub Actions lock file path from .github/tailor-sdk.lock to .github/tailor.lock
  • Update all CLI message strings, docs, tests, GitHub Actions workflows, and create-sdk templates accordingly
  • Rename agent skill directories from tailor-sdk/ to tailor/ (.agents/skills/tailor, .claude/skills/tailor)
  • Add new v2/rename-bin codemod to automate migration of user projects (tailor-sdktailor in scripts, shell files, CI YAML, and Markdown docs)
  • Add v2/rename-bin build entry to tsdown.config.ts so the transform script is included in the published package
  • Rewrite package-runner forms (npx, pnpm dlx, yarn dlx, bunx) tailor-sdk@...@tailor-platform/sdk@... to avoid resolving the unrelated npm tailor package; other tailor-sdk binary references are rewritten to tailor
  • Fix version-qualified fallback: tailor-sdk@version outside a package-runner context now rewrites to @tailor-platform/sdk@version instead of tailor@version
  • Extend PKG_RUNNER_RE to capture optional flags (e.g. -y, --yes) between the runner and the package name so npx -y tailor-sdk login and npx -y tailor-sdk@latest login are correctly rewritten to npx -y @tailor-platform/sdk forms
  • Add (?![\w-]) lookahead to rename-bin transform regex to prevent partial matches like tailor-sdk-skills
  • Fix completion test assertion pattern from __tailor_sdk_expand_ to __tailor_expand_
  • Restore tailor-sdk-prefixed references in sdk-skills-shim, apply-to-deploy, and cli-rename registry entries (bulk rename had incorrectly converted those codemod descriptions)
  • Rename tailorSdkBintailorBin and runTailorSdkrunTailor in migration_e2e.ts
  • Add v2/rename-bin fixture test suite to transform.test.ts, including version-qualified and no-match boundary cases
  • Clarify rename-bin description: only .gitignore entries need manual update; lock-file references in YAML/Markdown are rewritten automatically
  • Regenerate v2.md from updated registry
  • Move cd example-app before the workspace creation step in quickstart.md so that npx tailor login resolves the local binary instead of the unrelated npm tailor package
  • Add mv .tailor-sdk .tailor and git mv .github/tailor-sdk.lock .github/tailor.lock instructions to v2.md migration guide for a smooth upgrade
  • Fix postinstall.mjs log message to use @tailor-platform/sdk instead of tailor-sdk

Migration

Users upgrading to v2 can run the codemod to migrate their project files:

npx @tailor-platform/sdk-codemod --from 1.x --to 2.0.0

The rename-bin codemod handles tailor-sdk binary invocations in package.json scripts, shell scripts, YAML, and Markdown. Package-runner forms (npx tailor-sdk@..., pnpm dlx tailor-sdk@..., etc.) are rewritten to @tailor-platform/sdk@...; version-qualified standalone forms (tailor-sdk@latest) also become @tailor-platform/sdk@latest; unversioned binary references become tailor. .tailor-sdk directory paths and create-tailor-sdk package references are left unchanged.

Rename the binary key in package.json from tailor-sdk to tailor,
update the default output directory from .tailor-sdk to .tailor,
and rename the GitHub Actions lock file path from .github/tailor-sdk.lock
to .github/tailor.lock.

All CLI message strings, docs, tests, GitHub Actions workflows,
create-sdk templates, and config files are updated accordingly.
Adds the v2/rename-bin codemod to automate migration of user projects.
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1b7336f

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

This PR includes changesets to release 3 packages
Name Type
@tailor-platform/sdk Major
@tailor-platform/sdk-codemod Patch
@tailor-platform/create-sdk Major

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

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

🗺️ ERD viewer preview

Self-contained HTML built for this run — open the artifact, then view it in your browser:

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 1b7336f

@github-actions

This comment has been minimized.

This comment was marked as resolved.

…tadata

Bulk rename incorrectly converted text strings in sdk-skills-shim,
apply-to-deploy, and cli-rename registry entries that should have
remained as tailor-sdk-* (those codemods migrate tailor-sdk v1 CLI
invocations, not the binary name itself). Update rename-bin description
to note .tailor-sdk/ to .tailor/ manual path migration. Rename
tailorSdkBin to tailorBin and runTailorSdk to runTailor in
migration_e2e.ts. Regenerate v2.md from updated registry.
@github-actions

This comment has been minimized.

This comment was marked as resolved.

Add lookahead `(?![\w-])` to TAILOR_SDK_RE so that hyphenated
identifiers like `tailor-sdk-skills` are not partially matched and
incorrectly rewritten to `tailor-skills`. Aligns with the pattern
used in apply-to-deploy and cli-rename transforms.

Clarify the rename-bin description: only `.gitignore` entries need
manual update (the codemod skips paths preceded by a dot); references
to lock-file paths in YAML and Markdown are rewritten automatically.
Regenerate v2.md.
@github-actions

This comment has been minimized.

This comment was marked as resolved.

@toiroakr
toiroakr marked this pull request as ready for review June 25, 2026 14:30
@toiroakr
toiroakr requested a review from a team as a code owner June 25, 2026 14:30
@@ -0,0 +1,59 @@
import * as path from "pathe";

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.

This transform is registered but not added to packages/sdk-codemod/tsdown.config.ts, so the published package will not contain the script that v2/rename-bin loads.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed cdfa2c7

Comment thread .gitignore
!.claude/skills/llm-challenge
!.claude/skills/docs-check
!.claude/skills/tailor-sdk
!.claude/skills/tailor

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.

The project skill adapters still exist as .agents/skills/tailor-sdk and .claude/skills/tailor-sdk, and both now point at the removed packages/sdk/agent-skills/tailor-sdk target.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed cdfa2c7

// `@2.0.0`, etc.). Lookbehind excludes `.tailor-sdk` (preceded by `.`) and
// `create-tailor-sdk` (preceded by `-`). Lookahead excludes trailing `-word`
// (e.g. `tailor-sdk-skills`) to avoid partial-match rewrites.
const TAILOR_SDK_RE = /(?<![.\w-])tailor-sdk(?![\w-])(@[^\s'"`;|&)]+)?/g;

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.

Version-qualified package-manager forms are rewritten to tailor@..., which resolves the unrelated npm tailor package instead of @tailor-platform/sdk.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed b216c23

@dqn dqn assigned toiroakr and unassigned dqn Jun 26, 2026
toiroakr added 2 commits June 26, 2026 16:10
…mlinks and tests

- Add v2/rename-bin transform entry to tsdown.config.ts so the script is included in the published package
- Rewrite `npx tailor-sdk@...` to `npx @tailor-platform/sdk@...` to avoid resolving the unrelated npm `tailor` package
- Add NPX_RE regex to handle npx invocations separately from the general binary rename
- Update test fixtures to reflect correct npx rewrite (basic-shell, basic-yaml, version-qualified)
- Add v2/rename-bin to transform.test.ts fixture test suite
- Rename .agents/skills/tailor-sdk and .claude/skills/tailor-sdk symlinks to tailor
- Regenerate v2 migration docs
# Conflicts:
#	packages/sdk-codemod/src/registry.ts
#	packages/sdk/docs/cli/tailordb.md
#	packages/sdk/docs/migration/v2.md
#	packages/sdk/scripts/perf/runtime-perf.sh
#	packages/sdk/src/cli/shared/skills-installer.ts
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

This comment was marked as resolved.

@github-actions

This comment has been minimized.

This comment was marked as resolved.

@github-actions

This comment has been minimized.

This comment was marked as resolved.

…r-platform/sdk

Previously `tailor-sdk@latest` without a package-runner prefix was rewritten
to `tailor@latest`, which resolves the unrelated CSS Sprites Generator package.
Now any version-pinned form falls back to `@tailor-platform/sdk@version`, so
`npx -y tailor-sdk@latest` and bare `tailor-sdk@1.0.0` both produce the
correct package name. Unversioned `tailor-sdk` still becomes `tailor`.
@github-actions

This comment has been minimized.

This comment was marked as resolved.

…kage rewrite

`npx -y tailor-sdk login` was falling through to TAILOR_SDK_RE, producing
`npx -y tailor login`, which downloads the unrelated npm `tailor` package.
Extend PKG_RUNNER_RE to include optional short/long flags in the runner
capture group so the replacement preserves them and produces
`npx -y @tailor-platform/sdk login` as expected.
@github-actions

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (e1c9e49) #1557 (128683e) +/-
Coverage 69.6% 70.7% +1.0%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Details
  |                    | main (e1c9e49) | #1557 (128683e) |  +/-  |
  |--------------------|----------------|-----------------|-------|
+ | Coverage           |          69.6% |           70.7% | +1.0% |
  |   Files            |            422 |             417 |    -5 |
  |   Lines            |          15093 |           15098 |    +5 |
+ |   Covered          |          10516 |           10676 |  +160 |
+ | Code to Test Ratio |          1:0.4 |           1:0.4 |  +0.0 |
  |   Code             |         102209 |          102537 |  +328 |
+ |   Test             |          45569 |           46347 |  +778 |

Code coverage of files in pull request scope (66.2% → 68.5%)

Details
Files Coverage +/- Status
packages/sdk-codemod/src/registry.ts 0.0% -60.0% modified
packages/sdk/example/tailordb/user.ts 0.0% -100.0% affected
packages/sdk/llm-challenge/src/types.ts 0.0% -100.0% affected
packages/sdk/src/cli/commands/api/index.ts 94.7% 0.0% modified
packages/sdk/src/cli/commands/api/inspect.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/api/proto-reflect.ts 98.0% 0.0% modified
packages/sdk/src/cli/commands/authconnection/authorize.ts 3.7% 0.0% modified
packages/sdk/src/cli/commands/deploy/test_fixtures/tailor.config.generators-compat.ts 0.0% -100.0% affected
packages/sdk/src/cli/commands/deploy/test_fixtures/tailor.config.plugins-compat.ts 0.0% -100.0% affected
packages/sdk/src/cli/commands/deploy/auth-invoker.ts 0.0% -100.0% affected
packages/sdk/src/cli/commands/deploy/config-id-injector.ts 98.9% 0.0% modified
packages/sdk/src/cli/commands/deploy/confirm.ts 73.0% 0.0% modified
packages/sdk/src/cli/commands/deploy/deploy.ts 83.4% 0.0% modified
packages/sdk/src/cli/commands/deploy/executor.ts 80.1% +0.1% affected
packages/sdk/src/cli/commands/deploy/invoker.ts 100.0% +100.0% affected
packages/sdk/src/cli/commands/deploy/tailordb/index.ts 75.1% 0.0% modified
packages/sdk/src/cli/commands/executor/list.ts 63.6% 0.0% modified
packages/sdk/src/cli/commands/executor/webhook.ts 72.7% 0.0% modified
packages/sdk/src/cli/commands/function/logs.ts 39.7% -4.6% affected
packages/sdk/src/cli/commands/function/test-run.ts 56.8% -3.4% modified
packages/sdk/src/cli/commands/generate/plugin-executor-generator.ts 2.3% 0.0% modified
packages/sdk/src/cli/commands/generate/plugin-type-generator.ts 7.1% 0.0% modified
packages/sdk/src/cli/commands/generate/seed/bundler.ts 92.3% 0.0% modified
packages/sdk/src/cli/commands/generate/service.ts 58.3% -9.9% affected
packages/sdk/src/cli/commands/login.ts 7.8% -0.2% affected
packages/sdk/src/cli/commands/machineuser/token.ts 76.1% 0.0% modified
packages/sdk/src/cli/commands/profile/create.ts 75.0% +70.0% affected
packages/sdk/src/cli/commands/profile/list.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/profile/update.ts 89.3% +0.4% affected
packages/sdk/src/cli/commands/setup/check.ts 97.8% 0.0% modified
packages/sdk/src/cli/commands/setup/generate.ts 94.4% 0.0% modified
packages/sdk/src/cli/commands/setup/lock.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/setup/templates.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/skills/install.ts 57.1% 0.0% modified
packages/sdk/src/cli/commands/tailordb/erd/export.ts 4.3% 0.0% modified
packages/sdk/src/cli/commands/tailordb/erd/schema.ts 90.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/erd/serve.ts 18.7% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/bundler.ts 91.6% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/db-types-generator.ts 96.5% -0.8% affected
packages/sdk/src/cli/commands/tailordb/migrate/generate.ts 0.8% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/script.ts 2.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/sync.ts 90.5% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/template-generator.ts 89.3% 0.0% modified
packages/sdk/src/cli/commands/user/current.ts 72.7% 0.0% modified
packages/sdk/src/cli/commands/user/list.ts 75.0% 0.0% modified
packages/sdk/src/cli/commands/user/pat/create.ts 8.3% 0.0% modified
packages/sdk/src/cli/commands/user/pat/delete.ts 11.1% 0.0% modified
packages/sdk/src/cli/commands/user/pat/list.ts 4.1% 0.0% modified
packages/sdk/src/cli/commands/user/pat/update.ts 7.6% 0.0% modified
packages/sdk/src/cli/commands/user/switch.ts 87.5% +73.2% modified
packages/sdk/src/cli/commands/workflow/start.ts 83.6% +12.5% modified
packages/sdk/src/cli/commands/workspace/create.ts 83.3% 0.0% modified
packages/sdk/src/cli/crashreport/index.ts 68.1% 0.0% modified
packages/sdk/src/cli/crashreport/report.ts 88.0% +2.2% affected
packages/sdk/src/cli/index.ts 27.2% -6.1% modified
packages/sdk/src/cli/query/errors.ts 83.3% 0.0% modified
packages/sdk/src/cli/query/index.ts 51.7% 0.0% modified
packages/sdk/src/cli/services/executor/service.ts 58.9% 0.0% modified
packages/sdk/src/cli/shared/auth-namespace.ts 100.0% +100.0% affected
packages/sdk/src/cli/shared/config-loader.ts 74.1% -8.2% affected
packages/sdk/src/cli/shared/context.ts 80.8% +16.8% modified
packages/sdk/src/cli/shared/dist-dir.ts 100.0% 0.0% modified
packages/sdk/src/cli/shared/errors.ts 52.9% 0.0% modified
packages/sdk/src/cli/shared/readonly-guard.ts 100.0% 0.0% modified
packages/sdk/src/cli/shared/register-ts-hook.ts 100.0% +100.0% affected
packages/sdk/src/cli/shared/skills-installer.ts 93.3% 0.0% modified
packages/sdk/src/cli/shared/stack-trace.ts 95.7% 0.0% modified
packages/sdk/src/cli/shared/type-generator.ts 82.1% 0.0% modified
packages/sdk/src/cli/shared/user-agent.ts 100.0% 0.0% modified
packages/sdk/src/cli/telemetry/index.ts 100.0% 0.0% modified
packages/sdk/src/cli/telemetry/interceptor.ts 100.0% 0.0% modified
packages/sdk/src/cli/ts-hook.mjs 84.4% +84.4% affected
packages/sdk/src/configure/services/auth/index.ts 66.6% -8.4% affected
packages/sdk/src/configure/services/auth/types.ts 0.0% 0.0% modified
packages/sdk/src/configure/services/tailordb/permission.ts 100.0% 0.0% modified
packages/sdk/src/configure/services/tailordb/schema.ts 81.6% +0.5% affected
packages/sdk/src/configure/services/workflow/job.ts 90.0% +4.2% affected
packages/sdk/src/configure/services/workflow/registry.ts 95.0% +11.1% affected
packages/sdk/src/configure/services/workflow/test-env-key.ts 100.0% +6.6% affected
packages/sdk/src/configure/services/workflow/workflow.ts 66.6% +6.6% affected
packages/sdk/src/parser/service/idp/schema.ts 93.9% -0.2% affected
packages/sdk/src/parser/service/tailordb/field.ts 96.4% +1.1% affected
packages/sdk/src/plugin/builtin/seed/index.ts 0.0% -1.6% affected
packages/sdk/src/plugin/manager.ts 64.6% 0.0% modified
packages/sdk/src/vitest/mock.ts 95.2% +2.1% affected
packages/sdk/src/vitest/workflow-local.ts 79.4% +79.4% affected
packages/sdk/src/vitest/workflow-runtime.ts 66.6% +26.6% affected

SDK Configure Bundle Size

main (e1c9e49) #1557 (128683e) +/-
configure-index-size 20.14KB 21.24KB 1.1KB
dependency-chunks-size 47.71KB 35.38KB -12.33KB
total-bundle-size 67.85KB 56.62KB -11.23KB

Runtime Performance

main (e1c9e49) #1557 (128683e) +/-
Generate Median 3,289ms 3,157ms -132ms
Generate Max 3,304ms 3,204ms -100ms
Apply Build Median 3,341ms 3,209ms -132ms
Apply Build Max 3,426ms 3,244ms -182ms

Type Performance (instantiations)

main (e1c9e49) #1557 (128683e) +/-
tailordb-basic 36,391 36,160 -231
tailordb-optional 3,841 3,841 0
tailordb-relation 6,012 6,012 0
tailordb-validate 2,566 2,566 0
tailordb-hooks 5,777 5,777 0
tailordb-object 12,136 12,136 0
tailordb-enum 2,462 2,462 0
resolver-basic 9,438 9,413 -25
resolver-nested 26,125 26,100 -25
resolver-array 18,201 18,176 -25
executor-schedule 4,268 4,255 -13
executor-webhook 907 894 -13
executor-record 6,788 6,775 -13
executor-resolver 4,417 4,401 -16
executor-operation-function 899 886 -13
executor-operation-gql 903 890 -13
executor-operation-webhook 918 905 -13
executor-operation-workflow 1,747 1,726 -21

Reported by octocov

This comment was marked as resolved.

@toiroakr toiroakr assigned dqn and unassigned toiroakr Jun 26, 2026

@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 merged commit 20c2295 into v2 Jun 26, 2026
50 checks passed
@dqn
dqn deleted the chore/rename-bin branch June 26, 2026 15:46
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.

3 participants