rflib-plugin 0.1.2 → 0.2.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.
- package/README.md +34 -6
- package/lib/commands/rflib/logging/aura/instrument.d.ts +30 -0
- package/lib/commands/rflib/logging/aura/instrument.js +260 -0
- package/lib/commands/rflib/logging/aura/instrument.js.map +1 -0
- package/lib/commands/rflib/logging/lwc/instrument.js +16 -11
- package/lib/commands/rflib/logging/lwc/instrument.js.map +1 -1
- package/messages/rflib.logging.aura.instrument.md +70 -0
- package/oclif.manifest.json +97 -1
- package/package.json +14 -7
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Plugin for Salesforce CLI to help with the adoption of [RFLIB](https://github.co
|
|
|
8
8
|
|
|
9
9
|
- Automatically instruments Apex classes with RFLIB logging statements
|
|
10
10
|
- Automatically instruments LWC components with RFLIB logging statements
|
|
11
|
+
- Automatically instruments Aura components with RFLIB logging statements
|
|
11
12
|
|
|
12
13
|
## Installation
|
|
13
14
|
|
|
@@ -23,13 +24,13 @@ Adds RFLIB logging statements to Apex classes.
|
|
|
23
24
|
|
|
24
25
|
```bash
|
|
25
26
|
# Add logging to all classes in a directory
|
|
26
|
-
sf rflib logging apex instrument --sourcepath force-app
|
|
27
|
+
sf rflib logging apex instrument --sourcepath force-app
|
|
27
28
|
|
|
28
29
|
# Preview changes without modifying files
|
|
29
|
-
sf rflib logging apex instrument --sourcepath force-app
|
|
30
|
+
sf rflib logging apex instrument --sourcepath force-app --dryrun
|
|
30
31
|
|
|
31
32
|
# Format modified files with Prettier
|
|
32
|
-
sf rflib logging apex instrument --sourcepath force-app
|
|
33
|
+
sf rflib logging apex instrument --sourcepath force-app --prettier
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
#### Command Options
|
|
@@ -44,15 +45,42 @@ Adds RFLIB logging statements to Lightning Web Components.
|
|
|
44
45
|
|
|
45
46
|
```bash
|
|
46
47
|
# Add logging to all LWC files
|
|
47
|
-
sf rflib logging lwc instrument --sourcepath force-app
|
|
48
|
+
sf rflib logging lwc instrument --sourcepath force-app
|
|
48
49
|
|
|
49
50
|
# Preview changes without modifying files
|
|
50
|
-
sf rflib logging lwc instrument --sourcepath force-app
|
|
51
|
+
sf rflib logging lwc instrument --sourcepath force-app --dryrun
|
|
51
52
|
|
|
52
53
|
# Add logging and format code
|
|
53
|
-
sf rflib logging lwc instrument --sourcepath force-app
|
|
54
|
+
sf rflib logging lwc instrument --sourcepath force-app --prettier
|
|
54
55
|
```
|
|
55
56
|
|
|
57
|
+
#### Command Options
|
|
58
|
+
|
|
59
|
+
- `--sourcepath (-s)`: Directory containing Apex classes to instrument
|
|
60
|
+
- `--dryrun (-d)`: Preview changes without modifying files
|
|
61
|
+
- `--prettier (-p)`: Format modified files using Prettier
|
|
62
|
+
|
|
63
|
+
### `sf rflib logging aura instrument`
|
|
64
|
+
|
|
65
|
+
Adds RFLIB logging statements to Aura Components.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Add logging to all LWC files
|
|
69
|
+
sf rflib logging aura instrument --sourcepath force-app
|
|
70
|
+
|
|
71
|
+
# Preview changes without modifying files
|
|
72
|
+
sf rflib logging aura instrument --sourcepath force-app --dryrun
|
|
73
|
+
|
|
74
|
+
# Add logging and format code
|
|
75
|
+
sf rflib logging aura instrument --sourcepath force-app --prettier
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Command Options
|
|
79
|
+
|
|
80
|
+
- `--sourcepath (-s)`: Directory containing Apex classes to instrument
|
|
81
|
+
- `--dryrun (-d)`: Preview changes without modifying files
|
|
82
|
+
- `--prettier (-p)`: Format modified files using Prettier
|
|
83
|
+
|
|
56
84
|
## Contributing
|
|
57
85
|
|
|
58
86
|
1. Fork the repository
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type RflibLoggingAuraInstrumentResult = {
|
|
3
|
+
processedFiles: number;
|
|
4
|
+
modifiedFiles: number;
|
|
5
|
+
formattedFiles: number;
|
|
6
|
+
};
|
|
7
|
+
export default class RflibLoggingAuraInstrument extends SfCommand<RflibLoggingAuraInstrumentResult> {
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
sourcepath: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
dryrun: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
prettier: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
private logger;
|
|
17
|
+
private processedFiles;
|
|
18
|
+
private modifiedFiles;
|
|
19
|
+
private formattedFiles;
|
|
20
|
+
private readonly prettierConfig;
|
|
21
|
+
private static processMethodLogging;
|
|
22
|
+
private static processPromiseChains;
|
|
23
|
+
private static processTryCatchBlocks;
|
|
24
|
+
run(): Promise<RflibLoggingAuraInstrumentResult>;
|
|
25
|
+
private processDirectory;
|
|
26
|
+
private processAuraComponents;
|
|
27
|
+
private processAuraComponent;
|
|
28
|
+
private instrumentCmpFile;
|
|
29
|
+
private instrumentJsFile;
|
|
30
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
2
|
+
/* eslint-disable no-await-in-loop */
|
|
3
|
+
/* eslint-disable @typescript-eslint/quotes */
|
|
4
|
+
/* eslint-disable sf-plugin/no-missing-messages */
|
|
5
|
+
import * as fs from 'node:fs';
|
|
6
|
+
import * as path from 'node:path';
|
|
7
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages, Logger } from '@salesforce/core';
|
|
9
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
|
+
import * as prettier from 'prettier';
|
|
11
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
|
+
const messages = Messages.loadMessages('rflib-plugin', 'rflib.logging.aura.instrument');
|
|
13
|
+
const loggerComponentRegex = /<c:rflibLoggerCmp\s+aura:id="([^"]+)"\s+name="([^"]+)"\s+appendComponentId="([^"]+)"\s*\/>/;
|
|
14
|
+
const attributeRegex = /<aura:attribute[^>]*>/g;
|
|
15
|
+
const loggerVarRegex = /var\s+(\w+)\s*=\s*component\.find\(['"](\w+)['"]\)/;
|
|
16
|
+
const methodRegex = /(\b\w+)\s*:\s*function\s*\((.*?)\)\s*{((?:[^{}]|{(?:[^{}]|{(?:[^{}]|{(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})*})*})*?)}/g;
|
|
17
|
+
const promiseChainRegex = /\.(then|catch|finally)\s*\(\s*(?:async\s+)?(?:\(?([^)]*)\)?)?\s*=>\s*(?:{([\s\S]*?)}|([^{].*?)(?=\.|\)|\n|;|$))/g;
|
|
18
|
+
const tryCatchBlockRegex = /try\s*{[\s\S]*?}\s*catch\s*\(([^)]*)\)\s*{/g;
|
|
19
|
+
export default class RflibLoggingAuraInstrument extends SfCommand {
|
|
20
|
+
static summary = messages.getMessage('summary');
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static examples = messages.getMessages('examples');
|
|
23
|
+
static flags = {
|
|
24
|
+
sourcepath: Flags.string({
|
|
25
|
+
char: 's',
|
|
26
|
+
required: true,
|
|
27
|
+
summary: messages.getMessage('flags.sourcepath.summary'),
|
|
28
|
+
description: messages.getMessage('flags.sourcepath.description'),
|
|
29
|
+
}),
|
|
30
|
+
dryrun: Flags.boolean({
|
|
31
|
+
char: 'd',
|
|
32
|
+
default: false,
|
|
33
|
+
summary: messages.getMessage('flags.dryrun.summary'),
|
|
34
|
+
description: messages.getMessage('flags.dryrun.description'),
|
|
35
|
+
}),
|
|
36
|
+
prettier: Flags.boolean({
|
|
37
|
+
char: 'p',
|
|
38
|
+
default: false,
|
|
39
|
+
summary: messages.getMessage('flags.prettier.summary'),
|
|
40
|
+
description: messages.getMessage('flags.prettier.description'),
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
logger;
|
|
44
|
+
processedFiles = 0;
|
|
45
|
+
modifiedFiles = 0;
|
|
46
|
+
formattedFiles = 0;
|
|
47
|
+
prettierConfig = {
|
|
48
|
+
parser: 'babel',
|
|
49
|
+
printWidth: 120,
|
|
50
|
+
tabWidth: 4,
|
|
51
|
+
useTabs: false,
|
|
52
|
+
singleQuote: true,
|
|
53
|
+
trailingComma: "none"
|
|
54
|
+
};
|
|
55
|
+
static processMethodLogging(logger, content, loggerId, filePath) {
|
|
56
|
+
const isHelper = filePath.endsWith('Helper.js');
|
|
57
|
+
return content.replace(methodRegex, (match, methodName, params, body) => {
|
|
58
|
+
logger.trace(`Processing method: ${methodName}`);
|
|
59
|
+
const paramList = params.split(',').map(p => p.trim()).filter(p => p);
|
|
60
|
+
let loggerVar = 'logger';
|
|
61
|
+
let bodyContent = body;
|
|
62
|
+
// Prepare logging parameters
|
|
63
|
+
const paramsToLog = isHelper ? paramList : paramList.slice(1, 2);
|
|
64
|
+
const placeholders = paramsToLog.map((_, i) => `{${i}}`).join(', ');
|
|
65
|
+
const logParams = paramsToLog.length > 0 ? `, [${paramsToLog.join(', ')}]` : '';
|
|
66
|
+
// Find existing logger in function body
|
|
67
|
+
const loggerMatch = body.match(loggerVarRegex);
|
|
68
|
+
if (loggerMatch && loggerMatch[2] === loggerId) {
|
|
69
|
+
loggerVar = loggerMatch[1];
|
|
70
|
+
// Insert log after existing logger declaration
|
|
71
|
+
const loggerIndex = body.indexOf(loggerMatch[0]) + loggerMatch[0].length;
|
|
72
|
+
bodyContent = body.slice(0, loggerIndex) +
|
|
73
|
+
`\n ${loggerVar}.info('${methodName}(${placeholders})'${logParams});` +
|
|
74
|
+
body.slice(loggerIndex);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// Add new logger and log statement
|
|
78
|
+
const loggerInit = `var ${loggerVar} = ${paramList[0]}.find('${loggerId}');\n`;
|
|
79
|
+
bodyContent = `\n ${loggerInit} ${loggerVar}.info('${methodName}(${placeholders})'${logParams});${body}`;
|
|
80
|
+
}
|
|
81
|
+
return `${methodName}: function(${params}) {${bodyContent}}`;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
static processPromiseChains(content) {
|
|
85
|
+
return content.replace(promiseChainRegex, (match, type, param, blockBody, singleLineBody) => {
|
|
86
|
+
const paramName = param?.trim() || (type === 'then' ? 'result' : 'error');
|
|
87
|
+
let logStatement = '';
|
|
88
|
+
switch (type) {
|
|
89
|
+
case 'then':
|
|
90
|
+
logStatement = `logger.info('Promise resolved. Result={0}', ${paramName});`;
|
|
91
|
+
break;
|
|
92
|
+
case 'catch':
|
|
93
|
+
logStatement = `logger.error('An error occurred', ${paramName});`;
|
|
94
|
+
break;
|
|
95
|
+
case 'finally':
|
|
96
|
+
logStatement = `logger.info('Promise chain completed');`;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (singleLineBody) {
|
|
100
|
+
return `.${type}(${param || paramName} => {
|
|
101
|
+
${logStatement}
|
|
102
|
+
return ${singleLineBody};
|
|
103
|
+
})`;
|
|
104
|
+
}
|
|
105
|
+
if (blockBody) {
|
|
106
|
+
return `.${type}(${param || paramName} => {
|
|
107
|
+
${logStatement}${blockBody}
|
|
108
|
+
})`;
|
|
109
|
+
}
|
|
110
|
+
return match;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
static processTryCatchBlocks(content) {
|
|
114
|
+
return content.replace(tryCatchBlockRegex, (match, exceptionVar) => {
|
|
115
|
+
const errorVar = exceptionVar.trim().split(' ')[0] || 'error';
|
|
116
|
+
return match.replace(/catch\s*\(([^)]*)\)\s*{/, `catch(${exceptionVar}) {
|
|
117
|
+
logger.error('An error occurred', ${errorVar});`);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async run() {
|
|
121
|
+
this.logger = await Logger.child(this.ctor.name);
|
|
122
|
+
const { flags } = await this.parse(RflibLoggingAuraInstrument);
|
|
123
|
+
this.log(`Starting Aura component instrumentation in ${flags.sourcepath}`);
|
|
124
|
+
this.logger.debug(`Dry run mode: ${flags.dryrun}`);
|
|
125
|
+
this.spinner.start('Running...');
|
|
126
|
+
await this.processDirectory(flags.sourcepath, flags.dryrun, flags.prettier);
|
|
127
|
+
this.spinner.stop();
|
|
128
|
+
this.log(`\nInstrumentation complete.`);
|
|
129
|
+
this.log(`Processed files: ${this.processedFiles}`);
|
|
130
|
+
this.log(`Modified files: ${this.modifiedFiles}`);
|
|
131
|
+
this.log(`Formatted files: ${this.formattedFiles}`);
|
|
132
|
+
return {
|
|
133
|
+
processedFiles: this.processedFiles,
|
|
134
|
+
modifiedFiles: this.modifiedFiles,
|
|
135
|
+
formattedFiles: this.formattedFiles,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async processDirectory(dirPath, isDryRun, usePrettier) {
|
|
139
|
+
this.logger.debug(`Processing directory: ${dirPath}`);
|
|
140
|
+
// Check if path is direct component
|
|
141
|
+
const dirName = path.basename(dirPath);
|
|
142
|
+
const parentDir = path.basename(path.dirname(dirPath));
|
|
143
|
+
if (parentDir === 'aura') {
|
|
144
|
+
this.logger.info(`Processing single component: ${dirName}`);
|
|
145
|
+
await this.processAuraComponent(dirPath, dirName, isDryRun, usePrettier);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const entries = await fs.promises.readdir(dirPath, { withFileTypes: true });
|
|
149
|
+
for (const entry of entries) {
|
|
150
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
151
|
+
this.logger.debug(`Examining entry: ${entry.name}`);
|
|
152
|
+
if (entry.isDirectory()) {
|
|
153
|
+
if (entry.name === 'aura') {
|
|
154
|
+
this.logger.info(`Found Aura directory: ${fullPath}`);
|
|
155
|
+
await this.processAuraComponents(fullPath, isDryRun, usePrettier);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
await this.processDirectory(fullPath, isDryRun, usePrettier);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async processAuraComponents(auraPath, isDryRun, usePrettier) {
|
|
164
|
+
// Check if path is already an aura directory
|
|
165
|
+
if (path.basename(auraPath) !== 'aura') {
|
|
166
|
+
this.logger.warn(`Not an aura directory: ${auraPath}`);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const entries = await fs.promises.readdir(auraPath, { withFileTypes: true });
|
|
170
|
+
for (const entry of entries) {
|
|
171
|
+
if (entry.isDirectory()) {
|
|
172
|
+
const componentPath = path.join(auraPath, entry.name);
|
|
173
|
+
await this.processAuraComponent(componentPath, entry.name, isDryRun, usePrettier);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async processAuraComponent(componentPath, componentName, isDryRun, usePrettier) {
|
|
178
|
+
this.logger.info(`Processing Aura component: ${componentName}`);
|
|
179
|
+
const cmpPath = path.join(componentPath, `${componentName}.cmp`);
|
|
180
|
+
const controllerPath = path.join(componentPath, `${componentName}Controller.js`);
|
|
181
|
+
const helperPath = path.join(componentPath, `${componentName}Helper.js`);
|
|
182
|
+
const rendererPath = path.join(componentPath, `${componentName}Renderer.js`);
|
|
183
|
+
try {
|
|
184
|
+
const loggerId = await this.instrumentCmpFile(cmpPath, componentName, isDryRun);
|
|
185
|
+
this.logger.debug(`Using logger ID: ${loggerId}`);
|
|
186
|
+
await this.instrumentJsFile(controllerPath, loggerId, isDryRun, usePrettier);
|
|
187
|
+
await this.instrumentJsFile(helperPath, loggerId, isDryRun, usePrettier);
|
|
188
|
+
await this.instrumentJsFile(rendererPath, loggerId, isDryRun, usePrettier);
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
this.logger.error(`Error processing Aura ${componentName}`, error);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async instrumentCmpFile(filePath, componentName, isDryRun) {
|
|
195
|
+
if (!fs.existsSync(filePath)) {
|
|
196
|
+
this.logger.warn(`Component file not found: ${filePath}`);
|
|
197
|
+
return 'logger';
|
|
198
|
+
}
|
|
199
|
+
this.logger.debug(`Instrumenting component file: ${filePath}`);
|
|
200
|
+
this.processedFiles++;
|
|
201
|
+
let content = await fs.promises.readFile(filePath, 'utf8');
|
|
202
|
+
const originalContent = content;
|
|
203
|
+
const loggerMatch = content.match(loggerComponentRegex);
|
|
204
|
+
if (loggerMatch) {
|
|
205
|
+
return loggerMatch[1];
|
|
206
|
+
}
|
|
207
|
+
const lastAttributeMatch = [...content.matchAll(attributeRegex)].pop();
|
|
208
|
+
if (lastAttributeMatch) {
|
|
209
|
+
const insertPosition = lastAttributeMatch.index + lastAttributeMatch[0].length;
|
|
210
|
+
const loggerComponent = `\n <c:rflibLoggerCmp aura:id="logger" name="${componentName}" appendComponentId="false" />`;
|
|
211
|
+
content = content.slice(0, insertPosition) + loggerComponent + content.slice(insertPosition);
|
|
212
|
+
}
|
|
213
|
+
if (content !== originalContent) {
|
|
214
|
+
this.modifiedFiles++;
|
|
215
|
+
if (!isDryRun) {
|
|
216
|
+
await fs.promises.writeFile(filePath, content, 'utf8');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return 'logger';
|
|
220
|
+
}
|
|
221
|
+
async instrumentJsFile(filePath, loggerId, isDryRun, usePrettier) {
|
|
222
|
+
if (!fs.existsSync(filePath)) {
|
|
223
|
+
this.logger.debug(`JavaScript file not found: ${filePath}`);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
this.logger.debug(`Instrumenting JavaScript file: ${filePath}`);
|
|
227
|
+
this.processedFiles++;
|
|
228
|
+
let content = await fs.promises.readFile(filePath, 'utf8');
|
|
229
|
+
const originalContent = content;
|
|
230
|
+
// Process methods
|
|
231
|
+
content = RflibLoggingAuraInstrument.processMethodLogging(this.logger, content, loggerId, filePath);
|
|
232
|
+
content = RflibLoggingAuraInstrument.processPromiseChains(content);
|
|
233
|
+
content = RflibLoggingAuraInstrument.processTryCatchBlocks(content);
|
|
234
|
+
if (content !== originalContent) {
|
|
235
|
+
this.modifiedFiles++;
|
|
236
|
+
if (!isDryRun) {
|
|
237
|
+
try {
|
|
238
|
+
const finalContent = usePrettier ? await prettier.format(content, this.prettierConfig) : content;
|
|
239
|
+
await fs.promises.writeFile(filePath, finalContent);
|
|
240
|
+
if (usePrettier) {
|
|
241
|
+
this.formattedFiles++;
|
|
242
|
+
this.logger.info(`Modified and formatted: ${filePath}`);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.logger.info(`Modified: ${filePath}`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
this.logger.warn(`Failed to format ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
250
|
+
await fs.promises.writeFile(filePath, content);
|
|
251
|
+
this.logger.info(`Modified without formatting: ${filePath}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
this.logger.info(`Would modify: ${filePath}`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=instrument.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/logging/aura/instrument.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,qCAAqC;AACrC,8CAA8C;AAC9C,kDAAkD;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,6DAA6D;AAC7D,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAA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
27
|
char: 's',
|
|
28
28
|
required: true,
|
|
29
29
|
summary: messages.getMessage('flags.sourcepath.summary'),
|
|
30
|
-
description: messages.getMessage('flags.sourcepath.description')
|
|
30
|
+
description: messages.getMessage('flags.sourcepath.description'),
|
|
31
31
|
}),
|
|
32
32
|
dryrun: Flags.boolean({
|
|
33
33
|
char: 'd',
|
|
34
34
|
default: false,
|
|
35
35
|
summary: messages.getMessage('flags.dryrun.summary'),
|
|
36
|
-
description: messages.getMessage('flags.dryrun.description')
|
|
36
|
+
description: messages.getMessage('flags.dryrun.description'),
|
|
37
37
|
}),
|
|
38
38
|
prettier: Flags.boolean({
|
|
39
39
|
char: 'p',
|
|
40
40
|
default: false,
|
|
41
41
|
summary: messages.getMessage('flags.prettier.summary'),
|
|
42
|
-
description: messages.getMessage('flags.prettier.description')
|
|
43
|
-
})
|
|
42
|
+
description: messages.getMessage('flags.prettier.description'),
|
|
43
|
+
}),
|
|
44
44
|
};
|
|
45
45
|
logger;
|
|
46
46
|
processedFiles = 0;
|
|
@@ -51,7 +51,7 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
51
51
|
printWidth: 120,
|
|
52
52
|
tabWidth: 4,
|
|
53
53
|
useTabs: false,
|
|
54
|
-
singleQuote: true
|
|
54
|
+
singleQuote: true,
|
|
55
55
|
};
|
|
56
56
|
static detectExistingImport(content) {
|
|
57
57
|
return importRegex.test(content);
|
|
@@ -60,7 +60,7 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
60
60
|
const match = content.match(loggerRegex);
|
|
61
61
|
return {
|
|
62
62
|
exists: match !== null,
|
|
63
|
-
loggerName: match ? match[1] : 'logger'
|
|
63
|
+
loggerName: match ? match[1] : 'logger',
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
static addImportAndLogger(content, componentName) {
|
|
@@ -87,7 +87,7 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
87
87
|
let lastCondition = '';
|
|
88
88
|
// First process if statements and store conditions
|
|
89
89
|
let modified = content.replace(ifStatementRegex, (match, blockCondition, blockBody, lineCondition, lineBody) => {
|
|
90
|
-
const condition = typeof blockCondition === 'string' ? blockCondition :
|
|
90
|
+
const condition = typeof blockCondition === 'string' ? blockCondition : typeof lineCondition === 'string' ? lineCondition : '';
|
|
91
91
|
lastCondition = condition.trim();
|
|
92
92
|
const logStatement = `${loggerName}.debug(\`if (${lastCondition})\`);`;
|
|
93
93
|
if (blockBody) {
|
|
@@ -112,7 +112,10 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
112
112
|
static processMethodLogging(content, loggerName) {
|
|
113
113
|
// First handle methods
|
|
114
114
|
let modified = content.replace(methodRegex, (match, methodName, args) => {
|
|
115
|
-
const parameters = args
|
|
115
|
+
const parameters = args
|
|
116
|
+
.split(',')
|
|
117
|
+
.map((p) => p.trim())
|
|
118
|
+
.filter((p) => p);
|
|
116
119
|
const placeholders = parameters.map((_, i) => `{${i}}`).join(', ');
|
|
117
120
|
const logArgs = parameters.length > 0 ? `, ${parameters.join(', ')}` : '';
|
|
118
121
|
return `${match}\n ${loggerName}.info('${methodName}(${placeholders})'${logArgs});`;
|
|
@@ -124,7 +127,7 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
124
127
|
static processPromiseChains(content, loggerName) {
|
|
125
128
|
return content.replace(promiseChainRegex, (match, type, param, blockBody, singleLineBody, offset) => {
|
|
126
129
|
const methodName = this.findEnclosingMethod(content, offset);
|
|
127
|
-
const paramName = typeof param === 'string' ? param.trim() :
|
|
130
|
+
const paramName = typeof param === 'string' ? param.trim() : type === 'then' ? 'result' : 'error';
|
|
128
131
|
const indentation = match.match(/\n\s*/)?.[0] || '\n ';
|
|
129
132
|
let logStatement;
|
|
130
133
|
switch (type) {
|
|
@@ -168,7 +171,9 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
168
171
|
this.logger = await Logger.child(this.ctor.name);
|
|
169
172
|
const { flags } = await this.parse(RflibLoggingLwcInstrument);
|
|
170
173
|
this.log(`Scanning LWC components in ${flags.sourcepath}...`);
|
|
174
|
+
this.spinner.start('Running...');
|
|
171
175
|
await this.processDirectory(flags.sourcepath, flags.dryrun, flags.prettier);
|
|
176
|
+
this.spinner.stop();
|
|
172
177
|
this.log(`\nInstrumentation complete.`);
|
|
173
178
|
this.log(`Processed files: ${this.processedFiles}`);
|
|
174
179
|
this.log(`Modified files: ${this.modifiedFiles}`);
|
|
@@ -176,7 +181,7 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
176
181
|
return {
|
|
177
182
|
processedFiles: this.processedFiles,
|
|
178
183
|
modifiedFiles: this.modifiedFiles,
|
|
179
|
-
formattedFiles: this.formattedFiles
|
|
184
|
+
formattedFiles: this.formattedFiles,
|
|
180
185
|
};
|
|
181
186
|
}
|
|
182
187
|
async processDirectory(dirPath, isDryRun, usePrettier) {
|
|
@@ -187,7 +192,7 @@ export default class RflibLoggingLwcInstrument extends SfCommand {
|
|
|
187
192
|
if (stat.isDirectory()) {
|
|
188
193
|
await this.processDirectory(filePath, isDryRun, usePrettier);
|
|
189
194
|
}
|
|
190
|
-
else if (file.endsWith('.js') && !path.dirname(filePath).includes('aura')) {
|
|
195
|
+
else if (file.endsWith('.js') && !path.dirname(filePath).includes('aura') && !path.dirname(filePath).includes('__tests__')) {
|
|
191
196
|
await this.instrumentLwcFile(filePath, isDryRun, usePrettier);
|
|
192
197
|
}
|
|
193
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/logging/lwc/instrument.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,qCAAqC;AACrC,8CAA8C;AAC9C,kDAAkD;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D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ura Components with RFLIB logging statements automatically.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Analyzes Aura Component files and adds RFLIB logging statements for:
|
|
8
|
+
- Method entry logging with parameter values in Controller, Helper, and Renderer files
|
|
9
|
+
- Error logging in try-catch blocks
|
|
10
|
+
- Error logging in Promise catch handlers
|
|
11
|
+
- Adds rflibLoggerCmp component if not present
|
|
12
|
+
- Formats modified files using Prettier (optional)
|
|
13
|
+
|
|
14
|
+
The command processes:
|
|
15
|
+
- Component (.cmp) files to add the logger component
|
|
16
|
+
- Controller (.js) files for method instrumentation
|
|
17
|
+
- Helper (.js) files for method instrumentation
|
|
18
|
+
- Renderer (.js) files for method instrumentation
|
|
19
|
+
|
|
20
|
+
# flags.sourcepath.summary
|
|
21
|
+
|
|
22
|
+
Directory containing Aura components to instrument with logging.
|
|
23
|
+
|
|
24
|
+
# flags.sourcepath.description
|
|
25
|
+
|
|
26
|
+
Path to the source directory containing Aura components that should be instrumented with RFLIB logging statements. The command will:
|
|
27
|
+
- Scan for 'aura' directories recursively
|
|
28
|
+
- Process all Aura components found
|
|
29
|
+
- Add <c:rflibLoggerCmp> to component files
|
|
30
|
+
- Add logging statements to JavaScript files
|
|
31
|
+
- Initialize logger in methods using component.find()
|
|
32
|
+
|
|
33
|
+
# flags.dryrun.summary
|
|
34
|
+
|
|
35
|
+
Preview changes without modifying files.
|
|
36
|
+
|
|
37
|
+
# flags.dryrun.description
|
|
38
|
+
|
|
39
|
+
When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes. Shows:
|
|
40
|
+
- Files that would be modified
|
|
41
|
+
- Number of processed files
|
|
42
|
+
- Number of modified files
|
|
43
|
+
- Number of formatted files
|
|
44
|
+
|
|
45
|
+
# flags.prettier.summary
|
|
46
|
+
|
|
47
|
+
Format modified files using Prettier.
|
|
48
|
+
|
|
49
|
+
# flags.prettier.description
|
|
50
|
+
|
|
51
|
+
When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:
|
|
52
|
+
- 120 character line width
|
|
53
|
+
- 4 space indentation
|
|
54
|
+
- Single quotes for strings
|
|
55
|
+
- No tabs
|
|
56
|
+
- No trailing commas
|
|
57
|
+
|
|
58
|
+
# examples
|
|
59
|
+
|
|
60
|
+
- Add logging to all aura files:
|
|
61
|
+
$ sf rflib logging aura instrument --sourcepath force-app
|
|
62
|
+
|
|
63
|
+
- Preview changes:
|
|
64
|
+
$ sf rflib logging aura instrument --sourcepath force-app --dryrun
|
|
65
|
+
|
|
66
|
+
- Add logging and format code:
|
|
67
|
+
$ sf rflib logging aura instrument --sourcepath force-app --prettier
|
|
68
|
+
|
|
69
|
+
- Process specific component:
|
|
70
|
+
$ sf rflib logging aura instrument --sourcepath force-app/main/default/aura/myComponent
|
package/oclif.manifest.json
CHANGED
|
@@ -96,6 +96,102 @@
|
|
|
96
96
|
"instrument:apex:logging:rflib"
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
|
+
"rflib:logging:aura:instrument": {
|
|
100
|
+
"aliases": [],
|
|
101
|
+
"args": {},
|
|
102
|
+
"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",
|
|
103
|
+
"examples": [
|
|
104
|
+
"- 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"
|
|
105
|
+
],
|
|
106
|
+
"flags": {
|
|
107
|
+
"json": {
|
|
108
|
+
"description": "Format output as json.",
|
|
109
|
+
"helpGroup": "GLOBAL",
|
|
110
|
+
"name": "json",
|
|
111
|
+
"allowNo": false,
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"flags-dir": {
|
|
115
|
+
"helpGroup": "GLOBAL",
|
|
116
|
+
"name": "flags-dir",
|
|
117
|
+
"summary": "Import flag values from a directory.",
|
|
118
|
+
"hasDynamicHelp": false,
|
|
119
|
+
"multiple": false,
|
|
120
|
+
"type": "option"
|
|
121
|
+
},
|
|
122
|
+
"sourcepath": {
|
|
123
|
+
"char": "s",
|
|
124
|
+
"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()",
|
|
125
|
+
"name": "sourcepath",
|
|
126
|
+
"required": true,
|
|
127
|
+
"summary": "Directory containing Aura components to instrument with logging.",
|
|
128
|
+
"hasDynamicHelp": false,
|
|
129
|
+
"multiple": false,
|
|
130
|
+
"type": "option"
|
|
131
|
+
},
|
|
132
|
+
"dryrun": {
|
|
133
|
+
"char": "d",
|
|
134
|
+
"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",
|
|
135
|
+
"name": "dryrun",
|
|
136
|
+
"summary": "Preview changes without modifying files.",
|
|
137
|
+
"allowNo": false,
|
|
138
|
+
"type": "boolean"
|
|
139
|
+
},
|
|
140
|
+
"prettier": {
|
|
141
|
+
"char": "p",
|
|
142
|
+
"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",
|
|
143
|
+
"name": "prettier",
|
|
144
|
+
"summary": "Format modified files using Prettier.",
|
|
145
|
+
"allowNo": false,
|
|
146
|
+
"type": "boolean"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"hasDynamicHelp": false,
|
|
150
|
+
"hiddenAliases": [],
|
|
151
|
+
"id": "rflib:logging:aura:instrument",
|
|
152
|
+
"pluginAlias": "rflib-plugin",
|
|
153
|
+
"pluginName": "rflib-plugin",
|
|
154
|
+
"pluginType": "core",
|
|
155
|
+
"strict": true,
|
|
156
|
+
"summary": "Instrument Aura Components with RFLIB logging statements automatically.",
|
|
157
|
+
"enableJsonFlag": true,
|
|
158
|
+
"isESM": true,
|
|
159
|
+
"relativePath": [
|
|
160
|
+
"lib",
|
|
161
|
+
"commands",
|
|
162
|
+
"rflib",
|
|
163
|
+
"logging",
|
|
164
|
+
"aura",
|
|
165
|
+
"instrument.js"
|
|
166
|
+
],
|
|
167
|
+
"aliasPermutations": [],
|
|
168
|
+
"permutations": [
|
|
169
|
+
"rflib:logging:aura:instrument",
|
|
170
|
+
"logging:rflib:aura:instrument",
|
|
171
|
+
"logging:aura:rflib:instrument",
|
|
172
|
+
"logging:aura:instrument:rflib",
|
|
173
|
+
"rflib:aura:logging:instrument",
|
|
174
|
+
"aura:rflib:logging:instrument",
|
|
175
|
+
"aura:logging:rflib:instrument",
|
|
176
|
+
"aura:logging:instrument:rflib",
|
|
177
|
+
"rflib:aura:instrument:logging",
|
|
178
|
+
"aura:rflib:instrument:logging",
|
|
179
|
+
"aura:instrument:rflib:logging",
|
|
180
|
+
"aura:instrument:logging:rflib",
|
|
181
|
+
"rflib:logging:instrument:aura",
|
|
182
|
+
"logging:rflib:instrument:aura",
|
|
183
|
+
"logging:instrument:rflib:aura",
|
|
184
|
+
"logging:instrument:aura:rflib",
|
|
185
|
+
"rflib:instrument:logging:aura",
|
|
186
|
+
"instrument:rflib:logging:aura",
|
|
187
|
+
"instrument:logging:rflib:aura",
|
|
188
|
+
"instrument:logging:aura:rflib",
|
|
189
|
+
"rflib:instrument:aura:logging",
|
|
190
|
+
"instrument:rflib:aura:logging",
|
|
191
|
+
"instrument:aura:rflib:logging",
|
|
192
|
+
"instrument:aura:logging:rflib"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
99
195
|
"rflib:logging:lwc:instrument": {
|
|
100
196
|
"aliases": [],
|
|
101
197
|
"args": {},
|
|
@@ -193,5 +289,5 @@
|
|
|
193
289
|
]
|
|
194
290
|
}
|
|
195
291
|
},
|
|
196
|
-
"version": "0.
|
|
292
|
+
"version": "0.2.0"
|
|
197
293
|
}
|
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.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^4",
|
|
7
7
|
"@salesforce/core": "^8",
|
|
@@ -48,16 +48,19 @@
|
|
|
48
48
|
],
|
|
49
49
|
"topics": {
|
|
50
50
|
"rflib": {
|
|
51
|
-
"description": "
|
|
51
|
+
"description": "Utility commands for the RFLIB Salesforce open-source library",
|
|
52
52
|
"subtopics": {
|
|
53
53
|
"logging": {
|
|
54
|
-
"description": "
|
|
54
|
+
"description": "Commands related to RFLIB's logging library",
|
|
55
55
|
"subtopics": {
|
|
56
56
|
"apex": {
|
|
57
|
-
"description": "
|
|
57
|
+
"description": "Commands related to Apex logging"
|
|
58
58
|
},
|
|
59
59
|
"lwc": {
|
|
60
|
-
"description": "
|
|
60
|
+
"description": "Commands related to LWC logging"
|
|
61
|
+
},
|
|
62
|
+
"aura": {
|
|
63
|
+
"description": "Commands related to Aura logging"
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -207,5 +210,9 @@
|
|
|
207
210
|
},
|
|
208
211
|
"exports": "./lib/index.js",
|
|
209
212
|
"type": "module",
|
|
210
|
-
"author": "Johannes Fischer"
|
|
211
|
-
|
|
213
|
+
"author": "Johannes Fischer",
|
|
214
|
+
"volta": {
|
|
215
|
+
"node": "20.17.0",
|
|
216
|
+
"yarn": "1.22.22"
|
|
217
|
+
}
|
|
218
|
+
}
|