knip 5.41.1 → 5.42.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/README.md +1 -1
- package/dist/ConfigurationChief.d.ts +1 -0
- package/dist/ConfigurationValidator.d.ts +56 -0
- package/dist/ProjectPrincipal.js +2 -14
- package/dist/WorkspaceWorker.js +2 -3
- package/dist/compilers/index.d.ts +10 -0
- package/dist/constants.js +2 -0
- package/dist/index.js +21 -11
- package/dist/plugins/_template/index.js +1 -1
- package/dist/plugins/angular/index.js +59 -27
- package/dist/plugins/angular/types.d.ts +2 -2
- package/dist/plugins/expo/index.d.ts +3 -0
- package/dist/plugins/expo/index.js +6 -4
- package/dist/plugins/index.d.ts +20 -10
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/jest/index.d.ts +3 -0
- package/dist/plugins/jest/index.js +4 -0
- package/dist/plugins/karma/helpers.d.ts +7 -0
- package/dist/plugins/karma/helpers.js +32 -0
- package/dist/plugins/karma/index.d.ts +1 -2
- package/dist/plugins/karma/index.js +10 -36
- package/dist/plugins/linthtml/index.d.ts +2 -2
- package/dist/plugins/linthtml/types.d.ts +1 -1
- package/dist/plugins/metro/index.d.ts +15 -0
- package/dist/plugins/metro/index.js +48 -0
- package/dist/plugins/metro/types.d.ts +13 -0
- package/dist/plugins/metro/types.js +1 -0
- package/dist/plugins/nx/index.js +10 -2
- package/dist/plugins/nx/types.d.ts +1 -0
- package/dist/plugins/release-it/index.d.ts +0 -1
- package/dist/plugins/release-it/index.js +0 -2
- package/dist/plugins/simple-git-hooks/index.d.ts +2 -3
- package/dist/plugins/simple-git-hooks/index.js +1 -9
- package/dist/plugins/simple-git-hooks/types.d.ts +1 -1
- package/dist/plugins/typescript/index.d.ts +0 -1
- package/dist/plugins/typescript/index.js +0 -2
- package/dist/plugins/vite/index.d.ts +0 -1
- package/dist/plugins/vite/index.js +0 -2
- package/dist/plugins/webpack/index.d.ts +4 -1
- package/dist/plugins/webpack/index.js +5 -2
- package/dist/plugins/wireit/index.d.ts +0 -1
- package/dist/plugins/wireit/index.js +0 -2
- package/dist/reporters/symbols.js +6 -2
- package/dist/schema/plugins.d.ts +23 -0
- package/dist/schema/plugins.js +1 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +1 -0
- package/dist/types/dependency-graph.d.ts +2 -4
- package/dist/typescript/ast-helpers.d.ts +1 -0
- package/dist/typescript/ast-helpers.js +1 -0
- package/dist/typescript/get-imports-and-exports.d.ts +2 -4
- package/dist/typescript/get-imports-and-exports.js +18 -23
- package/dist/typescript/visitors/exports/exportAssignment.js +2 -1
- package/dist/typescript/visitors/exports/exportDeclaration.js +2 -1
- package/dist/typescript/visitors/exports/exportKeyword.js +3 -4
- package/dist/typescript/visitors/helpers.d.ts +1 -0
- package/dist/typescript/visitors/helpers.js +1 -0
- package/dist/util/dependency-graph.js +2 -4
- package/dist/util/file-entry-cache.js +2 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -12
- package/schema.json +4 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { toDeferResolveEntry, toDevDependency } from '../../util/input.js';
|
|
2
|
+
import { isInternal } from '../../util/path.js';
|
|
3
|
+
export const configFiles = ['karma.conf.js', 'karma.conf.ts', '.config/karma.conf.js', '.config/karma.conf.ts'];
|
|
4
|
+
export const inputsFromFrameworks = (frameworks) => frameworks.map(framework => {
|
|
5
|
+
return toDevDependency(framework === 'jasmine' ? 'jasmine-core' : framework);
|
|
6
|
+
});
|
|
7
|
+
export const inputsFromPlugins = (plugins, devDependencies) => {
|
|
8
|
+
if (!plugins) {
|
|
9
|
+
const karmaPluginDevDeps = Object.keys(devDependencies ?? {}).filter(name => name.startsWith('karma-'));
|
|
10
|
+
return karmaPluginDevDeps.map(karmaPluginDevDep => toDevDependency(karmaPluginDevDep));
|
|
11
|
+
}
|
|
12
|
+
return plugins
|
|
13
|
+
.map(plugin => {
|
|
14
|
+
if (typeof plugin !== 'string')
|
|
15
|
+
return;
|
|
16
|
+
return isInternal(plugin) ? toDeferResolveEntry(plugin) : toDevDependency(plugin);
|
|
17
|
+
})
|
|
18
|
+
.filter(input => !!input);
|
|
19
|
+
};
|
|
20
|
+
export const loadConfig = (configFile) => {
|
|
21
|
+
if (typeof configFile !== 'function')
|
|
22
|
+
return;
|
|
23
|
+
const inMemoryConfig = new InMemoryConfig();
|
|
24
|
+
configFile(inMemoryConfig);
|
|
25
|
+
return inMemoryConfig.config ?? {};
|
|
26
|
+
};
|
|
27
|
+
class InMemoryConfig {
|
|
28
|
+
config;
|
|
29
|
+
set(config) {
|
|
30
|
+
this.config = config;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
|
-
import type
|
|
3
|
-
type ConfigFile = (config: Config) => void;
|
|
2
|
+
import { type ConfigFile } from './helpers.js';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
enablers: string[];
|
|
@@ -1,43 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toEntry } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
|
+
import { configFiles, inputsFromFrameworks, inputsFromPlugins, loadConfig } from './helpers.js';
|
|
4
5
|
const title = 'Karma';
|
|
5
6
|
const enablers = ['karma'];
|
|
6
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
-
const config =
|
|
8
|
+
const config = configFiles;
|
|
8
9
|
const entry = [];
|
|
9
10
|
const resolveConfig = async (localConfig, options) => {
|
|
10
11
|
const inputs = new Set();
|
|
11
12
|
const config = loadConfig(localConfig);
|
|
13
|
+
if (!config)
|
|
14
|
+
return [];
|
|
12
15
|
if (config.frameworks) {
|
|
13
|
-
|
|
14
|
-
inputs.add(toDevDependency(devDepForFramework(framework)));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
if (config.plugins) {
|
|
18
|
-
for (const plugin of config.plugins) {
|
|
19
|
-
if (typeof plugin !== 'string')
|
|
20
|
-
continue;
|
|
21
|
-
if (isInternal(plugin)) {
|
|
22
|
-
inputs.add(toDeferResolveEntry(plugin));
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
inputs.add(toDevDependency(plugin));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const karmaPluginDevDeps = Object.keys(options.manifest.devDependencies ?? {}).filter(name => name.startsWith('karma-'));
|
|
31
|
-
for (const karmaPluginDevDep of karmaPluginDevDeps) {
|
|
32
|
-
inputs.add(toDevDependency(karmaPluginDevDep));
|
|
33
|
-
}
|
|
16
|
+
inputsFromFrameworks(config.frameworks).forEach(inputs.add, inputs);
|
|
34
17
|
}
|
|
18
|
+
inputsFromPlugins(config.plugins, options.manifest.devDependencies).forEach(inputs.add, inputs);
|
|
35
19
|
return Array.from(inputs);
|
|
36
20
|
};
|
|
37
|
-
const devDepForFramework = (framework) => (framework === 'jasmine' ? 'jasmine-core' : framework);
|
|
38
21
|
const resolveEntryPaths = (localConfig, options) => {
|
|
39
22
|
const inputs = new Set();
|
|
40
23
|
const config = loadConfig(localConfig);
|
|
24
|
+
if (!config)
|
|
25
|
+
return [];
|
|
41
26
|
const basePath = config.basePath ?? '';
|
|
42
27
|
if (config.files) {
|
|
43
28
|
for (const fileOrPatternObj of config.files) {
|
|
@@ -52,17 +37,6 @@ const resolveEntryPaths = (localConfig, options) => {
|
|
|
52
37
|
}
|
|
53
38
|
return Array.from(inputs);
|
|
54
39
|
};
|
|
55
|
-
const loadConfig = (configFile) => {
|
|
56
|
-
const inMemoryConfig = new InMemoryConfig();
|
|
57
|
-
configFile(inMemoryConfig);
|
|
58
|
-
return inMemoryConfig.config ?? {};
|
|
59
|
-
};
|
|
60
|
-
class InMemoryConfig {
|
|
61
|
-
config;
|
|
62
|
-
set(config) {
|
|
63
|
-
this.config = config;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
40
|
export default {
|
|
67
41
|
title,
|
|
68
42
|
enablers,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LintHTMLConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
packageJsonPath: string;
|
|
8
8
|
config: string[];
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
9
|
+
resolveConfig: ResolveConfig<LintHTMLConfig>;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
|
+
import type { MetroConfig } from './types.js';
|
|
3
|
+
export declare const docs: {
|
|
4
|
+
production: string[];
|
|
5
|
+
};
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
note: string;
|
|
9
|
+
enablers: string[];
|
|
10
|
+
isEnabled: IsPluginEnabled;
|
|
11
|
+
config: string[];
|
|
12
|
+
resolveEntryPaths: ResolveEntryPaths<MetroConfig>;
|
|
13
|
+
resolveConfig: ResolveConfig<MetroConfig>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { compact } from '../../util/array.js';
|
|
2
|
+
import { toDeferResolve, toProductionEntry } from '../../util/input.js';
|
|
3
|
+
import { join } from '../../util/path.js';
|
|
4
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
5
|
+
const title = 'Metro';
|
|
6
|
+
const note = `False positives for platform-specific unused files?
|
|
7
|
+
Override the entry patterns as shown below to match platforms and extensions.`;
|
|
8
|
+
const enablers = ['metro', 'react-native'];
|
|
9
|
+
const isEnabled = options => hasDependency(options.dependencies, enablers);
|
|
10
|
+
const config = ['metro.config.{js,cjs,json}', 'package.json'];
|
|
11
|
+
const DEFAULT_PLATFORMS = ['ios', 'android', 'windows', 'web'];
|
|
12
|
+
const PLATFORMS = [...DEFAULT_PLATFORMS, 'native', 'default'];
|
|
13
|
+
const DEFAULT_EXTENSIONS = ['js', 'jsx', 'json', 'ts', 'tsx'];
|
|
14
|
+
const production = [`src/**/*.{${PLATFORMS.join(',')}}.{${DEFAULT_EXTENSIONS.join(',')}}`];
|
|
15
|
+
export const docs = { production };
|
|
16
|
+
const resolveEntryPaths = async (config) => {
|
|
17
|
+
const platformEntryPatterns = compact(PLATFORMS.concat(config.resolver?.platforms ?? []));
|
|
18
|
+
const sourceExts = config.resolver?.sourceExts ?? DEFAULT_EXTENSIONS;
|
|
19
|
+
const pattern = `src/**/*.{${platformEntryPatterns.join(',')}}.{${sourceExts.join(',')}}`;
|
|
20
|
+
if (!config.projectRoot)
|
|
21
|
+
return [toProductionEntry(pattern)];
|
|
22
|
+
const entryFilePattern = 'index.{js,jsx,ts,tsx}';
|
|
23
|
+
const entryFilePath = join(config.projectRoot, entryFilePattern);
|
|
24
|
+
const entryFilePaths = join(config.projectRoot, pattern);
|
|
25
|
+
return [toProductionEntry(entryFilePath), toProductionEntry(entryFilePaths)];
|
|
26
|
+
};
|
|
27
|
+
const resolveConfig = async (config) => {
|
|
28
|
+
const { transformerPath, transformer } = config;
|
|
29
|
+
const inputs = [];
|
|
30
|
+
if (transformerPath)
|
|
31
|
+
inputs.push(transformerPath);
|
|
32
|
+
if (transformer?.assetPlugins)
|
|
33
|
+
inputs.push(...transformer.assetPlugins);
|
|
34
|
+
if (transformer?.minifierPath)
|
|
35
|
+
inputs.push(transformer.minifierPath);
|
|
36
|
+
if (transformer?.babelTransformerPath)
|
|
37
|
+
inputs.push(transformer.babelTransformerPath);
|
|
38
|
+
return [...inputs].map(toDeferResolve);
|
|
39
|
+
};
|
|
40
|
+
export default {
|
|
41
|
+
title,
|
|
42
|
+
note,
|
|
43
|
+
enablers,
|
|
44
|
+
isEnabled,
|
|
45
|
+
config,
|
|
46
|
+
resolveEntryPaths,
|
|
47
|
+
resolveConfig,
|
|
48
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MetroConfig = {
|
|
2
|
+
projectRoot?: string;
|
|
3
|
+
transformerPath?: string;
|
|
4
|
+
transformer?: {
|
|
5
|
+
minifierPath?: string;
|
|
6
|
+
assetPlugins?: string[];
|
|
7
|
+
babelTransformerPath?: string;
|
|
8
|
+
};
|
|
9
|
+
resolver?: {
|
|
10
|
+
platforms?: string[];
|
|
11
|
+
sourceExts?: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/plugins/nx/index.js
CHANGED
|
@@ -35,8 +35,16 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
35
35
|
.filter(executor => executor && !executor.startsWith('.'))
|
|
36
36
|
.map(executor => executor?.split(':')[0]);
|
|
37
37
|
const scripts = targets
|
|
38
|
-
.filter(target => target.executor === 'nx:run-commands')
|
|
39
|
-
.flatMap(target =>
|
|
38
|
+
.filter(target => target.executor === 'nx:run-commands' || target.command)
|
|
39
|
+
.flatMap(target => {
|
|
40
|
+
if (target.command)
|
|
41
|
+
return [target.command];
|
|
42
|
+
if (target.options?.command)
|
|
43
|
+
return [target.options.command];
|
|
44
|
+
if (target.options?.commands)
|
|
45
|
+
return target.options.commands;
|
|
46
|
+
return [];
|
|
47
|
+
});
|
|
40
48
|
const inputs = options.getInputsFromScripts(scripts);
|
|
41
49
|
return compact([...executors, ...inputs]).map(id => (typeof id === 'string' ? toDependency(id) : id));
|
|
42
50
|
};
|
|
@@ -3,7 +3,6 @@ import { hasDependency } from '../../util/plugin.js';
|
|
|
3
3
|
const title = 'Release It!';
|
|
4
4
|
const enablers = ['release-it'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
-
const packageJsonPath = 'release-it';
|
|
7
6
|
const config = ['.release-it.{json,js,cjs,ts,yml,yaml,toml}', 'package.json'];
|
|
8
7
|
const resolveConfig = (config, options) => {
|
|
9
8
|
const plugins = config.plugins ? Object.keys(config.plugins) : [];
|
|
@@ -21,7 +20,6 @@ export default {
|
|
|
21
20
|
title,
|
|
22
21
|
enablers,
|
|
23
22
|
isEnabled,
|
|
24
|
-
packageJsonPath,
|
|
25
23
|
config,
|
|
26
24
|
resolveConfig,
|
|
27
25
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SimpleGitHooksConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
|
-
packageJsonPath: string;
|
|
8
7
|
config: string[];
|
|
9
|
-
resolveConfig: ResolveConfig<
|
|
8
|
+
resolveConfig: ResolveConfig<SimpleGitHooksConfig>;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -2,14 +2,7 @@ import { hasDependency } from '../../util/plugin.js';
|
|
|
2
2
|
const title = 'simple-git-hooks';
|
|
3
3
|
const enablers = ['simple-git-hooks'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const
|
|
6
|
-
const config = [
|
|
7
|
-
'.simple-git-hooks.{js,cjs}',
|
|
8
|
-
'simple-git-hooks.{js,cjs}',
|
|
9
|
-
'.simple-git-hooks.json',
|
|
10
|
-
'simple-git-hooks.json',
|
|
11
|
-
'package.json',
|
|
12
|
-
];
|
|
5
|
+
const config = ['.simple-git-hooks.{js,cjs,json}', 'simple-git-hooks.{js,cjs,json}', 'package.json'];
|
|
13
6
|
const resolveConfig = async (config, options) => {
|
|
14
7
|
if (typeof config === 'function')
|
|
15
8
|
config = config();
|
|
@@ -26,7 +19,6 @@ export default {
|
|
|
26
19
|
title,
|
|
27
20
|
enablers,
|
|
28
21
|
isEnabled,
|
|
29
|
-
packageJsonPath,
|
|
30
22
|
config,
|
|
31
23
|
resolveConfig,
|
|
32
24
|
};
|
|
@@ -6,7 +6,6 @@ const title = 'TypeScript';
|
|
|
6
6
|
const enablers = ['typescript'];
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = ['tsconfig.json'];
|
|
9
|
-
const production = [];
|
|
10
9
|
const resolveConfig = async (localConfig, options) => {
|
|
11
10
|
const { compilerOptions } = localConfig;
|
|
12
11
|
const extend = localConfig.extends
|
|
@@ -36,7 +35,6 @@ export default {
|
|
|
36
35
|
enablers,
|
|
37
36
|
isEnabled,
|
|
38
37
|
config,
|
|
39
|
-
production,
|
|
40
38
|
resolveConfig,
|
|
41
39
|
args,
|
|
42
40
|
};
|
|
@@ -5,7 +5,6 @@ declare const _default: {
|
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
production: string[];
|
|
9
8
|
resolveEntryPaths: import("../../types/config.js").ResolveEntryPaths<import("../vitest/types.js").ViteConfigOrFn | import("../vitest/types.js").VitestWorkspaceConfig>;
|
|
10
9
|
resolveConfig: import("../../types/config.js").ResolveConfig<import("../vitest/types.js").ViteConfigOrFn | import("../vitest/types.js").VitestWorkspaceConfig>;
|
|
11
10
|
};
|
|
@@ -4,13 +4,11 @@ const title = 'Vite';
|
|
|
4
4
|
const enablers = ['vite', 'vitest'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
export const config = ['vite.config.{js,mjs,ts,cjs,mts,cts}'];
|
|
7
|
-
const production = [];
|
|
8
7
|
export default {
|
|
9
8
|
title,
|
|
10
9
|
enablers,
|
|
11
10
|
isEnabled,
|
|
12
11
|
config,
|
|
13
|
-
production,
|
|
14
12
|
resolveEntryPaths,
|
|
15
13
|
resolveConfig,
|
|
16
14
|
};
|
|
@@ -10,7 +10,10 @@ declare const _default: {
|
|
|
10
10
|
enablers: string[];
|
|
11
11
|
isEnabled: IsPluginEnabled;
|
|
12
12
|
config: string[];
|
|
13
|
-
production: string[];
|
|
14
13
|
resolveConfig: ResolveConfig<WebpackConfig>;
|
|
14
|
+
args: {
|
|
15
|
+
binaries: string[];
|
|
16
|
+
config: boolean;
|
|
17
|
+
};
|
|
15
18
|
};
|
|
16
19
|
export default _default;
|
|
@@ -7,7 +7,6 @@ const title = 'webpack';
|
|
|
7
7
|
const enablers = ['webpack', 'webpack-cli'];
|
|
8
8
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
9
9
|
const config = ['webpack.config.{js,ts,mjs,cjs,mts,cts}'];
|
|
10
|
-
const production = [];
|
|
11
10
|
const hasBabelOptions = (use) => Boolean(use) &&
|
|
12
11
|
typeof use !== 'string' &&
|
|
13
12
|
'loader' in use &&
|
|
@@ -100,11 +99,15 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
100
99
|
const webpackDevServer = scripts.some(script => script?.includes('webpack serve')) ? ['webpack-dev-server'] : [];
|
|
101
100
|
return compact([...inputs, [...webpackCLI, ...webpackDevServer].map(toDevDependency)].flat());
|
|
102
101
|
};
|
|
102
|
+
const args = {
|
|
103
|
+
binaries: ['webpack', 'webpack-dev-server'],
|
|
104
|
+
config: true,
|
|
105
|
+
};
|
|
103
106
|
export default {
|
|
104
107
|
title,
|
|
105
108
|
enablers,
|
|
106
109
|
isEnabled,
|
|
107
110
|
config,
|
|
108
|
-
production,
|
|
109
111
|
resolveConfig,
|
|
112
|
+
args,
|
|
110
113
|
};
|
|
@@ -2,7 +2,6 @@ import { hasDependency } from '../../util/plugin.js';
|
|
|
2
2
|
const title = 'Wireit';
|
|
3
3
|
const enablers = ['wireit'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const packageJsonPath = 'wireit';
|
|
6
5
|
const config = ['package.json'];
|
|
7
6
|
const resolveConfig = (localConfig, options) => {
|
|
8
7
|
const scripts = Object.values(localConfig).flatMap(({ command: script }) => (script ? [script] : []));
|
|
@@ -13,7 +12,6 @@ export default {
|
|
|
13
12
|
title,
|
|
14
13
|
enablers,
|
|
15
14
|
isEnabled,
|
|
16
|
-
packageJsonPath,
|
|
17
15
|
config,
|
|
18
16
|
resolveConfig,
|
|
19
17
|
};
|
|
@@ -7,11 +7,15 @@ const dim = picocolors.gray;
|
|
|
7
7
|
const bright = picocolors.whiteBright;
|
|
8
8
|
const TRUNCATE_WIDTH = 40;
|
|
9
9
|
const truncate = (text) => (text.length > TRUNCATE_WIDTH ? `${text.slice(0, TRUNCATE_WIDTH - 3)}...` : text);
|
|
10
|
+
const truncateStart = (text, width) => (text.length > width ? `...${text.slice(-(width - 3))}` : text);
|
|
10
11
|
const hl = (issue) => {
|
|
11
12
|
if (issue.specifier && issue.specifier !== issue.symbol && issue.specifier.includes(issue.symbol)) {
|
|
12
13
|
const parts = issue.specifier.split(issue.symbol);
|
|
13
|
-
const
|
|
14
|
-
|
|
14
|
+
const right = parts.slice(1).join('');
|
|
15
|
+
const max = TRUNCATE_WIDTH - issue.symbol.length - right.length;
|
|
16
|
+
const part = parts[0];
|
|
17
|
+
const left = part.length > 3 ? (max <= 3 ? `...${part.slice(-3)}` : truncateStart(part, max)) : part;
|
|
18
|
+
return [dim(left), bright(issue.symbol), dim(right)].join('');
|
|
15
19
|
}
|
|
16
20
|
return issue.symbol;
|
|
17
21
|
};
|
package/dist/schema/plugins.d.ts
CHANGED
|
@@ -417,6 +417,19 @@ export declare const pluginsSchema: z.ZodObject<{
|
|
|
417
417
|
entry?: string | string[] | undefined;
|
|
418
418
|
project?: string | string[] | undefined;
|
|
419
419
|
}>]>;
|
|
420
|
+
metro: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
421
|
+
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
422
|
+
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
423
|
+
project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
424
|
+
}, "strip", z.ZodTypeAny, {
|
|
425
|
+
config?: string | string[] | undefined;
|
|
426
|
+
entry?: string | string[] | undefined;
|
|
427
|
+
project?: string | string[] | undefined;
|
|
428
|
+
}, {
|
|
429
|
+
config?: string | string[] | undefined;
|
|
430
|
+
entry?: string | string[] | undefined;
|
|
431
|
+
project?: string | string[] | undefined;
|
|
432
|
+
}>]>;
|
|
420
433
|
mocha: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
421
434
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
422
435
|
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
@@ -1332,6 +1345,11 @@ export declare const pluginsSchema: z.ZodObject<{
|
|
|
1332
1345
|
entry?: string | string[] | undefined;
|
|
1333
1346
|
project?: string | string[] | undefined;
|
|
1334
1347
|
};
|
|
1348
|
+
metro: string | boolean | string[] | {
|
|
1349
|
+
config?: string | string[] | undefined;
|
|
1350
|
+
entry?: string | string[] | undefined;
|
|
1351
|
+
project?: string | string[] | undefined;
|
|
1352
|
+
};
|
|
1335
1353
|
mocha: string | boolean | string[] | {
|
|
1336
1354
|
config?: string | string[] | undefined;
|
|
1337
1355
|
entry?: string | string[] | undefined;
|
|
@@ -1778,6 +1796,11 @@ export declare const pluginsSchema: z.ZodObject<{
|
|
|
1778
1796
|
entry?: string | string[] | undefined;
|
|
1779
1797
|
project?: string | string[] | undefined;
|
|
1780
1798
|
};
|
|
1799
|
+
metro: string | boolean | string[] | {
|
|
1800
|
+
config?: string | string[] | undefined;
|
|
1801
|
+
entry?: string | string[] | undefined;
|
|
1802
|
+
project?: string | string[] | undefined;
|
|
1803
|
+
};
|
|
1781
1804
|
mocha: string | boolean | string[] | {
|
|
1782
1805
|
config?: string | string[] | undefined;
|
|
1783
1806
|
entry?: string | string[] | undefined;
|
package/dist/schema/plugins.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'node-test-runner' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
|
|
2
|
-
export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "c8", "capacitor", "changesets", "commitizen", "commitlint", "cspell", "cucumber", "cypress", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-actions", "glob", "graphql-codegen", "husky", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "node-test-runner", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "react-cosmos", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "storybook", "stryker", "stylelint", "svelte", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
|
|
1
|
+
export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'node-test-runner' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
|
|
2
|
+
export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "c8", "capacitor", "changesets", "commitizen", "commitlint", "cspell", "cucumber", "cypress", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-actions", "glob", "graphql-codegen", "husky", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "node-test-runner", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "react-cosmos", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "storybook", "stryker", "stylelint", "svelte", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
|
|
@@ -56,10 +56,8 @@ export type FileNode = {
|
|
|
56
56
|
external: Set<string>;
|
|
57
57
|
unresolved: Set<UnresolvedImport>;
|
|
58
58
|
};
|
|
59
|
-
exports:
|
|
60
|
-
|
|
61
|
-
duplicate: Iterable<Array<IssueSymbol>>;
|
|
62
|
-
};
|
|
59
|
+
exports: ExportMap;
|
|
60
|
+
duplicates: Iterable<Array<IssueSymbol>>;
|
|
63
61
|
scripts: Set<string>;
|
|
64
62
|
imported?: ImportDetails;
|
|
65
63
|
internalImportCache?: ImportMap;
|
|
@@ -21,6 +21,7 @@ export declare const isDestructuring: (node: ts.Node) => boolean;
|
|
|
21
21
|
export declare const getDestructuredIds: (name: ts.ObjectBindingPattern) => string[];
|
|
22
22
|
export declare const isConsiderReferencedNS: (node: ts.Identifier) => boolean;
|
|
23
23
|
export declare const isObjectEnumerationCallExpressionArgument: (node: ts.Identifier) => boolean;
|
|
24
|
+
export declare const isInForIteration: (node: ts.Node) => boolean;
|
|
24
25
|
export declare const isTopLevel: (node: ts.Node) => boolean;
|
|
25
26
|
export declare const getTypeName: (node: ts.Identifier) => ts.QualifiedName | undefined;
|
|
26
27
|
export declare const isImportSpecifier: (node: ts.Node) => boolean;
|
|
@@ -148,6 +148,7 @@ export const isObjectEnumerationCallExpressionArgument = (node) => ts.isCallExpr
|
|
|
148
148
|
ts.isIdentifier(node.parent.expression.expression) &&
|
|
149
149
|
node.parent.expression.expression.escapedText === 'Object' &&
|
|
150
150
|
objectEnumerationMethods.has(String(node.parent.expression.name.escapedText));
|
|
151
|
+
export const isInForIteration = (node) => node.parent && (ts.isForInStatement(node.parent) || ts.isForOfStatement(node.parent));
|
|
151
152
|
export const isTopLevel = (node) => ts.isSourceFile(node.parent) || (node.parent && ts.isSourceFile(node.parent.parent));
|
|
152
153
|
export const getTypeName = (node) => {
|
|
153
154
|
if (!node.parent?.parent)
|
|
@@ -11,10 +11,8 @@ export declare const _getImportsAndExports: (sourceFile: BoundSourceFile, resolv
|
|
|
11
11
|
specifiers: Set<[string, string]>;
|
|
12
12
|
unresolved: Set<UnresolvedImport>;
|
|
13
13
|
};
|
|
14
|
-
exports:
|
|
15
|
-
|
|
16
|
-
duplicate: IssueSymbol[][];
|
|
17
|
-
};
|
|
14
|
+
exports: ExportMap;
|
|
15
|
+
duplicates: IssueSymbol[][];
|
|
18
16
|
scripts: Set<string>;
|
|
19
17
|
traceRefs: Set<string>;
|
|
20
18
|
};
|