Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disallow installing root plugin #888

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

mdonnalley
Copy link
Contributor

  • Remove root plugin from human readable output in plugins --core (still present in json)
  • Disallow installing root plugin. It will error if it's the only plugin provided, otherwise it will warn
  • Suggest that the user use update if the CLI is installable and plugin-update is installed

@W-14481853@

Copy link

@WillieRuemmele WillieRuemmele left a comment

Choose a reason for hiding this comment

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

should we add a UT to cover these errors?

@WillieRuemmele
Copy link

QA Notes


built and linked this branch into my cli install at /Users/william.ruemmele/.nvm/versions/node/v20.12.2/lib/node_modules/@salesforce/cli

✅ :
before

@oclif/plugin-which 3.2.2 (core)
@salesforce/cli 2.46.4 (core)
apex 3.1.18 (core)

after

@oclif/plugin-which 3.2.2 (core)
apex 3.1.18 (core)

✅ : still present in --json

    "options": {
      "isRoot": true,
      "root": "/Users/william.ruemmele/.nvm/versions/node/v20.12.2/lib/node_modules/@salesforce/cli/dist"
    },
    "alias": "@salesforce/cli",

✅ : --json output matches
✅ : error on sf plugin install @salesforce/cli / warn on multiple plugin+root

➜  dreamhouse-lwc git:(main) ✗  hub:(GLOBAL - DevHub) scratch:([email protected])
 ➜  sf plugins install @salesforce/cli                         
 ›   Warning: Plugin @oclif/plugin-plugins (5.2.3) differs from the version specified by sf (5.2.4)
 ›   Error: Ignoring root plugin @salesforce/cli.
➜  dreamhouse-lwc git:(main) ✗  hub:(GLOBAL - DevHub) scratch:([email protected])
 ➜  sf plugins install @salesforce/cli @salesforce/plugin-source
 ›   Warning: Plugin @oclif/plugin-plugins (5.2.3) differs from the version specified by sf (5.2.4)
 ›   Warning: Ignoring root plugin @salesforce/cli.
Polling for new version(s) to become available on npm... done

✅ : error when using an installer CLI about installing @salesforce/cli

➜  dreamhouse-lwc git:(main) ✗  hub:(GLOBAL - DevHub) scratch:([email protected])
 ➜  sf plugins install @salesforce/cli
 ›   Error: Ignoring root plugin @salesforce/cli. Use "sf update" to update @salesforce/cli.

✅ : warning when installer installing @salesforce/cli + another plugin

 ➜  sf plugins install @salesforce/cli @salesforce/plugin-source
 ›   Warning: Ignoring root plugin @salesforce/cli. Use "sf update" to update @salesforce/cli.
Polling for new version(s) to become available on npm... done

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.

2 participants