chore(sdk): rename CLI binary from tailor-sdk to tailor#1557
Conversation
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 detectedLatest commit: 1b7336f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
🗺️ ERD viewer previewSelf-contained HTML built for this run — open the artifact, then view it in your browser:
|
commit: |
This comment has been minimized.
This comment has been minimized.
…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.
This comment has been minimized.
This comment has been minimized.
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.
This comment has been minimized.
This comment has been minimized.
| @@ -0,0 +1,59 @@ | |||
| import * as path from "pathe"; | |||
There was a problem hiding this comment.
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.
| !.claude/skills/llm-challenge | ||
| !.claude/skills/docs-check | ||
| !.claude/skills/tailor-sdk | ||
| !.claude/skills/tailor |
There was a problem hiding this comment.
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.
| // `@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; |
There was a problem hiding this comment.
Version-qualified package-manager forms are rewritten to tailor@..., which resolves the unrelated npm tailor package instead of @tailor-platform/sdk.
…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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…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`.
This comment has been minimized.
This comment has been minimized.
…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.
Summary
binkey inpackages/sdk/package.jsonfromtailor-sdktotailor.tailor-sdkto.tailor.github/tailor-sdk.lockto.github/tailor.lockcreate-sdktemplates accordinglytailor-sdk/totailor/(.agents/skills/tailor,.claude/skills/tailor)v2/rename-bincodemod to automate migration of user projects (tailor-sdk→tailorin scripts, shell files, CI YAML, and Markdown docs)v2/rename-binbuild entry totsdown.config.tsso the transform script is included in the published packagenpx,pnpm dlx,yarn dlx,bunx)tailor-sdk@...→@tailor-platform/sdk@...to avoid resolving the unrelated npmtailorpackage; othertailor-sdkbinary references are rewritten totailortailor-sdk@versionoutside a package-runner context now rewrites to@tailor-platform/sdk@versioninstead oftailor@versionPKG_RUNNER_REto capture optional flags (e.g.-y,--yes) between the runner and the package name sonpx -y tailor-sdk loginandnpx -y tailor-sdk@latest loginare correctly rewritten tonpx -y @tailor-platform/sdkforms(?![\w-])lookahead torename-bintransform regex to prevent partial matches liketailor-sdk-skills__tailor_sdk_expand_to__tailor_expand_tailor-sdk-prefixed references insdk-skills-shim,apply-to-deploy, andcli-renameregistry entries (bulk rename had incorrectly converted those codemod descriptions)tailorSdkBin→tailorBinandrunTailorSdk→runTailorinmigration_e2e.tsv2/rename-binfixture test suite totransform.test.ts, includingversion-qualifiedandno-matchboundary cases.gitignoreentries need manual update; lock-file references in YAML/Markdown are rewritten automaticallyv2.mdfrom updated registrycd example-appbefore the workspace creation step inquickstart.mdso thatnpx tailor loginresolves the local binary instead of the unrelated npmtailorpackagemv .tailor-sdk .tailorandgit mv .github/tailor-sdk.lock .github/tailor.lockinstructions to v2.md migration guide for a smooth upgradepostinstall.mjslog message to use@tailor-platform/sdkinstead oftailor-sdkMigration
Users upgrading to v2 can run the codemod to migrate their project files:
The
rename-bincodemod handlestailor-sdkbinary 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 becometailor..tailor-sdkdirectory paths andcreate-tailor-sdkpackage references are left unchanged.