Skip to content

Commit b32035b

Browse files
Merge pull request #404 from salesforcecli/wr/genDeprecatedWarnings
fix: pass deprecations options to template, clean template with Juliet
2 parents 00c7107 + e43d18b commit b32035b

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/ditamap/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class Command extends Ditamap {
104104
description,
105105
binary: 'binary' in commandMeta && typeof commandMeta.binary === 'string' ? commandMeta.binary : 'unknown',
106106
commandWithUnderscores,
107-
deprecated: (command.deprecated as boolean) ?? false,
107+
deprecated: (command.deprecated as boolean) ?? state === 'deprecated' ?? false,
108108
examples,
109109
help,
110110
isBetaCommand: state === 'beta',

src/ditamap/ditamap.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export abstract class Ditamap {
5959

6060
private readonly source: string;
6161

62-
public constructor(private filename: string, protected data: DitamapData) {
62+
protected constructor(private filename: string, protected data: DitamapData) {
6363
this.source = join(Ditamap.templatesDir, this.getTemplateFileName());
6464
this.destination = join(Ditamap.outputDir, filename);
6565
}
@@ -104,6 +104,7 @@ export abstract class Ditamap {
104104
* @returns {object}
105105
*/
106106
protected async transformToDitamap(): Promise<string> {
107+
//
107108
debug(`Generating ${this.destination} from ${this.getTemplateFileName()}`);
108109
const src = await fs.readFile(this.source, 'utf8');
109110
const template = hb.compile(src, { noEscape: false });

templates/command.hbs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ IF YOU WANT TO CHANGE THIS CONTENT, CONTACT [email protected] FOR D
1212
<title><codeph otherprops="nolang">{{name}}</codeph>{{#if isClosedPilotCommand}} (Pilot){{/if}}{{#if isOpenPilotCommand}} (Pilot){{/if}}{{#if isBetaCommand}} (Beta){{/if}}{{#if deprecated}} (Deprecated){{/if}}</title>
1313
<shortdesc>
1414
<ph id="shortdesc">
15-
{{#if deprecated}}The command <codeph otherprops="nolang">{{name}}</codeph> has been deprecated and will be removed in v{{deprecated.version}}.0 or later. {{#if deprecated.to}} Use <codeph otherprops="nolang">{{deprecated.to}}</codeph> instead. {{/if}} {{/if}}{{summary}}
15+
{{#if deprecated}}The command <codeph otherprops="nolang">{{name}}</codeph> has been deprecated{{#if deprecationOptions.version}} and will be removed in v{{deprecationOptions.version}} or later{{/if}}. {{#if deprecated.to}} Use <codeph otherprops="nolang">{{deprecated.to}}</codeph> instead. {{/if}} {{/if}}{{summary}}
1616
</ph>
1717
</shortdesc>
1818
<prolog>
@@ -33,11 +33,7 @@ IF YOU WANT TO CHANGE THIS CONTENT, CONTACT [email protected] FOR D
3333
until Salesforce announces its general availability in documentation or in press
3434
releases or public statements. We can’t guarantee general availability within any
3535
particular time frame or at all. Make your purchase decisions only on the basis of
36-
generally available products and features. You can provide feedback and suggestions for
37-
the <codeph otherprops="nolang">{{name}}</codeph> command in the <xref
38-
href="{{trailblazerCommunityUrl}}"
39-
format="html" scope="external" type="new-window:HTML">{{trailblazerCommunityName}}</xref> group in the
40-
Trailblazer Community.</note>
36+
generally available products and features.</note>
4137
</section>{{/if}}{{#if isOpenPilotCommand}}
4238
</section>{{/if}}{{#if isOpenPilotCommand}}
4339
<section>
@@ -48,11 +44,7 @@ IF YOU WANT TO CHANGE THIS CONTENT, CONTACT [email protected] FOR D
4844
until Salesforce announces its general availability in documentation or in press
4945
releases or public statements. We can’t guarantee general availability within any
5046
particular time frame or at all. Make your purchase decisions only on the basis of
51-
generally available products and features. You can provide feedback and suggestions for
52-
the <codeph otherprops="nolang">{{name}}</codeph> command in the <xref
53-
href="{{trailblazerCommunityUrl}}"
54-
format="html" scope="external" type="new-window:HTML">{{trailblazerCommunityName}}</xref> group in the
55-
Trailblazer Community.</note>
47+
generally available products and features.</note>
5648
</section>{{/if}}{{#if isBetaCommand}}
5749
<section>
5850
<note>This feature is a Beta Service. Customers may opt to try such Beta Service in its sole discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms (<xref href="https://www.salesforce.com/company/legal/agreements/" format="html" scope="external" type="new-window:HTML">https://www.salesforce.com/company/legal/agreements/</xref>).</note>

0 commit comments

Comments
 (0)