sfdx-hardis 6.17.2-alpha202512261505.0 → 6.17.2-alpha202512261745.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,12 +132,13 @@
132
132
  "clear:cache:hardis"
133
133
  ]
134
134
  },
135
- "hardis:config:get": {
135
+ "hardis:auth:login": {
136
136
  "aliases": [],
137
137
  "args": {},
138
- "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
138
+ "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
139
139
  "examples": [
140
- "$ sf hardis:project:deploy:sources:metadata"
140
+ "$ sf hardis:auth:login",
141
+ "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
141
142
  ],
142
143
  "flags": {
143
144
  "json": {
@@ -155,20 +156,28 @@
155
156
  "multiple": false,
156
157
  "type": "option"
157
158
  },
158
- "level": {
159
- "char": "l",
160
- "description": "project,branch or user",
161
- "name": "level",
162
- "default": "project",
159
+ "instanceurl": {
160
+ "char": "r",
161
+ "description": "URL of org instance",
162
+ "name": "instanceurl",
163
163
  "hasDynamicHelp": false,
164
164
  "multiple": false,
165
- "options": [
166
- "project",
167
- "branch",
168
- "user"
169
- ],
170
165
  "type": "option"
171
166
  },
167
+ "devhub": {
168
+ "char": "h",
169
+ "description": "Also connect associated DevHub",
170
+ "name": "devhub",
171
+ "allowNo": false,
172
+ "type": "boolean"
173
+ },
174
+ "scratchorg": {
175
+ "char": "s",
176
+ "description": "Scratch org",
177
+ "name": "scratchorg",
178
+ "allowNo": false,
179
+ "type": "boolean"
180
+ },
172
181
  "debug": {
173
182
  "char": "d",
174
183
  "description": "Activate debug mode (more logs)",
@@ -192,39 +201,38 @@
192
201
  },
193
202
  "hasDynamicHelp": false,
194
203
  "hiddenAliases": [],
195
- "id": "hardis:config:get",
204
+ "id": "hardis:auth:login",
196
205
  "pluginAlias": "sfdx-hardis",
197
206
  "pluginName": "sfdx-hardis",
198
207
  "pluginType": "core",
199
208
  "strict": true,
200
209
  "enableJsonFlag": true,
201
- "title": "Deploy metadata sources to org",
210
+ "title": "Login",
202
211
  "requiresProject": false,
203
212
  "isESM": true,
204
213
  "relativePath": [
205
214
  "lib",
206
215
  "commands",
207
216
  "hardis",
208
- "config",
209
- "get.js"
217
+ "auth",
218
+ "login.js"
210
219
  ],
211
220
  "aliasPermutations": [],
212
221
  "permutations": [
213
- "hardis:config:get",
214
- "config:hardis:get",
215
- "config:get:hardis",
216
- "hardis:get:config",
217
- "get:hardis:config",
218
- "get:config:hardis"
222
+ "hardis:auth:login",
223
+ "auth:hardis:login",
224
+ "auth:login:hardis",
225
+ "hardis:login:auth",
226
+ "login:hardis:auth",
227
+ "login:auth:hardis"
219
228
  ]
220
229
  },
221
- "hardis:auth:login": {
230
+ "hardis:config:get": {
222
231
  "aliases": [],
223
232
  "args": {},
224
- "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
233
+ "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
225
234
  "examples": [
226
- "$ sf hardis:auth:login",
227
- "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
235
+ "$ sf hardis:project:deploy:sources:metadata"
228
236
  ],
229
237
  "flags": {
230
238
  "json": {
@@ -242,28 +250,20 @@
242
250
  "multiple": false,
243
251
  "type": "option"
244
252
  },
245
- "instanceurl": {
246
- "char": "r",
247
- "description": "URL of org instance",
248
- "name": "instanceurl",
253
+ "level": {
254
+ "char": "l",
255
+ "description": "project,branch or user",
256
+ "name": "level",
257
+ "default": "project",
249
258
  "hasDynamicHelp": false,
250
259
  "multiple": false,
260
+ "options": [
261
+ "project",
262
+ "branch",
263
+ "user"
264
+ ],
251
265
  "type": "option"
252
266
  },
253
- "devhub": {
254
- "char": "h",
255
- "description": "Also connect associated DevHub",
256
- "name": "devhub",
257
- "allowNo": false,
258
- "type": "boolean"
259
- },
260
- "scratchorg": {
261
- "char": "s",
262
- "description": "Scratch org",
263
- "name": "scratchorg",
264
- "allowNo": false,
265
- "type": "boolean"
266
- },
267
267
  "debug": {
268
268
  "char": "d",
269
269
  "description": "Activate debug mode (more logs)",
@@ -287,30 +287,30 @@
287
287
  },
288
288
  "hasDynamicHelp": false,
289
289
  "hiddenAliases": [],
290
- "id": "hardis:auth:login",
290
+ "id": "hardis:config:get",
291
291
  "pluginAlias": "sfdx-hardis",
292
292
  "pluginName": "sfdx-hardis",
293
293
  "pluginType": "core",
294
294
  "strict": true,
295
295
  "enableJsonFlag": true,
296
- "title": "Login",
296
+ "title": "Deploy metadata sources to org",
297
297
  "requiresProject": false,
298
298
  "isESM": true,
299
299
  "relativePath": [
300
300
  "lib",
301
301
  "commands",
302
302
  "hardis",
303
- "auth",
304
- "login.js"
303
+ "config",
304
+ "get.js"
305
305
  ],
306
306
  "aliasPermutations": [],
307
307
  "permutations": [
308
- "hardis:auth:login",
309
- "auth:hardis:login",
310
- "auth:login:hardis",
311
- "hardis:login:auth",
312
- "login:hardis:auth",
313
- "login:auth:hardis"
308
+ "hardis:config:get",
309
+ "config:hardis:get",
310
+ "config:get:hardis",
311
+ "hardis:get:config",
312
+ "get:hardis:config",
313
+ "get:config:hardis"
314
314
  ]
315
315
  },
316
316
  "hardis:datacloud:sql-query": {
@@ -3140,12 +3140,12 @@
3140
3140
  "lint:project:hardis"
3141
3141
  ]
3142
3142
  },
3143
- "hardis:scratch:create": {
3143
+ "hardis:source:deploy": {
3144
3144
  "aliases": [],
3145
3145
  "args": {},
3146
- "description": "\n## Command Behavior\n\n**Creates and fully initializes a Salesforce scratch org with complete development environment setup.**\n\nThis command is a comprehensive scratch org provisioning tool that automates the entire process of creating, configuring, and initializing a Salesforce scratch org for development work. It handles everything from basic org creation to advanced configuration including package installation, metadata deployment, and data initialization.\n\nKey functionalities:\n\n- **Intelligent Org Management:** Automatically generates unique scratch org aliases based on username, git branch, and timestamp, with options to reuse existing orgs or force creation of new ones.\n- **Scratch Org Pool Integration:** Supports fetching pre-configured scratch orgs from pools for faster development cycles and CI/CD optimization.\n- **Custom Scratch Definition:** Dynamically builds project-scratch-def.json files with user-specific configurations including email, username patterns, and org shape settings (set variable **SCRATCH_ORG_SHAPE** to use org shapes).\n- **Package Installation:** Automatically installs all configured packages defined in `installedPackages` configuration property.\n- **Metadata Deployment:** Pushes source code and deploys metadata using optimized deployment strategies for scratch org environments.\n- **Permission Set Assignment:** Assigns specified permission sets defined in `initPermissionSets` configuration to the scratch org user.\n- **Apex Script Execution:** Runs custom Apex initialization scripts defined in `scratchOrgInitApexScripts` for org-specific setup.\n- **Data Loading:** Loads initial data using SFDMU data packages from `dataPackages` configuration for realistic development environments.\n- **User Configuration:** Automatically configures the scratch org admin user with proper names, email, country settings, and marketing user permissions.\n- **Password Generation:** Creates and stores secure passwords for easy scratch org access during development.\n- **CI/CD Integration:** Provides specialized handling for continuous integration environments including automated cleanup and pool management.\n- **Error Handling:** Comprehensive error recovery including scratch org cleanup on failure and detailed troubleshooting messages.\n\nThe command configuration can be customized using:\n\n- `config/.sfdx-hardis.yml` file with properties like `installedPackages`, `initPermissionSets`, `scratchOrgInitApexScripts`, and `dataPackages`.\n- Environment variable **SCRATCH_ORG_SHAPE** with shape org id, if you want to use org shapes\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Management:** Loads hierarchical configuration from `.sfdx-hardis.yml`, branch-specific, and user-specific configuration files using `getConfig('user')`.\n- **Alias Generation Logic:** Creates intelligent scratch org aliases using username, git branch, timestamp patterns with CI and pool prefixes for different environments.\n- **Scratch Org Definition Building:** Dynamically constructs `project-scratch-def.json` with user email, custom usernames, org shapes, and feature flags like StateAndCountryPicklist and MarketingUser.\n- **Pool Integration:** Implements scratch org pool fetching using `fetchScratchOrg` for rapid org provisioning in development and CI environments.\n- **Salesforce CLI Integration:** Executes `sf org create scratch` commands with proper parameter handling including wait times, duration, and dev hub targeting.\n- **Package Installation Pipeline:** Uses `installPackages` utility to install managed and unmanaged packages with dependency resolution and error handling.\n- **Metadata Deployment:** Leverages `initOrgMetadatas` for optimized source pushing and metadata deployment specific to scratch org environments.\n- **Permission Set Assignment:** Implements `initPermissionSetAssignments` for automated permission set assignment to scratch org users.\n- **Apex Script Execution:** Runs custom Apex initialization scripts using `initApexScripts` for org-specific configuration and setup.\n- **Data Loading Integration:** Uses SFDMU integration through `initOrgData` for comprehensive data loading from configured data packages.\n- **User Management:** Performs SOQL queries and DML operations to configure scratch org users with proper names, emails, country codes, and permission flags.\n- **Authentication Management:** Handles SFDX auth URL generation and storage for CI/CD environments and scratch org pool management.\n- **Error Recovery:** Implements comprehensive error handling with scratch org cleanup, pool management, and detailed error messaging for troubleshooting.\n- **WebSocket Integration:** Provides real-time status updates and file reporting through WebSocket connections for VS Code extension integration.\n</details>\n",
3146
+ "description": "sfdx-hardis wrapper for sfdx force:source:deploy that displays tips to solve deployment errors.\n\nAdditional to the base command wrapper: If using **--checkonly**, add options **--checkcoverage** and **--coverageformatters json-summary** to check that org coverage is > 75% (or value defined in .sfdx-hardis.yml property **apexTestsMinCoverageOrgWide**)\n\n### Deployment results\n\nYou can also have deployment results as pull request comments, on:\n\n- GitHub (see [GitHub Pull Requests comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-github/))\n- Gitlab (see [Gitlab integration configuration](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/))\n- Azure DevOps (see [Azure integration configuration](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-azure/))\n\n\n[![Assisted solving of Salesforce deployments errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)\n\n### Deployment pre or post commands\n\nYou can define command lines to run before or after a deployment, with parameters:\n\n- **id**: Unique Id for the command\n- **label**: Human readable label for the command\n- **skipIfError**: If defined to \"true\", the post-command won't be run if there is a deployment failure\n- **context**: Defines the context where the command will be run. Can be **all** (default), **check-deployment-only** or **process-deployment-only**\n- **runOnlyOnceByOrg**: If set to true, the command will be run only one time per org. A record of SfdxHardisTrace__c is stored to make that possible (it needs to be existing in target org)\n\nIf the commands are not the same depending on the target org, you can define them into **config/branches/.sfdx-hardis-BRANCHNAME.yml** instead of root **config/.sfdx-hardis.yml**\n\nExample:\n\n```yaml\ncommandsPreDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to the deployment user\n command: sf data update record --sobject User --where \"Username='deploy.github@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n\ncommandsPostDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to desired username\n command: sf data update record --sobject User --where \"Username='admin-yser@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n - id: someActionToRunJustOneTime\n label: And to run only if deployment is success\n command: sf sfdmu:run ...\n skipIfError: true\n context: process-deployment-only\n runOnlyOnceByOrg: true\n```\n\nNotes:\n\n- You can disable coloring of errors in red by defining env variable SFDX_HARDIS_DEPLOY_ERR_COLORS=false\n\n[See documentation of Salesforce command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_force_source_deploy)\n",
3147
3147
  "examples": [
3148
- "$ sf hardis:scratch:create"
3148
+ "$ sf hardis:source:deploy -x manifest/package.xml --wait 60 --ignorewarnings --testlevel RunLocalTests --postdestructivechanges ./manifest/destructiveChanges.xml --target-org nicolas.vuillamy@cloudity.com.sfdxhardis --checkonly --checkcoverage --verbose --coverageformatters json-summary"
3149
3149
  ],
3150
3150
  "flags": {
3151
3151
  "json": {
@@ -3163,138 +3163,216 @@
3163
3163
  "multiple": false,
3164
3164
  "type": "option"
3165
3165
  },
3166
- "forcenew": {
3167
- "char": "n",
3168
- "description": "If an existing scratch org exists, do not reuse it but create a new one",
3169
- "name": "forcenew",
3170
- "allowNo": false,
3171
- "type": "boolean"
3172
- },
3173
- "pool": {
3174
- "description": "Creates the scratch org for a scratch org pool",
3175
- "name": "pool",
3166
+ "checkonly": {
3167
+ "char": "c",
3168
+ "description": "checkonly",
3169
+ "name": "checkonly",
3176
3170
  "allowNo": false,
3177
3171
  "type": "boolean"
3178
3172
  },
3179
- "debug": {
3180
- "char": "d",
3181
- "description": "Activate debug mode (more logs)",
3182
- "name": "debug",
3173
+ "soapdeploy": {
3174
+ "description": "soapDeploy",
3175
+ "name": "soapdeploy",
3183
3176
  "allowNo": false,
3184
3177
  "type": "boolean"
3185
3178
  },
3186
- "websocket": {
3187
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
3188
- "name": "websocket",
3179
+ "wait": {
3180
+ "char": "w",
3181
+ "description": "wait",
3182
+ "name": "wait",
3183
+ "default": 60,
3189
3184
  "hasDynamicHelp": false,
3190
3185
  "multiple": false,
3191
3186
  "type": "option"
3192
3187
  },
3193
- "skipauth": {
3194
- "description": "Skip authentication check when a default username is required",
3195
- "name": "skipauth",
3196
- "allowNo": false,
3197
- "type": "boolean"
3198
- },
3199
- "target-dev-hub": {
3200
- "aliases": [
3201
- "targetdevhubusername"
3202
- ],
3203
- "char": "v",
3204
- "deprecateAliases": true,
3205
- "name": "target-dev-hub",
3206
- "noCacheDefault": true,
3207
- "required": true,
3208
- "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
3209
- "hasDynamicHelp": true,
3188
+ "testlevel": {
3189
+ "char": "l",
3190
+ "description": "testlevel",
3191
+ "name": "testlevel",
3192
+ "default": "NoTestRun",
3193
+ "hasDynamicHelp": false,
3210
3194
  "multiple": false,
3195
+ "options": [
3196
+ "NoTestRun",
3197
+ "RunSpecifiedTests",
3198
+ "RunLocalTests",
3199
+ "RunAllTestsInOrg"
3200
+ ],
3211
3201
  "type": "option"
3212
- }
3213
- },
3214
- "hasDynamicHelp": true,
3215
- "hiddenAliases": [],
3216
- "id": "hardis:scratch:create",
3217
- "pluginAlias": "sfdx-hardis",
3218
- "pluginName": "sfdx-hardis",
3219
- "pluginType": "core",
3220
- "strict": true,
3221
- "enableJsonFlag": true,
3222
- "title": "Create and initialize scratch org",
3223
- "requiresProject": true,
3224
- "requiresSfdxPlugins": [
3225
- "sfdmu"
3226
- ],
3227
- "isESM": true,
3228
- "relativePath": [
3229
- "lib",
3230
- "commands",
3231
- "hardis",
3232
- "scratch",
3233
- "create.js"
3234
- ],
3235
- "aliasPermutations": [],
3236
- "permutations": [
3237
- "hardis:scratch:create",
3238
- "scratch:hardis:create",
3239
- "scratch:create:hardis",
3240
- "hardis:create:scratch",
3241
- "create:hardis:scratch",
3242
- "create:scratch:hardis"
3243
- ]
3244
- },
3245
- "hardis:scratch:delete": {
3246
- "aliases": [],
3247
- "args": {},
3248
- "description": "## Command Behavior\n\n**Provides an assisted menu to delete Salesforce scratch orgs associated with a Dev Hub.**\n\nThis command simplifies the process of cleaning up your Salesforce development environments by allowing you to easily select and delete multiple scratch orgs. This is crucial for managing your scratch org limits and ensuring that you don't accumulate unnecessary or expired orgs.\n\nKey functionalities:\n\n- **Interactive Scratch Org Selection:** Displays a list of all active scratch orgs linked to your Dev Hub, including their usernames, instance URLs, and last used dates.\n- **Multi-Selection:** Allows you to select multiple scratch orgs for deletion.\n- **Confirmation Prompt:** Prompts for confirmation before proceeding with the deletion, ensuring that you don't accidentally delete important orgs.\n- **Dev Hub Integration:** Works with your configured Dev Hub to manage scratch orgs.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce CLI Integration:** It executes the `sf org list` command to retrieve a list of all scratch orgs associated with the current Dev Hub. It then filters this list to show only active orgs.\n- **Interactive Prompts:** Uses the `prompts` library to present a multi-select menu of scratch orgs to the user.\n- **Scratch Org Deletion:** For each selected scratch org, it executes the `sf org delete scratch --no-prompt` command to perform the deletion.\n- **Error Handling:** Includes basic error handling for Salesforce CLI commands.\n- **Data Sorting:** Sorts the list of scratch orgs by username, alias, and instance URL for better readability in the interactive menu.\n</details>\n",
3249
- "examples": [
3250
- "$ sf hardis:scratch:delete"
3251
- ],
3252
- "flags": {
3253
- "json": {
3254
- "description": "Format output as json.",
3255
- "helpGroup": "GLOBAL",
3256
- "name": "json",
3257
- "allowNo": false,
3258
- "type": "boolean"
3259
3202
  },
3260
- "flags-dir": {
3261
- "helpGroup": "GLOBAL",
3262
- "name": "flags-dir",
3263
- "summary": "Import flag values from a directory.",
3203
+ "runtests": {
3204
+ "char": "r",
3205
+ "description": "runTests",
3206
+ "name": "runtests",
3207
+ "default": [],
3264
3208
  "hasDynamicHelp": false,
3265
- "multiple": false,
3209
+ "multiple": true,
3266
3210
  "type": "option"
3267
3211
  },
3268
- "debug": {
3269
- "char": "d",
3270
- "description": "Activate debug mode (more logs)",
3271
- "name": "debug",
3212
+ "ignoreerrors": {
3213
+ "description": "ignoreErrors",
3214
+ "name": "ignoreerrors",
3272
3215
  "allowNo": false,
3273
3216
  "type": "boolean"
3274
3217
  },
3275
- "websocket": {
3276
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
3277
- "name": "websocket",
3278
- "hasDynamicHelp": false,
3279
- "multiple": false,
3280
- "type": "option"
3281
- },
3282
- "skipauth": {
3283
- "description": "Skip authentication check when a default username is required",
3284
- "name": "skipauth",
3218
+ "ignorewarnings": {
3219
+ "char": "g",
3220
+ "description": "ignoreWarnings",
3221
+ "name": "ignorewarnings",
3285
3222
  "allowNo": false,
3286
3223
  "type": "boolean"
3287
3224
  },
3288
- "target-dev-hub": {
3289
- "aliases": [
3290
- "targetdevhubusername"
3225
+ "validateddeployrequestid": {
3226
+ "char": "q",
3227
+ "description": "validateDeployRequestId",
3228
+ "exclusive": [
3229
+ "manifest",
3230
+ "metadata",
3231
+ "sourcepath",
3232
+ "checkonly",
3233
+ "testlevel",
3234
+ "runtests",
3235
+ "ignoreerrors",
3236
+ "ignorewarnings"
3291
3237
  ],
3292
- "char": "v",
3238
+ "name": "validateddeployrequestid",
3239
+ "hasDynamicHelp": false,
3240
+ "multiple": false,
3241
+ "type": "option"
3242
+ },
3243
+ "verbose": {
3244
+ "description": "verbose",
3245
+ "name": "verbose",
3246
+ "allowNo": false,
3247
+ "type": "boolean"
3248
+ },
3249
+ "metadata": {
3250
+ "char": "m",
3251
+ "description": "metadata",
3252
+ "exclusive": [
3253
+ "manifest",
3254
+ "sourcepath"
3255
+ ],
3256
+ "name": "metadata",
3257
+ "hasDynamicHelp": false,
3258
+ "multiple": true,
3259
+ "type": "option"
3260
+ },
3261
+ "sourcepath": {
3262
+ "char": "p",
3263
+ "description": "sourcePath",
3264
+ "exclusive": [
3265
+ "manifest",
3266
+ "metadata"
3267
+ ],
3268
+ "name": "sourcepath",
3269
+ "hasDynamicHelp": false,
3270
+ "multiple": true,
3271
+ "type": "option"
3272
+ },
3273
+ "manifest": {
3274
+ "char": "x",
3275
+ "description": "flagsLong.manifest",
3276
+ "exclusive": [
3277
+ "metadata",
3278
+ "sourcepath"
3279
+ ],
3280
+ "name": "manifest",
3281
+ "hasDynamicHelp": false,
3282
+ "multiple": false,
3283
+ "type": "option"
3284
+ },
3285
+ "predestructivechanges": {
3286
+ "dependsOn": [
3287
+ "manifest"
3288
+ ],
3289
+ "description": "predestructivechanges",
3290
+ "name": "predestructivechanges",
3291
+ "hasDynamicHelp": false,
3292
+ "multiple": false,
3293
+ "type": "option"
3294
+ },
3295
+ "postdestructivechanges": {
3296
+ "dependsOn": [
3297
+ "manifest"
3298
+ ],
3299
+ "description": "postdestructivechanges",
3300
+ "name": "postdestructivechanges",
3301
+ "hasDynamicHelp": false,
3302
+ "multiple": false,
3303
+ "type": "option"
3304
+ },
3305
+ "tracksource": {
3306
+ "char": "t",
3307
+ "description": "tracksource",
3308
+ "exclusive": [
3309
+ "checkonly",
3310
+ "validateddeployrequestid"
3311
+ ],
3312
+ "name": "tracksource",
3313
+ "allowNo": false,
3314
+ "type": "boolean"
3315
+ },
3316
+ "forceoverwrite": {
3317
+ "char": "f",
3318
+ "dependsOn": [
3319
+ "tracksource"
3320
+ ],
3321
+ "description": "forceoverwrite",
3322
+ "name": "forceoverwrite",
3323
+ "allowNo": false,
3324
+ "type": "boolean"
3325
+ },
3326
+ "resultsdir": {
3327
+ "description": "resultsdir",
3328
+ "name": "resultsdir",
3329
+ "hasDynamicHelp": false,
3330
+ "multiple": false,
3331
+ "type": "option"
3332
+ },
3333
+ "coverageformatters": {
3334
+ "description": "coverageformatters",
3335
+ "name": "coverageformatters",
3336
+ "hasDynamicHelp": false,
3337
+ "multiple": true,
3338
+ "type": "option"
3339
+ },
3340
+ "junit": {
3341
+ "description": "junit",
3342
+ "name": "junit",
3343
+ "allowNo": false,
3344
+ "type": "boolean"
3345
+ },
3346
+ "checkcoverage": {
3347
+ "description": "Check Apex org coverage",
3348
+ "name": "checkcoverage",
3349
+ "allowNo": false,
3350
+ "type": "boolean"
3351
+ },
3352
+ "debug": {
3353
+ "description": "debug",
3354
+ "name": "debug",
3355
+ "allowNo": false,
3356
+ "type": "boolean"
3357
+ },
3358
+ "websocket": {
3359
+ "description": "websocket",
3360
+ "name": "websocket",
3361
+ "hasDynamicHelp": false,
3362
+ "multiple": false,
3363
+ "type": "option"
3364
+ },
3365
+ "target-org": {
3366
+ "aliases": [
3367
+ "targetusername",
3368
+ "u"
3369
+ ],
3370
+ "char": "o",
3293
3371
  "deprecateAliases": true,
3294
- "name": "target-dev-hub",
3372
+ "name": "target-org",
3295
3373
  "noCacheDefault": true,
3296
3374
  "required": true,
3297
- "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
3375
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3298
3376
  "hasDynamicHelp": true,
3299
3377
  "multiple": false,
3300
3378
  "type": "option"
@@ -3302,38 +3380,141 @@
3302
3380
  },
3303
3381
  "hasDynamicHelp": true,
3304
3382
  "hiddenAliases": [],
3305
- "id": "hardis:scratch:delete",
3383
+ "id": "hardis:source:deploy",
3306
3384
  "pluginAlias": "sfdx-hardis",
3307
3385
  "pluginName": "sfdx-hardis",
3308
3386
  "pluginType": "core",
3309
3387
  "strict": true,
3310
3388
  "enableJsonFlag": true,
3311
- "title": "Delete scratch orgs(s)",
3389
+ "requiresProject": true,
3312
3390
  "isESM": true,
3313
3391
  "relativePath": [
3314
3392
  "lib",
3315
3393
  "commands",
3316
3394
  "hardis",
3317
- "scratch",
3318
- "delete.js"
3395
+ "source",
3396
+ "deploy.js"
3319
3397
  ],
3320
3398
  "aliasPermutations": [],
3321
3399
  "permutations": [
3322
- "hardis:scratch:delete",
3323
- "scratch:hardis:delete",
3324
- "scratch:delete:hardis",
3325
- "hardis:delete:scratch",
3326
- "delete:hardis:scratch",
3327
- "delete:scratch:hardis"
3400
+ "hardis:source:deploy",
3401
+ "source:hardis:deploy",
3402
+ "source:deploy:hardis",
3403
+ "hardis:deploy:source",
3404
+ "deploy:hardis:source",
3405
+ "deploy:source:hardis"
3328
3406
  ]
3329
3407
  },
3330
- "hardis:scratch:pull": {
3408
+ "hardis:source:push": {
3331
3409
  "aliases": [],
3332
3410
  "args": {},
3333
- "description": "\n## Command Behavior\n\n**Pulls metadata changes from your scratch org or source-tracked sandbox into your local project files.**\n\nThis command is essential for synchronizing your local development environment with the changes you've made directly in your Salesforce org. After pulling, you can then stage and commit the relevant files to your version control system.\n\nKey features and considerations:\n\n- **Underlying Command:** Internally, this command executes `sf project retrieve start` to fetch the metadata.\n- **Error Handling:** If the pull operation encounters errors, it offers to automatically add the problematic items to your `.forceignore` file and then attempts to pull again, helping you resolve conflicts and ignore unwanted metadata.\n- **Missing Updates:** If you don't see certain updated items in the pull results, you might need to manually retrieve them using the Salesforce Extension's **Org Browser** or the **Salesforce CLI** directly. Refer to the [Retrieve Metadatas documentation](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-publish-task/#retrieve-metadatas) for more details.\n- **Automatic Retrieval:** You can configure the `autoRetrieveWhenPull` property in your `.sfdx-hardis.yml` file to always retrieve specific metadata types (e.g., `CustomApplication`) that might not always be detected as updates by `project:retrieve:start`.\n\nExample `.sfdx-hardis.yml` configuration for `autoRetrieveWhenPull`:\n```yaml\nautoRetrieveWhenPull:\n - CustomApplication:MyCustomApplication\n - CustomApplication:MyOtherCustomApplication\n - CustomApplication:MyThirdCustomApp\n```\n\nFor a visual explanation of the process, watch this video:\n\n<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/Ik6whtflmfY\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation focuses on robust metadata synchronization:\n\n- **Salesforce CLI Wrapper:** It acts as a wrapper around the standard Salesforce CLI `sf project retrieve start` command, providing enhanced error handling and configuration options.\n- **Force Source Pull Utility:** The core logic resides in the `forceSourcePull` utility function, which orchestrates the retrieval process, including handling `.forceignore` updates.\n- **Configuration Integration:** It reads the `autoRetrieveWhenPull` setting from the project's `.sfdx-hardis.yml` to determine additional metadata to retrieve automatically.\n- **User Feedback:** Provides clear messages to the user regarding the pull status and guidance for troubleshooting.\n</details>\n",
3334
- "examples": [
3335
- "$ sf hardis:scratch:pull"
3411
+ "description": "sfdx-hardis wrapper for sfdx force:source:push that displays tips to solve deployment errors.\n\n[![Assisted solving of Salesforce deployments errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)\n\n[See documentation of Salesforce command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_force_source_push)\n",
3412
+ "flags": {
3413
+ "json": {
3414
+ "description": "Format output as json.",
3415
+ "helpGroup": "GLOBAL",
3416
+ "name": "json",
3417
+ "allowNo": false,
3418
+ "type": "boolean"
3419
+ },
3420
+ "flags-dir": {
3421
+ "helpGroup": "GLOBAL",
3422
+ "name": "flags-dir",
3423
+ "summary": "Import flag values from a directory.",
3424
+ "hasDynamicHelp": false,
3425
+ "multiple": false,
3426
+ "type": "option"
3427
+ },
3428
+ "forceoverwrite": {
3429
+ "char": "f",
3430
+ "description": "forceoverwrite",
3431
+ "name": "forceoverwrite",
3432
+ "allowNo": false,
3433
+ "type": "boolean"
3434
+ },
3435
+ "wait": {
3436
+ "char": "w",
3437
+ "description": "wait",
3438
+ "name": "wait",
3439
+ "default": 60,
3440
+ "hasDynamicHelp": false,
3441
+ "multiple": false,
3442
+ "type": "option"
3443
+ },
3444
+ "ignorewarnings": {
3445
+ "char": "g",
3446
+ "description": "ignorewarnings",
3447
+ "name": "ignorewarnings",
3448
+ "allowNo": false,
3449
+ "type": "boolean"
3450
+ },
3451
+ "quiet": {
3452
+ "description": "quiet",
3453
+ "name": "quiet",
3454
+ "allowNo": false,
3455
+ "type": "boolean"
3456
+ },
3457
+ "debug": {
3458
+ "description": "debug",
3459
+ "name": "debug",
3460
+ "allowNo": false,
3461
+ "type": "boolean"
3462
+ },
3463
+ "websocket": {
3464
+ "description": "websocket",
3465
+ "name": "websocket",
3466
+ "hasDynamicHelp": false,
3467
+ "multiple": false,
3468
+ "type": "option"
3469
+ },
3470
+ "target-org": {
3471
+ "aliases": [
3472
+ "targetusername",
3473
+ "u"
3474
+ ],
3475
+ "char": "o",
3476
+ "deprecateAliases": true,
3477
+ "name": "target-org",
3478
+ "noCacheDefault": true,
3479
+ "required": true,
3480
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3481
+ "hasDynamicHelp": true,
3482
+ "multiple": false,
3483
+ "type": "option"
3484
+ }
3485
+ },
3486
+ "hasDynamicHelp": true,
3487
+ "hiddenAliases": [],
3488
+ "id": "hardis:source:push",
3489
+ "pluginAlias": "sfdx-hardis",
3490
+ "pluginName": "sfdx-hardis",
3491
+ "pluginType": "core",
3492
+ "strict": true,
3493
+ "enableJsonFlag": true,
3494
+ "requiresProject": true,
3495
+ "isESM": true,
3496
+ "relativePath": [
3497
+ "lib",
3498
+ "commands",
3499
+ "hardis",
3500
+ "source",
3501
+ "push.js"
3336
3502
  ],
3503
+ "aliasPermutations": [],
3504
+ "permutations": [
3505
+ "hardis:source:push",
3506
+ "source:hardis:push",
3507
+ "source:push:hardis",
3508
+ "hardis:push:source",
3509
+ "push:hardis:source",
3510
+ "push:source:hardis"
3511
+ ]
3512
+ },
3513
+ "hardis:source:retrieve": {
3514
+ "aliases": [],
3515
+ "args": {},
3516
+ "description": "\n## Command Behavior\n\n**A wrapper command for Salesforce CLI's `sf project retrieve start` (formerly `sfdx force:source:retrieve`), with enhanced interactive features.**\n\nThis command facilitates the retrieval of metadata from a Salesforce org into your local project. It provides an assisted experience, especially when no specific retrieval constraints are provided.\n\nKey features:\n\n- **Assisted Metadata Selection:** If no `sourcepath`, `manifest`, `metadata`, or `packagenames` flags are specified, an interactive menu will prompt you to select the metadata types you wish to retrieve.\n- **Assisted Org Selection:** If no target org is specified, an interactive menu will guide you to choose an org for the retrieval operation.\n- **Backward Compatibility:** While this command wraps the newer `sf project retrieve start`, it maintains compatibility with the older `sfdx force:source:retrieve` flags.\n\n**Important Note:** The underlying Salesforce CLI command `sfdx force:source:retrieve` is being deprecated by Salesforce in November 2024. It is recommended to migrate to `sf project retrieve start` for future compatibility. See [Salesforce CLI Migration Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_mig_deploy_retrieve.htm) for more information.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThis command acts as an intelligent wrapper around the Salesforce CLI's source retrieval functionality:\n\n- **Command Wrapping:** It uses the `wrapSfdxCoreCommand` utility to execute the `sfdx force:source:retrieve` (or its equivalent `sf project retrieve start`) command, passing through all relevant flags and arguments.\n- **Interactive Prompts:** It leverages `MetadataUtils.promptMetadataTypes()` and `promptOrgUsernameDefault()` to provide interactive menus for metadata and org selection when the user does not provide them as flags.\n- **Argument Transformation:** It dynamically constructs the command-line arguments for the underlying Salesforce CLI command based on user selections and provided flags.\n- **Error Handling:** It includes basic error handling, such as prompting the user to re-select an org if an issue occurs during org selection.\n- **Deprecation Warning:** It explicitly logs warnings about the deprecation of `sfdx force:source:retrieve` to inform users about upcoming changes.\n</details>\n",
3517
+ "examples": [],
3337
3518
  "flags": {
3338
3519
  "json": {
3339
3520
  "description": "Format output as json.",
@@ -3342,23 +3523,106 @@
3342
3523
  "allowNo": false,
3343
3524
  "type": "boolean"
3344
3525
  },
3345
- "flags-dir": {
3346
- "helpGroup": "GLOBAL",
3347
- "name": "flags-dir",
3348
- "summary": "Import flag values from a directory.",
3349
- "hasDynamicHelp": false,
3350
- "multiple": false,
3351
- "type": "option"
3352
- },
3526
+ "flags-dir": {
3527
+ "helpGroup": "GLOBAL",
3528
+ "name": "flags-dir",
3529
+ "summary": "Import flag values from a directory.",
3530
+ "hasDynamicHelp": false,
3531
+ "multiple": false,
3532
+ "type": "option"
3533
+ },
3534
+ "apiversion": {
3535
+ "char": "a",
3536
+ "description": "Override the api version used for api requests made by this command",
3537
+ "name": "apiversion",
3538
+ "hasDynamicHelp": false,
3539
+ "multiple": false,
3540
+ "type": "option"
3541
+ },
3542
+ "sourcepath": {
3543
+ "char": "p",
3544
+ "description": "sourcePath",
3545
+ "exclusive": [
3546
+ "manifest",
3547
+ "metadata"
3548
+ ],
3549
+ "name": "sourcepath",
3550
+ "hasDynamicHelp": false,
3551
+ "multiple": true,
3552
+ "type": "option"
3553
+ },
3554
+ "wait": {
3555
+ "char": "w",
3556
+ "description": "wait",
3557
+ "name": "wait",
3558
+ "hasDynamicHelp": false,
3559
+ "multiple": false,
3560
+ "type": "option"
3561
+ },
3562
+ "manifest": {
3563
+ "char": "x",
3564
+ "description": "manifest",
3565
+ "exclusive": [
3566
+ "metadata",
3567
+ "sourcepath"
3568
+ ],
3569
+ "name": "manifest",
3570
+ "hasDynamicHelp": false,
3571
+ "multiple": false,
3572
+ "type": "option"
3573
+ },
3574
+ "metadata": {
3575
+ "char": "m",
3576
+ "description": "metadata",
3577
+ "exclusive": [
3578
+ "manifest",
3579
+ "sourcepath"
3580
+ ],
3581
+ "name": "metadata",
3582
+ "hasDynamicHelp": false,
3583
+ "multiple": true,
3584
+ "type": "option"
3585
+ },
3586
+ "packagenames": {
3587
+ "char": "n",
3588
+ "description": "packagenames",
3589
+ "name": "packagenames",
3590
+ "hasDynamicHelp": false,
3591
+ "multiple": true,
3592
+ "type": "option"
3593
+ },
3594
+ "tracksource": {
3595
+ "char": "t",
3596
+ "description": "tracksource",
3597
+ "name": "tracksource",
3598
+ "allowNo": false,
3599
+ "type": "boolean"
3600
+ },
3601
+ "forceoverwrite": {
3602
+ "char": "f",
3603
+ "dependsOn": [
3604
+ "tracksource"
3605
+ ],
3606
+ "description": "forceoverwrite",
3607
+ "name": "forceoverwrite",
3608
+ "allowNo": false,
3609
+ "type": "boolean"
3610
+ },
3611
+ "verbose": {
3612
+ "description": "verbose",
3613
+ "name": "verbose",
3614
+ "allowNo": false,
3615
+ "type": "boolean"
3616
+ },
3353
3617
  "debug": {
3354
3618
  "char": "d",
3355
- "description": "Activate debug mode (more logs)",
3619
+ "description": "debugMode",
3356
3620
  "name": "debug",
3357
3621
  "allowNo": false,
3358
3622
  "type": "boolean"
3359
3623
  },
3360
3624
  "websocket": {
3361
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
3625
+ "description": "websocket",
3362
3626
  "name": "websocket",
3363
3627
  "hasDynamicHelp": false,
3364
3628
  "multiple": false,
@@ -3388,38 +3652,37 @@
3388
3652
  },
3389
3653
  "hasDynamicHelp": true,
3390
3654
  "hiddenAliases": [],
3391
- "id": "hardis:scratch:pull",
3655
+ "id": "hardis:source:retrieve",
3392
3656
  "pluginAlias": "sfdx-hardis",
3393
3657
  "pluginName": "sfdx-hardis",
3394
3658
  "pluginType": "core",
3395
3659
  "strict": true,
3396
3660
  "enableJsonFlag": true,
3397
- "title": "Scratch PULL",
3398
3661
  "requiresProject": true,
3399
3662
  "isESM": true,
3400
3663
  "relativePath": [
3401
3664
  "lib",
3402
3665
  "commands",
3403
3666
  "hardis",
3404
- "scratch",
3405
- "pull.js"
3667
+ "source",
3668
+ "retrieve.js"
3406
3669
  ],
3407
3670
  "aliasPermutations": [],
3408
3671
  "permutations": [
3409
- "hardis:scratch:pull",
3410
- "scratch:hardis:pull",
3411
- "scratch:pull:hardis",
3412
- "hardis:pull:scratch",
3413
- "pull:hardis:scratch",
3414
- "pull:scratch:hardis"
3672
+ "hardis:source:retrieve",
3673
+ "source:hardis:retrieve",
3674
+ "source:retrieve:hardis",
3675
+ "hardis:retrieve:source",
3676
+ "retrieve:hardis:source",
3677
+ "retrieve:source:hardis"
3415
3678
  ]
3416
3679
  },
3417
- "hardis:scratch:push": {
3680
+ "hardis:work:new": {
3418
3681
  "aliases": [],
3419
3682
  "args": {},
3420
- "description": "## Command Behavior\n\n**Pushes local Salesforce DX source files to a scratch org or source-tracked sandbox.**\n\nThis command is a fundamental operation in Salesforce DX development, allowing developers to synchronize their local codebase with their development org. It ensures that changes made locally are reflected in the scratch org, enabling testing and validation.\n\nKey functionalities:\n\n- **Source Synchronization:** Deploys all local changes (metadata and code) to the target scratch org.\n- **Underlying Command:** Internally, this command executes `sf project deploy start` to perform the push operation.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce CLI Wrapper:** It acts as a wrapper around the standard Salesforce CLI `sf project deploy start` command.\n- **`forceSourcePush` Utility:** The core logic resides in the `forceSourcePush` utility function, which orchestrates the deployment process.\n- **Connection Handling:** It uses the connection to the target org to perform the push operation.\n</details>\n",
3683
+ "description": "\n## Command Behavior\n\n**Assisted menu to start working on a Salesforce User Story, streamlining the setup of your development environment.**\n\nThis command guides you through the process of preparing your local environment and a Salesforce org for a new development or configuration based User Story. It automates several steps, ensuring consistency and adherence to project standards.\n\nKey features include:\n\n- **Git Branch Management:** Ensures your local Git repository is up-to-date with the target branch and creates a new Git branch with a formatted name based on your User Story details. Branch naming conventions can be customized via the `branchPrefixChoices` property in `.sfdx-hardis.yml`.\n\n- **Org Provisioning & Initialization:** Facilitates the creation and initialization of either a scratch org or a source-tracked sandbox. The configuration for org initialization (e.g., package installation, source push, permission set assignments, Apex script execution, data loading) can be defined in `config/.sfdx-hardis.yml\n- **Project-Specific Configuration:** Supports defining multiple target branches (`availableTargetBranches`) and projects (`availableProjects`) in `.sfdx-hardis.yml`, allowing for tailored User Stories workflows.\n\n- **User Story Name Validation:** Enforces User Story name formatting using `newTaskNameRegex` and provides examples via `newTaskNameRegexExample\n- **Shared Development Sandboxes:** Accounts for scenarios with shared development sandboxes, adjusting prompts to prevent accidental overwrites.\n\nAdvanced instructions are available in the [Create New User Story documentation](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-create-new-task/).\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's logic orchestrates various underlying processes:\n\n- **Git Operations:** Utilizes `checkGitClean`, `ensureGitBranch`, `gitCheckOutRemote`, and `git().pull()` to manage Git repository state and branches.\n- **Interactive Prompts:** Leverages the `prompts` library to gather user input for User Story type, source types, and User Story names.\n- **Configuration Management:** Reads and applies project-specific configurations from `.sfdx-hardis.yml` using `getConfig` and `setConfig- **Org Initialization Utilities:** Calls a suite of utility functions for org setup, including `initApexScripts`, `initOrgData`, `initOrgMetadatas`, `initPermissionSetAssignments`, `installPackages`, and `makeSureOrgIsConnected- **Salesforce CLI Interaction:** Executes Salesforce CLI commands (e.g., `sf config set target-org`, `sf org open`, `sf project delete tracking`) via `execCommand` and `execSfdxJson- **Dynamic Org Selection:** Presents choices for scratch orgs or sandboxes based on project configuration and existing orgs, dynamically calling `ScratchCreate.run` or `SandboxCreate.run` as needed.\n- **WebSocket Communication:** Sends refresh status messages via `WebSocketClient.sendRefreshStatusMessage()` to update connected VS Code clients.\n</details>\n",
3421
3684
  "examples": [
3422
- "$ sf hardis:scratch:push"
3685
+ "$ sf hardis:work:new"
3423
3686
  ],
3424
3687
  "flags": {
3425
3688
  "json": {
@@ -3457,6 +3720,20 @@
3457
3720
  "allowNo": false,
3458
3721
  "type": "boolean"
3459
3722
  },
3723
+ "target-dev-hub": {
3724
+ "aliases": [
3725
+ "targetdevhubusername"
3726
+ ],
3727
+ "char": "v",
3728
+ "deprecateAliases": true,
3729
+ "name": "target-dev-hub",
3730
+ "noCacheDefault": true,
3731
+ "required": false,
3732
+ "summary": "Username or alias of the Dev Hub org.",
3733
+ "hasDynamicHelp": true,
3734
+ "multiple": false,
3735
+ "type": "option"
3736
+ },
3460
3737
  "target-org": {
3461
3738
  "aliases": [
3462
3739
  "targetusername",
@@ -3466,8 +3743,7 @@
3466
3743
  "deprecateAliases": true,
3467
3744
  "name": "target-org",
3468
3745
  "noCacheDefault": true,
3469
- "required": true,
3470
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3746
+ "summary": "Username or alias of the target org.",
3471
3747
  "hasDynamicHelp": true,
3472
3748
  "multiple": false,
3473
3749
  "type": "option"
@@ -3475,254 +3751,82 @@
3475
3751
  },
3476
3752
  "hasDynamicHelp": true,
3477
3753
  "hiddenAliases": [],
3478
- "id": "hardis:scratch:push",
3754
+ "id": "hardis:work:new",
3479
3755
  "pluginAlias": "sfdx-hardis",
3480
3756
  "pluginName": "sfdx-hardis",
3481
3757
  "pluginType": "core",
3482
3758
  "strict": true,
3483
3759
  "enableJsonFlag": true,
3484
- "title": "Scratch PUSH",
3760
+ "title": "New User Story",
3485
3761
  "requiresProject": true,
3486
3762
  "isESM": true,
3487
3763
  "relativePath": [
3488
3764
  "lib",
3489
3765
  "commands",
3490
3766
  "hardis",
3491
- "scratch",
3492
- "push.js"
3767
+ "work",
3768
+ "new.js"
3493
3769
  ],
3494
3770
  "aliasPermutations": [],
3495
3771
  "permutations": [
3496
- "hardis:scratch:push",
3497
- "scratch:hardis:push",
3498
- "scratch:push:hardis",
3499
- "hardis:push:scratch",
3500
- "push:hardis:scratch",
3501
- "push:scratch:hardis"
3772
+ "hardis:work:new",
3773
+ "work:hardis:new",
3774
+ "work:new:hardis",
3775
+ "hardis:new:work",
3776
+ "new:hardis:work",
3777
+ "new:work:hardis"
3502
3778
  ]
3503
3779
  },
3504
- "hardis:source:deploy": {
3780
+ "hardis:work:refresh": {
3505
3781
  "aliases": [],
3506
3782
  "args": {},
3507
- "description": "sfdx-hardis wrapper for sfdx force:source:deploy that displays tips to solve deployment errors.\n\nAdditional to the base command wrapper: If using **--checkonly**, add options **--checkcoverage** and **--coverageformatters json-summary** to check that org coverage is > 75% (or value defined in .sfdx-hardis.yml property **apexTestsMinCoverageOrgWide**)\n\n### Deployment results\n\nYou can also have deployment results as pull request comments, on:\n\n- GitHub (see [GitHub Pull Requests comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-github/))\n- Gitlab (see [Gitlab integration configuration](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/))\n- Azure DevOps (see [Azure integration configuration](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-azure/))\n\n\n[![Assisted solving of Salesforce deployments errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)\n\n### Deployment pre or post commands\n\nYou can define command lines to run before or after a deployment, with parameters:\n\n- **id**: Unique Id for the command\n- **label**: Human readable label for the command\n- **skipIfError**: If defined to \"true\", the post-command won't be run if there is a deployment failure\n- **context**: Defines the context where the command will be run. Can be **all** (default), **check-deployment-only** or **process-deployment-only**\n- **runOnlyOnceByOrg**: If set to true, the command will be run only one time per org. A record of SfdxHardisTrace__c is stored to make that possible (it needs to be existing in target org)\n\nIf the commands are not the same depending on the target org, you can define them into **config/branches/.sfdx-hardis-BRANCHNAME.yml** instead of root **config/.sfdx-hardis.yml**\n\nExample:\n\n```yaml\ncommandsPreDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to the deployment user\n command: sf data update record --sobject User --where \"Username='deploy.github@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n\ncommandsPostDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to desired username\n command: sf data update record --sobject User --where \"Username='admin-yser@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n - id: someActionToRunJustOneTime\n label: And to run only if deployment is success\n command: sf sfdmu:run ...\n skipIfError: true\n context: process-deployment-only\n runOnlyOnceByOrg: true\n```\n\nNotes:\n\n- You can disable coloring of errors in red by defining env variable SFDX_HARDIS_DEPLOY_ERR_COLORS=false\n\n[See documentation of Salesforce command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_force_source_deploy)\n",
3508
- "examples": [
3509
- "$ sf hardis:source:deploy -x manifest/package.xml --wait 60 --ignorewarnings --testlevel RunLocalTests --postdestructivechanges ./manifest/destructiveChanges.xml --target-org nicolas.vuillamy@cloudity.com.sfdxhardis --checkonly --checkcoverage --verbose --coverageformatters json-summary"
3510
- ],
3511
- "flags": {
3512
- "json": {
3513
- "description": "Format output as json.",
3514
- "helpGroup": "GLOBAL",
3515
- "name": "json",
3516
- "allowNo": false,
3517
- "type": "boolean"
3518
- },
3519
- "flags-dir": {
3520
- "helpGroup": "GLOBAL",
3521
- "name": "flags-dir",
3522
- "summary": "Import flag values from a directory.",
3523
- "hasDynamicHelp": false,
3524
- "multiple": false,
3525
- "type": "option"
3526
- },
3527
- "checkonly": {
3528
- "char": "c",
3529
- "description": "checkonly",
3530
- "name": "checkonly",
3531
- "allowNo": false,
3532
- "type": "boolean"
3533
- },
3534
- "soapdeploy": {
3535
- "description": "soapDeploy",
3536
- "name": "soapdeploy",
3537
- "allowNo": false,
3538
- "type": "boolean"
3539
- },
3540
- "wait": {
3541
- "char": "w",
3542
- "description": "wait",
3543
- "name": "wait",
3544
- "default": 60,
3545
- "hasDynamicHelp": false,
3546
- "multiple": false,
3547
- "type": "option"
3548
- },
3549
- "testlevel": {
3550
- "char": "l",
3551
- "description": "testlevel",
3552
- "name": "testlevel",
3553
- "default": "NoTestRun",
3554
- "hasDynamicHelp": false,
3555
- "multiple": false,
3556
- "options": [
3557
- "NoTestRun",
3558
- "RunSpecifiedTests",
3559
- "RunLocalTests",
3560
- "RunAllTestsInOrg"
3561
- ],
3562
- "type": "option"
3563
- },
3564
- "runtests": {
3565
- "char": "r",
3566
- "description": "runTests",
3567
- "name": "runtests",
3568
- "default": [],
3569
- "hasDynamicHelp": false,
3570
- "multiple": true,
3571
- "type": "option"
3572
- },
3573
- "ignoreerrors": {
3574
- "description": "ignoreErrors",
3575
- "name": "ignoreerrors",
3576
- "allowNo": false,
3577
- "type": "boolean"
3578
- },
3579
- "ignorewarnings": {
3580
- "char": "g",
3581
- "description": "ignoreWarnings",
3582
- "name": "ignorewarnings",
3583
- "allowNo": false,
3584
- "type": "boolean"
3585
- },
3586
- "validateddeployrequestid": {
3587
- "char": "q",
3588
- "description": "validateDeployRequestId",
3589
- "exclusive": [
3590
- "manifest",
3591
- "metadata",
3592
- "sourcepath",
3593
- "checkonly",
3594
- "testlevel",
3595
- "runtests",
3596
- "ignoreerrors",
3597
- "ignorewarnings"
3598
- ],
3599
- "name": "validateddeployrequestid",
3600
- "hasDynamicHelp": false,
3601
- "multiple": false,
3602
- "type": "option"
3603
- },
3604
- "verbose": {
3605
- "description": "verbose",
3606
- "name": "verbose",
3607
- "allowNo": false,
3608
- "type": "boolean"
3609
- },
3610
- "metadata": {
3611
- "char": "m",
3612
- "description": "metadata",
3613
- "exclusive": [
3614
- "manifest",
3615
- "sourcepath"
3616
- ],
3617
- "name": "metadata",
3618
- "hasDynamicHelp": false,
3619
- "multiple": true,
3620
- "type": "option"
3621
- },
3622
- "sourcepath": {
3623
- "char": "p",
3624
- "description": "sourcePath",
3625
- "exclusive": [
3626
- "manifest",
3627
- "metadata"
3628
- ],
3629
- "name": "sourcepath",
3630
- "hasDynamicHelp": false,
3631
- "multiple": true,
3632
- "type": "option"
3633
- },
3634
- "manifest": {
3635
- "char": "x",
3636
- "description": "flagsLong.manifest",
3637
- "exclusive": [
3638
- "metadata",
3639
- "sourcepath"
3640
- ],
3641
- "name": "manifest",
3642
- "hasDynamicHelp": false,
3643
- "multiple": false,
3644
- "type": "option"
3645
- },
3646
- "predestructivechanges": {
3647
- "dependsOn": [
3648
- "manifest"
3649
- ],
3650
- "description": "predestructivechanges",
3651
- "name": "predestructivechanges",
3652
- "hasDynamicHelp": false,
3653
- "multiple": false,
3654
- "type": "option"
3655
- },
3656
- "postdestructivechanges": {
3657
- "dependsOn": [
3658
- "manifest"
3659
- ],
3660
- "description": "postdestructivechanges",
3661
- "name": "postdestructivechanges",
3662
- "hasDynamicHelp": false,
3663
- "multiple": false,
3664
- "type": "option"
3665
- },
3666
- "tracksource": {
3667
- "char": "t",
3668
- "description": "tracksource",
3669
- "exclusive": [
3670
- "checkonly",
3671
- "validateddeployrequestid"
3672
- ],
3673
- "name": "tracksource",
3674
- "allowNo": false,
3675
- "type": "boolean"
3676
- },
3677
- "forceoverwrite": {
3678
- "char": "f",
3679
- "dependsOn": [
3680
- "tracksource"
3681
- ],
3682
- "description": "forceoverwrite",
3683
- "name": "forceoverwrite",
3783
+ "description": "\n## Command Behavior\n\n**Refreshes your local Git branch and Salesforce org with the latest content from another Git branch.**\n\nThis command is designed to help developers keep their local development environment synchronized with changes made by other team members. It automates the process of pulling updates from a designated branch, merging them into your current working branch, and then pushing those changes to your scratch org or source-tracked sandbox.\n\nKey functionalities:\n\n- **Pre-Merge Check:** Prompts the user to confirm that they have saved their current work before proceeding with the merge, preventing accidental data loss.\n- **Branch Selection:** Allows you to select a target Git branch (e.g., `integration`, `preprod`) from which to pull updates.\n- **Git Operations:** Performs a series of Git operations:\n - Pulls the latest version of the selected merge branch.\n - Stashes your uncommitted local changes before merging.\n - Merges the selected branch into your current local branch.\n - Handles merge conflicts interactively, prompting the user to resolve them.\n - Restores your stashed changes after the merge.\n- **Org Synchronization:** Pushes the updated local branch content to your scratch org or source-tracked sandbox, ensuring your org reflects the latest merged code.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Loading:** It retrieves project configurations using `getConfig` to determine the default development branch.\n- **Git Integration:** Extensively uses `simple-git` (`git()`) for various Git operations:\n - `git().branch()`: Lists local and remote branches.\n - `git().stash()`: Saves and restores uncommitted changes.\n - `git().fetch()`: Fetches updates from remote repositories.\n - `git().checkout()`: Switches between branches.\n - `git().pull()`: Pulls changes from a remote branch.\n - `git().merge()`: Merges one branch into another, handling conflicts.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through confirmations (e.g., saving work) and branch selection.\n- **Salesforce CLI Integration:** It uses `forceSourcePull` to pull changes from the scratch org and `forceSourcePush` to push changes to the scratch org.\n- **Error Handling:** Includes robust error handling for Git operations (e.g., merge conflicts) and provides guidance to the user for resolution.\n- **Environment Variable Check:** Checks for an `EXPERIMENTAL` environment variable to gate access to this command, indicating it might not be fully stable.\n</details>\n",
3784
+ "examples": [
3785
+ "$ sf hardis:work:refresh"
3786
+ ],
3787
+ "flags": {
3788
+ "json": {
3789
+ "description": "Format output as json.",
3790
+ "helpGroup": "GLOBAL",
3791
+ "name": "json",
3684
3792
  "allowNo": false,
3685
3793
  "type": "boolean"
3686
3794
  },
3687
- "resultsdir": {
3688
- "description": "resultsdir",
3689
- "name": "resultsdir",
3795
+ "flags-dir": {
3796
+ "helpGroup": "GLOBAL",
3797
+ "name": "flags-dir",
3798
+ "summary": "Import flag values from a directory.",
3690
3799
  "hasDynamicHelp": false,
3691
3800
  "multiple": false,
3692
3801
  "type": "option"
3693
3802
  },
3694
- "coverageformatters": {
3695
- "description": "coverageformatters",
3696
- "name": "coverageformatters",
3697
- "hasDynamicHelp": false,
3698
- "multiple": true,
3699
- "type": "option"
3700
- },
3701
- "junit": {
3702
- "description": "junit",
3703
- "name": "junit",
3704
- "allowNo": false,
3705
- "type": "boolean"
3706
- },
3707
- "checkcoverage": {
3708
- "description": "Check Apex org coverage",
3709
- "name": "checkcoverage",
3803
+ "nopull": {
3804
+ "char": "n",
3805
+ "description": "No scratch pull before save (careful if you use that!)",
3806
+ "name": "nopull",
3710
3807
  "allowNo": false,
3711
3808
  "type": "boolean"
3712
3809
  },
3713
3810
  "debug": {
3714
- "description": "debug",
3811
+ "char": "d",
3812
+ "description": "Activate debug mode (more logs)",
3715
3813
  "name": "debug",
3716
3814
  "allowNo": false,
3717
3815
  "type": "boolean"
3718
3816
  },
3719
3817
  "websocket": {
3720
- "description": "websocket",
3818
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
3721
3819
  "name": "websocket",
3722
3820
  "hasDynamicHelp": false,
3723
3821
  "multiple": false,
3724
3822
  "type": "option"
3725
3823
  },
3824
+ "skipauth": {
3825
+ "description": "Skip authentication check when a default username is required",
3826
+ "name": "skipauth",
3827
+ "allowNo": false,
3828
+ "type": "boolean"
3829
+ },
3726
3830
  "target-org": {
3727
3831
  "aliases": [
3728
3832
  "targetusername",
@@ -3741,35 +3845,39 @@
3741
3845
  },
3742
3846
  "hasDynamicHelp": true,
3743
3847
  "hiddenAliases": [],
3744
- "id": "hardis:source:deploy",
3848
+ "id": "hardis:work:refresh",
3745
3849
  "pluginAlias": "sfdx-hardis",
3746
3850
  "pluginName": "sfdx-hardis",
3747
3851
  "pluginType": "core",
3748
3852
  "strict": true,
3749
3853
  "enableJsonFlag": true,
3854
+ "title": "Refresh User Story branch",
3750
3855
  "requiresProject": true,
3751
3856
  "isESM": true,
3752
3857
  "relativePath": [
3753
3858
  "lib",
3754
3859
  "commands",
3755
3860
  "hardis",
3756
- "source",
3757
- "deploy.js"
3861
+ "work",
3862
+ "refresh.js"
3758
3863
  ],
3759
3864
  "aliasPermutations": [],
3760
3865
  "permutations": [
3761
- "hardis:source:deploy",
3762
- "source:hardis:deploy",
3763
- "source:deploy:hardis",
3764
- "hardis:deploy:source",
3765
- "deploy:hardis:source",
3766
- "deploy:source:hardis"
3866
+ "hardis:work:refresh",
3867
+ "work:hardis:refresh",
3868
+ "work:refresh:hardis",
3869
+ "hardis:refresh:work",
3870
+ "refresh:hardis:work",
3871
+ "refresh:work:hardis"
3767
3872
  ]
3768
3873
  },
3769
- "hardis:source:push": {
3874
+ "hardis:work:resetselection": {
3770
3875
  "aliases": [],
3771
3876
  "args": {},
3772
- "description": "sfdx-hardis wrapper for sfdx force:source:push that displays tips to solve deployment errors.\n\n[![Assisted solving of Salesforce deployments errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)\n\n[See documentation of Salesforce command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_force_source_push)\n",
3877
+ "description": "\n## Command Behavior\n\n**Resets the local Git repository to allow for a new selection of files to be included in a merge request.**\n\nThis command is designed to be used when you need to re-evaluate which changes should be part of your next merge request. It performs a soft Git reset, effectively unstaging all committed changes since the last merge with the target branch, and then cleans up any generated files.\n\nKey functionalities:\n\n- **Target Branch Selection:** Prompts you to select the target branch of your current or future merge request.\n- **Soft Git Reset:** Performs a `git reset --soft` operation to uncommit changes, moving the HEAD pointer back but keeping the changes in your working directory.\n- **Generated File Cleanup:** Resets and checks out `manifest/package.xml` and `manifest/destructiveChanges.xml` to their state before the reset, ensuring a clean slate for new selections.\n- **Force Push Authorization:** Sets a flag in your user configuration (`canForcePush: true`) to allow a force push in the subsequent `hardis:work:save` command, as the history will have been rewritten.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Git Integration:** Uses `simple-git` (`git()`) to interact with the Git repository:\n - `git().branch()`: Retrieves information about local and remote branches.\n - `git().log()`: Fetches the commit history to determine which commits to reset.\n - `git().reset()`: Performs the soft reset operation.\n - `git().checkout()`: Resets specific files (`package.xml`, `destructiveChanges.xml`) to their previous state.\n - `git().status()`: Displays the current status of the Git repository after the reset.\n- **Interactive Prompts:** Uses the `prompts` library to confirm the reset operation with the user and to select the target branch.\n- **Configuration Management:** Updates the user's configuration (`.sfdx-hardis.yml`) using `setConfig` to set the `canForcePush` flag.\n- **Error Handling:** Includes a check to prevent resetting protected branches.\n</details>\n",
3878
+ "examples": [
3879
+ "$ sf hardis:work:resetsave"
3880
+ ],
3773
3881
  "flags": {
3774
3882
  "json": {
3775
3883
  "description": "Format output as json.",
@@ -3786,48 +3894,26 @@
3786
3894
  "multiple": false,
3787
3895
  "type": "option"
3788
3896
  },
3789
- "forceoverwrite": {
3790
- "char": "f",
3791
- "description": "forceoverwrite",
3792
- "name": "forceoverwrite",
3793
- "allowNo": false,
3794
- "type": "boolean"
3795
- },
3796
- "wait": {
3797
- "char": "w",
3798
- "description": "wait",
3799
- "name": "wait",
3800
- "default": 60,
3801
- "hasDynamicHelp": false,
3802
- "multiple": false,
3803
- "type": "option"
3804
- },
3805
- "ignorewarnings": {
3806
- "char": "g",
3807
- "description": "ignorewarnings",
3808
- "name": "ignorewarnings",
3809
- "allowNo": false,
3810
- "type": "boolean"
3811
- },
3812
- "quiet": {
3813
- "description": "quiet",
3814
- "name": "quiet",
3815
- "allowNo": false,
3816
- "type": "boolean"
3817
- },
3818
3897
  "debug": {
3819
- "description": "debug",
3898
+ "char": "d",
3899
+ "description": "Activate debug mode (more logs)",
3820
3900
  "name": "debug",
3821
3901
  "allowNo": false,
3822
3902
  "type": "boolean"
3823
3903
  },
3824
3904
  "websocket": {
3825
- "description": "websocket",
3905
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
3826
3906
  "name": "websocket",
3827
3907
  "hasDynamicHelp": false,
3828
3908
  "multiple": false,
3829
3909
  "type": "option"
3830
3910
  },
3911
+ "skipauth": {
3912
+ "description": "Skip authentication check when a default username is required",
3913
+ "name": "skipauth",
3914
+ "allowNo": false,
3915
+ "type": "boolean"
3916
+ },
3831
3917
  "target-org": {
3832
3918
  "aliases": [
3833
3919
  "targetusername",
@@ -3846,36 +3932,40 @@
3846
3932
  },
3847
3933
  "hasDynamicHelp": true,
3848
3934
  "hiddenAliases": [],
3849
- "id": "hardis:source:push",
3935
+ "id": "hardis:work:resetselection",
3850
3936
  "pluginAlias": "sfdx-hardis",
3851
3937
  "pluginName": "sfdx-hardis",
3852
3938
  "pluginType": "core",
3853
3939
  "strict": true,
3854
3940
  "enableJsonFlag": true,
3941
+ "title": "Select again",
3855
3942
  "requiresProject": true,
3856
3943
  "isESM": true,
3857
3944
  "relativePath": [
3858
3945
  "lib",
3859
3946
  "commands",
3860
3947
  "hardis",
3861
- "source",
3862
- "push.js"
3948
+ "work",
3949
+ "resetselection.js"
3863
3950
  ],
3864
3951
  "aliasPermutations": [],
3865
3952
  "permutations": [
3866
- "hardis:source:push",
3867
- "source:hardis:push",
3868
- "source:push:hardis",
3869
- "hardis:push:source",
3870
- "push:hardis:source",
3871
- "push:source:hardis"
3953
+ "hardis:work:resetselection",
3954
+ "work:hardis:resetselection",
3955
+ "work:resetselection:hardis",
3956
+ "hardis:resetselection:work",
3957
+ "resetselection:hardis:work",
3958
+ "resetselection:work:hardis"
3872
3959
  ]
3873
3960
  },
3874
- "hardis:source:retrieve": {
3961
+ "hardis:work:save": {
3875
3962
  "aliases": [],
3876
3963
  "args": {},
3877
- "description": "\n## Command Behavior\n\n**A wrapper command for Salesforce CLI's `sf project retrieve start` (formerly `sfdx force:source:retrieve`), with enhanced interactive features.**\n\nThis command facilitates the retrieval of metadata from a Salesforce org into your local project. It provides an assisted experience, especially when no specific retrieval constraints are provided.\n\nKey features:\n\n- **Assisted Metadata Selection:** If no `sourcepath`, `manifest`, `metadata`, or `packagenames` flags are specified, an interactive menu will prompt you to select the metadata types you wish to retrieve.\n- **Assisted Org Selection:** If no target org is specified, an interactive menu will guide you to choose an org for the retrieval operation.\n- **Backward Compatibility:** While this command wraps the newer `sf project retrieve start`, it maintains compatibility with the older `sfdx force:source:retrieve` flags.\n\n**Important Note:** The underlying Salesforce CLI command `sfdx force:source:retrieve` is being deprecated by Salesforce in November 2024. It is recommended to migrate to `sf project retrieve start` for future compatibility. See [Salesforce CLI Migration Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_mig_deploy_retrieve.htm) for more information.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThis command acts as an intelligent wrapper around the Salesforce CLI's source retrieval functionality:\n\n- **Command Wrapping:** It uses the `wrapSfdxCoreCommand` utility to execute the `sfdx force:source:retrieve` (or its equivalent `sf project retrieve start`) command, passing through all relevant flags and arguments.\n- **Interactive Prompts:** It leverages `MetadataUtils.promptMetadataTypes()` and `promptOrgUsernameDefault()` to provide interactive menus for metadata and org selection when the user does not provide them as flags.\n- **Argument Transformation:** It dynamically constructs the command-line arguments for the underlying Salesforce CLI command based on user selections and provided flags.\n- **Error Handling:** It includes basic error handling, such as prompting the user to re-select an org if an issue occurs during org selection.\n- **Deprecation Warning:** It explicitly logs warnings about the deprecation of `sfdx force:source:retrieve` to inform users about upcoming changes.\n</details>\n",
3878
- "examples": [],
3964
+ "description": "\n## Command Behavior\n\n**Guides the user through the process of saving their work, preparing it for a Merge Request (also named Pull Request), and pushing changes to the remote Git repository.**\n\nThis command automates several critical steps involved in finalizing a development User Story and integrating it into the main codebase. It ensures that your local changes are properly synchronized, cleaned, and committed before being pushed.\n\nKey functionalities include:\n\n- **Git Status Management:** Ensures a clean Git working directory by handling ongoing merges and unstaging files.\n- **Org Synchronization (Optional):** Prompts the user to pull the latest metadata updates from their scratch org or source-tracked sandbox, ensuring local files reflect the org's state.\n- **Package.xml Updates:** Automatically generates `package.xml` and `destructiveChanges.xml` files based on the Git delta between your current branch and the target branch, reflecting added, modified, and deleted metadata.\n- **Automated Source Cleaning:** Applies predefined cleaning operations to your local Salesforce sources, such as removing unwanted references, minimizing profiles, or cleaning XML files based on configurations in your `.sfdx-hardis.yml`.\n - `autoCleanTypes`: A list of automated source cleanings, configurable via [hardis:project:clean:references](${CONSTANTS.DOC_URL_ROOT}/hardis/project/clean/references/).\n - `autoRemoveUserPermissions`: A list of user permissions to automatically remove from profile metadata.\n- **Deployment Plan Generation:** Builds an automated deployment plan based on the updated `package.xml` and configured deployment splits.\n- **Commit and Push:** Guides the user to commit the changes and push them to the remote Git repository, optionally handling force pushes if a branch reset occurred.\n- **Merge Request Guidance:** Provides information and links to facilitate the creation of a merge request after the changes are pushed.\n\nExample `.sfdx-hardis.yml` configuration:\n\n```yaml\nautoCleanTypes:\n - checkPermissions\n - destructivechanges\n - datadotcom\n - minimizeProfiles\n - listViewsMine\nautoRemoveUserPermissions:\n - EnableCommunityAppLauncher\n - FieldServiceAccess\n - OmnichannelInventorySync\n - SendExternalEmailAvailable\n - UseOmnichannelInventoryAPIs\n - ViewDataLeakageEvents\n - ViewMLModels\n - ViewPlatformEvents\n - WorkCalibrationUser\n```\n\nAdvanced instructions are available in the [Publish a User Story documentation](${CONSTANTS.DOC_URL_ROOT}/salesforce-ci-cd-publish-task/).\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves a series of orchestrated steps:\n\n- **Git Integration:** Extensively uses the `git` utility for status checks, adding files, committing, and pushing. It also leverages `sfdx-git-delta` for generating metadata differences between Git revisions.\n- **Interactive Prompts:** Employs the `prompts` library to interact with the user for decisions like pulling sources or pushing commits.\n- **Configuration Management:** Reads and updates project and user configurations using `getConfig` and `setConfig` to store preferences and deployment plans.\n- **Metadata Synchronization:** Calls `forceSourcePull` to retrieve metadata from the org and `callSfdxGitDelta` to generate `package.xml` and `destructiveChanges.xml` based on Git changes.\n- **XML Manipulation:** Utilizes `appendPackageXmlFilesContent`, `removePackageXmlFilesContent`, `parseXmlFile`, and `writeXmlFile` for modifying `package.xml` and `destructiveChanges.xml` files.\n- **Automated Cleaning:** Integrates with `CleanReferences.run` and `CleanXml.run` commands to perform automated cleaning operations on the Salesforce source files.\n- **Deployment Plan Building:** Dynamically constructs a deployment plan by analyzing the `package.xml` content and applying configured deployment splits.\n- **WebSocket Communication:** Uses `WebSocketClient.sendRefreshStatusMessage` to notify connected VS Code clients about status updates.\n- **External Tool Integration:** Requires the `sfdx-git-delta` plugin to be installed for its core functionality.\n</details>\n",
3965
+ "examples": [
3966
+ "$ sf hardis:work:task:save",
3967
+ "$ sf hardis:work:task:save --nopull --nogit --noclean"
3968
+ ],
3879
3969
  "flags": {
3880
3970
  "json": {
3881
3971
  "description": "Format output as json.",
@@ -3892,98 +3982,49 @@
3892
3982
  "multiple": false,
3893
3983
  "type": "option"
3894
3984
  },
3895
- "apiversion": {
3896
- "char": "a",
3897
- "description": "Override the api version used for api requests made by this command",
3898
- "name": "apiversion",
3899
- "hasDynamicHelp": false,
3900
- "multiple": false,
3901
- "type": "option"
3902
- },
3903
- "sourcepath": {
3904
- "char": "p",
3905
- "description": "sourcePath",
3906
- "exclusive": [
3907
- "manifest",
3908
- "metadata"
3909
- ],
3910
- "name": "sourcepath",
3911
- "hasDynamicHelp": false,
3912
- "multiple": true,
3913
- "type": "option"
3914
- },
3915
- "wait": {
3916
- "char": "w",
3917
- "description": "wait",
3918
- "name": "wait",
3919
- "hasDynamicHelp": false,
3920
- "multiple": false,
3921
- "type": "option"
3922
- },
3923
- "manifest": {
3924
- "char": "x",
3925
- "description": "manifest",
3926
- "exclusive": [
3927
- "metadata",
3928
- "sourcepath"
3929
- ],
3930
- "name": "manifest",
3931
- "hasDynamicHelp": false,
3932
- "multiple": false,
3933
- "type": "option"
3934
- },
3935
- "metadata": {
3936
- "char": "m",
3937
- "description": "metadata",
3938
- "exclusive": [
3939
- "manifest",
3940
- "sourcepath"
3941
- ],
3942
- "name": "metadata",
3943
- "hasDynamicHelp": false,
3944
- "multiple": true,
3945
- "type": "option"
3946
- },
3947
- "packagenames": {
3985
+ "nopull": {
3948
3986
  "char": "n",
3949
- "description": "packagenames",
3950
- "name": "packagenames",
3951
- "hasDynamicHelp": false,
3952
- "multiple": true,
3953
- "type": "option"
3987
+ "description": "No scratch pull before save",
3988
+ "name": "nopull",
3989
+ "allowNo": false,
3990
+ "type": "boolean"
3954
3991
  },
3955
- "tracksource": {
3956
- "char": "t",
3957
- "description": "tracksource",
3958
- "name": "tracksource",
3992
+ "nogit": {
3993
+ "char": "g",
3994
+ "description": "No automated git operations",
3995
+ "name": "nogit",
3959
3996
  "allowNo": false,
3960
3997
  "type": "boolean"
3961
3998
  },
3962
- "forceoverwrite": {
3963
- "char": "f",
3964
- "dependsOn": [
3965
- "tracksource"
3966
- ],
3967
- "description": "forceoverwrite",
3968
- "name": "forceoverwrite",
3999
+ "noclean": {
4000
+ "char": "c",
4001
+ "description": "No cleaning of local sources",
4002
+ "name": "noclean",
3969
4003
  "allowNo": false,
3970
4004
  "type": "boolean"
3971
4005
  },
3972
- "verbose": {
3973
- "description": "verbose",
3974
- "name": "verbose",
4006
+ "auto": {
4007
+ "description": "No user prompts (when called from CI for example)",
4008
+ "name": "auto",
3975
4009
  "allowNo": false,
3976
4010
  "type": "boolean"
3977
4011
  },
4012
+ "targetbranch": {
4013
+ "description": "Name of the Merge Request target branch. Will be guessed or prompted if not provided.",
4014
+ "name": "targetbranch",
4015
+ "hasDynamicHelp": false,
4016
+ "multiple": false,
4017
+ "type": "option"
4018
+ },
3978
4019
  "debug": {
3979
4020
  "char": "d",
3980
- "description": "debugMode",
4021
+ "description": "Activate debug mode (more logs)",
3981
4022
  "name": "debug",
3982
4023
  "allowNo": false,
3983
4024
  "type": "boolean"
3984
4025
  },
3985
4026
  "websocket": {
3986
- "description": "websocket",
4027
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
3987
4028
  "name": "websocket",
3988
4029
  "hasDynamicHelp": false,
3989
4030
  "multiple": false,
@@ -4013,37 +4054,41 @@
4013
4054
  },
4014
4055
  "hasDynamicHelp": true,
4015
4056
  "hiddenAliases": [],
4016
- "id": "hardis:source:retrieve",
4057
+ "id": "hardis:work:save",
4017
4058
  "pluginAlias": "sfdx-hardis",
4018
4059
  "pluginName": "sfdx-hardis",
4019
4060
  "pluginType": "core",
4020
4061
  "strict": true,
4021
4062
  "enableJsonFlag": true,
4063
+ "title": "Save User Story",
4022
4064
  "requiresProject": true,
4065
+ "requiresSfdxPlugins": [
4066
+ "sfdx-git-delta"
4067
+ ],
4023
4068
  "isESM": true,
4024
4069
  "relativePath": [
4025
4070
  "lib",
4026
4071
  "commands",
4027
4072
  "hardis",
4028
- "source",
4029
- "retrieve.js"
4073
+ "work",
4074
+ "save.js"
4030
4075
  ],
4031
4076
  "aliasPermutations": [],
4032
4077
  "permutations": [
4033
- "hardis:source:retrieve",
4034
- "source:hardis:retrieve",
4035
- "source:retrieve:hardis",
4036
- "hardis:retrieve:source",
4037
- "retrieve:hardis:source",
4038
- "retrieve:source:hardis"
4078
+ "hardis:work:save",
4079
+ "work:hardis:save",
4080
+ "work:save:hardis",
4081
+ "hardis:save:work",
4082
+ "save:hardis:work",
4083
+ "save:work:hardis"
4039
4084
  ]
4040
4085
  },
4041
- "hardis:work:new": {
4086
+ "hardis:work:ws": {
4042
4087
  "aliases": [],
4043
4088
  "args": {},
4044
- "description": "\n## Command Behavior\n\n**Assisted menu to start working on a Salesforce User Story, streamlining the setup of your development environment.**\n\nThis command guides you through the process of preparing your local environment and a Salesforce org for a new development or configuration based User Story. It automates several steps, ensuring consistency and adherence to project standards.\n\nKey features include:\n\n- **Git Branch Management:** Ensures your local Git repository is up-to-date with the target branch and creates a new Git branch with a formatted name based on your User Story details. Branch naming conventions can be customized via the `branchPrefixChoices` property in `.sfdx-hardis.yml`.\n\n- **Org Provisioning & Initialization:** Facilitates the creation and initialization of either a scratch org or a source-tracked sandbox. The configuration for org initialization (e.g., package installation, source push, permission set assignments, Apex script execution, data loading) can be defined in `config/.sfdx-hardis.yml\n- **Project-Specific Configuration:** Supports defining multiple target branches (`availableTargetBranches`) and projects (`availableProjects`) in `.sfdx-hardis.yml`, allowing for tailored User Stories workflows.\n\n- **User Story Name Validation:** Enforces User Story name formatting using `newTaskNameRegex` and provides examples via `newTaskNameRegexExample\n- **Shared Development Sandboxes:** Accounts for scenarios with shared development sandboxes, adjusting prompts to prevent accidental overwrites.\n\nAdvanced instructions are available in the [Create New User Story documentation](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-create-new-task/).\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's logic orchestrates various underlying processes:\n\n- **Git Operations:** Utilizes `checkGitClean`, `ensureGitBranch`, `gitCheckOutRemote`, and `git().pull()` to manage Git repository state and branches.\n- **Interactive Prompts:** Leverages the `prompts` library to gather user input for User Story type, source types, and User Story names.\n- **Configuration Management:** Reads and applies project-specific configurations from `.sfdx-hardis.yml` using `getConfig` and `setConfig- **Org Initialization Utilities:** Calls a suite of utility functions for org setup, including `initApexScripts`, `initOrgData`, `initOrgMetadatas`, `initPermissionSetAssignments`, `installPackages`, and `makeSureOrgIsConnected- **Salesforce CLI Interaction:** Executes Salesforce CLI commands (e.g., `sf config set target-org`, `sf org open`, `sf project delete tracking`) via `execCommand` and `execSfdxJson- **Dynamic Org Selection:** Presents choices for scratch orgs or sandboxes based on project configuration and existing orgs, dynamically calling `ScratchCreate.run` or `SandboxCreate.run` as needed.\n- **WebSocket Communication:** Sends refresh status messages via `WebSocketClient.sendRefreshStatusMessage()` to update connected VS Code clients.\n</details>\n",
4089
+ "description": "\n## Command Behavior\n\n**Performs technical operations related to WebSocket communication, primarily for internal use by the sfdx-hardis VS Code extension.**\n\nThis command is not intended for direct end-user interaction. It facilitates communication between the sfdx-hardis CLI and the VS Code Extension, enabling features like real-time status updates and plugin refreshes.\n\nKey functionalities:\n\n- **Refresh Status (`--event refreshStatus`):** Sends a message to the VS Code Extension to refresh its displayed status, ensuring that the UI reflects the latest state of Salesforce orgs or project activities.\n- **Refresh Plugins (`--event refreshPlugins`):** Sends a message to the VS Code Extension to refresh its loaded plugins, useful after installing or updating sfdx-hardis or other related extensions.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **WebSocketClient:** It utilizes the `WebSocketClient` utility to establish and manage WebSocket connections.\n- **Event-Driven Communication:** It listens for specific events (e.g., `refreshStatus`, `refreshPlugins`) and triggers corresponding actions on the connected WebSocket client.\n- **Internal Use:** This command is primarily called programmatically by the VS Code Extension to maintain synchronization and provide a seamless user experience.\n</details>\n",
4045
4090
  "examples": [
4046
- "$ sf hardis:work:new"
4091
+ "$ sf hardis:work:ws --event refreshStatus"
4047
4092
  ],
4048
4093
  "flags": {
4049
4094
  "json": {
@@ -4061,6 +4106,14 @@
4061
4106
  "multiple": false,
4062
4107
  "type": "option"
4063
4108
  },
4109
+ "event": {
4110
+ "char": "e",
4111
+ "description": "WebSocket event",
4112
+ "name": "event",
4113
+ "hasDynamicHelp": false,
4114
+ "multiple": false,
4115
+ "type": "option"
4116
+ },
4064
4117
  "debug": {
4065
4118
  "char": "d",
4066
4119
  "description": "Activate debug mode (more logs)",
@@ -4080,70 +4133,45 @@
4080
4133
  "name": "skipauth",
4081
4134
  "allowNo": false,
4082
4135
  "type": "boolean"
4083
- },
4084
- "target-dev-hub": {
4085
- "aliases": [
4086
- "targetdevhubusername"
4087
- ],
4088
- "char": "v",
4089
- "deprecateAliases": true,
4090
- "name": "target-dev-hub",
4091
- "noCacheDefault": true,
4092
- "required": false,
4093
- "summary": "Username or alias of the Dev Hub org.",
4094
- "hasDynamicHelp": true,
4095
- "multiple": false,
4096
- "type": "option"
4097
- },
4098
- "target-org": {
4099
- "aliases": [
4100
- "targetusername",
4101
- "u"
4102
- ],
4103
- "char": "o",
4104
- "deprecateAliases": true,
4105
- "name": "target-org",
4106
- "noCacheDefault": true,
4107
- "summary": "Username or alias of the target org.",
4108
- "hasDynamicHelp": true,
4109
- "multiple": false,
4110
- "type": "option"
4111
4136
  }
4112
4137
  },
4113
- "hasDynamicHelp": true,
4138
+ "hasDynamicHelp": false,
4114
4139
  "hiddenAliases": [],
4115
- "id": "hardis:work:new",
4140
+ "id": "hardis:work:ws",
4116
4141
  "pluginAlias": "sfdx-hardis",
4117
4142
  "pluginName": "sfdx-hardis",
4118
4143
  "pluginType": "core",
4119
4144
  "strict": true,
4120
4145
  "enableJsonFlag": true,
4121
- "title": "New User Story",
4122
- "requiresProject": true,
4146
+ "title": "WebSocket operations",
4147
+ "uiConfig": {
4148
+ "hide": true
4149
+ },
4150
+ "requiresProject": false,
4123
4151
  "isESM": true,
4124
4152
  "relativePath": [
4125
4153
  "lib",
4126
4154
  "commands",
4127
4155
  "hardis",
4128
4156
  "work",
4129
- "new.js"
4157
+ "ws.js"
4130
4158
  ],
4131
4159
  "aliasPermutations": [],
4132
4160
  "permutations": [
4133
- "hardis:work:new",
4134
- "work:hardis:new",
4135
- "work:new:hardis",
4136
- "hardis:new:work",
4137
- "new:hardis:work",
4138
- "new:work:hardis"
4161
+ "hardis:work:ws",
4162
+ "work:hardis:ws",
4163
+ "work:ws:hardis",
4164
+ "hardis:ws:work",
4165
+ "ws:hardis:work",
4166
+ "ws:work:hardis"
4139
4167
  ]
4140
4168
  },
4141
- "hardis:work:refresh": {
4169
+ "hardis:scratch:create": {
4142
4170
  "aliases": [],
4143
4171
  "args": {},
4144
- "description": "\n## Command Behavior\n\n**Refreshes your local Git branch and Salesforce org with the latest content from another Git branch.**\n\nThis command is designed to help developers keep their local development environment synchronized with changes made by other team members. It automates the process of pulling updates from a designated branch, merging them into your current working branch, and then pushing those changes to your scratch org or source-tracked sandbox.\n\nKey functionalities:\n\n- **Pre-Merge Check:** Prompts the user to confirm that they have saved their current work before proceeding with the merge, preventing accidental data loss.\n- **Branch Selection:** Allows you to select a target Git branch (e.g., `integration`, `preprod`) from which to pull updates.\n- **Git Operations:** Performs a series of Git operations:\n - Pulls the latest version of the selected merge branch.\n - Stashes your uncommitted local changes before merging.\n - Merges the selected branch into your current local branch.\n - Handles merge conflicts interactively, prompting the user to resolve them.\n - Restores your stashed changes after the merge.\n- **Org Synchronization:** Pushes the updated local branch content to your scratch org or source-tracked sandbox, ensuring your org reflects the latest merged code.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Loading:** It retrieves project configurations using `getConfig` to determine the default development branch.\n- **Git Integration:** Extensively uses `simple-git` (`git()`) for various Git operations:\n - `git().branch()`: Lists local and remote branches.\n - `git().stash()`: Saves and restores uncommitted changes.\n - `git().fetch()`: Fetches updates from remote repositories.\n - `git().checkout()`: Switches between branches.\n - `git().pull()`: Pulls changes from a remote branch.\n - `git().merge()`: Merges one branch into another, handling conflicts.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through confirmations (e.g., saving work) and branch selection.\n- **Salesforce CLI Integration:** It uses `forceSourcePull` to pull changes from the scratch org and `forceSourcePush` to push changes to the scratch org.\n- **Error Handling:** Includes robust error handling for Git operations (e.g., merge conflicts) and provides guidance to the user for resolution.\n- **Environment Variable Check:** Checks for an `EXPERIMENTAL` environment variable to gate access to this command, indicating it might not be fully stable.\n</details>\n",
4172
+ "description": "\n## Command Behavior\n\n**Creates and fully initializes a Salesforce scratch org with complete development environment setup.**\n\nThis command is a comprehensive scratch org provisioning tool that automates the entire process of creating, configuring, and initializing a Salesforce scratch org for development work. It handles everything from basic org creation to advanced configuration including package installation, metadata deployment, and data initialization.\n\nKey functionalities:\n\n- **Intelligent Org Management:** Automatically generates unique scratch org aliases based on username, git branch, and timestamp, with options to reuse existing orgs or force creation of new ones.\n- **Scratch Org Pool Integration:** Supports fetching pre-configured scratch orgs from pools for faster development cycles and CI/CD optimization.\n- **Custom Scratch Definition:** Dynamically builds project-scratch-def.json files with user-specific configurations including email, username patterns, and org shape settings (set variable **SCRATCH_ORG_SHAPE** to use org shapes).\n- **Package Installation:** Automatically installs all configured packages defined in `installedPackages` configuration property.\n- **Metadata Deployment:** Pushes source code and deploys metadata using optimized deployment strategies for scratch org environments.\n- **Permission Set Assignment:** Assigns specified permission sets defined in `initPermissionSets` configuration to the scratch org user.\n- **Apex Script Execution:** Runs custom Apex initialization scripts defined in `scratchOrgInitApexScripts` for org-specific setup.\n- **Data Loading:** Loads initial data using SFDMU data packages from `dataPackages` configuration for realistic development environments.\n- **User Configuration:** Automatically configures the scratch org admin user with proper names, email, country settings, and marketing user permissions.\n- **Password Generation:** Creates and stores secure passwords for easy scratch org access during development.\n- **CI/CD Integration:** Provides specialized handling for continuous integration environments including automated cleanup and pool management.\n- **Error Handling:** Comprehensive error recovery including scratch org cleanup on failure and detailed troubleshooting messages.\n\nThe command configuration can be customized using:\n\n- `config/.sfdx-hardis.yml` file with properties like `installedPackages`, `initPermissionSets`, `scratchOrgInitApexScripts`, and `dataPackages`.\n- Environment variable **SCRATCH_ORG_SHAPE** with shape org id, if you want to use org shapes\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Management:** Loads hierarchical configuration from `.sfdx-hardis.yml`, branch-specific, and user-specific configuration files using `getConfig('user')`.\n- **Alias Generation Logic:** Creates intelligent scratch org aliases using username, git branch, timestamp patterns with CI and pool prefixes for different environments.\n- **Scratch Org Definition Building:** Dynamically constructs `project-scratch-def.json` with user email, custom usernames, org shapes, and feature flags like StateAndCountryPicklist and MarketingUser.\n- **Pool Integration:** Implements scratch org pool fetching using `fetchScratchOrg` for rapid org provisioning in development and CI environments.\n- **Salesforce CLI Integration:** Executes `sf org create scratch` commands with proper parameter handling including wait times, duration, and dev hub targeting.\n- **Package Installation Pipeline:** Uses `installPackages` utility to install managed and unmanaged packages with dependency resolution and error handling.\n- **Metadata Deployment:** Leverages `initOrgMetadatas` for optimized source pushing and metadata deployment specific to scratch org environments.\n- **Permission Set Assignment:** Implements `initPermissionSetAssignments` for automated permission set assignment to scratch org users.\n- **Apex Script Execution:** Runs custom Apex initialization scripts using `initApexScripts` for org-specific configuration and setup.\n- **Data Loading Integration:** Uses SFDMU integration through `initOrgData` for comprehensive data loading from configured data packages.\n- **User Management:** Performs SOQL queries and DML operations to configure scratch org users with proper names, emails, country codes, and permission flags.\n- **Authentication Management:** Handles SFDX auth URL generation and storage for CI/CD environments and scratch org pool management.\n- **Error Recovery:** Implements comprehensive error handling with scratch org cleanup, pool management, and detailed error messaging for troubleshooting.\n- **WebSocket Integration:** Provides real-time status updates and file reporting through WebSocket connections for VS Code extension integration.\n</details>\n",
4145
4173
  "examples": [
4146
- "$ sf hardis:work:refresh"
4174
+ "$ sf hardis:scratch:create"
4147
4175
  ],
4148
4176
  "flags": {
4149
4177
  "json": {
@@ -4161,10 +4189,16 @@
4161
4189
  "multiple": false,
4162
4190
  "type": "option"
4163
4191
  },
4164
- "nopull": {
4192
+ "forcenew": {
4165
4193
  "char": "n",
4166
- "description": "No scratch pull before save (careful if you use that!)",
4167
- "name": "nopull",
4194
+ "description": "If an existing scratch org exists, do not reuse it but create a new one",
4195
+ "name": "forcenew",
4196
+ "allowNo": false,
4197
+ "type": "boolean"
4198
+ },
4199
+ "pool": {
4200
+ "description": "Creates the scratch org for a scratch org pool",
4201
+ "name": "pool",
4168
4202
  "allowNo": false,
4169
4203
  "type": "boolean"
4170
4204
  },
@@ -4188,17 +4222,16 @@
4188
4222
  "allowNo": false,
4189
4223
  "type": "boolean"
4190
4224
  },
4191
- "target-org": {
4225
+ "target-dev-hub": {
4192
4226
  "aliases": [
4193
- "targetusername",
4194
- "u"
4227
+ "targetdevhubusername"
4195
4228
  ],
4196
- "char": "o",
4229
+ "char": "v",
4197
4230
  "deprecateAliases": true,
4198
- "name": "target-org",
4231
+ "name": "target-dev-hub",
4199
4232
  "noCacheDefault": true,
4200
4233
  "required": true,
4201
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
4234
+ "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
4202
4235
  "hasDynamicHelp": true,
4203
4236
  "multiple": false,
4204
4237
  "type": "option"
@@ -4206,38 +4239,41 @@
4206
4239
  },
4207
4240
  "hasDynamicHelp": true,
4208
4241
  "hiddenAliases": [],
4209
- "id": "hardis:work:refresh",
4242
+ "id": "hardis:scratch:create",
4210
4243
  "pluginAlias": "sfdx-hardis",
4211
4244
  "pluginName": "sfdx-hardis",
4212
4245
  "pluginType": "core",
4213
4246
  "strict": true,
4214
4247
  "enableJsonFlag": true,
4215
- "title": "Refresh User Story branch",
4248
+ "title": "Create and initialize scratch org",
4216
4249
  "requiresProject": true,
4250
+ "requiresSfdxPlugins": [
4251
+ "sfdmu"
4252
+ ],
4217
4253
  "isESM": true,
4218
4254
  "relativePath": [
4219
4255
  "lib",
4220
4256
  "commands",
4221
4257
  "hardis",
4222
- "work",
4223
- "refresh.js"
4258
+ "scratch",
4259
+ "create.js"
4224
4260
  ],
4225
4261
  "aliasPermutations": [],
4226
4262
  "permutations": [
4227
- "hardis:work:refresh",
4228
- "work:hardis:refresh",
4229
- "work:refresh:hardis",
4230
- "hardis:refresh:work",
4231
- "refresh:hardis:work",
4232
- "refresh:work:hardis"
4263
+ "hardis:scratch:create",
4264
+ "scratch:hardis:create",
4265
+ "scratch:create:hardis",
4266
+ "hardis:create:scratch",
4267
+ "create:hardis:scratch",
4268
+ "create:scratch:hardis"
4233
4269
  ]
4234
4270
  },
4235
- "hardis:work:resetselection": {
4271
+ "hardis:scratch:delete": {
4236
4272
  "aliases": [],
4237
4273
  "args": {},
4238
- "description": "\n## Command Behavior\n\n**Resets the local Git repository to allow for a new selection of files to be included in a merge request.**\n\nThis command is designed to be used when you need to re-evaluate which changes should be part of your next merge request. It performs a soft Git reset, effectively unstaging all committed changes since the last merge with the target branch, and then cleans up any generated files.\n\nKey functionalities:\n\n- **Target Branch Selection:** Prompts you to select the target branch of your current or future merge request.\n- **Soft Git Reset:** Performs a `git reset --soft` operation to uncommit changes, moving the HEAD pointer back but keeping the changes in your working directory.\n- **Generated File Cleanup:** Resets and checks out `manifest/package.xml` and `manifest/destructiveChanges.xml` to their state before the reset, ensuring a clean slate for new selections.\n- **Force Push Authorization:** Sets a flag in your user configuration (`canForcePush: true`) to allow a force push in the subsequent `hardis:work:save` command, as the history will have been rewritten.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Git Integration:** Uses `simple-git` (`git()`) to interact with the Git repository:\n - `git().branch()`: Retrieves information about local and remote branches.\n - `git().log()`: Fetches the commit history to determine which commits to reset.\n - `git().reset()`: Performs the soft reset operation.\n - `git().checkout()`: Resets specific files (`package.xml`, `destructiveChanges.xml`) to their previous state.\n - `git().status()`: Displays the current status of the Git repository after the reset.\n- **Interactive Prompts:** Uses the `prompts` library to confirm the reset operation with the user and to select the target branch.\n- **Configuration Management:** Updates the user's configuration (`.sfdx-hardis.yml`) using `setConfig` to set the `canForcePush` flag.\n- **Error Handling:** Includes a check to prevent resetting protected branches.\n</details>\n",
4274
+ "description": "## Command Behavior\n\n**Provides an assisted menu to delete Salesforce scratch orgs associated with a Dev Hub.**\n\nThis command simplifies the process of cleaning up your Salesforce development environments by allowing you to easily select and delete multiple scratch orgs. This is crucial for managing your scratch org limits and ensuring that you don't accumulate unnecessary or expired orgs.\n\nKey functionalities:\n\n- **Interactive Scratch Org Selection:** Displays a list of all active scratch orgs linked to your Dev Hub, including their usernames, instance URLs, and last used dates.\n- **Multi-Selection:** Allows you to select multiple scratch orgs for deletion.\n- **Confirmation Prompt:** Prompts for confirmation before proceeding with the deletion, ensuring that you don't accidentally delete important orgs.\n- **Dev Hub Integration:** Works with your configured Dev Hub to manage scratch orgs.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce CLI Integration:** It executes the `sf org list` command to retrieve a list of all scratch orgs associated with the current Dev Hub. It then filters this list to show only active orgs.\n- **Interactive Prompts:** Uses the `prompts` library to present a multi-select menu of scratch orgs to the user.\n- **Scratch Org Deletion:** For each selected scratch org, it executes the `sf org delete scratch --no-prompt` command to perform the deletion.\n- **Error Handling:** Includes basic error handling for Salesforce CLI commands.\n- **Data Sorting:** Sorts the list of scratch orgs by username, alias, and instance URL for better readability in the interactive menu.\n</details>\n",
4239
4275
  "examples": [
4240
- "$ sf hardis:work:resetsave"
4276
+ "$ sf hardis:scratch:delete"
4241
4277
  ],
4242
4278
  "flags": {
4243
4279
  "json": {
@@ -4275,17 +4311,16 @@
4275
4311
  "allowNo": false,
4276
4312
  "type": "boolean"
4277
4313
  },
4278
- "target-org": {
4314
+ "target-dev-hub": {
4279
4315
  "aliases": [
4280
- "targetusername",
4281
- "u"
4316
+ "targetdevhubusername"
4282
4317
  ],
4283
- "char": "o",
4318
+ "char": "v",
4284
4319
  "deprecateAliases": true,
4285
- "name": "target-org",
4320
+ "name": "target-dev-hub",
4286
4321
  "noCacheDefault": true,
4287
4322
  "required": true,
4288
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
4323
+ "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
4289
4324
  "hasDynamicHelp": true,
4290
4325
  "multiple": false,
4291
4326
  "type": "option"
@@ -4293,39 +4328,37 @@
4293
4328
  },
4294
4329
  "hasDynamicHelp": true,
4295
4330
  "hiddenAliases": [],
4296
- "id": "hardis:work:resetselection",
4331
+ "id": "hardis:scratch:delete",
4297
4332
  "pluginAlias": "sfdx-hardis",
4298
4333
  "pluginName": "sfdx-hardis",
4299
4334
  "pluginType": "core",
4300
4335
  "strict": true,
4301
4336
  "enableJsonFlag": true,
4302
- "title": "Select again",
4303
- "requiresProject": true,
4337
+ "title": "Delete scratch orgs(s)",
4304
4338
  "isESM": true,
4305
4339
  "relativePath": [
4306
4340
  "lib",
4307
4341
  "commands",
4308
4342
  "hardis",
4309
- "work",
4310
- "resetselection.js"
4343
+ "scratch",
4344
+ "delete.js"
4311
4345
  ],
4312
4346
  "aliasPermutations": [],
4313
4347
  "permutations": [
4314
- "hardis:work:resetselection",
4315
- "work:hardis:resetselection",
4316
- "work:resetselection:hardis",
4317
- "hardis:resetselection:work",
4318
- "resetselection:hardis:work",
4319
- "resetselection:work:hardis"
4348
+ "hardis:scratch:delete",
4349
+ "scratch:hardis:delete",
4350
+ "scratch:delete:hardis",
4351
+ "hardis:delete:scratch",
4352
+ "delete:hardis:scratch",
4353
+ "delete:scratch:hardis"
4320
4354
  ]
4321
4355
  },
4322
- "hardis:work:save": {
4356
+ "hardis:scratch:pull": {
4323
4357
  "aliases": [],
4324
4358
  "args": {},
4325
- "description": "\n## Command Behavior\n\n**Guides the user through the process of saving their work, preparing it for a Merge Request (also named Pull Request), and pushing changes to the remote Git repository.**\n\nThis command automates several critical steps involved in finalizing a development User Story and integrating it into the main codebase. It ensures that your local changes are properly synchronized, cleaned, and committed before being pushed.\n\nKey functionalities include:\n\n- **Git Status Management:** Ensures a clean Git working directory by handling ongoing merges and unstaging files.\n- **Org Synchronization (Optional):** Prompts the user to pull the latest metadata updates from their scratch org or source-tracked sandbox, ensuring local files reflect the org's state.\n- **Package.xml Updates:** Automatically generates `package.xml` and `destructiveChanges.xml` files based on the Git delta between your current branch and the target branch, reflecting added, modified, and deleted metadata.\n- **Automated Source Cleaning:** Applies predefined cleaning operations to your local Salesforce sources, such as removing unwanted references, minimizing profiles, or cleaning XML files based on configurations in your `.sfdx-hardis.yml`.\n - `autoCleanTypes`: A list of automated source cleanings, configurable via [hardis:project:clean:references](${CONSTANTS.DOC_URL_ROOT}/hardis/project/clean/references/).\n - `autoRemoveUserPermissions`: A list of user permissions to automatically remove from profile metadata.\n- **Deployment Plan Generation:** Builds an automated deployment plan based on the updated `package.xml` and configured deployment splits.\n- **Commit and Push:** Guides the user to commit the changes and push them to the remote Git repository, optionally handling force pushes if a branch reset occurred.\n- **Merge Request Guidance:** Provides information and links to facilitate the creation of a merge request after the changes are pushed.\n\nExample `.sfdx-hardis.yml` configuration:\n\n```yaml\nautoCleanTypes:\n - checkPermissions\n - destructivechanges\n - datadotcom\n - minimizeProfiles\n - listViewsMine\nautoRemoveUserPermissions:\n - EnableCommunityAppLauncher\n - FieldServiceAccess\n - OmnichannelInventorySync\n - SendExternalEmailAvailable\n - UseOmnichannelInventoryAPIs\n - ViewDataLeakageEvents\n - ViewMLModels\n - ViewPlatformEvents\n - WorkCalibrationUser\n```\n\nAdvanced instructions are available in the [Publish a User Story documentation](${CONSTANTS.DOC_URL_ROOT}/salesforce-ci-cd-publish-task/).\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves a series of orchestrated steps:\n\n- **Git Integration:** Extensively uses the `git` utility for status checks, adding files, committing, and pushing. It also leverages `sfdx-git-delta` for generating metadata differences between Git revisions.\n- **Interactive Prompts:** Employs the `prompts` library to interact with the user for decisions like pulling sources or pushing commits.\n- **Configuration Management:** Reads and updates project and user configurations using `getConfig` and `setConfig` to store preferences and deployment plans.\n- **Metadata Synchronization:** Calls `forceSourcePull` to retrieve metadata from the org and `callSfdxGitDelta` to generate `package.xml` and `destructiveChanges.xml` based on Git changes.\n- **XML Manipulation:** Utilizes `appendPackageXmlFilesContent`, `removePackageXmlFilesContent`, `parseXmlFile`, and `writeXmlFile` for modifying `package.xml` and `destructiveChanges.xml` files.\n- **Automated Cleaning:** Integrates with `CleanReferences.run` and `CleanXml.run` commands to perform automated cleaning operations on the Salesforce source files.\n- **Deployment Plan Building:** Dynamically constructs a deployment plan by analyzing the `package.xml` content and applying configured deployment splits.\n- **WebSocket Communication:** Uses `WebSocketClient.sendRefreshStatusMessage` to notify connected VS Code clients about status updates.\n- **External Tool Integration:** Requires the `sfdx-git-delta` plugin to be installed for its core functionality.\n</details>\n",
4359
+ "description": "\n## Command Behavior\n\n**Pulls metadata changes from your scratch org or source-tracked sandbox into your local project files.**\n\nThis command is essential for synchronizing your local development environment with the changes you've made directly in your Salesforce org. After pulling, you can then stage and commit the relevant files to your version control system.\n\nKey features and considerations:\n\n- **Underlying Command:** Internally, this command executes `sf project retrieve start` to fetch the metadata.\n- **Error Handling:** If the pull operation encounters errors, it offers to automatically add the problematic items to your `.forceignore` file and then attempts to pull again, helping you resolve conflicts and ignore unwanted metadata.\n- **Missing Updates:** If you don't see certain updated items in the pull results, you might need to manually retrieve them using the Salesforce Extension's **Org Browser** or the **Salesforce CLI** directly. Refer to the [Retrieve Metadatas documentation](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-publish-task/#retrieve-metadatas) for more details.\n- **Automatic Retrieval:** You can configure the `autoRetrieveWhenPull` property in your `.sfdx-hardis.yml` file to always retrieve specific metadata types (e.g., `CustomApplication`) that might not always be detected as updates by `project:retrieve:start`.\n\nExample `.sfdx-hardis.yml` configuration for `autoRetrieveWhenPull`:\n```yaml\nautoRetrieveWhenPull:\n - CustomApplication:MyCustomApplication\n - CustomApplication:MyOtherCustomApplication\n - CustomApplication:MyThirdCustomApp\n```\n\nFor a visual explanation of the process, watch this video:\n\n<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/Ik6whtflmfY\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation focuses on robust metadata synchronization:\n\n- **Salesforce CLI Wrapper:** It acts as a wrapper around the standard Salesforce CLI `sf project retrieve start` command, providing enhanced error handling and configuration options.\n- **Force Source Pull Utility:** The core logic resides in the `forceSourcePull` utility function, which orchestrates the retrieval process, including handling `.forceignore` updates.\n- **Configuration Integration:** It reads the `autoRetrieveWhenPull` setting from the project's `.sfdx-hardis.yml` to determine additional metadata to retrieve automatically.\n- **User Feedback:** Provides clear messages to the user regarding the pull status and guidance for troubleshooting.\n</details>\n",
4326
4360
  "examples": [
4327
- "$ sf hardis:work:task:save",
4328
- "$ sf hardis:work:task:save --nopull --nogit --noclean"
4361
+ "$ sf hardis:scratch:pull"
4329
4362
  ],
4330
4363
  "flags": {
4331
4364
  "json": {
@@ -4343,40 +4376,6 @@
4343
4376
  "multiple": false,
4344
4377
  "type": "option"
4345
4378
  },
4346
- "nopull": {
4347
- "char": "n",
4348
- "description": "No scratch pull before save",
4349
- "name": "nopull",
4350
- "allowNo": false,
4351
- "type": "boolean"
4352
- },
4353
- "nogit": {
4354
- "char": "g",
4355
- "description": "No automated git operations",
4356
- "name": "nogit",
4357
- "allowNo": false,
4358
- "type": "boolean"
4359
- },
4360
- "noclean": {
4361
- "char": "c",
4362
- "description": "No cleaning of local sources",
4363
- "name": "noclean",
4364
- "allowNo": false,
4365
- "type": "boolean"
4366
- },
4367
- "auto": {
4368
- "description": "No user prompts (when called from CI for example)",
4369
- "name": "auto",
4370
- "allowNo": false,
4371
- "type": "boolean"
4372
- },
4373
- "targetbranch": {
4374
- "description": "Name of the Merge Request target branch. Will be guessed or prompted if not provided.",
4375
- "name": "targetbranch",
4376
- "hasDynamicHelp": false,
4377
- "multiple": false,
4378
- "type": "option"
4379
- },
4380
4379
  "debug": {
4381
4380
  "char": "d",
4382
4381
  "description": "Activate debug mode (more logs)",
@@ -4415,41 +4414,38 @@
4415
4414
  },
4416
4415
  "hasDynamicHelp": true,
4417
4416
  "hiddenAliases": [],
4418
- "id": "hardis:work:save",
4417
+ "id": "hardis:scratch:pull",
4419
4418
  "pluginAlias": "sfdx-hardis",
4420
4419
  "pluginName": "sfdx-hardis",
4421
4420
  "pluginType": "core",
4422
4421
  "strict": true,
4423
4422
  "enableJsonFlag": true,
4424
- "title": "Save User Story",
4423
+ "title": "Scratch PULL",
4425
4424
  "requiresProject": true,
4426
- "requiresSfdxPlugins": [
4427
- "sfdx-git-delta"
4428
- ],
4429
4425
  "isESM": true,
4430
4426
  "relativePath": [
4431
4427
  "lib",
4432
4428
  "commands",
4433
4429
  "hardis",
4434
- "work",
4435
- "save.js"
4430
+ "scratch",
4431
+ "pull.js"
4436
4432
  ],
4437
4433
  "aliasPermutations": [],
4438
4434
  "permutations": [
4439
- "hardis:work:save",
4440
- "work:hardis:save",
4441
- "work:save:hardis",
4442
- "hardis:save:work",
4443
- "save:hardis:work",
4444
- "save:work:hardis"
4435
+ "hardis:scratch:pull",
4436
+ "scratch:hardis:pull",
4437
+ "scratch:pull:hardis",
4438
+ "hardis:pull:scratch",
4439
+ "pull:hardis:scratch",
4440
+ "pull:scratch:hardis"
4445
4441
  ]
4446
4442
  },
4447
- "hardis:work:ws": {
4443
+ "hardis:scratch:push": {
4448
4444
  "aliases": [],
4449
4445
  "args": {},
4450
- "description": "\n## Command Behavior\n\n**Performs technical operations related to WebSocket communication, primarily for internal use by the sfdx-hardis VS Code extension.**\n\nThis command is not intended for direct end-user interaction. It facilitates communication between the sfdx-hardis CLI and the VS Code Extension, enabling features like real-time status updates and plugin refreshes.\n\nKey functionalities:\n\n- **Refresh Status (`--event refreshStatus`):** Sends a message to the VS Code Extension to refresh its displayed status, ensuring that the UI reflects the latest state of Salesforce orgs or project activities.\n- **Refresh Plugins (`--event refreshPlugins`):** Sends a message to the VS Code Extension to refresh its loaded plugins, useful after installing or updating sfdx-hardis or other related extensions.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **WebSocketClient:** It utilizes the `WebSocketClient` utility to establish and manage WebSocket connections.\n- **Event-Driven Communication:** It listens for specific events (e.g., `refreshStatus`, `refreshPlugins`) and triggers corresponding actions on the connected WebSocket client.\n- **Internal Use:** This command is primarily called programmatically by the VS Code Extension to maintain synchronization and provide a seamless user experience.\n</details>\n",
4446
+ "description": "## Command Behavior\n\n**Pushes local Salesforce DX source files to a scratch org or source-tracked sandbox.**\n\nThis command is a fundamental operation in Salesforce DX development, allowing developers to synchronize their local codebase with their development org. It ensures that changes made locally are reflected in the scratch org, enabling testing and validation.\n\nKey functionalities:\n\n- **Source Synchronization:** Deploys all local changes (metadata and code) to the target scratch org.\n- **Underlying Command:** Internally, this command executes `sf project deploy start` to perform the push operation.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce CLI Wrapper:** It acts as a wrapper around the standard Salesforce CLI `sf project deploy start` command.\n- **`forceSourcePush` Utility:** The core logic resides in the `forceSourcePush` utility function, which orchestrates the deployment process.\n- **Connection Handling:** It uses the connection to the target org to perform the push operation.\n</details>\n",
4451
4447
  "examples": [
4452
- "$ sf hardis:work:ws --event refreshStatus"
4448
+ "$ sf hardis:scratch:push"
4453
4449
  ],
4454
4450
  "flags": {
4455
4451
  "json": {
@@ -4467,14 +4463,6 @@
4467
4463
  "multiple": false,
4468
4464
  "type": "option"
4469
4465
  },
4470
- "event": {
4471
- "char": "e",
4472
- "description": "WebSocket event",
4473
- "name": "event",
4474
- "hasDynamicHelp": false,
4475
- "multiple": false,
4476
- "type": "option"
4477
- },
4478
4466
  "debug": {
4479
4467
  "char": "d",
4480
4468
  "description": "Activate debug mode (more logs)",
@@ -4494,37 +4482,49 @@
4494
4482
  "name": "skipauth",
4495
4483
  "allowNo": false,
4496
4484
  "type": "boolean"
4485
+ },
4486
+ "target-org": {
4487
+ "aliases": [
4488
+ "targetusername",
4489
+ "u"
4490
+ ],
4491
+ "char": "o",
4492
+ "deprecateAliases": true,
4493
+ "name": "target-org",
4494
+ "noCacheDefault": true,
4495
+ "required": true,
4496
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
4497
+ "hasDynamicHelp": true,
4498
+ "multiple": false,
4499
+ "type": "option"
4497
4500
  }
4498
4501
  },
4499
- "hasDynamicHelp": false,
4502
+ "hasDynamicHelp": true,
4500
4503
  "hiddenAliases": [],
4501
- "id": "hardis:work:ws",
4504
+ "id": "hardis:scratch:push",
4502
4505
  "pluginAlias": "sfdx-hardis",
4503
4506
  "pluginName": "sfdx-hardis",
4504
4507
  "pluginType": "core",
4505
4508
  "strict": true,
4506
4509
  "enableJsonFlag": true,
4507
- "title": "WebSocket operations",
4508
- "uiConfig": {
4509
- "hide": true
4510
- },
4511
- "requiresProject": false,
4510
+ "title": "Scratch PUSH",
4511
+ "requiresProject": true,
4512
4512
  "isESM": true,
4513
4513
  "relativePath": [
4514
4514
  "lib",
4515
4515
  "commands",
4516
4516
  "hardis",
4517
- "work",
4518
- "ws.js"
4517
+ "scratch",
4518
+ "push.js"
4519
4519
  ],
4520
4520
  "aliasPermutations": [],
4521
4521
  "permutations": [
4522
- "hardis:work:ws",
4523
- "work:hardis:ws",
4524
- "work:ws:hardis",
4525
- "hardis:ws:work",
4526
- "ws:hardis:work",
4527
- "ws:work:hardis"
4522
+ "hardis:scratch:push",
4523
+ "scratch:hardis:push",
4524
+ "scratch:push:hardis",
4525
+ "hardis:push:scratch",
4526
+ "push:hardis:scratch",
4527
+ "push:scratch:hardis"
4528
4528
  ]
4529
4529
  },
4530
4530
  "hardis:datacloud:extract:agentforce-conversations": {
@@ -5924,121 +5924,6 @@
5924
5924
  "import:data:org:hardis"
5925
5925
  ]
5926
5926
  },
5927
- "hardis:org:fix:listviewmine": {
5928
- "aliases": [],
5929
- "args": {},
5930
- "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
5931
- "examples": [
5932
- "$ sf hardis:org:fix:listviewmine",
5933
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
5934
- ],
5935
- "flags": {
5936
- "json": {
5937
- "description": "Format output as json.",
5938
- "helpGroup": "GLOBAL",
5939
- "name": "json",
5940
- "allowNo": false,
5941
- "type": "boolean"
5942
- },
5943
- "flags-dir": {
5944
- "helpGroup": "GLOBAL",
5945
- "name": "flags-dir",
5946
- "summary": "Import flag values from a directory.",
5947
- "hasDynamicHelp": false,
5948
- "multiple": false,
5949
- "type": "option"
5950
- },
5951
- "listviews": {
5952
- "char": "l",
5953
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
5954
- "name": "listviews",
5955
- "hasDynamicHelp": false,
5956
- "multiple": false,
5957
- "type": "option"
5958
- },
5959
- "debug": {
5960
- "char": "d",
5961
- "description": "Activate debug mode (more logs)",
5962
- "name": "debug",
5963
- "allowNo": false,
5964
- "type": "boolean"
5965
- },
5966
- "websocket": {
5967
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5968
- "name": "websocket",
5969
- "hasDynamicHelp": false,
5970
- "multiple": false,
5971
- "type": "option"
5972
- },
5973
- "skipauth": {
5974
- "description": "Skip authentication check when a default username is required",
5975
- "name": "skipauth",
5976
- "allowNo": false,
5977
- "type": "boolean"
5978
- },
5979
- "target-org": {
5980
- "aliases": [
5981
- "targetusername",
5982
- "u"
5983
- ],
5984
- "char": "o",
5985
- "deprecateAliases": true,
5986
- "name": "target-org",
5987
- "noCacheDefault": true,
5988
- "required": true,
5989
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5990
- "hasDynamicHelp": true,
5991
- "multiple": false,
5992
- "type": "option"
5993
- }
5994
- },
5995
- "hasDynamicHelp": true,
5996
- "hiddenAliases": [],
5997
- "id": "hardis:org:fix:listviewmine",
5998
- "pluginAlias": "sfdx-hardis",
5999
- "pluginName": "sfdx-hardis",
6000
- "pluginType": "core",
6001
- "strict": true,
6002
- "enableJsonFlag": true,
6003
- "title": "Fix listviews with ",
6004
- "requiresProject": true,
6005
- "isESM": true,
6006
- "relativePath": [
6007
- "lib",
6008
- "commands",
6009
- "hardis",
6010
- "org",
6011
- "fix",
6012
- "listviewmine.js"
6013
- ],
6014
- "aliasPermutations": [],
6015
- "permutations": [
6016
- "hardis:org:fix:listviewmine",
6017
- "org:hardis:fix:listviewmine",
6018
- "org:fix:hardis:listviewmine",
6019
- "org:fix:listviewmine:hardis",
6020
- "hardis:fix:org:listviewmine",
6021
- "fix:hardis:org:listviewmine",
6022
- "fix:org:hardis:listviewmine",
6023
- "fix:org:listviewmine:hardis",
6024
- "hardis:fix:listviewmine:org",
6025
- "fix:hardis:listviewmine:org",
6026
- "fix:listviewmine:hardis:org",
6027
- "fix:listviewmine:org:hardis",
6028
- "hardis:org:listviewmine:fix",
6029
- "org:hardis:listviewmine:fix",
6030
- "org:listviewmine:hardis:fix",
6031
- "org:listviewmine:fix:hardis",
6032
- "hardis:listviewmine:org:fix",
6033
- "listviewmine:hardis:org:fix",
6034
- "listviewmine:org:hardis:fix",
6035
- "listviewmine:org:fix:hardis",
6036
- "hardis:listviewmine:fix:org",
6037
- "listviewmine:hardis:fix:org",
6038
- "listviewmine:fix:hardis:org",
6039
- "listviewmine:fix:org:hardis"
6040
- ]
6041
- },
6042
5927
  "hardis:org:diagnose:audittrail": {
6043
5928
  "aliases": [],
6044
5929
  "args": {},
@@ -7706,6 +7591,121 @@
7706
7591
  "import:files:org:hardis"
7707
7592
  ]
7708
7593
  },
7594
+ "hardis:org:fix:listviewmine": {
7595
+ "aliases": [],
7596
+ "args": {},
7597
+ "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
7598
+ "examples": [
7599
+ "$ sf hardis:org:fix:listviewmine",
7600
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7601
+ ],
7602
+ "flags": {
7603
+ "json": {
7604
+ "description": "Format output as json.",
7605
+ "helpGroup": "GLOBAL",
7606
+ "name": "json",
7607
+ "allowNo": false,
7608
+ "type": "boolean"
7609
+ },
7610
+ "flags-dir": {
7611
+ "helpGroup": "GLOBAL",
7612
+ "name": "flags-dir",
7613
+ "summary": "Import flag values from a directory.",
7614
+ "hasDynamicHelp": false,
7615
+ "multiple": false,
7616
+ "type": "option"
7617
+ },
7618
+ "listviews": {
7619
+ "char": "l",
7620
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7621
+ "name": "listviews",
7622
+ "hasDynamicHelp": false,
7623
+ "multiple": false,
7624
+ "type": "option"
7625
+ },
7626
+ "debug": {
7627
+ "char": "d",
7628
+ "description": "Activate debug mode (more logs)",
7629
+ "name": "debug",
7630
+ "allowNo": false,
7631
+ "type": "boolean"
7632
+ },
7633
+ "websocket": {
7634
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7635
+ "name": "websocket",
7636
+ "hasDynamicHelp": false,
7637
+ "multiple": false,
7638
+ "type": "option"
7639
+ },
7640
+ "skipauth": {
7641
+ "description": "Skip authentication check when a default username is required",
7642
+ "name": "skipauth",
7643
+ "allowNo": false,
7644
+ "type": "boolean"
7645
+ },
7646
+ "target-org": {
7647
+ "aliases": [
7648
+ "targetusername",
7649
+ "u"
7650
+ ],
7651
+ "char": "o",
7652
+ "deprecateAliases": true,
7653
+ "name": "target-org",
7654
+ "noCacheDefault": true,
7655
+ "required": true,
7656
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7657
+ "hasDynamicHelp": true,
7658
+ "multiple": false,
7659
+ "type": "option"
7660
+ }
7661
+ },
7662
+ "hasDynamicHelp": true,
7663
+ "hiddenAliases": [],
7664
+ "id": "hardis:org:fix:listviewmine",
7665
+ "pluginAlias": "sfdx-hardis",
7666
+ "pluginName": "sfdx-hardis",
7667
+ "pluginType": "core",
7668
+ "strict": true,
7669
+ "enableJsonFlag": true,
7670
+ "title": "Fix listviews with ",
7671
+ "requiresProject": true,
7672
+ "isESM": true,
7673
+ "relativePath": [
7674
+ "lib",
7675
+ "commands",
7676
+ "hardis",
7677
+ "org",
7678
+ "fix",
7679
+ "listviewmine.js"
7680
+ ],
7681
+ "aliasPermutations": [],
7682
+ "permutations": [
7683
+ "hardis:org:fix:listviewmine",
7684
+ "org:hardis:fix:listviewmine",
7685
+ "org:fix:hardis:listviewmine",
7686
+ "org:fix:listviewmine:hardis",
7687
+ "hardis:fix:org:listviewmine",
7688
+ "fix:hardis:org:listviewmine",
7689
+ "fix:org:hardis:listviewmine",
7690
+ "fix:org:listviewmine:hardis",
7691
+ "hardis:fix:listviewmine:org",
7692
+ "fix:hardis:listviewmine:org",
7693
+ "fix:listviewmine:hardis:org",
7694
+ "fix:listviewmine:org:hardis",
7695
+ "hardis:org:listviewmine:fix",
7696
+ "org:hardis:listviewmine:fix",
7697
+ "org:listviewmine:hardis:fix",
7698
+ "org:listviewmine:fix:hardis",
7699
+ "hardis:listviewmine:org:fix",
7700
+ "listviewmine:hardis:org:fix",
7701
+ "listviewmine:org:hardis:fix",
7702
+ "listviewmine:org:fix:hardis",
7703
+ "hardis:listviewmine:fix:org",
7704
+ "listviewmine:hardis:fix:org",
7705
+ "listviewmine:fix:hardis:org",
7706
+ "listviewmine:fix:org:hardis"
7707
+ ]
7708
+ },
7709
7709
  "hardis:org:generate:packagexmlfull": {
7710
7710
  "aliases": [],
7711
7711
  "args": {},
@@ -12099,262 +12099,47 @@
12099
12099
  "hiddenAliases": [],
12100
12100
  "id": "hardis:project:clean:xml",
12101
12101
  "pluginAlias": "sfdx-hardis",
12102
- "pluginName": "sfdx-hardis",
12103
- "pluginType": "core",
12104
- "strict": true,
12105
- "enableJsonFlag": true,
12106
- "title": "Clean retrieved empty items in dx sources",
12107
- "requiresProject": true,
12108
- "isESM": true,
12109
- "relativePath": [
12110
- "lib",
12111
- "commands",
12112
- "hardis",
12113
- "project",
12114
- "clean",
12115
- "xml.js"
12116
- ],
12117
- "aliasPermutations": [],
12118
- "permutations": [
12119
- "hardis:project:clean:xml",
12120
- "project:hardis:clean:xml",
12121
- "project:clean:hardis:xml",
12122
- "project:clean:xml:hardis",
12123
- "hardis:clean:project:xml",
12124
- "clean:hardis:project:xml",
12125
- "clean:project:hardis:xml",
12126
- "clean:project:xml:hardis",
12127
- "hardis:clean:xml:project",
12128
- "clean:hardis:xml:project",
12129
- "clean:xml:hardis:project",
12130
- "clean:xml:project:hardis",
12131
- "hardis:project:xml:clean",
12132
- "project:hardis:xml:clean",
12133
- "project:xml:hardis:clean",
12134
- "project:xml:clean:hardis",
12135
- "hardis:xml:project:clean",
12136
- "xml:hardis:project:clean",
12137
- "xml:project:hardis:clean",
12138
- "xml:project:clean:hardis",
12139
- "hardis:xml:clean:project",
12140
- "xml:hardis:clean:project",
12141
- "xml:clean:hardis:project",
12142
- "xml:clean:project:hardis"
12143
- ]
12144
- },
12145
- "hardis:project:fix:profiletabs": {
12146
- "aliases": [],
12147
- "args": {},
12148
- "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
12149
- "examples": [
12150
- "$ sf hardis:project:fix:profiletabs"
12151
- ],
12152
- "flags": {
12153
- "json": {
12154
- "description": "Format output as json.",
12155
- "helpGroup": "GLOBAL",
12156
- "name": "json",
12157
- "allowNo": false,
12158
- "type": "boolean"
12159
- },
12160
- "flags-dir": {
12161
- "helpGroup": "GLOBAL",
12162
- "name": "flags-dir",
12163
- "summary": "Import flag values from a directory.",
12164
- "hasDynamicHelp": false,
12165
- "multiple": false,
12166
- "type": "option"
12167
- },
12168
- "path": {
12169
- "char": "p",
12170
- "description": "Root folder",
12171
- "name": "path",
12172
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12173
- "hasDynamicHelp": false,
12174
- "multiple": false,
12175
- "type": "option"
12176
- },
12177
- "debug": {
12178
- "char": "d",
12179
- "description": "Activate debug mode (more logs)",
12180
- "name": "debug",
12181
- "allowNo": false,
12182
- "type": "boolean"
12183
- },
12184
- "websocket": {
12185
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12186
- "name": "websocket",
12187
- "hasDynamicHelp": false,
12188
- "multiple": false,
12189
- "type": "option"
12190
- },
12191
- "skipauth": {
12192
- "description": "Skip authentication check when a default username is required",
12193
- "name": "skipauth",
12194
- "allowNo": false,
12195
- "type": "boolean"
12196
- },
12197
- "target-org": {
12198
- "aliases": [
12199
- "targetusername",
12200
- "u"
12201
- ],
12202
- "char": "o",
12203
- "deprecateAliases": true,
12204
- "name": "target-org",
12205
- "noCacheDefault": true,
12206
- "required": true,
12207
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12208
- "hasDynamicHelp": true,
12209
- "multiple": false,
12210
- "type": "option"
12211
- }
12212
- },
12213
- "hasDynamicHelp": true,
12214
- "hiddenAliases": [],
12215
- "id": "hardis:project:fix:profiletabs",
12216
- "pluginAlias": "sfdx-hardis",
12217
- "pluginName": "sfdx-hardis",
12218
- "pluginType": "core",
12219
- "strict": true,
12220
- "enableJsonFlag": true,
12221
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12222
- "requiresProject": true,
12223
- "isESM": true,
12224
- "relativePath": [
12225
- "lib",
12226
- "commands",
12227
- "hardis",
12228
- "project",
12229
- "fix",
12230
- "profiletabs.js"
12231
- ],
12232
- "aliasPermutations": [],
12233
- "permutations": [
12234
- "hardis:project:fix:profiletabs",
12235
- "project:hardis:fix:profiletabs",
12236
- "project:fix:hardis:profiletabs",
12237
- "project:fix:profiletabs:hardis",
12238
- "hardis:fix:project:profiletabs",
12239
- "fix:hardis:project:profiletabs",
12240
- "fix:project:hardis:profiletabs",
12241
- "fix:project:profiletabs:hardis",
12242
- "hardis:fix:profiletabs:project",
12243
- "fix:hardis:profiletabs:project",
12244
- "fix:profiletabs:hardis:project",
12245
- "fix:profiletabs:project:hardis",
12246
- "hardis:project:profiletabs:fix",
12247
- "project:hardis:profiletabs:fix",
12248
- "project:profiletabs:hardis:fix",
12249
- "project:profiletabs:fix:hardis",
12250
- "hardis:profiletabs:project:fix",
12251
- "profiletabs:hardis:project:fix",
12252
- "profiletabs:project:hardis:fix",
12253
- "profiletabs:project:fix:hardis",
12254
- "hardis:profiletabs:fix:project",
12255
- "profiletabs:hardis:fix:project",
12256
- "profiletabs:fix:hardis:project",
12257
- "profiletabs:fix:project:hardis"
12258
- ]
12259
- },
12260
- "hardis:project:fix:v53flexipages": {
12261
- "aliases": [],
12262
- "args": {},
12263
- "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12264
- "examples": [
12265
- "$ sf hardis:project:fix:v53flexipages"
12266
- ],
12267
- "flags": {
12268
- "json": {
12269
- "description": "Format output as json.",
12270
- "helpGroup": "GLOBAL",
12271
- "name": "json",
12272
- "allowNo": false,
12273
- "type": "boolean"
12274
- },
12275
- "flags-dir": {
12276
- "helpGroup": "GLOBAL",
12277
- "name": "flags-dir",
12278
- "summary": "Import flag values from a directory.",
12279
- "hasDynamicHelp": false,
12280
- "multiple": false,
12281
- "type": "option"
12282
- },
12283
- "path": {
12284
- "char": "p",
12285
- "description": "Root folder",
12286
- "name": "path",
12287
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12288
- "hasDynamicHelp": false,
12289
- "multiple": false,
12290
- "type": "option"
12291
- },
12292
- "debug": {
12293
- "char": "d",
12294
- "description": "Activate debug mode (more logs)",
12295
- "name": "debug",
12296
- "allowNo": false,
12297
- "type": "boolean"
12298
- },
12299
- "websocket": {
12300
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12301
- "name": "websocket",
12302
- "hasDynamicHelp": false,
12303
- "multiple": false,
12304
- "type": "option"
12305
- },
12306
- "skipauth": {
12307
- "description": "Skip authentication check when a default username is required",
12308
- "name": "skipauth",
12309
- "allowNo": false,
12310
- "type": "boolean"
12311
- }
12312
- },
12313
- "hasDynamicHelp": false,
12314
- "hiddenAliases": [],
12315
- "id": "hardis:project:fix:v53flexipages",
12316
- "pluginAlias": "sfdx-hardis",
12317
- "pluginName": "sfdx-hardis",
12318
- "pluginType": "core",
12319
- "strict": true,
12320
- "enableJsonFlag": true,
12321
- "title": "Fix flexipages for v53",
12322
- "requiresProject": true,
12323
- "isESM": true,
12324
- "relativePath": [
12325
- "lib",
12326
- "commands",
12327
- "hardis",
12328
- "project",
12329
- "fix",
12330
- "v53flexipages.js"
12331
- ],
12332
- "aliasPermutations": [],
12333
- "permutations": [
12334
- "hardis:project:fix:v53flexipages",
12335
- "project:hardis:fix:v53flexipages",
12336
- "project:fix:hardis:v53flexipages",
12337
- "project:fix:v53flexipages:hardis",
12338
- "hardis:fix:project:v53flexipages",
12339
- "fix:hardis:project:v53flexipages",
12340
- "fix:project:hardis:v53flexipages",
12341
- "fix:project:v53flexipages:hardis",
12342
- "hardis:fix:v53flexipages:project",
12343
- "fix:hardis:v53flexipages:project",
12344
- "fix:v53flexipages:hardis:project",
12345
- "fix:v53flexipages:project:hardis",
12346
- "hardis:project:v53flexipages:fix",
12347
- "project:hardis:v53flexipages:fix",
12348
- "project:v53flexipages:hardis:fix",
12349
- "project:v53flexipages:fix:hardis",
12350
- "hardis:v53flexipages:project:fix",
12351
- "v53flexipages:hardis:project:fix",
12352
- "v53flexipages:project:hardis:fix",
12353
- "v53flexipages:project:fix:hardis",
12354
- "hardis:v53flexipages:fix:project",
12355
- "v53flexipages:hardis:fix:project",
12356
- "v53flexipages:fix:hardis:project",
12357
- "v53flexipages:fix:project:hardis"
12102
+ "pluginName": "sfdx-hardis",
12103
+ "pluginType": "core",
12104
+ "strict": true,
12105
+ "enableJsonFlag": true,
12106
+ "title": "Clean retrieved empty items in dx sources",
12107
+ "requiresProject": true,
12108
+ "isESM": true,
12109
+ "relativePath": [
12110
+ "lib",
12111
+ "commands",
12112
+ "hardis",
12113
+ "project",
12114
+ "clean",
12115
+ "xml.js"
12116
+ ],
12117
+ "aliasPermutations": [],
12118
+ "permutations": [
12119
+ "hardis:project:clean:xml",
12120
+ "project:hardis:clean:xml",
12121
+ "project:clean:hardis:xml",
12122
+ "project:clean:xml:hardis",
12123
+ "hardis:clean:project:xml",
12124
+ "clean:hardis:project:xml",
12125
+ "clean:project:hardis:xml",
12126
+ "clean:project:xml:hardis",
12127
+ "hardis:clean:xml:project",
12128
+ "clean:hardis:xml:project",
12129
+ "clean:xml:hardis:project",
12130
+ "clean:xml:project:hardis",
12131
+ "hardis:project:xml:clean",
12132
+ "project:hardis:xml:clean",
12133
+ "project:xml:hardis:clean",
12134
+ "project:xml:clean:hardis",
12135
+ "hardis:xml:project:clean",
12136
+ "xml:hardis:project:clean",
12137
+ "xml:project:hardis:clean",
12138
+ "xml:project:clean:hardis",
12139
+ "hardis:xml:clean:project",
12140
+ "xml:hardis:clean:project",
12141
+ "xml:clean:hardis:project",
12142
+ "xml:clean:project:hardis"
12358
12143
  ]
12359
12144
  },
12360
12145
  "hardis:project:deploy:notify": {
@@ -13531,6 +13316,221 @@
13531
13316
  "validate:deploy:project:hardis"
13532
13317
  ]
13533
13318
  },
13319
+ "hardis:project:fix:profiletabs": {
13320
+ "aliases": [],
13321
+ "args": {},
13322
+ "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
13323
+ "examples": [
13324
+ "$ sf hardis:project:fix:profiletabs"
13325
+ ],
13326
+ "flags": {
13327
+ "json": {
13328
+ "description": "Format output as json.",
13329
+ "helpGroup": "GLOBAL",
13330
+ "name": "json",
13331
+ "allowNo": false,
13332
+ "type": "boolean"
13333
+ },
13334
+ "flags-dir": {
13335
+ "helpGroup": "GLOBAL",
13336
+ "name": "flags-dir",
13337
+ "summary": "Import flag values from a directory.",
13338
+ "hasDynamicHelp": false,
13339
+ "multiple": false,
13340
+ "type": "option"
13341
+ },
13342
+ "path": {
13343
+ "char": "p",
13344
+ "description": "Root folder",
13345
+ "name": "path",
13346
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
13347
+ "hasDynamicHelp": false,
13348
+ "multiple": false,
13349
+ "type": "option"
13350
+ },
13351
+ "debug": {
13352
+ "char": "d",
13353
+ "description": "Activate debug mode (more logs)",
13354
+ "name": "debug",
13355
+ "allowNo": false,
13356
+ "type": "boolean"
13357
+ },
13358
+ "websocket": {
13359
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13360
+ "name": "websocket",
13361
+ "hasDynamicHelp": false,
13362
+ "multiple": false,
13363
+ "type": "option"
13364
+ },
13365
+ "skipauth": {
13366
+ "description": "Skip authentication check when a default username is required",
13367
+ "name": "skipauth",
13368
+ "allowNo": false,
13369
+ "type": "boolean"
13370
+ },
13371
+ "target-org": {
13372
+ "aliases": [
13373
+ "targetusername",
13374
+ "u"
13375
+ ],
13376
+ "char": "o",
13377
+ "deprecateAliases": true,
13378
+ "name": "target-org",
13379
+ "noCacheDefault": true,
13380
+ "required": true,
13381
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
13382
+ "hasDynamicHelp": true,
13383
+ "multiple": false,
13384
+ "type": "option"
13385
+ }
13386
+ },
13387
+ "hasDynamicHelp": true,
13388
+ "hiddenAliases": [],
13389
+ "id": "hardis:project:fix:profiletabs",
13390
+ "pluginAlias": "sfdx-hardis",
13391
+ "pluginName": "sfdx-hardis",
13392
+ "pluginType": "core",
13393
+ "strict": true,
13394
+ "enableJsonFlag": true,
13395
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
13396
+ "requiresProject": true,
13397
+ "isESM": true,
13398
+ "relativePath": [
13399
+ "lib",
13400
+ "commands",
13401
+ "hardis",
13402
+ "project",
13403
+ "fix",
13404
+ "profiletabs.js"
13405
+ ],
13406
+ "aliasPermutations": [],
13407
+ "permutations": [
13408
+ "hardis:project:fix:profiletabs",
13409
+ "project:hardis:fix:profiletabs",
13410
+ "project:fix:hardis:profiletabs",
13411
+ "project:fix:profiletabs:hardis",
13412
+ "hardis:fix:project:profiletabs",
13413
+ "fix:hardis:project:profiletabs",
13414
+ "fix:project:hardis:profiletabs",
13415
+ "fix:project:profiletabs:hardis",
13416
+ "hardis:fix:profiletabs:project",
13417
+ "fix:hardis:profiletabs:project",
13418
+ "fix:profiletabs:hardis:project",
13419
+ "fix:profiletabs:project:hardis",
13420
+ "hardis:project:profiletabs:fix",
13421
+ "project:hardis:profiletabs:fix",
13422
+ "project:profiletabs:hardis:fix",
13423
+ "project:profiletabs:fix:hardis",
13424
+ "hardis:profiletabs:project:fix",
13425
+ "profiletabs:hardis:project:fix",
13426
+ "profiletabs:project:hardis:fix",
13427
+ "profiletabs:project:fix:hardis",
13428
+ "hardis:profiletabs:fix:project",
13429
+ "profiletabs:hardis:fix:project",
13430
+ "profiletabs:fix:hardis:project",
13431
+ "profiletabs:fix:project:hardis"
13432
+ ]
13433
+ },
13434
+ "hardis:project:fix:v53flexipages": {
13435
+ "aliases": [],
13436
+ "args": {},
13437
+ "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
13438
+ "examples": [
13439
+ "$ sf hardis:project:fix:v53flexipages"
13440
+ ],
13441
+ "flags": {
13442
+ "json": {
13443
+ "description": "Format output as json.",
13444
+ "helpGroup": "GLOBAL",
13445
+ "name": "json",
13446
+ "allowNo": false,
13447
+ "type": "boolean"
13448
+ },
13449
+ "flags-dir": {
13450
+ "helpGroup": "GLOBAL",
13451
+ "name": "flags-dir",
13452
+ "summary": "Import flag values from a directory.",
13453
+ "hasDynamicHelp": false,
13454
+ "multiple": false,
13455
+ "type": "option"
13456
+ },
13457
+ "path": {
13458
+ "char": "p",
13459
+ "description": "Root folder",
13460
+ "name": "path",
13461
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
13462
+ "hasDynamicHelp": false,
13463
+ "multiple": false,
13464
+ "type": "option"
13465
+ },
13466
+ "debug": {
13467
+ "char": "d",
13468
+ "description": "Activate debug mode (more logs)",
13469
+ "name": "debug",
13470
+ "allowNo": false,
13471
+ "type": "boolean"
13472
+ },
13473
+ "websocket": {
13474
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13475
+ "name": "websocket",
13476
+ "hasDynamicHelp": false,
13477
+ "multiple": false,
13478
+ "type": "option"
13479
+ },
13480
+ "skipauth": {
13481
+ "description": "Skip authentication check when a default username is required",
13482
+ "name": "skipauth",
13483
+ "allowNo": false,
13484
+ "type": "boolean"
13485
+ }
13486
+ },
13487
+ "hasDynamicHelp": false,
13488
+ "hiddenAliases": [],
13489
+ "id": "hardis:project:fix:v53flexipages",
13490
+ "pluginAlias": "sfdx-hardis",
13491
+ "pluginName": "sfdx-hardis",
13492
+ "pluginType": "core",
13493
+ "strict": true,
13494
+ "enableJsonFlag": true,
13495
+ "title": "Fix flexipages for v53",
13496
+ "requiresProject": true,
13497
+ "isESM": true,
13498
+ "relativePath": [
13499
+ "lib",
13500
+ "commands",
13501
+ "hardis",
13502
+ "project",
13503
+ "fix",
13504
+ "v53flexipages.js"
13505
+ ],
13506
+ "aliasPermutations": [],
13507
+ "permutations": [
13508
+ "hardis:project:fix:v53flexipages",
13509
+ "project:hardis:fix:v53flexipages",
13510
+ "project:fix:hardis:v53flexipages",
13511
+ "project:fix:v53flexipages:hardis",
13512
+ "hardis:fix:project:v53flexipages",
13513
+ "fix:hardis:project:v53flexipages",
13514
+ "fix:project:hardis:v53flexipages",
13515
+ "fix:project:v53flexipages:hardis",
13516
+ "hardis:fix:v53flexipages:project",
13517
+ "fix:hardis:v53flexipages:project",
13518
+ "fix:v53flexipages:hardis:project",
13519
+ "fix:v53flexipages:project:hardis",
13520
+ "hardis:project:v53flexipages:fix",
13521
+ "project:hardis:v53flexipages:fix",
13522
+ "project:v53flexipages:hardis:fix",
13523
+ "project:v53flexipages:fix:hardis",
13524
+ "hardis:v53flexipages:project:fix",
13525
+ "v53flexipages:hardis:project:fix",
13526
+ "v53flexipages:project:hardis:fix",
13527
+ "v53flexipages:project:fix:hardis",
13528
+ "hardis:v53flexipages:fix:project",
13529
+ "v53flexipages:hardis:fix:project",
13530
+ "v53flexipages:fix:hardis:project",
13531
+ "v53flexipages:fix:project:hardis"
13532
+ ]
13533
+ },
13534
13534
  "hardis:project:generate:bypass": {
13535
13535
  "aliases": [],
13536
13536
  "args": {},
@@ -16104,5 +16104,5 @@
16104
16104
  ]
16105
16105
  }
16106
16106
  },
16107
- "version": "6.17.2-alpha202512261505.0"
16107
+ "version": "6.17.2-alpha202512261745.0"
16108
16108
  }