knip 5.7.3 → 5.9.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 +1 -0
- package/dist/ConfigurationValidator.d.ts +56 -0
- package/dist/ConfigurationValidator.js +1 -0
- package/dist/WorkspaceWorker.d.ts +2 -2
- package/dist/WorkspaceWorker.js +1 -0
- package/dist/binaries/resolvers/fallback.js +1 -0
- package/dist/binaries/util.js +2 -2
- package/dist/compilers/index.d.ts +10 -0
- package/dist/plugins/commitlint/index.d.ts +1 -0
- package/dist/plugins/commitlint/index.js +3 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/moonrepo/index.d.ts +10 -0
- package/dist/plugins/moonrepo/index.js +22 -0
- package/dist/plugins/moonrepo/types.d.ts +7 -0
- package/dist/plugins/moonrepo/types.js +1 -0
- package/dist/plugins/vitest/helpers.js +13 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/types/plugins.d.ts +1 -0
- package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +3 -0
- package/dist/typescript/visitors/exports/exportsAccessExpression.js +20 -0
- package/dist/typescript/visitors/exports/index.js +8 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -26
- package/schema.json +4 -0
|
@@ -73,6 +73,7 @@ export declare class ConfigurationChief {
|
|
|
73
73
|
astro?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
74
74
|
svelte?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
75
75
|
vue?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
76
|
+
moonrepo?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
76
77
|
angular?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
77
78
|
ava?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
78
79
|
babel?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
|
|
@@ -38,6 +38,19 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
38
38
|
ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
|
|
39
39
|
ignoreMembers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
|
|
40
40
|
includeEntryExports: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
moonrepo: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
42
|
+
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
43
|
+
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
44
|
+
project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
config?: string | string[] | undefined;
|
|
47
|
+
entry?: string | string[] | undefined;
|
|
48
|
+
project?: string | string[] | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
config?: string | string[] | undefined;
|
|
51
|
+
entry?: string | string[] | undefined;
|
|
52
|
+
project?: string | string[] | undefined;
|
|
53
|
+
}>]>>;
|
|
41
54
|
astro: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
42
55
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
43
56
|
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
@@ -775,6 +788,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
775
788
|
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
776
789
|
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
777
790
|
includeEntryExports?: boolean | undefined;
|
|
791
|
+
moonrepo?: string | boolean | string[] | {
|
|
792
|
+
config?: string | string[] | undefined;
|
|
793
|
+
entry?: string | string[] | undefined;
|
|
794
|
+
project?: string | string[] | undefined;
|
|
795
|
+
} | undefined;
|
|
778
796
|
astro?: string | boolean | string[] | {
|
|
779
797
|
config?: string | string[] | undefined;
|
|
780
798
|
entry?: string | string[] | undefined;
|
|
@@ -1064,6 +1082,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
1064
1082
|
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
1065
1083
|
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
1066
1084
|
includeEntryExports?: boolean | undefined;
|
|
1085
|
+
moonrepo?: string | boolean | string[] | {
|
|
1086
|
+
config?: string | string[] | undefined;
|
|
1087
|
+
entry?: string | string[] | undefined;
|
|
1088
|
+
project?: string | string[] | undefined;
|
|
1089
|
+
} | undefined;
|
|
1067
1090
|
astro?: string | boolean | string[] | {
|
|
1068
1091
|
config?: string | string[] | undefined;
|
|
1069
1092
|
entry?: string | string[] | undefined;
|
|
@@ -1345,6 +1368,19 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
1345
1368
|
project?: string | string[] | undefined;
|
|
1346
1369
|
} | undefined;
|
|
1347
1370
|
}>>>;
|
|
1371
|
+
moonrepo: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
1372
|
+
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1373
|
+
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1374
|
+
project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1375
|
+
}, "strip", z.ZodTypeAny, {
|
|
1376
|
+
config?: string | string[] | undefined;
|
|
1377
|
+
entry?: string | string[] | undefined;
|
|
1378
|
+
project?: string | string[] | undefined;
|
|
1379
|
+
}, {
|
|
1380
|
+
config?: string | string[] | undefined;
|
|
1381
|
+
entry?: string | string[] | undefined;
|
|
1382
|
+
project?: string | string[] | undefined;
|
|
1383
|
+
}>]>>;
|
|
1348
1384
|
astro: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
1349
1385
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1350
1386
|
entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
@@ -2099,6 +2135,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
2099
2135
|
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
2100
2136
|
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
2101
2137
|
includeEntryExports?: boolean | undefined;
|
|
2138
|
+
moonrepo?: string | boolean | string[] | {
|
|
2139
|
+
config?: string | string[] | undefined;
|
|
2140
|
+
entry?: string | string[] | undefined;
|
|
2141
|
+
project?: string | string[] | undefined;
|
|
2142
|
+
} | undefined;
|
|
2102
2143
|
astro?: string | boolean | string[] | {
|
|
2103
2144
|
config?: string | string[] | undefined;
|
|
2104
2145
|
entry?: string | string[] | undefined;
|
|
@@ -2380,6 +2421,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
2380
2421
|
project?: string | string[] | undefined;
|
|
2381
2422
|
} | undefined;
|
|
2382
2423
|
}> | undefined;
|
|
2424
|
+
moonrepo?: string | boolean | string[] | {
|
|
2425
|
+
config?: string | string[] | undefined;
|
|
2426
|
+
entry?: string | string[] | undefined;
|
|
2427
|
+
project?: string | string[] | undefined;
|
|
2428
|
+
} | undefined;
|
|
2383
2429
|
astro?: string | boolean | string[] | {
|
|
2384
2430
|
config?: string | string[] | undefined;
|
|
2385
2431
|
entry?: string | string[] | undefined;
|
|
@@ -2686,6 +2732,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
2686
2732
|
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
2687
2733
|
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
2688
2734
|
includeEntryExports?: boolean | undefined;
|
|
2735
|
+
moonrepo?: string | boolean | string[] | {
|
|
2736
|
+
config?: string | string[] | undefined;
|
|
2737
|
+
entry?: string | string[] | undefined;
|
|
2738
|
+
project?: string | string[] | undefined;
|
|
2739
|
+
} | undefined;
|
|
2689
2740
|
astro?: string | boolean | string[] | {
|
|
2690
2741
|
config?: string | string[] | undefined;
|
|
2691
2742
|
entry?: string | string[] | undefined;
|
|
@@ -2967,6 +3018,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
|
|
|
2967
3018
|
project?: string | string[] | undefined;
|
|
2968
3019
|
} | undefined;
|
|
2969
3020
|
}> | undefined;
|
|
3021
|
+
moonrepo?: string | boolean | string[] | {
|
|
3022
|
+
config?: string | string[] | undefined;
|
|
3023
|
+
entry?: string | string[] | undefined;
|
|
3024
|
+
project?: string | string[] | undefined;
|
|
3025
|
+
} | undefined;
|
|
2970
3026
|
astro?: string | boolean | string[] | {
|
|
2971
3027
|
config?: string | string[] | undefined;
|
|
2972
3028
|
entry?: string | string[] | undefined;
|
|
@@ -27,7 +27,7 @@ export declare class WorkspaceWorker {
|
|
|
27
27
|
isStrict: boolean;
|
|
28
28
|
rootIgnore: Configuration['ignore'];
|
|
29
29
|
negatedWorkspacePatterns: string[];
|
|
30
|
-
enabledPluginsMap: Record<"astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", boolean>;
|
|
30
|
+
enabledPluginsMap: Record<"astro" | "svelte" | "vue" | "moonrepo" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", boolean>;
|
|
31
31
|
enabledPlugins: PluginName[];
|
|
32
32
|
enabledPluginsInAncestors: string[];
|
|
33
33
|
constructor({ name, dir, cwd, config, manifest, dependencies, isProduction, isStrict, rootIgnore, negatedWorkspacePatterns, enabledPluginsInAncestors, }: WorkspaceManagerOptions);
|
|
@@ -46,7 +46,7 @@ export declare class WorkspaceWorker {
|
|
|
46
46
|
entryFilePatterns: Set<string>;
|
|
47
47
|
productionEntryFilePatterns: Set<string>;
|
|
48
48
|
referencedDependencies: ReferencedDependencies;
|
|
49
|
-
enabledPlugins: ("astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg")[];
|
|
49
|
+
enabledPlugins: ("astro" | "svelte" | "vue" | "moonrepo" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg")[];
|
|
50
50
|
}>;
|
|
51
51
|
}
|
|
52
52
|
export {};
|
package/dist/WorkspaceWorker.js
CHANGED
package/dist/binaries/util.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getPackageNameFromFilePath, getPackageNameFromModuleSpecifier } from '../util/modules.js';
|
|
2
|
-
import { isInNodeModules, join } from '../util/path.js';
|
|
2
|
+
import { isAbsolute, isInNodeModules, join } from '../util/path.js';
|
|
3
3
|
import { toBinary } from '../util/protocols.js';
|
|
4
4
|
import { _tryResolve } from '../util/require.js';
|
|
5
5
|
export const tryResolveFilePath = (cwd, specifier, acceptModuleSpecifier) => {
|
|
6
6
|
if (specifier) {
|
|
7
|
-
const filePath = join(cwd, specifier);
|
|
7
|
+
const filePath = isAbsolute(specifier) ? specifier : join(cwd, specifier);
|
|
8
8
|
if (!isInNodeModules(filePath)) {
|
|
9
9
|
const resolvedFilePath = _tryResolve(filePath, cwd);
|
|
10
10
|
if (resolvedFilePath) {
|
|
@@ -27,6 +27,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
27
27
|
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
28
28
|
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
29
29
|
includeEntryExports?: boolean | undefined;
|
|
30
|
+
moonrepo?: string | boolean | string[] | {
|
|
31
|
+
config?: string | string[] | undefined;
|
|
32
|
+
entry?: string | string[] | undefined;
|
|
33
|
+
project?: string | string[] | undefined;
|
|
34
|
+
} | undefined;
|
|
30
35
|
astro?: string | boolean | string[] | {
|
|
31
36
|
config?: string | string[] | undefined;
|
|
32
37
|
entry?: string | string[] | undefined;
|
|
@@ -308,6 +313,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
308
313
|
project?: string | string[] | undefined;
|
|
309
314
|
} | undefined;
|
|
310
315
|
}> | undefined;
|
|
316
|
+
moonrepo?: string | boolean | string[] | {
|
|
317
|
+
config?: string | string[] | undefined;
|
|
318
|
+
entry?: string | string[] | undefined;
|
|
319
|
+
project?: string | string[] | undefined;
|
|
320
|
+
} | undefined;
|
|
311
321
|
astro?: string | boolean | string[] | {
|
|
312
322
|
config?: string | string[] | undefined;
|
|
313
323
|
entry?: string | string[] | undefined;
|
|
@@ -9,7 +9,9 @@ const config = [
|
|
|
9
9
|
'package.json',
|
|
10
10
|
];
|
|
11
11
|
const resolveConfig = config => {
|
|
12
|
-
|
|
12
|
+
const extendsConfigs = config.extends ? [config.extends].flat() : [];
|
|
13
|
+
const plugins = config.plugins ? [config.plugins].flat() : [];
|
|
14
|
+
return [...extendsConfigs, ...plugins];
|
|
13
15
|
};
|
|
14
16
|
export default {
|
|
15
17
|
title,
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -55,3 +55,4 @@ export { default as webpack } from './webpack/index.js';
|
|
|
55
55
|
export { default as wireit } from './wireit/index.js';
|
|
56
56
|
export { default as wrangler } from './wrangler/index.js';
|
|
57
57
|
export { default as yorkie } from './yorkie/index.js';
|
|
58
|
+
export { default as moonrepo } from './moonrepo/index.js';
|
package/dist/plugins/index.js
CHANGED
|
@@ -55,3 +55,4 @@ export { default as webpack } from './webpack/index.js';
|
|
|
55
55
|
export { default as wireit } from './wireit/index.js';
|
|
56
56
|
export { default as wrangler } from './wrangler/index.js';
|
|
57
57
|
export { default as yorkie } from './yorkie/index.js';
|
|
58
|
+
export { default as moonrepo } from './moonrepo/index.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { MoonConfiguration } from './types.js';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
enablers: import("#p/types/config.js").IgnorePatterns;
|
|
6
|
+
isEnabled: IsPluginEnabled;
|
|
7
|
+
config: string[];
|
|
8
|
+
resolveConfig: ResolveConfig<MoonConfiguration>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'moonrepo';
|
|
3
|
+
const enablers = ['@moonrepo/cli'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['moon.yml', '.moon/tasks.yml', '.moon/tasks/*.yml'];
|
|
6
|
+
const resolveConfig = async (config, options) => {
|
|
7
|
+
const tasks = config.tasks ? Object.values(config.tasks) : [];
|
|
8
|
+
const dependencies = tasks
|
|
9
|
+
.map(task => task.command)
|
|
10
|
+
.filter(command => command)
|
|
11
|
+
.map(command => command.replace('$workspaceRoot', options.rootCwd))
|
|
12
|
+
.map(command => command.replace('$projectRoot', options.cwd))
|
|
13
|
+
.flatMap(command => getDependenciesFromScripts(command, options));
|
|
14
|
+
return [...dependencies];
|
|
15
|
+
};
|
|
16
|
+
export default {
|
|
17
|
+
title,
|
|
18
|
+
enablers,
|
|
19
|
+
isEnabled,
|
|
20
|
+
config,
|
|
21
|
+
resolveConfig,
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,7 +14,19 @@ export const getEnvPackageName = (env) => {
|
|
|
14
14
|
return envPackageNames[env];
|
|
15
15
|
return `vitest-environment-${env}`;
|
|
16
16
|
};
|
|
17
|
-
const builtInReporters = [
|
|
17
|
+
const builtInReporters = [
|
|
18
|
+
'basic',
|
|
19
|
+
'default',
|
|
20
|
+
'dot',
|
|
21
|
+
'github-actions',
|
|
22
|
+
'hanging-process',
|
|
23
|
+
'html',
|
|
24
|
+
'json',
|
|
25
|
+
'junit',
|
|
26
|
+
'tap',
|
|
27
|
+
'tap-flat',
|
|
28
|
+
'verbose',
|
|
29
|
+
];
|
|
18
30
|
export const getExternalReporters = (reporters) => reporters
|
|
19
31
|
? [reporters]
|
|
20
32
|
.flat()
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Plugin } from './types/plugins.js';
|
|
2
|
-
declare const plugins: Record<"astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", Plugin>;
|
|
2
|
+
declare const plugins: Record<"astro" | "svelte" | "vue" | "moonrepo" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", Plugin>;
|
|
3
3
|
export { plugins };
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { EnsuredPluginConfiguration, IgnorePatterns, WorkspaceConfiguration
|
|
|
2
2
|
import type { PackageJson } from './package-json.js';
|
|
3
3
|
import type { DependencySet } from './workspace.js';
|
|
4
4
|
export interface BaseOptions {
|
|
5
|
+
rootCwd?: string;
|
|
5
6
|
cwd: string;
|
|
6
7
|
manifestScriptNames: Set<string>;
|
|
7
8
|
dependencies: DependencySet;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("#p/typescript/getImportsAndExports.ts").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { SymbolType } from '../../../types/issues.js';
|
|
3
|
+
import { isJS } from '../helpers.js';
|
|
4
|
+
import { exportVisitor as visit } from '../index.js';
|
|
5
|
+
export default visit(isJS, (node, { isFixExports }) => {
|
|
6
|
+
if (ts.isBinaryExpression(node) && ts.isPropertyAccessExpression(node.left)) {
|
|
7
|
+
if (ts.isIdentifier(node.left.expression) && node.left.expression.escapedText === 'exports') {
|
|
8
|
+
const identifier = node.left.name.getText();
|
|
9
|
+
const pos = node.left.name.pos;
|
|
10
|
+
const fix = isFixExports ? [node.getStart(), node.getEnd()] : undefined;
|
|
11
|
+
return {
|
|
12
|
+
node: node.left.name,
|
|
13
|
+
identifier,
|
|
14
|
+
type: SymbolType.UNKNOWN,
|
|
15
|
+
pos,
|
|
16
|
+
fix,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -2,6 +2,13 @@ import ts from 'typescript';
|
|
|
2
2
|
import exportAssignment from './exportAssignment.js';
|
|
3
3
|
import exportDeclaration from './exportDeclaration.js';
|
|
4
4
|
import exportKeyword from './exportKeyword.js';
|
|
5
|
+
import exportsAccessExpression from './exportsAccessExpression.js';
|
|
5
6
|
import moduleExportsAccessExpression from './moduleExportsAccessExpression.js';
|
|
6
|
-
const visitors = [
|
|
7
|
+
const visitors = [
|
|
8
|
+
exportAssignment,
|
|
9
|
+
exportDeclaration,
|
|
10
|
+
exportKeyword,
|
|
11
|
+
exportsAccessExpression,
|
|
12
|
+
moduleExportsAccessExpression,
|
|
13
|
+
];
|
|
7
14
|
export default (sourceFile) => visitors.map(v => v(sourceFile));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.9.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.9.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.0",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://knip.dev",
|
|
6
6
|
"repository": {
|
|
@@ -112,31 +112,6 @@
|
|
|
112
112
|
"node": ">=18.6.0"
|
|
113
113
|
},
|
|
114
114
|
"engineStrict": true,
|
|
115
|
-
"release-it": {
|
|
116
|
-
"hooks": {
|
|
117
|
-
"before:init": [
|
|
118
|
-
"npm run lint",
|
|
119
|
-
"npm run build",
|
|
120
|
-
"npm run knip",
|
|
121
|
-
"npm run knip:production",
|
|
122
|
-
"npm test"
|
|
123
|
-
],
|
|
124
|
-
"after:bump": [
|
|
125
|
-
"git add ../../package-lock.json"
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
"github": {
|
|
129
|
-
"release": true,
|
|
130
|
-
"comments": {
|
|
131
|
-
"submit": true
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"plugins": {
|
|
135
|
-
"@release-it/bumper": {
|
|
136
|
-
"out": "{dist,src}/version.*"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
115
|
"keywords": [
|
|
141
116
|
"analysis",
|
|
142
117
|
"analyze",
|
package/schema.json
CHANGED
|
@@ -363,6 +363,10 @@
|
|
|
363
363
|
"title": "Mocha plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/mocha/README.md)",
|
|
364
364
|
"$ref": "#/definitions/plugin"
|
|
365
365
|
},
|
|
366
|
+
"moonrepo": {
|
|
367
|
+
"title": "moonrepo plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/moonrepo/README.md)",
|
|
368
|
+
"$ref": "#/definitions/plugin"
|
|
369
|
+
},
|
|
366
370
|
"msw": {
|
|
367
371
|
"title": "Mocha plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/msw/README.md)",
|
|
368
372
|
"$ref": "#/definitions/plugin"
|