rflib-plugin 0.3.3 → 0.4.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.
@@ -50,10 +50,18 @@
50
50
  "type": "boolean"
51
51
  },
52
52
  "no-if": {
53
+ "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
53
54
  "name": "no-if",
54
55
  "summary": "Exclude the instrumentation of if-else statements.",
55
56
  "allowNo": false,
56
57
  "type": "boolean"
58
+ },
59
+ "skip-instrumented": {
60
+ "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib_Logger` reference.",
61
+ "name": "skip-instrumented",
62
+ "summary": "Skips any files where a logger is already present.",
63
+ "allowNo": false,
64
+ "type": "boolean"
57
65
  }
58
66
  },
59
67
  "hasDynamicHelp": false,
@@ -102,12 +110,12 @@
102
110
  "instrument:apex:logging:rflib"
103
111
  ]
104
112
  },
105
- "rflib:logging:aura:instrument": {
113
+ "rflib:logging:lwc:instrument": {
106
114
  "aliases": [],
107
115
  "args": {},
108
- "description": "Analyzes Aura Component files and adds RFLIB logging statements for:\n- Method entry logging with parameter values in Controller, Helper, and Renderer files\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Adds rflibLoggerCmp component if not present\n- Formats modified files using Prettier (optional)\n\nThe command processes:\n- Component (.cmp) files to add the logger component\n- Controller (.js) files for method instrumentation\n- Helper (.js) files for method instrumentation\n- Renderer (.js) files for method instrumentation",
116
+ "description": "Analyzes Lightning Web Component JavaScript files and adds RFLIB logging statements for:\n- Method entry logging with parameter values\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Condition logging in if/else blocks\n- Adds logger import if not present\n- Adds logger initialization if not present\n- Formats modified files using Prettier (optional)",
109
117
  "examples": [
110
- "- Add logging to all aura files:\n$ sf rflib logging aura instrument --sourcepath force-app\n\n- Preview changes:\n$ sf rflib logging aura instrument --sourcepath force-app --dryrun\n\n- Add logging and format code:\n$ sf rflib logging aura instrument --sourcepath force-app --prettier\n\n- Process specific component:\n$ sf rflib logging aura instrument --sourcepath force-app/main/default/aura/myComponent"
118
+ "- Add logging to all LWC files:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc\n\n- Preview changes:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --dryrun\n\n- Add logging and format code:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --prettier\n\n- Process specific component:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc/myComponent"
111
119
  ],
112
120
  "flags": {
113
121
  "json": {
@@ -127,10 +135,10 @@
127
135
  },
128
136
  "sourcepath": {
129
137
  "char": "s",
130
- "description": "Path to the source directory containing Aura components that should be instrumented with RFLIB logging statements. The command will:\n- Scan for 'aura' directories recursively\n- Process all Aura components found\n- Add <c:rflibLoggerCmp> to component files\n- Add logging statements to JavaScript files\n- Initialize logger in methods using component.find()",
138
+ "description": "Path to the source directory containing Lightning Web Component JavaScript files that should be instrumented with RFLIB logging statements. Aura component files are automatically excluded. The command will:\n- Process all .js files in the directory and subdirectories\n- Skip files in 'aura' directories\n- Add import statement: import { createLogger } from 'c/rflibLogger'\n- Add logger initialization: const logger = createLogger('ComponentName')",
131
139
  "name": "sourcepath",
132
140
  "required": true,
133
- "summary": "Directory containing Aura components to instrument with logging.",
141
+ "summary": "Directory containing LWC JavaScript files to instrument with logging.",
134
142
  "hasDynamicHelp": false,
135
143
  "multiple": false,
136
144
  "type": "option"
@@ -145,27 +153,35 @@
145
153
  },
146
154
  "prettier": {
147
155
  "char": "p",
148
- "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs\n- No trailing commas",
156
+ "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
149
157
  "name": "prettier",
150
158
  "summary": "Format modified files using Prettier.",
151
159
  "allowNo": false,
152
160
  "type": "boolean"
153
161
  },
154
162
  "no-if": {
163
+ "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
155
164
  "name": "no-if",
156
165
  "summary": "Exclude the instrumentation of if-else statements.",
157
166
  "allowNo": false,
158
167
  "type": "boolean"
168
+ },
169
+ "skip-instrumented": {
170
+ "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib` import statement.",
171
+ "name": "skip-instrumented",
172
+ "summary": "Skips any files where a logger is already present.",
173
+ "allowNo": false,
174
+ "type": "boolean"
159
175
  }
160
176
  },
161
177
  "hasDynamicHelp": false,
162
178
  "hiddenAliases": [],
163
- "id": "rflib:logging:aura:instrument",
179
+ "id": "rflib:logging:lwc:instrument",
164
180
  "pluginAlias": "rflib-plugin",
165
181
  "pluginName": "rflib-plugin",
166
182
  "pluginType": "core",
167
183
  "strict": true,
168
- "summary": "Instrument Aura Components with RFLIB logging statements automatically.",
184
+ "summary": "Instrument Lightning Web Components with RFLIB logging statements automatically.",
169
185
  "enableJsonFlag": true,
170
186
  "isESM": true,
171
187
  "relativePath": [
@@ -173,43 +189,43 @@
173
189
  "commands",
174
190
  "rflib",
175
191
  "logging",
176
- "aura",
192
+ "lwc",
177
193
  "instrument.js"
178
194
  ],
179
195
  "aliasPermutations": [],
180
196
  "permutations": [
181
- "rflib:logging:aura:instrument",
182
- "logging:rflib:aura:instrument",
183
- "logging:aura:rflib:instrument",
184
- "logging:aura:instrument:rflib",
185
- "rflib:aura:logging:instrument",
186
- "aura:rflib:logging:instrument",
187
- "aura:logging:rflib:instrument",
188
- "aura:logging:instrument:rflib",
189
- "rflib:aura:instrument:logging",
190
- "aura:rflib:instrument:logging",
191
- "aura:instrument:rflib:logging",
192
- "aura:instrument:logging:rflib",
193
- "rflib:logging:instrument:aura",
194
- "logging:rflib:instrument:aura",
195
- "logging:instrument:rflib:aura",
196
- "logging:instrument:aura:rflib",
197
- "rflib:instrument:logging:aura",
198
- "instrument:rflib:logging:aura",
199
- "instrument:logging:rflib:aura",
200
- "instrument:logging:aura:rflib",
201
- "rflib:instrument:aura:logging",
202
- "instrument:rflib:aura:logging",
203
- "instrument:aura:rflib:logging",
204
- "instrument:aura:logging:rflib"
197
+ "rflib:logging:lwc:instrument",
198
+ "logging:rflib:lwc:instrument",
199
+ "logging:lwc:rflib:instrument",
200
+ "logging:lwc:instrument:rflib",
201
+ "rflib:lwc:logging:instrument",
202
+ "lwc:rflib:logging:instrument",
203
+ "lwc:logging:rflib:instrument",
204
+ "lwc:logging:instrument:rflib",
205
+ "rflib:lwc:instrument:logging",
206
+ "lwc:rflib:instrument:logging",
207
+ "lwc:instrument:rflib:logging",
208
+ "lwc:instrument:logging:rflib",
209
+ "rflib:logging:instrument:lwc",
210
+ "logging:rflib:instrument:lwc",
211
+ "logging:instrument:rflib:lwc",
212
+ "logging:instrument:lwc:rflib",
213
+ "rflib:instrument:logging:lwc",
214
+ "instrument:rflib:logging:lwc",
215
+ "instrument:logging:rflib:lwc",
216
+ "instrument:logging:lwc:rflib",
217
+ "rflib:instrument:lwc:logging",
218
+ "instrument:rflib:lwc:logging",
219
+ "instrument:lwc:rflib:logging",
220
+ "instrument:lwc:logging:rflib"
205
221
  ]
206
222
  },
207
- "rflib:logging:lwc:instrument": {
223
+ "rflib:logging:aura:instrument": {
208
224
  "aliases": [],
209
225
  "args": {},
210
- "description": "Analyzes Lightning Web Component JavaScript files and adds RFLIB logging statements for:\n- Method entry logging with parameter values\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Condition logging in if/else blocks\n- Adds logger import if not present\n- Adds logger initialization if not present\n- Formats modified files using Prettier (optional)",
226
+ "description": "Analyzes Aura Component files and adds RFLIB logging statements for:\n- Method entry logging with parameter values in Controller, Helper, and Renderer files\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Adds rflibLoggerCmp component if not present\n- Formats modified files using Prettier (optional)\n\nThe command processes:\n- Component (.cmp) files to add the logger component\n- Controller (.js) files for method instrumentation\n- Helper (.js) files for method instrumentation\n- Renderer (.js) files for method instrumentation",
211
227
  "examples": [
212
- "- Add logging to all LWC files:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc\n\n- Preview changes:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --dryrun\n\n- Add logging and format code:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --prettier\n\n- Process specific component:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc/myComponent"
228
+ "- Add logging to all aura files:\n$ sf rflib logging aura instrument --sourcepath force-app\n\n- Preview changes:\n$ sf rflib logging aura instrument --sourcepath force-app --dryrun\n\n- Add logging and format code:\n$ sf rflib logging aura instrument --sourcepath force-app --prettier\n\n- Process specific component:\n$ sf rflib logging aura instrument --sourcepath force-app/main/default/aura/myComponent"
213
229
  ],
214
230
  "flags": {
215
231
  "json": {
@@ -229,10 +245,10 @@
229
245
  },
230
246
  "sourcepath": {
231
247
  "char": "s",
232
- "description": "Path to the source directory containing Lightning Web Component JavaScript files that should be instrumented with RFLIB logging statements. Aura component files are automatically excluded. The command will:\n- Process all .js files in the directory and subdirectories\n- Skip files in 'aura' directories\n- Add import statement: import { createLogger } from 'c/rflibLogger'\n- Add logger initialization: const logger = createLogger('ComponentName')",
248
+ "description": "Path to the source directory containing Aura components that should be instrumented with RFLIB logging statements. The command will:\n- Scan for 'aura' directories recursively\n- Process all Aura components found\n- Add <c:rflibLoggerCmp> to component files\n- Add logging statements to JavaScript files\n- Initialize logger in methods using component.find()",
233
249
  "name": "sourcepath",
234
250
  "required": true,
235
- "summary": "Directory containing LWC JavaScript files to instrument with logging.",
251
+ "summary": "Directory containing Aura components to instrument with logging.",
236
252
  "hasDynamicHelp": false,
237
253
  "multiple": false,
238
254
  "type": "option"
@@ -247,27 +263,35 @@
247
263
  },
248
264
  "prettier": {
249
265
  "char": "p",
250
- "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
266
+ "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs\n- No trailing commas",
251
267
  "name": "prettier",
252
268
  "summary": "Format modified files using Prettier.",
253
269
  "allowNo": false,
254
270
  "type": "boolean"
255
271
  },
256
272
  "no-if": {
273
+ "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
257
274
  "name": "no-if",
258
275
  "summary": "Exclude the instrumentation of if-else statements.",
259
276
  "allowNo": false,
260
277
  "type": "boolean"
278
+ },
279
+ "skip-instrumented": {
280
+ "description": "When provided, the command will not add log statements to any Aura component that contains the `` component.",
281
+ "name": "skip-instrumented",
282
+ "summary": "Skips any files where a logger is already present.",
283
+ "allowNo": false,
284
+ "type": "boolean"
261
285
  }
262
286
  },
263
287
  "hasDynamicHelp": false,
264
288
  "hiddenAliases": [],
265
- "id": "rflib:logging:lwc:instrument",
289
+ "id": "rflib:logging:aura:instrument",
266
290
  "pluginAlias": "rflib-plugin",
267
291
  "pluginName": "rflib-plugin",
268
292
  "pluginType": "core",
269
293
  "strict": true,
270
- "summary": "Instrument Lightning Web Components with RFLIB logging statements automatically.",
294
+ "summary": "Instrument Aura Components with RFLIB logging statements automatically.",
271
295
  "enableJsonFlag": true,
272
296
  "isESM": true,
273
297
  "relativePath": [
@@ -275,37 +299,37 @@
275
299
  "commands",
276
300
  "rflib",
277
301
  "logging",
278
- "lwc",
302
+ "aura",
279
303
  "instrument.js"
280
304
  ],
281
305
  "aliasPermutations": [],
282
306
  "permutations": [
283
- "rflib:logging:lwc:instrument",
284
- "logging:rflib:lwc:instrument",
285
- "logging:lwc:rflib:instrument",
286
- "logging:lwc:instrument:rflib",
287
- "rflib:lwc:logging:instrument",
288
- "lwc:rflib:logging:instrument",
289
- "lwc:logging:rflib:instrument",
290
- "lwc:logging:instrument:rflib",
291
- "rflib:lwc:instrument:logging",
292
- "lwc:rflib:instrument:logging",
293
- "lwc:instrument:rflib:logging",
294
- "lwc:instrument:logging:rflib",
295
- "rflib:logging:instrument:lwc",
296
- "logging:rflib:instrument:lwc",
297
- "logging:instrument:rflib:lwc",
298
- "logging:instrument:lwc:rflib",
299
- "rflib:instrument:logging:lwc",
300
- "instrument:rflib:logging:lwc",
301
- "instrument:logging:rflib:lwc",
302
- "instrument:logging:lwc:rflib",
303
- "rflib:instrument:lwc:logging",
304
- "instrument:rflib:lwc:logging",
305
- "instrument:lwc:rflib:logging",
306
- "instrument:lwc:logging:rflib"
307
+ "rflib:logging:aura:instrument",
308
+ "logging:rflib:aura:instrument",
309
+ "logging:aura:rflib:instrument",
310
+ "logging:aura:instrument:rflib",
311
+ "rflib:aura:logging:instrument",
312
+ "aura:rflib:logging:instrument",
313
+ "aura:logging:rflib:instrument",
314
+ "aura:logging:instrument:rflib",
315
+ "rflib:aura:instrument:logging",
316
+ "aura:rflib:instrument:logging",
317
+ "aura:instrument:rflib:logging",
318
+ "aura:instrument:logging:rflib",
319
+ "rflib:logging:instrument:aura",
320
+ "logging:rflib:instrument:aura",
321
+ "logging:instrument:rflib:aura",
322
+ "logging:instrument:aura:rflib",
323
+ "rflib:instrument:logging:aura",
324
+ "instrument:rflib:logging:aura",
325
+ "instrument:logging:rflib:aura",
326
+ "instrument:logging:aura:rflib",
327
+ "rflib:instrument:aura:logging",
328
+ "instrument:rflib:aura:logging",
329
+ "instrument:aura:rflib:logging",
330
+ "instrument:aura:logging:rflib"
307
331
  ]
308
332
  }
309
333
  },
310
- "version": "0.3.3"
334
+ "version": "0.4.0"
311
335
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rflib-plugin",
3
3
  "description": "Utility commands to help with the adoption of the RFLIB open-source library for Salesforce.",
4
- "version": "0.3.3",
4
+ "version": "0.4.0",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^4",
7
7
  "@salesforce/core": "^8",
@@ -13,7 +13,7 @@
13
13
  "@commitlint/cli": "^19.6.1",
14
14
  "@oclif/plugin-command-snapshot": "^5.2.26",
15
15
  "@salesforce/cli-plugins-testkit": "^5.3.10",
16
- "@salesforce/dev-scripts": "^10",
16
+ "@salesforce/dev-scripts": "^10.2.11",
17
17
  "eslint-plugin-sf-plugin": "^1.20.14",
18
18
  "husky": "^8.0.0",
19
19
  "oclif": "^4.17.13",
@@ -215,4 +215,4 @@
215
215
  "node": "20.17.0",
216
216
  "yarn": "1.22.22"
217
217
  }
218
- }
218
+ }