rflib-plugin 0.17.4 → 0.18.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.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "commands": {
3
- "rflib:logging:apex:instrument": {
3
+ "rflib:logging:aura:instrument": {
4
4
  "aliases": [],
5
5
  "args": {},
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.",
6
+ "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",
7
7
  "examples": [
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"
8
+ "- 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"
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 Apex classes that should be instrumented with RFLIB logging statements. Test classes (ending with 'Test.cls') are automatically excluded.",
28
+ "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()",
29
29
  "name": "sourcepath",
30
30
  "required": true,
31
- "summary": "Directory containing Apex classes to instrument with logging.",
31
+ "summary": "Directory containing Aura components 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. Shows:\n- Files that would be modified\n- Number of processed files\n- Number of modified files\n- Number of formatted files",
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 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",
46
+ "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",
47
47
  "name": "prettier",
48
48
  "summary": "Format modified files using Prettier.",
49
49
  "allowNo": false,
@@ -56,15 +56,8 @@
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
- },
66
59
  "skip-instrumented": {
67
- "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib_Logger` reference.",
60
+ "description": "When provided, the command will not add log statements to any Aura component that contains the `` component.",
68
61
  "name": "skip-instrumented",
69
62
  "summary": "Skips any files where a logger is already present.",
70
63
  "allowNo": false,
@@ -80,7 +73,7 @@
80
73
  },
81
74
  "exclude": {
82
75
  "char": "e",
83
- "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cls\" to skip auto-generated classes.",
76
+ "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cmp\" to skip auto-generated components.",
84
77
  "name": "exclude",
85
78
  "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
86
79
  "hasDynamicHelp": false,
@@ -100,12 +93,12 @@
100
93
  },
101
94
  "hasDynamicHelp": false,
102
95
  "hiddenAliases": [],
103
- "id": "rflib:logging:apex:instrument",
96
+ "id": "rflib:logging:aura:instrument",
104
97
  "pluginAlias": "rflib-plugin",
105
98
  "pluginName": "rflib-plugin",
106
99
  "pluginType": "core",
107
100
  "strict": true,
108
- "summary": "Instrument Apex classes with RFLIB logging statements automatically.",
101
+ "summary": "Instrument Aura Components with RFLIB logging statements automatically.",
109
102
  "enableJsonFlag": true,
110
103
  "isESM": true,
111
104
  "relativePath": [
@@ -113,43 +106,43 @@
113
106
  "commands",
114
107
  "rflib",
115
108
  "logging",
116
- "apex",
109
+ "aura",
117
110
  "instrument.js"
118
111
  ],
119
112
  "aliasPermutations": [],
120
113
  "permutations": [
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"
114
+ "rflib:logging:aura:instrument",
115
+ "logging:rflib:aura:instrument",
116
+ "logging:aura:rflib:instrument",
117
+ "logging:aura:instrument:rflib",
118
+ "rflib:aura:logging:instrument",
119
+ "aura:rflib:logging:instrument",
120
+ "aura:logging:rflib:instrument",
121
+ "aura:logging:instrument:rflib",
122
+ "rflib:aura:instrument:logging",
123
+ "aura:rflib:instrument:logging",
124
+ "aura:instrument:rflib:logging",
125
+ "aura:instrument:logging:rflib",
126
+ "rflib:logging:instrument:aura",
127
+ "logging:rflib:instrument:aura",
128
+ "logging:instrument:rflib:aura",
129
+ "logging:instrument:aura:rflib",
130
+ "rflib:instrument:logging:aura",
131
+ "instrument:rflib:logging:aura",
132
+ "instrument:logging:rflib:aura",
133
+ "instrument:logging:aura:rflib",
134
+ "rflib:instrument:aura:logging",
135
+ "instrument:rflib:aura:logging",
136
+ "instrument:aura:rflib:logging",
137
+ "instrument:aura:logging:rflib"
145
138
  ]
146
139
  },
147
- "rflib:logging:aura:instrument": {
140
+ "rflib:logging:apex:instrument": {
148
141
  "aliases": [],
149
142
  "args": {},
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",
143
+ "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.",
151
144
  "examples": [
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"
145
+ "- 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"
153
146
  ],
154
147
  "flags": {
155
148
  "json": {
@@ -169,17 +162,17 @@
169
162
  },
170
163
  "sourcepath": {
171
164
  "char": "s",
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()",
165
+ "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.",
173
166
  "name": "sourcepath",
174
167
  "required": true,
175
- "summary": "Directory containing Aura components to instrument with logging.",
168
+ "summary": "Directory containing Apex classes to instrument with logging.",
176
169
  "hasDynamicHelp": false,
177
170
  "multiple": false,
178
171
  "type": "option"
179
172
  },
180
173
  "dryrun": {
181
174
  "char": "d",
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",
175
+ "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
183
176
  "name": "dryrun",
184
177
  "summary": "Preview changes without modifying files.",
185
178
  "allowNo": false,
@@ -187,7 +180,7 @@
187
180
  },
188
181
  "prettier": {
189
182
  "char": "p",
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",
183
+ "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",
191
184
  "name": "prettier",
192
185
  "summary": "Format modified files using Prettier.",
193
186
  "allowNo": false,
@@ -200,8 +193,15 @@
200
193
  "allowNo": false,
201
194
  "type": "boolean"
202
195
  },
196
+ "no-catch": {
197
+ "description": "When provided, the command will not add error log statements inside of `catch` blocks.",
198
+ "name": "no-catch",
199
+ "summary": "Exclude the instrumentation of catch blocks.",
200
+ "allowNo": false,
201
+ "type": "boolean"
202
+ },
203
203
  "skip-instrumented": {
204
- "description": "When provided, the command will not add log statements to any Aura component that contains the `` component.",
204
+ "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib_Logger` reference.",
205
205
  "name": "skip-instrumented",
206
206
  "summary": "Skips any files where a logger is already present.",
207
207
  "allowNo": false,
@@ -217,7 +217,7 @@
217
217
  },
218
218
  "exclude": {
219
219
  "char": "e",
220
- "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cmp\" to skip auto-generated components.",
220
+ "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cls\" to skip auto-generated classes.",
221
221
  "name": "exclude",
222
222
  "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
223
223
  "hasDynamicHelp": false,
@@ -237,12 +237,12 @@
237
237
  },
238
238
  "hasDynamicHelp": false,
239
239
  "hiddenAliases": [],
240
- "id": "rflib:logging:aura:instrument",
240
+ "id": "rflib:logging:apex:instrument",
241
241
  "pluginAlias": "rflib-plugin",
242
242
  "pluginName": "rflib-plugin",
243
243
  "pluginType": "core",
244
244
  "strict": true,
245
- "summary": "Instrument Aura Components with RFLIB logging statements automatically.",
245
+ "summary": "Instrument Apex classes with RFLIB logging statements automatically.",
246
246
  "enableJsonFlag": true,
247
247
  "isESM": true,
248
248
  "relativePath": [
@@ -250,35 +250,35 @@
250
250
  "commands",
251
251
  "rflib",
252
252
  "logging",
253
- "aura",
253
+ "apex",
254
254
  "instrument.js"
255
255
  ],
256
256
  "aliasPermutations": [],
257
257
  "permutations": [
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"
258
+ "rflib:logging:apex:instrument",
259
+ "logging:rflib:apex:instrument",
260
+ "logging:apex:rflib:instrument",
261
+ "logging:apex:instrument:rflib",
262
+ "rflib:apex:logging:instrument",
263
+ "apex:rflib:logging:instrument",
264
+ "apex:logging:rflib:instrument",
265
+ "apex:logging:instrument:rflib",
266
+ "rflib:apex:instrument:logging",
267
+ "apex:rflib:instrument:logging",
268
+ "apex:instrument:rflib:logging",
269
+ "apex:instrument:logging:rflib",
270
+ "rflib:logging:instrument:apex",
271
+ "logging:rflib:instrument:apex",
272
+ "logging:instrument:rflib:apex",
273
+ "logging:instrument:apex:rflib",
274
+ "rflib:instrument:logging:apex",
275
+ "instrument:rflib:logging:apex",
276
+ "instrument:logging:rflib:apex",
277
+ "instrument:logging:apex:rflib",
278
+ "rflib:instrument:apex:logging",
279
+ "instrument:rflib:apex:logging",
280
+ "instrument:apex:rflib:logging",
281
+ "instrument:apex:logging:rflib"
282
282
  ]
283
283
  },
284
284
  "rflib:logging:flow:instrument": {
@@ -543,5 +543,5 @@
543
543
  ]
544
544
  }
545
545
  },
546
- "version": "0.17.4"
546
+ "version": "0.18.0"
547
547
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
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.17.4",
4
+ "version": "0.18.0",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^4.9.0",
7
- "@salesforce/core": "^8.27.0",
7
+ "@salesforce/core": "^8.27.1",
8
8
  "@salesforce/sf-plugins-core": "^12.2.6",
9
9
  "@types/xml2js": "^0.4.14",
10
10
  "minimatch": "^10.2.4",
@@ -14,11 +14,11 @@
14
14
  "xml2js": "^0.6.2"
15
15
  },
16
16
  "devDependencies": {
17
- "@commitlint/cli": "^20.4.4",
17
+ "@commitlint/cli": "^20.5.0",
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.12",
21
+ "@oclif/plugin-command-snapshot": "^5.3.13",
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.87",
29
+ "oclif": "^4.22.93",
30
30
  "source-map-support": "^0.5.21",
31
31
  "ts-node": "^10.9.2",
32
32
  "tsconfig-paths": "^4.2.0",