knip 6.27.0 → 6.28.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 +6 -0
- package/dist/DependencyDeputy.js +1 -1
- package/dist/WorkspaceWorker.js +9 -0
- package/dist/compilers/index.d.ts +10 -0
- package/dist/compilers/mdx.d.ts +2 -1
- package/dist/constants.js +14 -0
- package/dist/graph/analyze.js +6 -4
- package/dist/graph-explorer/explorer.d.ts +1 -1
- package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
- package/dist/graph-explorer/operations/is-referenced.js +47 -33
- package/dist/manifest/index.d.ts +2 -1
- package/dist/plugins/angular/index.js +3 -0
- package/dist/plugins/babel/helpers.d.ts +9 -7
- package/dist/plugins/convex/index.js +11 -2
- package/dist/plugins/convex/types.d.ts +3 -0
- package/dist/plugins/convex/types.js +1 -0
- package/dist/plugins/github-actions/index.js +5 -2
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/markdownlint/index.js +26 -5
- package/dist/plugins/markdownlint/types.d.ts +6 -0
- package/dist/plugins/nitro/index.js +3 -1
- package/dist/plugins/nuxt/index.js +19 -8
- package/dist/plugins/openclaw/index.d.ts +3 -0
- package/dist/plugins/openclaw/index.js +52 -0
- package/dist/plugins/openclaw/types.d.ts +25 -0
- package/dist/plugins/openclaw/types.js +1 -0
- package/dist/plugins/prettier/index.js +1 -1
- package/dist/plugins/tailwind/index.js +8 -0
- package/dist/plugins/tsdown/index.js +43 -0
- package/dist/plugins/typescript/index.js +1 -1
- package/dist/reporters/util/configuration-hints.js +3 -1
- package/dist/schema/configuration.d.ts +15 -0
- package/dist/schema/plugins.d.ts +5 -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/issues.d.ts +1 -1
- package/dist/typescript/ast-nodes.d.ts +3 -1
- package/dist/typescript/comments.d.ts +1 -1
- package/dist/typescript/comments.js +71 -5
- package/dist/typescript/get-imports-and-exports.d.ts +3 -1
- package/dist/typescript/get-imports-and-exports.js +1 -1
- package/dist/typescript/visitors/walk.d.ts +1 -0
- package/dist/typescript/visitors/walk.js +14 -1
- package/dist/util/codeowners.js +1 -1
- package/dist/util/create-options.d.ts +10 -0
- package/dist/util/glob-cache.d.ts +7 -1
- package/dist/util/glob-cache.js +52 -29
- package/dist/util/glob-core.d.ts +2 -0
- package/dist/util/glob-core.js +46 -6
- package/dist/util/glob.d.ts +6 -3
- package/dist/util/glob.js +23 -9
- package/dist/util/loader.d.ts +3 -1
- package/dist/util/parse-and-convert-gitignores.d.ts +2 -2
- package/dist/util/parse-and-convert-gitignores.js +4 -4
- package/dist/util/reporter.js +4 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -11
- package/schema.json +4 -0
|
@@ -472,6 +472,11 @@ export declare class ConfigurationChief {
|
|
|
472
472
|
entry?: string | string[] | undefined;
|
|
473
473
|
project?: string | string[] | undefined;
|
|
474
474
|
} | undefined;
|
|
475
|
+
openclaw?: string | boolean | string[] | {
|
|
476
|
+
config?: string | string[] | undefined;
|
|
477
|
+
entry?: string | string[] | undefined;
|
|
478
|
+
project?: string | string[] | undefined;
|
|
479
|
+
} | undefined;
|
|
475
480
|
orval?: string | boolean | string[] | {
|
|
476
481
|
config?: string | string[] | undefined;
|
|
477
482
|
entry?: string | string[] | undefined;
|
|
@@ -1052,6 +1057,7 @@ export declare class ConfigurationChief {
|
|
|
1052
1057
|
nyc?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
1053
1058
|
oclif?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
1054
1059
|
"openapi-ts"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
1060
|
+
openclaw?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
1055
1061
|
orval?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
1056
1062
|
oxfmt?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
|
1057
1063
|
oxlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
|
package/dist/DependencyDeputy.js
CHANGED
|
@@ -125,7 +125,7 @@ export class DependencyDeputy {
|
|
|
125
125
|
maybeAddReferencedExternalDependency(workspace, packageName, isDevOnly, isTypeOnly, isResolved) {
|
|
126
126
|
if (!this.isReportDependencies)
|
|
127
127
|
return true;
|
|
128
|
-
if (isBuiltin(packageName))
|
|
128
|
+
if (packageName.startsWith('node:') || isBuiltin(packageName))
|
|
129
129
|
return true;
|
|
130
130
|
if (IGNORED_RUNTIME_DEPENDENCIES.has(packageName))
|
|
131
131
|
return true;
|
package/dist/WorkspaceWorker.js
CHANGED
|
@@ -505,14 +505,23 @@ export class WorkspaceWorker {
|
|
|
505
505
|
}
|
|
506
506
|
if (type === 'project' && compilerExtensions) {
|
|
507
507
|
const seen = new Set();
|
|
508
|
+
const patternExtensions = new Set();
|
|
508
509
|
for (const pattern of userDefinedPatterns) {
|
|
509
510
|
for (const ext of extractPatternExtensions(pattern)) {
|
|
511
|
+
patternExtensions.add(ext);
|
|
510
512
|
if (seen.has(ext) || DEFAULT_EXTENSIONS.has(ext) || compilerExtensions.has(ext))
|
|
511
513
|
continue;
|
|
512
514
|
seen.add(ext);
|
|
513
515
|
hints.push({ type: 'project-extension-unregistered', identifier: ext, workspaceName });
|
|
514
516
|
}
|
|
515
517
|
}
|
|
518
|
+
if (patternExtensions.size > 0) {
|
|
519
|
+
for (const ext of compilerExtensions) {
|
|
520
|
+
if (patternExtensions.has(ext))
|
|
521
|
+
continue;
|
|
522
|
+
hints.push({ type: 'project-extension-excluded', identifier: ext, workspaceName });
|
|
523
|
+
}
|
|
524
|
+
}
|
|
516
525
|
}
|
|
517
526
|
return hints;
|
|
518
527
|
}
|
|
@@ -418,6 +418,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
418
418
|
entry?: string | string[] | undefined;
|
|
419
419
|
project?: string | string[] | undefined;
|
|
420
420
|
} | undefined;
|
|
421
|
+
openclaw?: string | boolean | string[] | {
|
|
422
|
+
config?: string | string[] | undefined;
|
|
423
|
+
entry?: string | string[] | undefined;
|
|
424
|
+
project?: string | string[] | undefined;
|
|
425
|
+
} | undefined;
|
|
421
426
|
orval?: string | boolean | string[] | {
|
|
422
427
|
config?: string | string[] | undefined;
|
|
423
428
|
entry?: string | string[] | undefined;
|
|
@@ -1329,6 +1334,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1329
1334
|
entry?: string | string[] | undefined;
|
|
1330
1335
|
project?: string | string[] | undefined;
|
|
1331
1336
|
} | undefined;
|
|
1337
|
+
openclaw?: string | boolean | string[] | {
|
|
1338
|
+
config?: string | string[] | undefined;
|
|
1339
|
+
entry?: string | string[] | undefined;
|
|
1340
|
+
project?: string | string[] | undefined;
|
|
1341
|
+
} | undefined;
|
|
1332
1342
|
orval?: string | boolean | string[] | {
|
|
1333
1343
|
config?: string | string[] | undefined;
|
|
1334
1344
|
entry?: string | string[] | undefined;
|
package/dist/compilers/mdx.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -50,6 +50,7 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
|
|
|
50
50
|
'curl',
|
|
51
51
|
'cut',
|
|
52
52
|
'date',
|
|
53
|
+
'defaults',
|
|
53
54
|
'deno',
|
|
54
55
|
'devtunnel',
|
|
55
56
|
'df',
|
|
@@ -67,7 +68,9 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
|
|
|
67
68
|
'factor',
|
|
68
69
|
'false',
|
|
69
70
|
'find',
|
|
71
|
+
'fuser',
|
|
70
72
|
'gem',
|
|
73
|
+
'getconf',
|
|
71
74
|
'gh',
|
|
72
75
|
'git',
|
|
73
76
|
'grep',
|
|
@@ -82,6 +85,7 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
|
|
|
82
85
|
'ln',
|
|
83
86
|
'logname',
|
|
84
87
|
'ls',
|
|
88
|
+
'lsof',
|
|
85
89
|
'md5sum',
|
|
86
90
|
'mkdir',
|
|
87
91
|
'mknod',
|
|
@@ -104,14 +108,17 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
|
|
|
104
108
|
'powershell.exe',
|
|
105
109
|
'pr',
|
|
106
110
|
'printenv',
|
|
111
|
+
'ps',
|
|
107
112
|
'pulumi',
|
|
108
113
|
'pwd',
|
|
109
114
|
'python',
|
|
110
115
|
'python3',
|
|
116
|
+
'raft',
|
|
111
117
|
'rm',
|
|
112
118
|
'rmdir',
|
|
113
119
|
'rsync',
|
|
114
120
|
'scp',
|
|
121
|
+
'security',
|
|
115
122
|
'sed',
|
|
116
123
|
'seq',
|
|
117
124
|
'set',
|
|
@@ -127,10 +134,13 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
|
|
|
127
134
|
'stat',
|
|
128
135
|
'stty',
|
|
129
136
|
'sudo',
|
|
137
|
+
'sw_vers',
|
|
130
138
|
'sync',
|
|
139
|
+
'sysctl',
|
|
131
140
|
'systemctl',
|
|
132
141
|
'tac',
|
|
133
142
|
'tar',
|
|
143
|
+
'taskkill',
|
|
134
144
|
'tee',
|
|
135
145
|
'test',
|
|
136
146
|
'time',
|
|
@@ -148,14 +158,18 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
|
|
|
148
158
|
'uniq',
|
|
149
159
|
'unzip',
|
|
150
160
|
'wc',
|
|
161
|
+
'which',
|
|
151
162
|
'who',
|
|
152
163
|
'whoami',
|
|
153
164
|
'xargs',
|
|
154
165
|
'xcodebuild',
|
|
166
|
+
'xcrun',
|
|
155
167
|
'xvfb-run',
|
|
156
168
|
'yarn',
|
|
157
169
|
'yes',
|
|
158
170
|
'zip',
|
|
171
|
+
'zsh',
|
|
172
|
+
'zstd',
|
|
159
173
|
]);
|
|
160
174
|
export const IGNORED_DEPENDENCIES = new Set(['knip', 'typescript']);
|
|
161
175
|
export const IGNORED_RUNTIME_DEPENDENCIES = new Set(['node', 'bun', 'deno']);
|
package/dist/graph/analyze.js
CHANGED
|
@@ -90,13 +90,15 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
|
|
|
90
90
|
}
|
|
91
91
|
if (isIgnored)
|
|
92
92
|
continue;
|
|
93
|
-
if (reExportingEntryFile
|
|
93
|
+
if (reExportingEntryFile) {
|
|
94
94
|
if (!isIncludeEntryExports) {
|
|
95
95
|
continue;
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
if (!isReferenced) {
|
|
98
|
+
const reExportedItem = graph.get(reExportingEntryFile)?.exports.get(identifier);
|
|
99
|
+
if (reExportedItem && shouldIgnore(reExportedItem.jsDocTags))
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
100
102
|
}
|
|
101
103
|
if (isReferenced) {
|
|
102
104
|
const isEnumMembers = options.includedIssueTypes.enumMembers && exportedItem.type === 'enum';
|
|
@@ -3,7 +3,7 @@ export declare const createGraphExplorer: (graph: ModuleGraph, entryPaths: Set<s
|
|
|
3
3
|
isReferenced: (filePath: string, identifier: string, options: {
|
|
4
4
|
traverseEntries: boolean;
|
|
5
5
|
treatStarAtEntryAsReferenced?: boolean;
|
|
6
|
-
}) => [
|
|
6
|
+
}) => readonly [false, string | undefined];
|
|
7
7
|
hasStrictlyNsReferences: (filePath: string, identifier: string) => [boolean, (string | undefined)?];
|
|
8
8
|
buildExportsTree: (options: {
|
|
9
9
|
filePath?: string;
|
|
@@ -2,4 +2,4 @@ import type { Identifier, ModuleGraph } from '../../types/module-graph.ts';
|
|
|
2
2
|
export declare const isReferenced: (graph: ModuleGraph, entryPaths: Set<string>, filePath: string, id: Identifier, options: {
|
|
3
3
|
traverseEntries: boolean;
|
|
4
4
|
treatStarAtEntryAsReferenced?: boolean;
|
|
5
|
-
}) => [
|
|
5
|
+
}) => readonly [false, string | undefined];
|
|
@@ -15,90 +15,104 @@ const hasOnlyNsRefs = (file) => {
|
|
|
15
15
|
};
|
|
16
16
|
export const isReferenced = (graph, entryPaths, filePath, id, options) => {
|
|
17
17
|
const seen = new Set();
|
|
18
|
+
let isReferenced = false;
|
|
19
|
+
let reExportingEntryFile;
|
|
20
|
+
const hasCompleteResult = () => isReferenced && (options.traverseEntries || reExportingEntryFile !== undefined);
|
|
18
21
|
const walkDown = (path, id, viaStar = false) => {
|
|
19
22
|
const isEntryFile = entryPaths.has(path);
|
|
20
|
-
|
|
23
|
+
if (isEntryFile && !reExportingEntryFile)
|
|
24
|
+
reExportingEntryFile = path;
|
|
25
|
+
if (hasCompleteResult())
|
|
26
|
+
return true;
|
|
21
27
|
if (seen.has(path))
|
|
22
|
-
return
|
|
28
|
+
return false;
|
|
23
29
|
seen.add(path);
|
|
24
30
|
const restIds = id.split('.');
|
|
25
31
|
const identifier = restIds.shift();
|
|
26
32
|
if (options.treatStarAtEntryAsReferenced && isEntryFile && viaStar && restIds.length > 0) {
|
|
27
|
-
|
|
33
|
+
isReferenced = true;
|
|
34
|
+
return hasCompleteResult();
|
|
28
35
|
}
|
|
29
36
|
const file = graph.get(path)?.importedBy;
|
|
30
37
|
if (!identifier || !file) {
|
|
31
|
-
return
|
|
38
|
+
return false;
|
|
32
39
|
}
|
|
33
40
|
const follow = (sources, nextId, nextViaStar = viaStar) => {
|
|
34
41
|
for (const byFilePath of sources) {
|
|
35
|
-
if (
|
|
36
|
-
continue;
|
|
37
|
-
const result = walkDown(byFilePath, nextId, nextViaStar);
|
|
38
|
-
if (result[1])
|
|
39
|
-
reExportingEntryFile = result[1];
|
|
40
|
-
if (result[0])
|
|
42
|
+
if (walkDown(byFilePath, nextId, nextViaStar))
|
|
41
43
|
return true;
|
|
42
44
|
}
|
|
43
45
|
return false;
|
|
44
46
|
};
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
(
|
|
48
|
-
|
|
47
|
+
if (!isReferenced) {
|
|
48
|
+
const hasDirectReference = (file.import.get(OPAQUE) && !hasOnlyNsRefs(file)) ||
|
|
49
|
+
((identifier === id || (identifier !== id && file.refs.has(id))) &&
|
|
50
|
+
(file.import.has(identifier) || file.importAs.has(identifier)));
|
|
51
|
+
if (hasDirectReference) {
|
|
52
|
+
isReferenced = true;
|
|
53
|
+
if (hasCompleteResult())
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
49
56
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
if (!isReferenced) {
|
|
58
|
+
aliasImports: for (const [exportId, aliases] of file.importAs) {
|
|
59
|
+
if (identifier === exportId) {
|
|
60
|
+
for (const alias of aliases.keys()) {
|
|
61
|
+
const aliasedRef = [alias, ...restIds].join('.');
|
|
62
|
+
if (file.refs.has(aliasedRef)) {
|
|
63
|
+
isReferenced = true;
|
|
64
|
+
break aliasImports;
|
|
65
|
+
}
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
}
|
|
69
|
+
if (hasCompleteResult())
|
|
70
|
+
return true;
|
|
59
71
|
}
|
|
60
72
|
for (const namespace of file.importNs.keys()) {
|
|
61
|
-
if (file.refs.has(`${namespace}.${id}`)) {
|
|
62
|
-
|
|
73
|
+
if (!isReferenced && file.refs.has(`${namespace}.${id}`)) {
|
|
74
|
+
isReferenced = true;
|
|
75
|
+
if (hasCompleteResult())
|
|
76
|
+
return true;
|
|
63
77
|
}
|
|
64
78
|
const nsAliasMap = getAliasReExportMap(file, namespace);
|
|
65
79
|
if (nsAliasMap) {
|
|
66
80
|
for (const [alias, sources] of nsAliasMap) {
|
|
67
81
|
if (follow(sources, `${alias}.${id}`))
|
|
68
|
-
return
|
|
82
|
+
return true;
|
|
69
83
|
}
|
|
70
84
|
}
|
|
71
85
|
const nsReExportSources = getNamespaceReExportSources(file, namespace);
|
|
72
86
|
if (nsReExportSources) {
|
|
73
87
|
if (follow(nsReExportSources, `${namespace}.${id}`))
|
|
74
|
-
return
|
|
88
|
+
return true;
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
if (isEntryFile && !options.traverseEntries)
|
|
78
|
-
return
|
|
92
|
+
return false;
|
|
79
93
|
const aliasMap = getAliasReExportMap(file, identifier);
|
|
80
94
|
if (aliasMap) {
|
|
81
95
|
for (const [alias, sources] of aliasMap) {
|
|
82
96
|
if (follow(sources, [alias, ...restIds].join('.')))
|
|
83
|
-
return
|
|
97
|
+
return true;
|
|
84
98
|
}
|
|
85
99
|
}
|
|
86
100
|
const directSources = getPassThroughReExportSources(file, identifier);
|
|
87
101
|
const starSources = getStarReExportSources(file);
|
|
88
102
|
if (directSources) {
|
|
89
103
|
if (follow(directSources, id))
|
|
90
|
-
return
|
|
104
|
+
return true;
|
|
91
105
|
}
|
|
92
106
|
else if (starSources) {
|
|
93
107
|
if (follow(starSources, id, true))
|
|
94
|
-
return
|
|
108
|
+
return true;
|
|
95
109
|
}
|
|
96
110
|
for (const [namespace, sources] of file.reExportNs) {
|
|
97
|
-
if (follow(sources, `${namespace}.${id}`, true))
|
|
98
|
-
return
|
|
99
|
-
}
|
|
111
|
+
if (follow(sources, `${namespace}.${id}`, true))
|
|
112
|
+
return true;
|
|
100
113
|
}
|
|
101
|
-
return
|
|
114
|
+
return false;
|
|
102
115
|
};
|
|
103
|
-
|
|
116
|
+
walkDown(filePath, id);
|
|
117
|
+
return [isReferenced, reExportingEntryFile];
|
|
104
118
|
};
|
package/dist/manifest/index.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ type Options = {
|
|
|
4
4
|
dir: string;
|
|
5
5
|
cwd: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
declare const getMetaDataFromPackageJson: ({ cwd, dir, packageNames }: Options) => {
|
|
8
8
|
hostDependencies: HostDependencies;
|
|
9
9
|
installedBinaries: InstalledBinaries;
|
|
10
10
|
hasTypesIncluded: Set<string>;
|
|
11
11
|
};
|
|
12
|
+
export declare const getDependencyMetaData: typeof getMetaDataFromPackageJson;
|
|
12
13
|
export {};
|
|
@@ -84,6 +84,9 @@ const entriesByOption = (opts) => new Map(Object.entries({
|
|
|
84
84
|
scripts: 'scripts' in opts && opts.scripts && Array.isArray(opts.scripts)
|
|
85
85
|
? opts.scripts.map(scriptStringOrObject => typeof scriptStringOrObject === 'string' ? scriptStringOrObject : scriptStringOrObject.input)
|
|
86
86
|
: [],
|
|
87
|
+
styles: 'styles' in opts && opts.styles && Array.isArray(opts.styles)
|
|
88
|
+
? opts.styles.map(styleStringOrObject => typeof styleStringOrObject === 'string' ? styleStringOrObject : styleStringOrObject.input)
|
|
89
|
+
: [],
|
|
87
90
|
polyfills: 'polyfills' in opts && opts.polyfills
|
|
88
91
|
? Array.isArray(opts.polyfills)
|
|
89
92
|
? opts.polyfills
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
export declare const resolveName: (identifier: string, namespace: 'preset' | 'plugin') => string;
|
|
2
|
+
declare const cacheFn: {
|
|
3
|
+
(): undefined;
|
|
4
|
+
forever: () => any;
|
|
5
|
+
never: () => any;
|
|
6
|
+
using: () => any;
|
|
7
|
+
invalidate: () => any;
|
|
8
|
+
};
|
|
2
9
|
export declare const api: {
|
|
3
10
|
assertVersion: () => boolean;
|
|
4
|
-
cache:
|
|
5
|
-
(): undefined;
|
|
6
|
-
forever: () => any;
|
|
7
|
-
never: () => any;
|
|
8
|
-
using: () => any;
|
|
9
|
-
invalidate: () => any;
|
|
10
|
-
};
|
|
11
|
+
cache: typeof cacheFn;
|
|
11
12
|
caller: () => boolean;
|
|
12
13
|
env: (env?: string) => "development" | true;
|
|
13
14
|
version: string;
|
|
14
15
|
};
|
|
16
|
+
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
1
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
4
|
const title = 'Convex';
|
|
3
5
|
const enablers = ['convex'];
|
|
4
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
-
const
|
|
7
|
+
const config = ['convex.json'];
|
|
8
|
+
const production = ['convex/**/*.@(js|ts)'];
|
|
9
|
+
const resolveConfig = localConfig => {
|
|
10
|
+
const functionsDir = typeof localConfig.functions === 'string' ? localConfig.functions : 'convex';
|
|
11
|
+
return [toProductionEntry(join(functionsDir, '**/*.@(js|ts)'))];
|
|
12
|
+
};
|
|
6
13
|
const plugin = {
|
|
7
14
|
title,
|
|
8
15
|
enablers,
|
|
9
16
|
isEnabled,
|
|
10
|
-
|
|
17
|
+
config,
|
|
18
|
+
production,
|
|
19
|
+
resolveConfig,
|
|
11
20
|
};
|
|
12
21
|
export default plugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,8 +17,9 @@ export const getActionDependencies = (config, options) => {
|
|
|
17
17
|
const scripts = [runs.pre, runs.main, runs.post].filter(isString);
|
|
18
18
|
return scripts.map(script => join(configFileDir, script));
|
|
19
19
|
};
|
|
20
|
+
const ACTION_PATH_VAR = /\$\{\{\s*github\.action_path\s*\}\}|\$\{GITHUB_ACTION_PATH\}|\$GITHUB_ACTION_PATH/g;
|
|
20
21
|
const resolveConfig = async (config, options) => {
|
|
21
|
-
const { rootCwd, getInputsFromScripts, isProduction, getManifest } = options;
|
|
22
|
+
const { rootCwd, getInputsFromScripts, isProduction, getManifest, configFileDir } = options;
|
|
22
23
|
const inputs = new Set();
|
|
23
24
|
const jobs = findByKeyDeep(config, 'steps');
|
|
24
25
|
for (const steps of jobs) {
|
|
@@ -31,7 +32,9 @@ const resolveConfig = async (config, options) => {
|
|
|
31
32
|
const dir = join(rootCwd, path && workingDir ? relative(workingDir, path) : workingDir ? workingDir : '.');
|
|
32
33
|
if (step.run) {
|
|
33
34
|
const manifest = getManifest(dir) ?? options.manifest;
|
|
34
|
-
|
|
35
|
+
const actionPath = relative(dir, configFileDir);
|
|
36
|
+
const run = step.run.replace(ACTION_PATH_VAR, actionPath ? `./${actionPath}` : '.');
|
|
37
|
+
for (const input of getInputsFromScripts([run], { knownBinsOnly: true, manifest })) {
|
|
35
38
|
if (isDeferResolveEntry(input) && path && !workingDir) {
|
|
36
39
|
input.specifier = relative(join(dir, path), join(rootCwd, input.specifier));
|
|
37
40
|
}
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ export declare const Plugins: {
|
|
|
87
87
|
nyc: import("../types/config.ts").Plugin;
|
|
88
88
|
oclif: import("../types/config.ts").Plugin;
|
|
89
89
|
'openapi-ts': import("../types/config.ts").Plugin;
|
|
90
|
+
openclaw: import("../types/config.ts").Plugin;
|
|
90
91
|
orval: import("../types/config.ts").Plugin;
|
|
91
92
|
oxfmt: import("../types/config.ts").Plugin;
|
|
92
93
|
oxlint: import("../types/config.ts").Plugin;
|
package/dist/plugins/index.js
CHANGED
|
@@ -81,6 +81,7 @@ import { default as nx } from './nx/index.js';
|
|
|
81
81
|
import { default as nyc } from './nyc/index.js';
|
|
82
82
|
import { default as oclif } from './oclif/index.js';
|
|
83
83
|
import { default as openapiTs } from './openapi-ts/index.js';
|
|
84
|
+
import { default as openclaw } from './openclaw/index.js';
|
|
84
85
|
import { default as orval } from './orval/index.js';
|
|
85
86
|
import { default as oxfmt } from './oxfmt/index.js';
|
|
86
87
|
import { default as oxlint } from './oxlint/index.js';
|
|
@@ -259,6 +260,7 @@ export const Plugins = {
|
|
|
259
260
|
nyc,
|
|
260
261
|
oclif,
|
|
261
262
|
'openapi-ts': openapiTs,
|
|
263
|
+
openclaw,
|
|
262
264
|
orval,
|
|
263
265
|
oxfmt,
|
|
264
266
|
oxlint,
|
|
@@ -2,19 +2,40 @@ import { toDependency } from '../../util/input.js';
|
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
import { getArgumentValues } from './helpers.js';
|
|
4
4
|
const title = 'markdownlint';
|
|
5
|
-
const enablers = ['markdownlint-cli'];
|
|
5
|
+
const enablers = ['markdownlint-cli', 'markdownlint-cli2'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
-
const
|
|
7
|
+
const isBundled = (specifier) => specifier.startsWith('markdownlint/style/') || specifier === 'markdownlint-cli2-formatter-default';
|
|
8
|
+
const config = ['.markdownlint-cli2.{jsonc,yaml,cjs,mjs}', '.markdownlint.{json,jsonc,yaml,yml,cjs,mjs}'];
|
|
8
9
|
const resolveConfig = (config, options) => {
|
|
9
10
|
const { manifest } = options;
|
|
10
|
-
const
|
|
11
|
+
const dependencies = [];
|
|
12
|
+
for (const extend of [config?.extends, config?.config?.extends]) {
|
|
13
|
+
if (extend)
|
|
14
|
+
dependencies.push(extend);
|
|
15
|
+
}
|
|
16
|
+
for (const customRule of config?.customRules ?? []) {
|
|
17
|
+
if (typeof customRule === 'string')
|
|
18
|
+
dependencies.push(customRule);
|
|
19
|
+
else if (Array.isArray(customRule)) {
|
|
20
|
+
for (const rule of customRule) {
|
|
21
|
+
if (typeof rule === 'string')
|
|
22
|
+
dependencies.push(rule);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
for (const modules of [config?.markdownItPlugins, config?.outputFormatters]) {
|
|
27
|
+
for (const module of modules ?? []) {
|
|
28
|
+
if (Array.isArray(module) && typeof module[0] === 'string')
|
|
29
|
+
dependencies.push(module[0]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
11
32
|
const scripts = manifest?.scripts
|
|
12
33
|
? Object.values(manifest.scripts).filter((script) => typeof script === 'string')
|
|
13
34
|
: [];
|
|
14
35
|
const uses = scripts
|
|
15
|
-
.filter(script => script.includes('markdownlint '))
|
|
36
|
+
.filter(script => script.includes('markdownlint ') || script.includes('markdownlint-cli2 '))
|
|
16
37
|
.flatMap(script => getArgumentValues(script, / (--rules|-r)[ =]([^ ]+)/g));
|
|
17
|
-
return [...
|
|
38
|
+
return [...dependencies, ...uses].filter(id => !isBundled(id)).map(id => toDependency(id));
|
|
18
39
|
};
|
|
19
40
|
const plugin = {
|
|
20
41
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDependency, toProductionEntry } from '../../util/input.js';
|
|
1
|
+
import { toDependency, toIgnore, toProductionEntry } from '../../util/input.js';
|
|
2
2
|
import { join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Nitro';
|
|
@@ -22,6 +22,7 @@ const setup = async () => {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
const resolve = () => [toIgnore('^#nitro-internal-', 'unresolved')];
|
|
25
26
|
const resolveConfig = async (localConfig) => {
|
|
26
27
|
const srcDir = localConfig.srcDir ?? '.';
|
|
27
28
|
const patterns = [
|
|
@@ -53,6 +54,7 @@ const plugin = {
|
|
|
53
54
|
config,
|
|
54
55
|
production,
|
|
55
56
|
setup,
|
|
57
|
+
resolve,
|
|
56
58
|
resolveConfig,
|
|
57
59
|
};
|
|
58
60
|
export default plugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isDirectory } from '../../util/fs.js';
|
|
2
2
|
import { _syncGlob } from '../../util/glob.js';
|
|
3
|
-
import { toAlias, toConfig, toDeferResolveProductionEntry, toDependency, toEntry, toIgnore, toProductionEntry, } from '../../util/input.js';
|
|
3
|
+
import { toAlias, toConfig, toDeferResolveProductionEntry, toDependency, toEntry, toIgnore, toProductionDependency, toProductionEntry, } from '../../util/input.js';
|
|
4
4
|
import { loadTSConfig } from '../../util/load-tsconfig.js';
|
|
5
|
-
import { join } from '../../util/path.js';
|
|
5
|
+
import { isInternal, join, toAbsolute } from '../../util/path.js';
|
|
6
6
|
import { hasDependency } from '../../util/plugin.js';
|
|
7
7
|
import { buildAutoImportMap, collectLocalImportPaths, createAutoImportMaps, createTsCompiler, createVueCompiler, readAndParseFile, } from '../_vue/auto-import.js';
|
|
8
8
|
const title = 'Nuxt';
|
|
@@ -35,6 +35,13 @@ const setup = async () => {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
const resolve = () => [
|
|
39
|
+
toIgnore('^#build/', 'unresolved'),
|
|
40
|
+
toIgnore('#components', 'unresolved'),
|
|
41
|
+
toIgnore('#imports', 'unresolved'),
|
|
42
|
+
toIgnore('^#internal/', 'unresolved'),
|
|
43
|
+
toIgnore('#spa-template', 'unresolved'),
|
|
44
|
+
];
|
|
38
45
|
const resolveAlias = (specifier, srcDir, rootDir) => {
|
|
39
46
|
if (specifier.startsWith('~~/') || specifier.startsWith('@@/'))
|
|
40
47
|
return join(rootDir, specifier.slice(3));
|
|
@@ -80,14 +87,18 @@ const registerCompilers = async ({ cwd, hasDependency, registerCompiler }) => {
|
|
|
80
87
|
const resolveConfig = async (localConfig, options) => {
|
|
81
88
|
const { configFileDir: cwd } = options;
|
|
82
89
|
const hasAppDir = isDirectory(cwd, 'app');
|
|
83
|
-
const srcDir = localConfig.srcDir ?? (hasAppDir ? join(cwd, 'app') : cwd);
|
|
90
|
+
const srcDir = toAbsolute(localConfig.srcDir ?? (hasAppDir ? join(cwd, 'app') : cwd), cwd);
|
|
84
91
|
const serverDir = localConfig.serverDir ?? 'server';
|
|
85
92
|
const inputs = [];
|
|
93
|
+
const addModule = (id) => {
|
|
94
|
+
const specifier = resolveAlias(id, srcDir, cwd);
|
|
95
|
+
inputs.push(isInternal(specifier) ? toDeferResolveProductionEntry(specifier) : toProductionDependency(specifier));
|
|
96
|
+
};
|
|
86
97
|
for (const id of localConfig.modules ?? []) {
|
|
87
98
|
if (Array.isArray(id) && typeof id[0] === 'string')
|
|
88
|
-
|
|
99
|
+
addModule(id[0]);
|
|
89
100
|
if (typeof id === 'string')
|
|
90
|
-
|
|
101
|
+
addModule(id);
|
|
91
102
|
}
|
|
92
103
|
addAppEntries(inputs, srcDir, serverDir, localConfig, cwd);
|
|
93
104
|
const aliases = localConfig.alias;
|
|
@@ -101,7 +112,8 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
101
112
|
}
|
|
102
113
|
}
|
|
103
114
|
for (const ext of localConfig.extends ?? []) {
|
|
104
|
-
const
|
|
115
|
+
const target = resolveAlias(ext, srcDir, cwd);
|
|
116
|
+
const resolved = isInternal(target) ? toAbsolute(target, cwd) : target;
|
|
105
117
|
const configs = _syncGlob({ cwd: resolved, patterns: config });
|
|
106
118
|
if (configs.length > 0)
|
|
107
119
|
for (const cfg of configs)
|
|
@@ -129,8 +141,6 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
129
141
|
inputs.push(toAlias(key, paths[key], { dir }));
|
|
130
142
|
}
|
|
131
143
|
}
|
|
132
|
-
inputs.push(toIgnore('#imports', 'unresolved'));
|
|
133
|
-
inputs.push(toIgnore('#components', 'unresolved'));
|
|
134
144
|
return inputs;
|
|
135
145
|
};
|
|
136
146
|
const plugin = {
|
|
@@ -141,6 +151,7 @@ const plugin = {
|
|
|
141
151
|
entry,
|
|
142
152
|
production,
|
|
143
153
|
setup,
|
|
154
|
+
resolve,
|
|
144
155
|
resolveConfig,
|
|
145
156
|
registerCompilers,
|
|
146
157
|
};
|