knip 2.38.5 → 2.39.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.
@@ -255,9 +255,10 @@ export class ConfigurationChief {
255
255
  .sort(byPathDepth)
256
256
  .map((name) => {
257
257
  const dir = join(this.cwd, name);
258
+ const pkgName = this.availableWorkspaceManifests.find(p => p.dir === dir)?.manifest.name ?? `NOT_FOUND_${name}`;
258
259
  return {
259
260
  name,
260
- pkgName: this.manifestWorkspaces.get(name) ?? this.manifest?.name ?? `NOT_FOUND_${name}`,
261
+ pkgName,
261
262
  dir,
262
263
  config: this.getConfigForWorkspace(name),
263
264
  ancestors: this.availableWorkspaceNames.reduce(getAncestors(name), []),
package/dist/constants.js CHANGED
@@ -5,6 +5,7 @@ export const GLOBAL_IGNORE_PATTERNS = ['**/node_modules/**', '.yarn'];
5
5
  export const IGNORED_GLOBAL_BINARIES = [
6
6
  'bash',
7
7
  'bun',
8
+ 'bunx',
8
9
  'cat',
9
10
  'cd',
10
11
  'chmod',
@@ -6,8 +6,12 @@ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABL
6
6
  export const ENTRY_FILE_PATTERNS = ['astro.config.{js,cjs,mjs,ts}', 'src/content/config.ts'];
7
7
  export const PRODUCTION_ENTRY_FILE_PATTERNS = ['src/pages/**/*.{astro,mdx,js,ts}', 'src/content/**/*.mdx'];
8
8
  export const findDependencies = async (configFilePath, options) => {
9
- const { config } = options;
10
- return config.entry
9
+ const { config, manifest } = options;
10
+ const dependencies = config.entry
11
11
  ? config.entry.map(toProductionEntryPattern)
12
12
  : [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
13
+ if (manifest.scripts && Object.values(manifest.scripts).some(script => /astro (--.+ )?check/.test(script))) {
14
+ dependencies.push('@astrojs/check');
15
+ }
16
+ return dependencies;
13
17
  };
@@ -20,7 +20,15 @@ const findRemarkDependencies = async (configFilePath, options) => {
20
20
  : await load(configFilePath);
21
21
  if (!localConfig)
22
22
  return [];
23
- const plugins = localConfig.plugins?.map(plugin => `remark-${plugin}`) ?? [];
23
+ const plugins = localConfig.plugins
24
+ ?.flatMap(plugin => {
25
+ if (typeof plugin === 'string')
26
+ return plugin;
27
+ if (Array.isArray(plugin) && typeof plugin[0] === 'string')
28
+ return plugin[0];
29
+ return [];
30
+ })
31
+ .map(plugin => (plugin.startsWith('remark-') ? plugin : `remark-${plugin}`)) ?? [];
24
32
  return plugins;
25
33
  };
26
34
  export const findDependencies = timerify(findRemarkDependencies);
@@ -0,0 +1,3 @@
1
+ export type RemarkConfig = {
2
+ plugins?: (string | [string, boolean] | unknown)[];
3
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.38.5";
1
+ export declare const version = "2.39.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.38.5';
1
+ export const version = '2.39.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.38.5",
3
+ "version": "2.39.0",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://github.com/webpro/knip",
6
6
  "repository": "github:webpro/knip",