knip 5.55.1 → 5.56.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.
Files changed (54) hide show
  1. package/README.md +1 -1
  2. package/dist/CacheConsultant.d.ts +1 -0
  3. package/dist/CacheConsultant.js +1 -1
  4. package/dist/ConfigurationChief.d.ts +1 -0
  5. package/dist/DependencyDeputy.d.ts +2 -0
  6. package/dist/DependencyDeputy.js +6 -0
  7. package/dist/PrincipalFactory.d.ts +2 -9
  8. package/dist/PrincipalFactory.js +10 -6
  9. package/dist/ProjectPrincipal.d.ts +1 -1
  10. package/dist/ProjectPrincipal.js +3 -3
  11. package/dist/WorkspaceWorker.js +1 -1
  12. package/dist/cli.js +6 -5
  13. package/dist/compilers/index.d.ts +10 -0
  14. package/dist/graph/build.js +11 -2
  15. package/dist/plugins/docusaurus/helpers.d.ts +5 -0
  16. package/dist/plugins/docusaurus/helpers.js +89 -0
  17. package/dist/plugins/docusaurus/index.d.ts +12 -0
  18. package/dist/plugins/docusaurus/index.js +36 -0
  19. package/dist/plugins/docusaurus/types.d.ts +40 -0
  20. package/dist/plugins/docusaurus/types.js +1 -0
  21. package/dist/plugins/index.d.ts +9 -0
  22. package/dist/plugins/index.js +2 -0
  23. package/dist/reporters/codeclimate.js +3 -3
  24. package/dist/reporters/codeowners.js +15 -30
  25. package/dist/reporters/compact.js +10 -4
  26. package/dist/reporters/disclosure.js +5 -24
  27. package/dist/reporters/markdown.js +2 -2
  28. package/dist/reporters/symbols.d.ts +1 -1
  29. package/dist/reporters/symbols.js +10 -45
  30. package/dist/reporters/util.d.ts +11 -7
  31. package/dist/reporters/util.js +45 -14
  32. package/dist/reporters/watch.js +7 -21
  33. package/dist/schema/configuration.d.ts +56 -0
  34. package/dist/schema/plugins.d.ts +23 -0
  35. package/dist/schema/plugins.js +1 -0
  36. package/dist/types/PluginNames.d.ts +2 -2
  37. package/dist/types/PluginNames.js +1 -0
  38. package/dist/types/project.d.ts +1 -0
  39. package/dist/typescript/resolve-module-names.js +2 -2
  40. package/dist/util/Performance.d.ts +7 -7
  41. package/dist/util/Performance.js +20 -16
  42. package/dist/util/cli-arguments.d.ts +2 -1
  43. package/dist/util/cli-arguments.js +2 -0
  44. package/dist/util/input.d.ts +8 -1
  45. package/dist/util/input.js +6 -0
  46. package/dist/util/resolve.d.ts +3 -1
  47. package/dist/util/resolve.js +7 -9
  48. package/dist/util/table.d.ts +4 -2
  49. package/dist/util/table.js +20 -24
  50. package/dist/util/watch.js +2 -2
  51. package/dist/version.d.ts +1 -1
  52. package/dist/version.js +1 -1
  53. package/package.json +2 -2
  54. package/schema.json +4 -0
@@ -1,35 +1,16 @@
1
- import { relative } from '../util/path.js';
2
- import { Table } from '../util/table.js';
3
- import { getTitle } from './util.js';
4
- const printHeader = (size, title) => console.log(`<details>\n${title ? `<summary>${title} (${size})</summary>\n` : ''}\n\`\`\``);
5
- const printFooter = () => console.log('```\n\n</details>\n');
6
- const logIssueRecord = (issues) => {
7
- const table = new Table();
8
- for (const issue of issues) {
9
- table.cell('symbol', issue.symbols ? issue.symbols.map(s => s.symbol).join(', ') : issue.symbol);
10
- table.cell('parentSymbol', issue.parentSymbol && issue.parentSymbol);
11
- table.cell('symbolType', issue.symbolType && issue.symbolType);
12
- const pos = issue.line === undefined ? '' : `:${issue.line}${issue.col === undefined ? '' : `:${issue.col}`}`;
13
- const cell = issue.type === 'files' ? '' : `${relative(issue.filePath)}${pos}`;
14
- table.cell('filePath', cell);
15
- table.newRow();
16
- }
17
- console.log(table.sort('filePath').toString());
18
- };
1
+ import { getIssueTypeTitle, getTableForType } from './util.js';
19
2
  export default ({ report, issues }) => {
20
3
  const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
21
- let totalIssues = 0;
22
4
  for (let [reportType, isReportType] of Object.entries(report)) {
23
5
  if (reportType === 'files')
24
6
  reportType = '_files';
25
7
  if (isReportType) {
26
- const title = reportMultipleGroups ? getTitle(reportType) : undefined;
8
+ const title = reportMultipleGroups ? getIssueTypeTitle(reportType) : undefined;
27
9
  const issuesForType = Object.values(issues[reportType]).flatMap(Object.values);
28
10
  if (issuesForType.length > 0) {
29
- printHeader(issuesForType.length, title);
30
- logIssueRecord(issuesForType);
31
- totalIssues = totalIssues + issuesForType.length;
32
- printFooter();
11
+ console.log(`<details>\n${title ? `<summary>${title} (${issuesForType.length})</summary>\n` : ''}\n\`\`\``);
12
+ console.log(getTableForType(issuesForType, { isUseColors: false }).toString());
13
+ console.log('```\n\n</details>\n');
33
14
  }
34
15
  }
35
16
  }
@@ -1,5 +1,5 @@
1
1
  import { relative, toRelative } from '../util/path.js';
2
- import { getTitle } from './util.js';
2
+ import { getIssueTypeTitle } from './util.js';
3
3
  export default ({ report, issues }) => {
4
4
  console.log('# Knip report\n');
5
5
  const getFilePath = (issue) => {
@@ -11,7 +11,7 @@ export default ({ report, issues }) => {
11
11
  const sortLongestFilePath = (a, b) => getFilePath(b).length - getFilePath(a).length;
12
12
  for (const [reportType, isReportType] of Object.entries(report)) {
13
13
  if (isReportType) {
14
- const title = getTitle(reportType);
14
+ const title = getIssueTypeTitle(reportType);
15
15
  const isSet = issues[reportType] instanceof Set;
16
16
  const issuesForType = isSet
17
17
  ? Array.from(issues[reportType])
@@ -1,3 +1,3 @@
1
- import { type ReporterOptions } from '../types/issues.js';
1
+ import type { ReporterOptions } from '../types/issues.js';
2
2
  declare const _default: ({ report, issues, tagHints, configurationHints, isDisableConfigHints, isTreatConfigHintsAsErrors, isShowProgress, }: ReporterOptions) => void;
3
3
  export default _default;
@@ -1,41 +1,6 @@
1
- import picocolors from 'picocolors';
2
1
  import { ROOT_WORKSPACE_NAME } from '../constants.js';
3
- import { SymbolType } from '../types/issues.js';
4
- import { relative, toRelative } from '../util/path.js';
5
- import { Table } from '../util/table.js';
6
- import { getTitle, identity, logTitle, logTitleDimmed } from './util.js';
7
- const dim = picocolors.gray;
8
- const bright = picocolors.whiteBright;
9
- const sortByPos = (a, b) => {
10
- const [f, r, c] = a.filePath.value.split(':');
11
- const [f2, r2, c2] = b.filePath.value.split(':');
12
- return f === f2 ? (Number(r) === Number(r2) ? Number(c) - Number(c2) : Number(r) - Number(r2)) : f.localeCompare(f2);
13
- };
14
- const highlightPkg = (issue) => (_) => {
15
- if (issue.specifier && issue.specifier !== issue.symbol && issue.specifier.includes(issue.symbol)) {
16
- const parts = issue.specifier.split(issue.symbol);
17
- const left = parts[0];
18
- const right = parts.slice(1).join('');
19
- return [dim(left), bright(issue.symbol), dim(right)].join('');
20
- }
21
- return issue.symbol;
22
- };
23
- const logIssueRecord = (issues) => {
24
- const table = new Table({ truncateStart: ['filePath'], noTruncate: ['symbolType'] });
25
- for (const issue of issues) {
26
- table.newRow();
27
- const print = issue.isFixed || issue.severity === 'warn' ? dim : identity;
28
- const symbols = issue.symbols;
29
- table.cell('symbol', print(symbols ? symbols.map(s => s.symbol).join(', ') : issue.symbol), highlightPkg(issue));
30
- table.cell('parentSymbol', issue.parentSymbol && print(issue.parentSymbol));
31
- table.cell('symbolType', issue.symbolType && issue.symbolType !== SymbolType.UNKNOWN && print(issue.symbolType));
32
- const pos = issue.line === undefined ? '' : `:${issue.line}${issue.col === undefined ? '' : `:${issue.col}`}`;
33
- const cell = issue.type === 'files' ? '' : `${relative(issue.filePath)}${pos}`;
34
- table.cell('filePath', print(cell));
35
- table.cell('fixed', issue.isFixed && print('(removed)'));
36
- }
37
- console.log(table.sort(sortByPos).toString());
38
- };
2
+ import { toRelative } from '../util/path.js';
3
+ import { dim, getColoredTitle, getDimmedTitle, getIssueTypeTitle, getTableForType, plain } from './util.js';
39
4
  export default ({ report, issues, tagHints, configurationHints, isDisableConfigHints, isTreatConfigHintsAsErrors, isShowProgress, }) => {
40
5
  const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
41
6
  let totalIssues = 0;
@@ -43,29 +8,29 @@ export default ({ report, issues, tagHints, configurationHints, isDisableConfigH
43
8
  if (reportType === 'files')
44
9
  reportType = '_files';
45
10
  if (isReportType) {
46
- const title = reportMultipleGroups && getTitle(reportType);
11
+ const title = reportMultipleGroups && getIssueTypeTitle(reportType);
47
12
  const issuesForType = Object.values(issues[reportType]).flatMap(Object.values);
48
13
  if (issuesForType.length > 0) {
49
- title && logTitle(title, issuesForType.length);
50
- logIssueRecord(issuesForType);
14
+ title && console.log(getColoredTitle(title, issuesForType.length));
15
+ console.log(getTableForType(issuesForType).toString());
51
16
  totalIssues = totalIssues + issuesForType.length;
52
17
  }
53
18
  }
54
19
  }
55
20
  if (!isDisableConfigHints) {
56
21
  if (configurationHints.size > 0) {
57
- const _logTitle = isTreatConfigHintsAsErrors ? logTitle : logTitleDimmed;
58
- const _color = isTreatConfigHintsAsErrors ? identity : dim;
59
- _logTitle('Configuration hints', configurationHints.size);
22
+ const getTitle = isTreatConfigHintsAsErrors ? getColoredTitle : getDimmedTitle;
23
+ console.log(getTitle('Configuration hints', configurationHints.size));
24
+ const style = isTreatConfigHintsAsErrors ? plain : dim;
60
25
  for (const hint of configurationHints) {
61
26
  const { type, workspaceName, identifier } = hint;
62
27
  const message = `Unused item in ${type}`;
63
28
  const workspace = workspaceName && workspaceName !== ROOT_WORKSPACE_NAME ? ` (workspace: ${workspaceName})` : '';
64
- console.warn(_color(`${message}${workspace}:`), identifier);
29
+ console.warn(style(`${message}${workspace}:`), identifier);
65
30
  }
66
31
  }
67
32
  if (tagHints.size > 0) {
68
- logTitle('Tag issues', tagHints.size);
33
+ console.log(getColoredTitle('Tag issues', tagHints.size));
69
34
  for (const hint of tagHints) {
70
35
  const { filePath, identifier, tagName } = hint;
71
36
  const message = `Unused tag in ${toRelative(filePath)}:`;
@@ -1,9 +1,11 @@
1
1
  import { ISSUE_TYPE_TITLE } from '../constants.js';
2
- import type { Issue, IssueSeverity, IssueSymbol } from '../types/issues.js';
3
- export declare const identity: (text: string) => string;
4
- export declare const getTitle: (reportType: keyof typeof ISSUE_TYPE_TITLE) => string;
5
- export declare const logTitle: (title: string, count: number) => void;
6
- export declare const logTitleDimmed: (title: string) => void;
2
+ import { type Issue, type IssueSeverity, type IssueSymbol } from '../types/issues.js';
3
+ import { Table } from '../util/table.js';
4
+ export declare const plain: (text: string) => string;
5
+ export declare const dim: import("picocolors/types.js").Formatter;
6
+ export declare const getIssueTypeTitle: (reportType: keyof typeof ISSUE_TYPE_TITLE) => string;
7
+ export declare const getColoredTitle: (title: string, count: number) => string;
8
+ export declare const getDimmedTitle: (title: string) => string;
7
9
  type LogIssueLine = {
8
10
  owner?: string;
9
11
  filePath: string;
@@ -11,12 +13,14 @@ type LogIssueLine = {
11
13
  parentSymbol?: string;
12
14
  severity?: IssueSeverity;
13
15
  };
14
- export declare const logIssueLine: ({ owner, filePath, symbols, parentSymbol, severity }: LogIssueLine) => void;
15
- export declare const logIssueSet: (issues: string[]) => void;
16
+ export declare const getIssueLine: ({ owner, filePath, symbols, parentSymbol, severity }: LogIssueLine) => string;
16
17
  export declare const convert: (issue: Issue | IssueSymbol) => {
17
18
  name: string;
18
19
  line: number | undefined;
19
20
  col: number | undefined;
20
21
  pos: number | undefined;
21
22
  };
23
+ export declare const getTableForType: (issues: Issue[], options?: {
24
+ isUseColors?: boolean;
25
+ }) => Table;
22
26
  export {};
@@ -1,21 +1,19 @@
1
1
  import picocolors from 'picocolors';
2
2
  import { ISSUE_TYPE_TITLE } from '../constants.js';
3
- import { relative, toRelative } from '../util/path.js';
4
- export const identity = (text) => text;
5
- export const getTitle = (reportType) => {
6
- return ISSUE_TYPE_TITLE[reportType];
7
- };
8
- export const logTitle = (title, count) => console.log(`${picocolors.yellowBright(picocolors.underline(title))} (${count})`);
9
- export const logTitleDimmed = (title) => console.log(`${picocolors.yellow(picocolors.underline(`${title}`))}`);
10
- export const logIssueLine = ({ owner, filePath, symbols, parentSymbol, severity }) => {
3
+ import { SymbolType } from '../types/issues.js';
4
+ import { relative } from '../util/path.js';
5
+ import { Table } from '../util/table.js';
6
+ export const plain = (text) => text;
7
+ export const dim = picocolors.gray;
8
+ const bright = picocolors.whiteBright;
9
+ export const getIssueTypeTitle = (reportType) => ISSUE_TYPE_TITLE[reportType];
10
+ export const getColoredTitle = (title, count) => `${picocolors.yellowBright(picocolors.underline(title))} (${count})`;
11
+ export const getDimmedTitle = (title) => `${picocolors.yellow(picocolors.underline(`${title}`))}`;
12
+ export const getIssueLine = ({ owner, filePath, symbols, parentSymbol, severity }) => {
11
13
  const symbol = symbols ? `: ${symbols.map(s => s.symbol).join(', ')}` : '';
12
14
  const parent = parentSymbol ? ` (${parentSymbol})` : '';
13
- const print = severity === 'warn' ? picocolors.gray : identity;
14
- console.log(`${owner ? `${picocolors.cyan(owner)} ` : ''}${print(`${relative(filePath)}${symbol}${parent}`)}`);
15
- };
16
- export const logIssueSet = (issues) => {
17
- for (const value of issues.sort())
18
- console.log(toRelative(value));
15
+ const print = severity === 'warn' ? dim : plain;
16
+ return `${owner ? `${picocolors.cyan(owner)} ` : ''}${print(`${relative(filePath)}${symbol}${parent}`)}`;
19
17
  };
20
18
  export const convert = (issue) => ({
21
19
  name: issue.symbol,
@@ -23,3 +21,36 @@ export const convert = (issue) => ({
23
21
  col: issue.col,
24
22
  pos: issue.pos,
25
23
  });
24
+ const sortByPos = (a, b) => {
25
+ const [filePathA, rowA, colA] = a.filePath.split(':');
26
+ const [filePathB, rowB, colB] = b.filePath.split(':');
27
+ return filePathA === filePathB
28
+ ? Number(rowA) === Number(rowB)
29
+ ? Number(colA) - Number(colB)
30
+ : Number(rowA) - Number(rowB)
31
+ : filePathA.localeCompare(filePathB);
32
+ };
33
+ const highlightSymbol = (issue) => (_) => {
34
+ if (issue.specifier && issue.specifier !== issue.symbol && issue.specifier.includes(issue.symbol)) {
35
+ const parts = issue.specifier.split(issue.symbol);
36
+ const rest = parts.slice(1).join('');
37
+ return [dim(parts[0]), bright(issue.symbol), dim(rest)].join('');
38
+ }
39
+ return issue.symbol;
40
+ };
41
+ export const getTableForType = (issues, options = { isUseColors: true }) => {
42
+ const table = new Table({ truncateStart: ['filePath'], noTruncate: ['symbolType'] });
43
+ for (const issue of issues.sort(sortByPos)) {
44
+ table.row();
45
+ const print = options.isUseColors && (issue.isFixed || issue.severity === 'warn') ? dim : plain;
46
+ const symbol = issue.symbols ? issue.symbols.map(s => s.symbol).join(', ') : issue.symbol;
47
+ table.cell('symbol', print(symbol), options.isUseColors ? highlightSymbol(issue) : () => symbol);
48
+ table.cell('parentSymbol', issue.parentSymbol && print(issue.parentSymbol));
49
+ table.cell('symbolType', issue.symbolType && issue.symbolType !== SymbolType.UNKNOWN && print(issue.symbolType));
50
+ const pos = issue.line === undefined ? '' : `:${issue.line}${issue.col === undefined ? '' : `:${issue.col}`}`;
51
+ const cell = issue.type === 'files' ? '' : `${relative(issue.filePath)}${pos}`;
52
+ table.cell('filePath', print(cell));
53
+ table.cell('fixed', issue.isFixed && print('(removed)'));
54
+ }
55
+ return table;
56
+ };
@@ -1,36 +1,22 @@
1
1
  import picocolors from 'picocolors';
2
2
  import { perfObserver } from '../util/Performance.js';
3
- import { relative } from '../util/path.js';
4
3
  import { prettyMilliseconds } from '../util/string.js';
5
- import { getTitle } from './util.js';
4
+ import { getIssueTypeTitle, getTableForType } from './util.js';
6
5
  export default ({ report, issues, streamer, startTime, size, isDebug }) => {
7
6
  const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
8
7
  let totalIssues = 0;
9
8
  const lines = [];
10
- for (const [reportType, isReportType] of Object.entries(report)) {
11
- if (reportType === '_files')
12
- continue;
9
+ for (let [reportType, isReportType] of Object.entries(report)) {
10
+ if (reportType === 'files')
11
+ reportType = '_files';
13
12
  if (isReportType) {
14
- const title = reportMultipleGroups && getTitle(reportType);
15
- const isSet = issues[reportType] instanceof Set;
16
- const issuesForType = isSet
17
- ? Array.from(issues[reportType])
18
- : Object.values(issues[reportType]).flatMap(Object.values);
13
+ const title = reportMultipleGroups && getIssueTypeTitle(reportType);
14
+ const issuesForType = Object.values(issues[reportType]).flatMap(Object.values);
19
15
  if (issuesForType.length > 0) {
20
16
  if (title) {
21
17
  lines.push(`${picocolors.yellowBright(picocolors.underline(title))} (${issuesForType.length})`);
22
18
  }
23
- if (typeof issuesForType[0] === 'string') {
24
- lines.push(...issuesForType.map(filePath => relative(filePath)));
25
- }
26
- else {
27
- const width = issuesForType.reduce((max, issue) => Math.max(max, issue.symbol.length), 0) + 1;
28
- for (const issue of issuesForType) {
29
- const filePath = relative(issue.filePath);
30
- const pos = issue.line ? `:${issue.line}:${issue.col}` : '';
31
- lines.push(`${issue.symbol.padEnd(width)} ${filePath}${pos}`);
32
- }
33
- }
19
+ lines.push(...getTableForType(issuesForType).toRows());
34
20
  }
35
21
  totalIssues = totalIssues + issuesForType.length;
36
22
  }
@@ -228,6 +228,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
228
228
  entry?: string | string[] | undefined;
229
229
  project?: string | string[] | undefined;
230
230
  }>]>>;
231
+ docusaurus: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
232
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
233
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
234
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ config?: string | string[] | undefined;
237
+ entry?: string | string[] | undefined;
238
+ project?: string | string[] | undefined;
239
+ }, {
240
+ config?: string | string[] | undefined;
241
+ entry?: string | string[] | undefined;
242
+ project?: string | string[] | undefined;
243
+ }>]>>;
231
244
  dotenv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
232
245
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
233
246
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1442,6 +1455,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
1442
1455
  entry?: string | string[] | undefined;
1443
1456
  project?: string | string[] | undefined;
1444
1457
  } | undefined;
1458
+ docusaurus?: string | boolean | string[] | {
1459
+ config?: string | string[] | undefined;
1460
+ entry?: string | string[] | undefined;
1461
+ project?: string | string[] | undefined;
1462
+ } | undefined;
1445
1463
  dotenv?: string | boolean | string[] | {
1446
1464
  config?: string | string[] | undefined;
1447
1465
  entry?: string | string[] | undefined;
@@ -1962,6 +1980,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
1962
1980
  entry?: string | string[] | undefined;
1963
1981
  project?: string | string[] | undefined;
1964
1982
  } | undefined;
1983
+ docusaurus?: string | boolean | string[] | {
1984
+ config?: string | string[] | undefined;
1985
+ entry?: string | string[] | undefined;
1986
+ project?: string | string[] | undefined;
1987
+ } | undefined;
1965
1988
  dotenv?: string | boolean | string[] | {
1966
1989
  config?: string | string[] | undefined;
1967
1990
  entry?: string | string[] | undefined;
@@ -2596,6 +2619,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
2596
2619
  entry?: string | string[] | undefined;
2597
2620
  project?: string | string[] | undefined;
2598
2621
  }>]>>;
2622
+ docusaurus: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
2623
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2624
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2625
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2626
+ }, "strip", z.ZodTypeAny, {
2627
+ config?: string | string[] | undefined;
2628
+ entry?: string | string[] | undefined;
2629
+ project?: string | string[] | undefined;
2630
+ }, {
2631
+ config?: string | string[] | undefined;
2632
+ entry?: string | string[] | undefined;
2633
+ project?: string | string[] | undefined;
2634
+ }>]>>;
2599
2635
  dotenv: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
2600
2636
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2601
2637
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -3813,6 +3849,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
3813
3849
  entry?: string | string[] | undefined;
3814
3850
  project?: string | string[] | undefined;
3815
3851
  } | undefined;
3852
+ docusaurus?: string | boolean | string[] | {
3853
+ config?: string | string[] | undefined;
3854
+ entry?: string | string[] | undefined;
3855
+ project?: string | string[] | undefined;
3856
+ } | undefined;
3816
3857
  dotenv?: string | boolean | string[] | {
3817
3858
  config?: string | string[] | undefined;
3818
3859
  entry?: string | string[] | undefined;
@@ -4341,6 +4382,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4341
4382
  entry?: string | string[] | undefined;
4342
4383
  project?: string | string[] | undefined;
4343
4384
  } | undefined;
4385
+ docusaurus?: string | boolean | string[] | {
4386
+ config?: string | string[] | undefined;
4387
+ entry?: string | string[] | undefined;
4388
+ project?: string | string[] | undefined;
4389
+ } | undefined;
4344
4390
  dotenv?: string | boolean | string[] | {
4345
4391
  config?: string | string[] | undefined;
4346
4392
  entry?: string | string[] | undefined;
@@ -4865,6 +4911,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4865
4911
  entry?: string | string[] | undefined;
4866
4912
  project?: string | string[] | undefined;
4867
4913
  } | undefined;
4914
+ docusaurus?: string | boolean | string[] | {
4915
+ config?: string | string[] | undefined;
4916
+ entry?: string | string[] | undefined;
4917
+ project?: string | string[] | undefined;
4918
+ } | undefined;
4868
4919
  dotenv?: string | boolean | string[] | {
4869
4920
  config?: string | string[] | undefined;
4870
4921
  entry?: string | string[] | undefined;
@@ -5393,6 +5444,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
5393
5444
  entry?: string | string[] | undefined;
5394
5445
  project?: string | string[] | undefined;
5395
5446
  } | undefined;
5447
+ docusaurus?: string | boolean | string[] | {
5448
+ config?: string | string[] | undefined;
5449
+ entry?: string | string[] | undefined;
5450
+ project?: string | string[] | undefined;
5451
+ } | undefined;
5396
5452
  dotenv?: string | boolean | string[] | {
5397
5453
  config?: string | string[] | undefined;
5398
5454
  entry?: string | string[] | undefined;
@@ -209,6 +209,19 @@ export declare const pluginsSchema: z.ZodObject<{
209
209
  entry?: string | string[] | undefined;
210
210
  project?: string | string[] | undefined;
211
211
  }>]>;
212
+ docusaurus: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
213
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
214
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
215
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
216
+ }, "strip", z.ZodTypeAny, {
217
+ config?: string | string[] | undefined;
218
+ entry?: string | string[] | undefined;
219
+ project?: string | string[] | undefined;
220
+ }, {
221
+ config?: string | string[] | undefined;
222
+ entry?: string | string[] | undefined;
223
+ project?: string | string[] | undefined;
224
+ }>]>;
212
225
  dotenv: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
213
226
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
214
227
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1421,6 +1434,11 @@ export declare const pluginsSchema: z.ZodObject<{
1421
1434
  entry?: string | string[] | undefined;
1422
1435
  project?: string | string[] | undefined;
1423
1436
  };
1437
+ docusaurus: string | boolean | string[] | {
1438
+ config?: string | string[] | undefined;
1439
+ entry?: string | string[] | undefined;
1440
+ project?: string | string[] | undefined;
1441
+ };
1424
1442
  dotenv: string | boolean | string[] | {
1425
1443
  config?: string | string[] | undefined;
1426
1444
  entry?: string | string[] | undefined;
@@ -1932,6 +1950,11 @@ export declare const pluginsSchema: z.ZodObject<{
1932
1950
  entry?: string | string[] | undefined;
1933
1951
  project?: string | string[] | undefined;
1934
1952
  };
1953
+ docusaurus: string | boolean | string[] | {
1954
+ config?: string | string[] | undefined;
1955
+ entry?: string | string[] | undefined;
1956
+ project?: string | string[] | undefined;
1957
+ };
1935
1958
  dotenv: string | boolean | string[] | {
1936
1959
  config?: string | string[] | undefined;
1937
1960
  entry?: string | string[] | undefined;
@@ -25,6 +25,7 @@ export const pluginsSchema = z.object({
25
25
  cucumber: pluginSchema,
26
26
  cypress: pluginSchema,
27
27
  'dependency-cruiser': pluginSchema,
28
+ docusaurus: pluginSchema,
28
29
  dotenv: pluginSchema,
29
30
  drizzle: pluginSchema,
30
31
  eleventy: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'bun' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
- export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "bun", "c8", "capacitor", "changesets", "commitizen", "commitlint", "create-typescript-app", "cspell", "cucumber", "cypress", "dependency-cruiser", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
1
+ export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'bun' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
+ export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "bun", "c8", "capacitor", "changesets", "commitizen", "commitlint", "create-typescript-app", "cspell", "cucumber", "cypress", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
@@ -14,6 +14,7 @@ export const pluginNames = [
14
14
  'cucumber',
15
15
  'cypress',
16
16
  'dependency-cruiser',
17
+ 'docusaurus',
17
18
  'dotenv',
18
19
  'drizzle',
19
20
  'eleventy',
@@ -14,4 +14,5 @@ export type PrincipalOptions = {
14
14
  toSourceFilePath: ToSourceFilePath;
15
15
  isCache: boolean;
16
16
  cacheLocation: string;
17
+ isProduction: boolean;
17
18
  };
@@ -5,7 +5,7 @@ import { DEFAULT_EXTENSIONS } from '../constants.js';
5
5
  import { timerify } from '../util/Performance.js';
6
6
  import { sanitizeSpecifier } from '../util/modules.js';
7
7
  import { dirname, extname, isAbsolute, isInNodeModules, join } from '../util/path.js';
8
- import { _resolveSync, createSyncResolver } from '../util/resolve.js';
8
+ import { _createSyncResolver, _resolveSync } from '../util/resolve.js';
9
9
  import { isDeclarationFileExtension } from './ast-helpers.js';
10
10
  const resolutionCache = new Map();
11
11
  const fileExists = (name, containingFile) => {
@@ -22,7 +22,7 @@ const fileExists = (name, containingFile) => {
22
22
  export function createCustomModuleResolver(compilerOptions, customCompilerExtensions, toSourceFilePath, useCache = true, isSkipLibs = true) {
23
23
  const customCompilerExtensionsSet = new Set(customCompilerExtensions);
24
24
  const extensions = [...DEFAULT_EXTENSIONS, ...customCompilerExtensions];
25
- const resolveSync = customCompilerExtensionsSet.size === 0 ? _resolveSync : createSyncResolver(extensions);
25
+ const resolveSync = customCompilerExtensionsSet.size === 0 ? _resolveSync : _createSyncResolver(extensions);
26
26
  const virtualDeclarationFiles = new Map();
27
27
  const tsSys = {
28
28
  ...ts.sys,
@@ -11,8 +11,8 @@ interface MemoryEntry extends PerformanceEntry {
11
11
  }
12
12
  declare class Performance {
13
13
  isEnabled: boolean;
14
- isPerformanceEnabled: boolean;
15
- isMemoryEnabled: boolean;
14
+ isTimerifyFunctions: boolean;
15
+ isMemoryUsageEnabled: boolean;
16
16
  startTime: number;
17
17
  endTime: number;
18
18
  perfEntries: PerformanceEntry[];
@@ -23,17 +23,17 @@ declare class Performance {
23
23
  memObserver?: PerformanceObserver;
24
24
  memoryUsageStart?: ReturnType<typeof memoryUsage>;
25
25
  freeMemoryStart?: number;
26
- constructor({ isPerformanceEnabled, isMemoryEnabled }: {
27
- isPerformanceEnabled?: boolean | undefined;
28
- isMemoryEnabled?: boolean | undefined;
26
+ constructor({ isTimerifyFunctions, isMemoryUsageEnabled }: {
27
+ isTimerifyFunctions?: boolean | undefined;
28
+ isMemoryUsageEnabled?: boolean | undefined;
29
29
  });
30
30
  private setMark;
31
31
  private clearMark;
32
32
  private flush;
33
33
  private getPerfEntriesByName;
34
- getPerformanceTable(): string;
34
+ getTimerifiedFunctionsTable(): string;
35
35
  addMemoryMark(index: number): void;
36
- getMemoryTable(): string;
36
+ getMemoryUsageTable(): string;
37
37
  getCurrentDurationInMs(startTime?: number): number;
38
38
  getMemHeapUsage(): number;
39
39
  getCurrentMemUsageInMb(): any;