knip 2.34.1 → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigurationChief.d.ts +5 -4
- package/dist/WorkspaceWorker.d.ts +1 -1
- package/dist/plugins/_template/index.js +2 -1
- package/dist/plugins/astro/index.js +5 -2
- package/dist/plugins/eslint/helpers.d.ts +2 -7
- package/dist/plugins/gatsby/index.js +3 -2
- package/dist/plugins/next/index.js +5 -2
- package/dist/plugins/postcss/index.js +1 -1
- package/dist/plugins/prettier/index.js +2 -2
- package/dist/plugins/remix/index.js +5 -2
- package/dist/plugins/typescript/index.js +3 -3
- package/dist/plugins/vite/index.js +2 -2
- package/dist/plugins/vitest/helpers.d.ts +2 -2
- package/dist/plugins/vitest/index.d.ts +2 -2
- package/dist/plugins/vitest/index.js +30 -13
- package/dist/plugins/vitest/types.d.ts +14 -3
- package/dist/types/config.d.ts +1 -0
- package/dist/types/package-json.d.ts +41 -0
- package/dist/types/plugins.d.ts +2 -4
- package/dist/types/util.d.ts +16 -0
- package/dist/types/util.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +17 -17
- package/schema.json +1 -1
- package/dist/plugins/vite/types.d.ts +0 -4
- /package/dist/{plugins/vite/types.js → types/package-json.js} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="npmcli__package-json" />
|
|
1
2
|
import { createPkgGraph } from '@pnpm/workspace.pkgs-graph';
|
|
2
3
|
import type { SyncCompilers, AsyncCompilers } from './types/compilers.js';
|
|
3
4
|
import type { Configuration, WorkspaceConfiguration } from './types/config.js';
|
|
4
|
-
import type {
|
|
5
|
+
import type { PackageJson } from '@npmcli/package-json';
|
|
5
6
|
type ConfigurationManagerOptions = {
|
|
6
7
|
cwd: string;
|
|
7
8
|
isProduction: boolean;
|
|
@@ -13,14 +14,14 @@ export type Workspace = {
|
|
|
13
14
|
ancestors: string[];
|
|
14
15
|
config: WorkspaceConfiguration;
|
|
15
16
|
manifestPath: string;
|
|
16
|
-
manifest:
|
|
17
|
+
manifest: PackageJson;
|
|
17
18
|
};
|
|
18
19
|
export declare class ConfigurationChief {
|
|
19
20
|
cwd: string;
|
|
20
21
|
isProduction: boolean;
|
|
21
22
|
config: Configuration;
|
|
22
23
|
manifestPath?: string;
|
|
23
|
-
manifest?:
|
|
24
|
+
manifest?: PackageJson;
|
|
24
25
|
ignoredWorkspacePatterns: string[];
|
|
25
26
|
manifestWorkspaces: Map<string, string>;
|
|
26
27
|
additionalWorkspaceNames: Set<string>;
|
|
@@ -29,7 +30,7 @@ export declare class ConfigurationChief {
|
|
|
29
30
|
availableWorkspaceDirs: string[];
|
|
30
31
|
availableWorkspaceManifests: {
|
|
31
32
|
dir: string;
|
|
32
|
-
manifest:
|
|
33
|
+
manifest: PackageJson;
|
|
33
34
|
}[];
|
|
34
35
|
workspacesGraph: ReturnType<typeof createPkgGraph> | undefined;
|
|
35
36
|
enabledWorkspaces: Workspace[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Configuration, PluginName, WorkspaceConfiguration } from './types/config.js';
|
|
2
|
-
import type { PackageJsonWithPlugins } from './types/
|
|
2
|
+
import type { PackageJsonWithPlugins } from './types/package-json.js';
|
|
3
3
|
import type { InstalledBinaries, HostDependencies } from './types/workspace.js';
|
|
4
4
|
type WorkspaceManagerOptions = {
|
|
5
5
|
name: string;
|
|
@@ -11,7 +11,8 @@ export const PROJECT_FILE_PATTERNS = [];
|
|
|
11
11
|
const findPluginDependencies = async (configFilePath, options) => {
|
|
12
12
|
const { manifest, config, isProduction } = options;
|
|
13
13
|
const localConfig = configFilePath.endsWith('package.json')
|
|
14
|
-
?
|
|
14
|
+
?
|
|
15
|
+
manifest.plugin
|
|
15
16
|
: await load(configFilePath);
|
|
16
17
|
if (!localConfig)
|
|
17
18
|
return [];
|
|
@@ -5,6 +5,9 @@ export const ENABLERS = ['astro'];
|
|
|
5
5
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
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
|
-
export const findDependencies = async () => {
|
|
9
|
-
|
|
8
|
+
export const findDependencies = async (configFilePath, options) => {
|
|
9
|
+
const { config } = options;
|
|
10
|
+
return config.entry
|
|
11
|
+
? config.entry.map(toProductionEntryPattern)
|
|
12
|
+
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
10
13
|
};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ESLintConfig } from './types.js';
|
|
3
|
-
import type { PackageJson } from '@npmcli/package-json';
|
|
4
|
-
type Manifest = PackageJson & {
|
|
5
|
-
eslintConfig?: ESLintConfig;
|
|
6
|
-
};
|
|
1
|
+
import type { PackageJsonWithPlugins } from '../../types/package-json.js';
|
|
7
2
|
type GetDependenciesDeep = (configFilePath: string, options: {
|
|
8
3
|
cwd: string;
|
|
9
|
-
manifest:
|
|
4
|
+
manifest: PackageJsonWithPlugins;
|
|
10
5
|
}, dependencies?: Set<string>) => Promise<Set<string>>;
|
|
11
6
|
export declare const getDependenciesDeep: GetDependenciesDeep;
|
|
12
7
|
export declare const resolvePluginSpecifier: (specifier: string) => string;
|
|
@@ -13,9 +13,10 @@ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
|
13
13
|
'src/html.{js,jsx,ts,tsx}',
|
|
14
14
|
'plugins/**/gatsby-{browser,ssr}.{js,jsx,ts,tsx}',
|
|
15
15
|
];
|
|
16
|
-
const findGatsbyDependencies = async (configFilePath,
|
|
16
|
+
const findGatsbyDependencies = async (configFilePath, options) => {
|
|
17
|
+
const { isProduction, config } = options;
|
|
17
18
|
const localConfig = await load(configFilePath);
|
|
18
|
-
const entryPatterns = PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern);
|
|
19
|
+
const entryPatterns = (config.entry ?? PRODUCTION_ENTRY_FILE_PATTERNS).map(toProductionEntryPattern);
|
|
19
20
|
if (isProduction || !localConfig)
|
|
20
21
|
return entryPatterns;
|
|
21
22
|
if (/gatsby-config/.test(configFilePath)) {
|
|
@@ -18,6 +18,9 @@ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
|
18
18
|
...productionEntryFilePatternsWithoutSrc,
|
|
19
19
|
...productionEntryFilePatternsWithoutSrc.map(pattern => `src/${pattern}`),
|
|
20
20
|
];
|
|
21
|
-
export const findDependencies = async () => {
|
|
22
|
-
|
|
21
|
+
export const findDependencies = async (configFilePath, options) => {
|
|
22
|
+
const { config } = options;
|
|
23
|
+
return config.entry
|
|
24
|
+
? config.entry.map(toProductionEntryPattern)
|
|
25
|
+
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
23
26
|
};
|
|
@@ -3,7 +3,7 @@ import { hasDependency, load } from '../../util/plugin.js';
|
|
|
3
3
|
export const NAME = 'PostCSS';
|
|
4
4
|
export const ENABLERS = ['postcss', 'next'];
|
|
5
5
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
6
|
-
export const CONFIG_FILE_PATTERNS = ['postcss.config.js', 'postcss.config.json', 'package.json'];
|
|
6
|
+
export const CONFIG_FILE_PATTERNS = ['postcss.config.{cjs,js}', 'postcss.config.json', 'package.json'];
|
|
7
7
|
const findPostCSSDependencies = async (configFilePath, options) => {
|
|
8
8
|
const { manifest, isProduction } = options;
|
|
9
9
|
if (isProduction)
|
|
@@ -5,8 +5,8 @@ export const ENABLERS = ['prettier'];
|
|
|
5
5
|
export const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, ENABLERS) || 'prettier' in config;
|
|
6
6
|
export const CONFIG_FILE_PATTERNS = [
|
|
7
7
|
'.prettierrc',
|
|
8
|
-
'.prettierrc.{json,js,cjs,yml,yaml}',
|
|
9
|
-
'prettier.config.{js,cjs}',
|
|
8
|
+
'.prettierrc.{json,js,cjs,mjs,yml,yaml}',
|
|
9
|
+
'prettier.config.{js,cjs,mjs}',
|
|
10
10
|
'package.json',
|
|
11
11
|
];
|
|
12
12
|
const findPrettierDependencies = async (configFilePath, { manifest, isProduction }) => {
|
|
@@ -11,7 +11,10 @@ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
|
11
11
|
'app/routes/**/*.{js,ts,tsx}',
|
|
12
12
|
'server.{js,ts}',
|
|
13
13
|
];
|
|
14
|
-
const findRemixDependencies = async () => {
|
|
15
|
-
|
|
14
|
+
const findRemixDependencies = async (configFilePath, options) => {
|
|
15
|
+
const { config } = options;
|
|
16
|
+
return config.entry
|
|
17
|
+
? config.entry.map(toProductionEntryPattern)
|
|
18
|
+
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
16
19
|
};
|
|
17
20
|
export const findDependencies = timerify(findRemixDependencies);
|
|
@@ -25,19 +25,19 @@ const resolveExtensibleConfig = async (configFilePath) => {
|
|
|
25
25
|
};
|
|
26
26
|
export const findTypeScriptDependencies = async (configFilePath, options) => {
|
|
27
27
|
const { isProduction } = options;
|
|
28
|
-
if (isProduction)
|
|
29
|
-
return [];
|
|
30
28
|
const { compilerOptions } = await loadTSConfig(configFilePath);
|
|
31
29
|
const localConfig = await resolveExtensibleConfig(configFilePath);
|
|
32
30
|
if (!compilerOptions || !localConfig)
|
|
33
31
|
return [];
|
|
32
|
+
const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
|
|
33
|
+
if (isProduction)
|
|
34
|
+
return [...jsx];
|
|
34
35
|
const extend = localConfig.extends ? [localConfig.extends].flat().filter(extend => !isInternal(extend)) : [];
|
|
35
36
|
const types = compilerOptions.types ?? [];
|
|
36
37
|
const plugins = Array.isArray(compilerOptions?.plugins)
|
|
37
38
|
? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
|
|
38
39
|
: [];
|
|
39
40
|
const importHelpers = compilerOptions?.importHelpers ? ['tslib'] : [];
|
|
40
|
-
const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
|
|
41
41
|
return compact([...extend, ...types, ...plugins, ...importHelpers, ...jsx]);
|
|
42
42
|
};
|
|
43
43
|
export const findDependencies = timerify(findTypeScriptDependencies);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { timerify } from '../../util/Performance.js';
|
|
2
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
|
-
import {
|
|
3
|
+
import { findVitestDependencies } from '../vitest/index.js';
|
|
4
4
|
export const NAME = 'Vite';
|
|
5
5
|
export const ENABLERS = ['vite'];
|
|
6
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
@@ -9,6 +9,6 @@ const findViteDependencies = async (configFilePath, options) => {
|
|
|
9
9
|
const localConfig = await load(configFilePath);
|
|
10
10
|
if (!localConfig)
|
|
11
11
|
return [];
|
|
12
|
-
return
|
|
12
|
+
return findVitestDependencies(localConfig, options);
|
|
13
13
|
};
|
|
14
14
|
export const findDependencies = timerify(findViteDependencies);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ViteConfig } from './types.js';
|
|
2
2
|
type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
3
3
|
type VitestEnvironment = BuiltinEnvironment | (string & Record<never, never>);
|
|
4
4
|
export declare const getEnvPackageName: (env: VitestEnvironment) => any;
|
|
5
|
-
export declare const getExternalReporters: (reporters?:
|
|
5
|
+
export declare const getExternalReporters: (reporters?: ViteConfig['test']['reporters']) => unknown[];
|
|
6
6
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ViteConfigOrFn } from './types.js';
|
|
2
2
|
import type { IsPluginEnabledCallback, GenericPluginCallback, GenericPluginCallbackOptions } from '../../types/plugins.js';
|
|
3
3
|
export declare const NAME = "Vitest";
|
|
4
4
|
export declare const ENABLERS: string[];
|
|
5
5
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
6
6
|
export declare const CONFIG_FILE_PATTERNS: string[];
|
|
7
7
|
export declare const ENTRY_FILE_PATTERNS: string[];
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const findVitestDependencies: (localConfig: ViteConfigOrFn, options: GenericPluginCallbackOptions) => Promise<any[]>;
|
|
9
9
|
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { compact } from '../../util/array.js';
|
|
2
1
|
import { timerify } from '../../util/Performance.js';
|
|
3
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
4
3
|
import { toEntryPattern } from '../../util/protocols.js';
|
|
@@ -8,14 +7,11 @@ export const ENABLERS = ['vitest'];
|
|
|
8
7
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
9
8
|
export const CONFIG_FILE_PATTERNS = ['vitest.config.ts', 'vitest.{workspace,projects}.{ts,js,json}'];
|
|
10
9
|
export const ENTRY_FILE_PATTERNS = ['**/*.{test,spec}.?(c|m)[jt]s?(x)'];
|
|
11
|
-
|
|
12
|
-
const { isProduction } = options;
|
|
13
|
-
localConfig = typeof localConfig === 'function' ? localConfig() : localConfig;
|
|
14
|
-
if (!localConfig || !localConfig.test)
|
|
15
|
-
return [];
|
|
10
|
+
const findConfigDependencies = (localConfig, options) => {
|
|
11
|
+
const { isProduction, config } = options;
|
|
16
12
|
const testConfig = localConfig.test;
|
|
17
|
-
const entryPatterns = (
|
|
18
|
-
if (isProduction)
|
|
13
|
+
const entryPatterns = (config?.entry ?? testConfig?.include ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
|
|
14
|
+
if (!testConfig || isProduction)
|
|
19
15
|
return entryPatterns;
|
|
20
16
|
const environments = testConfig.environment ? [getEnvPackageName(testConfig.environment)] : [];
|
|
21
17
|
const reporters = getExternalReporters(testConfig.reporters);
|
|
@@ -24,10 +20,31 @@ export const findVitestDeps = (localConfig, options) => {
|
|
|
24
20
|
const globalSetup = testConfig.globalSetup ? [testConfig.globalSetup].flat() : [];
|
|
25
21
|
return [...entryPatterns, ...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup];
|
|
26
22
|
};
|
|
27
|
-
const findVitestDependencies = async (
|
|
23
|
+
export const findVitestDependencies = async (localConfig, options) => {
|
|
24
|
+
if (!localConfig)
|
|
25
|
+
return [];
|
|
26
|
+
if (typeof localConfig === 'function') {
|
|
27
|
+
const dependencies = new Set();
|
|
28
|
+
for (const command of ['dev', 'serve', 'build']) {
|
|
29
|
+
for (const mode of ['development', 'production']) {
|
|
30
|
+
const config = await localConfig({ command, mode, ssrBuild: undefined });
|
|
31
|
+
findConfigDependencies(config, options).forEach(dependency => dependencies.add(dependency));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return Array.from(dependencies);
|
|
35
|
+
}
|
|
36
|
+
if (!localConfig.test)
|
|
37
|
+
return [];
|
|
38
|
+
return findConfigDependencies(localConfig, options);
|
|
39
|
+
};
|
|
40
|
+
const findVitestWorkspaceDependencies = async (configFilePath, options) => {
|
|
28
41
|
const localConfig = await load(configFilePath);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
const dependencies = new Set();
|
|
43
|
+
for (const config of [localConfig].flat()) {
|
|
44
|
+
if (config && typeof config !== 'string') {
|
|
45
|
+
(await findVitestDependencies(config, options)).forEach(dependency => dependencies.add(dependency));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return Array.from(dependencies);
|
|
32
49
|
};
|
|
33
|
-
export const findDependencies = timerify(
|
|
50
|
+
export const findDependencies = timerify(findVitestWorkspaceDependencies);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface VitestConfig {
|
|
2
2
|
test: {
|
|
3
3
|
include: string[];
|
|
4
4
|
coverage?: {
|
|
@@ -10,5 +10,16 @@ export interface VitestConfig {
|
|
|
10
10
|
setupFiles?: string | string[];
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
13
|
+
export interface ViteConfig extends VitestConfig {
|
|
14
|
+
plugins: unknown[];
|
|
15
|
+
}
|
|
16
|
+
export type COMMAND = 'dev' | 'serve' | 'build';
|
|
17
|
+
export type MODE = 'development' | 'production';
|
|
18
|
+
interface Options {
|
|
19
|
+
command: COMMAND;
|
|
20
|
+
mode: MODE;
|
|
21
|
+
ssrBuild?: boolean | undefined;
|
|
22
|
+
}
|
|
23
|
+
export type ViteConfigOrFn = ViteConfig | ((options: Options) => ViteConfig) | ((options: Options) => Promise<ViteConfig>);
|
|
24
|
+
export type VitestWorkspaceConfig = (string | ViteConfig)[];
|
|
25
|
+
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type RawConfiguration = z.infer<typeof ConfigurationValidator>;
|
|
|
7
7
|
export type RawPluginConfiguration = z.infer<typeof pluginSchema>;
|
|
8
8
|
type NormalizedGlob = string[];
|
|
9
9
|
export type PluginName = keyof typeof Plugins;
|
|
10
|
+
export type PluginMap = typeof Plugins;
|
|
10
11
|
export type EnsuredPluginConfiguration = {
|
|
11
12
|
config: NormalizedGlob | null;
|
|
12
13
|
entry: NormalizedGlob | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { PluginMap } from './config.js';
|
|
2
|
+
import type { LiteralUnion, MergeUnion } from './util.js';
|
|
3
|
+
type Dependency = Record<string, string>;
|
|
4
|
+
type ExportCondition = LiteralUnion<'import' | 'require' | 'node' | 'node-addons' | 'deno' | 'browser' | 'electron' | 'react-native' | 'default', string>;
|
|
5
|
+
type Exports = null | string | string[] | {
|
|
6
|
+
[key in ExportCondition]: Exports;
|
|
7
|
+
} | {
|
|
8
|
+
[key: string]: Exports;
|
|
9
|
+
};
|
|
10
|
+
type ExtractKeys<T, K extends string> = T extends {
|
|
11
|
+
PACKAGE_JSON_PATH: infer P;
|
|
12
|
+
} ? P extends `${infer First}.${infer Second}` ? {
|
|
13
|
+
[K1 in First]?: {
|
|
14
|
+
[K2 in Second]?: unknown;
|
|
15
|
+
};
|
|
16
|
+
} : {
|
|
17
|
+
[P in T['PACKAGE_JSON_PATH'] & string]?: unknown;
|
|
18
|
+
} : Record<K, unknown>;
|
|
19
|
+
type PluginKeys = {
|
|
20
|
+
[K in keyof PluginMap]: ExtractKeys<PluginMap[K], K>;
|
|
21
|
+
};
|
|
22
|
+
type Plugins = MergeUnion<PluginKeys[keyof PluginMap]>;
|
|
23
|
+
export type PackageJsonWithPlugins = {
|
|
24
|
+
name?: string;
|
|
25
|
+
main?: string;
|
|
26
|
+
bin?: string | Record<string, string>;
|
|
27
|
+
version?: string;
|
|
28
|
+
workspaces?: string[] | {
|
|
29
|
+
packages?: string[];
|
|
30
|
+
};
|
|
31
|
+
exports?: Exports;
|
|
32
|
+
scripts?: Record<string, string>;
|
|
33
|
+
dependencies?: Dependency;
|
|
34
|
+
devDependencies?: Dependency;
|
|
35
|
+
peerDependencies?: Dependency;
|
|
36
|
+
optionalDependencies?: Dependency;
|
|
37
|
+
peerDependenciesMeta?: Record<string, {
|
|
38
|
+
optional: true;
|
|
39
|
+
}>;
|
|
40
|
+
} & Plugins;
|
|
41
|
+
export {};
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
/// <reference types="npmcli__package-json" />
|
|
2
1
|
import type { EnsuredPluginConfiguration, WorkspaceConfiguration } from './config.js';
|
|
3
|
-
import type {
|
|
4
|
-
export type PackageJsonWithPlugins = PackageJson & Record<string, unknown>;
|
|
2
|
+
import type { PackageJsonWithPlugins } from './package-json.js';
|
|
5
3
|
type IsPluginEnabledCallbackOptions = {
|
|
6
4
|
cwd: string;
|
|
7
|
-
manifest:
|
|
5
|
+
manifest: PackageJsonWithPlugins;
|
|
8
6
|
dependencies: Set<string>;
|
|
9
7
|
config: WorkspaceConfiguration;
|
|
10
8
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
2
|
+
export type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
3
|
+
type CommonKeys<T extends object> = keyof T;
|
|
4
|
+
type AllKeys<T> = T extends unknown ? keyof T : never;
|
|
5
|
+
type Subtract<A, C> = A extends C ? never : A;
|
|
6
|
+
type NonCommonKeys<T extends object> = Subtract<AllKeys<T>, CommonKeys<T>>;
|
|
7
|
+
type PickType<T, K extends AllKeys<T>> = T extends {
|
|
8
|
+
[k in K]?: unknown;
|
|
9
|
+
} ? T[K] : undefined;
|
|
10
|
+
type PickTypeOf<T, K extends string | number | symbol> = K extends AllKeys<T> ? PickType<T, K> : never;
|
|
11
|
+
export type MergeUnion<T extends object> = {
|
|
12
|
+
[k in CommonKeys<T>]: PickTypeOf<T, k>;
|
|
13
|
+
} & {
|
|
14
|
+
[k in NonCommonKeys<T>]?: PickTypeOf<T, k>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.
|
|
1
|
+
export declare const version = "2.36.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.
|
|
1
|
+
export const version = '2.36.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.36.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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@npmcli/map-workspaces": "^3.0.4",
|
|
47
47
|
"@pkgjs/parseargs": "0.11.0",
|
|
48
48
|
"@pnpm/logger": "5.0.0",
|
|
49
|
-
"@pnpm/workspace.pkgs-graph": "2.0.
|
|
49
|
+
"@pnpm/workspace.pkgs-graph": "2.0.8",
|
|
50
50
|
"@snyk/github-codeowners": "^1.1.0",
|
|
51
51
|
"chalk": "^5.2.0",
|
|
52
52
|
"easy-table": "^1.2.0",
|
|
@@ -61,26 +61,26 @@
|
|
|
61
61
|
"summary": "^2.1.0",
|
|
62
62
|
"typescript": "^5.0.2",
|
|
63
63
|
"zod": "3.22.4",
|
|
64
|
-
"zod-validation-error": "
|
|
64
|
+
"zod-validation-error": "2.0.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@jest/types": "29.6.3",
|
|
68
68
|
"@npmcli/package-json": "5.0.0",
|
|
69
69
|
"@release-it/bumper": "5.1.0",
|
|
70
70
|
"@swc/cli": "0.1.62",
|
|
71
|
-
"@swc/core": "1.3.
|
|
72
|
-
"@types/eslint": "8.44.
|
|
73
|
-
"@types/js-yaml": "4.0.
|
|
74
|
-
"@types/micromatch": "4.0.
|
|
75
|
-
"@types/minimist": "1.2.
|
|
76
|
-
"@types/node": "20.8.
|
|
77
|
-
"@types/npmcli__map-workspaces": "3.0.
|
|
78
|
-
"@types/pkgjs__parseargs": "0.10.
|
|
79
|
-
"@types/webpack": "5.28.
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
81
|
-
"@typescript-eslint/parser": "6.
|
|
71
|
+
"@swc/core": "1.3.94",
|
|
72
|
+
"@types/eslint": "8.44.6",
|
|
73
|
+
"@types/js-yaml": "4.0.8",
|
|
74
|
+
"@types/micromatch": "4.0.4",
|
|
75
|
+
"@types/minimist": "1.2.4",
|
|
76
|
+
"@types/node": "20.8.7",
|
|
77
|
+
"@types/npmcli__map-workspaces": "3.0.3",
|
|
78
|
+
"@types/pkgjs__parseargs": "0.10.2",
|
|
79
|
+
"@types/webpack": "5.28.4",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "6.8.0",
|
|
81
|
+
"@typescript-eslint/parser": "6.8.0",
|
|
82
82
|
"c8": "8.0.1",
|
|
83
|
-
"eslint": "8.
|
|
83
|
+
"eslint": "8.52.0",
|
|
84
84
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
85
85
|
"eslint-plugin-import": "2.28.1",
|
|
86
86
|
"eslint-plugin-n": "16.2.0",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"release-it": "16.2.1",
|
|
90
90
|
"remark-cli": "12.0.0",
|
|
91
91
|
"remark-preset-webpro": "1.0.0",
|
|
92
|
-
"tsx": "3.
|
|
93
|
-
"type-fest": "4.
|
|
92
|
+
"tsx": "3.14.0",
|
|
93
|
+
"type-fest": "4.5.0"
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": ">=16.17.0 <17 || >=18.6.0"
|
package/schema.json
CHANGED
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"globPatterns": {
|
|
136
|
-
"description": "Use file paths and glob patterns to match files. Knip uses fast-glob and
|
|
136
|
+
"description": "Use file paths and glob patterns to match files. Knip uses fast-glob and minimatch (https://github.com/micromatch/micromatch#matching-features)",
|
|
137
137
|
"anyOf": [
|
|
138
138
|
{
|
|
139
139
|
"type": "string"
|
|
File without changes
|