sfdx-hardis 5.45.0 → 5.45.1-beta202508100129.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.
- package/CHANGELOG.md +8 -0
- package/lib/commands/hardis/auth/login.js +20 -6
- package/lib/commands/hardis/auth/login.js.map +1 -1
- package/lib/commands/hardis/cache/clear.d.ts +4 -1
- package/lib/commands/hardis/cache/clear.js +20 -2
- package/lib/commands/hardis/cache/clear.js.map +1 -1
- package/lib/commands/hardis/config/get.js +20 -1
- package/lib/commands/hardis/config/get.js.map +1 -1
- package/lib/commands/hardis/doc/extract/permsetgroups.js +25 -1
- package/lib/commands/hardis/doc/extract/permsetgroups.js.map +1 -1
- package/lib/commands/hardis/doc/fieldusage.js +21 -3
- package/lib/commands/hardis/doc/fieldusage.js.map +1 -1
- package/lib/commands/hardis/doc/flow2markdown.js +31 -4
- package/lib/commands/hardis/doc/flow2markdown.js.map +1 -1
- package/lib/commands/hardis/doc/mkdocs-to-cf.js +48 -28
- package/lib/commands/hardis/doc/mkdocs-to-cf.js.map +1 -1
- package/lib/commands/hardis/doc/mkdocs-to-salesforce.js +40 -17
- package/lib/commands/hardis/doc/mkdocs-to-salesforce.js.map +1 -1
- package/lib/commands/hardis/doc/override-prompts.js +43 -38
- package/lib/commands/hardis/doc/override-prompts.js.map +1 -1
- package/lib/commands/hardis/doc/packagexml2markdown.js +27 -1
- package/lib/commands/hardis/doc/packagexml2markdown.js.map +1 -1
- package/lib/commands/hardis/doc/plugin/generate.js +35 -7
- package/lib/commands/hardis/doc/plugin/generate.js.map +1 -1
- package/lib/commands/hardis/doc/project2markdown.js +11 -2
- package/lib/commands/hardis/doc/project2markdown.js.map +1 -1
- package/lib/commands/hardis/git/pull-requests/extract.js +27 -1
- package/lib/commands/hardis/git/pull-requests/extract.js.map +1 -1
- package/lib/commands/hardis/lint/access.js +37 -6
- package/lib/commands/hardis/lint/access.js.map +1 -1
- package/lib/commands/hardis/lint/metadatastatus.js +29 -10
- package/lib/commands/hardis/lint/metadatastatus.js.map +1 -1
- package/lib/commands/hardis/lint/missingattributes.js +25 -1
- package/lib/commands/hardis/lint/missingattributes.js.map +1 -1
- package/lib/commands/hardis/lint/unusedmetadatas.js +104 -49
- package/lib/commands/hardis/lint/unusedmetadatas.js.map +1 -1
- package/lib/commands/hardis/mdapi/deploy.d.ts +1 -1
- package/lib/commands/hardis/mdapi/deploy.js +24 -2
- package/lib/commands/hardis/mdapi/deploy.js.map +1 -1
- package/lib/commands/hardis/misc/custom-label-translations.js +38 -1
- package/lib/commands/hardis/misc/custom-label-translations.js.map +1 -1
- package/lib/commands/hardis/misc/purge-references.js +33 -3
- package/lib/commands/hardis/misc/purge-references.js.map +1 -1
- package/lib/commands/hardis/misc/servicenow-report.js +4 -0
- package/lib/commands/hardis/misc/servicenow-report.js.map +1 -1
- package/lib/commands/hardis/misc/toml2csv.js +39 -1
- package/lib/commands/hardis/misc/toml2csv.js.map +1 -1
- package/lib/commands/hardis/org/community/update.d.ts +1 -1
- package/lib/commands/hardis/org/community/update.js +28 -1
- package/lib/commands/hardis/org/community/update.js.map +1 -1
- package/lib/commands/hardis/org/configure/data.js +45 -10
- package/lib/commands/hardis/org/configure/data.js.map +1 -1
- package/lib/commands/hardis/org/configure/files.js +30 -2
- package/lib/commands/hardis/org/configure/files.js.map +1 -1
- package/lib/commands/hardis/org/configure/monitoring.js +41 -7
- package/lib/commands/hardis/org/configure/monitoring.js.map +1 -1
- package/lib/commands/hardis/org/connect.js +23 -2
- package/lib/commands/hardis/org/connect.js.map +1 -1
- package/lib/commands/hardis/org/create.js +31 -2
- package/lib/commands/hardis/org/create.js.map +1 -1
- package/lib/commands/hardis/org/data/delete.js +28 -6
- package/lib/commands/hardis/org/data/delete.js.map +1 -1
- package/lib/commands/hardis/org/data/export.js +28 -2
- package/lib/commands/hardis/org/data/export.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/audittrail.js +18 -16
- package/lib/commands/hardis/org/diagnose/audittrail.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/instanceupgrade.js +26 -2
- package/lib/commands/hardis/org/diagnose/instanceupgrade.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/legacyapi.js +1 -2
- package/lib/commands/hardis/org/diagnose/legacyapi.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/licenses.js +29 -1
- package/lib/commands/hardis/org/diagnose/licenses.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/unused-apex-classes.js +5 -0
- package/lib/commands/hardis/org/diagnose/unused-apex-classes.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/unused-connected-apps.js +35 -7
- package/lib/commands/hardis/org/diagnose/unused-connected-apps.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/unusedlicenses.js +33 -10
- package/lib/commands/hardis/org/diagnose/unusedlicenses.js.map +1 -1
- package/lib/commands/hardis/org/diagnose/unusedusers.js +28 -7
- package/lib/commands/hardis/org/diagnose/unusedusers.js.map +1 -1
- package/lib/commands/hardis/org/files/export.js +25 -5
- package/lib/commands/hardis/org/files/export.js.map +1 -1
- package/lib/commands/hardis/org/files/import.js +23 -3
- package/lib/commands/hardis/org/files/import.js.map +1 -1
- package/lib/commands/hardis/org/generate/packagexmlfull.js +33 -2
- package/lib/commands/hardis/org/generate/packagexmlfull.js.map +1 -1
- package/lib/commands/hardis/org/monitor/backup.js +4 -3
- package/lib/commands/hardis/org/monitor/backup.js.map +1 -1
- package/lib/commands/hardis/org/monitor/limits.js +27 -1
- package/lib/commands/hardis/org/monitor/limits.js.map +1 -1
- package/lib/commands/hardis/org/multi-org-query.js +28 -4
- package/lib/commands/hardis/org/multi-org-query.js.map +1 -1
- package/lib/commands/hardis/org/purge/apexlog.js +27 -1
- package/lib/commands/hardis/org/purge/apexlog.js.map +1 -1
- package/lib/commands/hardis/org/purge/flow.js +56 -13
- package/lib/commands/hardis/org/purge/flow.js.map +1 -1
- package/lib/commands/hardis/org/retrieve/packageconfig.js +29 -3
- package/lib/commands/hardis/org/retrieve/packageconfig.js.map +1 -1
- package/lib/commands/hardis/org/retrieve/sources/analytics.js +24 -1
- package/lib/commands/hardis/org/retrieve/sources/analytics.js.map +1 -1
- package/lib/commands/hardis/org/retrieve/sources/dx.js +33 -2
- package/lib/commands/hardis/org/retrieve/sources/dx.js.map +1 -1
- package/lib/commands/hardis/org/retrieve/sources/dx2.js +28 -3
- package/lib/commands/hardis/org/retrieve/sources/dx2.js.map +1 -1
- package/lib/commands/hardis/org/retrieve/sources/metadata.js +28 -1
- package/lib/commands/hardis/org/retrieve/sources/metadata.js.map +1 -1
- package/lib/commands/hardis/org/select.js +24 -1
- package/lib/commands/hardis/org/select.js.map +1 -1
- package/lib/commands/hardis/org/test/apex.js +14 -3
- package/lib/commands/hardis/org/test/apex.js.map +1 -1
- package/lib/commands/hardis/org/user/activateinvalid.js +3 -0
- package/lib/commands/hardis/org/user/activateinvalid.js.map +1 -1
- package/lib/commands/hardis/org/user/freeze.js +29 -2
- package/lib/commands/hardis/org/user/freeze.js.map +1 -1
- package/lib/commands/hardis/org/user/unfreeze.js +29 -2
- package/lib/commands/hardis/org/user/unfreeze.js.map +1 -1
- package/lib/commands/hardis/package/create.js +30 -1
- package/lib/commands/hardis/package/create.js.map +1 -1
- package/lib/commands/hardis/package/install.js +6 -0
- package/lib/commands/hardis/package/install.js.map +1 -1
- package/lib/commands/hardis/package/mergexml.js +27 -1
- package/lib/commands/hardis/package/mergexml.js.map +1 -1
- package/lib/commands/hardis/package/version/create.js +33 -2
- package/lib/commands/hardis/package/version/create.js.map +1 -1
- package/lib/commands/hardis/package/version/list.js +20 -1
- package/lib/commands/hardis/package/version/list.js.map +1 -1
- package/lib/commands/hardis/package/version/promote.js +26 -1
- package/lib/commands/hardis/package/version/promote.js.map +1 -1
- package/lib/commands/hardis/packagexml/append.d.ts +1 -1
- package/lib/commands/hardis/packagexml/append.js +23 -1
- package/lib/commands/hardis/packagexml/append.js.map +1 -1
- package/lib/commands/hardis/packagexml/remove.d.ts +1 -1
- package/lib/commands/hardis/packagexml/remove.js +24 -1
- package/lib/commands/hardis/packagexml/remove.js.map +1 -1
- package/lib/commands/hardis/project/audit/apiversion.js +35 -24
- package/lib/commands/hardis/project/audit/apiversion.js.map +1 -1
- package/lib/commands/hardis/project/audit/callincallout.js +27 -1
- package/lib/commands/hardis/project/audit/callincallout.js.map +1 -1
- package/lib/commands/hardis/project/audit/duplicatefiles.js +35 -2
- package/lib/commands/hardis/project/audit/duplicatefiles.js.map +1 -1
- package/lib/commands/hardis/project/audit/remotesites.js +25 -1
- package/lib/commands/hardis/project/audit/remotesites.js.map +1 -1
- package/lib/commands/hardis/project/clean/emptyitems.js +25 -1
- package/lib/commands/hardis/project/clean/emptyitems.js.map +1 -1
- package/lib/commands/hardis/project/clean/filter-xml-content.d.ts +1 -1
- package/lib/commands/hardis/project/clean/filter-xml-content.js +28 -5
- package/lib/commands/hardis/project/clean/filter-xml-content.js.map +1 -1
- package/lib/commands/hardis/project/clean/hiddenitems.js +25 -1
- package/lib/commands/hardis/project/clean/hiddenitems.js.map +1 -1
- package/lib/commands/hardis/project/clean/manageditems.js +24 -1
- package/lib/commands/hardis/project/clean/manageditems.js.map +1 -1
- package/lib/commands/hardis/project/clean/minimizeprofiles.js +9 -6
- package/lib/commands/hardis/project/clean/minimizeprofiles.js.map +1 -1
- package/lib/commands/hardis/project/clean/orgmissingitems.js +30 -2
- package/lib/commands/hardis/project/clean/orgmissingitems.js.map +1 -1
- package/lib/commands/hardis/project/clean/references.js +30 -3
- package/lib/commands/hardis/project/clean/references.js.map +1 -1
- package/lib/commands/hardis/project/clean/retrievefolders.js +20 -1
- package/lib/commands/hardis/project/clean/retrievefolders.js.map +1 -1
- package/lib/commands/hardis/project/clean/standarditems.js +25 -1
- package/lib/commands/hardis/project/clean/standarditems.js.map +1 -1
- package/lib/commands/hardis/project/clean/systemdebug.js +28 -1
- package/lib/commands/hardis/project/clean/systemdebug.js.map +1 -1
- package/lib/commands/hardis/project/clean/xml.js +5 -4
- package/lib/commands/hardis/project/clean/xml.js.map +1 -1
- package/lib/commands/hardis/project/configure/auth.js +74 -8
- package/lib/commands/hardis/project/configure/auth.js.map +1 -1
- package/lib/commands/hardis/project/convert/profilestopermsets.js +22 -1
- package/lib/commands/hardis/project/convert/profilestopermsets.js.map +1 -1
- package/lib/commands/hardis/project/create.js +5 -1
- package/lib/commands/hardis/project/create.js.map +1 -1
- package/lib/commands/hardis/project/deploy/simulate.js +27 -4
- package/lib/commands/hardis/project/deploy/simulate.js.map +1 -1
- package/lib/commands/hardis/project/fix/profiletabs.js +30 -1
- package/lib/commands/hardis/project/fix/profiletabs.js.map +1 -1
- package/lib/commands/hardis/project/fix/v53flexipages.js +24 -2
- package/lib/commands/hardis/project/fix/v53flexipages.js.map +1 -1
- package/lib/commands/hardis/project/generate/bypass.js +58 -14
- package/lib/commands/hardis/project/generate/bypass.js.map +1 -1
- package/lib/commands/hardis/project/generate/flow-git-diff.js +4 -0
- package/lib/commands/hardis/project/generate/flow-git-diff.js.map +1 -1
- package/lib/commands/hardis/project/generate/gitdelta.js +42 -3
- package/lib/commands/hardis/project/generate/gitdelta.js.map +1 -1
- package/lib/commands/hardis/project/lint.js +23 -1
- package/lib/commands/hardis/project/lint.js.map +1 -1
- package/lib/commands/hardis/project/metadata/findduplicates.js +19 -7
- package/lib/commands/hardis/project/metadata/findduplicates.js.map +1 -1
- package/lib/commands/hardis/scratch/create.js +3 -2
- package/lib/commands/hardis/scratch/create.js.map +1 -1
- package/lib/commands/hardis/scratch/delete.js +24 -1
- package/lib/commands/hardis/scratch/delete.js.map +1 -1
- package/lib/commands/hardis/scratch/pool/create.js +4 -0
- package/lib/commands/hardis/scratch/pool/create.js.map +1 -1
- package/lib/commands/hardis/scratch/pool/localauth.js +22 -1
- package/lib/commands/hardis/scratch/pool/localauth.js.map +1 -1
- package/lib/commands/hardis/scratch/pool/refresh.js +25 -1
- package/lib/commands/hardis/scratch/pool/refresh.js.map +1 -1
- package/lib/commands/hardis/scratch/pool/reset.js +25 -1
- package/lib/commands/hardis/scratch/pool/reset.js.map +1 -1
- package/lib/commands/hardis/scratch/pool/view.js +22 -1
- package/lib/commands/hardis/scratch/pool/view.js.map +1 -1
- package/lib/commands/hardis/scratch/pull.js +28 -9
- package/lib/commands/hardis/scratch/pull.js.map +1 -1
- package/lib/commands/hardis/scratch/push.js +17 -2
- package/lib/commands/hardis/scratch/push.js.map +1 -1
- package/lib/commands/hardis/source/retrieve.d.ts +1 -1
- package/lib/commands/hardis/source/retrieve.js +22 -4
- package/lib/commands/hardis/source/retrieve.js.map +1 -1
- package/lib/commands/hardis/work/new.js +51 -88
- package/lib/commands/hardis/work/new.js.map +1 -1
- package/lib/commands/hardis/work/refresh.js +42 -1
- package/lib/commands/hardis/work/refresh.js.map +1 -1
- package/lib/commands/hardis/work/resetselection.js +28 -3
- package/lib/commands/hardis/work/resetselection.js.map +1 -1
- package/lib/commands/hardis/work/save.js +52 -30
- package/lib/commands/hardis/work/save.js.map +1 -1
- package/lib/commands/hardis/work/ws.d.ts +3 -0
- package/lib/commands/hardis/work/ws.js +23 -3
- package/lib/commands/hardis/work/ws.js.map +1 -1
- package/lib/commands/hello/world.d.ts +1 -1
- package/lib/commands/hello/world.js +20 -1
- package/lib/commands/hello/world.js.map +1 -1
- package/lib/common/aiProvider/index.js +1 -0
- package/lib/common/aiProvider/index.js.map +1 -1
- package/lib/common/gitProvider/azureDevops.js +2 -1
- package/lib/common/gitProvider/azureDevops.js.map +1 -1
- package/lib/common/gitProvider/index.js +1 -0
- package/lib/common/gitProvider/index.js.map +1 -1
- package/lib/common/metadata-utils/index.js +12 -4
- package/lib/common/metadata-utils/index.js.map +1 -1
- package/lib/common/utils/apiUtils.js +22 -9
- package/lib/common/utils/apiUtils.js.map +1 -1
- package/lib/common/utils/authUtils.js +3 -2
- package/lib/common/utils/authUtils.js.map +1 -1
- package/lib/common/utils/dataUtils.js +1 -0
- package/lib/common/utils/dataUtils.js.map +1 -1
- package/lib/common/utils/deployUtils.js +21 -2
- package/lib/common/utils/deployUtils.js.map +1 -1
- package/lib/common/utils/filesUtils.js +33 -9
- package/lib/common/utils/filesUtils.js.map +1 -1
- package/lib/common/utils/gitUtils.js +3 -1
- package/lib/common/utils/gitUtils.js.map +1 -1
- package/lib/common/utils/index.d.ts +1 -1
- package/lib/common/utils/index.js +104 -25
- package/lib/common/utils/index.js.map +1 -1
- package/lib/common/utils/mermaidUtils.js +2 -2
- package/lib/common/utils/orgUtils.js +31 -18
- package/lib/common/utils/orgUtils.js.map +1 -1
- package/lib/common/utils/poolUtils.js +1 -0
- package/lib/common/utils/poolUtils.js.map +1 -1
- package/lib/common/utils/prompts.d.ts +2 -0
- package/lib/common/utils/prompts.js +4 -0
- package/lib/common/utils/prompts.js.map +1 -1
- package/lib/common/utils/xmlUtils.js +1 -1
- package/lib/common/websocketClient.d.ts +15 -2
- package/lib/common/websocketClient.js +149 -10
- package/lib/common/websocketClient.js.map +1 -1
- package/lib/config/index.js +4 -1
- package/lib/config/index.js.map +1 -1
- package/lib/hooks/{postrun → finally}/notify.d.ts +1 -1
- package/lib/hooks/{postrun → finally}/notify.js +3 -1
- package/lib/hooks/finally/notify.js.map +1 -0
- package/lib/hooks/init/check-local-sfdx-hardis-files.js +3 -1
- package/lib/hooks/init/check-local-sfdx-hardis-files.js.map +1 -1
- package/oclif.lock +117 -60
- package/oclif.manifest.json +636 -630
- package/package.json +15 -11
- package/lib/hooks/postrun/notify.js.map +0 -1
|
@@ -11,34 +11,38 @@ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
|
11
11
|
const messages = Messages.loadMessages('sfdx-hardis', 'org');
|
|
12
12
|
export default class OverridePrompts extends SfCommand {
|
|
13
13
|
static title = 'Override AI Prompt Templates';
|
|
14
|
-
static description = `
|
|
14
|
+
static description = `
|
|
15
|
+
## Command Behavior
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
**Creates local override files for AI prompt templates and variables, allowing for customization of sfdx-hardis AI interactions.**
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
- Generating documentation with AI
|
|
20
|
-
- Solving deployment errors
|
|
21
|
-
- Describing Salesforce metadata
|
|
19
|
+
This command sets up a \`config/prompt-templates/\` folder within your project. It populates this folder with \`.txt\` files containing the default AI prompt templates and variables used by sfdx-hardis. This enables you to tailor the AI's behavior and responses to your organization's specific needs, terminology, and coding standards.
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
- Role definitions (business analyst, developer, etc.)
|
|
25
|
-
- Formatting requirements for markdown output
|
|
26
|
-
- Security caution instructions
|
|
27
|
-
- Output format specifications
|
|
21
|
+
Key functionalities:
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
- **Template Customization:** Modify templates used for generating documentation, solving deployment errors, and describing Salesforce metadata.
|
|
24
|
+
- **Variable Customization:** Adjust common instruction patterns (e.g., role definitions, formatting requirements, security cautions) that are reused across multiple templates.
|
|
25
|
+
- **Persistent Overrides:** Once created, these local files will override the default sfdx-hardis templates and variables, and they will not be overwritten by future sfdx-hardis updates unless explicitly requested with the \`--overwrite\` flag.
|
|
30
26
|
|
|
31
|
-
After running this command, you can modify any of the
|
|
32
|
-
|
|
33
|
-
**Important**: Once created, existing template and variable files will never be overwritten with newer versions from sfdx-hardis updates, unless you explicitly use the --overwrite flag. This ensures your customizations are preserved.
|
|
27
|
+
**Important:** After running this command, you can modify any of the \`.txt\` files in \`config/prompt-templates/\` to customize the AI's behavior.
|
|
34
28
|
|
|
35
29
|
Available templates:
|
|
36
|
-
${Object.keys(PROMPT_TEMPLATES).map(name => `- ${name}`).join('
|
|
30
|
+
${Object.keys(PROMPT_TEMPLATES).map(name => `- ${name}`).join('\\n')}
|
|
37
31
|
|
|
38
32
|
Available variables:
|
|
39
|
-
${Object.keys(PROMPT_VARIABLES).map(name => `- ${name}`).join('
|
|
33
|
+
${Object.keys(PROMPT_VARIABLES).map(name => `- ${name}`).join('\\n')}
|
|
40
34
|
|
|
41
35
|
More info on [AI Prompts documentation](https://sfdx-hardis.cloudity.com/salesforce-ai-prompts/)
|
|
36
|
+
|
|
37
|
+
## Technical explanations
|
|
38
|
+
|
|
39
|
+
The command's technical implementation involves:
|
|
40
|
+
|
|
41
|
+
- **Directory Creation:** Ensures the \`config/prompt-templates/\` directory exists using \`fs.ensureDirSync()\`.
|
|
42
|
+
- **File Copying:** Iterates through predefined \`PROMPT_TEMPLATES\` and \`PROMPT_VARIABLES\` objects. For each template/variable, it extracts the English text content and writes it to a corresponding \`.txt\` file in the \`config/prompt-templates/\` directory.
|
|
43
|
+
- **Overwrite Logic:** Checks if a file already exists. If the \`--overwrite\` flag is provided, it overwrites the existing file; otherwise, it skips the file and logs a message.
|
|
44
|
+
- **User Feedback:** Provides detailed logs about created, overwritten, and skipped files, along with instructions on how to use the customized prompts and variables.
|
|
45
|
+
- **Dynamic Content:** The description itself dynamically lists available templates and variables by iterating over \`PROMPT_TEMPLATES\` and \`PROMPT_VARIABLES\` objects.
|
|
42
46
|
`;
|
|
43
47
|
static examples = [
|
|
44
48
|
'$ sf hardis:doc:override-prompts',
|
|
@@ -76,6 +80,7 @@ More info on [AI Prompts documentation](https://sfdx-hardis.cloudity.com/salesfo
|
|
|
76
80
|
let createdCount = 0;
|
|
77
81
|
let overwrittenCount = 0;
|
|
78
82
|
let skippedCount = 0;
|
|
83
|
+
uxLog(this, c.cyan('Creating prompt templates and variables...'));
|
|
79
84
|
// Copy all prompt templates as .txt files
|
|
80
85
|
for (const [templateName, templateDefinition] of Object.entries(PROMPT_TEMPLATES)) {
|
|
81
86
|
const targetFile = path.join(promptTemplatesDir, `${templateName}.txt`);
|
|
@@ -85,7 +90,7 @@ More info on [AI Prompts documentation](https://sfdx-hardis.cloudity.com/salesfo
|
|
|
85
90
|
const promptText = templateDefinition.text.en;
|
|
86
91
|
// Overwrite the existing file
|
|
87
92
|
fs.writeFileSync(targetFile, promptText);
|
|
88
|
-
uxLog(this, c.
|
|
93
|
+
uxLog(this, c.grey(`Overwritten: ${templateName}.txt`));
|
|
89
94
|
overwrittenCount++;
|
|
90
95
|
}
|
|
91
96
|
else {
|
|
@@ -110,7 +115,7 @@ More info on [AI Prompts documentation](https://sfdx-hardis.cloudity.com/salesfo
|
|
|
110
115
|
const variableText = variableDefinition.text.en;
|
|
111
116
|
// Overwrite the existing file
|
|
112
117
|
fs.writeFileSync(targetFile, variableText);
|
|
113
|
-
uxLog(this, c.
|
|
118
|
+
uxLog(this, c.grey(`Overwritten: ${variableName}.txt`));
|
|
114
119
|
overwrittenCount++;
|
|
115
120
|
}
|
|
116
121
|
else {
|
|
@@ -127,30 +132,30 @@ More info on [AI Prompts documentation](https://sfdx-hardis.cloudity.com/salesfo
|
|
|
127
132
|
createdCount++;
|
|
128
133
|
} // Summary
|
|
129
134
|
uxLog(this, '');
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
const actionMessage = overwrittenCount > 0 ?
|
|
136
|
+
`Created ${createdCount} and overwritten ${overwrittenCount} prompt template and variable files` :
|
|
137
|
+
`Created ${createdCount} prompt template and variable files`;
|
|
138
|
+
uxLog(this, c.cyan(actionMessage));
|
|
132
139
|
if (overwrittenCount > 0) {
|
|
133
|
-
uxLog(this, c.
|
|
140
|
+
uxLog(this, c.yellow(`Overwritten ${overwrittenCount} existing files`));
|
|
134
141
|
}
|
|
135
142
|
if (skippedCount > 0) {
|
|
136
143
|
uxLog(this, c.yellow(`Skipped ${skippedCount} existing files`));
|
|
137
144
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
uxLog(this, c.
|
|
151
|
-
|
|
152
|
-
`Created ${createdCount} and overwritten ${overwrittenCount} prompt template and variable files` :
|
|
153
|
-
`Created ${createdCount} prompt template and variable files`;
|
|
145
|
+
const usageMessage = [
|
|
146
|
+
'',
|
|
147
|
+
'Prompt templates and variables location:',
|
|
148
|
+
` ${promptTemplatesDir}`,
|
|
149
|
+
'',
|
|
150
|
+
'Usage:',
|
|
151
|
+
' - Edit template .txt files to customize AI prompts',
|
|
152
|
+
' - Edit variable .txt files to customize common instruction patterns',
|
|
153
|
+
' - Use {{VARIABLE_NAME}} placeholders for dynamic content',
|
|
154
|
+
' - Templates can reference variables with {{VARIABLE_NAME}} syntax',
|
|
155
|
+
' - Your custom prompts and variables will override the defaults automatically',
|
|
156
|
+
].join('\n');
|
|
157
|
+
uxLog(this, c.grey(usageMessage));
|
|
158
|
+
uxLog(this, c.grey('Documentation: https://sfdx-hardis.cloudity.com/salesforce-ai-prompts/'));
|
|
154
159
|
return {
|
|
155
160
|
status: 'success',
|
|
156
161
|
message: `${actionMessage} in ${promptTemplatesDir}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"override-prompts.js","sourceRoot":"","sources":["../../../../src/commands/hardis/doc/override-prompts.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,CAAC,MAAM,OAAO,CAAC;AACtB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAc;IAClD,MAAM,CAAC,KAAK,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AAC;QAEnC,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,eAAe,gBAAgB,iBAAiB,CAAC,CAAC,CAAC;QAC1E,CAAC;QAED,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,YAAY,iBAAiB,CAAC,CAAC,CAAC;QAClE,CAAC;QAED,MAAM,YAAY,GAAG;YACnB,EAAE;YACF,0CAA0C;YAC1C,MAAM,kBAAkB,EAAE;YAC1B,EAAE;YACF,QAAQ;YACR,uDAAuD;YACvD,wEAAwE;YACxE,6DAA6D;YAC7D,sEAAsE;YACtE,iFAAiF;SAClF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC,CAAC;QAE9F,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,GAAG,aAAa,OAAO,kBAAkB,EAAE;YACpD,YAAY;YACZ,gBAAgB;YAChB,YAAY;YACZ,SAAS,EAAE,kBAAkB;SAC9B,CAAC;IACJ,CAAC"}
|
|
@@ -7,7 +7,33 @@ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
|
7
7
|
const messages = Messages.loadMessages('sfdx-hardis', 'org');
|
|
8
8
|
export default class PackageXml2Markdown extends SfCommand {
|
|
9
9
|
static title = 'PackageXml to Markdown';
|
|
10
|
-
static description =
|
|
10
|
+
static description = `\
|
|
11
|
+
## Command Behavior\
|
|
12
|
+
\
|
|
13
|
+
**Generates a Markdown documentation file from a Salesforce \`package.xml\` file.**\
|
|
14
|
+
\
|
|
15
|
+
This command provides a convenient way to visualize and document the metadata components defined within a \`package.xml\` file. It's particularly useful for:\
|
|
16
|
+
\
|
|
17
|
+
- **Understanding Project Scope:** Quickly grasp what metadata types and components are included in a specific deployment or retrieval.\
|
|
18
|
+
- **Documentation:** Create human-readable documentation of your project's metadata structure.\
|
|
19
|
+
- **Collaboration:** Share a clear overview of metadata changes with team members or stakeholders.\
|
|
20
|
+
\
|
|
21
|
+
Key features:\
|
|
22
|
+
\
|
|
23
|
+
- **Flexible Input:** You can specify the path to a \`package.xml\` file using the \`--inputfile\` flag. If not provided, the command will automatically look for \`package.xml\` files in the \`manifest\` folder.\
|
|
24
|
+
- **Customizable Output:** You can force the path and name of the output Markdown file using the \`--outputfile\` flag.\
|
|
25
|
+
- **VS Code Integration:** Automatically opens the generated Markdown file in a new VS Code tab for immediate review.\
|
|
26
|
+
\
|
|
27
|
+
## Technical explanations\
|
|
28
|
+
\
|
|
29
|
+
The command's technical implementation involves:\
|
|
30
|
+
\
|
|
31
|
+
- **XML Parsing:** It reads the content of the specified \`package.xml\` file and parses its XML structure to extract the metadata types and their members.\
|
|
32
|
+
- **Markdown Generation:** It utilizes the \`DocBuilderPackageXML.generatePackageXmlMarkdown\` utility to transform the parsed \`package.xml\` data into a structured Markdown format. This utility handles the formatting and organization of the metadata information.\
|
|
33
|
+
- **File System Operations:** It uses \`fs-extra\` (implicitly through \`DocBuilderPackageXML\`) to read the input \`package.xml\` and write the generated Markdown file.\
|
|
34
|
+
- **WebSocket Communication:** It interacts with a WebSocket client (\`WebSocketClient.requestOpenFile\`) to open the generated Markdown file in a VS Code tab, enhancing user experience.\
|
|
35
|
+
- **Salesforce Org Context:** It can optionally use the \`target-org\` flag to provide context, such as the instance URL, which might be used for generating links or additional information within the Markdown.\
|
|
36
|
+
`;
|
|
11
37
|
static examples = [
|
|
12
38
|
'$ sf hardis:doc:packagexml2markdown',
|
|
13
39
|
'$ sf hardis:doc:packagexml2markdown --inputfile manifest/package-all.xml'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packagexml2markdown.js","sourceRoot":"","sources":["../../../../src/commands/hardis/doc/packagexml2markdown.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAE1F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAc;IACtD,MAAM,CAAC,KAAK,GAAG,wBAAwB,CAAC;IAExC,MAAM,CAAC,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"packagexml2markdown.js","sourceRoot":"","sources":["../../../../src/commands/hardis/doc/packagexml2markdown.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAE1F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAc;IACtD,MAAM,CAAC,KAAK,GAAG,wBAAwB,CAAC;IAExC,MAAM,CAAC,WAAW,GAAG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,EAAE,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,EAAE,WAAW,CAAC;QACxE,IAAI,CAAC,UAAU,GAAG,MAAM,oBAAoB,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QAE5H,6CAA6C;QAC7C,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjD,+CAA+C;QAC/C,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IACzC,CAAC"}
|
|
@@ -15,17 +15,45 @@ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
|
15
15
|
const messages = Messages.loadMessages('sfdx-hardis', 'org');
|
|
16
16
|
export default class DocPluginGenerate extends SfCommand {
|
|
17
17
|
static title = 'Generate SF Cli Plugin Documentation';
|
|
18
|
-
static description = `
|
|
18
|
+
static description = `
|
|
19
|
+
## Command Behavior
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
**Generates Markdown documentation for an SF CLI plugin, ready for conversion into HTML with MkDocs.**
|
|
21
22
|
|
|
22
|
-
-
|
|
23
|
-
- .github/workflows/build-deploy-docs.yml
|
|
24
|
-
- docs/javascripts/gtag.js , if you want Google Analytics tracking
|
|
23
|
+
This command automates the creation of comprehensive documentation for your Salesforce CLI plugin. It processes your plugin's commands and their flags to generate structured Markdown files, which can then be used with MkDocs to produce a professional-looking website.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Key functionalities:
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
- **Command Documentation:** Generates a dedicated Markdown file for each command, including its description, parameters (flags), and examples.
|
|
28
|
+
- **Index and Commands Pages:** Creates an \`index.md\` and \`commands.md\` file that list all available commands, providing an overview and easy navigation.
|
|
29
|
+
- **MkDocs Integration:** Sets up the basic MkDocs project structure and updates the \`mkdocs.yml\` navigation to include the generated command documentation.
|
|
30
|
+
- **Default File Copying:** Copies essential MkDocs configuration files and GitHub Actions workflows to your project, streamlining the setup for continuous documentation deployment.
|
|
31
|
+
|
|
32
|
+
**Post-Generation Steps:**
|
|
33
|
+
|
|
34
|
+
After the initial run, you will need to manually update:
|
|
35
|
+
|
|
36
|
+
- \`mkdocs.yml\`: Customize the project title, theme, and other MkDocs settings.
|
|
37
|
+
- \`.github/workflows/build-deploy-docs.yml\`: Configure the GitHub Actions workflow for automatic documentation deployment.
|
|
38
|
+
- \`docs/javascripts/gtag.js\`: If desired, set up Google Analytics tracking.
|
|
39
|
+
|
|
40
|
+
Finally, activate GitHub Pages with \`gh_pages\` as the target branch. This will enable automatic documentation rebuilding and publishing to GitHub Pages upon each merge into your \`master\`/\`main\` branch.
|
|
41
|
+
|
|
42
|
+
## Technical explanations
|
|
43
|
+
|
|
44
|
+
The command's technical implementation involves:
|
|
45
|
+
|
|
46
|
+
- **Plugin Configuration Loading:** It loads the SF CLI plugin's configuration using \`@oclif/core\`'s \`Config.load()\`, which provides access to all registered commands and their metadata.
|
|
47
|
+
- **Command Iteration:** It iterates through each command defined in the plugin's configuration.
|
|
48
|
+
- **Markdown File Generation:** For each command, it constructs a Markdown file (\`.md\`) containing:
|
|
49
|
+
- The command ID as the main heading.
|
|
50
|
+
- The command's \`description\` property.
|
|
51
|
+
- A table of parameters (flags), including their name, type, description, default value, required status, and available options. It dynamically extracts this information from the command's \`flags\` property.
|
|
52
|
+
- Code blocks for each example provided in the command's \`examples\` property.
|
|
53
|
+
- **Navigation Structure:** It builds a nested JavaScript object (\`commandsNav\`) that mirrors the command hierarchy, which is then converted to YAML and inserted into \`mkdocs.yml\` to create the navigation menu.
|
|
54
|
+
- **Index and Commands Page Generation:** It reads the project's \`README.md\` and extracts relevant sections to create the \`index.md\` file. It also generates a separate \`commands.md\` file listing all commands.
|
|
55
|
+
- **File System Operations:** It uses \`fs-extra\` to create directories, copy default MkDocs files (\`defaults/mkdocs\`), and write the generated Markdown and YAML files.
|
|
56
|
+
- **YAML Serialization:** It uses \`js-yaml\` to serialize the navigation object into YAML format for \`mkdocs.yml\`.
|
|
29
57
|
`;
|
|
30
58
|
static examples = ['$ sf hardis:doc:plugin:generate'];
|
|
31
59
|
// public static args = [{name: 'file'}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../../src/commands/hardis/doc/plugin/generate.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,CAAC,MAAM,OAAO,CAAC;AACtB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAE5F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAc;IACpD,MAAM,CAAC,KAAK,GAAG,sCAAsC,CAAC;IAEtD,MAAM,CAAC,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../../src/commands/hardis/doc/plugin/generate.ts"],"names":[],"mappings":"AAAA,wBAAwB;A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UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;QACrG,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC3C,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC3C,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC"}
|
|
@@ -254,6 +254,7 @@ ${this.htmlInstructions}
|
|
|
254
254
|
await fs.writeFile(path.join(this.outputMarkdownRoot, "manifests.md"), getMetaHideLines() + packageLines.join("\n") + `\n${this.footer}\n`);
|
|
255
255
|
this.tempDir = await createTempDir();
|
|
256
256
|
// Convert source to metadata API format to build prompts
|
|
257
|
+
uxLog(this, c.cyan("Converting source to metadata API format..."));
|
|
257
258
|
await execCommand(`sf project convert source --metadata CustomObject --output-dir ${this.tempDir}`, this, { fail: true, output: true, debug: this.debugMode });
|
|
258
259
|
this.objectFiles = (await glob("**/*.object", { cwd: this.tempDir, ignore: GLOB_IGNORE_PATTERNS }));
|
|
259
260
|
sortCrossPlatform(this.objectFiles);
|
|
@@ -334,7 +335,12 @@ ${Project2Markdown.htmlInstructions}
|
|
|
334
335
|
}
|
|
335
336
|
}
|
|
336
337
|
// Open file in a new VsCode tab if available
|
|
337
|
-
WebSocketClient.
|
|
338
|
+
if (WebSocketClient.isAliveWithLwcUI()) {
|
|
339
|
+
WebSocketClient.sendReportFileMessage(this.outputMarkdownIndexFile, "Project documentation Index");
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
WebSocketClient.requestOpenFile(this.outputMarkdownIndexFile);
|
|
343
|
+
}
|
|
338
344
|
return { outputPackageXmlMarkdownFiles: this.outputPackageXmlMarkdownFiles };
|
|
339
345
|
}
|
|
340
346
|
async generateApexDocumentation() {
|
|
@@ -423,6 +429,7 @@ ${Project2Markdown.htmlInstructions}
|
|
|
423
429
|
await fs.writeFile(apexIndexFile, getMetaHideLines() + DocBuilderApex.buildIndexTable('', this.apexDescriptions).join("\n") + `\n\n${this.footer}\n`);
|
|
424
430
|
}
|
|
425
431
|
async generatePackagesDocumentation() {
|
|
432
|
+
uxLog(this, c.cyan("Generating Installed Packages documentation..."));
|
|
426
433
|
const packagesForMenu = { "All Packages": "packages/index.md" };
|
|
427
434
|
// List packages
|
|
428
435
|
const packages = this.sfdxHardisConfig.installedPackages || []; // CI/CD context
|
|
@@ -917,7 +924,7 @@ ${Project2Markdown.htmlInstructions}
|
|
|
917
924
|
uxLog(this, c.grey(`Skip Data Cloud Object ${objectName}... (use INCLUDE_DATA_CLOUD_DOC=true to enforce it)`));
|
|
918
925
|
continue;
|
|
919
926
|
}
|
|
920
|
-
uxLog(this, c.
|
|
927
|
+
uxLog(this, c.grey(`Generating markdown for Object ${objectName}...`));
|
|
921
928
|
const objectXml = (await fs.readFile(path.join(this.tempDir, objectFile), "utf8")).toString();
|
|
922
929
|
const objectMdFile = path.join(this.outputMarkdownRoot, "objects", objectName + ".md");
|
|
923
930
|
// Build filtered XML
|
|
@@ -1146,6 +1153,7 @@ ${Project2Markdown.htmlInstructions}
|
|
|
1146
1153
|
return branchesOrgsLines;
|
|
1147
1154
|
}
|
|
1148
1155
|
async manageLocalPackages() {
|
|
1156
|
+
uxLog(this, c.cyan("Generating package.xml files for local packages..."));
|
|
1149
1157
|
const packageDirs = this.project?.getPackageDirectories();
|
|
1150
1158
|
if (!(packageDirs?.length === 1 && packageDirs[0].name === "force-app" && fs.existsSync("manifest/package.xml"))) {
|
|
1151
1159
|
for (const packageDir of packageDirs || []) {
|
|
@@ -1185,6 +1193,7 @@ ${Project2Markdown.htmlInstructions}
|
|
|
1185
1193
|
}
|
|
1186
1194
|
}
|
|
1187
1195
|
async generatePackageXmlMarkdown(packageXmlCandidates, instanceUrl) {
|
|
1196
|
+
uxLog(this, c.cyan("Generating package.xml documentation..."));
|
|
1188
1197
|
// Generate packageXml doc when found
|
|
1189
1198
|
for (const packageXmlCandidate of packageXmlCandidates) {
|
|
1190
1199
|
if (fs.existsSync(packageXmlCandidate.path)) {
|