knip 6.27.0 → 6.29.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.
Files changed (67) hide show
  1. package/dist/ConfigurationChief.d.ts +6 -0
  2. package/dist/DependencyDeputy.js +1 -1
  3. package/dist/WorkspaceWorker.js +9 -0
  4. package/dist/compilers/compilers.d.ts +1 -0
  5. package/dist/compilers/compilers.js +10 -0
  6. package/dist/compilers/index.d.ts +10 -0
  7. package/dist/compilers/index.js +2 -0
  8. package/dist/compilers/mdx.d.ts +2 -1
  9. package/dist/compilers/tsrx.d.ts +5 -0
  10. package/dist/compilers/tsrx.js +3 -0
  11. package/dist/constants.js +14 -0
  12. package/dist/graph/analyze.js +6 -4
  13. package/dist/graph-explorer/explorer.d.ts +1 -1
  14. package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
  15. package/dist/graph-explorer/operations/is-referenced.js +47 -33
  16. package/dist/manifest/index.d.ts +2 -1
  17. package/dist/plugins/angular/index.js +3 -0
  18. package/dist/plugins/babel/helpers.d.ts +9 -7
  19. package/dist/plugins/convex/index.js +11 -2
  20. package/dist/plugins/convex/types.d.ts +3 -0
  21. package/dist/plugins/convex/types.js +1 -0
  22. package/dist/plugins/github-actions/index.js +5 -2
  23. package/dist/plugins/index.d.ts +1 -0
  24. package/dist/plugins/index.js +2 -0
  25. package/dist/plugins/markdownlint/index.js +26 -5
  26. package/dist/plugins/markdownlint/types.d.ts +6 -0
  27. package/dist/plugins/nitro/index.js +3 -1
  28. package/dist/plugins/nuxt/index.js +19 -8
  29. package/dist/plugins/openclaw/index.d.ts +3 -0
  30. package/dist/plugins/openclaw/index.js +52 -0
  31. package/dist/plugins/openclaw/types.d.ts +25 -0
  32. package/dist/plugins/openclaw/types.js +1 -0
  33. package/dist/plugins/prettier/index.js +1 -1
  34. package/dist/plugins/tailwind/index.js +8 -0
  35. package/dist/plugins/tsdown/index.js +43 -0
  36. package/dist/plugins/typescript/index.js +1 -1
  37. package/dist/reporters/util/configuration-hints.js +3 -1
  38. package/dist/schema/configuration.d.ts +15 -0
  39. package/dist/schema/plugins.d.ts +5 -0
  40. package/dist/schema/plugins.js +1 -0
  41. package/dist/types/PluginNames.d.ts +2 -2
  42. package/dist/types/PluginNames.js +1 -0
  43. package/dist/types/issues.d.ts +1 -1
  44. package/dist/typescript/ast-nodes.d.ts +3 -1
  45. package/dist/typescript/comments.d.ts +1 -1
  46. package/dist/typescript/comments.js +71 -5
  47. package/dist/typescript/get-imports-and-exports.d.ts +3 -1
  48. package/dist/typescript/get-imports-and-exports.js +1 -1
  49. package/dist/typescript/visitors/walk.d.ts +1 -0
  50. package/dist/typescript/visitors/walk.js +14 -1
  51. package/dist/util/Performance.js +1 -1
  52. package/dist/util/codeowners.js +1 -1
  53. package/dist/util/create-options.d.ts +10 -0
  54. package/dist/util/glob-cache.d.ts +7 -1
  55. package/dist/util/glob-cache.js +52 -29
  56. package/dist/util/glob-core.d.ts +2 -0
  57. package/dist/util/glob-core.js +52 -7
  58. package/dist/util/glob.d.ts +6 -3
  59. package/dist/util/glob.js +23 -9
  60. package/dist/util/loader.d.ts +3 -1
  61. package/dist/util/parse-and-convert-gitignores.d.ts +2 -2
  62. package/dist/util/parse-and-convert-gitignores.js +4 -4
  63. package/dist/util/reporter.js +4 -3
  64. package/dist/version.d.ts +1 -1
  65. package/dist/version.js +1 -1
  66. package/package.json +11 -11
  67. 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;
@@ -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;
@@ -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
  }
@@ -6,6 +6,7 @@ export declare const styleExtractor: RegExp;
6
6
  export declare const blockCommentMatcher: RegExp;
7
7
  export declare const lineCommentMatcher: RegExp;
8
8
  export declare const importMatcher: RegExp;
9
+ export declare const collectImports: CompilerSync;
9
10
  export declare const importsWithinScripts: CompilerSync;
10
11
  export declare const scriptBodies: CompilerSync;
11
12
  export declare const getStyleLang: (attrs: string) => string | undefined;
@@ -6,6 +6,16 @@ const langAttrMatcher = /\blang\s*=\s*["']([^"']+)["']/i;
6
6
  export const blockCommentMatcher = /\/\*[\s\S]*?\*\//g;
7
7
  export const lineCommentMatcher = /^[ \t]*\/\/.*$/gm;
8
8
  export const importMatcher = /import(?:\s*\(\s*['"][^'"]+['"][^)]*\)|(?!\s*\()[^'"]+['"][^'"]+['"])/g;
9
+ export const collectImports = text => {
10
+ if (!text.includes('import'))
11
+ return '';
12
+ const imports = [];
13
+ importMatcher.lastIndex = 0;
14
+ let match;
15
+ while ((match = importMatcher.exec(text)))
16
+ imports.push(match[0]);
17
+ return imports.join('\n');
18
+ };
9
19
  export const importsWithinScripts = (text) => {
10
20
  const scripts = [];
11
21
  scriptExtractor.lastIndex = 0;
@@ -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;
@@ -2,6 +2,7 @@ import LESS from './less.js';
2
2
  import MDX from './mdx.js';
3
3
  import SCSS from './scss.js';
4
4
  import STYLUS from './stylus.js';
5
+ import TSRX from './tsrx.js';
5
6
  const isAsyncCompiler = (fn) => (fn ? fn.constructor.name === 'AsyncFunction' : false);
6
7
  export const normalizeCompilerExtension = (ext) => ext.replace(/^\.*/, '.');
7
8
  export const partitionCompilers = (rawLocalConfig) => {
@@ -33,6 +34,7 @@ const compilers = [
33
34
  { extensions: ['.sass', '.scss'], ...SCSS },
34
35
  { extensions: ['.less'], ...LESS },
35
36
  { extensions: ['.styl', '.stylus'], ...STYLUS },
37
+ { extensions: ['.tsrx'], ...TSRX },
36
38
  ];
37
39
  export const getIncludedCompilers = (syncCompilers, asyncCompilers, dependencies, onReferencedDependency) => {
38
40
  for (const { extensions, dependencies: compilerDependencies, compiler } of compilers) {
@@ -1,5 +1,6 @@
1
+ declare const compiler: (text: string) => string;
1
2
  declare const _default: {
2
3
  dependencies: string[];
3
- compiler: (text: string) => string;
4
+ compiler: typeof compiler;
4
5
  };
5
6
  export default _default;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ dependencies: string[];
3
+ compiler: import("./types.ts").CompilerSync;
4
+ };
5
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { collectImports } from './compilers.js';
2
+ const dependencies = ['@tsrx/core', '@tsrx/react', '@tsrx/preact', '@tsrx/vue', '@tsrx/solid', '@tsrx/ripple'];
3
+ export default { dependencies, compiler: collectImports };
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']);
@@ -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 && !isReferenced) {
93
+ if (reExportingEntryFile) {
94
94
  if (!isIncludeEntryExports) {
95
95
  continue;
96
96
  }
97
- const reExportedItem = graph.get(reExportingEntryFile)?.exports.get(identifier);
98
- if (reExportedItem && shouldIgnore(reExportedItem.jsDocTags))
99
- continue;
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
- }) => [boolean, string | undefined];
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
- }) => [boolean, string | undefined];
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
- let reExportingEntryFile = isEntryFile ? path : undefined;
23
+ if (isEntryFile && !reExportingEntryFile)
24
+ reExportingEntryFile = path;
25
+ if (hasCompleteResult())
26
+ return true;
21
27
  if (seen.has(path))
22
- return [false, reExportingEntryFile];
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
- return [true, reExportingEntryFile];
33
+ isReferenced = true;
34
+ return hasCompleteResult();
28
35
  }
29
36
  const file = graph.get(path)?.importedBy;
30
37
  if (!identifier || !file) {
31
- return [false, reExportingEntryFile];
38
+ return false;
32
39
  }
33
40
  const follow = (sources, nextId, nextViaStar = viaStar) => {
34
41
  for (const byFilePath of sources) {
35
- if (seen.has(byFilePath))
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 ((file.import.get(OPAQUE) && !hasOnlyNsRefs(file)) ||
46
- ((identifier === id || (identifier !== id && file.refs.has(id))) &&
47
- (file.import.has(identifier) || file.importAs.has(identifier)))) {
48
- return [true, reExportingEntryFile];
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
- for (const [exportId, aliases] of file.importAs) {
51
- if (identifier === exportId) {
52
- for (const alias of aliases.keys()) {
53
- const aliasedRef = [alias, ...restIds].join('.');
54
- if (file.refs.has(aliasedRef)) {
55
- return [true, reExportingEntryFile];
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
- return [true, reExportingEntryFile];
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 [true, reExportingEntryFile];
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 [true, reExportingEntryFile];
88
+ return true;
75
89
  }
76
90
  }
77
91
  if (isEntryFile && !options.traverseEntries)
78
- return [false, reExportingEntryFile];
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 [true, reExportingEntryFile];
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 [true, reExportingEntryFile];
104
+ return true;
91
105
  }
92
106
  else if (starSources) {
93
107
  if (follow(starSources, id, true))
94
- return [true, reExportingEntryFile];
108
+ return true;
95
109
  }
96
110
  for (const [namespace, sources] of file.reExportNs) {
97
- if (follow(sources, `${namespace}.${id}`, true)) {
98
- return [true, reExportingEntryFile];
99
- }
111
+ if (follow(sources, `${namespace}.${id}`, true))
112
+ return true;
100
113
  }
101
- return [false, reExportingEntryFile];
114
+ return false;
102
115
  };
103
- return walkDown(filePath, id);
116
+ walkDown(filePath, id);
117
+ return [isReferenced, reExportingEntryFile];
104
118
  };
@@ -4,9 +4,10 @@ type Options = {
4
4
  dir: string;
5
5
  cwd: string;
6
6
  };
7
- export declare const getDependencyMetaData: ({ cwd, dir, packageNames }: Options) => {
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 entry = ['convex/*.config.@(js|ts)', 'convex/**/_generated/*.@(js|ts)'];
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
- entry,
17
+ config,
18
+ production,
19
+ resolveConfig,
11
20
  };
12
21
  export default plugin;
@@ -0,0 +1,3 @@
1
+ export interface ConvexConfig {
2
+ functions?: string;
3
+ }
@@ -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
- for (const input of getInputsFromScripts([step.run], { knownBinsOnly: true, manifest })) {
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
  }
@@ -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;
@@ -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 config = ['.markdownlint.{json,jsonc}', '.markdownlint.{yml,yaml}'];
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 extend = config?.extends ? [config.extends] : [];
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 [...extend, ...uses].map(id => toDependency(id));
38
+ return [...dependencies, ...uses].filter(id => !isBundled(id)).map(id => toDependency(id));
18
39
  };
19
40
  const plugin = {
20
41
  title,
@@ -1,3 +1,9 @@
1
1
  export type MarkdownlintConfig = {
2
+ config?: {
3
+ extends?: string;
4
+ };
5
+ customRules?: unknown[];
2
6
  extends?: string;
7
+ markdownItPlugins?: unknown[];
8
+ outputFormatters?: unknown[];
3
9
  };
@@ -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;