Skip to content

fix(cli): advise keeping one dependency when two packages declare one provider ID - #12215

Closed
josephfarina wants to merge 4 commits into
mainfrom
josephfarina/provider-twin-advice
Closed

josephfarina wants to merge 4 commits into
mainfrom
josephfarina/provider-twin-advice

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What changes

When two installed packages claim one provider ID, the CLI sets the second aside and warns:

[email protected] and [email protected] both claim provider ID "pkg-a". [email protected] loads first and is used; [email protected] contributes nothing until one package changes its providerId.

That advice fits a package that claims another package's name. When both manifests declare the ID themselves, the two packages may be one integration published under two names (installing both loads it twice), or two unrelated packages that chose the same ID. The CLI cannot tell these apart, so the warning now names both cases:

… [email protected] contributes nothing. Both manifests declare this provider ID. If they are one integration installed under two names, keep one of the two dependencies; otherwise one package must change its providerId.

astryx doctor's provider-identity fix follows the same rule: the two-case advice when every conflict is declared by both manifests, the current rename advice when none is, and both fixes, each named for the conflicts it fits, when a project has some of each. The signal is that each manifest writes providerId (the loader already keeps the keys a manifest declares); the conflict record carries bothDeclare for doctor.

A documented rename, where only the renamed package sets providerId, keeps today's advice, as does a second copy of a package that takes its ID from its name. An npm-alias copy at the same name and version is already one package and gets no warning; an alias copy at another version of a package whose manifest writes providerId gets the two-case advice. Which package is used, which is set aside, and every JSON shape and exit code stay the same; only message and fix text change.

Testing

  • provider-resolution.test.mjs: both manifests declare the ID → the two-case advice and bothDeclare: true; one declares it (either order) or neither does → the current advice, word for word; a conflict where only the second package's manifest declares the ID carries no bothDeclare.
  • doctor.test.mjs (checkProviderIdentity): message and fix pinned for all-both-declare, none, and a mixed project.
  • Red arm: with the source changes reverted, each new case fails.
  • vitest run --project node over foundation/integrations, api/doctor, api/integration: 51 files, 1,288 tests pass.
  • prettier is clean on provider-resolution.mjs, provider-resolution.test.mjs and doctor.mjs. integrations.mjs and doctor.test.mjs were not prettier-clean before this change; the lines this change adds there match prettier's output. eslint is clean on the changed files.

… provider ID

When two installed packages claim the same provider ID, the second is set aside
and the warning says it contributes nothing "until one package changes its
providerId". That advice is wrong when both manifests declare the ID
themselves: the packages then say they are one integration published under two
names (a renamed package and the old name, say), and changing an ID would make
both load. The warning now names that case and says to keep one of the two
dependencies. The signal is exact: each manifest writes `providerId`, rather
than taking it from its package name. A package that claims another package's
name-derived ID keeps the current advice.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 7:36am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 7:46 AM UTC

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c336f39

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot 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.

Requesting changes: keep-one advice for twin installs is a good direction, but astryx doctor now contradicts itself for the case it targets, and the description's claims about the signal do not hold.

  • astryx doctor's provider-identity check keeps its fix "Give each integration its own providerId" (packages/cli/api/doctor/doctor.mjs:1416-1418) beside the new "keep one of the two dependencies" message, so the changeset's "instead of saying to change a providerId" is not true for doctor: give the fix the same two cases and pin message and fix in a checkProviderIdentity test.
  • The description calls "both manifests declare the ID" an exact signal for one integration under two names, such as a renamed package beside its old name, but the documented rename (packages/cli/authoring/integration/integration.doc.mjs:25, where only the renamed package sets providerId) and one package installed at two versions under an npm alias both keep the old advice, while an unrelated package that claims a name its owner writes explicitly is told they are one integration: narrow the description and the message to what the condition proves, or use a signal that holds.
  • The description says prettier is clean on the changed files, but prettier --check flags packages/cli/foundation/integrations/provider-resolution.test.mjs:23-25 (lines that predate this change): run prettier --write on the file or narrow the claim.

The new unit tests fail on the base and pass on the head, and the integration, doctor and integration-command suites pass.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: when both manifests declare the ID, doctor and the warnings say to keep one of the two dependencies: verified (provider-resolution.mjs:217-220, new unit test).
  • Claim: this replaces the advice to change a providerId: false for doctor's provider-identity fix (doctor.mjs:1416-1418).
  • Claim: the quoted current message: verified against the base resolver.
  • Claim: both manifests declaring means one integration under two names, for example a renamed package beside its old name: false (the documented rename keeps the old advice).
  • Claim: the signal is exact and the loader already keeps the keys a manifest declares: loader part verified (integrations.mjs:283-285); exact is false.
  • Claim: precedence, JSON shapes and exit codes are unchanged and only the message changes: verified.
  • Claim: new cases for both, one (either order) and neither declaring: verified (provider-resolution.test.mjs:307-344).
  • Claim: the both-declare case fails with the change reverted and the one-declares case passes: verified by a base run.
  • Claim: 51 files and 1,284 tests pass in the three suites: verified, 51 files and 1,285 tests pass.
  • Claim: prettier and eslint are clean on the changed files: eslint verified; prettier false for the test file.
  • File .changeset/provider-twin-advice.md: finding (its replacement claim is false for doctor).
  • File packages/cli/foundation/integrations/provider-resolution.mjs: findings on the doctor fix and the signal.
  • File packages/cli/foundation/integrations/provider-resolution.test.mjs: tests clear; finding on the formatting claim.

Automated review (maintainer link)

Comment thread .changeset/provider-twin-advice.md Resolved
…or's fix too

Two packages that both declare the same provider ID may be one integration
under two names, or two unrelated packages that chose the same ID. The warning
now says both: if they are one integration installed under two names, keep one
of the two dependencies; otherwise one package must change its providerId.
`astryx doctor`'s `provider-identity` fix gives the same two cases when every
conflict is between packages that both declare the ID, and keeps the current
fix otherwise. The conflict record carries `bothDeclare` so doctor reads the
case rather than the message. Tests pin the message and the fix for both
cases, and the resolver test file is prettier-clean.

@astracat-bot astracat-bot Bot 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.

Requesting changes: the twin-install advice now reads as two cases in both the warning and astryx doctor's fix, which resolves the earlier requested changes; one doctor case and two description claims remain.

  • In a project that holds a twin conflict and also a conflict where only one manifest declares the ID, checkProviderIdentity falls back to "Give each integration its own providerId" (packages/cli/api/doctor/doctor.mjs:1416-1425), which contradicts the twin's keep-one message and the changeset's promise about doctor's fix: give both fix sentences when only some conflicts carry bothDeclare (or narrow the changeset), and pin that mixed case in doctor.test.mjs.
  • The description says prettier is clean on the changed source files, but prettier --check flags packages/cli/foundation/integrations/integrations.mjs (lines 120, 165, 200, 231 and 283, which predate this change): narrow the claim to the files or lines it holds for.
  • The description says an npm-alias copy keeps today's advice, but an alias copy of a package whose manifest writes providerId gets the two-case advice: qualify it as an alias of a package that takes its ID from its name.

Non-blocking: assert __providerConflict.bothDeclare in the resolver's both-declare test, since the doctor test builds that flag by hand.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Changeset: when both manifests declare one provider ID, the warning gives the two cases: verified (provider-resolution.mjs:217-223, resolver test).
  • Changeset: doctor's fix gives the same two cases: verified when every conflict is between packages that both declare the ID; false in a project that also has a one-declares conflict.
  • Changeset: a provider ID taken from a package name keeps the old advice: verified (resolver test; a documented rename and a same-package alias keep it).
  • Description: the current and the new message texts: verified against the base and head resolver.
  • Description: the CLI cannot tell one integration under two names from two unrelated packages, so the warning names both cases: verified (provider-resolution.mjs:217-223).
  • Description: doctor's fix gives the two cases when every conflict is between packages that both declare the ID, and the current fix otherwise: verified (doctor.mjs:1416-1425).
  • Description: the signal is each manifest writing providerId, which the loader already records, and the conflict record carries bothDeclare for doctor: verified (integrations.mjs:285-286, provider-resolution.mjs:241).
  • Description: a documented rename keeps today's advice: verified. An npm-alias copy keeps it: false when the package's manifest writes providerId.
  • Description: which package is used or set aside, JSON shapes and exit codes are unchanged; only message and fix text change: verified.
  • Description: the resolver and doctor tests pin message and fix for both cases: verified (provider-resolution.test.mjs:305-342, doctor.test.mjs:515-576).
  • Description: with the source changes reverted, both new cases fail: verified on the base.
  • Description: 51 files and 1,286 tests pass in the three suites: verified.
  • Description: prettier and eslint are clean on the changed source files and the resolver test file: eslint verified; prettier false for integrations.mjs.
  • File .changeset/provider-twin-advice.md: finding (doctor's fix in a project with mixed conflicts).
  • File packages/cli/api/doctor/doctor.mjs: finding (mixed-conflict fix).
  • File packages/cli/api/doctor/doctor.test.mjs: clear; the mixed case belongs here once fixed.
  • File packages/cli/foundation/integrations/integrations.mjs: clear (JSDoc only); the prettier claim about it is false.
  • File packages/cli/foundation/integrations/provider-resolution.mjs: clear.
  • File packages/cli/foundation/integrations/provider-resolution.test.mjs: clear; non-blocking note on asserting bothDeclare.

Automated review (maintainer link)

Comment thread packages/cli/api/doctor/doctor.mjs Resolved
…onflict

`astryx doctor`'s `provider-identity` fix chose the two-case advice only when
every conflict was declared by both manifests, so a project with one such
conflict and one other got only the rename advice. It now names both fixes, each
for the conflicts it fits. Tests pin the mixed case and that the resolver marks
`bothDeclare` only on a conflict both manifests declare.

@astracat-bot astracat-bot Bot 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.

Requesting changes: the mixed-project astryx doctor fix, the prettier claim and the npm-alias claim from the last review are all fixed; one description claim about the resolver test remains.

  • The description says provider-resolution.test.mjs checks that a conflict where only one manifest declares the ID (in either order), or neither does, carries no bothDeclare, but the test 'marks a conflict both manifests declare, and only that one' checks that for one pairing only (packages/cli/foundation/integrations/provider-resolution.test.mjs:325-328): add the same toBeUndefined() check for the reverse pairing and the neither pairing, or narrow the bullet.

The code itself behaves as described for every pairing, so either edit clears this.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Changeset: when both manifests declare one provider ID, the warning and doctor's fix give the two cases: verified, mixed projects included (provider-resolution.mjs:217-223, doctor.mjs:1393-1403).
  • Changeset: a provider ID taken from a package name keeps the old advice: verified (documented rename and a name-derived second copy keep it).
  • Description: the current and the new warning texts: verified against the base and head resolver.
  • Description: the CLI cannot tell one integration under two names from two unrelated packages, so the warning names both cases: verified (conditional wording, provider-resolution.mjs:219-223).
  • Description: doctor's fix gives the two cases when every conflict is declared by both manifests, the rename fix when none is, and both fixes, each labelled, when a project has some of each: verified (doctor.mjs:1393-1403).
  • Description: the signal is each manifest writing providerId, which the loader already records, and the conflict record carries bothDeclare for doctor: verified (integrations.mjs:285, provider-resolution.mjs:195-197, :241).
  • Description: a documented rename and a second copy that takes its ID from its name keep today's advice: verified.
  • Description: an npm-alias copy at the same name and version gets no warning, and one at another version of a package that writes providerId gets the two cases: verified (provider-resolution.mjs:455-468).
  • Description: which package is used or set aside, every JSON shape and exit code stay the same; only message and fix text change: verified (doctor JSON shapes compared on base and head).
  • Description: the resolver test pins the two cases and bothDeclare for a twin pair: verified (provider-resolution.test.mjs:320-340); and the current advice word for word for the other pairings: verified (:342-353); and no bothDeclare for both one-declares orders and for neither: false, only one pairing is checked (:325-328).
  • Description: the doctor test pins message and fix for all-twin, none and mixed projects: verified (doctor.test.mjs:515-611).
  • Description: with the source changes reverted, each new case fails: verified for the four tests that pin new behavior; the test that pins today's advice passes on the base, as it must.
  • Description: 51 files and 1,288 tests pass in the three suites: verified.
  • Description: prettier is clean on the resolver, its test and doctor.mjs, and the lines added to integrations.mjs and doctor.test.mjs match prettier: verified (both files were already flagged on the base).
  • Description: eslint is clean on the changed files: verified.
  • File .changeset/provider-twin-advice.md: clear.
  • File packages/cli/api/doctor/doctor.mjs: clear.
  • File packages/cli/api/doctor/doctor.test.mjs: clear.
  • File packages/cli/foundation/integrations/integrations.mjs: clear (JSDoc only).
  • File packages/cli/foundation/integrations/provider-resolution.mjs: clear.
  • File packages/cli/foundation/integrations/provider-resolution.test.mjs: finding (the description overstates what its flag test checks).

Automated review (maintainer link)

@astracat-bot astracat-bot Bot 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.

Approved pending CI: the full CI run on this head was cancelled because CI had no free capacity, so its jobs still need a re-run before merge.

The provider-ID conflict warning and astryx doctor's provider-identity fix now give the two-case advice only when both manifests declare the ID, keep the rename advice for every other conflict, and give both fixes in a project that has both kinds. The last open point is fixed: the Testing bullet now describes exactly what provider-resolution.test.mjs asserts about bothDeclare.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none
  • Claims:
    • Title: the CLI advises keeping one dependency when two packages declare one provider ID: verified (provider-resolution.mjs:217-223).
    • Before this change every conflict ended with "until one package changes its providerId": verified (base message template, kept at provider-resolution.mjs:223).
    • When both manifests declare the ID, the warning names both cases in the quoted words: verified (provider-resolution.mjs:219-222, :240; doctor run on a twin install).
    • Doctor's fix is the two-case advice when every conflict is declared by both, the rename advice when none is, and both fixes, each labelled, when mixed: verified (doctor.mjs:1393-1403; doctor.test.mjs:515-611).
    • The signal is each manifest writing providerId, read from the keys the loader keeps, and the conflict record carries bothDeclare: verified (integrations.mjs:285; provider-resolution.mjs:195-197, :241).
    • A documented rename and a second copy that takes its ID from its name keep today's advice: verified (provider-resolution.mjs:217-223; provider-resolution.test.mjs:342-355; doctor run on a rename install).
    • An npm-alias copy at the same name and version gets no warning, and one at another version whose manifests write providerId gets the two-case advice: verified (provider-resolution.mjs:455-468; doctor runs on both installs).
    • Which package is used or set aside, every JSON shape and every exit code stay the same; only message and fix text change: verified (doctor --json check shapes identical on base and head in six projects; exit 0 throughout).
    • Resolver tests: both declare gives the two-case advice and the flag; one or neither declares gives today's advice; a conflict where only the second package declares carries no flag: verified (provider-resolution.test.mjs:320-355).
    • Doctor tests pin message and fix for all-both, none and mixed projects: verified (doctor.test.mjs:515-611).
    • With the source changes reverted, each new case fails: verified for the four tests of new behavior; the test that pins today's advice passes on the base by design.
    • The node test project over the three directories passes 51 files and 1,288 tests: verified.
    • Prettier is clean on three files, and the added lines in the other two match its output: verified (both files already failed the check before this change).
    • Eslint is clean on the changed files: verified.
    • Changeset: a CLI patch in which both-declare conflicts get the two cases in the warning and doctor's fix, with name-derived IDs unchanged: verified.
  • Files:
    • .changeset/provider-twin-advice.md: clear
    • packages/cli/api/doctor/doctor.mjs: clear
    • packages/cli/api/doctor/doctor.test.mjs: clear
    • packages/cli/foundation/integrations/integrations.mjs: clear
    • packages/cli/foundation/integrations/provider-resolution.mjs: clear
    • packages/cli/foundation/integrations/provider-resolution.test.mjs: clear

Automated review (maintainer link)

@josephfarina josephfarina reopened this Nov 17, 2026
josephfarina added a commit that referenced this pull request Nov 18, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12072 fix(templates): payment form and checkout wrap the summary below the form on a narrow first paint
  Author: Joey Farina <[email protected]>
- #12274 fix(core): cap the Selector family's trigger-width list minimum at the viewport
  Author: josephfarina <[email protected]>
- #12215 fix(cli): advise keeping one dependency when two packages declare one provider ID
  Author: Joey <[email protected]>
- #12322 [experimental] export --reverse: use the project's own copy of an aliased file, or restore the page's copy with its paths entry
  Author: josephfarina <[email protected]>
- #12403 docs(core): Text's as and PowerSearch's statusVariant list every value their types allow
  Author: Joey Farina <[email protected]>
- #12494 fix(templates): dashboard templates use page sections, not cards, for page regions
  Author: Joey Farina <[email protected]>
- #12282 fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme
  Author: Joey Farina <[email protected]>
- #12420 fix(Chat): ChatToolCalls and ChatDictationButton without a required prop name it and the fix in development
  Author: Joey Farina <[email protected]>
- #12205 fix(cli): equally scored icons put first one whose id the query names in full
  Author: Joey Farina <[email protected]>
- #12455 fix(core): a theme sets the room between a checkbox or a switch and its label
  Author: josephfarina <[email protected]>
- #12658 perf(cli): the first theme build after a CLI upgrade reuses the JavaScript it compiled from a theme's local modules
  Author: Joey <[email protected]>
- #12323 [experimental] export: React logs no render timings while the export draws a page
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12713.

@github-actions
github-actions Bot deleted the josephfarina/provider-twin-advice branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — c336f39a Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant