sfdx-hardis 5.10.2-beta202412222214.0 → 5.10.2-beta202412280136.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 +5 -0
- package/defaults/mkdocs/docs/stylesheets/extra.css +25 -0
- package/defaults/mkdocs/mkdocs.yml +4 -2
- package/defaults/mkdocs-project-doc/docs/javascripts/gtag.js +27 -0
- package/defaults/mkdocs-project-doc/docs/javascripts/tables.js +6 -0
- package/defaults/mkdocs-project-doc/docs/overrides/main.html +4 -0
- package/defaults/mkdocs-project-doc/docs/stylesheets/extra.css +33 -0
- package/defaults/mkdocs-project-doc/mkdocs.yml +46 -0
- package/lib/commands/hardis/doc/flow2markdown.js +6 -1
- package/lib/commands/hardis/doc/flow2markdown.js.map +1 -1
- package/lib/commands/hardis/doc/project2markdown.d.ts +8 -2
- package/lib/commands/hardis/doc/project2markdown.js +165 -45
- package/lib/commands/hardis/doc/project2markdown.js.map +1 -1
- package/lib/commands/hardis/org/monitor/backup.js +1 -1
- package/lib/commands/hardis/org/monitor/backup.js.map +1 -1
- package/lib/common/gitProvider/azureDevops.d.ts +1 -0
- package/lib/common/gitProvider/azureDevops.js +4 -0
- package/lib/common/gitProvider/azureDevops.js.map +1 -1
- package/lib/common/gitProvider/bitbucket.d.ts +1 -0
- package/lib/common/gitProvider/bitbucket.js +4 -0
- package/lib/common/gitProvider/bitbucket.js.map +1 -1
- package/lib/common/gitProvider/gitProviderRoot.d.ts +1 -0
- package/lib/common/gitProvider/gitProviderRoot.js +4 -0
- package/lib/common/gitProvider/gitProviderRoot.js.map +1 -1
- package/lib/common/gitProvider/github.d.ts +1 -0
- package/lib/common/gitProvider/github.js +4 -0
- package/lib/common/gitProvider/github.js.map +1 -1
- package/lib/common/gitProvider/gitlab.d.ts +1 -0
- package/lib/common/gitProvider/gitlab.js +4 -0
- package/lib/common/gitProvider/gitlab.js.map +1 -1
- package/lib/common/gitProvider/index.d.ts +1 -0
- package/lib/common/gitProvider/index.js +7 -0
- package/lib/common/gitProvider/index.js.map +1 -1
- package/lib/common/gitProvider/utilsMarkdown.d.ts +1 -1
- package/lib/common/gitProvider/utilsMarkdown.js +19 -5
- package/lib/common/gitProvider/utilsMarkdown.js.map +1 -1
- package/lib/common/metadata-utils/index.js +3 -2
- package/lib/common/metadata-utils/index.js.map +1 -1
- package/lib/common/utils/flowVisualiser/flowParser.d.ts +0 -7
- package/lib/common/utils/flowVisualiser/flowParser.js +153 -168
- package/lib/common/utils/flowVisualiser/flowParser.js.map +1 -1
- package/lib/common/utils/flowVisualiser/nodeFormatUtils.d.ts +14 -0
- package/lib/common/utils/flowVisualiser/nodeFormatUtils.js +339 -0
- package/lib/common/utils/flowVisualiser/nodeFormatUtils.js.map +1 -0
- package/lib/common/utils/flowVisualiser/renderConfig.d.ts +9 -3
- package/lib/common/utils/flowVisualiser/renderConfig.js +62 -56
- package/lib/common/utils/flowVisualiser/renderConfig.js.map +1 -1
- package/lib/common/utils/gitUtils.js +2 -2
- package/lib/common/utils/gitUtils.js.map +1 -1
- package/lib/common/utils/mermaidUtils.d.ts +3 -1
- package/lib/common/utils/mermaidUtils.js +125 -69
- package/lib/common/utils/mermaidUtils.js.map +1 -1
- package/oclif.lock +95 -3
- package/oclif.manifest.json +64 -50
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,7 @@ Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image
|
|
|
7
7
|
- Visual flow management, using MermaidJs
|
|
8
8
|
- [hardis:doc:project2markdown](https://sfdx-hardis.cloudity.com/hardis/doc/project2markdown/): Add a markdown file for each Flow
|
|
9
9
|
- If unable to run mermaid-cli, store markdown with mermaidJs diagram content anyway (can happen from Monitoring Backup Command)
|
|
10
|
+
- When called from Monitoring ([hardis:org:monitor:backup](https://sfdx-hardis.cloudity.com/hardis/org/monitor/backup/)), generate Flow documentation only if it has been updated
|
|
10
11
|
- [hardis:doc:flow2markdown](https://sfdx-hardis.cloudity.com/hardis/doc/flow2markdown/): Generate the markdown documentation of a single flow (available from VsCode extension)
|
|
11
12
|
- [hardis:project:generate:flow-git-diff](https://sfdx-hardis.cloudity.com/hardis/project/generate/flow-git-diff/): Generate the visual git diff for a single flow (available from VsCode extension)
|
|
12
13
|
- [hardis:project:deploy:smart](https://sfdx-hardis.cloudity.com/hardis/project/deploy/smart/): Add visual git diff for flows updated by a Pull Request
|
|
@@ -27,6 +28,10 @@ Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image
|
|
|
27
28
|
- Display warning message in case package.xml has wrong format
|
|
28
29
|
- Allow to override package-no-overwrite from a branch .sfdx-hardis.yml config file
|
|
29
30
|
|
|
31
|
+
- Doc
|
|
32
|
+
- Update Microsoft Teams notifications integration User Guide
|
|
33
|
+
- Add troubleshooting section in Email integration User Guide
|
|
34
|
+
|
|
30
35
|
## [5.10.1] 2024-12-12
|
|
31
36
|
|
|
32
37
|
- Fix sfdx-hardis docker image build by adding coreutils in dependencies
|
|
@@ -6,3 +6,28 @@
|
|
|
6
6
|
.md-typeset table:not([class]) {
|
|
7
7
|
display: table;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
/* light mode table header bgcolor */
|
|
11
|
+
.md-typeset__table th {
|
|
12
|
+
background-color: #f2edfe;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* dark mode table header bgcolor */
|
|
16
|
+
[data-md-color-scheme="slate"] .md-typeset__table th {
|
|
17
|
+
background-color: hsla(var(--md-hue), 25%, 25%, 1)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* light mode alternating table bg colors */
|
|
21
|
+
.md-typeset__table tr:nth-child(2n) {
|
|
22
|
+
background-color: #f8f8f8;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* dark mode alternating table bg colors */
|
|
26
|
+
[data-md-color-scheme="slate"] .md-typeset__table tr:nth-child(2n) {
|
|
27
|
+
background-color: hsla(var(--md-hue), 25%, 25%, 1)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:root>* {
|
|
31
|
+
--md-primary-fg-color: #1B1464;
|
|
32
|
+
--md-footer-bg-color: #1B1464;
|
|
33
|
+
}
|
|
@@ -9,9 +9,11 @@ theme:
|
|
|
9
9
|
name: material
|
|
10
10
|
custom_dir: docs/overrides
|
|
11
11
|
features:
|
|
12
|
+
- content.code.copy
|
|
12
13
|
- navigation.instant
|
|
13
|
-
|
|
14
|
-
#
|
|
14
|
+
- navigation.footer
|
|
15
|
+
# logo: assets/images/salesforce-logo.png
|
|
16
|
+
# favicon: assets/images/salesforce-icon.png
|
|
15
17
|
palette:
|
|
16
18
|
primary: "light blue"
|
|
17
19
|
markdown_extensions:
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
location$.subscribe(function(url) {
|
|
3
|
+
window.dataLayer = window.dataLayer || [];
|
|
4
|
+
function gtag() {
|
|
5
|
+
dataLayer.push(arguments);
|
|
6
|
+
}
|
|
7
|
+
gtag("js", new Date());
|
|
8
|
+
|
|
9
|
+
gtag("config", "G-3DM50255LC");
|
|
10
|
+
});
|
|
11
|
+
*/
|
|
12
|
+
var gtag_id = "G-XXXXXXXXXX";
|
|
13
|
+
|
|
14
|
+
var script = document.createElement("script");
|
|
15
|
+
script.src = "https://www.googletagmanager.com/gtag/js?id=" + gtag_id;
|
|
16
|
+
document.head.appendChild(script);
|
|
17
|
+
|
|
18
|
+
location$.subscribe(function (url) {
|
|
19
|
+
window.dataLayer = window.dataLayer || [];
|
|
20
|
+
|
|
21
|
+
function gtag() {
|
|
22
|
+
dataLayer.push(arguments);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
gtag("js", new Date());
|
|
26
|
+
gtag("config", gtag_id);
|
|
27
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* stylelint-disable SelectorFormat */
|
|
2
|
+
.md-typeset__table {
|
|
3
|
+
min-width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.md-typeset table:not([class]) {
|
|
7
|
+
display: table;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* light mode table header bgcolor */
|
|
11
|
+
.md-typeset__table th {
|
|
12
|
+
background-color: #f2edfe;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* dark mode table header bgcolor */
|
|
16
|
+
[data-md-color-scheme="slate"] .md-typeset__table th {
|
|
17
|
+
background-color: hsla(var(--md-hue), 25%, 25%, 1)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* light mode alternating table bg colors */
|
|
21
|
+
.md-typeset__table tr:nth-child(2n) {
|
|
22
|
+
background-color: #f8f8f8;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* dark mode alternating table bg colors */
|
|
26
|
+
[data-md-color-scheme="slate"] .md-typeset__table tr:nth-child(2n) {
|
|
27
|
+
background-color: hsla(var(--md-hue), 25%, 25%, 1)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:root>* {
|
|
31
|
+
--md-primary-fg-color: #1B1464;
|
|
32
|
+
--md-footer-bg-color: #1B1464;
|
|
33
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
site_name: Salesforce Project Documentation
|
|
2
|
+
site_url: https://sfdx-hardis.cloudity.com
|
|
3
|
+
repo_url: https://github.com/hardisgroupco/sfdx-hardis
|
|
4
|
+
edit_uri: tree/master/docs
|
|
5
|
+
site_author: Nicolas Vuillamy
|
|
6
|
+
site_description: Salesforce project documentation generated by sfdx-hardis
|
|
7
|
+
copyright: Doc generated by <a href="https://sfdx-hardis.cloudity.com/hardis/doc/plugin/generate/" target="_blank">sfdx-hardis</a>
|
|
8
|
+
theme:
|
|
9
|
+
name: material
|
|
10
|
+
custom_dir: docs/overrides
|
|
11
|
+
features:
|
|
12
|
+
- navigation.instant
|
|
13
|
+
- navigation.footer
|
|
14
|
+
# logo: assets/images/cloudity-text-logo.svg
|
|
15
|
+
# favicon: assets/images/cloudity-logo.svg
|
|
16
|
+
palette:
|
|
17
|
+
primary: indigo
|
|
18
|
+
markdown_extensions:
|
|
19
|
+
- pymdownx.emoji:
|
|
20
|
+
emoji_index: !!python/name:materialx.emoji.twemoji
|
|
21
|
+
emoji_generator: !!python/name:materialx.emoji.to_svg
|
|
22
|
+
- pymdownx.snippets:
|
|
23
|
+
base_path: docs
|
|
24
|
+
check_paths: true
|
|
25
|
+
- mdx_truly_sane_lists
|
|
26
|
+
- attr_list
|
|
27
|
+
extra_javascript:
|
|
28
|
+
- https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js
|
|
29
|
+
- javascripts/tables.js
|
|
30
|
+
- javascripts/gtag.js
|
|
31
|
+
extra_css:
|
|
32
|
+
- stylesheets/extra.css
|
|
33
|
+
extra:
|
|
34
|
+
social:
|
|
35
|
+
- icon: fontawesome/regular/circle-question
|
|
36
|
+
link: https://github.com/hardisgroupcom/sfdx-hardis/issues
|
|
37
|
+
title: Need help ? Post an issue :)
|
|
38
|
+
- icon: fontawesome/brands/github
|
|
39
|
+
link: https://github.com/hardisgroupcom/sfdx-hardis
|
|
40
|
+
- icon: fontawesome/brands/docker
|
|
41
|
+
link: https://hub.docker.com/r/oxsecurity/megalinter
|
|
42
|
+
- icon: fontawesome/brands/twitter
|
|
43
|
+
link: https://twitter.com/NicolasVuillamy
|
|
44
|
+
generator: false
|
|
45
|
+
nav:
|
|
46
|
+
- "Home": "index.md"
|
|
@@ -26,6 +26,11 @@ export default class Flow2Markdown extends SfCommand {
|
|
|
26
26
|
char: 'f',
|
|
27
27
|
description: 'Force the path and name of output markdown file. Must end with .md',
|
|
28
28
|
}),
|
|
29
|
+
"with-history": Flags.boolean({
|
|
30
|
+
char: 'd',
|
|
31
|
+
default: false,
|
|
32
|
+
description: messages.getMessage('debugMode'),
|
|
33
|
+
}),
|
|
29
34
|
debug: Flags.boolean({
|
|
30
35
|
char: 'd',
|
|
31
36
|
default: false,
|
|
@@ -58,7 +63,7 @@ export default class Flow2Markdown extends SfCommand {
|
|
|
58
63
|
}
|
|
59
64
|
uxLog(this, c.grey(`Generating markdown for Flow ${this.inputFile}...`));
|
|
60
65
|
const flowXml = (await fs.readFile(this.inputFile, "utf8")).toString();
|
|
61
|
-
const genRes = await generateFlowMarkdownFile(this.inputFile, flowXml, this.outputFile);
|
|
66
|
+
const genRes = await generateFlowMarkdownFile(this.inputFile, flowXml, this.outputFile, { collapsedDetails: false });
|
|
62
67
|
if (!genRes) {
|
|
63
68
|
throw new Error("Error generating markdown file");
|
|
64
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow2markdown.js","sourceRoot":"","sources":["../../../../src/commands/hardis/doc/flow2markdown.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,CAAC,MAAM,OAAO,CAAC;AACtB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAElH,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,aAAc,SAAQ,SAAc;IAChD,MAAM,CAAC,KAAK,GAAG,kBAAkB,CAAC;IAElC,MAAM,CAAC,WAAW,GA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CAAC,UAAU,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC;QACrH,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,+BAA+B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QACD,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"}
|
|
@@ -2,25 +2,31 @@ import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
|
2
2
|
import { AnyJson } from '@salesforce/ts-types';
|
|
3
3
|
export default class Project2Markdown extends SfCommand<any> {
|
|
4
4
|
static title: string;
|
|
5
|
+
static htmlInstructions: string;
|
|
5
6
|
static description: string;
|
|
6
7
|
static examples: string[];
|
|
7
8
|
static flags: any;
|
|
8
9
|
static requiresProject: boolean;
|
|
10
|
+
protected diffOnly: boolean;
|
|
9
11
|
protected packageXmlCandidates: any[];
|
|
10
12
|
protected outputMarkdownRoot: string;
|
|
11
13
|
protected outputMarkdownIndexFile: string;
|
|
12
14
|
protected mdLines: string[];
|
|
13
15
|
protected sfdxHardisConfig: any;
|
|
14
16
|
protected outputPackageXmlMarkdownFiles: any[];
|
|
17
|
+
protected mkDocsNavNodes: any;
|
|
15
18
|
protected debugMode: boolean;
|
|
19
|
+
protected footer: string;
|
|
16
20
|
run(): Promise<AnyJson>;
|
|
21
|
+
private buildMkDocsYml;
|
|
17
22
|
private generateFlowsDocumentation;
|
|
23
|
+
private humanDisplay;
|
|
18
24
|
private buildFlowsTable;
|
|
19
|
-
private
|
|
25
|
+
private buildInstalledPackages;
|
|
20
26
|
private buildSfdxHardisParams;
|
|
21
27
|
private buildMajorBranchesAndOrgs;
|
|
22
28
|
private manageLocalPackages;
|
|
23
|
-
private
|
|
29
|
+
private buildPackagesIndex;
|
|
24
30
|
private generatePackageXmlMarkdown;
|
|
25
31
|
private listPackageXmlCandidates;
|
|
26
32
|
}
|
|
@@ -14,10 +14,24 @@ import { listMajorOrgs } from '../../../common/utils/orgConfigUtils.js';
|
|
|
14
14
|
import { glob } from 'glob';
|
|
15
15
|
import { listFlowFiles } from '../../../common/utils/projectUtils.js';
|
|
16
16
|
import { generateFlowMarkdownFile, generateMarkdownFileWithMermaid } from '../../../common/utils/mermaidUtils.js';
|
|
17
|
+
import { MetadataUtils } from '../../../common/metadata-utils/index.js';
|
|
18
|
+
import { PACKAGE_ROOT_DIR } from '../../../settings.js';
|
|
19
|
+
import yaml from 'js-yaml';
|
|
17
20
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
18
21
|
const messages = Messages.loadMessages('sfdx-hardis', 'org');
|
|
19
22
|
export default class Project2Markdown extends SfCommand {
|
|
20
23
|
static title = 'SFDX Project to Markdown';
|
|
24
|
+
static htmlInstructions = `## Doc HTML Pages
|
|
25
|
+
|
|
26
|
+
To read the documentation as HTML pages, run the following code (you need python on your computer)
|
|
27
|
+
|
|
28
|
+
\`\`\`python
|
|
29
|
+
pip install mkdocs-material mdx_truly_sane_lists
|
|
30
|
+
mkdocs serve
|
|
31
|
+
\`\`\`
|
|
32
|
+
|
|
33
|
+
To just generate HTML pages that you can host anywhere, run \`mkdocs build\`
|
|
34
|
+
`;
|
|
21
35
|
static description = `Generates a markdown documentation from a SFDX project
|
|
22
36
|
|
|
23
37
|
- Package.xml files
|
|
@@ -43,11 +57,17 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
43
57
|

|
|
44
58
|
|
|
45
59
|

|
|
60
|
+
|
|
61
|
+
${this.htmlInstructions}
|
|
46
62
|
`;
|
|
47
63
|
static examples = [
|
|
48
64
|
'$ sf hardis:doc:project2markdown',
|
|
49
65
|
];
|
|
50
66
|
static flags = {
|
|
67
|
+
"diff-only": Flags.boolean({
|
|
68
|
+
default: false,
|
|
69
|
+
description: "Generate documentation only for changed files (used for monitoring)",
|
|
70
|
+
}),
|
|
51
71
|
debug: Flags.boolean({
|
|
52
72
|
char: 'd',
|
|
53
73
|
default: false,
|
|
@@ -62,26 +82,36 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
62
82
|
};
|
|
63
83
|
// Set this to true if your command requires a project workspace; 'requiresProject' is false by default
|
|
64
84
|
static requiresProject = true;
|
|
85
|
+
diffOnly = false;
|
|
65
86
|
packageXmlCandidates;
|
|
66
87
|
outputMarkdownRoot = "docs";
|
|
67
88
|
outputMarkdownIndexFile = path.join(this.outputMarkdownRoot, "index.md");
|
|
68
89
|
mdLines = [];
|
|
69
90
|
sfdxHardisConfig = {};
|
|
70
91
|
outputPackageXmlMarkdownFiles = [];
|
|
92
|
+
mkDocsNavNodes = { "Home": "index.md" };
|
|
71
93
|
debugMode = false;
|
|
94
|
+
footer;
|
|
72
95
|
/* jscpd:ignore-end */
|
|
73
96
|
async run() {
|
|
74
97
|
const { flags } = await this.parse(Project2Markdown);
|
|
98
|
+
this.diffOnly = flags["diff-only"] === true ? true : false;
|
|
75
99
|
this.debugMode = flags.debug || false;
|
|
76
|
-
|
|
100
|
+
await fs.ensureDir(this.outputMarkdownRoot);
|
|
101
|
+
const currentBranch = await getCurrentGitBranch();
|
|
102
|
+
this.footer = `_Documentation generated from branch ${currentBranch} with [sfdx-hardis](${CONSTANTS.DOC_URL_ROOT}) command [\`sf hardis:doc:project2markdown\`](https://sfdx-hardis.cloudity.com/hardis/doc/project2markdown/)_`;
|
|
77
103
|
if (fs.existsSync("config/.sfdx-hardis.yml")) {
|
|
78
104
|
this.sfdxHardisConfig = await getConfig("project");
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
105
|
+
// General sfdx-hardis config
|
|
106
|
+
const sfdxHardisParamsLines = this.buildSfdxHardisParams();
|
|
107
|
+
this.mdLines.push(...sfdxHardisParamsLines);
|
|
108
|
+
await fs.writeFile(path.join(this.outputMarkdownRoot, "sfdx-hardis-params.md"), sfdxHardisParamsLines.join("\n") + `\n${this.footer}\n`);
|
|
109
|
+
this.mkDocsNavNodes["SFDX-Hardis Config"] = "sfdx-hardis-params.md";
|
|
110
|
+
// Branches & orgs
|
|
111
|
+
const branchesAndOrgsLines = await this.buildMajorBranchesAndOrgs();
|
|
112
|
+
this.mdLines.push(...branchesAndOrgsLines);
|
|
113
|
+
await fs.writeFile(path.join(this.outputMarkdownRoot, "sfdx-hardis-branches-and-orgs.md"), branchesAndOrgsLines.join("\n") + `\n${this.footer}\n`);
|
|
114
|
+
this.mkDocsNavNodes["Branches & Orgs"] = "sfdx-hardis-branches-and-orgs.md";
|
|
85
115
|
}
|
|
86
116
|
else {
|
|
87
117
|
const repoName = (await getGitRepoName() || "").replace(".git", "");
|
|
@@ -92,55 +122,123 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
92
122
|
]);
|
|
93
123
|
}
|
|
94
124
|
// List SFDX packages and generate a manifest for each of them, except if there is only force-app with a package.xml
|
|
125
|
+
this.packageXmlCandidates = this.listPackageXmlCandidates();
|
|
95
126
|
await this.manageLocalPackages();
|
|
96
|
-
// List all packageXml files and generate related markdown
|
|
97
127
|
await this.generatePackageXmlMarkdown(this.packageXmlCandidates);
|
|
98
|
-
await this.
|
|
128
|
+
const packageLines = await this.buildPackagesIndex();
|
|
129
|
+
this.mdLines.push(...packageLines);
|
|
130
|
+
await fs.writeFile(path.join(this.outputMarkdownRoot, "manifests.md"), packageLines.join("\n") + `\n${this.footer}\n`);
|
|
99
131
|
// List managed packages
|
|
100
|
-
await this.
|
|
132
|
+
const installedPackages = await this.buildInstalledPackages();
|
|
133
|
+
this.mdLines.push(...installedPackages);
|
|
134
|
+
await fs.writeFile(path.join(this.outputMarkdownRoot, "installed-packages.md"), installedPackages.join("\n") + `\n${this.footer}\n`);
|
|
135
|
+
this.mkDocsNavNodes["Installed Packages"] = "installed-packages.md";
|
|
101
136
|
// List flows & generate doc
|
|
102
137
|
if (!(process?.env?.GENERATE_FLOW_DOC === 'false')) {
|
|
103
138
|
await this.generateFlowsDocumentation();
|
|
104
139
|
}
|
|
105
|
-
// Footer
|
|
106
|
-
this.mdLines.push(`_Documentation generated with [sfdx-hardis](${CONSTANTS.DOC_URL_ROOT}) command [\`sf hardis:doc:project2markdown\`](https://sfdx-hardis.cloudity.com/hardis/doc/project2markdown/)_`);
|
|
107
140
|
// Write output index file
|
|
108
141
|
await fs.ensureDir(path.dirname(this.outputMarkdownIndexFile));
|
|
109
|
-
await fs.writeFile(this.outputMarkdownIndexFile, this.mdLines.join("\n") + "\n");
|
|
142
|
+
await fs.writeFile(this.outputMarkdownIndexFile, this.mdLines.join("\n") + "\n\n" + Project2Markdown.htmlInstructions + `\n\n${this.footer}\n`);
|
|
110
143
|
uxLog(this, c.green(`Successfully generated doc index at ${this.outputMarkdownIndexFile}`));
|
|
111
144
|
const readmeFile = path.join(process.cwd(), "README.md");
|
|
112
145
|
if (fs.existsSync(readmeFile)) {
|
|
113
146
|
let readme = await fs.readFile(readmeFile, "utf8");
|
|
114
147
|
if (!readme.includes("docs/index.md")) {
|
|
115
|
-
readme +=
|
|
148
|
+
readme += `
|
|
149
|
+
|
|
150
|
+
## Documentation
|
|
151
|
+
|
|
152
|
+
[Read auto-generated documentation of the SFDX project](docs/index.md)
|
|
153
|
+
|
|
154
|
+
${Project2Markdown.htmlInstructions}
|
|
155
|
+
`;
|
|
116
156
|
await fs.writeFile(readmeFile, readme);
|
|
117
157
|
uxLog(this, c.green(`Updated README.md to add link to docs/index.md`));
|
|
118
158
|
}
|
|
119
159
|
}
|
|
160
|
+
await this.buildMkDocsYml();
|
|
120
161
|
// Open file in a new VsCode tab if available
|
|
121
162
|
WebSocketClient.requestOpenFile(this.outputMarkdownIndexFile);
|
|
122
163
|
return { outputPackageXmlMarkdownFiles: this.outputPackageXmlMarkdownFiles };
|
|
123
164
|
}
|
|
165
|
+
async buildMkDocsYml() {
|
|
166
|
+
// Copy default files (mkdocs.yml and other files can be updated by the SF Cli plugin developer later)
|
|
167
|
+
const mkdocsYmlFile = path.join(process.cwd(), 'mkdocs.yml');
|
|
168
|
+
const mkdocsYmlFileExists = fs.existsSync(mkdocsYmlFile);
|
|
169
|
+
await fs.copy(path.join(PACKAGE_ROOT_DIR, 'defaults/mkdocs-project-doc', '.'), process.cwd(), { overwrite: false });
|
|
170
|
+
if (!mkdocsYmlFileExists) {
|
|
171
|
+
uxLog(this, c.blue('Base mkdocs files copied in your Salesforce project repo'));
|
|
172
|
+
uxLog(this, c.yellow('You should probably manually update mkdocs.yml to add your own configuration, like theme, site_name, etc.'));
|
|
173
|
+
}
|
|
174
|
+
// Update mkdocs nav items
|
|
175
|
+
const mkdocsYml = yaml.load(fs
|
|
176
|
+
.readFileSync(mkdocsYmlFile, 'utf-8')
|
|
177
|
+
.replace('!!python/name:materialx.emoji.twemoji', "'!!python/name:materialx.emoji.twemoji'")
|
|
178
|
+
.replace('!!python/name:materialx.emoji.to_svg', "'!!python/name:materialx.emoji.to_svg'"));
|
|
179
|
+
if (!mkdocsYml.nav) {
|
|
180
|
+
mkdocsYml.nav = {};
|
|
181
|
+
}
|
|
182
|
+
for (const menuName of Object.keys(this.mkDocsNavNodes)) {
|
|
183
|
+
let pos = 0;
|
|
184
|
+
let found = false;
|
|
185
|
+
for (const navItem of mkdocsYml.nav) {
|
|
186
|
+
if (navItem[menuName]) {
|
|
187
|
+
found = true;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
pos++;
|
|
191
|
+
}
|
|
192
|
+
const navMenu = {};
|
|
193
|
+
navMenu[menuName] = this.mkDocsNavNodes[menuName];
|
|
194
|
+
if (found) {
|
|
195
|
+
mkdocsYml.nav[pos] = navMenu;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
mkdocsYml.nav.push(navMenu);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/* jscpd:ignore-start */
|
|
202
|
+
const mkdocsYmlStr = yaml
|
|
203
|
+
.dump(mkdocsYml)
|
|
204
|
+
.replace("'!!python/name:materialx.emoji.twemoji'", '!!python/name:materialx.emoji.twemoji')
|
|
205
|
+
.replace("'!!python/name:materialx.emoji.to_svg'", '!!python/name:materialx.emoji.to_svg');
|
|
206
|
+
await fs.writeFile(mkdocsYmlFile, mkdocsYmlStr);
|
|
207
|
+
uxLog(this, c.cyan(`Updated ${c.green(mkdocsYmlFile)}`));
|
|
208
|
+
uxLog(this, c.cyan(`To generate a HTML WebSite with this documentation with a single command, see instructions at ${CONSTANTS.DOC_URL_ROOT}/hardis/doc/project2markdown/`));
|
|
209
|
+
/* jscpd:ignore-end */
|
|
210
|
+
}
|
|
124
211
|
async generateFlowsDocumentation() {
|
|
125
212
|
uxLog(this, c.cyan("Generating Flows Visual documentation... (if you don't want it, define GENERATE_FLOW_DOC=false in your environment variables)"));
|
|
213
|
+
const flowsForMenu = { "All flows": "flows/index.md" };
|
|
126
214
|
await fs.ensureDir(path.join(this.outputMarkdownRoot, "flows"));
|
|
127
215
|
const packageDirs = this.project?.getPackageDirectories();
|
|
216
|
+
const updatedFlowNames = !this.diffOnly ?
|
|
217
|
+
[] :
|
|
218
|
+
(await MetadataUtils.listChangedFiles()).filter(f => f?.path?.endsWith(".flow-meta.xml")).map(f => path.basename(f.path, ".flow-meta.xml"));
|
|
128
219
|
const flowFiles = await listFlowFiles(packageDirs);
|
|
129
220
|
const flowErrors = [];
|
|
130
221
|
const flowWarnings = [];
|
|
222
|
+
const flowSkips = [];
|
|
131
223
|
const flowDescriptions = [];
|
|
132
224
|
for (const flowFile of flowFiles) {
|
|
225
|
+
const flowName = path.basename(flowFile, ".flow-meta.xml");
|
|
133
226
|
uxLog(this, c.grey(`Generating markdown for Flow ${flowFile}...`));
|
|
134
227
|
const flowXml = (await fs.readFile(flowFile, "utf8")).toString();
|
|
135
228
|
const flowContent = await parseXmlFile(flowFile);
|
|
136
229
|
flowDescriptions.push({
|
|
137
|
-
name:
|
|
230
|
+
name: flowName,
|
|
138
231
|
description: flowContent?.Flow?.description?.[0] || "",
|
|
139
232
|
type: flowContent?.Flow?.processType?.[0] === "Flow" ? "ScreenFlow" : flowContent?.Flow?.start?.[0]?.triggerType?.[0] ?? (flowContent?.Flow?.processType?.[0] || "ERROR (Unknown)"),
|
|
140
233
|
object: flowContent?.Flow?.start?.[0]?.object?.[0] || flowContent?.Flow?.processMetadataValues?.filter(pmv => pmv.name[0] === "ObjectType")?.[0]?.value?.[0]?.stringValue?.[0] || ""
|
|
141
234
|
});
|
|
142
|
-
|
|
143
|
-
|
|
235
|
+
flowsForMenu[flowName] = "flows/" + flowName + ".md";
|
|
236
|
+
if (this.diffOnly && !updatedFlowNames.includes(flowName)) {
|
|
237
|
+
flowSkips.push(flowFile);
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
const outputFlowMdFile = path.join(this.outputMarkdownRoot, "flows", flowName + ".md");
|
|
241
|
+
const genRes = await generateFlowMarkdownFile(flowFile, flowXml, outputFlowMdFile, { collapsedDetails: false });
|
|
144
242
|
if (!genRes) {
|
|
145
243
|
flowErrors.push(flowFile);
|
|
146
244
|
continue;
|
|
@@ -154,12 +252,15 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
154
252
|
continue;
|
|
155
253
|
}
|
|
156
254
|
}
|
|
157
|
-
|
|
255
|
+
if (flowSkips.length > 0) {
|
|
256
|
+
uxLog(this, c.yellow(`Skipped generation for ${flowSkips.length} Flows that have not been updated: ${this.humanDisplay(flowSkips)}`));
|
|
257
|
+
}
|
|
258
|
+
uxLog(this, c.green(`Successfully generated ${flowFiles.length - flowSkips.length - flowWarnings.length - flowErrors.length} Flows documentation`));
|
|
158
259
|
if (flowWarnings.length > 0) {
|
|
159
|
-
uxLog(this, c.yellow(`Partially generated documentation (Markdown with mermaidJs but without SVG) for ${flowWarnings.length} Flows: ${
|
|
260
|
+
uxLog(this, c.yellow(`Partially generated documentation (Markdown with mermaidJs but without SVG) for ${flowWarnings.length} Flows: ${this.humanDisplay(flowWarnings)}`));
|
|
160
261
|
}
|
|
161
262
|
if (flowErrors.length > 0) {
|
|
162
|
-
uxLog(this, c.yellow(`Error generating documentation for ${flowErrors.length} Flows: ${
|
|
263
|
+
uxLog(this, c.yellow(`Error generating documentation for ${flowErrors.length} Flows: ${this.humanDisplay(flowErrors)}`));
|
|
163
264
|
}
|
|
164
265
|
// Write table on doc index
|
|
165
266
|
const flowTableLines = await this.buildFlowsTable(flowDescriptions, 'flows/');
|
|
@@ -169,9 +270,13 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
169
270
|
await fs.ensureDir(path.join(this.outputMarkdownRoot, "flows"));
|
|
170
271
|
const flowTableLinesForIndex = await this.buildFlowsTable(flowDescriptions, '');
|
|
171
272
|
const flowIndexFile = path.join(this.outputMarkdownRoot, "flows", "index.md");
|
|
172
|
-
await fs.writeFile(flowIndexFile, flowTableLinesForIndex.join("\n") +
|
|
273
|
+
await fs.writeFile(flowIndexFile, flowTableLinesForIndex.join("\n") + `\n${this.footer}\n`);
|
|
274
|
+
this.mkDocsNavNodes["Flows"] = flowsForMenu;
|
|
173
275
|
uxLog(this, c.green(`Successfully generated doc index for Flows at ${flowIndexFile}`));
|
|
174
276
|
}
|
|
277
|
+
humanDisplay(flows) {
|
|
278
|
+
return flows.map(flow => path.basename(flow, ".flow-meta.xml")).join(", ");
|
|
279
|
+
}
|
|
175
280
|
async buildFlowsTable(flowDescriptions, prefix) {
|
|
176
281
|
const lines = [];
|
|
177
282
|
lines.push(...[
|
|
@@ -188,10 +293,11 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
188
293
|
lines.push("");
|
|
189
294
|
return lines;
|
|
190
295
|
}
|
|
191
|
-
async
|
|
296
|
+
async buildInstalledPackages() {
|
|
192
297
|
// CI/CD context
|
|
193
298
|
const packages = this.sfdxHardisConfig.installedPackages || [];
|
|
194
299
|
// Monitoring context
|
|
300
|
+
const installedPackagesLines = [];
|
|
195
301
|
const packageFolder = path.join(process.cwd(), 'installedPackages');
|
|
196
302
|
if (packages.length === 0 && fs.existsSync(packageFolder)) {
|
|
197
303
|
const findManagedPattern = "**/*.json";
|
|
@@ -207,41 +313,49 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
207
313
|
}
|
|
208
314
|
// Write packages table
|
|
209
315
|
if (packages && packages.length > 0) {
|
|
210
|
-
|
|
316
|
+
installedPackagesLines.push(...[
|
|
211
317
|
"## Installed packages",
|
|
212
318
|
"",
|
|
213
319
|
"| Name | Namespace | Version | Version Name |",
|
|
214
320
|
"| :---- | :-------- | :------ | :----------: | "
|
|
215
321
|
]);
|
|
216
322
|
for (const pckg of sortArray(packages, { by: ['SubscriberPackageNamespace', 'SubscriberPackageName'], order: ['asc', 'asc'] })) {
|
|
217
|
-
|
|
323
|
+
installedPackagesLines.push(...[
|
|
218
324
|
`| ${pckg.SubscriberPackageName} | ${pckg.SubscriberPackageNamespace || ""} | [${pckg.SubscriberPackageVersionNumber}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${pckg.SubscriberPackageVersionId}) | ${pckg.SubscriberPackageVersionName} |`
|
|
219
325
|
]);
|
|
220
326
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
327
|
+
installedPackagesLines.push("");
|
|
328
|
+
installedPackagesLines.push("___");
|
|
329
|
+
installedPackagesLines.push("");
|
|
224
330
|
}
|
|
331
|
+
return installedPackagesLines;
|
|
225
332
|
}
|
|
226
333
|
buildSfdxHardisParams() {
|
|
227
|
-
|
|
334
|
+
const sfdxParamsTableLines = [];
|
|
335
|
+
sfdxParamsTableLines.push(...[
|
|
336
|
+
`## ${this.sfdxHardisConfig?.projectName?.toUpperCase() || "SFDX Project"} CI/CD configuration`,
|
|
337
|
+
""
|
|
338
|
+
]);
|
|
339
|
+
sfdxParamsTableLines.push(...[
|
|
228
340
|
"| Sfdx-hardis Parameter | Value | Description & doc link |",
|
|
229
341
|
"| :--------- | :---- | :---------- |"
|
|
230
342
|
]);
|
|
231
343
|
const installPackagesDuringCheckDeploy = this.sfdxHardisConfig?.installPackagesDuringCheckDeploy ?? false;
|
|
232
|
-
|
|
344
|
+
sfdxParamsTableLines.push(`| installPackagesDuringCheckDeploy | ${bool2emoji(installPackagesDuringCheckDeploy)} | [Install 1GP & 2GP packages during deployment check CI/CD job](https://sfdx-hardis.cloudity.com/hardis/project/deploy/smart/#packages-installation) |`);
|
|
233
345
|
const useDeltaDeployment = this.sfdxHardisConfig?.useDeltaDeployment ?? false;
|
|
234
|
-
|
|
346
|
+
sfdxParamsTableLines.push(`| useDeltaDeployment | ${bool2emoji(useDeltaDeployment)} | [Deploys only updated metadatas , only when a MR/PR is from a minor branch to a major branch](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-config-delta-deployment/#delta-mode) |`);
|
|
235
347
|
const useSmartDeploymentTests = this.sfdxHardisConfig?.useSmartDeploymentTests ?? false;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
348
|
+
sfdxParamsTableLines.push(`| useSmartDeploymentTests | ${bool2emoji(useSmartDeploymentTests)} | [Skip Apex test cases if delta metadatas can not impact them, only when a MR/PR is from a minor branch to a major branch](https://sfdx-hardis.cloudity.com/hardis/project/deploy/smart/#smart-deployments-tests) |`);
|
|
349
|
+
sfdxParamsTableLines.push("");
|
|
350
|
+
sfdxParamsTableLines.push("___");
|
|
351
|
+
sfdxParamsTableLines.push("");
|
|
352
|
+
return sfdxParamsTableLines;
|
|
240
353
|
}
|
|
241
354
|
async buildMajorBranchesAndOrgs() {
|
|
355
|
+
const branchesOrgsLines = [];
|
|
242
356
|
const majorOrgs = await listMajorOrgs();
|
|
243
357
|
if (majorOrgs.length > 0) {
|
|
244
|
-
|
|
358
|
+
branchesOrgsLines.push(...[
|
|
245
359
|
"## Major branches and orgs",
|
|
246
360
|
"",
|
|
247
361
|
"| Git branch | Salesforce Org | Deployment Username |",
|
|
@@ -249,12 +363,13 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
249
363
|
]);
|
|
250
364
|
for (const majorOrg of majorOrgs) {
|
|
251
365
|
const majorOrgLine = `| ${majorOrg.branchName} | ${majorOrg.instanceUrl} | ${majorOrg.targetUsername} |`;
|
|
252
|
-
|
|
366
|
+
branchesOrgsLines.push(majorOrgLine);
|
|
253
367
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
368
|
+
branchesOrgsLines.push("");
|
|
369
|
+
branchesOrgsLines.push("___");
|
|
370
|
+
branchesOrgsLines.push("");
|
|
257
371
|
}
|
|
372
|
+
return branchesOrgsLines;
|
|
258
373
|
}
|
|
259
374
|
async manageLocalPackages() {
|
|
260
375
|
const packageDirs = this.project?.getPackageDirectories();
|
|
@@ -279,8 +394,10 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
279
394
|
}
|
|
280
395
|
}
|
|
281
396
|
}
|
|
282
|
-
async
|
|
283
|
-
|
|
397
|
+
async buildPackagesIndex() {
|
|
398
|
+
const packageLines = [];
|
|
399
|
+
const packagesForMenu = { "All manifests": "manifests.md" };
|
|
400
|
+
packageLines.push(...[
|
|
284
401
|
"## Package XML files",
|
|
285
402
|
"",
|
|
286
403
|
"| Package name | Description |",
|
|
@@ -291,11 +408,14 @@ _sfdx-hardis docker image is alpine-based and does not succeed to run mermaid/pu
|
|
|
291
408
|
const packageMdFile = path.basename(outputPackageXmlDef.path) + ".md";
|
|
292
409
|
const label = outputPackageXmlDef.name ? `Package folder: ${outputPackageXmlDef.name}` : path.basename(outputPackageXmlDef.path);
|
|
293
410
|
const packageTableLine = `| [${label}](${packageMdFile}) (${metadataNb}) | ${outputPackageXmlDef.description} |`;
|
|
294
|
-
|
|
411
|
+
packageLines.push(packageTableLine);
|
|
412
|
+
packagesForMenu[label] = packageMdFile;
|
|
295
413
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
414
|
+
packageLines.push("");
|
|
415
|
+
packageLines.push("___");
|
|
416
|
+
packageLines.push("");
|
|
417
|
+
this.mkDocsNavNodes["Manifests"] = packagesForMenu;
|
|
418
|
+
return packageLines;
|
|
299
419
|
}
|
|
300
420
|
async generatePackageXmlMarkdown(packageXmlCandidates) {
|
|
301
421
|
// Generate packageXml doc when found
|