generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert project to use a new source behavior (#1015)
* feat(wip): decompose command * feat: convert a project to use a new sourceBehaviorOption * chore: snapshot/schema * feat: error for behavior change with no matching types * refactor: rename the command from design * chore: ut a function * test: add a nut, fix bugs that uncovers * chore: bump sdr for renamed prop * feat: normalize paths for consistency * test: more nut for preset conversion * test: remove redundant nut * test: win ut only * refactor: calc preset dir once * test: windows ut again * test: restore full test suite * fix: edit the messages for "project convert source-behavior" (#1018) * fix: change behavior shortchar * chore: snapshot/schema * Update messages/convert.source-behavior.md Co-authored-by: Willhoit <[email protected]> * chore: pr suggestions Co-authored-by: Willhoit <[email protected]> --------- Co-authored-by: Juliet Shackell <[email protected]> Co-authored-by: Eric Willhoit <[email protected]> Co-authored-by: Willhoit <[email protected]>
- Loading branch information
1 parent
bb8db15
commit 014500e
Showing
17 changed files
with
622 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# summary | ||
|
||
Enable a behavior of your project source files, and then update your Salesforce DX project to implement the behavior. | ||
|
||
# description | ||
|
||
Specifically, this command updates the "sourceBehaviorOption" option in the "sfdx-project.json" file and then converts the associated local source files in your project as needed. | ||
|
||
For example, run this command with the "--behavior decomposePermissionSetBeta" flag to start decomposing permission sets when you deploy or retrieve them. Decomposing means breaking up the monolithic metadata API format XML file that corresponds to a metadata component into smaller XML files and directories based on its subtypes. Permission sets are not decomposed by default; you must opt-in to start decomposing them by using this command. When the command finishes, your "sfdx-project.json" file is updated to always decompose permission sets, and the existing permission set files in your local package directories are converted into the new decomposed format. You run this command only once for a given behavior change. | ||
|
||
For more information about the possible values for the --behavior flag, see the "sourceBehaviorOptions" section in the https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm topic. | ||
|
||
# flags.behavior.summary | ||
|
||
Behavior to enable; the values correspond to the possible values of the "sourceBehaviorOption" option in the "sfdx-project.json" file. | ||
|
||
# examples | ||
|
||
- Update your Salesforce DX project to decompose custom labels: | ||
|
||
<%= config.bin %> <%= command.id %> --behavior decomposeCustomLabelsBeta | ||
|
||
- Display what the command would do, but don't change any existing files: | ||
|
||
<%= config.bin %> <%= command.id %> --behavior decomposeCustomLabelsBeta --dry-run | ||
|
||
- Keep the temporary directory that contains the interim metadata API formatted files: | ||
|
||
<%= config.bin %> <%= command.id %> --behavior decomposeCustomLabelsBeta --dry-run --preserve-temp-dir | ||
|
||
# flags.dry-run.summary | ||
|
||
Display what the command would do, but don't make any actual changes. | ||
|
||
# flags.dry-run.description | ||
|
||
Doesn't modify the existing files in your project, including the "sfdx-project.json" file. Instead, the command lists the files that would be deleted, explains the modifications to the "sfdx-project.json" file, and outputs the resulting modifications to a new directory named `DRY-RUN-RESULTS` for review. | ||
|
||
# flags.preserve-temp-dir.summary | ||
|
||
Don't delete the metadata API format temporary directory that this command creates. Useful for debugging. | ||
|
||
# error.trackingNotSupported | ||
|
||
Your project has a default org (target-org) that uses source tracking. This operation will cause changes to the local project source files that can't be properly tracked. | ||
|
||
# error.trackingNotSupported.actions | ||
|
||
- Retrieve any changes or data you need from the org that you haven't already retrieved. | ||
- Delete the org ("sf org delete scratch" or "sf org delete sandbox"). | ||
- Run this command again. | ||
- Create a new org ("sf org create scratch" or "sf org create sandbox") and deploy the modified source. | ||
|
||
# error.packageDirectoryNeedsMainDefault | ||
|
||
The package directory %s doesn't have a main/default structure. | ||
This command moves metadata into a main/default structure, but your package directories aren't ready for it. | ||
|
||
# error.packageDirectoryNeedsMainDefault.actions | ||
|
||
- Update %s to have all its metadata inside a main/default directory structure. | ||
- Run the command again. | ||
|
||
# success.dryRun | ||
|
||
Files were created in %s outside your package directories for you to inspect. | ||
|
||
# error.noTargetTypes | ||
|
||
The project doesn't contain any package directories with metadata that matches the specified behavior %s. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$ref": "#/definitions/SourceBehaviorResult", | ||
"definitions": { | ||
"SourceBehaviorResult": { | ||
"type": "object", | ||
"properties": { | ||
"sourceBehaviorOptions": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"deletedFiles": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"createdFiles": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["sourceBehaviorOptions", "deletedFiles", "createdFiles"], | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.