-
chore(cli): remove dead duplicate maybe-advice-spans-usage file (#3757)
发布于
2026-07-07 12:22:23 +00:00 The captured-errors pretty-printer in the CLI has two files that export
the same
maybeAdviseSpansUsagesymbol:ts/packages/cli/src/effect-errors/pretty-print/captured-errors/maybe-advise-spans-usage.ts
(the live one, spelledadvise), re-exported by
captured-errors/index.tsand
consumed byformat-captured-error.ts.ts/packages/cli/src/effect-errors/pretty-print/captured-errors/maybe-advice-spans-usage.ts
(spelledadvice), which is never exported through the barrel and never
imported
anywhere.The
advicefile is a leftover from anadvice -> adviserename: both
files were
originally introduced identical, and only theadvisecopy was later
updated (its
leading''became' 'for color-contrast spacing) and wired up. The
advice
copy has since sat as unreferenced dead code that still returns the
stale
pre-fix value. It ships in the bundle as dead code and is a copy-paste /
confusion
hazard. This PR deletes it.No linked issue (self-identified cleanup).
Fixes #
Changes
- Delete the unused, stale duplicate
ts/packages/cli/src/effect-errors/pretty-print/captured-errors/maybe-advice-spans-usage.ts.
The livemaybe-advise-spans-usage.tsis unchanged and remains the only
exported/imported copy.
Type of change
- Bug fix
- New feature
- Refactor/Chore
- Documentation
- Breaking change
How Has This Been Tested?
Confirmed the removed file is unreferenced, then ran the CLI's checks
with the
deletion in place (local Node 26 / pnpm 10; CI will verify the pinned
toolchain):- Unreferenced check: searched the repo for both the path
maybe-advice-spans-usage
and the tokenadviceunderts/packages/cli/src/-> 0 matches. Only
the live
./maybe-advise-spans-usageis re-exported by
captured-errors/index.ts, and
format-captured-error.tsimportsmaybeAdviseSpansUsagethrough that
barrel. - Build workspace deps:
pnpm run build:packages-> all packages built. - Typecheck (required when touching CLI code, per
ts/packages/cli/AGENTS.md):
pnpm exec turbo typecheck --filter=@composio/cli --force-> pass,
fully
re-executed (no cache). A missing-module error would surface here if
anything had
imported the deleted file. - Lint:
pnpm exec eslint ts/packages/cli/src/effect-errors --ext .ts
-> clean. - Tests:
pnpm exec vitest runints/packages/cli-> 720 passed, 1
skipped,
80 files. No regressions.
Screenshots (if applicable)
N/A.
Checklist
- I have read the Code of Conduct and this PR adheres to it
- I ran linters/tests locally and they passed
- I updated documentation as needed (none needed; internal dead
code) - I added tests or explain why not applicable
- I added a changeset if this change affects published packages
Tests: not applicable. This is a pure deletion of unreachable code with
no
behavior change; nothing references the file, so there is nothing to
regression-test. The livemaybeAdviseSpansUsagepath is already
exercised by the
existing effect-errors tests viaformat-captured-error.Changeset: not needed. The CLI package is not published to npm and this
is an
internal, non-published-surface change.Additional context
Git history for the curious: both files were introduced identical in
333b03c3b;
the livemaybe-advise-spans-usage.tsdiverged infe5acc7d7(leading
''->' '
for color contrast) and became the wired-up copy, leaving
maybe-advice-spans-usage.ts
behind as the stale duplicate removed here.Co-authored-by: Alberto Schiabel jkomyno@users.noreply.github.com
下载附件
- Delete the unused, stale duplicate