-
Notifications
You must be signed in to change notification settings - Fork 0
W-22164863: Address review comments and update backend request param #11
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| { | ||
| "extends": "@salesforce/dev-config/nyc" | ||
| "nyc": { | ||
| "extends": "@salesforce/dev-config/nyc" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,50 +1,13 @@ | ||
| **NOTE: This template for sf plugins is not yet official. Please consult with the Platform CLI team before using this template.** | ||
|
|
||
| # plugin-license-management | ||
| # License Management Plugin | ||
|
|
||
| [](https://www.npmjs.com/package/@salesforce/plugin-license-management) [](https://npmjs.org/package/@salesforce/plugin-license-management) [](https://opensource.org/license/apache-2-0) | ||
|
|
||
| ## Using the template | ||
|
|
||
| This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin: | ||
|
|
||
| 1. Please get in touch with the Platform CLI team. We want to help you develop your plugin. | ||
| 2. Generate your plugin: | ||
|
|
||
| ``` | ||
| sf plugins install dev | ||
| sf dev generate plugin | ||
|
|
||
| git init -b main | ||
| git add . && git commit -m "chore: initial commit" | ||
| ``` | ||
|
|
||
| 3. Create your plugin's repo in the salesforcecli github org | ||
| 4. When you're ready, replace the contents of this README with the information you want. | ||
|
|
||
| ## Learn about `sf` plugins | ||
|
|
||
| Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development. | ||
|
|
||
| This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce. There is also a default circleci config using the [release management orb](https://github.com/forcedotcom/npm-release-management-orb) standards. | ||
| Manage Permission Set Licenses (PSLs) in your scratch orgs. This plugin lets you provision PSL seats into a target scratch org — either one at a time via command line flags, or in bulk using a JSON definition file. | ||
|
|
||
| Additionally, there are some additional tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled. | ||
| ## Before You Begin | ||
|
|
||
| ### Tooling | ||
|
|
||
| - [@salesforce/core](https://github.com/forcedotcom/sfdx-core) | ||
| - [@salesforce/kit](https://github.com/forcedotcom/kit) | ||
| - [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core) | ||
| - [@salesforce/ts-types](https://github.com/forcedotcom/ts-types) | ||
| - [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon) | ||
| - [@salesforce/dev-config](https://github.com/forcedotcom/dev-config) | ||
| - [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts) | ||
|
|
||
| # Everything past here is only a suggestion as to what should be in your specific plugin's description | ||
|
|
||
| This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm). | ||
|
|
||
| We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed. | ||
| - Install and authenticate the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). | ||
| - Ensure you have the appropriate permissions to manage Permission Set Licenses in the target org. | ||
|
|
||
| ## Install | ||
|
|
||
|
|
@@ -170,12 +133,53 @@ _See code: [src/commands/license/provision.ts](https://github.com/salesforcecli/ | |
|
|
||
| # Local Testing | ||
|
|
||
| ### 1. Log in to your Dev Hub | ||
|
|
||
| ```bash | ||
| sf org login web --set-default-dev-hub --instance-url <dev-hub-url> | ||
| ``` | ||
|
|
||
| ### 2. Create a scratch org | ||
|
|
||
| Before creating the scratch org, update `test/config/scratch-org-def.json` with your values: | ||
|
|
||
| | Field | Description | | ||
| | ----------- | ------------------------------------ | | ||
| | `orgName` | Display name for the scratch org | | ||
| | `namespace` | Your package namespace (e.g. `myNS`) | | ||
|
|
||
| ```bash | ||
| sf org create scratch --definition-file test/config/scratch-org-def.json --alias <scratch-org-alias> | ||
| ``` | ||
|
|
||
| ### 3. Install the package into the scratch org | ||
|
|
||
| Make the package available in the scratch org. Some ways to do this include: | ||
|
|
||
| **Install a released package version** | ||
|
|
||
| ```bash | ||
| sf package install --package <package-version-id> --target-org <scratch-org-alias> | ||
| ``` | ||
|
|
||
| **Push source directly** | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say "OR Push source directly"
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need to mention |
||
|
|
||
| ```bash | ||
| sf org create scratch --target-dev-hub <devhub-alias> --definition-file test/config/scratch-org-def.json | ||
| sf project deploy start --target-org <scratch-org-alias> | ||
| ``` | ||
|
|
||
| sf package install --package <package-id> --target-org <scratch-org-username> | ||
| ### 4. Open the scratch org (optional) | ||
|
|
||
| sf package install report -i <install-request-id> -o <scratch-org-username> | ||
| ```bash | ||
| sf org open --target-org <scratch-org-alias> | ||
| ``` | ||
|
|
||
| ### 5. Provision licenses | ||
|
|
||
| ```bash | ||
| # Provision a single PSL | ||
| sf license provision --target-org <scratch-org-alias> --namespace <namespace> --license <license-name> --quantity <number> | ||
|
|
||
| sf license provision -o <scratch-org-username> --license premium --namespace demo --quantity 10 | ||
| # Provision multiple PSLs using a definition file | ||
| sf license provision --target-org <scratch-org-alias> --definition-file <path-to-definition-file> | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ukanoja-sf ,
I see that in cli we only mention the flow of installing a package.
The other valid flow is to do
sf project deploy startto deploy the project, devs don't have to release a new package when developing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the steps