rflib-plugin 0.16.1 → 0.17.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/lib/commands/rflib/logging/apex/instrument.d.ts +1 -0
- package/lib/commands/rflib/logging/apex/instrument.js +9 -1
- package/lib/commands/rflib/logging/apex/instrument.js.map +1 -1
- package/lib/commands/rflib/logging/aura/instrument.js +1 -0
- package/lib/commands/rflib/logging/aura/instrument.js.map +1 -1
- package/lib/commands/rflib/logging/lwc/instrument.js +5 -3
- package/lib/commands/rflib/logging/lwc/instrument.js.map +1 -1
- package/lib/shared/types.d.ts +1 -0
- package/lib/shared/types.js.map +1 -1
- package/messages/rflib.logging.apex.instrument.md +8 -0
- package/oclif.lock +794 -828
- package/oclif.manifest.json +80 -73
- package/package.json +5 -5
package/oclif.manifest.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"rflib:logging:
|
|
3
|
+
"rflib:logging:apex:instrument": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {},
|
|
6
|
-
"description": "Analyzes
|
|
6
|
+
"description": "Analyzes Apex classes and adds RFLIB logging statements for method entry and error handling. Adds class-level logger initialization if not already present. \nFor Apex Test classes, the `@TestSetup` method will be updated to include `rflib_TestUtil.prepareLoggerForUnitTests();` to avoid test failures caused by the logging framework.",
|
|
7
7
|
"examples": [
|
|
8
|
-
"- Add logging to all
|
|
8
|
+
"- Add logging statements to all Apex classes in a directory:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes\n\n- Preview changes without modifying files:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes --dryrun\n\n- Add logging statements and format code:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes --prettier"
|
|
9
9
|
],
|
|
10
10
|
"flags": {
|
|
11
11
|
"json": {
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sourcepath": {
|
|
27
27
|
"char": "s",
|
|
28
|
-
"description": "Path to the source directory containing
|
|
28
|
+
"description": "Path to the source directory containing Apex classes that should be instrumented with RFLIB logging statements. Test classes (ending with 'Test.cls') are automatically excluded.",
|
|
29
29
|
"name": "sourcepath",
|
|
30
30
|
"required": true,
|
|
31
|
-
"summary": "Directory containing
|
|
31
|
+
"summary": "Directory containing Apex classes to instrument with logging.",
|
|
32
32
|
"hasDynamicHelp": false,
|
|
33
33
|
"multiple": false,
|
|
34
34
|
"type": "option"
|
|
35
35
|
},
|
|
36
36
|
"dryrun": {
|
|
37
37
|
"char": "d",
|
|
38
|
-
"description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.
|
|
38
|
+
"description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
|
|
39
39
|
"name": "dryrun",
|
|
40
40
|
"summary": "Preview changes without modifying files.",
|
|
41
41
|
"allowNo": false,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"prettier": {
|
|
45
45
|
"char": "p",
|
|
46
|
-
"description": "When enabled, formats the modified
|
|
46
|
+
"description": "When enabled, formats the modified Apex files using prettier-plugin-apex after adding logging statements. Maintains consistent code style with:\n\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
|
|
47
47
|
"name": "prettier",
|
|
48
48
|
"summary": "Format modified files using Prettier.",
|
|
49
49
|
"allowNo": false,
|
|
@@ -56,8 +56,15 @@
|
|
|
56
56
|
"allowNo": false,
|
|
57
57
|
"type": "boolean"
|
|
58
58
|
},
|
|
59
|
+
"no-catch": {
|
|
60
|
+
"description": "When provided, the command will not add error log statements inside of `catch` blocks.",
|
|
61
|
+
"name": "no-catch",
|
|
62
|
+
"summary": "Exclude the instrumentation of catch blocks.",
|
|
63
|
+
"allowNo": false,
|
|
64
|
+
"type": "boolean"
|
|
65
|
+
},
|
|
59
66
|
"skip-instrumented": {
|
|
60
|
-
"description": "When provided, the command will not add log statements to any
|
|
67
|
+
"description": "When provided, the command will not add log statements to any Apex class that contains the `rflib_Logger` reference.",
|
|
61
68
|
"name": "skip-instrumented",
|
|
62
69
|
"summary": "Skips any files where a logger is already present.",
|
|
63
70
|
"allowNo": false,
|
|
@@ -73,7 +80,7 @@
|
|
|
73
80
|
},
|
|
74
81
|
"exclude": {
|
|
75
82
|
"char": "e",
|
|
76
|
-
"description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.
|
|
83
|
+
"description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cls\" to skip auto-generated classes.",
|
|
77
84
|
"name": "exclude",
|
|
78
85
|
"summary": "Exclude files or directories from instrumentation based on a glob pattern.",
|
|
79
86
|
"hasDynamicHelp": false,
|
|
@@ -93,12 +100,12 @@
|
|
|
93
100
|
},
|
|
94
101
|
"hasDynamicHelp": false,
|
|
95
102
|
"hiddenAliases": [],
|
|
96
|
-
"id": "rflib:logging:
|
|
103
|
+
"id": "rflib:logging:apex:instrument",
|
|
97
104
|
"pluginAlias": "rflib-plugin",
|
|
98
105
|
"pluginName": "rflib-plugin",
|
|
99
106
|
"pluginType": "core",
|
|
100
107
|
"strict": true,
|
|
101
|
-
"summary": "Instrument
|
|
108
|
+
"summary": "Instrument Apex classes with RFLIB logging statements automatically.",
|
|
102
109
|
"enableJsonFlag": true,
|
|
103
110
|
"isESM": true,
|
|
104
111
|
"relativePath": [
|
|
@@ -106,43 +113,43 @@
|
|
|
106
113
|
"commands",
|
|
107
114
|
"rflib",
|
|
108
115
|
"logging",
|
|
109
|
-
"
|
|
116
|
+
"apex",
|
|
110
117
|
"instrument.js"
|
|
111
118
|
],
|
|
112
119
|
"aliasPermutations": [],
|
|
113
120
|
"permutations": [
|
|
114
|
-
"rflib:logging:
|
|
115
|
-
"logging:rflib:
|
|
116
|
-
"logging:
|
|
117
|
-
"logging:
|
|
118
|
-
"rflib:
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"rflib:
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"rflib:logging:instrument:
|
|
127
|
-
"logging:rflib:instrument:
|
|
128
|
-
"logging:instrument:rflib:
|
|
129
|
-
"logging:instrument:
|
|
130
|
-
"rflib:instrument:logging:
|
|
131
|
-
"instrument:rflib:logging:
|
|
132
|
-
"instrument:logging:rflib:
|
|
133
|
-
"instrument:logging:
|
|
134
|
-
"rflib:instrument:
|
|
135
|
-
"instrument:rflib:
|
|
136
|
-
"instrument:
|
|
137
|
-
"instrument:
|
|
121
|
+
"rflib:logging:apex:instrument",
|
|
122
|
+
"logging:rflib:apex:instrument",
|
|
123
|
+
"logging:apex:rflib:instrument",
|
|
124
|
+
"logging:apex:instrument:rflib",
|
|
125
|
+
"rflib:apex:logging:instrument",
|
|
126
|
+
"apex:rflib:logging:instrument",
|
|
127
|
+
"apex:logging:rflib:instrument",
|
|
128
|
+
"apex:logging:instrument:rflib",
|
|
129
|
+
"rflib:apex:instrument:logging",
|
|
130
|
+
"apex:rflib:instrument:logging",
|
|
131
|
+
"apex:instrument:rflib:logging",
|
|
132
|
+
"apex:instrument:logging:rflib",
|
|
133
|
+
"rflib:logging:instrument:apex",
|
|
134
|
+
"logging:rflib:instrument:apex",
|
|
135
|
+
"logging:instrument:rflib:apex",
|
|
136
|
+
"logging:instrument:apex:rflib",
|
|
137
|
+
"rflib:instrument:logging:apex",
|
|
138
|
+
"instrument:rflib:logging:apex",
|
|
139
|
+
"instrument:logging:rflib:apex",
|
|
140
|
+
"instrument:logging:apex:rflib",
|
|
141
|
+
"rflib:instrument:apex:logging",
|
|
142
|
+
"instrument:rflib:apex:logging",
|
|
143
|
+
"instrument:apex:rflib:logging",
|
|
144
|
+
"instrument:apex:logging:rflib"
|
|
138
145
|
]
|
|
139
146
|
},
|
|
140
|
-
"rflib:logging:
|
|
147
|
+
"rflib:logging:aura:instrument": {
|
|
141
148
|
"aliases": [],
|
|
142
149
|
"args": {},
|
|
143
|
-
"description": "Analyzes
|
|
150
|
+
"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- Replaces console.log and similar method invocations\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",
|
|
144
151
|
"examples": [
|
|
145
|
-
"- Add logging
|
|
152
|
+
"- 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"
|
|
146
153
|
],
|
|
147
154
|
"flags": {
|
|
148
155
|
"json": {
|
|
@@ -162,17 +169,17 @@
|
|
|
162
169
|
},
|
|
163
170
|
"sourcepath": {
|
|
164
171
|
"char": "s",
|
|
165
|
-
"description": "Path to the source directory containing
|
|
172
|
+
"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()",
|
|
166
173
|
"name": "sourcepath",
|
|
167
174
|
"required": true,
|
|
168
|
-
"summary": "Directory containing
|
|
175
|
+
"summary": "Directory containing Aura components to instrument with logging.",
|
|
169
176
|
"hasDynamicHelp": false,
|
|
170
177
|
"multiple": false,
|
|
171
178
|
"type": "option"
|
|
172
179
|
},
|
|
173
180
|
"dryrun": {
|
|
174
181
|
"char": "d",
|
|
175
|
-
"description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
|
|
182
|
+
"description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes. Shows:\n- Files that would be modified\n- Number of processed files\n- Number of modified files\n- Number of formatted files",
|
|
176
183
|
"name": "dryrun",
|
|
177
184
|
"summary": "Preview changes without modifying files.",
|
|
178
185
|
"allowNo": false,
|
|
@@ -180,7 +187,7 @@
|
|
|
180
187
|
},
|
|
181
188
|
"prettier": {
|
|
182
189
|
"char": "p",
|
|
183
|
-
"description": "When enabled, formats the modified
|
|
190
|
+
"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",
|
|
184
191
|
"name": "prettier",
|
|
185
192
|
"summary": "Format modified files using Prettier.",
|
|
186
193
|
"allowNo": false,
|
|
@@ -194,7 +201,7 @@
|
|
|
194
201
|
"type": "boolean"
|
|
195
202
|
},
|
|
196
203
|
"skip-instrumented": {
|
|
197
|
-
"description": "When provided, the command will not add log statements to any
|
|
204
|
+
"description": "When provided, the command will not add log statements to any Aura component that contains the `` component.",
|
|
198
205
|
"name": "skip-instrumented",
|
|
199
206
|
"summary": "Skips any files where a logger is already present.",
|
|
200
207
|
"allowNo": false,
|
|
@@ -210,7 +217,7 @@
|
|
|
210
217
|
},
|
|
211
218
|
"exclude": {
|
|
212
219
|
"char": "e",
|
|
213
|
-
"description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.
|
|
220
|
+
"description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cmp\" to skip auto-generated components.",
|
|
214
221
|
"name": "exclude",
|
|
215
222
|
"summary": "Exclude files or directories from instrumentation based on a glob pattern.",
|
|
216
223
|
"hasDynamicHelp": false,
|
|
@@ -230,12 +237,12 @@
|
|
|
230
237
|
},
|
|
231
238
|
"hasDynamicHelp": false,
|
|
232
239
|
"hiddenAliases": [],
|
|
233
|
-
"id": "rflib:logging:
|
|
240
|
+
"id": "rflib:logging:aura:instrument",
|
|
234
241
|
"pluginAlias": "rflib-plugin",
|
|
235
242
|
"pluginName": "rflib-plugin",
|
|
236
243
|
"pluginType": "core",
|
|
237
244
|
"strict": true,
|
|
238
|
-
"summary": "Instrument
|
|
245
|
+
"summary": "Instrument Aura Components with RFLIB logging statements automatically.",
|
|
239
246
|
"enableJsonFlag": true,
|
|
240
247
|
"isESM": true,
|
|
241
248
|
"relativePath": [
|
|
@@ -243,35 +250,35 @@
|
|
|
243
250
|
"commands",
|
|
244
251
|
"rflib",
|
|
245
252
|
"logging",
|
|
246
|
-
"
|
|
253
|
+
"aura",
|
|
247
254
|
"instrument.js"
|
|
248
255
|
],
|
|
249
256
|
"aliasPermutations": [],
|
|
250
257
|
"permutations": [
|
|
251
|
-
"rflib:logging:
|
|
252
|
-
"logging:rflib:
|
|
253
|
-
"logging:
|
|
254
|
-
"logging:
|
|
255
|
-
"rflib:
|
|
256
|
-
"
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"rflib:
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"
|
|
263
|
-
"rflib:logging:instrument:
|
|
264
|
-
"logging:rflib:instrument:
|
|
265
|
-
"logging:instrument:rflib:
|
|
266
|
-
"logging:instrument:
|
|
267
|
-
"rflib:instrument:logging:
|
|
268
|
-
"instrument:rflib:logging:
|
|
269
|
-
"instrument:logging:rflib:
|
|
270
|
-
"instrument:logging:
|
|
271
|
-
"rflib:instrument:
|
|
272
|
-
"instrument:rflib:
|
|
273
|
-
"instrument:
|
|
274
|
-
"instrument:
|
|
258
|
+
"rflib:logging:aura:instrument",
|
|
259
|
+
"logging:rflib:aura:instrument",
|
|
260
|
+
"logging:aura:rflib:instrument",
|
|
261
|
+
"logging:aura:instrument:rflib",
|
|
262
|
+
"rflib:aura:logging:instrument",
|
|
263
|
+
"aura:rflib:logging:instrument",
|
|
264
|
+
"aura:logging:rflib:instrument",
|
|
265
|
+
"aura:logging:instrument:rflib",
|
|
266
|
+
"rflib:aura:instrument:logging",
|
|
267
|
+
"aura:rflib:instrument:logging",
|
|
268
|
+
"aura:instrument:rflib:logging",
|
|
269
|
+
"aura:instrument:logging:rflib",
|
|
270
|
+
"rflib:logging:instrument:aura",
|
|
271
|
+
"logging:rflib:instrument:aura",
|
|
272
|
+
"logging:instrument:rflib:aura",
|
|
273
|
+
"logging:instrument:aura:rflib",
|
|
274
|
+
"rflib:instrument:logging:aura",
|
|
275
|
+
"instrument:rflib:logging:aura",
|
|
276
|
+
"instrument:logging:rflib:aura",
|
|
277
|
+
"instrument:logging:aura:rflib",
|
|
278
|
+
"rflib:instrument:aura:logging",
|
|
279
|
+
"instrument:rflib:aura:logging",
|
|
280
|
+
"instrument:aura:rflib:logging",
|
|
281
|
+
"instrument:aura:logging:rflib"
|
|
275
282
|
]
|
|
276
283
|
},
|
|
277
284
|
"rflib:logging:flow:instrument": {
|
|
@@ -536,5 +543,5 @@
|
|
|
536
543
|
]
|
|
537
544
|
}
|
|
538
545
|
},
|
|
539
|
-
"version": "0.
|
|
546
|
+
"version": "0.17.1"
|
|
540
547
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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.
|
|
4
|
+
"version": "0.17.1",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^4.8.0",
|
|
7
|
-
"@salesforce/core": "^8.26.
|
|
7
|
+
"@salesforce/core": "^8.26.3",
|
|
8
8
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
9
9
|
"@types/xml2js": "^0.4.14",
|
|
10
|
-
"minimatch": "^10.2.
|
|
10
|
+
"minimatch": "^10.2.4",
|
|
11
11
|
"prettier": "^3.8.1",
|
|
12
12
|
"prettier-plugin-apex": "^2.2.6",
|
|
13
13
|
"wireit": "^0.14.12",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@eslint/eslintrc": "^2.1.4",
|
|
19
19
|
"@eslint/js": "^8.57.1",
|
|
20
20
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
21
|
-
"@oclif/plugin-command-snapshot": "^5.3.
|
|
21
|
+
"@oclif/plugin-command-snapshot": "^5.3.10",
|
|
22
22
|
"@salesforce/cli-plugins-testkit": "^5.3.41",
|
|
23
23
|
"@salesforce/dev-scripts": "^11.0.4",
|
|
24
24
|
"@types/minimatch": "^5.1.2",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"eslint": "^8.57.1",
|
|
27
27
|
"eslint-plugin-sf-plugin": "^1.20.33",
|
|
28
28
|
"husky": "^9.1.7",
|
|
29
|
-
"oclif": "^4.22.
|
|
29
|
+
"oclif": "^4.22.85",
|
|
30
30
|
"source-map-support": "^0.5.21",
|
|
31
31
|
"ts-node": "^10.9.2",
|
|
32
32
|
"tsconfig-paths": "^4.2.0",
|