@salesforce/plugin-templates 57.3.0 → 57.4.1

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
@@ -178,7 +178,7 @@ FLAG DESCRIPTIONS
178
178
  directory.
179
179
  ```
180
180
 
181
- _See code: [src/commands/template/generate/analytics/template.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/analytics/template.ts)_
181
+ _See code: [src/commands/template/generate/analytics/template.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/analytics/template.ts)_
182
182
 
183
183
  ## `sf template generate apex class`
184
184
 
@@ -240,7 +240,7 @@ FLAG DESCRIPTIONS
240
240
  Supplied parameter values or default values are filled into a copy of the template.
241
241
  ```
242
242
 
243
- _See code: [src/commands/template/generate/apex/class.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/apex/class.ts)_
243
+ _See code: [src/commands/template/generate/apex/class.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/apex/class.ts)_
244
244
 
245
245
  ## `sf template generate apex trigger`
246
246
 
@@ -310,7 +310,7 @@ FLAG DESCRIPTIONS
310
310
  Supplied parameter values or default values are filled into a copy of the template.
311
311
  ```
312
312
 
313
- _See code: [src/commands/template/generate/apex/trigger.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/apex/trigger.ts)_
313
+ _See code: [src/commands/template/generate/apex/trigger.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/apex/trigger.ts)_
314
314
 
315
315
  ## `sf template generate digital-experience site`
316
316
 
@@ -364,7 +364,7 @@ FLAG DESCRIPTIONS
364
364
  project, defaults to the current directory.
365
365
  ```
366
366
 
367
- _See code: [src/commands/template/generate/digital-experience/site.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/digital-experience/site.ts)_
367
+ _See code: [src/commands/template/generate/digital-experience/site.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/digital-experience/site.ts)_
368
368
 
369
369
  ## `sf template generate flexipage`
370
370
 
@@ -446,7 +446,7 @@ FLAG DESCRIPTIONS
446
446
  'Custom_Object__c'. This sets the `sobjectType` field in the FlexiPage metadata.
447
447
  ```
448
448
 
449
- _See code: [src/commands/template/generate/flexipage/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/flexipage/index.ts)_
449
+ _See code: [src/commands/template/generate/flexipage/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/flexipage/index.ts)_
450
450
 
451
451
  ## `sf template generate lightning app`
452
452
 
@@ -504,7 +504,7 @@ FLAG DESCRIPTIONS
504
504
  field in the DX project's "sfdx-project.json" file.
505
505
  ```
506
506
 
507
- _See code: [src/commands/template/generate/lightning/app.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/lightning/app.ts)_
507
+ _See code: [src/commands/template/generate/lightning/app.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/lightning/app.ts)_
508
508
 
509
509
  ## `sf template generate lightning component`
510
510
 
@@ -581,7 +581,7 @@ FLAG DESCRIPTIONS
581
581
  field in the DX project's "sfdx-project.json" file.
582
582
  ```
583
583
 
584
- _See code: [src/commands/template/generate/lightning/component.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/lightning/component.ts)_
584
+ _See code: [src/commands/template/generate/lightning/component.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/lightning/component.ts)_
585
585
 
586
586
  ## `sf template generate lightning event`
587
587
 
@@ -639,7 +639,7 @@ FLAG DESCRIPTIONS
639
639
  field in the DX project's "sfdx-project.json" file.
640
640
  ```
641
641
 
642
- _See code: [src/commands/template/generate/lightning/event.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/lightning/event.ts)_
642
+ _See code: [src/commands/template/generate/lightning/event.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/lightning/event.ts)_
643
643
 
644
644
  ## `sf template generate lightning interface`
645
645
 
@@ -697,7 +697,7 @@ FLAG DESCRIPTIONS
697
697
  field in the DX project's "sfdx-project.json" file.
698
698
  ```
699
699
 
700
- _See code: [src/commands/template/generate/lightning/interface.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/lightning/interface.ts)_
700
+ _See code: [src/commands/template/generate/lightning/interface.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/lightning/interface.ts)_
701
701
 
702
702
  ## `sf template generate lightning test`
703
703
 
@@ -755,7 +755,7 @@ FLAG DESCRIPTIONS
755
755
  field in the DX project's "sfdx-project.json" file.
756
756
  ```
757
757
 
758
- _See code: [src/commands/template/generate/lightning/test.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/lightning/test.ts)_
758
+ _See code: [src/commands/template/generate/lightning/test.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/lightning/test.ts)_
759
759
 
760
760
  ## `sf template generate project`
761
761
 
@@ -887,7 +887,7 @@ FLAG DESCRIPTIONS
887
887
  server-side type stripping.
888
888
  ```
889
889
 
890
- _See code: [src/commands/template/generate/project/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/project/index.ts)_
890
+ _See code: [src/commands/template/generate/project/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/project/index.ts)_
891
891
 
892
892
  ## `sf template generate static-resource`
893
893
 
@@ -950,7 +950,7 @@ FLAG DESCRIPTIONS
950
950
  etc.
951
951
  ```
952
952
 
953
- _See code: [src/commands/template/generate/static-resource/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/static-resource/index.ts)_
953
+ _See code: [src/commands/template/generate/static-resource/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/static-resource/index.ts)_
954
954
 
955
955
  ## `sf template generate ui-bundle`
956
956
 
@@ -1039,7 +1039,7 @@ FLAG DESCRIPTIONS
1039
1039
  Supplied parameter values or default values are filled into a copy of the template.
1040
1040
  ```
1041
1041
 
1042
- _See code: [src/commands/template/generate/ui-bundle/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/ui-bundle/index.ts)_
1042
+ _See code: [src/commands/template/generate/ui-bundle/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/ui-bundle/index.ts)_
1043
1043
 
1044
1044
  ## `sf template generate ui-embedding`
1045
1045
 
@@ -1118,7 +1118,7 @@ FLAG DESCRIPTIONS
1118
1118
  (announced by screen readers).
1119
1119
  ```
1120
1120
 
1121
- _See code: [src/commands/template/generate/ui-embedding/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/ui-embedding/index.ts)_
1121
+ _See code: [src/commands/template/generate/ui-embedding/index.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/ui-embedding/index.ts)_
1122
1122
 
1123
1123
  ## `sf template generate visualforce component`
1124
1124
 
@@ -1175,7 +1175,7 @@ FLAG DESCRIPTIONS
1175
1175
  Supplied parameter values or default values are filled into a copy of the template.
1176
1176
  ```
1177
1177
 
1178
- _See code: [src/commands/template/generate/visualforce/component.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/visualforce/component.ts)_
1178
+ _See code: [src/commands/template/generate/visualforce/component.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/visualforce/component.ts)_
1179
1179
 
1180
1180
  ## `sf template generate visualforce page`
1181
1181
 
@@ -1226,6 +1226,6 @@ FLAG DESCRIPTIONS
1226
1226
  The name can be up to 40 characters and must start with a letter.
1227
1227
  ```
1228
1228
 
1229
- _See code: [src/commands/template/generate/visualforce/page.ts](https://github.com/salesforcecli/plugin-templates/blob/57.3.0/src/commands/template/generate/visualforce/page.ts)_
1229
+ _See code: [src/commands/template/generate/visualforce/page.ts](https://github.com/salesforcecli/plugin-templates/blob/57.4.1/src/commands/template/generate/visualforce/page.ts)_
1230
1230
 
1231
1231
  <!-- commandsstop -->
@@ -0,0 +1,60 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { CreateOutput, LightningOutOptions } from '@salesforce/templates';
3
+ /** Flat flag shape read by {@link mergeLightningOutInputs} — a structural subset of the parsed oclif flags. */
4
+ type LightningOutFlags = {
5
+ 'app-name'?: string;
6
+ 'eca-name'?: string;
7
+ runtime?: 'LWR_CORE' | 'CLWR';
8
+ 'host-domains'?: string[];
9
+ components?: string[];
10
+ 'eca-contact-email'?: string;
11
+ 'eca-callback-url'?: string;
12
+ 'output-dir'?: string;
13
+ };
14
+ /** Parse the --definition-file JSON, surfacing a clear error on malformed or non-object input. */
15
+ export declare function readDefinition(file: string): Record<string, unknown>;
16
+ /**
17
+ * Validate the types of --definition-file fields before they reach the generator, so wrong-typed
18
+ * JSON (e.g. `"appName": 123`) yields an actionable error here rather than an internal TypeError
19
+ * from the generator (which calls `.trim()` on string fields). A field is skipped when the matching
20
+ * flag overrides it, since flags always arrive as strings and win per-key (see mergeLightningOutInputs).
21
+ */
22
+ export declare function validateDefinitionShape(defn: Record<string, unknown>, flags: LightningOutFlags): void;
23
+ /**
24
+ * Merge the --definition-file JSON with individual flags into one LightningOutOptions, with
25
+ * per-key precedence (flags win over the file) and wholesale list-replace semantics for
26
+ * hostDomains/components (never merge/concat). All structural validation (required-ness, shape,
27
+ * formats) is the generator's job — this function only resolves precedence.
28
+ */
29
+ export declare function mergeLightningOutInputs(defn: Record<string, unknown>, flags: LightningOutFlags): {
30
+ opts: LightningOutOptions;
31
+ unknownKeys: string[];
32
+ };
33
+ /** True when a project sourceApiVersion is present and below the v68.0 deploy floor. Pure; testable. */
34
+ export declare function isBelowApiFloor(projApi: string | undefined): boolean;
35
+ /**
36
+ * Quote a path for safe copy-paste into a POSIX shell when it contains whitespace or quote chars,
37
+ * so the suggested deploy command survives output dirs such as "/tmp/Lightning Out".
38
+ */
39
+ export declare function shellQuoteArg(p: string): string;
40
+ export default class LightningOut extends SfCommand<CreateOutput> {
41
+ static readonly summary: string;
42
+ static readonly description: string;
43
+ static readonly examples: string[];
44
+ static readonly state = "beta";
45
+ static readonly hidden = true;
46
+ static readonly flags: {
47
+ 'app-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
48
+ 'eca-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
49
+ runtime: import("@oclif/core/interfaces").OptionFlag<"LWR_CORE" | "CLWR" | undefined, import("@oclif/core/interfaces").CustomOptions>;
50
+ 'host-domains': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
51
+ components: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
52
+ 'eca-contact-email': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
53
+ 'eca-callback-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
54
+ 'definition-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
55
+ 'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
56
+ loglevel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
57
+ };
58
+ run(): Promise<CreateOutput>;
59
+ }
60
+ export {};
@@ -0,0 +1,179 @@
1
+ /*
2
+ * Copyright 2025, Salesforce, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import * as fs from 'node:fs';
17
+ import { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
18
+ import { TemplateType } from '@salesforce/templates';
19
+ import { Messages, SfProject } from '@salesforce/core';
20
+ import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
21
+ import { outputDirFlagLightning } from '../../../../utils/flags.js';
22
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
23
+ const messages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningOut');
24
+ /** Parse the --definition-file JSON, surfacing a clear error on malformed or non-object input. */
25
+ export function readDefinition(file) {
26
+ let parsed;
27
+ try {
28
+ parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
29
+ }
30
+ catch (e) {
31
+ throw messages.createError('error.definition-file-json', [file, e.message]);
32
+ }
33
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
34
+ throw messages.createError('error.definition-file-not-object', [file]);
35
+ }
36
+ return parsed;
37
+ }
38
+ /** True when a value is an array whose every element is a string. */
39
+ function isStringArray(v) {
40
+ return Array.isArray(v) && v.every((x) => typeof x === 'string');
41
+ }
42
+ /**
43
+ * Validate the types of --definition-file fields before they reach the generator, so wrong-typed
44
+ * JSON (e.g. `"appName": 123`) yields an actionable error here rather than an internal TypeError
45
+ * from the generator (which calls `.trim()` on string fields). A field is skipped when the matching
46
+ * flag overrides it, since flags always arrive as strings and win per-key (see mergeLightningOutInputs).
47
+ */
48
+ export function validateDefinitionShape(defn, flags) {
49
+ const requireString = (overridden, val, key) => {
50
+ if (!overridden && val !== undefined && typeof val !== 'string') {
51
+ throw messages.createError('error.definition-file-field-type', [key, 'a string']);
52
+ }
53
+ };
54
+ const requireStringArray = (overridden, val, key) => {
55
+ if (!overridden && val !== undefined && !isStringArray(val)) {
56
+ throw messages.createError('error.definition-file-field-type', [key, 'an array of strings']);
57
+ }
58
+ };
59
+ requireString(flags['app-name'] !== undefined, defn.appName, 'appName');
60
+ requireString(flags.runtime !== undefined, defn.runtime, 'runtime');
61
+ requireStringArray(flags['host-domains'] !== undefined, defn.hostDomains, 'hostDomains');
62
+ requireStringArray(flags.components !== undefined, defn.components, 'components');
63
+ if (defn.eca !== undefined) {
64
+ if (typeof defn.eca !== 'object' || defn.eca === null || Array.isArray(defn.eca)) {
65
+ throw messages.createError('error.definition-file-field-type', ['eca', 'an object']);
66
+ }
67
+ const eca = defn.eca;
68
+ requireString(flags['eca-name'] !== undefined, eca.name, 'eca.name');
69
+ requireString(flags['eca-contact-email'] !== undefined, eca.contactEmail, 'eca.contactEmail');
70
+ requireString(flags['eca-callback-url'] !== undefined, eca.callbackUrl, 'eca.callbackUrl');
71
+ }
72
+ }
73
+ /**
74
+ * Merge the --definition-file JSON with individual flags into one LightningOutOptions, with
75
+ * per-key precedence (flags win over the file) and wholesale list-replace semantics for
76
+ * hostDomains/components (never merge/concat). All structural validation (required-ness, shape,
77
+ * formats) is the generator's job — this function only resolves precedence.
78
+ */
79
+ export function mergeLightningOutInputs(defn, flags) {
80
+ const known = new Set(['appName', 'runtime', 'hostDomains', 'components', 'eca']);
81
+ const unknownKeys = Object.keys(defn).filter((k) => !known.has(k));
82
+ const ecaDefn = (defn.eca ?? {});
83
+ const opts = {
84
+ appName: flags['app-name'] ?? defn.appName,
85
+ runtime: (flags.runtime ?? defn.runtime),
86
+ hostDomains: flags['host-domains'] ?? defn.hostDomains ?? [],
87
+ components: flags.components ?? defn.components,
88
+ eca: {
89
+ name: flags['eca-name'] ?? ecaDefn.name,
90
+ contactEmail: flags['eca-contact-email'] ?? ecaDefn.contactEmail,
91
+ callbackUrl: flags['eca-callback-url'] ?? ecaDefn.callbackUrl,
92
+ },
93
+ outputdir: flags['output-dir'],
94
+ };
95
+ return { opts, unknownKeys };
96
+ }
97
+ /**
98
+ * Resolve the local DX project's `sourceApiVersion`, used only for a CLI-side advisory warning
99
+ * (the generator itself has no project context). Returns undefined when there's no DX project —
100
+ * generating outside a project must not error.
101
+ */
102
+ async function getSourceApiVersion() {
103
+ try {
104
+ const project = await SfProject.resolve();
105
+ const projectJson = await project.resolveProjectConfig();
106
+ return projectJson.sourceApiVersion;
107
+ }
108
+ catch (e) {
109
+ return undefined;
110
+ }
111
+ }
112
+ /** True when a project sourceApiVersion is present and below the v68.0 deploy floor. Pure; testable. */
113
+ export function isBelowApiFloor(projApi) {
114
+ return !!projApi && Number(projApi) < 68;
115
+ }
116
+ /**
117
+ * Quote a path for safe copy-paste into a POSIX shell when it contains whitespace or quote chars,
118
+ * so the suggested deploy command survives output dirs such as "/tmp/Lightning Out".
119
+ */
120
+ export function shellQuoteArg(p) {
121
+ return /[\s"'\\]/.test(p) ? `'${p.replace(/'/g, "'\\''")}'` : p;
122
+ }
123
+ export default class LightningOut extends SfCommand {
124
+ static summary = messages.getMessage('summary');
125
+ static description = messages.getMessage('description');
126
+ static examples = messages.getMessages('examples');
127
+ static state = 'beta';
128
+ static hidden = true;
129
+ static flags = {
130
+ 'app-name': Flags.string({ summary: messages.getMessage('flags.app-name.summary'), required: false }),
131
+ 'eca-name': Flags.string({ summary: messages.getMessage('flags.eca-name.summary'), required: false }),
132
+ runtime: Flags.option({
133
+ options: ['LWR_CORE', 'CLWR'],
134
+ summary: messages.getMessage('flags.runtime.summary'),
135
+ })(),
136
+ 'host-domains': Flags.string({ summary: messages.getMessage('flags.host-domains.summary'), multiple: true }),
137
+ components: Flags.string({ summary: messages.getMessage('flags.components.summary'), multiple: true }),
138
+ 'eca-contact-email': Flags.string({ summary: messages.getMessage('flags.eca-contact-email.summary') }),
139
+ 'eca-callback-url': Flags.string({ summary: messages.getMessage('flags.eca-callback-url.summary') }),
140
+ 'definition-file': Flags.file({ exists: true, summary: messages.getMessage('flags.definition-file.summary') }),
141
+ 'output-dir': outputDirFlagLightning,
142
+ loglevel,
143
+ };
144
+ async run() {
145
+ const { flags } = await this.parse(LightningOut);
146
+ const defn = flags['definition-file'] ? readDefinition(flags['definition-file']) : {};
147
+ validateDefinitionShape(defn, flags);
148
+ const { opts, unknownKeys } = mergeLightningOutInputs(defn, flags);
149
+ unknownKeys.forEach((k) => this.warn(messages.getMessage('warning.unknown-definition-key', [k])));
150
+ const result = await runGenerator({
151
+ templateType: TemplateType.LightningOut,
152
+ opts,
153
+ ux: new Ux({ jsonEnabled: this.jsonEnabled() }),
154
+ templates: getCustomTemplates(this.configAggregator),
155
+ });
156
+ // CLI-side sourceApiVersion floor check (the generator has no project context).
157
+ const projApi = await getSourceApiVersion();
158
+ const belowFloor = isBelowApiFloor(projApi);
159
+ if (belowFloor) {
160
+ this.warn(messages.getMessage('warning.source-api-version', [String(projApi)]));
161
+ }
162
+ // Success guidance (suppressed automatically under --json).
163
+ // Only pin --api-version to the 68.0 deploy floor when the project is below it; otherwise omit
164
+ // the optional flag so the user's own (>= floor) project default applies rather than being downgraded.
165
+ const outputDir = opts.outputdir ?? '.';
166
+ const apiVersionSuffix = belowFloor ? ' --api-version 68.0' : '';
167
+ this.log(messages.getMessage('success.next-step', [outputDir, shellQuoteArg(outputDir), apiVersionSuffix]));
168
+ this.info(messages.getMessage('success.app-id'));
169
+ this.info(messages.getMessage('success.dont-delete'));
170
+ this.info(messages.getMessage('success.eca-overwrite', [opts.eca.name ?? '']));
171
+ this.info(messages.getMessage('success.components-exist'));
172
+ // frontdoor.jsp handoff is a CLWR-only concern; don't show it for LWR_CORE runs.
173
+ if (opts.runtime === 'CLWR') {
174
+ this.info(messages.getMessage('success.frontdoor'));
175
+ }
176
+ return result; // --json returns the full CreateOutput (created[])
177
+ }
178
+ }
179
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceR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ime LWR_CORE --host-domains https://example.com --eca-name MyLoAppEca --eca-contact-email dev@example.com --eca-callback-url https://example.com/cb
6
+
7
+ - Generate an app using the values in a JSON definition file called lo-def.json:
8
+
9
+ <%= config.bin %> <%= command.id %> --definition-file lo-def.json
10
+
11
+ - Generate the app into a specific directory:
12
+
13
+ <%= config.bin %> <%= command.id %> --definition-file lo-def.json --output-dir force-app/main/default
14
+
15
+ - Generate the app using most of the values from a definition file, but the --host-domains value overrides its equivalent in the file:
16
+
17
+ <%= config.bin %> <%= command.id %> --definition-file lo-def.json --host-domains https://staging.example.com
18
+
19
+ # summary
20
+
21
+ Generate the required metadata to scaffold a Lightning Out 2.0 app.
22
+
23
+ # description
24
+
25
+ Lightning Out 2.0 lets you embed custom Lightning web components (LWCs) into your external, non-Salesforce apps.
26
+
27
+ This command gets you started by generating the seven metadata artifact types that a Lightning Out 2.0 app requires into your Salesforce DX project: LightningOutApp, MyDomain and Security settings, one CorsWhitelistOrigin per host domain, and the three External Client Application OAuth components (ExternalClientApplication, ExtlClntAppGlobalOauthSettings, ExtlClntAppOauthSettings). The command is generate-only; it doesn't deploy any metadata to an org.
28
+
29
+ Inputs may come from a --definition-file JSON, individual flags, or both. Flag values take precedence over the file on a per-key basis. The command validates the types of definition-file fields; the underlying generator performs the remaining structural validation, such as required fields and formats.
30
+
31
+ # flags.app-name.summary
32
+
33
+ Developer name of the new Lightning Out 2.0 app.
34
+
35
+ # flags.eca-name.summary
36
+
37
+ Developer name of the External Client Application associated with the app.
38
+
39
+ # flags.runtime.summary
40
+
41
+ Runtime the app targets. LWR_CORE serves from your Salesforce org for authenticated users; CLWR serves from an Experience Cloud site (guest access, extra site-deployment step).
42
+
43
+ # flags.host-domains.summary
44
+
45
+ HTTP or HTTPS origin of an external host page that embeds the app. Repeat the flag to specify more than one. Replaces, rather than merges with, any hostDomains in the --definition-file.
46
+
47
+ # flags.components.summary
48
+
49
+ Name of a Lightning web component exposed by the app. Repeat the flag to specify more than one. Replaces, rather than merges with, any components in the --definition-file.
50
+
51
+ # flags.eca-contact-email.summary
52
+
53
+ Contact email for the External Client Application.
54
+
55
+ # flags.eca-callback-url.summary
56
+
57
+ OAuth callback URL for the External Client Application.
58
+
59
+ # flags.definition-file.summary
60
+
61
+ Path to a JSON file describing the Lightning Out 2.0 app. Individual flags, when supplied, override the corresponding value in this file.
62
+
63
+ # error.definition-file-json
64
+
65
+ Definition file %s is not valid JSON: %s
66
+
67
+ # error.definition-file-not-object
68
+
69
+ Definition file %s must contain a single JSON object, not an array or scalar.
70
+
71
+ # error.definition-file-field-type
72
+
73
+ Definition file field "%s" must be %s.
74
+
75
+ # warning.unknown-definition-key
76
+
77
+ Ignoring unrecognized key "%s" in --definition-file.
78
+
79
+ # warning.source-api-version
80
+
81
+ Your local project's sourceApiVersion (%s) is below 68.0, the minimum API version this scaffold supports for deployment. Set sourceApiVersion to 68.0 or later in sfdx-project.json, or pass --api-version 68.0 or later when you deploy.
82
+
83
+ # success.next-step
84
+
85
+ Scaffold generated in %s. Deploy it with: sf project deploy start --source-dir %s%s
86
+
87
+ # success.app-id
88
+
89
+ After deploying, note the LightningOutApp's App ID from Setup — your host page needs it to embed the app.
90
+
91
+ # success.dont-delete
92
+
93
+ Don't delete the generated ExternalClientApplication after deploying — Lightning Out uses it for OAuth at runtime.
94
+
95
+ # success.eca-overwrite
96
+
97
+ Re-running this command overwrites the generated files for the "%s" External Client Application; back up local edits first.
98
+
99
+ # success.components-exist
100
+
101
+ Verify that every component you referenced already exists and is exposed for Lightning Out before deploying.
102
+
103
+ # success.frontdoor
104
+
105
+ For CLWR, host pages must complete a frontdoor.jsp handoff before the embedded app can authenticate.
@@ -1,158 +1,5 @@
1
1
  {
2
2
  "commands": {
3
- "template:generate:analytics:template": {
4
- "aliases": [
5
- "force:analytics:template:create",
6
- "analytics:generate:template"
7
- ],
8
- "args": {},
9
- "deprecateAliases": true,
10
- "description": "The metadata files associated with the Analytics template must be contained in a parent directory called \"waveTemplates\" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.",
11
- "examples": [
12
- "Generate the metadata files for a simple Analytics template file called myTemplate in the force-app/main/default/waveTemplates directory:\n<%= config.bin %> <%= command.id %> --name myTemplate --output-dir force-app/main/default/waveTemplates"
13
- ],
14
- "flags": {
15
- "json": {
16
- "description": "Format output as json.",
17
- "helpGroup": "GLOBAL",
18
- "name": "json",
19
- "allowNo": false,
20
- "type": "boolean"
21
- },
22
- "flags-dir": {
23
- "helpGroup": "GLOBAL",
24
- "name": "flags-dir",
25
- "summary": "Import flag values from a directory.",
26
- "hasDynamicHelp": false,
27
- "multiple": false,
28
- "type": "option"
29
- },
30
- "output-dir": {
31
- "aliases": [
32
- "outputdir"
33
- ],
34
- "char": "d",
35
- "deprecateAliases": true,
36
- "description": "The location can be an absolute path or relative to the current working directory. The default is the current directory.",
37
- "name": "output-dir",
38
- "summary": "Directory for saving the created files.",
39
- "default": ".",
40
- "hasDynamicHelp": false,
41
- "multiple": false,
42
- "type": "option"
43
- },
44
- "api-version": {
45
- "aliases": [
46
- "apiversion"
47
- ],
48
- "deprecateAliases": true,
49
- "description": "Override the api version used for api requests made by this command",
50
- "name": "api-version",
51
- "hasDynamicHelp": false,
52
- "multiple": false,
53
- "type": "option"
54
- },
55
- "name": {
56
- "aliases": [
57
- "templatename"
58
- ],
59
- "char": "n",
60
- "deprecateAliases": true,
61
- "name": "name",
62
- "required": true,
63
- "summary": "Name of the Analytics template.",
64
- "hasDynamicHelp": false,
65
- "multiple": false,
66
- "type": "option"
67
- },
68
- "loglevel": {
69
- "deprecated": {
70
- "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 `SF_LOG_LEVEL` environment variable."
71
- },
72
- "hidden": true,
73
- "name": "loglevel",
74
- "hasDynamicHelp": false,
75
- "multiple": false,
76
- "type": "option"
77
- }
78
- },
79
- "hasDynamicHelp": false,
80
- "hiddenAliases": [],
81
- "id": "template:generate:analytics:template",
82
- "pluginAlias": "@salesforce/plugin-templates",
83
- "pluginName": "@salesforce/plugin-templates",
84
- "pluginType": "core",
85
- "strict": true,
86
- "summary": "Generate a simple Analytics template.",
87
- "enableJsonFlag": true,
88
- "isESM": true,
89
- "relativePath": [
90
- "lib",
91
- "commands",
92
- "template",
93
- "generate",
94
- "analytics",
95
- "template.js"
96
- ],
97
- "aliasPermutations": [
98
- "force:analytics:template:create",
99
- "analytics:force:template:create",
100
- "analytics:template:force:create",
101
- "analytics:template:create:force",
102
- "force:template:analytics:create",
103
- "template:force:analytics:create",
104
- "template:analytics:force:create",
105
- "template:analytics:create:force",
106
- "force:template:create:analytics",
107
- "template:force:create:analytics",
108
- "template:create:force:analytics",
109
- "template:create:analytics:force",
110
- "force:analytics:create:template",
111
- "analytics:force:create:template",
112
- "analytics:create:force:template",
113
- "analytics:create:template:force",
114
- "force:create:analytics:template",
115
- "create:force:analytics:template",
116
- "create:analytics:force:template",
117
- "create:analytics:template:force",
118
- "force:create:template:analytics",
119
- "create:force:template:analytics",
120
- "create:template:force:analytics",
121
- "create:template:analytics:force",
122
- "analytics:generate:template",
123
- "generate:analytics:template",
124
- "generate:template:analytics",
125
- "analytics:template:generate",
126
- "template:analytics:generate",
127
- "template:generate:analytics"
128
- ],
129
- "permutations": [
130
- "template:generate:analytics:template",
131
- "generate:template:analytics:template",
132
- "generate:analytics:template:template",
133
- "generate:analytics:template:template",
134
- "template:analytics:generate:template",
135
- "analytics:template:generate:template",
136
- "analytics:generate:template:template",
137
- "analytics:generate:template:template",
138
- "template:analytics:template:generate",
139
- "analytics:template:template:generate",
140
- "analytics:template:template:generate",
141
- "analytics:template:generate:template",
142
- "template:generate:template:analytics",
143
- "generate:template:template:analytics",
144
- "generate:template:template:analytics",
145
- "generate:template:analytics:template",
146
- "template:template:generate:analytics",
147
- "template:template:generate:analytics",
148
- "template:generate:template:analytics",
149
- "template:generate:analytics:template",
150
- "template:template:analytics:generate",
151
- "template:template:analytics:generate",
152
- "template:analytics:template:generate",
153
- "template:analytics:generate:template"
154
- ]
155
- },
156
3
  "template:generate:apex:class": {
157
4
  "aliases": [
158
5
  "force:apex:class:create",
@@ -530,6 +377,159 @@
530
377
  "trigger:apex:generate:template"
531
378
  ]
532
379
  },
380
+ "template:generate:analytics:template": {
381
+ "aliases": [
382
+ "force:analytics:template:create",
383
+ "analytics:generate:template"
384
+ ],
385
+ "args": {},
386
+ "deprecateAliases": true,
387
+ "description": "The metadata files associated with the Analytics template must be contained in a parent directory called \"waveTemplates\" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.",
388
+ "examples": [
389
+ "Generate the metadata files for a simple Analytics template file called myTemplate in the force-app/main/default/waveTemplates directory:\n<%= config.bin %> <%= command.id %> --name myTemplate --output-dir force-app/main/default/waveTemplates"
390
+ ],
391
+ "flags": {
392
+ "json": {
393
+ "description": "Format output as json.",
394
+ "helpGroup": "GLOBAL",
395
+ "name": "json",
396
+ "allowNo": false,
397
+ "type": "boolean"
398
+ },
399
+ "flags-dir": {
400
+ "helpGroup": "GLOBAL",
401
+ "name": "flags-dir",
402
+ "summary": "Import flag values from a directory.",
403
+ "hasDynamicHelp": false,
404
+ "multiple": false,
405
+ "type": "option"
406
+ },
407
+ "output-dir": {
408
+ "aliases": [
409
+ "outputdir"
410
+ ],
411
+ "char": "d",
412
+ "deprecateAliases": true,
413
+ "description": "The location can be an absolute path or relative to the current working directory. The default is the current directory.",
414
+ "name": "output-dir",
415
+ "summary": "Directory for saving the created files.",
416
+ "default": ".",
417
+ "hasDynamicHelp": false,
418
+ "multiple": false,
419
+ "type": "option"
420
+ },
421
+ "api-version": {
422
+ "aliases": [
423
+ "apiversion"
424
+ ],
425
+ "deprecateAliases": true,
426
+ "description": "Override the api version used for api requests made by this command",
427
+ "name": "api-version",
428
+ "hasDynamicHelp": false,
429
+ "multiple": false,
430
+ "type": "option"
431
+ },
432
+ "name": {
433
+ "aliases": [
434
+ "templatename"
435
+ ],
436
+ "char": "n",
437
+ "deprecateAliases": true,
438
+ "name": "name",
439
+ "required": true,
440
+ "summary": "Name of the Analytics template.",
441
+ "hasDynamicHelp": false,
442
+ "multiple": false,
443
+ "type": "option"
444
+ },
445
+ "loglevel": {
446
+ "deprecated": {
447
+ "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 `SF_LOG_LEVEL` environment variable."
448
+ },
449
+ "hidden": true,
450
+ "name": "loglevel",
451
+ "hasDynamicHelp": false,
452
+ "multiple": false,
453
+ "type": "option"
454
+ }
455
+ },
456
+ "hasDynamicHelp": false,
457
+ "hiddenAliases": [],
458
+ "id": "template:generate:analytics:template",
459
+ "pluginAlias": "@salesforce/plugin-templates",
460
+ "pluginName": "@salesforce/plugin-templates",
461
+ "pluginType": "core",
462
+ "strict": true,
463
+ "summary": "Generate a simple Analytics template.",
464
+ "enableJsonFlag": true,
465
+ "isESM": true,
466
+ "relativePath": [
467
+ "lib",
468
+ "commands",
469
+ "template",
470
+ "generate",
471
+ "analytics",
472
+ "template.js"
473
+ ],
474
+ "aliasPermutations": [
475
+ "force:analytics:template:create",
476
+ "analytics:force:template:create",
477
+ "analytics:template:force:create",
478
+ "analytics:template:create:force",
479
+ "force:template:analytics:create",
480
+ "template:force:analytics:create",
481
+ "template:analytics:force:create",
482
+ "template:analytics:create:force",
483
+ "force:template:create:analytics",
484
+ "template:force:create:analytics",
485
+ "template:create:force:analytics",
486
+ "template:create:analytics:force",
487
+ "force:analytics:create:template",
488
+ "analytics:force:create:template",
489
+ "analytics:create:force:template",
490
+ "analytics:create:template:force",
491
+ "force:create:analytics:template",
492
+ "create:force:analytics:template",
493
+ "create:analytics:force:template",
494
+ "create:analytics:template:force",
495
+ "force:create:template:analytics",
496
+ "create:force:template:analytics",
497
+ "create:template:force:analytics",
498
+ "create:template:analytics:force",
499
+ "analytics:generate:template",
500
+ "generate:analytics:template",
501
+ "generate:template:analytics",
502
+ "analytics:template:generate",
503
+ "template:analytics:generate",
504
+ "template:generate:analytics"
505
+ ],
506
+ "permutations": [
507
+ "template:generate:analytics:template",
508
+ "generate:template:analytics:template",
509
+ "generate:analytics:template:template",
510
+ "generate:analytics:template:template",
511
+ "template:analytics:generate:template",
512
+ "analytics:template:generate:template",
513
+ "analytics:generate:template:template",
514
+ "analytics:generate:template:template",
515
+ "template:analytics:template:generate",
516
+ "analytics:template:template:generate",
517
+ "analytics:template:template:generate",
518
+ "analytics:template:generate:template",
519
+ "template:generate:template:analytics",
520
+ "generate:template:template:analytics",
521
+ "generate:template:template:analytics",
522
+ "generate:template:analytics:template",
523
+ "template:template:generate:analytics",
524
+ "template:template:generate:analytics",
525
+ "template:generate:template:analytics",
526
+ "template:generate:analytics:template",
527
+ "template:template:analytics:generate",
528
+ "template:template:analytics:generate",
529
+ "template:analytics:template:generate",
530
+ "template:analytics:generate:template"
531
+ ]
532
+ },
533
533
  "template:generate:digital-experience:site": {
534
534
  "aliases": [],
535
535
  "args": {},
@@ -1739,6 +1739,149 @@
1739
1739
  "test:lightning:generate:template"
1740
1740
  ]
1741
1741
  },
1742
+ "template:generate:lightning-out": {
1743
+ "aliases": [],
1744
+ "args": {},
1745
+ "description": "Lightning Out 2.0 lets you embed custom Lightning web components (LWCs) into your external, non-Salesforce apps.\n\nThis command gets you started by generating the seven metadata artifact types that a Lightning Out 2.0 app requires into your Salesforce DX project: LightningOutApp, MyDomain and Security settings, one CorsWhitelistOrigin per host domain, and the three External Client Application OAuth components (ExternalClientApplication, ExtlClntAppGlobalOauthSettings, ExtlClntAppOauthSettings). The command is generate-only; it doesn't deploy any metadata to an org.\n\nInputs may come from a --definition-file JSON, individual flags, or both. Flag values take precedence over the file on a per-key basis. The command validates the types of definition-file fields; the underlying generator performs the remaining structural validation, such as required fields and formats.",
1746
+ "examples": [
1747
+ "Generate a Lightning Out 2.0 app using individual flags to specify the values:\n<%= config.bin %> <%= command.id %> --app-name MyLoApp --runtime LWR_CORE --host-domains https://example.com --eca-name MyLoAppEca --eca-contact-email dev@example.com --eca-callback-url https://example.com/cb",
1748
+ "Generate an app using the values in a JSON definition file called lo-def.json:\n<%= config.bin %> <%= command.id %> --definition-file lo-def.json",
1749
+ "Generate the app into a specific directory:\n<%= config.bin %> <%= command.id %> --definition-file lo-def.json --output-dir force-app/main/default",
1750
+ "Generate the app using most of the values from a definition file, but the --host-domains value overrides its equivalent in the file:\n<%= config.bin %> <%= command.id %> --definition-file lo-def.json --host-domains https://staging.example.com"
1751
+ ],
1752
+ "flags": {
1753
+ "json": {
1754
+ "description": "Format output as json.",
1755
+ "helpGroup": "GLOBAL",
1756
+ "name": "json",
1757
+ "allowNo": false,
1758
+ "type": "boolean"
1759
+ },
1760
+ "flags-dir": {
1761
+ "helpGroup": "GLOBAL",
1762
+ "name": "flags-dir",
1763
+ "summary": "Import flag values from a directory.",
1764
+ "hasDynamicHelp": false,
1765
+ "multiple": false,
1766
+ "type": "option"
1767
+ },
1768
+ "app-name": {
1769
+ "name": "app-name",
1770
+ "required": false,
1771
+ "summary": "Developer name of the new Lightning Out 2.0 app.",
1772
+ "hasDynamicHelp": false,
1773
+ "multiple": false,
1774
+ "type": "option"
1775
+ },
1776
+ "eca-name": {
1777
+ "name": "eca-name",
1778
+ "required": false,
1779
+ "summary": "Developer name of the External Client Application associated with the app.",
1780
+ "hasDynamicHelp": false,
1781
+ "multiple": false,
1782
+ "type": "option"
1783
+ },
1784
+ "runtime": {
1785
+ "name": "runtime",
1786
+ "summary": "Runtime the app targets. LWR_CORE serves from your Salesforce org for authenticated users; CLWR serves from an Experience Cloud site (guest access, extra site-deployment step).",
1787
+ "hasDynamicHelp": false,
1788
+ "multiple": false,
1789
+ "options": [
1790
+ "LWR_CORE",
1791
+ "CLWR"
1792
+ ],
1793
+ "type": "option"
1794
+ },
1795
+ "host-domains": {
1796
+ "name": "host-domains",
1797
+ "summary": "HTTP or HTTPS origin of an external host page that embeds the app. Repeat the flag to specify more than one. Replaces, rather than merges with, any hostDomains in the --definition-file.",
1798
+ "hasDynamicHelp": false,
1799
+ "multiple": true,
1800
+ "type": "option"
1801
+ },
1802
+ "components": {
1803
+ "name": "components",
1804
+ "summary": "Name of a Lightning web component exposed by the app. Repeat the flag to specify more than one. Replaces, rather than merges with, any components in the --definition-file.",
1805
+ "hasDynamicHelp": false,
1806
+ "multiple": true,
1807
+ "type": "option"
1808
+ },
1809
+ "eca-contact-email": {
1810
+ "name": "eca-contact-email",
1811
+ "summary": "Contact email for the External Client Application.",
1812
+ "hasDynamicHelp": false,
1813
+ "multiple": false,
1814
+ "type": "option"
1815
+ },
1816
+ "eca-callback-url": {
1817
+ "name": "eca-callback-url",
1818
+ "summary": "OAuth callback URL for the External Client Application.",
1819
+ "hasDynamicHelp": false,
1820
+ "multiple": false,
1821
+ "type": "option"
1822
+ },
1823
+ "definition-file": {
1824
+ "name": "definition-file",
1825
+ "summary": "Path to a JSON file describing the Lightning Out 2.0 app. Individual flags, when supplied, override the corresponding value in this file.",
1826
+ "hasDynamicHelp": false,
1827
+ "multiple": false,
1828
+ "type": "option"
1829
+ },
1830
+ "output-dir": {
1831
+ "aliases": [
1832
+ "outputdir"
1833
+ ],
1834
+ "char": "d",
1835
+ "deprecateAliases": true,
1836
+ "description": "The location can be an absolute path or relative to the current working directory. The default is the current directory.",
1837
+ "name": "output-dir",
1838
+ "summary": "Directory for saving the created files.",
1839
+ "default": ".",
1840
+ "hasDynamicHelp": false,
1841
+ "multiple": false,
1842
+ "type": "option"
1843
+ },
1844
+ "loglevel": {
1845
+ "deprecated": {
1846
+ "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 `SF_LOG_LEVEL` environment variable."
1847
+ },
1848
+ "hidden": true,
1849
+ "name": "loglevel",
1850
+ "hasDynamicHelp": false,
1851
+ "multiple": false,
1852
+ "type": "option"
1853
+ }
1854
+ },
1855
+ "hasDynamicHelp": false,
1856
+ "hidden": true,
1857
+ "hiddenAliases": [],
1858
+ "id": "template:generate:lightning-out",
1859
+ "pluginAlias": "@salesforce/plugin-templates",
1860
+ "pluginName": "@salesforce/plugin-templates",
1861
+ "pluginType": "core",
1862
+ "state": "beta",
1863
+ "strict": true,
1864
+ "summary": "Generate the required metadata to scaffold a Lightning Out 2.0 app.",
1865
+ "enableJsonFlag": true,
1866
+ "isESM": true,
1867
+ "relativePath": [
1868
+ "lib",
1869
+ "commands",
1870
+ "template",
1871
+ "generate",
1872
+ "lightning-out",
1873
+ "index.js"
1874
+ ],
1875
+ "aliasPermutations": [],
1876
+ "permutations": [
1877
+ "template:generate:lightning-out",
1878
+ "generate:template:lightning-out",
1879
+ "generate:lightning-out:template",
1880
+ "template:lightning-out:generate",
1881
+ "lightning-out:template:generate",
1882
+ "lightning-out:generate:template"
1883
+ ]
1884
+ },
1742
1885
  "template:generate:project": {
1743
1886
  "aliases": [
1744
1887
  "force:project:create",
@@ -2670,5 +2813,5 @@
2670
2813
  ]
2671
2814
  }
2672
2815
  },
2673
- "version": "57.3.0"
2816
+ "version": "57.4.1"
2674
2817
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-templates",
3
3
  "description": "Commands to create metadata from a default or custom template",
4
- "version": "57.3.0",
4
+ "version": "57.4.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/salesforcecli/plugin-templates/issues",
7
7
  "enableO11y": true,
8
8
  "o11yUploadEndpoint": "https://794testsite.my.site.com/byolwr/webruntime/log/metrics",
9
9
  "dependencies": {
10
- "@salesforce/core": "^9.1.9",
10
+ "@salesforce/core": "^9.2.0",
11
11
  "@salesforce/sf-plugins-core": "^13.0.4",
12
- "@salesforce/templates": "^66.15.0"
12
+ "@salesforce/templates": "^66.16.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@oclif/plugin-command-snapshot": "^6.0.0",
16
16
  "@salesforce/cli-plugins-testkit": "^5.3.66",
17
- "@salesforce/dev-scripts": "^13.0.2",
17
+ "@salesforce/dev-scripts": "^14.0.0",
18
18
  "@salesforce/plugin-command-reference": "^3.1.132",
19
19
  "@types/chai": "^4.3.17",
20
20
  "@types/mocha": "^10.0.10",
@@ -22,11 +22,11 @@
22
22
  "@types/sinon": "^10.0.20",
23
23
  "@types/yeoman-assert": "^3.1.4",
24
24
  "eslint": "^10.4.0",
25
- "eslint-config-salesforce-typescript": "^6.0.0",
25
+ "eslint-config-salesforce-typescript": "^7.0.0",
26
26
  "eslint-plugin-sf-plugin": "^3.0.0",
27
27
  "oclif": "^5.0.0",
28
28
  "ts-node": "^10.9.2",
29
- "typescript": "^5.9.3",
29
+ "typescript": "^6.0.0",
30
30
  "yeoman-assert": "^3.1.1"
31
31
  },
32
32
  "homepage": "https://github.com/salesforcecli/plugin-templates",
@@ -259,7 +259,7 @@
259
259
  "exports": "./lib/index.js",
260
260
  "type": "module",
261
261
  "sfdx": {
262
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/57.3.0.crt",
263
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/57.3.0.sig"
262
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/57.4.1.crt",
263
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-templates/57.4.1.sig"
264
264
  }
265
265
  }