knip 5.35.0 → 5.36.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/dist/ConfigurationChief.d.ts +0 -1
- package/dist/ConfigurationChief.js +0 -10
- package/dist/plugins/webpack/index.js +3 -2
- package/dist/plugins/webpack/types.d.ts +1 -0
- package/dist/reporters/disclosure.d.ts +3 -0
- package/dist/reporters/disclosure.js +49 -0
- package/dist/reporters/index.d.ts +1 -0
- package/dist/reporters/index.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -57,7 +57,6 @@ export declare class ConfigurationChief {
|
|
|
57
57
|
private getConfiguredWorkspaceKeys;
|
|
58
58
|
private getAdditionalWorkspaceNames;
|
|
59
59
|
private getAvailableWorkspaceNames;
|
|
60
|
-
private getAvailableWorkspacePkgNames;
|
|
61
60
|
private setIncludedWorkspaces;
|
|
62
61
|
getManifestForWorkspace(name: string): PackageJson | undefined;
|
|
63
62
|
getIncludedWorkspaces(): Workspace[];
|
|
@@ -204,16 +204,6 @@ export class ConfigurationChief {
|
|
|
204
204
|
getAvailableWorkspaceNames(names) {
|
|
205
205
|
return [...names, ...this.additionalWorkspaceNames].filter(name => !picomatch.isMatch(name, this.ignoredWorkspacePatterns));
|
|
206
206
|
}
|
|
207
|
-
getAvailableWorkspacePkgNames(pkgNames) {
|
|
208
|
-
const names = new Set();
|
|
209
|
-
for (const pkgName of pkgNames) {
|
|
210
|
-
if (names.has(pkgName))
|
|
211
|
-
throw new ConfigurationError(`Duplicate package name: ${pkgName}`);
|
|
212
|
-
if (!picomatch.isMatch(pkgName, this.ignoredWorkspacePatterns))
|
|
213
|
-
names.add(pkgName);
|
|
214
|
-
}
|
|
215
|
-
return names;
|
|
216
|
-
}
|
|
217
207
|
setIncludedWorkspaces() {
|
|
218
208
|
if (this.workspace) {
|
|
219
209
|
const dir = resolve(this.workspace);
|
|
@@ -52,8 +52,9 @@ export const findWebpackDependenciesFromConfig = async ({ config, cwd }) => {
|
|
|
52
52
|
const passes = typeof config === 'function' ? [false, true] : [false];
|
|
53
53
|
const inputs = new Set();
|
|
54
54
|
for (const isProduction of passes) {
|
|
55
|
-
const
|
|
56
|
-
const
|
|
55
|
+
const mode = isProduction ? 'production' : 'development';
|
|
56
|
+
const env = { production: isProduction, mode };
|
|
57
|
+
const argv = { mode };
|
|
57
58
|
const resolvedConfig = typeof config === 'function' ? await config(env, argv) : config;
|
|
58
59
|
for (const options of [resolvedConfig].flat()) {
|
|
59
60
|
const entries = [];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import EasyTable from 'easy-table';
|
|
2
|
+
import { relative, toRelative } from '../util/path.js';
|
|
3
|
+
import { getTitle } from './util.js';
|
|
4
|
+
const printHeader = (size, title) => console.log(`<details>${title ? `<summary>${title} (${size})</summary>` : ''}\n\n\`\`\``);
|
|
5
|
+
const printFooter = () => console.log('```\n\n</details>\n');
|
|
6
|
+
const logIssueRecord = (issues) => {
|
|
7
|
+
const table = new EasyTable();
|
|
8
|
+
for (const issue of issues) {
|
|
9
|
+
table.cell('symbol', issue.symbols ? issue.symbols.map(s => s.symbol).join(', ') : issue.symbol);
|
|
10
|
+
issue.parentSymbol && table.cell('parentSymbol', issue.parentSymbol);
|
|
11
|
+
issue.symbolType && table.cell('symbolType', issue.symbolType);
|
|
12
|
+
const pos = issue.line === undefined ? '' : `:${issue.line}${issue.col === undefined ? '' : `:${issue.col}`}`;
|
|
13
|
+
const cell = `${relative(issue.filePath)}${pos}`;
|
|
14
|
+
table.cell('filePath', cell);
|
|
15
|
+
table.newRow();
|
|
16
|
+
}
|
|
17
|
+
console.log(table.sort(['filePath', 'parentSymbol', 'symbol']).print().trim());
|
|
18
|
+
};
|
|
19
|
+
export default ({ report, issues }) => {
|
|
20
|
+
const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
|
|
21
|
+
let totalIssues = 0;
|
|
22
|
+
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
23
|
+
if (reportType === '_files')
|
|
24
|
+
continue;
|
|
25
|
+
if (isReportType) {
|
|
26
|
+
const title = reportMultipleGroups ? getTitle(reportType) : undefined;
|
|
27
|
+
if (reportType === 'files') {
|
|
28
|
+
const issuesForType = Array.from(issues._files);
|
|
29
|
+
if (issuesForType.length > 0) {
|
|
30
|
+
printHeader(issuesForType.length, title);
|
|
31
|
+
const sortedIssues = issuesForType.sort((a, b) => a.filePath.localeCompare(b.filePath));
|
|
32
|
+
for (const issue of sortedIssues)
|
|
33
|
+
console.log(toRelative(issue.filePath));
|
|
34
|
+
totalIssues = totalIssues + issuesForType.length;
|
|
35
|
+
printFooter();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const issuesForType = Object.values(issues[reportType]).flatMap(Object.values);
|
|
40
|
+
if (issuesForType.length > 0) {
|
|
41
|
+
printHeader(issuesForType.length, title);
|
|
42
|
+
logIssueRecord(issuesForType);
|
|
43
|
+
totalIssues = totalIssues + issuesForType.length;
|
|
44
|
+
printFooter();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
symbols: ({ report, issues, tagHints, configurationHints, noConfigHints, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
3
3
|
compact: ({ report, issues, isShowProgress }: import("../index.js").ReporterOptions) => void;
|
|
4
4
|
codeowners: ({ report, issues, isShowProgress, options }: import("../index.js").ReporterOptions) => void;
|
|
5
|
+
disclosure: ({ report, issues }: import("../index.js").ReporterOptions) => void;
|
|
5
6
|
json: ({ report, issues, options }: import("../index.js").ReporterOptions) => Promise<void>;
|
|
6
7
|
markdown: ({ report, issues }: import("../index.js").ReporterOptions) => void;
|
|
7
8
|
};
|
package/dist/reporters/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import codeowners from './codeowners.js';
|
|
2
2
|
import compact from './compact.js';
|
|
3
|
+
import disclosure from './disclosure.js';
|
|
3
4
|
import json from './json.js';
|
|
4
5
|
import markdown from './markdown.js';
|
|
5
6
|
import symbols from './symbols.js';
|
|
@@ -7,6 +8,7 @@ export default {
|
|
|
7
8
|
symbols,
|
|
8
9
|
compact,
|
|
9
10
|
codeowners,
|
|
11
|
+
disclosure,
|
|
10
12
|
json,
|
|
11
13
|
markdown,
|
|
12
14
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.36.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.36.0';
|