knip 5.1.2 → 5.1.3
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 +3 -3
- package/dist/ConfigurationValidator.d.ts +21 -21
- package/dist/ProjectPrincipal.d.ts +1 -1
- package/dist/ProjectPrincipal.js +3 -5
- package/dist/WorkspaceWorker.d.ts +2 -2
- package/dist/WorkspaceWorker.js +61 -44
- package/dist/binaries/index.js +2 -2
- package/dist/binaries/resolvers/index.d.ts +12 -12
- package/dist/compilers/index.d.ts +6 -7
- package/dist/compilers/index.js +0 -3
- package/dist/constants.d.ts +1 -2
- package/dist/constants.js +8 -4
- package/dist/plugins/_template/index.d.ts +10 -9
- package/dist/plugins/_template/index.js +16 -30
- package/dist/plugins/angular/index.d.ts +8 -6
- package/dist/plugins/angular/index.js +17 -22
- package/dist/plugins/astro/index.d.ts +7 -7
- package/dist/plugins/astro/index.js +14 -17
- package/dist/plugins/ava/index.d.ts +9 -7
- package/dist/plugins/ava/index.js +19 -21
- package/dist/plugins/babel/helpers.js +1 -1
- package/dist/plugins/babel/index.d.ts +7 -7
- package/dist/plugins/babel/index.js +15 -26
- package/dist/plugins/capacitor/index.d.ts +7 -6
- package/dist/plugins/capacitor/index.js +11 -18
- package/dist/plugins/changesets/index.d.ts +7 -6
- package/dist/plugins/changesets/index.js +14 -21
- package/dist/plugins/changesets/types.d.ts +3 -0
- package/dist/plugins/changesets/types.js +1 -0
- package/dist/plugins/commitizen/index.d.ts +8 -7
- package/dist/plugins/commitizen/index.js +13 -21
- package/dist/plugins/commitlint/index.d.ts +9 -6
- package/dist/plugins/commitlint/index.js +11 -19
- package/dist/plugins/cspell/index.d.ts +7 -6
- package/dist/plugins/cspell/index.js +12 -20
- package/dist/plugins/cypress/index.d.ts +7 -7
- package/dist/plugins/cypress/index.js +13 -21
- package/dist/plugins/drizzle/index.d.ts +7 -6
- package/dist/plugins/drizzle/index.js +13 -16
- package/dist/plugins/eleventy/index.d.ts +11 -9
- package/dist/plugins/eleventy/index.js +35 -41
- package/dist/plugins/eslint/helpers.d.ts +3 -5
- package/dist/plugins/eslint/helpers.js +10 -15
- package/dist/plugins/eslint/index.d.ts +10 -8
- package/dist/plugins/eslint/index.js +15 -29
- package/dist/plugins/gatsby/index.d.ts +8 -7
- package/dist/plugins/gatsby/index.js +15 -22
- package/dist/plugins/github-actions/index.d.ts +6 -6
- package/dist/plugins/github-actions/index.js +15 -25
- package/dist/plugins/graphql-codegen/index.d.ts +8 -7
- package/dist/plugins/graphql-codegen/index.js +15 -23
- package/dist/plugins/husky/index.d.ts +6 -6
- package/dist/plugins/husky/index.js +10 -16
- package/dist/plugins/jest/index.d.ts +9 -7
- package/dist/plugins/jest/index.js +50 -31
- package/dist/plugins/lefthook/index.d.ts +6 -6
- package/dist/plugins/lefthook/index.js +19 -24
- package/dist/plugins/lint-staged/index.d.ts +8 -7
- package/dist/plugins/lint-staged/index.js +16 -23
- package/dist/plugins/linthtml/index.d.ts +8 -7
- package/dist/plugins/linthtml/index.js +16 -24
- package/dist/plugins/markdownlint/index.d.ts +7 -6
- package/dist/plugins/markdownlint/index.js +12 -17
- package/dist/plugins/mocha/index.d.ts +9 -7
- package/dist/plugins/mocha/index.js +19 -22
- package/dist/plugins/msw/index.d.ts +8 -7
- package/dist/plugins/msw/index.js +12 -15
- package/dist/plugins/netlify/index.d.ts +9 -7
- package/dist/plugins/netlify/index.js +23 -27
- package/dist/plugins/next/index.d.ts +6 -7
- package/dist/plugins/next/index.js +10 -18
- package/dist/plugins/node-test-runner/index.d.ts +5 -6
- package/dist/plugins/node-test-runner/index.js +6 -18
- package/dist/plugins/npm-package-json-lint/index.d.ts +8 -7
- package/dist/plugins/npm-package-json-lint/index.js +12 -19
- package/dist/plugins/nx/index.d.ts +7 -6
- package/dist/plugins/nx/index.js +18 -27
- package/dist/plugins/nyc/index.d.ts +7 -6
- package/dist/plugins/nyc/index.js +11 -17
- package/dist/plugins/playwright/index.d.ts +11 -13
- package/dist/plugins/playwright/index.js +23 -30
- package/dist/plugins/playwright-ct/index.d.ts +8 -7
- package/dist/plugins/playwright-ct/index.js +12 -24
- package/dist/plugins/postcss/index.d.ts +7 -6
- package/dist/plugins/postcss/index.js +12 -21
- package/dist/plugins/prettier/index.d.ts +7 -6
- package/dist/plugins/prettier/index.js +14 -20
- package/dist/plugins/release-it/index.d.ts +8 -7
- package/dist/plugins/release-it/index.js +18 -27
- package/dist/plugins/remark/index.d.ts +8 -7
- package/dist/plugins/remark/index.js +13 -28
- package/dist/plugins/remix/index.d.ts +6 -7
- package/dist/plugins/remix/index.js +10 -20
- package/dist/plugins/rollup/index.d.ts +5 -6
- package/dist/plugins/rollup/index.js +8 -16
- package/dist/plugins/semantic-release/index.d.ts +8 -7
- package/dist/plugins/semantic-release/index.js +13 -25
- package/dist/plugins/sentry/index.d.ts +5 -6
- package/dist/plugins/sentry/index.js +8 -16
- package/dist/plugins/storybook/index.d.ts +10 -8
- package/dist/plugins/storybook/index.js +28 -35
- package/dist/plugins/stryker/index.d.ts +7 -6
- package/dist/plugins/stryker/index.js +10 -18
- package/dist/plugins/stylelint/index.d.ts +7 -6
- package/dist/plugins/stylelint/index.js +13 -23
- package/dist/plugins/svelte/index.d.ts +7 -8
- package/dist/plugins/svelte/index.js +13 -23
- package/dist/plugins/tailwind/index.d.ts +5 -6
- package/dist/plugins/tailwind/index.js +8 -14
- package/dist/plugins/tsup/index.d.ts +7 -6
- package/dist/plugins/tsup/index.js +14 -21
- package/dist/plugins/typedoc/index.d.ts +10 -7
- package/dist/plugins/typedoc/index.js +14 -24
- package/dist/plugins/typescript/index.d.ts +8 -7
- package/dist/plugins/typescript/index.js +31 -25
- package/dist/plugins/unbuild/index.d.ts +7 -6
- package/dist/plugins/unbuild/index.js +12 -17
- package/dist/plugins/vercel-og/index.d.ts +5 -6
- package/dist/plugins/vercel-og/index.js +8 -16
- package/dist/plugins/vite/index.d.ts +9 -7
- package/dist/plugins/vite/index.js +13 -18
- package/dist/plugins/vitest/index.d.ts +11 -9
- package/dist/plugins/vitest/index.js +62 -49
- package/dist/plugins/vue/index.d.ts +7 -6
- package/dist/plugins/vue/index.js +14 -26
- package/dist/plugins/webpack/index.d.ts +7 -6
- package/dist/plugins/webpack/index.js +17 -20
- package/dist/plugins/wireit/index.d.ts +8 -7
- package/dist/plugins/wireit/index.js +12 -20
- package/dist/plugins/yorkie/index.d.ts +8 -7
- package/dist/plugins/yorkie/index.js +13 -21
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +14 -0
- package/dist/reporters/index.d.ts +5 -5
- package/dist/types/config.d.ts +1 -1
- package/dist/types/package-json.d.ts +12 -13
- package/dist/types/plugins.d.ts +20 -14
- package/dist/types/util.d.ts +0 -13
- package/dist/typescript/SourceFileManager.js +3 -0
- package/dist/typescript/createHosts.js +4 -3
- package/dist/typescript/resolveModuleNames.js +26 -41
- package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/propertyAccessCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
- package/dist/typescript/visitors/exports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
- package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/index.d.ts +1 -1
- package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
- package/dist/typescript/visitors/scripts/execa.d.ts +1 -1
- package/dist/typescript/visitors/scripts/index.d.ts +1 -1
- package/dist/typescript/visitors/scripts/zx.d.ts +1 -1
- package/dist/util/Performance.d.ts +1 -4
- package/dist/util/Performance.js +5 -1
- package/dist/util/fs.js +0 -3
- package/dist/util/loader.d.ts +0 -2
- package/dist/util/loader.js +8 -16
- package/dist/util/object.d.ts +1 -1
- package/dist/util/path.d.ts +0 -3
- package/dist/util/path.js +0 -1
- package/dist/util/plugin.d.ts +4 -1
- package/dist/util/plugin.js +28 -1
- package/dist/util/require.d.ts +1 -0
- package/dist/util/require.js +13 -0
- package/dist/util/tsconfig-loader.js +1 -2
- package/dist/util/type.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
- package/dist/plugins/eslint/fallback.d.ts +0 -1
- package/dist/plugins/eslint/fallback.js +0 -18
|
@@ -1,35 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return [];
|
|
13
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest[PACKAGE_JSON_PATH] : await load(configFilePath);
|
|
14
|
-
if (!localConfig)
|
|
15
|
-
return [];
|
|
16
|
-
const plugins = localConfig.plugins ? Object.keys(localConfig.plugins) : [];
|
|
17
|
-
const scripts = localConfig.hooks ? Object.values(localConfig.hooks).flat() : [];
|
|
18
|
-
if (typeof localConfig.github?.releaseNotes === 'string') {
|
|
19
|
-
scripts.push(localConfig.github.releaseNotes);
|
|
1
|
+
import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Release It';
|
|
3
|
+
const enablers = ['release-it'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const packageJsonPath = 'release-it';
|
|
6
|
+
const config = ['.release-it.json', '.release-it.{js,cjs}', '.release-it.{yml,yaml}', 'package.json'];
|
|
7
|
+
const resolveConfig = (config, options) => {
|
|
8
|
+
const plugins = config.plugins ? Object.keys(config.plugins) : [];
|
|
9
|
+
const scripts = config.hooks ? Object.values(config.hooks).flat() : [];
|
|
10
|
+
if (typeof config.github?.releaseNotes === 'string') {
|
|
11
|
+
scripts.push(config.github.releaseNotes);
|
|
20
12
|
}
|
|
21
|
-
if (typeof
|
|
22
|
-
scripts.push(
|
|
13
|
+
if (typeof config.gitlab?.releaseNotes === 'string') {
|
|
14
|
+
scripts.push(config.gitlab.releaseNotes);
|
|
23
15
|
}
|
|
24
16
|
const dependencies = getDependenciesFromScripts(scripts, options);
|
|
25
17
|
return [...plugins, ...dependencies];
|
|
26
18
|
};
|
|
27
|
-
const findDependencies = timerify(findReleaseItDependencies);
|
|
28
19
|
export default {
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
title,
|
|
21
|
+
enablers,
|
|
31
22
|
isEnabled,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
packageJsonPath,
|
|
24
|
+
config,
|
|
25
|
+
resolveConfig,
|
|
35
26
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { RemarkConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
readonly title: "Remark";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly packageJsonPath: "remarkConfig";
|
|
8
|
+
readonly config: string[];
|
|
9
|
+
readonly resolveConfig: ResolveConfig<RemarkConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
'package.json',
|
|
10
|
-
'.remarkrc',
|
|
11
|
-
'.remarkrc.json',
|
|
12
|
-
'.remarkrc.{js,cjs,mjs}',
|
|
13
|
-
'.remarkrc.{yml,yaml}',
|
|
14
|
-
];
|
|
15
|
-
const findRemarkDependencies = async (configFilePath, options) => {
|
|
16
|
-
const { manifest, isProduction } = options;
|
|
17
|
-
if (isProduction)
|
|
18
|
-
return [];
|
|
19
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest[PACKAGE_JSON_PATH] : await load(configFilePath);
|
|
20
|
-
if (!localConfig)
|
|
21
|
-
return [];
|
|
22
|
-
const plugins = localConfig.plugins
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Remark';
|
|
3
|
+
const enablers = ['remark-cli'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const packageJsonPath = 'remarkConfig';
|
|
6
|
+
const config = ['package.json', '.remarkrc', '.remarkrc.json', '.remarkrc.{js,cjs,mjs}', '.remarkrc.{yml,yaml}'];
|
|
7
|
+
const resolveConfig = config => {
|
|
8
|
+
const plugins = config.plugins
|
|
23
9
|
?.flatMap(plugin => {
|
|
24
10
|
if (typeof plugin === 'string')
|
|
25
11
|
return plugin;
|
|
@@ -30,12 +16,11 @@ const findRemarkDependencies = async (configFilePath, options) => {
|
|
|
30
16
|
.map(plugin => (plugin.startsWith('remark-') ? plugin : `remark-${plugin}`)) ?? [];
|
|
31
17
|
return plugins;
|
|
32
18
|
};
|
|
33
|
-
const findDependencies = timerify(findRemarkDependencies);
|
|
34
19
|
export default {
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
title,
|
|
21
|
+
enablers,
|
|
37
22
|
isEnabled,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
packageJsonPath,
|
|
24
|
+
config,
|
|
25
|
+
resolveConfig,
|
|
41
26
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
findDependencies: GenericPluginCallback;
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: RegExp[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
entry: string[];
|
|
7
|
+
production: string[];
|
|
9
8
|
};
|
|
10
9
|
export default _default;
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const ENTRY_FILE_PATTERNS = ['remix.config.js', 'remix.init/index.js'];
|
|
8
|
-
const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Remix';
|
|
3
|
+
const enablers = [/^@remix-run\//];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['remix.config.js', 'remix.init/index.js'];
|
|
6
|
+
const production = [
|
|
9
7
|
'app/root.tsx',
|
|
10
8
|
'app/entry.{client,server}.{js,jsx,ts,tsx}',
|
|
11
9
|
'app/routes/**/*.{js,ts,tsx}',
|
|
12
10
|
'server.{js,ts}',
|
|
13
11
|
];
|
|
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)];
|
|
19
|
-
};
|
|
20
|
-
const findDependencies = timerify(findRemixDependencies);
|
|
21
12
|
export default {
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
title,
|
|
14
|
+
enablers,
|
|
24
15
|
isEnabled,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
findDependencies,
|
|
16
|
+
entry,
|
|
17
|
+
production,
|
|
28
18
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
findDependencies: GenericPluginCallback;
|
|
3
|
+
readonly title: "Rollup";
|
|
4
|
+
readonly enablers: string[];
|
|
5
|
+
readonly isEnabled: IsPluginEnabled;
|
|
6
|
+
readonly entry: string[];
|
|
8
7
|
};
|
|
9
8
|
export default _default;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
7
|
-
const ENTRY_FILE_PATTERNS = ['rollup.config.{js,cjs,mjs,ts}'];
|
|
8
|
-
const findRollupDependencies = async () => {
|
|
9
|
-
const entryPatterns = ENTRY_FILE_PATTERNS.map(toEntryPattern);
|
|
10
|
-
return entryPatterns;
|
|
11
|
-
};
|
|
12
|
-
const findDependencies = timerify(findRollupDependencies);
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Rollup';
|
|
3
|
+
const enablers = ['rollup'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['rollup.config.{js,cjs,mjs,ts}'];
|
|
13
6
|
export default {
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
title,
|
|
8
|
+
enablers,
|
|
16
9
|
isEnabled,
|
|
17
|
-
|
|
18
|
-
findDependencies,
|
|
10
|
+
entry,
|
|
19
11
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { SemanticReleaseConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
readonly title: "Semantic Release";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly packageJsonPath: "release";
|
|
8
|
+
readonly config: string[];
|
|
9
|
+
readonly resolveConfig: ResolveConfig<SemanticReleaseConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
'.releaserc',
|
|
10
|
-
'.releaserc.{yaml,yml,json,js,cjs}',
|
|
11
|
-
'release.config.{js,cjs}',
|
|
12
|
-
'package.json',
|
|
13
|
-
];
|
|
14
|
-
const findSemanticReleaseDependencies = async (configFilePath, options) => {
|
|
15
|
-
const { manifest, isProduction } = options;
|
|
16
|
-
if (isProduction)
|
|
17
|
-
return [];
|
|
18
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest[PACKAGE_JSON_PATH] : await load(configFilePath);
|
|
19
|
-
const plugins = (localConfig?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Semantic Release';
|
|
3
|
+
const enablers = ['semantic-release'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const packageJsonPath = 'release';
|
|
6
|
+
const config = ['.releaserc', '.releaserc.{yaml,yml,json,js,cjs}', 'release.config.{js,cjs}', 'package.json'];
|
|
7
|
+
const resolveConfig = config => {
|
|
8
|
+
const plugins = (config?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
|
|
20
9
|
return plugins;
|
|
21
10
|
};
|
|
22
|
-
const findDependencies = timerify(findSemanticReleaseDependencies);
|
|
23
11
|
export default {
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
title,
|
|
13
|
+
enablers,
|
|
26
14
|
isEnabled,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
packageJsonPath,
|
|
16
|
+
config,
|
|
17
|
+
resolveConfig,
|
|
30
18
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
findDependencies: GenericPluginCallback;
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: RegExp[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
entry: string[];
|
|
8
7
|
};
|
|
9
8
|
export default _default;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
7
|
-
const ENTRY_FILE_PATTERNS = ['sentry.{client,server,edge}.config.{js,ts}'];
|
|
8
|
-
const findSentryDependencies = async () => {
|
|
9
|
-
const entryPatterns = ENTRY_FILE_PATTERNS.map(toEntryPattern);
|
|
10
|
-
return entryPatterns;
|
|
11
|
-
};
|
|
12
|
-
const findDependencies = timerify(findSentryDependencies);
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Sentry';
|
|
3
|
+
const enablers = [/^@sentry\//];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['sentry.{client,server,edge}.config.{js,ts}'];
|
|
13
6
|
export default {
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
title,
|
|
8
|
+
enablers,
|
|
16
9
|
isEnabled,
|
|
17
|
-
|
|
18
|
-
findDependencies,
|
|
10
|
+
entry,
|
|
19
11
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
|
+
import type { StorybookConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
readonly title: "Storybook";
|
|
5
|
+
readonly enablers: (string | RegExp)[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly entry: string[];
|
|
9
|
+
readonly project: string[];
|
|
10
|
+
readonly resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
|
|
11
|
+
readonly resolveConfig: ResolveConfig<StorybookConfig>;
|
|
10
12
|
};
|
|
11
13
|
export default _default;
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { hasDependency, load } from '../../util/plugin.js';
|
|
1
|
+
import { join, relative } from '#p/util/path.js';
|
|
2
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
4
3
|
import { toEntryPattern } from '../../util/protocols.js';
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies,
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const {
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
? await localConfig.stories(STORIES_FILE_PATTERNS)
|
|
18
|
-
: localConfig?.stories;
|
|
19
|
-
const relativePatterns = stories?.map(pattern => {
|
|
4
|
+
const title = 'Storybook';
|
|
5
|
+
const enablers = [/^@storybook\//, '@nrwl/storybook'];
|
|
6
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
+
const config = ['.storybook/{main,test-runner}.{js,ts}'];
|
|
8
|
+
const stories = ['**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))'];
|
|
9
|
+
const restEntry = ['.storybook/{manager,preview}.{js,jsx,ts,tsx}'];
|
|
10
|
+
const entry = [...restEntry, ...stories];
|
|
11
|
+
const project = ['.storybook/**/*.{js,jsx,ts,tsx}'];
|
|
12
|
+
const resolveEntryPaths = async (localConfig, options) => {
|
|
13
|
+
const { cwd, configFileDir } = options;
|
|
14
|
+
const strs = typeof localConfig?.stories === 'function' ? await localConfig.stories(stories) : localConfig?.stories;
|
|
15
|
+
const relativePatterns = strs?.map(pattern => {
|
|
20
16
|
if (typeof pattern === 'string')
|
|
21
|
-
return relative(cwd, join(
|
|
22
|
-
return relative(cwd, join(
|
|
17
|
+
return relative(cwd, join(configFileDir, pattern));
|
|
18
|
+
return relative(cwd, join(configFileDir, pattern.directory, pattern.files ?? stories[0]));
|
|
23
19
|
});
|
|
24
|
-
const patterns = [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const entryPatterns = patterns.map(toEntryPattern);
|
|
29
|
-
if (!localConfig || isProduction)
|
|
30
|
-
return entryPatterns;
|
|
20
|
+
const patterns = [...restEntry, ...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : stories)];
|
|
21
|
+
return patterns.map(toEntryPattern);
|
|
22
|
+
};
|
|
23
|
+
const resolveConfig = async (localConfig) => {
|
|
31
24
|
const addons = localConfig.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
|
|
32
25
|
const builder = localConfig?.core?.builder;
|
|
33
26
|
const builderPackages = builder && /webpack/.test(builder) ? [`@storybook/builder-${builder}`, `@storybook/manager-${builder}`] : [];
|
|
34
27
|
const frameworks = localConfig.framework?.name ? [localConfig.framework.name] : [];
|
|
35
|
-
return [...
|
|
28
|
+
return [...addons, ...builderPackages, ...frameworks];
|
|
36
29
|
};
|
|
37
|
-
const findDependencies = timerify(findStorybookDependencies);
|
|
38
30
|
export default {
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
title,
|
|
32
|
+
enablers,
|
|
41
33
|
isEnabled,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
config,
|
|
35
|
+
entry,
|
|
36
|
+
project,
|
|
37
|
+
resolveEntryPaths,
|
|
38
|
+
resolveConfig,
|
|
46
39
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { StrykerConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "Stryker";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<StrykerConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const findStrykerDependencies = async (configFilePath, options) => {
|
|
8
|
-
const { isProduction } = options;
|
|
9
|
-
if (isProduction)
|
|
10
|
-
return [];
|
|
11
|
-
const localConfig = await load(configFilePath);
|
|
12
|
-
if (!localConfig)
|
|
13
|
-
return [];
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Stryker';
|
|
3
|
+
const enablers = ['@stryker-mutator/core'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['?(.)stryker.{conf,config}.{js,mjs,cjs,json}'];
|
|
6
|
+
const resolveConfig = localConfig => {
|
|
14
7
|
const runners = localConfig.testRunner ? [`@stryker-mutator/${localConfig.testRunner}-runner`] : [];
|
|
15
8
|
const checkers = localConfig.checkers
|
|
16
9
|
? localConfig.checkers.map(checker => `@stryker-mutator/${checker}-checker`)
|
|
@@ -18,11 +11,10 @@ const findStrykerDependencies = async (configFilePath, options) => {
|
|
|
18
11
|
const plugins = localConfig.plugins ?? [];
|
|
19
12
|
return [...runners, ...checkers, ...plugins];
|
|
20
13
|
};
|
|
21
|
-
const findDependencies = timerify(findStrykerDependencies);
|
|
22
14
|
export default {
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
title,
|
|
16
|
+
enablers,
|
|
25
17
|
isEnabled,
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
config,
|
|
19
|
+
resolveConfig,
|
|
28
20
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { StyleLintConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "Stylelint";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<StyleLintConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const findDependenciesInConfig = (config) => {
|
|
1
|
+
import { isInternal } from '#p/util/path.js';
|
|
2
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
3
|
+
const title = 'Stylelint';
|
|
4
|
+
const enablers = ['stylelint'];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const config = ['.stylelintrc', '.stylelintrc.{cjs,js,json,yaml,yml}', 'stylelint.config.{cjs,mjs,js}'];
|
|
7
|
+
const resolve = (config) => {
|
|
9
8
|
const extend = config.extends ? [config.extends].flat().filter(id => !isInternal(id)) : [];
|
|
10
9
|
const plugins = config.plugins ? [config.plugins].flat().filter(id => !isInternal(id)) : [];
|
|
11
|
-
const overrideConfigs = 'overrides' in config ? config.overrides.flatMap(
|
|
10
|
+
const overrideConfigs = 'overrides' in config ? config.overrides.flatMap(resolve) : [];
|
|
12
11
|
return [...extend, ...plugins, ...overrideConfigs];
|
|
13
12
|
};
|
|
14
|
-
const
|
|
15
|
-
const { manifest, isProduction } = options;
|
|
16
|
-
if (isProduction)
|
|
17
|
-
return [];
|
|
18
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest.stylelint : await load(configFilePath);
|
|
19
|
-
if (!localConfig)
|
|
20
|
-
return [];
|
|
21
|
-
return findDependenciesInConfig(localConfig);
|
|
22
|
-
};
|
|
23
|
-
const findDependencies = timerify(findPluginDependencies);
|
|
13
|
+
const resolveConfig = config => resolve(config);
|
|
24
14
|
export default {
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
title,
|
|
16
|
+
enablers,
|
|
27
17
|
isEnabled,
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
config,
|
|
19
|
+
resolveConfig,
|
|
30
20
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
findDependencies: GenericPluginCallback;
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: string[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
entry: string[];
|
|
7
|
+
production: string[];
|
|
8
|
+
project: string[];
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const ENTRY_FILE_PATTERNS = ['svelte.config.js', ...VITE_CONFIG_FILE_PATTERNS];
|
|
9
|
-
const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
import { config as viteConfig } from '../vite/index.js';
|
|
3
|
+
const title = 'Svelte';
|
|
4
|
+
const enablers = ['svelte'];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const entry = ['svelte.config.js', ...viteConfig];
|
|
7
|
+
const production = [
|
|
10
8
|
'src/routes/**/+{page,server,page.server,error,layout,layout.server}{,@*}.{js,ts,svelte}',
|
|
11
9
|
'src/hooks.{server,client}.{js,ts}',
|
|
12
10
|
'src/params/*{js,ts}',
|
|
13
11
|
];
|
|
14
|
-
const
|
|
15
|
-
const findSvelteDependencies = async (configFilePath, options) => {
|
|
16
|
-
const { config } = options;
|
|
17
|
-
return config.entry
|
|
18
|
-
? config.entry.map(toProductionEntryPattern)
|
|
19
|
-
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
20
|
-
};
|
|
21
|
-
const findDependencies = timerify(findSvelteDependencies);
|
|
12
|
+
const project = ['src/**/*.{js,ts,svelte}'];
|
|
22
13
|
export default {
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
title,
|
|
15
|
+
enablers,
|
|
25
16
|
isEnabled,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
findDependencies,
|
|
17
|
+
entry,
|
|
18
|
+
production,
|
|
19
|
+
project,
|
|
30
20
|
};
|