@salesforce/plugin-templates 55.1.0 → 55.2.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/LICENSE.txt +12 -0
- package/README.md +495 -17
- package/bin/dev +7 -3
- package/bin/run +3 -2
- package/lib/commands/force/project/create.js +1 -0
- package/lib/commands/force/project/create.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/messageUtil.d.ts +4 -1
- package/lib/utils/messageUtil.js +5 -2
- package/lib/utils/messageUtil.js.map +1 -1
- package/lib/utils/templateCommand.d.ts +3 -3
- package/lib/utils/templateCommand.js +12 -9
- package/lib/utils/templateCommand.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +77 -25
- package/yarn.lock +1185 -320
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2022, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
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.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/forcedotcom/salesforcedx-templates/blob/master/package.json)
|
|
5
|
+
[](https://snyk.io/test/github/salesforcecli/plugin-templates)
|
|
6
|
+
[](https://github.com/salesforcecli/plugin-templates/blob/master/package.json)
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
# Getting Started
|
|
10
9
|
|
|
11
10
|
To use, install the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli) and run the following commands.
|
|
12
11
|
|
|
@@ -19,15 +18,494 @@ To run a command
|
|
|
19
18
|
$ sfdx [command]
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
##
|
|
21
|
+
## Install
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
1. Clone the repository, and `cd` into it.
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
git clone git@github.com:salesforcecli/plugin-templates.git
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. Ensure you have [Yarn](https://yarnpkg.com/) installed and run the following to build:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
yarn install
|
|
33
|
+
yarn build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Issues
|
|
37
|
+
|
|
38
|
+
Please report any issues to https://github.com/salesforcecli/plugin-templates/issues or https://github.com/forcedotcom/cli/issues.
|
|
39
|
+
|
|
40
|
+
## Contributing
|
|
41
|
+
|
|
42
|
+
1. Familiarize yourself with the codebase by reading the docs and the templates [library](https://github.com/salesforcecli/plugin-templates).
|
|
43
|
+
1. Create a new issue before starting your project so that we can keep track of
|
|
44
|
+
what you're trying to add/fix. That way, we can also offer suggestions or
|
|
45
|
+
let you know if there is already an effort in progress.
|
|
46
|
+
1. Fork this repository.
|
|
47
|
+
1. The [build](#build) section has details on how to set up your environment.
|
|
48
|
+
1. Create a _topic_ branch in your fork based on the correct branch (usually the **main** branch). Note: this step is recommended but technically not required if contributing using a fork.
|
|
49
|
+
1. Edit the code in your fork.
|
|
50
|
+
1. Sign CLA (see [CLA](#cla)).
|
|
51
|
+
1. Send us a pull request when you're done. We'll review your code, suggest any
|
|
52
|
+
needed changes, and merge it in.
|
|
53
|
+
|
|
54
|
+
## Pull Requests
|
|
55
|
+
|
|
56
|
+
### Committing
|
|
57
|
+
|
|
58
|
+
1. We enforce commit message format using [commitizen](https://github.com/commitizen/cz-cli). To ensure correct formatting, use our VS Code Task `Commit`. with `yarn run commit`.
|
|
59
|
+
1. The commit message format that we expect is: `type: commit message`. Valid types are: feat, fix, improvement, docs, style, refactor, perf, test, build, ci, chore and revert.
|
|
60
|
+
1. Before commit and push, Husky runs several hooks to ensure the commit message is in the correct format and that everything lints and compiles properly.
|
|
61
|
+
|
|
62
|
+
## CLA
|
|
63
|
+
|
|
64
|
+
External contributors will be required to sign a Contributor's License
|
|
65
|
+
Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
|
|
66
|
+
|
|
67
|
+
# Build
|
|
68
|
+
|
|
69
|
+
## Developing Plugin
|
|
70
|
+
|
|
71
|
+
To test plugin locally, use `bin/dev` in place of `sfdx`. For example:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
./bin/dev force:apex:class:create --classname 'TestClass' --template 'DefaultApexClass' --outputdir ./testsoutput/myApex/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Link your plugin to Salesforce CLI:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
sfdx plugins:link .
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Verify plugin is linked:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
sfdx plugins
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
To test plugin locally with Salesforce CLI, add `"@salesforce/plugin-templates": "file://path/to/plugin-templates"` to the plugin's `package.json`.
|
|
90
|
+
|
|
91
|
+
## Debugging Your Plugin
|
|
92
|
+
|
|
93
|
+
We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the `.vscode` directory of this plugin is a `launch.json` config file, which allows you to attach a debugger to the node process when running your commands.
|
|
94
|
+
|
|
95
|
+
To debug the `hello:org` command:
|
|
96
|
+
|
|
97
|
+
1. If you linked your plugin to the Salesforce CLI, call your command with the `dev-suspend` switch:
|
|
98
|
+
|
|
99
|
+
```sh-session
|
|
100
|
+
$ sfdx hello:org -u myOrg@example.com --dev-suspend
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Alternatively, to call your command using the `bin/dev` script, set the `NODE_OPTIONS` environment variable to `--inspect-brk` when starting the debugger:
|
|
104
|
+
|
|
105
|
+
```sh-session
|
|
106
|
+
$ NODE_OPTIONS=--inspect-brk ./bin/dev force:apex:class:create --classname 'TestClass' --template 'DefaultApexClass' --outputdir ./testsoutput/myApex/
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
2. Set some breakpoints in your command code.
|
|
110
|
+
3. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
|
|
111
|
+
4. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration is selected.
|
|
112
|
+
5. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
|
|
113
|
+
6. Hit the green play button at the top middle of VS Code (this play button is to the right of the play button that you clicked in step #5).
|
|
114
|
+
|
|
115
|
+
Congrats, you are debugging!
|
|
116
|
+
|
|
117
|
+
# Commands
|
|
118
|
+
|
|
119
|
+
A list of the available commands
|
|
120
|
+
|
|
121
|
+
#### `sfdx force:apex:class:create`
|
|
122
|
+
|
|
123
|
+
create an Apex class
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
USAGE
|
|
127
|
+
$ sfdx force:apex:class:create -n <string> [-d <string>] [-t <string>] [--apiversion <string>] [--json] [--loglevel
|
|
128
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
129
|
+
|
|
130
|
+
OPTIONS
|
|
131
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
132
|
+
|
|
133
|
+
-n, --classname=classname(required) name of the generated Apex class
|
|
134
|
+
|
|
135
|
+
-t, --template=ApexException|ApexUnitTest|DefaultApexClass|InboundEmailService [default: DefaultApexClass] template
|
|
136
|
+
to use for file creation
|
|
137
|
+
|
|
138
|
+
--apiversion=apiversion override the api version used for
|
|
139
|
+
api requests made by this command
|
|
140
|
+
|
|
141
|
+
--json format output as json
|
|
142
|
+
|
|
143
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
144
|
+
this command invocation
|
|
145
|
+
|
|
146
|
+
DESCRIPTION
|
|
147
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
148
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
149
|
+
|
|
150
|
+
EXAMPLES
|
|
151
|
+
$ sfdx force:apex:class:create -n MyClass
|
|
152
|
+
$ sfdx force:apex:class:create -n MyClass -d classes
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
_See code: [src/commands/force/apex/class/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/apex/class/create.ts)_
|
|
156
|
+
|
|
157
|
+
#### `sfdx force:apex:trigger:create`
|
|
158
|
+
|
|
159
|
+
create an Apex trigger
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
USAGE
|
|
163
|
+
$ sfdx force:apex:trigger:create -n <string> [-d <string>] [-e <string>] [-s <string>] [-t <string>] [--apiversion
|
|
164
|
+
<string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
165
|
+
|
|
166
|
+
OPTIONS
|
|
167
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
168
|
+
|
|
169
|
+
-e, --triggerevents=before insert|before update|before delete|after insert|after update|after delete|after undelete
|
|
170
|
+
[default: before insert] events that fire the trigger
|
|
171
|
+
|
|
172
|
+
-n, --triggername=triggername (required) name of the generated Apex trigger
|
|
173
|
+
|
|
174
|
+
-s, --sobject=sobject [default: SOBJECT] sObject to create a trigger on
|
|
175
|
+
|
|
176
|
+
-t, --template=ApexTrigger [default: ApexTrigger] template to use for file creation
|
|
177
|
+
|
|
178
|
+
--apiversion=apiversion override the api version used for api requests made by this command
|
|
179
|
+
|
|
180
|
+
--json format output as json
|
|
181
|
+
|
|
182
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation
|
|
183
|
+
|
|
184
|
+
DESCRIPTION
|
|
185
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
186
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
187
|
+
|
|
188
|
+
EXAMPLES
|
|
189
|
+
$ sfdx force:apex:trigger:create -n MyTrigger
|
|
190
|
+
$ sfdx force:apex:trigger:create -n MyTrigger -s Account -e 'before insert, after upsert'
|
|
191
|
+
$ sfdx force:apex:trigger:create -n MyTrigger -d triggers
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
_See code: [src/commands/force/apex/trigger/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/apex/trigger/create.ts)_
|
|
195
|
+
|
|
196
|
+
#### `sfdx force:lightning:app:create`
|
|
197
|
+
|
|
198
|
+
create a Lightning app
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
USAGE
|
|
202
|
+
$ sfdx force:lightning:app:create -n <string> [-d <string>] [-t <string>] [--apiversion <string>] [--json] [--loglevel
|
|
203
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
204
|
+
|
|
205
|
+
OPTIONS
|
|
206
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
207
|
+
|
|
208
|
+
-n, --appname=appname (required) name of the generated
|
|
209
|
+
Lightning app
|
|
210
|
+
|
|
211
|
+
-t, --template=DefaultLightningApp [default: DefaultLightningApp]
|
|
212
|
+
template to use for file creation
|
|
213
|
+
|
|
214
|
+
--apiversion=apiversion override the api version used for
|
|
215
|
+
api requests made by this command
|
|
216
|
+
|
|
217
|
+
--json format output as json
|
|
218
|
+
|
|
219
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
220
|
+
this command invocation
|
|
221
|
+
|
|
222
|
+
DESCRIPTION
|
|
223
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
224
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
225
|
+
If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your
|
|
226
|
+
bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we
|
|
227
|
+
create force-app/myBundle/ to store the files in the bundle.
|
|
228
|
+
|
|
229
|
+
EXAMPLES
|
|
230
|
+
$ sfdx force:lightning:app:create -n myapp
|
|
231
|
+
$ sfdx force:lightning:app:create -n myapp -d aura
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
_See code: [src/commands/force/lightning/app/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/lightning/app/create.ts)_
|
|
235
|
+
|
|
236
|
+
#### `sfdx force:lightning:component:create`
|
|
237
|
+
|
|
238
|
+
create a bundle for an Aura component or a Lightning web component
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
USAGE
|
|
242
|
+
$ sfdx force:lightning:component:create -n <string> [-d <string>] [-t <string>] [--type <string>] [--apiversion
|
|
243
|
+
<string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
244
|
+
|
|
245
|
+
OPTIONS
|
|
246
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
247
|
+
|
|
248
|
+
-n, --componentname=componentname (required) name of the generated
|
|
249
|
+
Lightning component
|
|
250
|
+
|
|
251
|
+
-t, --template= [default: DefaultLightningCmp]
|
|
252
|
+
template to use for file creation
|
|
253
|
+
|
|
254
|
+
--apiversion=apiversion override the api version used for
|
|
255
|
+
api requests made by this command
|
|
256
|
+
|
|
257
|
+
--json format output as json
|
|
258
|
+
|
|
259
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
260
|
+
this command invocation
|
|
261
|
+
|
|
262
|
+
--type=aura|lwc [default: aura] type of the
|
|
263
|
+
Lightning component
|
|
264
|
+
|
|
265
|
+
DESCRIPTION
|
|
266
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
267
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
268
|
+
If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your
|
|
269
|
+
bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we
|
|
270
|
+
create force-app/myBundle/ to store the files in the bundle.
|
|
271
|
+
To create a Lightning web component, pass --type lwc to the command. If you don’t include a --type value, Salesforce
|
|
272
|
+
CLI creates an Aura component by default.
|
|
273
|
+
|
|
274
|
+
EXAMPLES
|
|
275
|
+
$ sfdx force:lightning:component:create -n mycomponent
|
|
276
|
+
$ sfdx force:lightning:component:create -n mycomponent --type lwc
|
|
277
|
+
$ sfdx force:lightning:component:create -n mycomponent -d aura
|
|
278
|
+
$ sfdx force:lightning:component:create -n mycomponent --type lwc -d lwc
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
_See code: [src/commands/force/lightning/component/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/lightning/component/create.ts)_
|
|
282
|
+
|
|
283
|
+
#### `sfdx force:lightning:event:create`
|
|
284
|
+
|
|
285
|
+
create a Lightning event
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
USAGE
|
|
289
|
+
$ sfdx force:lightning:event:create -n <string> [-d <string>] [-t <string>] [--apiversion <string>] [--json]
|
|
290
|
+
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
291
|
+
|
|
292
|
+
OPTIONS
|
|
293
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
294
|
+
|
|
295
|
+
-n, --eventname=eventname (required) name of the generated
|
|
296
|
+
Lightning event
|
|
297
|
+
|
|
298
|
+
-t, --template=DefaultLightningEvt [default: DefaultLightningEvt]
|
|
299
|
+
template to use for file creation
|
|
300
|
+
|
|
301
|
+
--apiversion=apiversion override the api version used for
|
|
302
|
+
api requests made by this command
|
|
303
|
+
|
|
304
|
+
--json format output as json
|
|
305
|
+
|
|
306
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
307
|
+
this command invocation
|
|
308
|
+
|
|
309
|
+
DESCRIPTION
|
|
310
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
311
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
312
|
+
If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your
|
|
313
|
+
bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we
|
|
314
|
+
create force-app/myBundle/ to store the files in the bundle.
|
|
315
|
+
|
|
316
|
+
EXAMPLES
|
|
317
|
+
$ sfdx force:lightning:app:create -n myevent
|
|
318
|
+
$ sfdx force:lightning:event:create -n myevent -d aura
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
_See code: [src/commands/force/lightning/event/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/lightning/event/create.ts)_
|
|
322
|
+
|
|
323
|
+
#### `sfdx force:lightning:interface:create`
|
|
324
|
+
|
|
325
|
+
create a Lightning interface
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
USAGE
|
|
329
|
+
$ sfdx force:lightning:interface:create -n <string> [-d <string>] [-t <string>] [--apiversion <string>] [--json]
|
|
330
|
+
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
331
|
+
|
|
332
|
+
OPTIONS
|
|
333
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
334
|
+
|
|
335
|
+
-n, --interfacename=interfacename (required) name of the generated
|
|
336
|
+
Lightning interface
|
|
337
|
+
|
|
338
|
+
-t, --template=DefaultLightningIntf [default: DefaultLightningIntf]
|
|
339
|
+
template to use for file creation
|
|
340
|
+
|
|
341
|
+
--apiversion=apiversion override the api version used for
|
|
342
|
+
api requests made by this command
|
|
343
|
+
|
|
344
|
+
--json format output as json
|
|
345
|
+
|
|
346
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
347
|
+
this command invocation
|
|
348
|
+
|
|
349
|
+
DESCRIPTION
|
|
350
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
351
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
352
|
+
If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your
|
|
353
|
+
bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we
|
|
354
|
+
create force-app/myBundle/ to store the files in the bundle.
|
|
355
|
+
|
|
356
|
+
EXAMPLES
|
|
357
|
+
$ sfdx force:lightning:interface:create -n myinterface
|
|
358
|
+
$ sfdx force:lightning:interface:create -n myinterface -d aura
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
_See code: [src/commands/force/lightning/interface/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/lightning/interface/create.ts)_
|
|
362
|
+
|
|
363
|
+
#### `sfdx force:lightning:test:create`
|
|
364
|
+
|
|
365
|
+
create a Lightning test
|
|
366
|
+
|
|
367
|
+
```
|
|
368
|
+
USAGE
|
|
369
|
+
$ sfdx force:lightning:test:create -n <string> [-d <string>] [-t <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
370
|
+
|
|
371
|
+
OPTIONS
|
|
372
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
373
|
+
-n, --testname=testname (required) name of the generated Lightning test
|
|
374
|
+
-t, --template=DefaultLightningTest [default: DefaultLightningTest] template to use for file creation
|
|
375
|
+
--json format output as json
|
|
376
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation
|
|
377
|
+
|
|
378
|
+
DESCRIPTION
|
|
379
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
380
|
+
|
|
381
|
+
EXAMPLES
|
|
382
|
+
$ sfdx force:lightning:test:create -n MyLightningTest
|
|
383
|
+
$ sfdx force:lightning:test:create -n MyLightningTest -d lightningTests
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
_See code: [src/commands/force/lightning/test/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/lightning/test/create.ts)_
|
|
387
|
+
|
|
388
|
+
#### `sfdx force:project:create`
|
|
389
|
+
|
|
390
|
+
create a Salesforce DX project
|
|
391
|
+
|
|
392
|
+
```
|
|
393
|
+
USAGE
|
|
394
|
+
$ sfdx force:project:create -n <string> [-d <string>] [-p <string>] [-s <string>] [-t <string>] [-x] [--json]
|
|
395
|
+
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
396
|
+
|
|
397
|
+
OPTIONS
|
|
398
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
399
|
+
|
|
400
|
+
-n, --projectname=projectname (required) name of the generated
|
|
401
|
+
project
|
|
402
|
+
|
|
403
|
+
-p, --defaultpackagedir=defaultpackagedir [default: force-app] default package
|
|
404
|
+
directory name
|
|
405
|
+
|
|
406
|
+
-s, --namespace=namespace project associated namespace
|
|
407
|
+
|
|
408
|
+
-t, --template=standard|empty|analytics [default: standard] template to use
|
|
409
|
+
for file creation
|
|
410
|
+
|
|
411
|
+
-x, --manifest generate a manifest (package.xml)
|
|
412
|
+
for change-set based development
|
|
413
|
+
|
|
414
|
+
--json format output as json
|
|
415
|
+
|
|
416
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
417
|
+
this command invocation
|
|
418
|
+
|
|
419
|
+
DESCRIPTION
|
|
420
|
+
Default values are used if the template, namespace, defaultpackagedir, and outputdir aren’t supplied.
|
|
421
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
422
|
+
|
|
423
|
+
EXAMPLES
|
|
424
|
+
$ sfdx force:project:create --projectname mywork
|
|
425
|
+
$ sfdx force:project:create --projectname mywork --defaultpackagedir myapp
|
|
426
|
+
$ sfdx force:project:create --projectname mywork --defaultpackagedir myapp --manifest
|
|
427
|
+
$ sfdx force:project:create --projectname mywork --template empty
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
_See code: [src/commands/force/project/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/project/create.ts)_
|
|
431
|
+
|
|
432
|
+
#### `sfdx force:visualforce:component:create`
|
|
433
|
+
|
|
434
|
+
create a Visualforce component
|
|
435
|
+
|
|
436
|
+
```
|
|
437
|
+
USAGE
|
|
438
|
+
$ sfdx force:visualforce:component:create -n <string> -l <string> [-d <string>] [-t <string>] [--apiversion <string>]
|
|
439
|
+
[--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
440
|
+
|
|
441
|
+
OPTIONS
|
|
442
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
443
|
+
|
|
444
|
+
-l, --label=label (required) Visualforce component
|
|
445
|
+
label
|
|
446
|
+
|
|
447
|
+
-n, --componentname=componentname (required) name of the generated
|
|
448
|
+
Visualforce component
|
|
449
|
+
|
|
450
|
+
-t, --template=DefaultVFComponent [default: DefaultVFComponent]
|
|
451
|
+
template to use for file creation
|
|
452
|
+
|
|
453
|
+
--apiversion=apiversion override the api version used for
|
|
454
|
+
api requests made by this command
|
|
455
|
+
|
|
456
|
+
--json format output as json
|
|
457
|
+
|
|
458
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
459
|
+
this command invocation
|
|
460
|
+
|
|
461
|
+
DESCRIPTION
|
|
462
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
463
|
+
The outputdir can be an absolute path or relative to the current working directory.
|
|
464
|
+
Name and label are required.
|
|
465
|
+
|
|
466
|
+
EXAMPLES
|
|
467
|
+
$ sfdx force:visualforce:component:create -n mycomponent -l mylabel
|
|
468
|
+
$ sfdx force:visualforce:component:create -n mycomponent -l mylabel -d components
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
_See code: [src/commands/force/visualforce/component/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/visualforce/component/create.ts)_
|
|
472
|
+
|
|
473
|
+
#### `sfdx force:visualforce:page:create`
|
|
474
|
+
|
|
475
|
+
create a Visualforce page
|
|
476
|
+
|
|
477
|
+
```
|
|
478
|
+
USAGE
|
|
479
|
+
$ sfdx force:visualforce:page:create -n <string> -l <string> [-d <string>] [-t <string>] [--apiversion <string>]
|
|
480
|
+
[--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
481
|
+
|
|
482
|
+
OPTIONS
|
|
483
|
+
-d, --outputdir=outputdir folder for saving the created files
|
|
484
|
+
|
|
485
|
+
-l, --label=label (required) Visualforce page label
|
|
486
|
+
|
|
487
|
+
-n, --pagename=pagename (required) name of the generated
|
|
488
|
+
Visualforce page
|
|
489
|
+
|
|
490
|
+
-t, --template=DefaultVFPage [default: DefaultVFPage] template to
|
|
491
|
+
use for file creation
|
|
492
|
+
|
|
493
|
+
--apiversion=apiversion override the api version used for
|
|
494
|
+
api requests made by this command
|
|
495
|
+
|
|
496
|
+
--json format output as json
|
|
497
|
+
|
|
498
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
499
|
+
this command invocation
|
|
500
|
+
|
|
501
|
+
DESCRIPTION
|
|
502
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
503
|
+
If not supplied, the apiversion, template, and outputdir use default values.
|
|
504
|
+
Name and label are required.
|
|
505
|
+
|
|
506
|
+
EXAMPLES
|
|
507
|
+
$ sfdx force:visualforce:page:create -n mypage -l mylabel
|
|
508
|
+
$ sfdx force:visualforce:page:create -n mypage -l mylabel -d pages
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
_See code: [src/commands/force/visualforce/page/create.ts](https://github.com/salesforcecli/plugin-templates/blob/master/src/commands/force/visualforce/page/create.ts)_
|
package/bin/dev
CHANGED
|
@@ -8,10 +8,14 @@ const project = path.join(__dirname, '..', 'tsconfig.json');
|
|
|
8
8
|
// In dev mode -> use ts-node and dev plugins
|
|
9
9
|
process.env.NODE_ENV = 'development';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// Enable SWC for faster typescript compiling
|
|
12
|
+
require('ts-node').register({ project, swc: true });
|
|
12
13
|
|
|
13
14
|
// In dev mode, always show stack traces
|
|
14
|
-
oclif
|
|
15
|
+
const g = (global.oclif = global.oclif || {});
|
|
16
|
+
|
|
17
|
+
// In dev mode, always show stack traces
|
|
18
|
+
global.oclif.debug = true;
|
|
15
19
|
|
|
16
20
|
// Start the CLI
|
|
17
|
-
oclif.run().then(oclif
|
|
21
|
+
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
|
package/bin/run
CHANGED
|
@@ -14,6 +14,7 @@ class Project extends utils_1.TemplateCommand {
|
|
|
14
14
|
run() {
|
|
15
15
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
// namespace is a reserved keyword for the generator
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
17
18
|
this.flags.ns = this.flags.namespace;
|
|
18
19
|
return this.runGenerator(projectGenerator_1.default);
|
|
19
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/force/project/create.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iDAA4C;AAC5C,4FAAqF;AAErF,0CAA8D;AAE9D,MAAqB,OAAQ,SAAQ,uBAAe;IAwDrC,GAAG;;YACd,oDAAoD;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/force/project/create.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iDAA4C;AAC5C,4FAAqF;AAErF,0CAA8D;AAE9D,MAAqB,OAAQ,SAAQ,uBAAe;IAwDrC,GAAG;;YACd,oDAAoD;YACpD,mEAAmE;YACnE,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YAErC,OAAO,IAAI,CAAC,YAAY,CAAC,0BAAgB,CAAC,CAAC;QAC7C,CAAC;KAAA;;AA9DH,0BA+DC;AA9De,mBAAW,GAAG,mBAAW,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;AACxE,gBAAQ,GAAG;IACvB,kDAAkD;IAClD,4EAA4E;IAC5E,uFAAuF;IACvF,mEAAmE;CACpE,CAAC;AACY,YAAI,GAAG,mBAAW,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC1D,uBAAe,GAAG,mBAAW,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAEzD,mBAAW,GAAG;IAC7B,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAC1D,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,gCAAgC,CAAC;QAClE,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,gCAAgC,CAAC;QAC9D,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,oCAAoC,CAAC;QACtE,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC;KAC5C,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,0BAA0B,CAAC;QACxD,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,8BAA8B,CAAC;QAChE,OAAO,EAAE,GAAG;KACb,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,iCAAiC,CAAC;QAC/D,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,qCAAqC,CAAC;QACvE,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,iBAAiB,EAAE,eAAK,CAAC,MAAM,CAAC;QAC9B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,+BAA+B,CAAC;QAC7D,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,mCAAmC,CAAC;QACrE,OAAO,EAAE,WAAW;KACrB,CAAC;IACF,QAAQ,EAAE,eAAK,CAAC,OAAO,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,gCAAgC,CAAC;QAC9D,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,oCAAoC,CAAC;KACvE,CAAC;IACF,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAW,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAC1D,eAAe,EAAE,mBAAW,CAAC,GAAG,CAAC,gCAAgC,CAAC;QAClE,OAAO,EAAE,8BAA8B;QACvC,MAAM,EAAE,IAAI;KACb,CAAC;CACH,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (c)
|
|
4
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
5
5
|
* All rights reserved.
|
|
6
6
|
* Licensed under the BSD 3-Clause license.
|
|
7
7
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
package/lib/utils/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TemplateCommand = exports.MessageUtil = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export declare type Token = string | number | boolean;
|
|
2
2
|
export declare class MessageUtil {
|
|
3
|
+
private static messages;
|
|
3
4
|
/**
|
|
4
5
|
* Get the message for a given key
|
|
6
|
+
*
|
|
5
7
|
* @param key The key of the message
|
|
6
8
|
* @param tokens The values to substitute in the message
|
|
7
9
|
*/
|
|
8
10
|
static get(key: string, tokens?: Token[]): string;
|
|
9
11
|
/**
|
|
10
12
|
* Get the description used in the --help output for the command
|
|
13
|
+
*
|
|
11
14
|
* @param descriptionKey The message key for the description text
|
|
12
15
|
* @param isLightningBundle If the command is for a lightning bundle
|
|
13
16
|
* @param tokens The values to substitute in the message
|
|
@@ -20,11 +23,11 @@ export declare class MessageUtil {
|
|
|
20
23
|
* **USE `buildDescription` FOR SETTING THE `description` PROPERTY OF
|
|
21
24
|
* A COMMAND. THIS IS EXCLUSIVELY USED TO SET THE `help` PROPERTY ON THE COMMAND FOR
|
|
22
25
|
* DOC GENERATING PURPOSES AND IS NOT SHOWN IN THE --help OUTPUT.**
|
|
26
|
+
*
|
|
23
27
|
* @param examples Example uses of the command
|
|
24
28
|
* @param isLightningBundle If the command is for a lightning bundle
|
|
25
29
|
* @param extra Extra text to append to the help message before the examples
|
|
26
30
|
*/
|
|
27
31
|
static buildHelpText(examples: string[], isLightningBundle: boolean, extra?: string): string;
|
|
28
|
-
private static messages;
|
|
29
32
|
private static getHelpHead;
|
|
30
33
|
}
|