Skip to content

@W-23123159 - feat: delete the sf metadata enrich CLI command#62

Closed
kumar-aman2-general wants to merge 3 commits into
salesforcecli:mainfrom
kumar-aman2-general:W-23123159-delete-enrich-cli
Closed

@W-23123159 - feat: delete the sf metadata enrich CLI command#62
kumar-aman2-general wants to merge 3 commits into
salesforcecli:mainfrom
kumar-aman2-general:W-23123159-delete-enrich-cli

Conversation

@kumar-aman2-general

Copy link
Copy Markdown
Collaborator

What & Why

Retires the preview-state sf metadata enrich CLI command in favor of the sanctioned portable Skill (the supported migration target). This plugin's only command was metadata enrich, so retiring it effectively guts the plugin: the command and everything that existed solely to support it are removed. Resolves W-23123159.

Changes

  • Deleted the command: src/commands/metadata/enrich.ts.
  • Deleted its message bundles: messages/metadata.enrich.md, messages/metrics.md, messages/errors.md.
  • Deleted its result schema: schemas/metadata-enrich.json.
  • Deleted its tests: test/nuts/enrich.nut.ts, test/unit/enrichmentRecords.test.ts, test/unit/componentProcessor.test.ts.
  • Emptied command-snapshot.json ([]) and removed the metadata oclif topic from package.json — no dangling metadata:enrich registration.
  • Dropped the now-unused @salesforce/metadata-enrichment dependency, plus stale /messages and /schemas entries from the package files array.
  • Added a placeholder smoke test so the test/lint pipeline stays coherent (dev-scripts lints src test).
  • Updated README.md with a deprecation/retirement notice pointing users to the Skill.

Acceptance criteria

  • sf metadata enrich command removed; oclif command/topic registration and snapshot cleaned; no dangling metadata:enrich.
  • Deprecate + unpublish the npm package @salesforce/plugin-metadata-enrichment — ops step requiring npm publish rights (see below).
  • Docs / examples updated to point users to the Skill.

Required follow-up ops step (npm)

Per the story, the command and its hosting package retire together. The npm side can't be done from this PR (needs publish rights):

npm deprecate @salesforce/plugin-metadata-enrichment "Retired in favor of the portable Skill"
npm unpublish @salesforce/plugin-metadata-enrichment --force

Verification

  • yarn build (compile + lint) — passes.
  • yarn test:only — passes (smoke test).
  • bin/dev.js snapshot:compare (deprecation policy) — "No changes have been detected".
  • Repo-wide grep — no remaining metadata:enrich, MetadataEnrich, or @salesforce/metadata-enrichment references outside the README deprecation notice and CHANGELOG.

🤖 Generated with Claude Code

Retire the preview-state `sf metadata enrich` CLI command in favor of the
sanctioned portable Skill migration target. This plugin's only command was
`metadata enrich`, so the command and everything that existed solely to
support it are removed.

- Delete src/commands/metadata/enrich.ts (the command)
- Delete its message bundles (metadata.enrich.md, metrics.md, errors.md)
- Delete its result schema (schemas/metadata-enrich.json)
- Delete its tests (enrich.nut.ts, enrichmentRecords.test.ts, componentProcessor.test.ts)
- Empty command-snapshot.json and remove the `metadata` oclif topic
- Drop the now-unused @salesforce/metadata-enrichment dependency
- Drop stale /messages and /schemas entries from package "files"
- Add a placeholder smoke test so the test pipeline stays coherent
- Update README with a deprecation/retirement notice pointing to the Skill

The hosting npm package @salesforce/plugin-metadata-enrichment must be
deprecated and unpublished as a separate ops step (needs npm publish rights):
  npm deprecate @salesforce/plugin-metadata-enrichment "Retired in favor of the portable Skill"
  npm unpublish @salesforce/plugin-metadata-enrichment --force

Verified: build (compile + lint), unit tests, and snapshot deprecation-policy
check all pass; no dangling metadata:enrich references.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kumar-aman2-general

Copy link
Copy Markdown
Collaborator Author

Heads-up for reviewers: one follow-up step + a downstream dependency

This PR removes the sf metadata enrich command and everything that supported it. Two things worth knowing before/after merge:

1. There's an npm step that can't be done in this PR.
The story (W-23123159) says the command and its hosting npm package should retire together. A PR can only delete the code — it can't touch npm. So once this merges, someone with publish rights needs to run:

npm deprecate @salesforce/plugin-metadata-enrichment "Retired in favor of the portable Skill"
npm unpublish @salesforce/plugin-metadata-enrichment --force

Note: unpublish only works within 72h of a publish, so for the already-published version it'll most likely be rejected — in practice deprecate is the realistic end state. Worth confirming with whoever owns the npm org.

2. Merging this unblocks another story.
W-23123169 ("delete the @salesforce/metadata-enrichment shared client library") is gated on nothing depending on the library anymore. This plugin is still one of those dependents (@salesforce/metadata-enrichment: ^0.0.18), so the library can't be retired until this PR merges and a new plugin version is published (or the package stops being published). The other dependent — the MCP provider — is handled in salesforcecli/mcp#470.

So the order is: merge this + MCP #470 → publish → then W-23123169 can proceed.

Nothing in the code here is blocked — build, unit tests, lint, and the snapshot deprecation-policy check all pass, and the CLA is signed. Just flagging the human/ops steps so they don't fall through the cracks.

Comment thread messages/errors.md
@@ -1,11 +0,0 @@
# errors.component.not.found

Component not found in project.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

.

@william-xie-sf

Copy link
Copy Markdown
Collaborator

Have you considered just archiving the repository (removing all credentials and publish steps) and doing the npm unpublish so it can't be installed anymore? Is there any value to removing the code when it can just be accessed in the commit history?

@kumar-aman2-general

kumar-aman2-general commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Have you considered just archiving the repository (removing all credentials and publish steps) and doing the npm unpublish so it can't be installed anymore? Is there any value to removing the code when it can just be accessed in the commit history?

Hey @william-xie-sf , I looked into both:

npm unpublish: 0.1.3 was published ~29 days ago, so it's outside npm's 72-hour unpublish window. Past that, npm only allows it under narrow conditions and for @salesforce-scoped packages it usually needs the npm org owner and is often restricted so I don't think "unpublish so it can't be installed" is reliably available. deprecate is the realistic end state. Happy to defer to whoever owns the npm org to confirm.

Archiving the repo: fully agree as a follow-up, it's a single-command plugin, no reason to keep it writable once this lands. I'd treat it as complementary rather than a replacement, since archiving alone leaves main showing a working command and leaves published 0.1.3 still installable.

"Why delete the code if git history keeps it?": fair point on history, but the deletion isn't about hiding the code, it's the prerequisite for the next step. 0.1.3 still depends on @salesforce/metadata-enrichment ^0.0.18, and W-23123169 (retire that shared library) is gated on nothing depending on it. Deprecating/archiving doesn't change what the published artifact depends on only publishing a new version with the dependency removed does, and that needs the code gone first. Unpublish would also satisfy the gate, but per above it's likely unavailable.

Suggested order: merge this + mcp#470 → publish a new plugin version (dependency dropped) → deprecate on npm → archive the repo. Open to folding the archive into this if you'd prefer.

Comment thread command-snapshot.json Outdated
"plugin": "@salesforce/plugin-metadata-enrichment"
}
]
[]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file can be deleted

Comment thread README.md Outdated
```bash
sf plugins install @salesforce/plugin-metadata-enrichment@x.y.z
```
> **⚠️ Deprecated and retired.** The `sf metadata enrich` CLI command and its npm package `@salesforce/plugin-metadata-enrichment` have been retired. Conversational and agent-assisted metadata enrichment is now served by the sanctioned portable Skill, which is the supported migration target. This repository no longer ships a CLI command.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Delete it?

Comment thread package.json Outdated
@@ -10,7 +10,6 @@
"@oclif/table": "^0.5.1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file can be deleted?

@ShipraShreyasi

Copy link
Copy Markdown
Collaborator

Can we do npm unpublish before deleting it?

Address reviewer feedback (ShipraShreyasi, william-xie-sf): fully retire the
plugin rather than leaving a functional-but-command-less shell.

- Remove all runtime dependencies (were used only by the deleted command)
- Delete command-snapshot.json and its supporting tooling
  (@oclif/plugin-command-snapshot devPlugin/dep, test:deprecation-policy
  and test:json-schema wireit steps, snapshot refs in format)
- Trim README to the deprecation notice + Issues (drop Build/Contributing/
  Commands boilerplate that contradicted "no longer ships a command")

Build, lint, and the full test suite pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kumar-aman2-general

kumar-aman2-general commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @ShipraShreyasi, good call. I pushed a commit that fully guts the plugin instead of leaving a working shell:

  • package.json: removed all the runtime deps since they were only there for the deleted command, so it's empty now
  • command-snapshot.json: deleted it, plus the snapshot tooling that went with it (the command-snapshot devPlugin and the two wireit test steps that used it) so CI doesn't break
  • README: cut it down to just the deprecation notice and Issues. Dropped the Build/Contributing/Commands stuff since it didn't make sense anymore

Build, lint and tests all pass.

On unpublishing before deleting: unpublish hits npm directly so the order doesn't really matter, but 0.1.3 is about a month old now and npm only lets you unpublish within 72 hours, so it'll probably get rejected anyway and needs whoever owns the npm org. So deprecate is realistically the end state, as a follow-up after merge. Happy to be corrected if someone knows the npm side better.

cc: @william-xie-sf

Comment thread test/unit/smoke.test.ts Outdated
it('ships no commands', () => {
expect(true).to.equal(true);
});
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is showing as a new file. Please delete it

The retired plugin ships no commands, so the placeholder smoke test added
to keep the mocha pipeline coherent is unnecessary. Per review feedback,
delete test/unit/smoke.test.ts along with the now-empty test/ scaffolding
(tsconfig, eslintrc), and drop the test:only / test:compile wireit targets
and test-dir globs from lint/format. The test pipeline now runs
command-reference + lint + link-check, which stay green with no commands
and no unit tests. yarn build and yarn test pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kumar-aman2-general

Copy link
Copy Markdown
Collaborator Author

Superseded by #65, re-opened from a branch in this repo so build verification and test runs are invoked (this one was from a fork, where CI does not fire). Closing in favor of #65.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants