@salesforce/plugin-templates 56.13.4 → 56.15.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # plugin-templates
2
2
 
3
- This repository provides a series of commands, templates, and generators for various metadata types.
3
+ This repository provides a series of commands, templates, and generators for various metadata types, including support for TypeScript Lightning Web Components.
4
4
 
5
5
  [![Known Vulnerabilities](https://snyk.io/test/github/salesforcecli/plugin-templates/badge.svg)](https://snyk.io/test/github/salesforcecli/plugin-templates)
6
6
  [![License](https://img.shields.io/npm/l/@salesforce/plugin-templates.svg)](https://github.com/salesforcecli/plugin-templates/blob/master/package.json)
@@ -177,7 +177,7 @@ FLAG DESCRIPTIONS
177
177
  directory.
178
178
  ```
179
179
 
180
- _See code: [src/commands/template/generate/analytics/template.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/analytics/template.ts)_
180
+ _See code: [src/commands/template/generate/analytics/template.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/analytics/template.ts)_
181
181
 
182
182
  ## `sf template generate apex class`
183
183
 
@@ -237,7 +237,7 @@ FLAG DESCRIPTIONS
237
237
  Supplied parameter values or default values are filled into a copy of the template.
238
238
  ```
239
239
 
240
- _See code: [src/commands/template/generate/apex/class.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/apex/class.ts)_
240
+ _See code: [src/commands/template/generate/apex/class.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/apex/class.ts)_
241
241
 
242
242
  ## `sf template generate apex trigger`
243
243
 
@@ -307,7 +307,7 @@ FLAG DESCRIPTIONS
307
307
  Supplied parameter values or default values are filled into a copy of the template.
308
308
  ```
309
309
 
310
- _See code: [src/commands/template/generate/apex/trigger.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/apex/trigger.ts)_
310
+ _See code: [src/commands/template/generate/apex/trigger.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/apex/trigger.ts)_
311
311
 
312
312
  ## `sf template generate digital-experience site`
313
313
 
@@ -361,7 +361,7 @@ FLAG DESCRIPTIONS
361
361
  project, defaults to the current directory.
362
362
  ```
363
363
 
364
- _See code: [src/commands/template/generate/digital-experience/site.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/digital-experience/site.ts)_
364
+ _See code: [src/commands/template/generate/digital-experience/site.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/digital-experience/site.ts)_
365
365
 
366
366
  ## `sf template generate flexipage`
367
367
 
@@ -443,7 +443,7 @@ FLAG DESCRIPTIONS
443
443
  'Custom_Object__c'. This sets the `sobjectType` field in the FlexiPage metadata.
444
444
  ```
445
445
 
446
- _See code: [src/commands/template/generate/flexipage/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/flexipage/index.ts)_
446
+ _See code: [src/commands/template/generate/flexipage/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/flexipage/index.ts)_
447
447
 
448
448
  ## `sf template generate lightning app`
449
449
 
@@ -496,10 +496,12 @@ FLAG DESCRIPTIONS
496
496
 
497
497
  -t, --template=DefaultLightningApp Template to use for file creation.
498
498
 
499
- Supplied parameter values or default values are filled into a copy of the template.
499
+ Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if
500
+ not specified, the CLI automatically selects the template based on the project's sfdx-project.json
501
+ "defaultLwcLanguage" field: TypeScript template for "typescript", JavaScript template for "javascript".
500
502
  ```
501
503
 
502
- _See code: [src/commands/template/generate/lightning/app.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/lightning/app.ts)_
504
+ _See code: [src/commands/template/generate/lightning/app.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/lightning/app.ts)_
503
505
 
504
506
  ## `sf template generate lightning component`
505
507
 
@@ -508,13 +510,14 @@ Generate a bundle for an Aura component or a Lightning web component.
508
510
  ```
509
511
  USAGE
510
512
  $ sf template generate lightning component -n <value> [--json] [--flags-dir <value>] [-t
511
- default|analyticsDashboard|analyticsDashboardWithStep] [-d <value>] [--api-version <value>] [--type aura|lwc]
513
+ default|analyticsDashboard|analyticsDashboardWithStep|typescript] [-d <value>] [--api-version <value>] [--type
514
+ aura|lwc]
512
515
 
513
516
  FLAGS
514
517
  -d, --output-dir=<value> [default: .] Directory for saving the created files.
515
518
  -n, --name=<value> (required) Name of the generated Lightning Component.
516
519
  -t, --template=<option> [default: default] Template to use for file creation.
517
- <options: default|analyticsDashboard|analyticsDashboardWithStep>
520
+ <options: default|analyticsDashboard|analyticsDashboardWithStep|typescript>
518
521
  --api-version=<value> Override the api version used for api requests made by this command
519
522
  --type=<option> [default: aura] Type of the component bundle.
520
523
  <options: aura|lwc>
@@ -554,6 +557,10 @@ EXAMPLES
554
557
 
555
558
  $ sf template generate lightning component --name mycomponent --type lwc --output-dir force-app/main/default/lwc
556
559
 
560
+ Generate a TypeScript Lightning web component:
561
+
562
+ $ sf template generate lightning component --name mycomponent --type lwc --template typescript
563
+
557
564
  FLAG DESCRIPTIONS
558
565
  -d, --output-dir=<value> Directory for saving the created files.
559
566
 
@@ -564,12 +571,14 @@ FLAG DESCRIPTIONS
564
571
 
565
572
  The name can be up to 40 characters and must start with a letter.
566
573
 
567
- -t, --template=default|analyticsDashboard|analyticsDashboardWithStep Template to use for file creation.
574
+ -t, --template=default|analyticsDashboard|analyticsDashboardWithStep|typescript Template to use for file creation.
568
575
 
569
- Supplied parameter values or default values are filled into a copy of the template.
576
+ Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if
577
+ not specified, the CLI automatically selects the template based on the project's sfdx-project.json
578
+ "defaultLwcLanguage" field: TypeScript template for "typescript", JavaScript template for "javascript".
570
579
  ```
571
580
 
572
- _See code: [src/commands/template/generate/lightning/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/lightning/component.ts)_
581
+ _See code: [src/commands/template/generate/lightning/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/lightning/component.ts)_
573
582
 
574
583
  ## `sf template generate lightning event`
575
584
 
@@ -622,10 +631,12 @@ FLAG DESCRIPTIONS
622
631
 
623
632
  -t, --template=DefaultLightningEvt Template to use for file creation.
624
633
 
625
- Supplied parameter values or default values are filled into a copy of the template.
634
+ Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if
635
+ not specified, the CLI automatically selects the template based on the project's sfdx-project.json
636
+ "defaultLwcLanguage" field: TypeScript template for "typescript", JavaScript template for "javascript".
626
637
  ```
627
638
 
628
- _See code: [src/commands/template/generate/lightning/event.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/lightning/event.ts)_
639
+ _See code: [src/commands/template/generate/lightning/event.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/lightning/event.ts)_
629
640
 
630
641
  ## `sf template generate lightning interface`
631
642
 
@@ -678,10 +689,12 @@ FLAG DESCRIPTIONS
678
689
 
679
690
  -t, --template=DefaultLightningIntf Template to use for file creation.
680
691
 
681
- Supplied parameter values or default values are filled into a copy of the template.
692
+ Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if
693
+ not specified, the CLI automatically selects the template based on the project's sfdx-project.json
694
+ "defaultLwcLanguage" field: TypeScript template for "typescript", JavaScript template for "javascript".
682
695
  ```
683
696
 
684
- _See code: [src/commands/template/generate/lightning/interface.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/lightning/interface.ts)_
697
+ _See code: [src/commands/template/generate/lightning/interface.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/lightning/interface.ts)_
685
698
 
686
699
  ## `sf template generate lightning test`
687
700
 
@@ -734,10 +747,12 @@ FLAG DESCRIPTIONS
734
747
 
735
748
  -t, --template=DefaultLightningTest Template to use for file creation.
736
749
 
737
- Supplied parameter values or default values are filled into a copy of the template.
750
+ Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if
751
+ not specified, the CLI automatically selects the template based on the project's sfdx-project.json
752
+ "defaultLwcLanguage" field: TypeScript template for "typescript", JavaScript template for "javascript".
738
753
  ```
739
754
 
740
- _See code: [src/commands/template/generate/lightning/test.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/lightning/test.ts)_
755
+ _See code: [src/commands/template/generate/lightning/test.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/lightning/test.ts)_
741
756
 
742
757
  ## `sf template generate project`
743
758
 
@@ -747,7 +762,7 @@ Generate a Salesforce DX project.
747
762
  USAGE
748
763
  $ sf template generate project -n <value> [--json] [--flags-dir <value>] [-t
749
764
  standard|empty|analytics|reactinternalapp|reactexternalapp|agent] [-d <value>] [-s <value>] [-p <value>] [-x]
750
- [--api-version <value>]
765
+ [--lwc-language javascript|typescript] [--api-version <value>]
751
766
 
752
767
  FLAGS
753
768
  -d, --output-dir=<value> [default: .] Directory for saving the created files.
@@ -758,6 +773,8 @@ FLAGS
758
773
  <options: standard|empty|analytics|reactinternalapp|reactexternalapp|agent>
759
774
  -x, --manifest Generate a manifest (package.xml) for change-set based development.
760
775
  --api-version=<value> Will set this version as sourceApiVersion in the sfdx-project.json file
776
+ --lwc-language=<option> Language of the Lightning Web Components. Default is "javascript".
777
+ <options: javascript|typescript>
761
778
 
762
779
  GLOBAL FLAGS
763
780
  --flags-dir=<value> Import flag values from a directory.
@@ -795,6 +812,10 @@ EXAMPLES
795
812
 
796
813
  $ sf template generate project --name mywork --template empty
797
814
 
815
+ Generate a project in which the Lightning Web Components use TypeScript rather than the default JavaScript:
816
+
817
+ $ sf template generate project --name mywork --lwc-language typescript
818
+
798
819
  FLAG DESCRIPTIONS
799
820
  -d, --output-dir=<value> Directory for saving the created files.
800
821
 
@@ -848,9 +869,16 @@ FLAG DESCRIPTIONS
848
869
  --api-version=<value> Will set this version as sourceApiVersion in the sfdx-project.json file
849
870
 
850
871
  Override the api version used for api requests made by this command
872
+
873
+ --lwc-language=javascript|typescript Language of the Lightning Web Components. Default is "javascript".
874
+
875
+ Sets the default language for Lightning Web Components in this project. When set to `'typescript'`, generates
876
+ TypeScript configuration files (tsconfig.json, package.json with TypeScript dependencies, and TypeScript-aware
877
+ ESLint config). TypeScript files are compiled locally for validation, and the TypeScript (`.ts`) files are deployed
878
+ to Salesforce for server-side type stripping. If not specified, the project uses JavaScript.
851
879
  ```
852
880
 
853
- _See code: [src/commands/template/generate/project/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/project/index.ts)_
881
+ _See code: [src/commands/template/generate/project/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/project/index.ts)_
854
882
 
855
883
  ## `sf template generate static-resource`
856
884
 
@@ -913,7 +941,7 @@ FLAG DESCRIPTIONS
913
941
  etc.
914
942
  ```
915
943
 
916
- _See code: [src/commands/template/generate/static-resource/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/static-resource/index.ts)_
944
+ _See code: [src/commands/template/generate/static-resource/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/static-resource/index.ts)_
917
945
 
918
946
  ## `sf template generate ui-bundle`
919
947
 
@@ -997,7 +1025,7 @@ FLAG DESCRIPTIONS
997
1025
  Supplied parameter values or default values are filled into a copy of the template.
998
1026
  ```
999
1027
 
1000
- _See code: [src/commands/template/generate/ui-bundle/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/ui-bundle/index.ts)_
1028
+ _See code: [src/commands/template/generate/ui-bundle/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/ui-bundle/index.ts)_
1001
1029
 
1002
1030
  ## `sf template generate visualforce component`
1003
1031
 
@@ -1054,7 +1082,7 @@ FLAG DESCRIPTIONS
1054
1082
  Supplied parameter values or default values are filled into a copy of the template.
1055
1083
  ```
1056
1084
 
1057
- _See code: [src/commands/template/generate/visualforce/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/visualforce/component.ts)_
1085
+ _See code: [src/commands/template/generate/visualforce/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/visualforce/component.ts)_
1058
1086
 
1059
1087
  ## `sf template generate visualforce page`
1060
1088
 
@@ -1105,6 +1133,6 @@ FLAG DESCRIPTIONS
1105
1133
  The name can be up to 40 characters and must start with a letter.
1106
1134
  ```
1107
1135
 
1108
- _See code: [src/commands/template/generate/visualforce/page.ts](https://github.com/salesforcecli/plugin-templates/blob/56.13.4/src/commands/template/generate/visualforce/page.ts)_
1136
+ _See code: [src/commands/template/generate/visualforce/page.ts](https://github.com/salesforcecli/plugin-templates/blob/56.15.0/src/commands/template/generate/visualforce/page.ts)_
1109
1137
 
1110
1138
  <!-- commandsstop -->
@@ -8,7 +8,7 @@ export default class LightningComponent extends SfCommand<CreateOutput> {
8
8
  static readonly deprecateAliases = true;
9
9
  static readonly flags: {
10
10
  name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
- template: import("@oclif/core/interfaces").OptionFlag<"default" | "analyticsDashboard" | "analyticsDashboardWithStep", import("@oclif/core/interfaces").CustomOptions>;
11
+ template: import("@oclif/core/interfaces").OptionFlag<"default" | "analyticsDashboard" | "analyticsDashboardWithStep" | "typescript", import("@oclif/core/interfaces").CustomOptions>;
12
12
  'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
13
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
14
  type: import("@oclif/core/interfaces").OptionFlag<"aura" | "lwc", import("@oclif/core/interfaces").CustomOptions>;
@@ -7,7 +7,7 @@
7
7
  // tslint:disable:no-unused-expression
8
8
  import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
9
9
  import { TemplateType } from '@salesforce/templates';
10
- import { Messages } from '@salesforce/core';
10
+ import { Messages, SfProject } from '@salesforce/core';
11
11
  import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
12
12
  import { internalFlag, outputDirFlagLightning } from '../../../../utils/flags.js';
13
13
  const BUNDLE_TYPE = 'Component';
@@ -36,7 +36,7 @@ export default class LightningComponent extends SfCommand {
36
36
  default: 'default',
37
37
  // Note: keep this list here and LightningComponentOptions#template in-sync with the
38
38
  // templates/lightningcomponents/[aura|lwc]/* folders
39
- options: ['default', 'analyticsDashboard', 'analyticsDashboardWithStep'],
39
+ options: ['default', 'analyticsDashboard', 'analyticsDashboardWithStep', 'typescript'],
40
40
  })(),
41
41
  'output-dir': outputDirFlagLightning,
42
42
  'api-version': orgApiVersionFlagWithDeprecations,
@@ -50,9 +50,28 @@ export default class LightningComponent extends SfCommand {
50
50
  };
51
51
  async run() {
52
52
  const { flags } = await this.parse(LightningComponent);
53
+ // Determine if user explicitly set the template flag
54
+ const userExplicitlySetTemplate = this.argv.includes('--template') || this.argv.includes('-t');
55
+ let template = flags.template;
56
+ // If template not explicitly provided and generating LWC, check project preference
57
+ if (!userExplicitlySetTemplate && flags.type === 'lwc') {
58
+ try {
59
+ const projectPath = flags['output-dir'] || process.cwd();
60
+ const project = await SfProject.resolve(projectPath);
61
+ const projectJson = await project.resolveProjectConfig();
62
+ const defaultLwcLanguage = projectJson.defaultLwcLanguage;
63
+ if (defaultLwcLanguage === 'typescript') {
64
+ template = 'typescript';
65
+ }
66
+ }
67
+ catch (error) {
68
+ this.debug('Could not resolve project config for intelligent defaulting:', error);
69
+ }
70
+ }
53
71
  const flagsAsOptions = {
54
72
  componentname: flags.name,
55
- template: flags.template,
73
+ // Temp re-mapping to allow lowercase typescript flag
74
+ template: template === 'typescript' ? 'typeScript' : template,
56
75
  outputdir: flags['output-dir'],
57
76
  apiversion: flags['api-version'],
58
77
  internal: flags.internal,
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../src/commands/template/generate/lightning/component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sCAAsC;AAEtC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iCAAiC,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAChH,OAAO,EAA2C,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAClF,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,cAAc,CAAC,CAAC;AACvF,MAAM,eAAe,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;AAC3F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,SAAuB;IAC9D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,OAAO,GAAG,CAAC,kCAAkC,EAAE,8BAA8B,CAAC,CAAC;IAC/F,MAAM,CAAU,gBAAgB,GAAG,IAA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;SACjB,CAAC;QACF,OAAO,YAAY,CAAC;YAClB,YAAY,EAAE,YAAY,CAAC,kBAAkB;YAC7C,IAAI,EAAE,cAAc;YACpB,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/C,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC;SACrD,CAAC,CAAC;IACL,CAAC"}
@@ -14,6 +14,7 @@ export default class Project extends SfCommand<CreateOutput> {
14
14
  'default-package-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
15
  manifest: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  'login-url': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'lwc-language': import("@oclif/core/interfaces").OptionFlag<"typescript" | "javascript" | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
18
  loglevel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
19
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
20
  };
@@ -61,6 +61,11 @@ export default class Project extends SfCommand {
61
61
  aliases: ['loginurl'],
62
62
  deprecateAliases: true,
63
63
  }),
64
+ 'lwc-language': Flags.option({
65
+ summary: messages.getMessage('flags.lwc-language.summary'),
66
+ description: messages.getMessage('flags.lwc-language.description'),
67
+ options: ['javascript', 'typescript'],
68
+ })(),
64
69
  loglevel,
65
70
  'api-version': Flags.orgApiVersion({
66
71
  summary: messages.getMessage('flags.api-version.summary'),
@@ -79,6 +84,9 @@ export default class Project extends SfCommand {
79
84
  defaultpackagedir: flags['default-package-dir'],
80
85
  apiversion: flags['api-version'],
81
86
  };
87
+ if (flags['lwc-language']) {
88
+ flagsAsOptions.lwcLanguage = flags['lwc-language'];
89
+ }
82
90
  return runGenerator({
83
91
  templateType: TemplateType.Project,
84
92
  opts: flagsAsOptions,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/template/generate/project/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAgC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,SAAS,CAAC,CAAC;AAClF,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAuB;IACnD,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,OAAO,GAAG,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;IACvE,MAAM,CAAU,gBAAgB,GAAG,IAAI,CAAC;IACxC,MAAM,CAAU,KAAK,GAAG;QAC7B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;YAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YAC1D,QAAQ,EAAE,IA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AAE,QAAQ,CAAC,UAAU,CAAC,gCAAgC,CAAC;YAClE,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAU;SAC/C,CAAC,EAAE;QACJ,QAAQ;QACR,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC;YACjC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC;SAC1D,CAAC;KACH,CAAC;IACK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE5C,MAAM,cAAc,GAAmB;YACrC,WAAW,EAAE,KAAK,CAAC,IAAI;YACvB,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,oDAAoD;YACpD,EAAE,EAAE,KAAK,CAAC,SAAS;YACnB,iBAAiB,EAAE,KAAK,CAAC,qBAAqB,CAAC;YAC/C,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;SACjC,CAAC;QACF,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAC1B,cAAc,CAAC,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,YAAY,CAAC;YAClB,YAAY,EAAE,YAAY,CAAC,OAAO;YAClC,IAAI,EAAE,cAAc;YACpB,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/C,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC;SACrD,CAAC,CAAC;IACL,CAAC"}
@@ -24,4 +24,4 @@ Template to use for file creation.
24
24
 
25
25
  # flags.template.description
26
26
 
27
- Supplied parameter values or default values are filled into a copy of the template.
27
+ Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if not specified, the CLI automatically selects the template based on the project's sfdx-project.json "defaultLwcLanguage" field: TypeScript template for "typescript", JavaScript template for "javascript".
@@ -16,6 +16,10 @@
16
16
 
17
17
  <%= config.bin %> <%= command.id %> --name mycomponent --type lwc --output-dir force-app/main/default/lwc
18
18
 
19
+ - Generate a TypeScript Lightning web component:
20
+
21
+ <%= config.bin %> <%= command.id %> --name mycomponent --type lwc --template typescript
22
+
19
23
  # summary
20
24
 
21
25
  Generate a bundle for an Aura component or a Lightning web component.
@@ -26,6 +26,10 @@ By default, the generated sfdx-project.json file sets the sourceApiVersion prope
26
26
 
27
27
  <%= config.bin %> <%= command.id %> --name mywork --template empty
28
28
 
29
+ - Generate a project in which the Lightning Web Components use TypeScript rather than the default JavaScript:
30
+
31
+ <%= config.bin %> <%= command.id %> --name mywork --lwc-language typescript
32
+
29
33
  # flags.name.summary
30
34
 
31
35
  Name of the generated project.
@@ -93,3 +97,11 @@ Salesforce instance login URL.
93
97
  # flags.login-url.description
94
98
 
95
99
  Normally defaults to https://login.salesforce.com.
100
+
101
+ # flags.lwc-language.summary
102
+
103
+ Language of the Lightning Web Components. Default is "javascript".
104
+
105
+ # flags.lwc-language.description
106
+
107
+ Sets the default language for Lightning Web Components in this project. When set to `'typescript'`, generates TypeScript configuration files (tsconfig.json, package.json with TypeScript dependencies, and TypeScript-aware ESLint config). TypeScript files are compiled locally for validation, and the TypeScript (`.ts`) files are deployed to Salesforce for server-side type stripping. If not specified, the project uses JavaScript.
@@ -375,6 +375,134 @@
375
375
  "trigger:apex:generate:template"
376
376
  ]
377
377
  },
378
+ "template:generate:digital-experience:site": {
379
+ "aliases": [],
380
+ "args": {},
381
+ "description": "Creates the metadata of an Experience Cloud site with the specified template, name, and URL path prefix. The output includes all the necessary metadata files, including DigitalExperienceConfig, DigitalExperienceBundle, Network, and CustomSite.\nUnlike `sf community create`, which builds the site directly in the org, this command generates only the local metadata.",
382
+ "examples": [
383
+ "Generate an Experience Cloud site using the Build Your Own (LWR) template. The site is called \"mysite\" and has the URL path prefix \"mysite\":\n<%= config.bin %> <%= command.id %> --template-name \"Build Your Own (LWR)\" --name mysite --url-path-prefix mysite",
384
+ "Generate an Experience Cloud site like the last example, but generate the files into the specified output directory:\n<%= config.bin %> <%= command.id %> --template-name \"Build Your Own (LWR)\" --name mysite --url-path-prefix mysite --output-dir force-app/main/default"
385
+ ],
386
+ "flags": {
387
+ "json": {
388
+ "description": "Format output as json.",
389
+ "helpGroup": "GLOBAL",
390
+ "name": "json",
391
+ "allowNo": false,
392
+ "type": "boolean"
393
+ },
394
+ "flags-dir": {
395
+ "helpGroup": "GLOBAL",
396
+ "name": "flags-dir",
397
+ "summary": "Import flag values from a directory.",
398
+ "hasDynamicHelp": false,
399
+ "multiple": false,
400
+ "type": "option"
401
+ },
402
+ "target-org": {
403
+ "char": "o",
404
+ "name": "target-org",
405
+ "noCacheDefault": true,
406
+ "summary": "Username or alias of the target org.",
407
+ "hasDynamicHelp": true,
408
+ "multiple": false,
409
+ "type": "option"
410
+ },
411
+ "name": {
412
+ "char": "n",
413
+ "name": "name",
414
+ "required": true,
415
+ "summary": "Name of the Experience Cloud site to generate.",
416
+ "hasDynamicHelp": false,
417
+ "multiple": false,
418
+ "type": "option"
419
+ },
420
+ "template-name": {
421
+ "char": "t",
422
+ "name": "template-name",
423
+ "required": true,
424
+ "summary": "Template to use when generating the site.",
425
+ "hasDynamicHelp": false,
426
+ "multiple": false,
427
+ "options": [
428
+ "Build Your Own (LWR)"
429
+ ],
430
+ "type": "option"
431
+ },
432
+ "url-path-prefix": {
433
+ "char": "p",
434
+ "name": "url-path-prefix",
435
+ "summary": "URL path prefix for the site; must contain only alphanumeric characters.",
436
+ "default": "",
437
+ "hasDynamicHelp": false,
438
+ "multiple": false,
439
+ "type": "option"
440
+ },
441
+ "admin-email": {
442
+ "char": "e",
443
+ "name": "admin-email",
444
+ "summary": "Email address for the site administrator. Defaults to the username of the currently authenticated user.",
445
+ "hasDynamicHelp": false,
446
+ "multiple": false,
447
+ "type": "option"
448
+ },
449
+ "output-dir": {
450
+ "char": "d",
451
+ "description": "The location can be an absolute path or relative to the current working directory. If not specified, the command reads your sfdx-project.json file and uses the default package directory. When running outside a Salesforce DX project, defaults to the current directory.",
452
+ "name": "output-dir",
453
+ "summary": "Directory to generate the site files in.",
454
+ "hasDynamicHelp": false,
455
+ "multiple": false,
456
+ "type": "option"
457
+ }
458
+ },
459
+ "hasDynamicHelp": true,
460
+ "hiddenAliases": [],
461
+ "id": "template:generate:digital-experience:site",
462
+ "pluginAlias": "@salesforce/plugin-templates",
463
+ "pluginName": "@salesforce/plugin-templates",
464
+ "pluginType": "core",
465
+ "state": "preview",
466
+ "strict": true,
467
+ "summary": "Generate an Experience Cloud site.",
468
+ "enableJsonFlag": true,
469
+ "isESM": true,
470
+ "relativePath": [
471
+ "lib",
472
+ "commands",
473
+ "template",
474
+ "generate",
475
+ "digital-experience",
476
+ "site.js"
477
+ ],
478
+ "aliasPermutations": [],
479
+ "permutations": [
480
+ "template:generate:digital-experience:site",
481
+ "generate:template:digital-experience:site",
482
+ "generate:digital-experience:template:site",
483
+ "generate:digital-experience:site:template",
484
+ "template:digital-experience:generate:site",
485
+ "digital-experience:template:generate:site",
486
+ "digital-experience:generate:template:site",
487
+ "digital-experience:generate:site:template",
488
+ "template:digital-experience:site:generate",
489
+ "digital-experience:template:site:generate",
490
+ "digital-experience:site:template:generate",
491
+ "digital-experience:site:generate:template",
492
+ "template:generate:site:digital-experience",
493
+ "generate:template:site:digital-experience",
494
+ "generate:site:template:digital-experience",
495
+ "generate:site:digital-experience:template",
496
+ "template:site:generate:digital-experience",
497
+ "site:template:generate:digital-experience",
498
+ "site:generate:template:digital-experience",
499
+ "site:generate:digital-experience:template",
500
+ "template:site:digital-experience:generate",
501
+ "site:template:digital-experience:generate",
502
+ "site:digital-experience:template:generate",
503
+ "site:digital-experience:generate:template"
504
+ ]
505
+ },
378
506
  "template:generate:analytics:template": {
379
507
  "aliases": [
380
508
  "force:analytics:template:create",
@@ -528,134 +656,6 @@
528
656
  "template:analytics:generate:template"
529
657
  ]
530
658
  },
531
- "template:generate:digital-experience:site": {
532
- "aliases": [],
533
- "args": {},
534
- "description": "Creates the metadata of an Experience Cloud site with the specified template, name, and URL path prefix. The output includes all the necessary metadata files, including DigitalExperienceConfig, DigitalExperienceBundle, Network, and CustomSite.\nUnlike `sf community create`, which builds the site directly in the org, this command generates only the local metadata.",
535
- "examples": [
536
- "Generate an Experience Cloud site using the Build Your Own (LWR) template. The site is called \"mysite\" and has the URL path prefix \"mysite\":\n<%= config.bin %> <%= command.id %> --template-name \"Build Your Own (LWR)\" --name mysite --url-path-prefix mysite",
537
- "Generate an Experience Cloud site like the last example, but generate the files into the specified output directory:\n<%= config.bin %> <%= command.id %> --template-name \"Build Your Own (LWR)\" --name mysite --url-path-prefix mysite --output-dir force-app/main/default"
538
- ],
539
- "flags": {
540
- "json": {
541
- "description": "Format output as json.",
542
- "helpGroup": "GLOBAL",
543
- "name": "json",
544
- "allowNo": false,
545
- "type": "boolean"
546
- },
547
- "flags-dir": {
548
- "helpGroup": "GLOBAL",
549
- "name": "flags-dir",
550
- "summary": "Import flag values from a directory.",
551
- "hasDynamicHelp": false,
552
- "multiple": false,
553
- "type": "option"
554
- },
555
- "target-org": {
556
- "char": "o",
557
- "name": "target-org",
558
- "noCacheDefault": true,
559
- "summary": "Username or alias of the target org.",
560
- "hasDynamicHelp": true,
561
- "multiple": false,
562
- "type": "option"
563
- },
564
- "name": {
565
- "char": "n",
566
- "name": "name",
567
- "required": true,
568
- "summary": "Name of the Experience Cloud site to generate.",
569
- "hasDynamicHelp": false,
570
- "multiple": false,
571
- "type": "option"
572
- },
573
- "template-name": {
574
- "char": "t",
575
- "name": "template-name",
576
- "required": true,
577
- "summary": "Template to use when generating the site.",
578
- "hasDynamicHelp": false,
579
- "multiple": false,
580
- "options": [
581
- "Build Your Own (LWR)"
582
- ],
583
- "type": "option"
584
- },
585
- "url-path-prefix": {
586
- "char": "p",
587
- "name": "url-path-prefix",
588
- "summary": "URL path prefix for the site; must contain only alphanumeric characters.",
589
- "default": "",
590
- "hasDynamicHelp": false,
591
- "multiple": false,
592
- "type": "option"
593
- },
594
- "admin-email": {
595
- "char": "e",
596
- "name": "admin-email",
597
- "summary": "Email address for the site administrator. Defaults to the username of the currently authenticated user.",
598
- "hasDynamicHelp": false,
599
- "multiple": false,
600
- "type": "option"
601
- },
602
- "output-dir": {
603
- "char": "d",
604
- "description": "The location can be an absolute path or relative to the current working directory. If not specified, the command reads your sfdx-project.json file and uses the default package directory. When running outside a Salesforce DX project, defaults to the current directory.",
605
- "name": "output-dir",
606
- "summary": "Directory to generate the site files in.",
607
- "hasDynamicHelp": false,
608
- "multiple": false,
609
- "type": "option"
610
- }
611
- },
612
- "hasDynamicHelp": true,
613
- "hiddenAliases": [],
614
- "id": "template:generate:digital-experience:site",
615
- "pluginAlias": "@salesforce/plugin-templates",
616
- "pluginName": "@salesforce/plugin-templates",
617
- "pluginType": "core",
618
- "state": "preview",
619
- "strict": true,
620
- "summary": "Generate an Experience Cloud site.",
621
- "enableJsonFlag": true,
622
- "isESM": true,
623
- "relativePath": [
624
- "lib",
625
- "commands",
626
- "template",
627
- "generate",
628
- "digital-experience",
629
- "site.js"
630
- ],
631
- "aliasPermutations": [],
632
- "permutations": [
633
- "template:generate:digital-experience:site",
634
- "generate:template:digital-experience:site",
635
- "generate:digital-experience:template:site",
636
- "generate:digital-experience:site:template",
637
- "template:digital-experience:generate:site",
638
- "digital-experience:template:generate:site",
639
- "digital-experience:generate:template:site",
640
- "digital-experience:generate:site:template",
641
- "template:digital-experience:site:generate",
642
- "digital-experience:template:site:generate",
643
- "digital-experience:site:template:generate",
644
- "digital-experience:site:generate:template",
645
- "template:generate:site:digital-experience",
646
- "generate:template:site:digital-experience",
647
- "generate:site:template:digital-experience",
648
- "generate:site:digital-experience:template",
649
- "template:site:generate:digital-experience",
650
- "site:template:generate:digital-experience",
651
- "site:generate:template:digital-experience",
652
- "site:generate:digital-experience:template",
653
- "template:site:digital-experience:generate",
654
- "site:template:digital-experience:generate",
655
- "site:digital-experience:template:generate",
656
- "site:digital-experience:generate:template"
657
- ]
658
- },
659
659
  "template:generate:flexipage": {
660
660
  "aliases": [],
661
661
  "args": {},
@@ -883,7 +883,7 @@
883
883
  },
884
884
  "template": {
885
885
  "char": "t",
886
- "description": "Supplied parameter values or default values are filled into a copy of the template.",
886
+ "description": "Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if not specified, the CLI automatically selects the template based on the project's sfdx-project.json \"defaultLwcLanguage\" field: TypeScript template for \"typescript\", JavaScript template for \"javascript\".",
887
887
  "name": "template",
888
888
  "summary": "Template to use for file creation.",
889
889
  "default": "DefaultLightningApp",
@@ -1027,7 +1027,8 @@
1027
1027
  "Generate the metadata files for an Aura component bundle in the current directory:\n<%= config.bin %> <%= command.id %> --name mycomponent",
1028
1028
  "Generate a Lightning web component bundle in the current directory:\n<%= config.bin %> <%= command.id %> --name mycomponent --type lwc",
1029
1029
  "Generate an Aura component bundle in the \"force-app/main/default/aura\" directory:\n<%= config.bin %> <%= command.id %> --name mycomponent --output-dir force-app/main/default/aura",
1030
- "Generate a Lightning web component bundle in the \"force-app/main/default/lwc\" directory:\n<%= config.bin %> <%= command.id %> --name mycomponent --type lwc --output-dir force-app/main/default/lwc"
1030
+ "Generate a Lightning web component bundle in the \"force-app/main/default/lwc\" directory:\n<%= config.bin %> <%= command.id %> --name mycomponent --type lwc --output-dir force-app/main/default/lwc",
1031
+ "Generate a TypeScript Lightning web component:\n<%= config.bin %> <%= command.id %> --name mycomponent --type lwc --template typescript"
1031
1032
  ],
1032
1033
  "flags": {
1033
1034
  "json": {
@@ -1061,7 +1062,7 @@
1061
1062
  },
1062
1063
  "template": {
1063
1064
  "char": "t",
1064
- "description": "Supplied parameter values or default values are filled into a copy of the template.",
1065
+ "description": "Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if not specified, the CLI automatically selects the template based on the project's sfdx-project.json \"defaultLwcLanguage\" field: TypeScript template for \"typescript\", JavaScript template for \"javascript\".",
1065
1066
  "name": "template",
1066
1067
  "summary": "Template to use for file creation.",
1067
1068
  "default": "default",
@@ -1070,7 +1071,8 @@
1070
1071
  "options": [
1071
1072
  "default",
1072
1073
  "analyticsDashboard",
1073
- "analyticsDashboardWithStep"
1074
+ "analyticsDashboardWithStep",
1075
+ "typescript"
1074
1076
  ],
1075
1077
  "type": "option"
1076
1078
  },
@@ -1251,7 +1253,7 @@
1251
1253
  },
1252
1254
  "template": {
1253
1255
  "char": "t",
1254
- "description": "Supplied parameter values or default values are filled into a copy of the template.",
1256
+ "description": "Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if not specified, the CLI automatically selects the template based on the project's sfdx-project.json \"defaultLwcLanguage\" field: TypeScript template for \"typescript\", JavaScript template for \"javascript\".",
1255
1257
  "name": "template",
1256
1258
  "summary": "Template to use for file creation.",
1257
1259
  "default": "DefaultLightningEvt",
@@ -1427,7 +1429,7 @@
1427
1429
  },
1428
1430
  "template": {
1429
1431
  "char": "t",
1430
- "description": "Supplied parameter values or default values are filled into a copy of the template.",
1432
+ "description": "Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if not specified, the CLI automatically selects the template based on the project's sfdx-project.json \"defaultLwcLanguage\" field: TypeScript template for \"typescript\", JavaScript template for \"javascript\".",
1431
1433
  "name": "template",
1432
1434
  "summary": "Template to use for file creation.",
1433
1435
  "default": "DefaultLightningIntf",
@@ -1603,7 +1605,7 @@
1603
1605
  },
1604
1606
  "template": {
1605
1607
  "char": "t",
1606
- "description": "Supplied parameter values or default values are filled into a copy of the template.",
1608
+ "description": "Supplied parameter values or default values are filled into a copy of the template. For Lightning Web Components, if not specified, the CLI automatically selects the template based on the project's sfdx-project.json \"defaultLwcLanguage\" field: TypeScript template for \"typescript\", JavaScript template for \"javascript\".",
1607
1609
  "name": "template",
1608
1610
  "summary": "Template to use for file creation.",
1609
1611
  "default": "DefaultLightningTest",
@@ -1747,7 +1749,8 @@
1747
1749
  "Generate a project called \"mywork\":\n<%= config.bin %> <%= command.id %> --name mywork",
1748
1750
  "Similar to previous example, but generate the files in a directory called \"myapp\":\n<%= config.bin %> <%= command.id %> --name mywork --default-package-dir myapp",
1749
1751
  "Similar to prevoius example, but also generate a default package.xml manifest file:\n<%= config.bin %> <%= command.id %> --name mywork --default-package-dir myapp --manifest",
1750
- "Generate a project with the minimum files and directories:\n<%= config.bin %> <%= command.id %> --name mywork --template empty"
1752
+ "Generate a project with the minimum files and directories:\n<%= config.bin %> <%= command.id %> --name mywork --template empty",
1753
+ "Generate a project in which the Lightning Web Components use TypeScript rather than the default JavaScript:\n<%= config.bin %> <%= command.id %> --name mywork --lwc-language typescript"
1751
1754
  ],
1752
1755
  "flags": {
1753
1756
  "json": {
@@ -1857,6 +1860,18 @@
1857
1860
  "multiple": false,
1858
1861
  "type": "option"
1859
1862
  },
1863
+ "lwc-language": {
1864
+ "description": "Sets the default language for Lightning Web Components in this project. When set to `'typescript'`, generates TypeScript configuration files (tsconfig.json, package.json with TypeScript dependencies, and TypeScript-aware ESLint config). TypeScript files are compiled locally for validation, and the TypeScript (`.ts`) files are deployed to Salesforce for server-side type stripping. If not specified, the project uses JavaScript.",
1865
+ "name": "lwc-language",
1866
+ "summary": "Language of the Lightning Web Components. Default is \"javascript\".",
1867
+ "hasDynamicHelp": false,
1868
+ "multiple": false,
1869
+ "options": [
1870
+ "javascript",
1871
+ "typescript"
1872
+ ],
1873
+ "type": "option"
1874
+ },
1860
1875
  "loglevel": {
1861
1876
  "deprecated": {
1862
1877
  "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
@@ -2501,5 +2516,5 @@
2501
2516
  ]
2502
2517
  }
2503
2518
  },
2504
- "version": "56.13.4"
2519
+ "version": "56.15.0"
2505
2520
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-templates",
3
3
  "description": "Commands to create metadata from a default or custom template",
4
- "version": "56.13.4",
4
+ "version": "56.15.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/salesforcecli/plugin-templates/issues",
7
7
  "enableO11y": true,
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@salesforce/core": "^8.27.1",
11
11
  "@salesforce/sf-plugins-core": "^12",
12
- "@salesforce/templates": "^66.7.4"
12
+ "@salesforce/templates": "^66.7.6"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@oclif/plugin-command-snapshot": "^5.3.13",
@@ -249,7 +249,7 @@
249
249
  "exports": "./lib/index.js",
250
250
  "type": "module",
251
251
  "sfdx": {
252
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/56.13.4.crt",
253
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/56.13.4.sig"
252
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/56.15.0.crt",
253
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/56.15.0.sig"
254
254
  }
255
255
  }