knip 6.35.1 → 6.37.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 +20 -2
- package/dist/ConfigurationChief.js +15 -1
- package/dist/DependencyDeputy.d.ts +0 -2
- package/dist/DependencyDeputy.js +1 -17
- package/dist/WorkspaceWorker.js +7 -6
- package/dist/binaries/bash-parser.js +1 -1
- package/dist/binaries/command.js +21 -10
- package/dist/binaries/fallback.js +5 -4
- package/dist/binaries/plugins.js +4 -4
- package/dist/binaries/resolvers/bun.js +2 -2
- package/dist/binaries/resolvers/find.js +5 -4
- package/dist/binaries/resolvers/index.d.ts +2 -1
- package/dist/binaries/resolvers/index.js +3 -2
- package/dist/binaries/resolvers/npm.js +46 -4
- package/dist/binaries/resolvers/npx.js +8 -4
- package/dist/binaries/resolvers/nub.js +3 -2
- package/dist/binaries/resolvers/pnpm.js +17 -10
- package/dist/binaries/resolvers/yarn.js +1 -1
- package/dist/binaries/util.d.ts +4 -1
- package/dist/binaries/util.js +2 -0
- package/dist/compilers/compilers.js +1 -1
- package/dist/compilers/scss.js +2 -2
- package/dist/graph-explorer/cache.d.ts +3 -0
- package/dist/graph-explorer/cache.js +6 -0
- package/dist/graph-explorer/explorer.d.ts +1 -0
- package/dist/graph-explorer/explorer.js +2 -0
- package/dist/graph-explorer/operations/build-exports-tree.js +14 -2
- package/dist/graph-explorer/operations/get-ambiguous-star-export.d.ts +8 -0
- package/dist/graph-explorer/operations/get-ambiguous-star-export.js +11 -0
- package/dist/graph-explorer/operations/get-contention.js +265 -122
- package/dist/graph-explorer/operations/resolve-export-origins.d.ts +32 -0
- package/dist/graph-explorer/operations/resolve-export-origins.js +255 -0
- package/dist/graph-explorer/utils.js +8 -0
- package/dist/manifest/index.js +1 -3
- package/dist/plugins/ava/index.js +1 -1
- package/dist/plugins/eslint/helpers.d.ts +2 -1
- package/dist/plugins/eslint/helpers.js +59 -14
- package/dist/plugins/eslint/index.js +2 -2
- package/dist/plugins/eslint/resolveFromAST.js +17 -11
- package/dist/plugins/eslint/types.d.ts +3 -3
- package/dist/plugins/github-actions/index.js +1 -1
- package/dist/plugins/graphql-codegen/index.js +15 -4
- package/dist/plugins/graphql-codegen/types.d.ts +11 -1
- package/dist/plugins/graphql-codegen/types.js +6 -0
- package/dist/plugins/husky/index.js +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/lefthook/index.js +1 -1
- package/dist/plugins/mise/scripts.js +5 -5
- package/dist/plugins/next/index.js +39 -5
- package/dist/plugins/node/index.js +6 -0
- package/dist/plugins/tailwind/compiler.js +2 -2
- package/dist/plugins/tailwind/index.js +7 -1
- package/dist/plugins/taskfile/index.js +1 -1
- package/dist/plugins/tauri/index.js +1 -1
- package/dist/plugins/textlint/helpers.d.ts +4 -0
- package/dist/plugins/textlint/helpers.js +39 -0
- package/dist/plugins/textlint/index.d.ts +3 -0
- package/dist/plugins/textlint/index.js +52 -0
- package/dist/plugins/textlint/types.d.ts +5 -0
- package/dist/plugins/textlint/types.js +1 -0
- package/dist/plugins/travis/index.js +1 -1
- package/dist/plugins/typedoc/index.js +3 -2
- package/dist/plugins/typedoc/types.d.ts +2 -2
- package/dist/plugins/varlock/index.d.ts +3 -0
- package/dist/plugins/varlock/index.js +31 -0
- package/dist/plugins/varlock/parse.d.ts +11 -0
- package/dist/plugins/varlock/parse.js +185 -0
- package/dist/plugins/varlock/scan.d.ts +2 -0
- package/dist/plugins/varlock/scan.js +78 -0
- package/dist/plugins/vite-plus/resolveFromAST.js +1 -1
- package/dist/plugins/vitest/index.js +4 -2
- package/dist/reporters/trace.js +30 -1
- package/dist/schema/configuration.d.ts +33 -0
- package/dist/schema/configuration.js +2 -0
- package/dist/schema/plugins.d.ts +10 -0
- package/dist/schema/plugins.js +2 -0
- package/dist/session/build-maps.js +9 -1
- package/dist/session/file-descriptor.js +0 -2
- package/dist/session/index.d.ts +1 -1
- package/dist/session/types.d.ts +18 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +2 -0
- package/dist/types/config.d.ts +5 -1
- package/dist/types/module-graph.d.ts +3 -0
- package/dist/types/package-json.d.ts +1 -1
- package/dist/typescript/get-imports-and-exports.js +43 -9
- package/dist/typescript/visitors/exports.js +9 -4
- package/dist/typescript/visitors/walk.d.ts +1 -1
- package/dist/typescript/visitors/walk.js +4 -1
- package/dist/util/array.d.ts +1 -1
- package/dist/util/array.js +5 -1
- package/dist/util/create-input-handler.js +3 -3
- package/dist/util/create-options.d.ts +28 -2
- package/dist/util/file-entry-cache.js +1 -1
- package/dist/util/glob-core.d.ts +1 -0
- package/dist/util/glob-core.js +11 -3
- package/dist/util/jiti.js +1 -0
- package/dist/util/modules.d.ts +2 -0
- package/dist/util/modules.js +3 -1
- package/dist/util/package-json.d.ts +185 -183
- package/dist/util/parse-args.d.ts +2 -0
- package/dist/util/parse-args.js +6 -1
- package/dist/util/url.d.ts +1 -0
- package/dist/util/url.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/schema.json +20 -0
package/dist/reporters/trace.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IMPORT_STAR } from '../constants.js';
|
|
2
|
+
import { getAmbiguousStarExport } from '../graph-explorer/operations/get-ambiguous-star-export.js';
|
|
1
3
|
import st from '../util/colors.js';
|
|
2
4
|
import { toRelative } from '../util/path.js';
|
|
3
5
|
import { toRegexOrString } from '../util/regex.js';
|
|
@@ -33,6 +35,34 @@ export default ({ graph, explorer, options, workspaceFilePathFilter, issues }) =
|
|
|
33
35
|
}
|
|
34
36
|
else {
|
|
35
37
|
let nodes = explorer.buildExportsTree({ filePath: options.traceFile, identifier: options.traceExport });
|
|
38
|
+
const traceFile = options.traceFile;
|
|
39
|
+
const traceExport = options.traceExport;
|
|
40
|
+
const dotIndex = traceExport?.indexOf('.') ?? -1;
|
|
41
|
+
const resolvedTraceExport = dotIndex === -1 ? traceExport : traceExport?.slice(0, dotIndex);
|
|
42
|
+
const resolution = traceFile && resolvedTraceExport ? explorer.resolveExportOrigins(traceFile, resolvedTraceExport) : undefined;
|
|
43
|
+
const collision = resolution && resolvedTraceExport ? getAmbiguousStarExport(resolution, resolvedTraceExport) : undefined;
|
|
44
|
+
const toRel = (path) => toRelative(path, options.cwd);
|
|
45
|
+
if (collision) {
|
|
46
|
+
collision.origins.sort((a, b) => compareStrings(a.filePath, b.filePath));
|
|
47
|
+
console.log(`${toRel(traceFile ?? '')}:${st.cyanBright(resolvedTraceExport ?? '')} [ambiguous]`);
|
|
48
|
+
for (let i = 0; i < collision.origins.length; i++) {
|
|
49
|
+
const origin = collision.origins[i];
|
|
50
|
+
const connector = i === collision.origins.length - 1 ? '└──' : '├──';
|
|
51
|
+
console.log(`${st.dim(connector)} ${toRel(origin.filePath)}:${st.cyanBright(origin.identifier)}`);
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (nodes.length === 0 && resolution && !resolution.hasExplicitExport && resolution.origins.length === 1) {
|
|
56
|
+
const [origin] = resolution.origins;
|
|
57
|
+
const originFile = graph.get(origin.filePath);
|
|
58
|
+
if (originFile && origin.identifier !== IMPORT_STAR && origin.identifier !== 'default') {
|
|
59
|
+
for (const [exportId, exp] of originFile.exports) {
|
|
60
|
+
if (exp.binding !== origin.identifier)
|
|
61
|
+
continue;
|
|
62
|
+
nodes.push(...explorer.buildExportsTree({ filePath: origin.filePath, identifier: exportId }));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
36
66
|
if (nodes.length === 0 && options.traceExport?.includes('.')) {
|
|
37
67
|
const nsName = options.traceExport.substring(0, options.traceExport.indexOf('.'));
|
|
38
68
|
nodes = explorer.buildExportsTree({ filePath: options.traceFile, identifier: nsName });
|
|
@@ -56,7 +86,6 @@ export default ({ graph, explorer, options, workspaceFilePathFilter, issues }) =
|
|
|
56
86
|
}
|
|
57
87
|
}
|
|
58
88
|
nodes.sort((a, b) => compareStrings(a.filePath, b.filePath) || compareStrings(a.identifier, b.identifier));
|
|
59
|
-
const toRel = (path) => toRelative(path, options.cwd);
|
|
60
89
|
if (nodes.length === 0) {
|
|
61
90
|
if (options.traceFile && !graph.has(options.traceFile)) {
|
|
62
91
|
console.log(`File not found in module graph: ${toRel(options.traceFile)}`);
|
|
@@ -731,6 +731,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
731
731
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
732
732
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
733
733
|
}, z.core.$strip>]>>;
|
|
734
|
+
textlint: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
735
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
736
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
737
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
738
|
+
}, z.core.$strip>]>>;
|
|
734
739
|
travis: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
735
740
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
736
741
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -811,6 +816,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
811
816
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
812
817
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
813
818
|
}, z.core.$strip>]>>;
|
|
819
|
+
varlock: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
820
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
821
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
822
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
823
|
+
}, z.core.$strip>]>>;
|
|
814
824
|
vercel: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
815
825
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
816
826
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -922,6 +932,7 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
|
|
|
922
932
|
ignore: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
923
933
|
ignoreFiles: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
924
934
|
ignoreBinaries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
935
|
+
ignoreGlobalBinaries: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
925
936
|
ignoreDependencies: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
926
937
|
ignoreMembers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
927
938
|
ignoreUnresolved: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
@@ -1662,6 +1673,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1662
1673
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1663
1674
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1664
1675
|
}, z.core.$strip>]>>;
|
|
1676
|
+
textlint: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1677
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1678
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1679
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1680
|
+
}, z.core.$strip>]>>;
|
|
1665
1681
|
travis: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1666
1682
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1667
1683
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -1742,6 +1758,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1742
1758
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1743
1759
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1744
1760
|
}, z.core.$strip>]>>;
|
|
1761
|
+
varlock: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1762
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1763
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1764
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1765
|
+
}, z.core.$strip>]>>;
|
|
1745
1766
|
vercel: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
1746
1767
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1747
1768
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -1859,6 +1880,7 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
1859
1880
|
ignore: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1860
1881
|
ignoreFiles: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
1861
1882
|
ignoreBinaries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
1883
|
+
ignoreGlobalBinaries: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
1862
1884
|
ignoreDependencies: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
1863
1885
|
ignoreMembers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
1864
1886
|
ignoreUnresolved: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
@@ -2612,6 +2634,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2612
2634
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2613
2635
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2614
2636
|
}, z.core.$strip>]>>;
|
|
2637
|
+
textlint: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2638
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2639
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2640
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2641
|
+
}, z.core.$strip>]>>;
|
|
2615
2642
|
travis: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2616
2643
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2617
2644
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -2692,6 +2719,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2692
2719
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2693
2720
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2694
2721
|
}, z.core.$strip>]>>;
|
|
2722
|
+
varlock: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2723
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2724
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2725
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2726
|
+
}, z.core.$strip>]>>;
|
|
2695
2727
|
vercel: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
2696
2728
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2697
2729
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -2803,6 +2835,7 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
|
|
|
2803
2835
|
ignore: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2804
2836
|
ignoreFiles: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
2805
2837
|
ignoreBinaries: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
2838
|
+
ignoreGlobalBinaries: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
2806
2839
|
ignoreDependencies: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
2807
2840
|
ignoreMembers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
2808
2841
|
ignoreUnresolved: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
|
|
@@ -42,6 +42,7 @@ const rootConfigurationSchema = z.object({
|
|
|
42
42
|
ignore: z.optional(globSchema),
|
|
43
43
|
ignoreFiles: z.optional(globSchema),
|
|
44
44
|
ignoreBinaries: z.optional(stringOrRegexSchema),
|
|
45
|
+
ignoreGlobalBinaries: z.optional(z.boolean()),
|
|
45
46
|
ignoreDependencies: z.optional(stringOrRegexSchema),
|
|
46
47
|
ignoreMembers: z.optional(stringOrRegexSchema),
|
|
47
48
|
ignoreUnresolved: z.optional(stringOrRegexSchema),
|
|
@@ -69,6 +70,7 @@ const baseWorkspaceConfigurationSchema = z.object({
|
|
|
69
70
|
ignore: z.optional(globSchema),
|
|
70
71
|
ignoreFiles: z.optional(globSchema),
|
|
71
72
|
ignoreBinaries: z.optional(stringOrRegexSchema),
|
|
73
|
+
ignoreGlobalBinaries: z.optional(z.boolean()),
|
|
72
74
|
ignoreDependencies: z.optional(stringOrRegexSchema),
|
|
73
75
|
ignoreMembers: z.optional(stringOrRegexSchema),
|
|
74
76
|
ignoreUnresolved: z.optional(stringOrRegexSchema),
|
package/dist/schema/plugins.d.ts
CHANGED
|
@@ -736,6 +736,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
|
|
|
736
736
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
737
737
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
738
738
|
}, z.core.$strip>]>;
|
|
739
|
+
textlint: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
740
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
741
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
742
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
743
|
+
}, z.core.$strip>]>;
|
|
739
744
|
travis: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
740
745
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
741
746
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
@@ -816,6 +821,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
|
|
|
816
821
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
817
822
|
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
818
823
|
}, z.core.$strip>]>;
|
|
824
|
+
varlock: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
825
|
+
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
826
|
+
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
827
|
+
project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
828
|
+
}, z.core.$strip>]>;
|
|
819
829
|
vercel: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
|
|
820
830
|
config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
821
831
|
entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
package/dist/schema/plugins.js
CHANGED
|
@@ -156,6 +156,7 @@ export const pluginsSchema = z.object({
|
|
|
156
156
|
taskfile: pluginSchema,
|
|
157
157
|
tauri: pluginSchema,
|
|
158
158
|
temporal: pluginSchema,
|
|
159
|
+
textlint: pluginSchema,
|
|
159
160
|
travis: pluginSchema,
|
|
160
161
|
'ts-node': pluginSchema,
|
|
161
162
|
tsd: pluginSchema,
|
|
@@ -172,6 +173,7 @@ export const pluginsSchema = z.object({
|
|
|
172
173
|
'unplugin-vue-i18n': pluginSchema,
|
|
173
174
|
'unplugin-vue-markdown': pluginSchema,
|
|
174
175
|
'unplugin-vue-router': pluginSchema,
|
|
176
|
+
varlock: pluginSchema,
|
|
175
177
|
vercel: pluginSchema,
|
|
176
178
|
'vercel-og': pluginSchema,
|
|
177
179
|
vike: pluginSchema,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IMPORT_STAR } from '../constants.js';
|
|
1
|
+
import { IMPORT_FLAGS, IMPORT_STAR } from '../constants.js';
|
|
2
2
|
import { getExportedIdentifiers } from '../graph-explorer/utils.js';
|
|
3
3
|
import { forEachAliasReExport, forEachNamespaceReExport, forEachPassThroughReExport, getStarReExportSources, } from '../graph-explorer/visitors.js';
|
|
4
4
|
import { compareStrings } from '../util/string.js';
|
|
@@ -52,6 +52,14 @@ export const buildExportsMap = (fileNode, filePath, graph, entryPaths, explorer,
|
|
|
52
52
|
for (const _export of fileNode.exports.values()) {
|
|
53
53
|
addExport(_export.identifier, filePath, _export.pos, _export.line, _export.col, undefined);
|
|
54
54
|
}
|
|
55
|
+
for (const _import of fileNode.imports.imports) {
|
|
56
|
+
if (!_import.filePath &&
|
|
57
|
+
_import.modifiers & IMPORT_FLAGS.RE_EXPORT &&
|
|
58
|
+
_import.identifier === IMPORT_STAR &&
|
|
59
|
+
_import.alias) {
|
|
60
|
+
addExport(_import.alias, filePath, _import.pos, _import.line, _import.col, undefined);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
for (const [importedFilePath, importMaps] of fileNode.imports.internal) {
|
|
56
64
|
forEachPassThroughReExport(importMaps, (id, _sources) => {
|
|
57
65
|
if (exportsMap.has(id))
|
|
@@ -27,8 +27,6 @@ export const buildFileDescriptor = (filePath, cwd, graph, entryPaths, options =
|
|
|
27
27
|
const details = contentionMap.get(identifier);
|
|
28
28
|
if (!details)
|
|
29
29
|
continue;
|
|
30
|
-
if (details.branching.length === 0 && details.conflict.length === 0)
|
|
31
|
-
continue;
|
|
32
30
|
contention[identifier] = details;
|
|
33
31
|
}
|
|
34
32
|
}
|
package/dist/session/index.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export { createOptions, type MainOptions } from '../util/create-options.ts';
|
|
|
9
9
|
export { buildFileDescriptor, type FileDescriptorOptions } from './file-descriptor.ts';
|
|
10
10
|
export { buildPackageJsonDescriptor, type PackageJsonFile } from './package-json-descriptor.ts';
|
|
11
11
|
export { createSession, type Session } from './session.ts';
|
|
12
|
-
export type { ContentionDetails, Export, File, SourceLocation } from './types.ts';
|
|
12
|
+
export type { ContentionDetails, ContentionKind, ContentionOrigin, ContentionSite, Export, File, SourceLocation, } from './types.ts';
|
package/dist/session/types.d.ts
CHANGED
|
@@ -13,9 +13,27 @@ export interface Export extends SourceLocation {
|
|
|
13
13
|
entryPaths: Set<string>;
|
|
14
14
|
exports: Export[] | undefined;
|
|
15
15
|
}
|
|
16
|
+
export type ContentionKind = 'ambiguous' | 'shadowed' | 'converged';
|
|
17
|
+
export interface ContentionOrigin {
|
|
18
|
+
filePath: string;
|
|
19
|
+
identifier: string;
|
|
20
|
+
line?: number;
|
|
21
|
+
col?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ContentionSite {
|
|
24
|
+
kind: ContentionKind;
|
|
25
|
+
filePath: string;
|
|
26
|
+
identifier: string;
|
|
27
|
+
line?: number;
|
|
28
|
+
col?: number;
|
|
29
|
+
origins: ContentionOrigin[];
|
|
30
|
+
winner?: ContentionOrigin;
|
|
31
|
+
sources: string[];
|
|
32
|
+
}
|
|
16
33
|
export interface ContentionDetails {
|
|
17
34
|
branching: string[];
|
|
18
35
|
conflict: string[];
|
|
36
|
+
sites: ContentionSite[];
|
|
19
37
|
}
|
|
20
38
|
export interface FileMetrics {
|
|
21
39
|
imports: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'borp' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'eve' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'marko' | 'mdx' | 'mdxlint' | 'metro' | 'mise' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'quasar' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
|
|
2
|
-
export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'borp', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'eve', 'execa', 'expo', 'expressive-code', 'fast', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'marko', 'mdx', 'mdxlint', 'metro', 'mise', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'quasar', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
|
|
1
|
+
export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'borp' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'eve' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'marko' | 'mdx' | 'mdxlint' | 'metro' | 'mise' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'quasar' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
|
|
2
|
+
export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'borp', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'eve', 'execa', 'expo', 'expressive-code', 'fast', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'marko', 'mdx', 'mdxlint', 'metro', 'mise', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'quasar', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
|
|
@@ -145,6 +145,7 @@ export const pluginNames = [
|
|
|
145
145
|
'taskfile',
|
|
146
146
|
'tauri',
|
|
147
147
|
'temporal',
|
|
148
|
+
'textlint',
|
|
148
149
|
'travis',
|
|
149
150
|
'ts-node',
|
|
150
151
|
'tsd',
|
|
@@ -161,6 +162,7 @@ export const pluginNames = [
|
|
|
161
162
|
'unplugin-vue-i18n',
|
|
162
163
|
'unplugin-vue-markdown',
|
|
163
164
|
'unplugin-vue-router',
|
|
165
|
+
'varlock',
|
|
164
166
|
'vercel',
|
|
165
167
|
'vercel-og',
|
|
166
168
|
'vike',
|
package/dist/types/config.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ import type { Tags } from './options.ts';
|
|
|
13
13
|
import type { PluginName } from './PluginNames.ts';
|
|
14
14
|
import type { PackageJson } from './package-json.ts';
|
|
15
15
|
export interface GetInputsFromScriptsOptions extends BaseOptions {
|
|
16
|
-
|
|
16
|
+
isForwardedArgs?: boolean;
|
|
17
|
+
optionalBinaries?: boolean;
|
|
17
18
|
containingFilePath: string;
|
|
18
19
|
expandedScripts?: Set<string>;
|
|
19
20
|
}
|
|
@@ -47,6 +48,7 @@ export type GetImportsAndExportsOptions = {
|
|
|
47
48
|
export interface Configuration {
|
|
48
49
|
ignore: NormalizedGlob;
|
|
49
50
|
ignoreBinaries: IgnorePatterns;
|
|
51
|
+
ignoreGlobalBinaries: boolean;
|
|
50
52
|
ignoreDependencies: IgnorePatterns;
|
|
51
53
|
ignoreExportsUsedInFile: IgnoreExportsUsedInFile;
|
|
52
54
|
ignoreFiles: NormalizedGlob;
|
|
@@ -71,6 +73,7 @@ interface BaseWorkspaceConfiguration {
|
|
|
71
73
|
paths: Record<string, string[]>;
|
|
72
74
|
ignore: NormalizedGlob;
|
|
73
75
|
ignoreFiles: NormalizedGlob;
|
|
76
|
+
ignoreGlobalBinaries: boolean;
|
|
74
77
|
ignoreExportsUsedInFile: IgnoreExportsUsedInFile;
|
|
75
78
|
isIncludeEntryExports: boolean;
|
|
76
79
|
}
|
|
@@ -97,6 +100,7 @@ export interface PluginOptions extends BaseOptions {
|
|
|
97
100
|
configFileDir: string;
|
|
98
101
|
configFileName: string;
|
|
99
102
|
configFilePath: string;
|
|
103
|
+
isResolvedConfigFile: boolean;
|
|
100
104
|
isProduction: boolean;
|
|
101
105
|
enabledPlugins: string[];
|
|
102
106
|
getInputsFromScripts: GetInputsFromScriptsPartial;
|
|
@@ -28,6 +28,7 @@ export interface Import extends Position {
|
|
|
28
28
|
readonly specifier: string;
|
|
29
29
|
readonly filePath: string | undefined;
|
|
30
30
|
readonly identifier: string | undefined;
|
|
31
|
+
readonly alias: string | undefined;
|
|
31
32
|
readonly isTypeOnly: boolean;
|
|
32
33
|
readonly modifiers: number;
|
|
33
34
|
readonly jsDocTags: Tags | undefined;
|
|
@@ -38,6 +39,7 @@ export interface ExternalRef {
|
|
|
38
39
|
}
|
|
39
40
|
export interface Export extends Position {
|
|
40
41
|
readonly identifier: Identifier;
|
|
42
|
+
readonly binding: Identifier;
|
|
41
43
|
readonly type: SymbolType;
|
|
42
44
|
readonly members: ExportMember[];
|
|
43
45
|
jsDocTags: Tags;
|
|
@@ -46,6 +48,7 @@ export interface Export extends Position {
|
|
|
46
48
|
referencedIn: Set<string> | undefined;
|
|
47
49
|
readonly fixes: Fixes;
|
|
48
50
|
isReExport: boolean;
|
|
51
|
+
isBindingReExport: boolean;
|
|
49
52
|
}
|
|
50
53
|
export interface ExportMember extends Position {
|
|
51
54
|
readonly identifier: Identifier;
|
|
@@ -18,7 +18,7 @@ type WithPackageJsonPathAsKey<T> = {
|
|
|
18
18
|
[K in keyof T]: PackageJsonPath<T[K]> extends never ? K : PackageJsonPath<T[K]>;
|
|
19
19
|
};
|
|
20
20
|
type PluginConfig<P> = {
|
|
21
|
-
[K in keyof P as WithPackageJsonPathAsKey<P>[K]]
|
|
21
|
+
[K in keyof P as WithPackageJsonPathAsKey<P>[K]]?: unknown;
|
|
22
22
|
};
|
|
23
23
|
type Plugins = PluginConfig<PluginMap>;
|
|
24
24
|
export type Scripts = Record<string, string>;
|
|
@@ -35,6 +35,7 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
35
35
|
importAliases.set(aliasName, new Set([{ id, filePath: importFilePath }]));
|
|
36
36
|
};
|
|
37
37
|
const localImportMap = new Map();
|
|
38
|
+
let builtinImports;
|
|
38
39
|
const localDeclarationTypes = new Map();
|
|
39
40
|
const referencedInExport = new Map();
|
|
40
41
|
const destructuredExports = new Set();
|
|
@@ -57,6 +58,7 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
57
58
|
filePath: importFilePath,
|
|
58
59
|
specifier,
|
|
59
60
|
identifier: namespace ?? opts.identifier,
|
|
61
|
+
alias: opts.alias,
|
|
60
62
|
pos: opts.pos,
|
|
61
63
|
line: opts.line,
|
|
62
64
|
col: opts.col,
|
|
@@ -95,8 +97,26 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
95
97
|
}
|
|
96
98
|
};
|
|
97
99
|
const addImport = (specifier, identifier, alias, namespace, pos, modifiers, specifierPos, jsDocTags, preResolvedModule) => {
|
|
98
|
-
if (!specifier
|
|
100
|
+
if (!specifier)
|
|
99
101
|
return;
|
|
102
|
+
if (isBuiltin(specifier)) {
|
|
103
|
+
const { line, col } = getLineAndCol(lineStarts, pos);
|
|
104
|
+
const _import = {
|
|
105
|
+
filePath: undefined,
|
|
106
|
+
specifier: specifier.startsWith('node:') ? specifier : `node:${specifier}`,
|
|
107
|
+
identifier: identifier ?? SIDE_EFFECTS,
|
|
108
|
+
alias: namespace ?? alias,
|
|
109
|
+
pos,
|
|
110
|
+
line,
|
|
111
|
+
col,
|
|
112
|
+
isTypeOnly: isDts || !!(modifiers & IMPORT_FLAGS.TYPE_ONLY),
|
|
113
|
+
modifiers,
|
|
114
|
+
jsDocTags,
|
|
115
|
+
};
|
|
116
|
+
if (modifiers & IMPORT_FLAGS.RE_EXPORT)
|
|
117
|
+
imports.add(_import);
|
|
118
|
+
return _import;
|
|
119
|
+
}
|
|
100
120
|
const module = preResolvedModule ?? resolveModule(specifier, filePath);
|
|
101
121
|
if (modifiers & IMPORT_FLAGS.AUGMENT &&
|
|
102
122
|
(!module || module.isExternalLibraryImport || isInNodeModules(module.resolvedFileName))) {
|
|
@@ -142,6 +162,7 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
142
162
|
filePath: resolvedFileName,
|
|
143
163
|
specifier: sanitizedSpecifier,
|
|
144
164
|
identifier: identifier ?? SIDE_EFFECTS,
|
|
165
|
+
alias,
|
|
145
166
|
pos: ePos,
|
|
146
167
|
line,
|
|
147
168
|
col,
|
|
@@ -168,6 +189,7 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
168
189
|
filePath: undefined,
|
|
169
190
|
specifier,
|
|
170
191
|
identifier: identifier ?? SIDE_EFFECTS,
|
|
192
|
+
alias,
|
|
171
193
|
pos: uPos,
|
|
172
194
|
line,
|
|
173
195
|
col,
|
|
@@ -210,26 +232,25 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
210
232
|
: undefined;
|
|
211
233
|
for (const entry of _imports.entries) {
|
|
212
234
|
const modifiers = entry.isType ? IMPORT_FLAGS.TYPE_ONLY : IMPORT_FLAGS.NONE;
|
|
235
|
+
const localName = entry.localName.value;
|
|
236
|
+
let builtinImport;
|
|
213
237
|
if (entry.importName.kind === 'NamespaceObject') {
|
|
214
|
-
const localName = entry.localName.value;
|
|
215
238
|
if (isChildProcessImport)
|
|
216
239
|
(childProcessNamespaces ??= new Set()).add(localName);
|
|
217
|
-
addImport(specifier, IMPORT_STAR, localName, undefined, entry.localName.start, modifiers, pos, jsdocTags, resolved);
|
|
240
|
+
builtinImport = addImport(specifier, IMPORT_STAR, localName, undefined, entry.localName.start, modifiers, pos, jsdocTags, resolved);
|
|
218
241
|
if (internalPath)
|
|
219
242
|
localImportMap.set(localName, { importedName: IMPORT_STAR, filePath: internalPath, isNamespace: true });
|
|
220
243
|
}
|
|
221
244
|
else if (entry.importName.kind === 'Default') {
|
|
222
|
-
const localName = entry.localName.value;
|
|
223
245
|
if (isChildProcessImport)
|
|
224
246
|
(childProcessNamespaces ??= new Set()).add(localName);
|
|
225
247
|
const alias = localName !== 'default' ? localName : undefined;
|
|
226
|
-
addImport(specifier, 'default', alias, undefined, entry.localName.start, modifiers, pos, jsdocTags, resolved);
|
|
248
|
+
builtinImport = addImport(specifier, 'default', alias, undefined, entry.localName.start, modifiers, pos, jsdocTags, resolved);
|
|
227
249
|
if (internalPath)
|
|
228
250
|
localImportMap.set(localName, { importedName: 'default', filePath: internalPath, isNamespace: false });
|
|
229
251
|
}
|
|
230
252
|
else {
|
|
231
253
|
const importedName = entry.importName.name;
|
|
232
|
-
const localName = entry.localName.value;
|
|
233
254
|
const alias = localName !== importedName ? localName : undefined;
|
|
234
255
|
if (isChildProcessImport)
|
|
235
256
|
(childProcessMethods ??= new Map()).set(localName, importedName);
|
|
@@ -239,10 +260,12 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
239
260
|
else if (importedName === 'resolve')
|
|
240
261
|
hasPathResolveImport = true;
|
|
241
262
|
}
|
|
242
|
-
addImport(specifier, importedName, alias, undefined, entry.localName.start, modifiers, pos, jsdocTags, resolved);
|
|
263
|
+
builtinImport = addImport(specifier, importedName, alias, undefined, entry.localName.start, modifiers, pos, jsdocTags, resolved);
|
|
243
264
|
if (internalPath)
|
|
244
265
|
localImportMap.set(localName, { importedName, filePath: internalPath, isNamespace: false });
|
|
245
266
|
}
|
|
267
|
+
if (builtinImport)
|
|
268
|
+
(builtinImports ??= new Map()).set(localName, builtinImport);
|
|
246
269
|
}
|
|
247
270
|
}
|
|
248
271
|
for (const se of result.module.staticExports) {
|
|
@@ -267,9 +290,11 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
267
290
|
}
|
|
268
291
|
else if (entry.importName.kind === 'Name') {
|
|
269
292
|
const importedName = entry.importName.name;
|
|
293
|
+
const builtinImport = builtinImports?.get(importedName);
|
|
294
|
+
const sourceName = builtinImport && builtinImport.pos === entry.importName.start ? builtinImport.identifier : importedName;
|
|
270
295
|
const exportedName = entry.exportName.name;
|
|
271
|
-
const alias = exportedName && exportedName !==
|
|
272
|
-
addImport(specifier,
|
|
296
|
+
const alias = exportedName && exportedName !== sourceName ? exportedName : undefined;
|
|
297
|
+
addImport(specifier, sourceName, alias, undefined, entry.start, modifiers, pos, undefined, reExportResolved);
|
|
273
298
|
}
|
|
274
299
|
continue;
|
|
275
300
|
}
|
|
@@ -323,6 +348,15 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
323
348
|
const firstStmtStart = result.program.body[0]?.start ?? Number.POSITIVE_INFINITY;
|
|
324
349
|
extractImportsFromComments(result.comments, firstStmtStart, addImport);
|
|
325
350
|
for (const [id, item] of exports) {
|
|
351
|
+
const builtinImport = specifierExportNames.has(id) ? builtinImports?.get(item.binding) : undefined;
|
|
352
|
+
if (builtinImport) {
|
|
353
|
+
item.isReExport = true;
|
|
354
|
+
item.isBindingReExport = true;
|
|
355
|
+
if (builtinImport.identifier === IMPORT_STAR) {
|
|
356
|
+
const isTypeOnly = builtinImport.isTypeOnly || item.type === 'type';
|
|
357
|
+
addImport(builtinImport.specifier, IMPORT_STAR, id, undefined, item.pos, IMPORT_FLAGS.RE_EXPORT | (isTypeOnly ? IMPORT_FLAGS.TYPE_ONLY : IMPORT_FLAGS.NONE));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
326
360
|
item.referencedIn = referencedInExport.get(id);
|
|
327
361
|
if (localRefs && shouldCountRefs(ignoreExportsUsedInFile, item.type) && localRefs.has(id)) {
|
|
328
362
|
item.hasRefsInFile = true;
|
|
@@ -30,7 +30,7 @@ export function handleExportNamed(node, s) {
|
|
|
30
30
|
: undefined;
|
|
31
31
|
const specTags = s.getJSDocTags(spec.start);
|
|
32
32
|
const tags = specTags.size ? new Set([...declTags, ...specTags]) : declTags;
|
|
33
|
-
s.addExport(exportedName, type, spec.exported?.start ?? spec.start, [], fix, true, tags);
|
|
33
|
+
s.addExport(exportedName, type, spec.exported?.start ?? spec.start, [], fix, true, tags, exportedName, true);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
return;
|
|
@@ -208,6 +208,7 @@ export function handleExportNamed(node, s) {
|
|
|
208
208
|
: undefined;
|
|
209
209
|
const _import = localName ? s.localImportMap.get(localName) : undefined;
|
|
210
210
|
const isReExport = !!_import;
|
|
211
|
+
const isBindingReExport = !!_import && !_import.isDynamicImport;
|
|
211
212
|
if (_import) {
|
|
212
213
|
const internalImport = s.internal.get(_import.filePath);
|
|
213
214
|
if (internalImport) {
|
|
@@ -222,7 +223,7 @@ export function handleExportNamed(node, s) {
|
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
|
-
s.addExport(exportedName, type, spec.exported?.start ?? spec.start, [], fix, isReExport, s.getJSDocTags(node.start));
|
|
226
|
+
s.addExport(exportedName, type, spec.exported?.start ?? spec.start, [], fix, isReExport, s.getJSDocTags(node.start), localName, isBindingReExport);
|
|
226
227
|
if (exportedName)
|
|
227
228
|
s.specifierExportNames.add(exportedName);
|
|
228
229
|
if (localName && exportedName)
|
|
@@ -243,14 +244,17 @@ export function handleExportDefault(node, s) {
|
|
|
243
244
|
let type = SYMBOL_TYPE.UNKNOWN;
|
|
244
245
|
let pos = decl.start;
|
|
245
246
|
let members = [];
|
|
246
|
-
|
|
247
|
+
let binding = 'default';
|
|
248
|
+
if (decl.type === 'FunctionDeclaration' || decl.type === 'TSDeclareFunction') {
|
|
247
249
|
type = SYMBOL_TYPE.FUNCTION;
|
|
248
250
|
pos = decl.id?.start ?? decl.start;
|
|
251
|
+
binding = decl.id?.name ?? binding;
|
|
249
252
|
s.collectRefsInType(decl, 'default', hasExplicitFunctionReturnType(decl));
|
|
250
253
|
}
|
|
251
254
|
else if (decl.type === 'ClassDeclaration') {
|
|
252
255
|
type = SYMBOL_TYPE.CLASS;
|
|
253
256
|
pos = decl.id?.start ?? decl.start;
|
|
257
|
+
binding = decl.id?.name ?? binding;
|
|
254
258
|
members = [];
|
|
255
259
|
s.collectRefsInType(decl, 'default', true);
|
|
256
260
|
if (decl.id)
|
|
@@ -259,6 +263,7 @@ export function handleExportDefault(node, s) {
|
|
|
259
263
|
else if (decl.type === 'TSInterfaceDeclaration') {
|
|
260
264
|
type = SYMBOL_TYPE.INTERFACE;
|
|
261
265
|
pos = decl.id.start;
|
|
266
|
+
binding = decl.id.name;
|
|
262
267
|
s.collectRefsInType(decl.body, 'default', false);
|
|
263
268
|
}
|
|
264
269
|
else if (decl.type === 'Identifier') {
|
|
@@ -294,7 +299,7 @@ export function handleExportDefault(node, s) {
|
|
|
294
299
|
}
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
|
-
s.addExport('default', type, pos, members, fix, false, s.getJSDocTags(node.start));
|
|
302
|
+
s.addExport('default', type, pos, members, fix, false, s.getJSDocTags(node.start), binding);
|
|
298
303
|
}
|
|
299
304
|
export function handleExportAssignment(node, s) {
|
|
300
305
|
if (s.skipExports || s.isInNamespace(node))
|
|
@@ -84,7 +84,7 @@ export interface WalkState extends WalkContext {
|
|
|
84
84
|
customElementRegistries: Set<string>;
|
|
85
85
|
classNameStack: string[];
|
|
86
86
|
staticBlockDepth: number;
|
|
87
|
-
addExport: (identifier: string, type: SymbolType, pos: number, members: ExportMember[], fix: Fix, isReExport: boolean, jsDocTags: Set<string
|
|
87
|
+
addExport: (identifier: string, type: SymbolType, pos: number, members: ExportMember[], fix: Fix, isReExport: boolean, jsDocTags: Set<string>, binding?: string, isBindingReExport?: boolean) => void;
|
|
88
88
|
getFix: (start: number, end: number, flags?: number) => Fix;
|
|
89
89
|
getTypeFix: (start: number, end: number) => Fix;
|
|
90
90
|
collectRefsInType: (node: any, exportName: string, signatureOnly: boolean) => void;
|