knip 6.43.0 → 6.44.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/README.md +2 -4
- package/dist/CacheConsultant.d.ts +1 -0
- package/dist/CacheConsultant.js +2 -0
- package/dist/CatalogCounselor.d.ts +1 -3
- package/dist/CatalogCounselor.js +18 -15
- package/dist/ConfigurationChief.d.ts +24 -0
- package/dist/DependencyDeputy.d.ts +2 -1
- package/dist/DependencyDeputy.js +11 -6
- package/dist/IssueCollector.js +1 -0
- package/dist/ProjectPrincipal.d.ts +4 -2
- package/dist/ProjectPrincipal.js +32 -10
- package/dist/WorkspaceWorker.d.ts +5 -2
- package/dist/WorkspaceWorker.js +20 -7
- package/dist/binaries/resolvers/bun.js +7 -2
- package/dist/binaries/util.js +2 -1
- package/dist/cli.js +6 -1
- package/dist/compilers/index.d.ts +5 -0
- package/dist/compilers/index.js +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/graph/analyze.js +3 -2
- package/dist/graph/build.d.ts +2 -0
- package/dist/graph/build.js +37 -22
- package/dist/graph-explorer/cache.d.ts +2 -1
- package/dist/graph-explorer/cache.js +5 -1
- package/dist/graph-explorer/explorer.d.ts +3 -5
- package/dist/graph-explorer/explorer.js +24 -3
- package/dist/plugins/babel/index.js +6 -1
- package/dist/plugins/biome/index.js +1 -1
- package/dist/plugins/cspell/index.js +10 -2
- package/dist/plugins/dependency-cruiser/index.js +2 -2
- package/dist/plugins/docusaurus/helpers.js +4 -4
- package/dist/plugins/electron-vite/index.js +2 -2
- package/dist/plugins/eleventy/index.js +2 -2
- package/dist/plugins/expressive-code/index.d.ts +1 -1
- package/dist/plugins/expressive-code/index.js +2 -2
- package/dist/plugins/gatsby/index.js +6 -6
- package/dist/plugins/gatsby/types.d.ts +1 -1
- package/dist/plugins/github-actions/index.js +1 -1
- package/dist/plugins/i18next-parser/index.js +2 -2
- package/dist/plugins/index.d.ts +5 -1
- package/dist/plugins/index.js +8 -0
- package/dist/plugins/jasmine/index.js +2 -2
- package/dist/plugins/karma/index.js +4 -4
- package/dist/plugins/kysely-codegen/index.d.ts +3 -0
- package/dist/plugins/kysely-codegen/index.js +20 -0
- package/dist/plugins/lefthook/index.js +2 -2
- package/dist/plugins/lingui/index.d.ts +3 -0
- package/dist/plugins/lingui/index.js +16 -0
- package/dist/plugins/lockfile-lint/index.js +2 -2
- package/dist/plugins/lost-pixel/index.js +2 -2
- package/dist/plugins/lunaria/index.js +2 -2
- package/dist/plugins/marko/index.js +5 -6
- package/dist/plugins/mastra/index.d.ts +3 -0
- package/dist/plugins/mastra/index.js +57 -0
- package/dist/plugins/mcp/index.js +1 -1
- package/dist/plugins/mise/index.js +0 -3
- package/dist/plugins/mocha/index.js +43 -4
- package/dist/plugins/mocha/types.d.ts +1 -0
- package/dist/plugins/npm-package-json-lint/index.js +1 -1
- package/dist/plugins/npm-package-json-lint/types.d.ts +1 -1
- package/dist/plugins/nx/index.js +3 -8
- package/dist/plugins/nyc/index.js +1 -1
- package/dist/plugins/openapi-ts/index.js +2 -2
- package/dist/plugins/oxfmt/index.js +2 -2
- package/dist/plugins/playwright/index.js +6 -11
- package/dist/plugins/pnpm/index.js +2 -4
- package/dist/plugins/purgecss/index.d.ts +3 -0
- package/dist/plugins/purgecss/index.js +16 -0
- package/dist/plugins/railway/index.js +1 -4
- package/dist/plugins/relay/index.js +1 -1
- package/dist/plugins/release-it/index.js +1 -1
- package/dist/plugins/remix/index.js +1 -1
- package/dist/plugins/rsbuild/index.js +29 -1
- package/dist/plugins/rsbuild/types.d.ts +8 -0
- package/dist/plugins/rstest/index.js +2 -2
- package/dist/plugins/serverless-framework/index.js +1 -1
- package/dist/plugins/storybook/index.js +5 -5
- package/dist/plugins/sveltekit/resolveFromAST.js +1 -1
- package/dist/plugins/svgr/index.js +2 -1
- package/dist/plugins/swc/index.js +8 -3
- package/dist/plugins/syncpack/index.js +2 -2
- package/dist/plugins/tanstack-router/index.js +3 -2
- package/dist/plugins/taskfile/index.js +4 -7
- package/dist/plugins/textlint/helpers.js +2 -2
- package/dist/plugins/typescript/index.js +7 -3
- package/dist/plugins/unocss/index.js +2 -2
- package/dist/plugins/vite-plugin-pwa/index.js +1 -4
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.d.ts +0 -2
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
- package/dist/plugins/vite-pwa-assets-generator/index.js +2 -2
- package/dist/plugins/vitest/helpers.js +4 -7
- package/dist/plugins/vitest/index.js +1 -1
- package/dist/plugins/webpack/index.d.ts +2 -0
- package/dist/plugins/webpack/index.js +11 -6
- package/dist/plugins/yarn/index.js +2 -4
- package/dist/reporters/codeclimate.d.ts +2 -2
- package/dist/reporters/codeclimate.js +2 -4
- package/dist/reporters/codeowners.d.ts +2 -2
- package/dist/reporters/codeowners.js +9 -9
- package/dist/reporters/compact.d.ts +2 -2
- package/dist/reporters/compact.js +8 -7
- package/dist/reporters/cycles.d.ts +2 -2
- package/dist/reporters/cycles.js +7 -6
- package/dist/reporters/disclosure.d.ts +2 -2
- package/dist/reporters/disclosure.js +6 -4
- package/dist/reporters/github-actions.d.ts +2 -2
- package/dist/reporters/github-actions.js +7 -5
- package/dist/reporters/index.d.ts +10 -10
- package/dist/reporters/json.d.ts +2 -2
- package/dist/reporters/json.js +2 -4
- package/dist/reporters/markdown.d.ts +2 -2
- package/dist/reporters/markdown.js +11 -9
- package/dist/reporters/sarif.d.ts +2 -2
- package/dist/reporters/sarif.js +2 -3
- package/dist/reporters/symbols.d.ts +2 -2
- package/dist/reporters/symbols.js +6 -4
- package/dist/run.d.ts +1 -1
- package/dist/run.js +3 -10
- package/dist/schema/configuration.d.ts +60 -0
- package/dist/schema/plugins.d.ts +20 -0
- package/dist/schema/plugins.js +4 -0
- package/dist/session/configuration.d.ts +15 -0
- package/dist/session/configuration.js +62 -0
- package/dist/session/incremental.d.ts +54 -0
- package/dist/session/incremental.js +49 -0
- package/dist/session/session.d.ts +1 -1
- package/dist/session/session.js +63 -27
- package/dist/session/watch.d.ts +2 -0
- package/dist/session/watch.js +41 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +4 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/issues.d.ts +4 -0
- package/dist/types/package-json.d.ts +0 -3
- package/dist/typescript/get-imports-and-exports.js +2 -0
- package/dist/typescript/visitors/calls.js +15 -11
- package/dist/typescript/visitors/imports.d.ts +3 -1
- package/dist/typescript/visitors/imports.js +77 -53
- package/dist/typescript/visitors/members.js +23 -26
- package/dist/typescript/visitors/walk.d.ts +3 -0
- package/dist/typescript/visitors/walk.js +43 -2
- package/dist/util/cli-arguments.d.ts +2 -1
- package/dist/util/cli-arguments.js +3 -0
- package/dist/util/create-input-handler.js +1 -1
- package/dist/util/create-options.d.ts +43 -2
- package/dist/util/create-options.js +17 -4
- package/dist/util/file-entry-cache.d.ts +2 -0
- package/dist/util/file-entry-cache.js +19 -1
- package/dist/util/gitignore-cache.d.ts +1 -0
- package/dist/util/gitignore-cache.js +1 -0
- package/dist/util/glob-core.js +4 -2
- package/dist/util/glob.d.ts +1 -0
- package/dist/util/glob.js +6 -0
- package/dist/util/input.d.ts +2 -0
- package/dist/util/loader.d.ts +1 -0
- package/dist/util/loader.js +29 -1
- package/dist/util/modules.js +5 -2
- package/dist/util/path.d.ts +1 -0
- package/dist/util/path.js +1 -0
- package/dist/util/reporter.d.ts +1 -1
- package/dist/util/reporter.js +53 -9
- package/dist/util/watch.d.ts +5 -11
- package/dist/util/watch.js +84 -68
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +16 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
symbols: (options: import("../types.ts").
|
|
3
|
-
compact: ({ report, issues, isShowProgress, cwd }: import("../types.ts").
|
|
4
|
-
codeowners: ({ report, issues, isShowProgress, options, cwd }: import("../types.ts").
|
|
5
|
-
cycles: ({ cwd, issues, isShowProgress }: import("../types.ts").
|
|
6
|
-
disclosure: ({ report, issues, cwd }: import("../types.ts").
|
|
7
|
-
codeclimate: ({ report, issues, cwd }: import("../types.ts").
|
|
8
|
-
json: ({ report, issues, options, cwd }: import("../types.ts").
|
|
9
|
-
markdown: ({ report, issues, cwd }: import("../types.ts").
|
|
10
|
-
sarif: ({ report, issues, cwd }: import("../types.ts").
|
|
11
|
-
'github-actions': ({ report, issues, cwd, configurationHints, tagHints, isDisableConfigHints, isDisableTagHints, isTreatConfigHintsAsErrors, isTreatTagHintsAsErrors, configFilePath, }: import("../types.ts").
|
|
2
|
+
symbols: (options: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
3
|
+
compact: ({ report, issues, isShowProgress, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
4
|
+
codeowners: ({ report, issues, isShowProgress, options, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
5
|
+
cycles: ({ cwd, issues, isShowProgress, write }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
6
|
+
disclosure: ({ report, issues, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
7
|
+
codeclimate: ({ report, issues, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => Promise<void>;
|
|
8
|
+
json: ({ report, issues, options, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => Promise<void>;
|
|
9
|
+
markdown: ({ report, issues, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
10
|
+
sarif: ({ report, issues, cwd, write }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
11
|
+
'github-actions': ({ report, issues, cwd, configurationHints, tagHints, isDisableConfigHints, isDisableTagHints, isTreatConfigHintsAsErrors, isTreatTagHintsAsErrors, configFilePath, write, }: import("../types/issues.ts").InternalReporterOptions) => void;
|
|
12
12
|
};
|
|
13
13
|
export default _default;
|
package/dist/reporters/json.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InternalReporterOptions } from '../types/issues.ts';
|
|
2
2
|
export interface JSONReportNamedItem {
|
|
3
3
|
name: string;
|
|
4
4
|
}
|
|
@@ -35,4 +35,4 @@ export type JSONReport = {
|
|
|
35
35
|
issues: Array<JSONReportEntry>;
|
|
36
36
|
};
|
|
37
37
|
export default _default;
|
|
38
|
-
declare function _default({ report, issues, options, cwd }:
|
|
38
|
+
declare function _default({ report, issues, options, cwd, write }: InternalReporterOptions): Promise<void>;
|
package/dist/reporters/json.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createOwnershipEngine } from '../util/codeowners.js';
|
|
|
2
2
|
import { isFile } from '../util/fs.js';
|
|
3
3
|
import { relative, resolve } from '../util/path.js';
|
|
4
4
|
import { convert, flattenIssues } from './util/util.js';
|
|
5
|
-
export default async ({ report, issues, options, cwd }) => {
|
|
5
|
+
export default async ({ report, issues, options, cwd, write }) => {
|
|
6
6
|
let opts = {};
|
|
7
7
|
try {
|
|
8
8
|
opts = options ? JSON.parse(options) : opts;
|
|
@@ -56,7 +56,5 @@ export default async ({ report, issues, options, cwd }) => {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
const jsonReport = { issues: Object.values(json) };
|
|
59
|
-
|
|
60
|
-
process.stdout._handle?.setBlocking?.(true);
|
|
61
|
-
process.stdout.write(`${output}\n`);
|
|
59
|
+
write(JSON.stringify(jsonReport));
|
|
62
60
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InternalReporterOptions } from '../types/issues.ts';
|
|
2
2
|
export default _default;
|
|
3
|
-
declare function _default({ report, issues, cwd }:
|
|
3
|
+
declare function _default({ report, issues, cwd, write }: InternalReporterOptions): void;
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { relative } from '../util/path.js';
|
|
2
2
|
import { flattenIssues, getIssueTypeTitle } from './util/util.js';
|
|
3
|
-
export default ({ report, issues, cwd }) => {
|
|
4
|
-
|
|
3
|
+
export default ({ report, issues, cwd, write }) => {
|
|
4
|
+
const lines = ['# Knip report\n'];
|
|
5
5
|
const getFilePath = (issue) => {
|
|
6
6
|
if (!(issue.line && issue.col))
|
|
7
7
|
return relative(cwd, issue.filePath);
|
|
8
8
|
return `${relative(cwd, issue.filePath)}:${issue.line}:${issue.col}`;
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const getSymbol = (issue) => issue.symbol.replaceAll('|', '\\|');
|
|
11
|
+
const sortLongestSymbol = (a, b) => getSymbol(b).length - getSymbol(a).length;
|
|
11
12
|
const sortLongestFilePath = (a, b) => getFilePath(b).length - getFilePath(a).length;
|
|
12
13
|
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
13
14
|
if (isReportType) {
|
|
14
15
|
const title = getIssueTypeTitle(reportType);
|
|
15
16
|
const issuesForType = flattenIssues(issues[reportType]);
|
|
16
17
|
if (issuesForType.length > 0) {
|
|
17
|
-
|
|
18
|
-
const longestSymbol = issuesForType.sort(sortLongestSymbol)[0].
|
|
18
|
+
lines.push(`## ${title} (${issuesForType.length})\n`);
|
|
19
|
+
const longestSymbol = getSymbol(issuesForType.sort(sortLongestSymbol)[0]).length;
|
|
19
20
|
const sortedByFilePath = issuesForType.sort(sortLongestFilePath);
|
|
20
21
|
const longestFilePath = getFilePath(sortedByFilePath[0]).length;
|
|
21
22
|
const nameWidth = Math.max(longestSymbol, 'Name'.length);
|
|
22
23
|
const locationWidth = Math.max(longestFilePath, 'Location'.length);
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
lines.push(`| ${'Name'.padEnd(nameWidth)} | ${'Location'.padEnd(locationWidth)} | Severity |`);
|
|
25
|
+
lines.push(`| :${'-'.repeat(nameWidth - 1)} | :${'-'.repeat(locationWidth - 1)} | :------- |`);
|
|
25
26
|
for (const issue of sortedByFilePath) {
|
|
26
|
-
|
|
27
|
+
lines.push(`| ${getSymbol(issue).padEnd(nameWidth)} | ${getFilePath(issue).padEnd(locationWidth)} | ${(issue.severity ?? '').padEnd(8)} |`);
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
lines.push('');
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
write(lines.join('\n'));
|
|
32
34
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InternalReporterOptions } from '../types/issues.ts';
|
|
2
2
|
export default _default;
|
|
3
|
-
declare function _default({ report, issues, cwd }:
|
|
3
|
+
declare function _default({ report, issues, cwd, write }: InternalReporterOptions): void;
|
package/dist/reporters/sarif.js
CHANGED
|
@@ -28,7 +28,7 @@ const sortByLocation = (a, b) => a.filePath.localeCompare(b.filePath) ||
|
|
|
28
28
|
(a.line ?? 0) - (b.line ?? 0) ||
|
|
29
29
|
(a.col ?? 0) - (b.col ?? 0) ||
|
|
30
30
|
a.symbol.localeCompare(b.symbol);
|
|
31
|
-
export default ({ report, issues, cwd }) => {
|
|
31
|
+
export default ({ report, issues, cwd, write }) => {
|
|
32
32
|
const groups = [];
|
|
33
33
|
for (const [type, isReportType] of Object.entries(report)) {
|
|
34
34
|
if (!isReportType)
|
|
@@ -74,6 +74,5 @@ export default ({ report, issues, cwd }) => {
|
|
|
74
74
|
},
|
|
75
75
|
],
|
|
76
76
|
});
|
|
77
|
-
|
|
78
|
-
process.stdout.write(`${output}\n`);
|
|
77
|
+
write(output);
|
|
79
78
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InternalReporterOptions } from '../types/issues.ts';
|
|
2
2
|
export default _default;
|
|
3
|
-
declare function _default(options:
|
|
3
|
+
declare function _default(options: InternalReporterOptions): void;
|
|
@@ -2,24 +2,26 @@ import { printConfigurationHints, printTagHints } from './util/configuration-hin
|
|
|
2
2
|
import { dim, flattenIssues, getColoredTitle, getIssueTypeTitle, getTableForType } from './util/util.js';
|
|
3
3
|
export default (options) => {
|
|
4
4
|
const { report, issues, isDisableConfigHints, isDisableTagHints, isShowProgress } = options;
|
|
5
|
+
const lines = [];
|
|
5
6
|
let totalIssues = 0;
|
|
6
7
|
for (const [reportType, isReportType] of Object.entries(report)) {
|
|
7
8
|
if (isReportType) {
|
|
8
9
|
const title = getIssueTypeTitle(reportType);
|
|
9
10
|
const issuesForType = flattenIssues(issues[reportType]);
|
|
10
11
|
if (issuesForType.length > 0) {
|
|
11
|
-
title &&
|
|
12
|
+
title && lines.push(getColoredTitle(title, issuesForType.length));
|
|
12
13
|
const issues = typeof options.maxShowIssues === 'number'
|
|
13
14
|
? Array.from(issuesForType).slice(0, options.maxShowIssues)
|
|
14
15
|
: issuesForType;
|
|
15
16
|
if (issues.length > 0)
|
|
16
|
-
|
|
17
|
+
lines.push(getTableForType(issues, options.cwd).toString());
|
|
17
18
|
if (issues.length !== issuesForType.length)
|
|
18
|
-
|
|
19
|
+
lines.push(dim(`…${issuesForType.length - issues.length} more items`));
|
|
19
20
|
totalIssues = totalIssues + issuesForType.length;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
options.write(lines.join('\n'));
|
|
23
25
|
if (!isDisableConfigHints) {
|
|
24
26
|
printConfigurationHints(options);
|
|
25
27
|
}
|
|
@@ -30,6 +32,6 @@ export default (options) => {
|
|
|
30
32
|
isShowProgress &&
|
|
31
33
|
(!options.isTreatConfigHintsAsErrors || options.configurationHints.length === 0) &&
|
|
32
34
|
(!options.isTreatTagHintsAsErrors || options.tagHints.size === 0)) {
|
|
33
|
-
|
|
35
|
+
options.write('✂️ Excellent, Knip found no issues.');
|
|
34
36
|
}
|
|
35
37
|
};
|
package/dist/run.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare const run: (options: MainOptions) => Promise<{
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
session: {
|
|
18
|
-
listener: import("node:fs").WatchListener<string | Buffer<ArrayBufferLike>>;
|
|
19
18
|
handleFileChanges: (changes: import("./util/watch.ts").WatchChange[]) => Promise<{
|
|
20
19
|
duration: number;
|
|
21
20
|
mem: number;
|
|
@@ -29,6 +28,7 @@ export declare const run: (options: MainOptions) => Promise<{
|
|
|
29
28
|
configurationHints: import("./types/issues.ts").ConfigurationHint[];
|
|
30
29
|
hasConfigLoadErrors: boolean;
|
|
31
30
|
};
|
|
31
|
+
configurationFiles: import("./session/configuration.ts").ConfigurationFiles | undefined;
|
|
32
32
|
} | undefined;
|
|
33
33
|
streamer: ConsoleStreamer;
|
|
34
34
|
}>;
|
package/dist/run.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { watch } from 'node:fs';
|
|
2
1
|
import { createScriptParserContext } from './binaries/create-script-parser-context.js';
|
|
3
2
|
import { _getInputsFromScripts } from './binaries/index.js';
|
|
4
3
|
import { CatalogCounselor } from './CatalogCounselor.js';
|
|
@@ -9,7 +8,6 @@ import { analyze } from './graph/analyze.js';
|
|
|
9
8
|
import { build } from './graph/build.js';
|
|
10
9
|
import { IssueCollector } from './IssueCollector.js';
|
|
11
10
|
import { ProjectPrincipal } from './ProjectPrincipal.js';
|
|
12
|
-
import watchReporter from './reporters/watch.js';
|
|
13
11
|
import { debugLogObject } from './util/debug.js';
|
|
14
12
|
import { flushGitignoreCache, initGitignoreCache } from './util/gitignore-cache.js';
|
|
15
13
|
import { flushGlobCache, initGlobCache } from './util/glob-cache.js';
|
|
@@ -68,7 +66,7 @@ export const run = async (options) => {
|
|
|
68
66
|
collector.setIgnoreIssues(chief.getIgnoreIssues());
|
|
69
67
|
debugLogObject('*', 'Included workspaces', () => workspaces.map(w => w.pkgName));
|
|
70
68
|
debugLogObject('*', 'Included workspace configs', () => workspaces.map(w => ({ pkgName: w.pkgName, name: w.name, config: w.config, ancestors: w.ancestors })));
|
|
71
|
-
const { graph, entryPaths, analyzedFiles, unreferencedFiles, analyzeSourceFile, enabledPluginsStore } = await build({
|
|
69
|
+
const { graph, entryPaths, analyzedFiles, unreferencedFiles, analyzeSourceFile, enabledPluginsStore, configurationFiles, } = await build({
|
|
72
70
|
chief,
|
|
73
71
|
collector,
|
|
74
72
|
counselor,
|
|
@@ -93,13 +91,10 @@ export const run = async (options) => {
|
|
|
93
91
|
options,
|
|
94
92
|
});
|
|
95
93
|
let session;
|
|
96
|
-
if (options.
|
|
94
|
+
if (options.isSession) {
|
|
97
95
|
const isIgnored = (filePath) => (!!options.cacheLocation && filePath.startsWith(options.cacheLocation)) ||
|
|
98
96
|
filePath.includes('/.git/') ||
|
|
99
97
|
isGitIgnored(filePath);
|
|
100
|
-
const onFileChange = options.isWatch
|
|
101
|
-
? ({ issues, duration }) => watchReporter(options, { issues, streamer, size: analyzedFiles.size, duration })
|
|
102
|
-
: undefined;
|
|
103
98
|
session = await getSessionHandler(options, {
|
|
104
99
|
analyzedFiles,
|
|
105
100
|
analyzeSourceFile,
|
|
@@ -108,13 +103,11 @@ export const run = async (options) => {
|
|
|
108
103
|
analyze: reAnalyze,
|
|
109
104
|
principal,
|
|
110
105
|
graph,
|
|
106
|
+
configurationFiles,
|
|
111
107
|
isIgnored,
|
|
112
|
-
onFileChange,
|
|
113
108
|
unreferencedFiles,
|
|
114
109
|
entryPaths,
|
|
115
110
|
});
|
|
116
|
-
if (options.isWatch)
|
|
117
|
-
watch(options.cwd, { recursive: true }, session.listener);
|
|
118
111
|
}
|
|
119
112
|
const { issues, counters, tagHints, configurationHints, hasConfigLoadErrors } = collector.getIssues();
|
|
120
113
|
if (!options.isWatch)
|
|
@@ -281,6 +281,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
281
281
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
282
282
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
283
283
|
}, z.core.$strip>]>>;
|
|
284
|
+
'kysely-codegen': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
285
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
286
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
287
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
288
|
+
}, z.core.$strip>]>>;
|
|
284
289
|
ladle: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
285
290
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
286
291
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -296,6 +301,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
296
301
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
297
302
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
298
303
|
}, z.core.$strip>]>>;
|
|
304
|
+
lingui: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
305
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
306
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
307
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
308
|
+
}, z.core.$strip>]>>;
|
|
299
309
|
'lint-staged': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
300
310
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
301
311
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -336,6 +346,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
336
346
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
337
347
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
338
348
|
}, z.core.$strip>]>>;
|
|
349
|
+
mastra: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
350
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
351
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
352
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
353
|
+
}, z.core.$strip>]>>;
|
|
339
354
|
mcp: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
340
355
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
341
356
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -566,6 +581,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
566
581
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
567
582
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
568
583
|
}, z.core.$strip>]>>;
|
|
584
|
+
purgecss: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
585
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
586
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
587
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
588
|
+
}, z.core.$strip>]>>;
|
|
569
589
|
quasar: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
570
590
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
571
591
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -1288,6 +1308,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1288
1308
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1289
1309
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1290
1310
|
}, z.core.$strip>]>>;
|
|
1311
|
+
'kysely-codegen': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1312
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1313
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1314
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1315
|
+
}, z.core.$strip>]>>;
|
|
1291
1316
|
ladle: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1292
1317
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1293
1318
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -1303,6 +1328,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1303
1328
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1304
1329
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1305
1330
|
}, z.core.$strip>]>>;
|
|
1331
|
+
lingui: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1332
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1333
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1334
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1335
|
+
}, z.core.$strip>]>>;
|
|
1306
1336
|
'lint-staged': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1307
1337
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1308
1338
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -1343,6 +1373,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1343
1373
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1344
1374
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1345
1375
|
}, z.core.$strip>]>>;
|
|
1376
|
+
mastra: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1377
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1378
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1379
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1380
|
+
}, z.core.$strip>]>>;
|
|
1346
1381
|
mcp: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1347
1382
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1348
1383
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -1573,6 +1608,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1573
1608
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1574
1609
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1575
1610
|
}, z.core.$strip>]>>;
|
|
1611
|
+
purgecss: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1612
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1613
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1614
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1615
|
+
}, z.core.$strip>]>>;
|
|
1576
1616
|
quasar: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1577
1617
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1578
1618
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -2314,6 +2354,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2314
2354
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2315
2355
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2316
2356
|
}, z.core.$strip>]>>;
|
|
2357
|
+
'kysely-codegen': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2358
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2359
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2360
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2361
|
+
}, z.core.$strip>]>>;
|
|
2317
2362
|
ladle: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2318
2363
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2319
2364
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -2329,6 +2374,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2329
2374
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2330
2375
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2331
2376
|
}, z.core.$strip>]>>;
|
|
2377
|
+
lingui: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2378
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2379
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2380
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2381
|
+
}, z.core.$strip>]>>;
|
|
2332
2382
|
'lint-staged': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2333
2383
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2334
2384
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -2369,6 +2419,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2369
2419
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2370
2420
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2371
2421
|
}, z.core.$strip>]>>;
|
|
2422
|
+
mastra: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2423
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2424
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2425
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2426
|
+
}, z.core.$strip>]>>;
|
|
2372
2427
|
mcp: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2373
2428
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2374
2429
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -2599,6 +2654,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2599
2654
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2600
2655
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2601
2656
|
}, z.core.$strip>]>>;
|
|
2657
|
+
purgecss: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2658
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2659
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2660
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2661
|
+
}, z.core.$strip>]>>;
|
|
2602
2662
|
quasar: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2603
2663
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2604
2664
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
package/dist/schema/plugins.d.ts
CHANGED
|
@@ -286,6 +286,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
|
|
|
286
286
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
287
287
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
288
288
|
}, z.core.$strip>]>;
|
|
289
|
+
'kysely-codegen': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
290
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
291
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
292
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
293
|
+
}, z.core.$strip>]>;
|
|
289
294
|
ladle: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
290
295
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
291
296
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -301,6 +306,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
|
|
|
301
306
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
302
307
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
303
308
|
}, z.core.$strip>]>;
|
|
309
|
+
lingui: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
310
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
311
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
312
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
313
|
+
}, z.core.$strip>]>;
|
|
304
314
|
'lint-staged': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
305
315
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
306
316
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -341,6 +351,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
|
|
|
341
351
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
342
352
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
343
353
|
}, z.core.$strip>]>;
|
|
354
|
+
mastra: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
355
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
356
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
357
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
358
|
+
}, z.core.$strip>]>;
|
|
344
359
|
mcp: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
345
360
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
346
361
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -571,6 +586,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
|
|
|
571
586
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
572
587
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
573
588
|
}, z.core.$strip>]>;
|
|
589
|
+
purgecss: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
590
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
591
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
592
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
593
|
+
}, z.core.$strip>]>;
|
|
574
594
|
quasar: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
575
595
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
576
596
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
package/dist/schema/plugins.js
CHANGED
|
@@ -66,9 +66,11 @@ export const pluginsSchema = z.object({
|
|
|
66
66
|
jest: pluginSchema,
|
|
67
67
|
karma: pluginSchema,
|
|
68
68
|
knex: pluginSchema,
|
|
69
|
+
'kysely-codegen': pluginSchema,
|
|
69
70
|
ladle: pluginSchema,
|
|
70
71
|
'laravel-vite-plugin': pluginSchema,
|
|
71
72
|
lefthook: pluginSchema,
|
|
73
|
+
lingui: pluginSchema,
|
|
72
74
|
'lint-staged': pluginSchema,
|
|
73
75
|
linthtml: pluginSchema,
|
|
74
76
|
lit: pluginSchema,
|
|
@@ -77,6 +79,7 @@ export const pluginsSchema = z.object({
|
|
|
77
79
|
lunaria: pluginSchema,
|
|
78
80
|
markdownlint: pluginSchema,
|
|
79
81
|
marko: pluginSchema,
|
|
82
|
+
mastra: pluginSchema,
|
|
80
83
|
mcp: pluginSchema,
|
|
81
84
|
mdx: pluginSchema,
|
|
82
85
|
mdxlint: pluginSchema,
|
|
@@ -123,6 +126,7 @@ export const pluginsSchema = z.object({
|
|
|
123
126
|
preconstruct: pluginSchema,
|
|
124
127
|
prettier: pluginSchema,
|
|
125
128
|
prisma: pluginSchema,
|
|
129
|
+
purgecss: pluginSchema,
|
|
126
130
|
quasar: pluginSchema,
|
|
127
131
|
qwik: pluginSchema,
|
|
128
132
|
railway: pluginSchema,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MainOptions } from '../util/create-options.ts';
|
|
2
|
+
import type { WatchChange } from '../util/watch.ts';
|
|
3
|
+
export declare class SessionConfigurationChangedError extends Error {
|
|
4
|
+
constructor(filePath: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class ConfigurationFiles {
|
|
7
|
+
paths: Set<string>;
|
|
8
|
+
private importers;
|
|
9
|
+
private matchers;
|
|
10
|
+
constructor(options: MainOptions);
|
|
11
|
+
addPatterns(dir: string, patterns: string[]): void;
|
|
12
|
+
addImport(importer: string, imported: string): void;
|
|
13
|
+
getAffected(changes: WatchChange[], cwd: string): Set<string>;
|
|
14
|
+
getChange(changes: WatchChange[], cwd: string): SessionConfigurationChangedError | undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import picomatch from 'picomatch';
|
|
2
|
+
import { KNIP_CONFIG_LOCATIONS } from '../constants.js';
|
|
3
|
+
import { isAbsolute, isInNodeModules, join, relative, toAbsolute, toPosix, toRelative } from '../util/path.js';
|
|
4
|
+
export class SessionConfigurationChangedError extends Error {
|
|
5
|
+
constructor(filePath) {
|
|
6
|
+
super(`Configuration changed (${filePath})`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class ConfigurationFiles {
|
|
10
|
+
paths = new Set();
|
|
11
|
+
importers = new Map();
|
|
12
|
+
matchers = [];
|
|
13
|
+
constructor(options) {
|
|
14
|
+
const manifests = [];
|
|
15
|
+
for (const pattern of options.workspaces)
|
|
16
|
+
manifests.push(join(pattern, 'package.json'));
|
|
17
|
+
this.addPatterns(options.cwd, [...KNIP_CONFIG_LOCATIONS, 'pnpm-workspace.yaml', '**/.gitignore', ...manifests]);
|
|
18
|
+
if (options.configFilePath)
|
|
19
|
+
this.paths.add(options.configFilePath);
|
|
20
|
+
for (const filePath of options.preprocessorInputs)
|
|
21
|
+
if (isAbsolute(filePath))
|
|
22
|
+
this.paths.add(filePath);
|
|
23
|
+
}
|
|
24
|
+
addPatterns(dir, patterns) {
|
|
25
|
+
const included = [];
|
|
26
|
+
const excluded = [];
|
|
27
|
+
for (const pattern of patterns) {
|
|
28
|
+
if (pattern.startsWith('!'))
|
|
29
|
+
excluded.push(toRelative(pattern.slice(1), dir));
|
|
30
|
+
else
|
|
31
|
+
included.push(toRelative(pattern, dir));
|
|
32
|
+
}
|
|
33
|
+
if (included.length > 0)
|
|
34
|
+
this.matchers.push({ dir, isMatch: picomatch(included, { dot: true, ignore: excluded }) });
|
|
35
|
+
}
|
|
36
|
+
addImport(importer, imported) {
|
|
37
|
+
this.paths.add(imported);
|
|
38
|
+
const importers = this.importers.get(imported);
|
|
39
|
+
if (importers)
|
|
40
|
+
importers.add(importer);
|
|
41
|
+
else
|
|
42
|
+
this.importers.set(imported, new Set([importer]));
|
|
43
|
+
}
|
|
44
|
+
getAffected(changes, cwd) {
|
|
45
|
+
const affected = new Set();
|
|
46
|
+
for (const change of changes)
|
|
47
|
+
affected.add(toAbsolute(toPosix(change.filePath), cwd));
|
|
48
|
+
for (const filePath of affected) {
|
|
49
|
+
for (const importer of this.importers.get(filePath) ?? [])
|
|
50
|
+
affected.add(importer);
|
|
51
|
+
}
|
|
52
|
+
return affected;
|
|
53
|
+
}
|
|
54
|
+
getChange(changes, cwd) {
|
|
55
|
+
for (const change of changes) {
|
|
56
|
+
const filePath = toAbsolute(toPosix(change.filePath), cwd);
|
|
57
|
+
if (this.paths.has(filePath) ||
|
|
58
|
+
(!isInNodeModules(filePath) && this.matchers.some(({ dir, isMatch }) => isMatch(relative(dir, filePath)))))
|
|
59
|
+
return new SessionConfigurationChangedError(toRelative(filePath, cwd));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { FileNode } from '../types/module-graph.ts';
|
|
2
|
+
export declare const isIncrementalFile: (file: FileNode) => boolean;
|
|
3
|
+
export declare const getFileTopology: (file: FileNode) => {
|
|
4
|
+
internal: import("../types/module-graph.ts").ImportMap;
|
|
5
|
+
paths: string[];
|
|
6
|
+
imports: {
|
|
7
|
+
specifier: string;
|
|
8
|
+
filePath: string | undefined;
|
|
9
|
+
identifier: string | undefined;
|
|
10
|
+
alias: string | undefined;
|
|
11
|
+
isTypeOnly: boolean;
|
|
12
|
+
modifiers: number;
|
|
13
|
+
jsDocTags: Set<string> | undefined;
|
|
14
|
+
}[];
|
|
15
|
+
external: {
|
|
16
|
+
specifier: string;
|
|
17
|
+
filePath: string | undefined;
|
|
18
|
+
identifier: string | undefined;
|
|
19
|
+
alias: string | undefined;
|
|
20
|
+
isTypeOnly: boolean;
|
|
21
|
+
modifiers: number;
|
|
22
|
+
jsDocTags: Set<string> | undefined;
|
|
23
|
+
}[];
|
|
24
|
+
unresolved: {
|
|
25
|
+
specifier: string;
|
|
26
|
+
filePath: string | undefined;
|
|
27
|
+
identifier: string | undefined;
|
|
28
|
+
alias: string | undefined;
|
|
29
|
+
isTypeOnly: boolean;
|
|
30
|
+
modifiers: number;
|
|
31
|
+
jsDocTags: Set<string> | undefined;
|
|
32
|
+
}[];
|
|
33
|
+
externalRefs: Set<import("../types/module-graph.ts").ExternalRef>;
|
|
34
|
+
exports: {
|
|
35
|
+
identifier: string;
|
|
36
|
+
binding: string;
|
|
37
|
+
type: import("../types/issues.ts").SymbolType;
|
|
38
|
+
jsDocTags: Set<string>;
|
|
39
|
+
hasRefsInFile: boolean;
|
|
40
|
+
isRegistered: boolean;
|
|
41
|
+
referencedIn: Set<string> | undefined;
|
|
42
|
+
isReExport: boolean;
|
|
43
|
+
isBindingReExport: boolean;
|
|
44
|
+
members: {
|
|
45
|
+
identifier: string;
|
|
46
|
+
type: import("../types/issues.ts").SymbolType;
|
|
47
|
+
flags: number;
|
|
48
|
+
jsDocTags: Set<string>;
|
|
49
|
+
hasRefsInFile: boolean;
|
|
50
|
+
}[];
|
|
51
|
+
}[];
|
|
52
|
+
skipExports: boolean;
|
|
53
|
+
};
|
|
54
|
+
export declare const hasSameTopology: (before: ReturnType<typeof getFileTopology>, after: FileNode) => boolean;
|