knip 5.39.2 → 5.39.4

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.
@@ -266,7 +266,7 @@ export class WorkspaceWorker {
266
266
  }
267
267
  const finalEntryPaths = getFinalEntryPaths(plugin, options, configEntryPaths);
268
268
  for (const id of finalEntryPaths)
269
- addInput(id, id.containingFilePath ?? containingFilePath);
269
+ addInput(id, id.containingFilePath);
270
270
  if (hasResolve) {
271
271
  const dependencies = (await plugin.resolve?.(options)) ?? [];
272
272
  for (const id of dependencies)
@@ -1,4 +1,16 @@
1
1
  import { fencedCodeBlockMatcher, importMatcher } from './compilers.js';
2
- const condition = (hasDependency) => hasDependency('@mdx-js/mdx') || hasDependency('astro');
2
+ const mdxDependencies = [
3
+ 'astro',
4
+ '@mdx-js/esbuild',
5
+ '@mdx-js/loader',
6
+ '@mdx-js/mdx',
7
+ '@mdx-js/node-loader',
8
+ '@mdx-js/preact',
9
+ '@mdx-js/react',
10
+ '@mdx-js/rollup',
11
+ '@mdx-js/vue',
12
+ 'remark-mdx',
13
+ ];
14
+ const condition = (hasDependency) => mdxDependencies.some(hasDependency);
3
15
  const compiler = (text) => [...text.replace(fencedCodeBlockMatcher, '').matchAll(importMatcher)].join('\n');
4
16
  export default { condition, compiler };
@@ -3,7 +3,7 @@ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Astro';
4
4
  const enablers = ['astro'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const entry = ['astro.config.{js,cjs,mjs,ts}', 'src/content/config.ts'];
6
+ const entry = ['astro.config.{js,cjs,mjs,ts}', 'src/content/config.ts', 'src/content.config.ts'];
7
7
  const production = [
8
8
  'src/pages/**/*.{astro,mdx,js,ts}',
9
9
  'src/content/**/*.mdx',
@@ -54,7 +54,7 @@ export const resolveEntryPaths = async (localConfig, options) => {
54
54
  const dir = join(options.configFileDir, cfg.test?.root ?? '.');
55
55
  if (cfg.test?.include) {
56
56
  for (const dependency of cfg.test.include)
57
- inputs.add(toEntry(join(dir, dependency)));
57
+ dependency[0] !== '!' && inputs.add(toEntry(join(dir, dependency)));
58
58
  }
59
59
  else {
60
60
  for (const dependency of options.config.entry ?? entry)
@@ -33,4 +33,4 @@ export const toDevDependency = (specifier) => ({ type: 'dependency', specifier }
33
33
  export const toDeferResolve = (specifier) => ({ type: 'deferResolve', specifier });
34
34
  export const toDeferResolveEntry = (specifier) => ({ type: 'deferResolveEntry', specifier });
35
35
  export const isDeferResolveEntry = (input) => input.type === 'deferResolveEntry';
36
- export const toDebugString = (input) => `${input.type}:${input.specifier} ${input.containingFilePath ? `(${toRelative(input.containingFilePath)})` : ''}`;
36
+ export const toDebugString = (input) => `${input.type}:${input.specifier}${input.containingFilePath ? ` (${toRelative(input.containingFilePath)})` : ''}`;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.39.2";
1
+ export declare const version = "5.39.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.39.2';
1
+ export const version = '5.39.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.39.2",
3
+ "version": "5.39.4",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {