knip 5.23.1 → 5.23.2
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 +89 -15
- package/dist/ConfigurationValidator.d.ts +2897 -1141
- package/dist/DependencyDeputy.d.ts +21 -6
- package/dist/IssueCollector.d.ts +4 -4
- package/dist/IssueFixer.d.ts +1 -1
- package/dist/PrincipalFactory.d.ts +3 -3
- package/dist/ProjectPrincipal.d.ts +9 -9
- package/dist/WorkspaceWorker.d.ts +14 -9
- package/dist/binaries/util.d.ts +5 -5
- package/dist/compilers/astro.d.ts +1 -1
- package/dist/compilers/compilers.d.ts +2 -2
- package/dist/compilers/index.d.ts +695 -83
- package/dist/compilers/mdx.d.ts +1 -1
- package/dist/constants.d.ts +4 -4
- package/dist/index.d.ts +8 -1
- package/dist/manifest/helpers.d.ts +1 -1
- package/dist/manifest/index.d.ts +4 -6
- package/dist/plugins/babel/helpers.d.ts +1 -1
- package/dist/plugins/babel/index.d.ts +1 -1
- package/dist/plugins/capacitor/index.d.ts +1 -1
- package/dist/plugins/commitlint/index.js +2 -7
- package/dist/plugins/cypress/index.d.ts +1 -1
- package/dist/plugins/eleventy/helpers.d.ts +5 -5
- package/dist/plugins/eleventy/index.d.ts +5 -2
- package/dist/plugins/graphql-codegen/index.d.ts +1 -1
- package/dist/plugins/graphql-codegen/index.js +1 -1
- package/dist/plugins/husky/index.d.ts +1 -1
- package/dist/plugins/jest/index.d.ts +3 -2
- package/dist/plugins/lefthook/index.d.ts +1 -1
- package/dist/plugins/lint-staged/index.d.ts +2 -1
- package/dist/plugins/lint-staged/index.js +5 -6
- package/dist/plugins/linthtml/index.js +2 -9
- package/dist/plugins/lockfile-lint/index.js +2 -2
- package/dist/plugins/markdownlint/helpers.d.ts +1 -1
- package/dist/plugins/netlify/helpers.d.ts +1 -1
- package/dist/plugins/netlify/index.d.ts +1 -1
- package/dist/plugins/next/index.d.ts +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +2 -2
- package/dist/plugins/nx/index.d.ts +1 -1
- package/dist/plugins/playwright-ct/index.d.ts +1 -1
- package/dist/plugins/postcss/index.js +6 -2
- package/dist/plugins/prettier/index.js +2 -2
- package/dist/plugins/release-it/index.js +1 -1
- package/dist/plugins/remix/index.d.ts +1 -1
- package/dist/plugins/semantic-release/index.js +2 -2
- package/dist/plugins/sentry/index.d.ts +1 -1
- package/dist/plugins/simple-git-hooks/index.d.ts +2 -1
- package/dist/plugins/size-limit/index.js +5 -2
- package/dist/plugins/storybook/index.d.ts +2 -2
- package/dist/plugins/stylelint/index.js +2 -2
- package/dist/plugins/svelte/index.d.ts +1 -1
- package/dist/plugins/syncpack/index.d.ts +1 -0
- package/dist/plugins/syncpack/index.js +5 -2
- package/dist/plugins/tsup/index.js +1 -1
- package/dist/plugins/typedoc/index.js +4 -4
- package/dist/plugins/unbuild/index.d.ts +2 -1
- package/dist/plugins/unocss/index.js +2 -2
- package/dist/plugins/vitest/helpers.d.ts +2 -2
- package/dist/plugins/webpack/index.d.ts +4 -1
- package/dist/plugins/wireit/index.d.ts +2 -3
- package/dist/plugins/xo/index.js +2 -2
- package/dist/plugins/yorkie/index.d.ts +2 -1
- package/dist/reporters/index.d.ts +1 -1
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/util.d.ts +1 -1
- package/dist/typescript/SourceFileManager.d.ts +5 -5
- package/dist/typescript/ast-helpers.d.ts +7 -7
- package/dist/typescript/getImportsAndExports.d.ts +11 -10
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/index.d.ts +1 -1
- package/dist/typescript/visitors/imports/index.d.ts +1 -1
- package/dist/typescript/visitors/scripts/index.d.ts +1 -1
- package/dist/util/Performance.d.ts +2 -2
- package/dist/util/array.d.ts +2 -2
- package/dist/util/errors.d.ts +1 -1
- package/dist/util/file-entry-cache.d.ts +6 -3
- package/dist/util/fs.d.ts +6 -6
- package/dist/util/get-included-issue-types.d.ts +2 -1
- package/dist/util/get-included-issue-types.js +1 -1
- package/dist/util/git.d.ts +1 -1
- package/dist/util/glob.d.ts +6 -6
- package/dist/util/handle-dependency.d.ts +1 -1
- package/dist/util/is-identifier-referenced.d.ts +1 -1
- package/dist/util/loader.d.ts +1 -1
- package/dist/util/map-workspaces.d.ts +2 -1
- package/dist/util/modules.d.ts +7 -7
- package/dist/util/package-json.d.ts +6 -2
- package/dist/util/path.d.ts +6 -6
- package/dist/util/pkgs-graph.d.ts +1 -1
- package/dist/util/plugin.d.ts +33 -9
- package/dist/util/plugin.js +34 -2
- package/dist/util/protocols.d.ts +9 -9
- package/dist/util/regex.d.ts +3 -3
- package/dist/util/reporter.d.ts +1 -1
- package/dist/util/require.d.ts +3 -3
- package/dist/util/resolve.d.ts +1 -1
- package/dist/util/tag.d.ts +2 -2
- package/dist/util/trace.d.ts +2 -2
- package/dist/util/tsconfig-loader.d.ts +6 -1
- package/dist/util/unwrap-function.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -2
package/dist/compilers/mdx.d.ts
CHANGED
package/dist/constants.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export declare const ANONYMOUS = "__anonymous";
|
|
|
5
5
|
export declare const KNIP_CONFIG_LOCATIONS: string[];
|
|
6
6
|
export declare const DEFAULT_EXTENSIONS: string[];
|
|
7
7
|
export declare const GLOBAL_IGNORE_PATTERNS: string[];
|
|
8
|
-
export declare const IGNORED_GLOBAL_BINARIES:
|
|
9
|
-
export declare const IGNORED_DEPENDENCIES:
|
|
10
|
-
export declare const IGNORED_RUNTIME_DEPENDENCIES:
|
|
11
|
-
export declare const FOREIGN_FILE_EXTENSIONS:
|
|
8
|
+
export declare const IGNORED_GLOBAL_BINARIES: Set<string>;
|
|
9
|
+
export declare const IGNORED_DEPENDENCIES: Set<string>;
|
|
10
|
+
export declare const IGNORED_RUNTIME_DEPENDENCIES: Set<string>;
|
|
11
|
+
export declare const FOREIGN_FILE_EXTENSIONS: Set<string>;
|
|
12
12
|
export declare const IGNORE_DEFINITELY_TYPED: string[];
|
|
13
13
|
export declare const ISSUE_TYPES: IssueType[];
|
|
14
14
|
export declare const ISSUE_TYPE_TITLE: Record<IssueType, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { CommandLineOptions } from './types/cli.js';
|
|
2
2
|
export type { RawConfiguration as KnipConfig } from './types/config.js';
|
|
3
3
|
export type { Preprocessor, Reporter, ReporterOptions } from './types/issues.js';
|
|
4
|
-
export declare const main: (unresolvedConfiguration: CommandLineOptions) =>
|
|
4
|
+
export declare const main: (unresolvedConfiguration: CommandLineOptions) => Promise<{
|
|
5
|
+
report: import("./types/issues.js").Report;
|
|
6
|
+
issues: import("./types/issues.js").Issues;
|
|
7
|
+
counters: import("./types/issues.js").Counters;
|
|
8
|
+
rules: import("./types/issues.js").Rules;
|
|
9
|
+
tagHints: Set<import("./types/issues.js").TagHint>;
|
|
10
|
+
configurationHints: Set<import("./types/issues.js").ConfigurationHint>;
|
|
11
|
+
}>;
|
|
@@ -9,5 +9,5 @@ type GetFilteredScriptsOptions = {
|
|
|
9
9
|
isProduction: boolean;
|
|
10
10
|
scripts?: Scripts;
|
|
11
11
|
};
|
|
12
|
-
export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) =>
|
|
12
|
+
export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) => Scripts;
|
|
13
13
|
export {};
|
package/dist/manifest/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import type { HostDependencies, InstalledBinaries } from '../types/workspace.js';
|
|
1
2
|
type Options = {
|
|
2
3
|
packageNames: string[];
|
|
3
4
|
dir: string;
|
|
4
5
|
cwd: string;
|
|
5
6
|
};
|
|
6
7
|
export declare const getDependencyMetaData: ({ cwd, dir, packageNames }: Options) => {
|
|
7
|
-
hostDependencies:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}[]>;
|
|
11
|
-
installedBinaries: Map<string, Set<string>>;
|
|
12
|
-
hasTypesIncluded: any;
|
|
8
|
+
hostDependencies: HostDependencies;
|
|
9
|
+
installedBinaries: InstalledBinaries;
|
|
10
|
+
hasTypesIncluded: Set<string>;
|
|
13
11
|
};
|
|
14
12
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { BabelConfig, BabelConfigObj } from './types.js';
|
|
|
3
3
|
export declare const getDependenciesFromConfig: (config: BabelConfigObj) => string[];
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
enablers:
|
|
6
|
+
enablers: RegExp[];
|
|
7
7
|
isEnabled: IsPluginEnabled;
|
|
8
8
|
config: string[];
|
|
9
9
|
resolveConfig: ResolveConfig<BabelConfig>;
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
|
2
2
|
import type { CapacitorConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: RegExp[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<CapacitorConfig>;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'commitlint';
|
|
3
3
|
const enablers = ['@commitlint/cli'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = [
|
|
6
|
-
'.commitlintrc',
|
|
7
|
-
'.commitlintrc.{json,yaml,yml,js,cjs,ts,cts}',
|
|
8
|
-
'commitlint.config.{js,cjs,ts,cts}',
|
|
9
|
-
'package.json',
|
|
10
|
-
];
|
|
5
|
+
const config = ['package.json', 'package.yaml', ...toCosmiconfig('commitlint', { additionalExtensions: ['cts'] })];
|
|
11
6
|
const resolveConfig = async (config) => {
|
|
12
7
|
const extendsConfigs = config.extends
|
|
13
8
|
? [config.extends]
|
|
@@ -109,22 +109,22 @@ export declare class DummyEleventyConfig {
|
|
|
109
109
|
DateTime: {};
|
|
110
110
|
dynamicPermalinks: boolean;
|
|
111
111
|
useGitIgnore: boolean;
|
|
112
|
-
ignores:
|
|
113
|
-
watchIgnores:
|
|
112
|
+
ignores: Set<unknown>;
|
|
113
|
+
watchIgnores: Set<unknown>;
|
|
114
114
|
dataDeepMerge: boolean;
|
|
115
|
-
extensionMap:
|
|
115
|
+
extensionMap: Set<unknown>;
|
|
116
116
|
watchJavaScriptDependencies: boolean;
|
|
117
117
|
additionalWatchTargets: never[];
|
|
118
118
|
serverOptions: {};
|
|
119
119
|
globalData: {};
|
|
120
120
|
chokidarConfig: {};
|
|
121
121
|
watchThrottleWaitTime: number;
|
|
122
|
-
dataExtensions: any
|
|
122
|
+
dataExtensions: Map<any, any>;
|
|
123
123
|
quietMode: boolean;
|
|
124
124
|
plugins: never[];
|
|
125
125
|
_pluginExecution: boolean;
|
|
126
126
|
useTemplateCache: boolean;
|
|
127
|
-
dataFilterSelectors:
|
|
127
|
+
dataFilterSelectors: Set<unknown>;
|
|
128
128
|
libraryAmendments: {};
|
|
129
129
|
serverPassthroughCopyBehavior: string;
|
|
130
130
|
urlTransforms: never[];
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
|
+
import { DummyEleventyConfig } from './helpers.js';
|
|
3
|
+
import type { EleventyConfig } from './types.js';
|
|
4
|
+
type T = Partial<EleventyConfig> | ((arg: DummyEleventyConfig) => Promise<Partial<EleventyConfig>>);
|
|
2
5
|
declare const _default: {
|
|
3
6
|
title: string;
|
|
4
7
|
enablers: string[];
|
|
5
8
|
isEnabled: IsPluginEnabled;
|
|
6
9
|
config: string[];
|
|
7
10
|
production: string[];
|
|
8
|
-
resolveEntryPaths: ResolveEntryPaths<
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
11
|
+
resolveEntryPaths: ResolveEntryPaths<T>;
|
|
12
|
+
resolveConfig: ResolveConfig<T>;
|
|
10
13
|
};
|
|
11
14
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
|
2
2
|
import type { GraphqlCodegenTypes, GraphqlConfigTypes, GraphqlProjectsConfigTypes } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: (string | RegExp)[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
packageJsonPath: (manifest: import("../../types/package-json.js").PackageJson) => string;
|
|
8
8
|
config: string[];
|
|
@@ -9,7 +9,7 @@ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
|
9
9
|
const packageJsonPath = manifest => get(manifest, 'codegen') ?? get(manifest, 'graphql');
|
|
10
10
|
const config = [
|
|
11
11
|
'package.json',
|
|
12
|
-
'codegen.{json,yml,yaml,js,ts
|
|
12
|
+
'codegen.{json,yml,yaml,js,ts}',
|
|
13
13
|
'.codegenrc.{json,yml,yaml,js,ts}',
|
|
14
14
|
'codegen.config.js',
|
|
15
15
|
'.graphqlrc',
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
|
+
import type { JestConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: string[];
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
config: string[];
|
|
7
8
|
entry: string[];
|
|
8
|
-
resolveEntryPaths: ResolveEntryPaths<
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
9
|
+
resolveEntryPaths: ResolveEntryPaths<JestConfig>;
|
|
10
|
+
resolveConfig: ResolveConfig<JestConfig>;
|
|
10
11
|
};
|
|
11
12
|
export default _default;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { LintStagedConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: string[];
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
config: string[];
|
|
8
|
-
resolveConfig: ResolveConfig<
|
|
9
|
+
resolveConfig: ResolveConfig<LintStagedConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { getDependenciesFromScripts, hasDependency, toLilconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'lint-staged';
|
|
3
3
|
const enablers = ['lint-staged'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const packageJsonPath = 'lint-staged';
|
|
6
6
|
const config = [
|
|
7
|
-
'.lintstagedrc',
|
|
8
|
-
'.lintstagedrc.json',
|
|
9
|
-
'.lintstagedrc.{yml,yaml}',
|
|
10
|
-
'.lintstagedrc.{js,mjs,cjs}',
|
|
11
|
-
'lint-staged.config.{js,mjs,cjs}',
|
|
12
7
|
'package.json',
|
|
8
|
+
'package.yaml',
|
|
9
|
+
'package.yml',
|
|
10
|
+
...toLilconfig('lint-staged'),
|
|
11
|
+
...toLilconfig('lintstaged'),
|
|
13
12
|
];
|
|
14
13
|
const resolveConfig = async (config, options) => {
|
|
15
14
|
if (typeof config === 'function')
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { isInternal } from '#p/util/path.js';
|
|
2
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
3
3
|
import { toEntryPattern } from '#p/util/protocols.js';
|
|
4
4
|
const title = 'LintHTML';
|
|
5
5
|
const packageJsonPath = 'linthtmlConfig';
|
|
6
6
|
const enablers = ['@linthtml/linthtml'];
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
|
-
const config = [
|
|
9
|
-
'.linthtmlrc',
|
|
10
|
-
'.linthtmlrc.json',
|
|
11
|
-
'.linthtmlrc.yml',
|
|
12
|
-
'.linthtmlrc.{js,cjs}',
|
|
13
|
-
'linthtml.config.js',
|
|
14
|
-
'package.json',
|
|
15
|
-
];
|
|
8
|
+
const config = ['package.json', ...toCosmiconfig('linthtml')];
|
|
16
9
|
const resolveConfig = config => {
|
|
17
10
|
const extensions = [config.extends ?? []]
|
|
18
11
|
.flat()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'lockfile-lint';
|
|
3
3
|
const enablers = ['lockfile-lint'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = ['.
|
|
5
|
+
const config = ['package.json', ...toCosmiconfig('lockfile-lint', { additionalExtensions: ['toml'] })];
|
|
6
6
|
export default {
|
|
7
7
|
title,
|
|
8
8
|
enablers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getArgumentValues: (value: string, matcher: RegExp) =>
|
|
1
|
+
export declare const getArgumentValues: (value: string, matcher: RegExp) => string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FunctionsConfig } from './types.js';
|
|
2
|
-
export declare const extractFunctionsConfigProperty: (config: FunctionsConfig, property: keyof FunctionsConfig) =>
|
|
2
|
+
export declare const extractFunctionsConfigProperty: (config: FunctionsConfig, property: keyof FunctionsConfig) => string[];
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types
|
|
|
2
2
|
import type { NetlifyConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: (string | RegExp)[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
production: string[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'npm-package-json-lint';
|
|
3
3
|
const enablers = ['npm-package-json-lint'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const packageJsonPath = 'npmpackagejsonlint';
|
|
6
|
-
const config = ['.
|
|
6
|
+
const config = ['package.json', ...toCosmiconfig('npmpackagejsonlint')];
|
|
7
7
|
const resolveConfig = localConfig => {
|
|
8
8
|
return localConfig?.extends ? [localConfig.extends] : [];
|
|
9
9
|
};
|
|
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
|
2
2
|
import type { NxConfigRoot, NxProjectConfiguration } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: (string | RegExp)[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<NxProjectConfiguration | NxConfigRoot>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toLilconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'PostCSS';
|
|
3
3
|
const enablers = ['postcss', 'postcss-cli', 'next'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = [
|
|
5
|
+
const config = [
|
|
6
|
+
'package.json',
|
|
7
|
+
'postcss.config.json',
|
|
8
|
+
...toLilconfig('postcss', { configDir: false, additionalExtensions: ['ts', 'mts', 'cts', 'yaml', 'yml'] }),
|
|
9
|
+
];
|
|
6
10
|
const resolveConfig = config => {
|
|
7
11
|
return config.plugins
|
|
8
12
|
? (Array.isArray(config.plugins) ? config.plugins : Object.keys(config.plugins)).flatMap(plugin => {
|
|
@@ -4,9 +4,9 @@ const enablers = ['prettier'];
|
|
|
4
4
|
const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, enablers) || 'prettier' in config;
|
|
5
5
|
const config = [
|
|
6
6
|
'.prettierrc',
|
|
7
|
-
'.prettierrc.{json,js,cjs,mjs,yml,yaml}',
|
|
7
|
+
'.prettierrc.{json,js,cjs,mjs,yml,yaml,toml,json5}',
|
|
8
8
|
'prettier.config.{js,cjs,mjs}',
|
|
9
|
-
'package.json',
|
|
9
|
+
'package.{json,yaml}',
|
|
10
10
|
];
|
|
11
11
|
const resolveConfig = config => {
|
|
12
12
|
if (typeof config === 'string') {
|
|
@@ -3,7 +3,7 @@ const title = 'Release It';
|
|
|
3
3
|
const enablers = ['release-it'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const packageJsonPath = 'release-it';
|
|
6
|
-
const config = ['.release-it.json
|
|
6
|
+
const config = ['.release-it.{json,js,cjs,ts,yml,yaml,toml}', 'package.json'];
|
|
7
7
|
const resolveConfig = (config, options) => {
|
|
8
8
|
const plugins = config.plugins ? Object.keys(config.plugins) : [];
|
|
9
9
|
const scripts = config.hooks ? Object.values(config.hooks).flat() : [];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'Semantic Release';
|
|
3
3
|
const enablers = ['semantic-release'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const packageJsonPath = 'release';
|
|
6
|
-
const config = ['.
|
|
6
|
+
const config = ['package.json', ...toCosmiconfig('release')];
|
|
7
7
|
const resolveConfig = config => {
|
|
8
8
|
const plugins = (config?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
|
|
9
9
|
return plugins;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { PluginConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: import("#p/types/config.js").IgnorePatterns;
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
config: string[];
|
|
8
|
-
resolveConfig: ResolveConfig<
|
|
9
|
+
resolveConfig: ResolveConfig<PluginConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toLilconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'size-limit';
|
|
3
3
|
const enablers = ['size-limit'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = [
|
|
5
|
+
const config = [
|
|
6
|
+
'package.json',
|
|
7
|
+
...toLilconfig('size-limit', { configDir: false, additionalExtensions: ['ts', 'mts', 'cts'], rcSuffix: '' }),
|
|
8
|
+
];
|
|
6
9
|
export default {
|
|
7
10
|
title,
|
|
8
11
|
enablers,
|
|
@@ -2,10 +2,10 @@ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types
|
|
|
2
2
|
import type { StorybookConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: (string | RegExp)[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
entry:
|
|
8
|
+
entry: string[];
|
|
9
9
|
project: string[];
|
|
10
10
|
resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
|
|
11
11
|
resolveConfig: ResolveConfig<StorybookConfig>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isInternal } from '#p/util/path.js';
|
|
2
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
3
3
|
const title = 'Stylelint';
|
|
4
4
|
const enablers = ['stylelint'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
-
const config = ['.
|
|
6
|
+
const config = ['package.json', ...toCosmiconfig('stylelint')];
|
|
7
7
|
const resolve = (config) => {
|
|
8
8
|
const extend = config.extends ? [config.extends].flat().filter(id => !isInternal(id)) : [];
|
|
9
9
|
const plugins = config.plugins ? [config.plugins].flat().filter(id => !isInternal(id)) : [];
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { get } from '#p/util/object.js';
|
|
2
|
+
import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
|
|
2
3
|
const title = 'Syncpack';
|
|
3
4
|
const enablers = ['syncpack'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = ['.
|
|
6
|
+
const config = ['package.json', ...toCosmiconfig('syncpack')];
|
|
7
|
+
const packageJsonPath = manifest => get(manifest, 'syncpack');
|
|
6
8
|
export default {
|
|
7
9
|
title,
|
|
8
10
|
enablers,
|
|
9
11
|
isEnabled,
|
|
10
12
|
config,
|
|
13
|
+
packageJsonPath,
|
|
11
14
|
};
|
|
@@ -3,7 +3,7 @@ import { toProductionEntryPattern } from '#p/util/protocols.js';
|
|
|
3
3
|
const title = 'tsup';
|
|
4
4
|
const enablers = ['tsup'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
-
const config = ['tsup.config.{js,ts,cjs,json}', 'package.json'];
|
|
6
|
+
const config = ['tsup.config.{js,ts,cjs,mjs,json}', 'package.json'];
|
|
7
7
|
const resolveConfig = async (config) => {
|
|
8
8
|
if (typeof config === 'function')
|
|
9
9
|
config = await config({});
|
|
@@ -4,10 +4,10 @@ const enablers = ['typedoc'];
|
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const packageJsonPath = 'typedocOptions';
|
|
6
6
|
const config = [
|
|
7
|
-
'typedoc.{js,cjs,json,jsonc}',
|
|
8
|
-
'typedoc.config.{js,cjs}',
|
|
9
|
-
'.config/typedoc.{js,cjs,json,jsonc}',
|
|
10
|
-
'.config/typedoc.config.{js,cjs}',
|
|
7
|
+
'typedoc.{js,cjs,mjs,json,jsonc}',
|
|
8
|
+
'typedoc.config.{js,cjs,mjs}',
|
|
9
|
+
'.config/typedoc.{js,cjs,mjs,json,jsonc}',
|
|
10
|
+
'.config/typedoc.config.{js,cjs,mjs}',
|
|
11
11
|
'package.json',
|
|
12
12
|
'tsconfig.json',
|
|
13
13
|
];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { UnbuildConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: string[];
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
config: string[];
|
|
7
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveConfig: ResolveConfig<UnbuildConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
1
|
+
import { hasDependency, toUnconfig } from '#p/util/plugin.js';
|
|
2
2
|
const title = 'UnoCSS';
|
|
3
3
|
const enablers = ['unocss'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const config = ['uno.config
|
|
5
|
+
const config = [...toUnconfig('uno.config'), ...toUnconfig('unocss.config')];
|
|
6
6
|
export default {
|
|
7
7
|
title,
|
|
8
8
|
enablers,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViteConfig } from './types.js';
|
|
2
|
-
export declare const getEnvPackageName: (env: string) =>
|
|
3
|
-
export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) =>
|
|
2
|
+
export declare const getEnvPackageName: (env: string) => string;
|
|
3
|
+
export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) => string[];
|
|
@@ -3,7 +3,10 @@ import type { WebpackConfig } from './types.js';
|
|
|
3
3
|
export declare const findWebpackDependenciesFromConfig: ({ config, cwd }: {
|
|
4
4
|
config: WebpackConfig;
|
|
5
5
|
cwd: string;
|
|
6
|
-
}) =>
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
dependencies: Set<string>;
|
|
8
|
+
entryPatterns: Set<string>;
|
|
9
|
+
}>;
|
|
7
10
|
declare const _default: {
|
|
8
11
|
title: string;
|
|
9
12
|
enablers: string[];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { WireitConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: string[];
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
config: string[];
|
|
8
|
-
resolveConfig: ResolveConfig<
|
|
9
|
-
command?: string;
|
|
10
|
-
}>>;
|
|
9
|
+
resolveConfig: ResolveConfig<WireitConfig>;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
package/dist/plugins/xo/index.js
CHANGED
|
@@ -4,8 +4,8 @@ const title = 'xo';
|
|
|
4
4
|
const enablers = ['xo'];
|
|
5
5
|
const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, enablers) || 'xo' in config;
|
|
6
6
|
const packageJsonPath = 'xo';
|
|
7
|
-
const config = ['
|
|
8
|
-
const entry = ['{
|
|
7
|
+
const config = ['package.json', '.xo-config', '.xo-config.{js,cjs,json}', 'xo.config.{js,cjs}'];
|
|
8
|
+
const entry = ['.xo-config.{js,cjs}', 'xo.config.{js,cjs}'];
|
|
9
9
|
const resolveConfig = async (config, options) => {
|
|
10
10
|
const dependencies = await getDependenciesDeep(config, options);
|
|
11
11
|
return [...dependencies];
|