uilint 0.2.115 → 0.2.117
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/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4132,7 +4132,8 @@ async function generateManifest(options = {}) {
|
|
|
4132
4132
|
const cwd = resolve9(options.cwd ?? process.cwd());
|
|
4133
4133
|
const include = options.include ?? DEFAULT_INCLUDE;
|
|
4134
4134
|
const exclude = options.exclude ?? DEFAULT_EXCLUDE;
|
|
4135
|
-
const
|
|
4135
|
+
const includeSource = options.includeSource ?? true;
|
|
4136
|
+
const includeSnippets = options.includeSnippets ?? false;
|
|
4136
4137
|
const snippetContextLines = options.snippetContextLines ?? 3;
|
|
4137
4138
|
const onProgress = options.onProgress ?? (() => {
|
|
4138
4139
|
});
|
|
@@ -4170,21 +4171,25 @@ async function generateManifest(options = {}) {
|
|
|
4170
4171
|
dataLoc: issue.dataLoc
|
|
4171
4172
|
}));
|
|
4172
4173
|
if (manifestIssues.length === 0) continue;
|
|
4174
|
+
let fileContent;
|
|
4173
4175
|
let snippets;
|
|
4174
|
-
if (includeSnippets) {
|
|
4176
|
+
if (includeSource || includeSnippets) {
|
|
4175
4177
|
try {
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
issuesByDataLoc.
|
|
4178
|
+
fileContent = readFileSync4(absolutePath, "utf-8");
|
|
4179
|
+
if (includeSnippets) {
|
|
4180
|
+
snippets = {};
|
|
4181
|
+
const issuesByDataLoc = /* @__PURE__ */ new Map();
|
|
4182
|
+
for (const issue of manifestIssues) {
|
|
4183
|
+
if (!issuesByDataLoc.has(issue.dataLoc)) {
|
|
4184
|
+
issuesByDataLoc.set(issue.dataLoc, issue);
|
|
4185
|
+
}
|
|
4186
|
+
}
|
|
4187
|
+
for (const [dataLoc, issue] of issuesByDataLoc) {
|
|
4188
|
+
snippets[dataLoc] = extractSourceSnippet(fileContent, issue.line, snippetContextLines);
|
|
4182
4189
|
}
|
|
4183
|
-
}
|
|
4184
|
-
for (const [dataLoc, issue] of issuesByDataLoc) {
|
|
4185
|
-
snippets[dataLoc] = extractSourceSnippet(code, issue.line, snippetContextLines);
|
|
4186
4190
|
}
|
|
4187
4191
|
} catch {
|
|
4192
|
+
fileContent = void 0;
|
|
4188
4193
|
}
|
|
4189
4194
|
}
|
|
4190
4195
|
for (const issue of manifestIssues) {
|
|
@@ -4205,7 +4210,10 @@ async function generateManifest(options = {}) {
|
|
|
4205
4210
|
manifestFiles.push({
|
|
4206
4211
|
filePath: dataLocFilePath,
|
|
4207
4212
|
issues: manifestIssues,
|
|
4208
|
-
|
|
4213
|
+
// Include full source content for production mode source display
|
|
4214
|
+
content: includeSource ? fileContent : void 0,
|
|
4215
|
+
// Include snippets if explicitly requested (deprecated)
|
|
4216
|
+
snippets: includeSnippets ? snippets : void 0
|
|
4209
4217
|
});
|
|
4210
4218
|
}
|
|
4211
4219
|
onProgress(`Scan complete: ${totalIssues} issues in ${manifestFiles.length} files`);
|