knip 6.26.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.
Files changed (96) hide show
  1. package/dist/ConfigurationChief.d.ts +12 -0
  2. package/dist/DependencyDeputy.d.ts +1 -1
  3. package/dist/DependencyDeputy.js +3 -3
  4. package/dist/ProjectPrincipal.d.ts +3 -3
  5. package/dist/ProjectPrincipal.js +4 -4
  6. package/dist/WorkspaceWorker.js +9 -0
  7. package/dist/binaries/fallback.js +5 -1
  8. package/dist/binaries/resolvers/bun.js +13 -5
  9. package/dist/binaries/resolvers/npm.js +4 -2
  10. package/dist/binaries/resolvers/pnpm.js +11 -1
  11. package/dist/binaries/resolvers/yarn.js +10 -4
  12. package/dist/binaries/util.d.ts +4 -0
  13. package/dist/binaries/util.js +14 -0
  14. package/dist/compilers/index.d.ts +20 -0
  15. package/dist/compilers/less.js +1 -1
  16. package/dist/compilers/mdx.d.ts +2 -1
  17. package/dist/compilers/scss.js +1 -1
  18. package/dist/compilers/stylus.js +1 -1
  19. package/dist/constants.js +20 -0
  20. package/dist/graph/analyze.js +7 -5
  21. package/dist/graph/build.js +16 -4
  22. package/dist/graph-explorer/explorer.d.ts +1 -1
  23. package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
  24. package/dist/graph-explorer/operations/is-referenced.js +47 -33
  25. package/dist/manifest/index.d.ts +2 -1
  26. package/dist/plugins/_vue/auto-import.js +64 -4
  27. package/dist/plugins/_vue/types.d.ts +18 -11
  28. package/dist/plugins/angular/index.js +3 -0
  29. package/dist/plugins/babel/helpers.d.ts +9 -7
  30. package/dist/plugins/convex/index.js +11 -2
  31. package/dist/plugins/convex/types.d.ts +3 -0
  32. package/dist/plugins/convex/types.js +1 -0
  33. package/dist/plugins/github-actions/index.js +5 -2
  34. package/dist/plugins/index.d.ts +2 -0
  35. package/dist/plugins/index.js +4 -0
  36. package/dist/plugins/markdownlint/index.js +26 -5
  37. package/dist/plugins/markdownlint/types.d.ts +6 -0
  38. package/dist/plugins/nitro/index.js +3 -1
  39. package/dist/plugins/nuxt/index.js +19 -8
  40. package/dist/plugins/openclaw/index.d.ts +3 -0
  41. package/dist/plugins/openclaw/index.js +52 -0
  42. package/dist/plugins/openclaw/types.d.ts +25 -0
  43. package/dist/plugins/openclaw/types.js +1 -0
  44. package/dist/plugins/prettier/index.js +1 -1
  45. package/dist/plugins/react-email/index.js +1 -0
  46. package/dist/plugins/tailwind/compiler.js +9 -4
  47. package/dist/plugins/tailwind/index.js +8 -0
  48. package/dist/plugins/tanstack-router/index.js +3 -1
  49. package/dist/plugins/temporal/index.d.ts +3 -0
  50. package/dist/plugins/temporal/index.js +12 -0
  51. package/dist/plugins/tsdown/index.js +58 -3
  52. package/dist/plugins/tsdown/types.d.ts +4 -1
  53. package/dist/plugins/typescript/index.js +1 -1
  54. package/dist/plugins/vitest/index.js +15 -0
  55. package/dist/plugins/vitest/types.d.ts +5 -0
  56. package/dist/reporters/util/configuration-hints.js +3 -1
  57. package/dist/run.js +3 -3
  58. package/dist/schema/configuration.d.ts +30 -0
  59. package/dist/schema/plugins.d.ts +10 -0
  60. package/dist/schema/plugins.js +2 -0
  61. package/dist/types/PluginNames.d.ts +2 -2
  62. package/dist/types/PluginNames.js +2 -0
  63. package/dist/types/config.d.ts +1 -0
  64. package/dist/types/issues.d.ts +1 -1
  65. package/dist/typescript/ast-nodes.d.ts +4 -1
  66. package/dist/typescript/comments.d.ts +1 -1
  67. package/dist/typescript/comments.js +71 -5
  68. package/dist/typescript/get-imports-and-exports.d.ts +3 -1
  69. package/dist/typescript/get-imports-and-exports.js +9 -6
  70. package/dist/typescript/resolve-module-names.d.ts +2 -2
  71. package/dist/typescript/resolve-module-names.js +97 -18
  72. package/dist/typescript/visitors/walk.d.ts +3 -1
  73. package/dist/typescript/visitors/walk.js +27 -3
  74. package/dist/util/codeowners.js +1 -1
  75. package/dist/util/create-input-handler.js +8 -1
  76. package/dist/util/create-options.d.ts +20 -0
  77. package/dist/util/glob-cache.d.ts +7 -1
  78. package/dist/util/glob-cache.js +52 -29
  79. package/dist/util/glob-core.d.ts +2 -0
  80. package/dist/util/glob-core.js +46 -6
  81. package/dist/util/glob.d.ts +6 -3
  82. package/dist/util/glob.js +23 -9
  83. package/dist/util/loader.d.ts +3 -1
  84. package/dist/util/package-json.d.ts +7 -0
  85. package/dist/util/package-json.js +37 -0
  86. package/dist/util/parse-and-convert-gitignores.d.ts +2 -2
  87. package/dist/util/parse-and-convert-gitignores.js +4 -4
  88. package/dist/util/reporter.js +4 -3
  89. package/dist/util/resolve.d.ts +1 -0
  90. package/dist/util/resolve.js +1 -1
  91. package/dist/util/to-source-path.d.ts +4 -3
  92. package/dist/util/to-source-path.js +22 -5
  93. package/dist/version.d.ts +1 -1
  94. package/dist/version.js +1 -1
  95. package/package.json +11 -11
  96. package/schema.json +8 -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;
@@ -757,6 +762,11 @@ export declare class ConfigurationChief {
757
762
  entry?: string | string[] | undefined;
758
763
  project?: string | string[] | undefined;
759
764
  } | undefined;
765
+ temporal?: string | boolean | string[] | {
766
+ config?: string | string[] | undefined;
767
+ entry?: string | string[] | undefined;
768
+ project?: string | string[] | undefined;
769
+ } | undefined;
760
770
  travis?: string | boolean | string[] | {
761
771
  config?: string | string[] | undefined;
762
772
  entry?: string | string[] | undefined;
@@ -1047,6 +1057,7 @@ export declare class ConfigurationChief {
1047
1057
  nyc?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1048
1058
  oclif?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1049
1059
  "openapi-ts"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1060
+ openclaw?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1050
1061
  orval?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1051
1062
  oxfmt?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1052
1063
  oxlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -1104,6 +1115,7 @@ export declare class ConfigurationChief {
1104
1115
  "tanstack-router"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1105
1116
  taskfile?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1106
1117
  tauri?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1118
+ temporal?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1107
1119
  travis?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1108
1120
  "ts-node"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1109
1121
  tsdown?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -58,7 +58,7 @@ export declare class DependencyDeputy {
58
58
  isPeerOptional: boolean;
59
59
  }[];
60
60
  getOptionalPeerDependencies(workspaceName: string): DependencySet;
61
- maybeAddReferencedExternalDependency(workspace: Workspace, packageName: string, isDevOnly?: boolean, isTypeOnly?: boolean): boolean;
61
+ maybeAddReferencedExternalDependency(workspace: Workspace, packageName: string, isDevOnly?: boolean, isTypeOnly?: boolean, isResolved?: boolean): boolean;
62
62
  maybeAddReferencedBinary(workspace: Workspace, binaryName: string): Set<string> | undefined;
63
63
  private isInDependencies;
64
64
  settleDependencyIssues(): {
@@ -122,10 +122,10 @@ export class DependencyDeputy {
122
122
  getOptionalPeerDependencies(workspaceName) {
123
123
  return this._manifests.get(workspaceName)?.optionalPeerDependencies ?? new Set();
124
124
  }
125
- maybeAddReferencedExternalDependency(workspace, packageName, isDevOnly, isTypeOnly) {
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;
@@ -150,7 +150,7 @@ export class DependencyDeputy {
150
150
  this.addReferencedDependency(workspace.name, packageName);
151
151
  return true;
152
152
  }
153
- if (!this.isStrict) {
153
+ if (!this.isStrict && isResolved !== false) {
154
154
  for (const name of workspaceNames) {
155
155
  const hosts = this.getHostDependenciesFor(name, packageName);
156
156
  if (hosts.length === 0)
@@ -7,7 +7,7 @@ import type { Paths } from './types/project.ts';
7
7
  import type { ResolveGlobPattern } from './typescript/resolve-module-names.ts';
8
8
  import { SourceFileManager } from './typescript/SourceFileManager.ts';
9
9
  import type { MainOptions } from './util/create-options.ts';
10
- import type { ToSourceFilePath, WorkspaceManifestHandler } from './util/to-source-path.ts';
10
+ import type { ToSourceFilePath, WorkspacePackageTargetHandler } from './util/to-source-path.ts';
11
11
  export declare class ProjectPrincipal {
12
12
  entryPaths: Set<string>;
13
13
  projectPaths: Set<string>;
@@ -25,14 +25,14 @@ export declare class ProjectPrincipal {
25
25
  private extensions;
26
26
  cache: CacheConsultant<FileNode>;
27
27
  toSourceFilePath: ToSourceFilePath;
28
- private findWorkspaceManifestImports;
28
+ private findWorkspacePackageTarget;
29
29
  fileManager: SourceFileManager;
30
30
  private resolveModule;
31
31
  resolveGlobPattern: ResolveGlobPattern;
32
32
  resolvedFiles: Set<string>;
33
33
  deletedFiles: Set<string>;
34
34
  private onPathAdded;
35
- constructor(options: MainOptions, toSourceFilePath: ToSourceFilePath, findWorkspaceManifestImports?: WorkspaceManifestHandler);
35
+ constructor(options: MainOptions, toSourceFilePath: ToSourceFilePath, findWorkspacePackageTarget?: WorkspacePackageTargetHandler);
36
36
  addCompilers(compilers: [SyncCompilers, AsyncCompilers]): void;
37
37
  addPaths(paths: Paths, basePath: string, scope: string): void;
38
38
  addRootDirs(rootDirs: string[] | undefined, scope: string): void;
@@ -35,17 +35,17 @@ export class ProjectPrincipal {
35
35
  extensions = new Set(DEFAULT_EXTENSIONS);
36
36
  cache;
37
37
  toSourceFilePath;
38
- findWorkspaceManifestImports;
38
+ findWorkspacePackageTarget;
39
39
  fileManager;
40
40
  resolveModule = () => undefined;
41
41
  resolveGlobPattern = pattern => [pattern];
42
42
  resolvedFiles = new Set();
43
43
  deletedFiles = new Set();
44
44
  onPathAdded;
45
- constructor(options, toSourceFilePath, findWorkspaceManifestImports) {
45
+ constructor(options, toSourceFilePath, findWorkspacePackageTarget) {
46
46
  this.cache = new CacheConsultant('root', options);
47
47
  this.toSourceFilePath = toSourceFilePath;
48
- this.findWorkspaceManifestImports = findWorkspaceManifestImports;
48
+ this.findWorkspacePackageTarget = findWorkspacePackageTarget;
49
49
  this.tsConfigFile = options.tsConfigFile ? toAbsolute(options.tsConfigFile, options.cwd) : undefined;
50
50
  this.pluginVisitorObjects.push(createBunShellVisitor(this.pluginCtx));
51
51
  this.fileManager = new SourceFileManager({
@@ -91,7 +91,7 @@ export class ProjectPrincipal {
91
91
  const customCompilerExtensions = getCompilerExtensions([this.syncCompilers, this.asyncCompilers]);
92
92
  const scopedPaths = this.paths.size > 0 ? Array.from(this.paths, ([scope, paths]) => ({ scope, paths })) : undefined;
93
93
  const scopedRootDirs = this.rootDirs.size > 0 ? Array.from(this.rootDirs, ([scope, rootDirs]) => ({ scope, rootDirs })) : undefined;
94
- this.resolveModule = createCustomModuleResolver({ scopedPaths, scopedRootDirs }, customCompilerExtensions, this.toSourceFilePath, this.findWorkspaceManifestImports, this.tsConfigFile);
94
+ this.resolveModule = createCustomModuleResolver({ scopedPaths, scopedRootDirs }, customCompilerExtensions, this.toSourceFilePath, this.findWorkspacePackageTarget, this.tsConfigFile);
95
95
  this.resolveGlobPattern = createGlobAliasResolver(scopedPaths);
96
96
  }
97
97
  readFile(filePath) {
@@ -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
  }
@@ -7,7 +7,11 @@ const positionals = new Set(['babel-node', 'esbuild', 'execa', 'jiti', 'oxnode',
7
7
  const positionalBinaries = new Set(['concurrently']);
8
8
  export const resolve = (binary, args, { fromArgs }) => {
9
9
  const parsed = parseArgs(args, { boolean: ['quiet', 'verbose'], '--': endOfCommandBinaries.includes(binary) });
10
- const bin = binary.startsWith('.') ? toEntry(binary) : isValidBinary(binary) ? toBinary(binary) : undefined;
10
+ const bin = binary.startsWith('.') || binary.includes('/')
11
+ ? toEntry(binary)
12
+ : isValidBinary(binary)
13
+ ? toBinary(binary)
14
+ : undefined;
11
15
  const pos = positionals.has(binary) ? [toDeferResolve(parsed._[0])] : [];
12
16
  const newCommand = parsed['--'] && parsed['--'].length > 0 ? fromArgs(parsed['--']) : [];
13
17
  const commands = positionalBinaries.has(binary) ? parsed._.flatMap(cmd => fromArgs([cmd])) : [];
@@ -2,6 +2,7 @@ import parseArgs from '../../util/parse-args.js';
2
2
  import { toBinary, toEntry } from '../../util/input.js';
3
3
  import { isAbsolute, join } from '../../util/path.js';
4
4
  import { _resolveSync } from '../../util/resolve.js';
5
+ import { argsAfter, expandScript } from '../util.js';
5
6
  import { resolveX } from './bunx.js';
6
7
  const commands = new Set([
7
8
  'add',
@@ -59,10 +60,12 @@ export const resolve = (_binary, args, options) => {
59
60
  return [binary, ...resolveX(argsForX, options)];
60
61
  }
61
62
  const { manifest, cwd, fromArgs } = options;
62
- if (command === 'run' && manifest.scriptNames.has(script))
63
- return [binary];
64
- if (manifest.scriptNames.has(command))
65
- return [binary];
63
+ if (command === 'run' && manifest.scriptNames.has(script)) {
64
+ return [binary, ...(expandScript(script, argsAfter(args, script), manifest.scripts, options) ?? [])];
65
+ }
66
+ if (manifest.scriptNames.has(command)) {
67
+ return [binary, ...(expandScript(command, argsAfter(args, command), manifest.scripts, options) ?? [])];
68
+ }
66
69
  if (command !== 'run' && commands.has(command))
67
70
  return [binary];
68
71
  const filePath = command === 'run' ? script : command;
@@ -74,5 +77,10 @@ export const resolve = (_binary, args, options) => {
74
77
  return [binary, toEntry(resolved)];
75
78
  const dir = parsed.cwd ? join(cwd, parsed.cwd) : undefined;
76
79
  const opts = dir ? { cwd: dir } : {};
77
- return command === 'run' ? [binary] : [binary, ...fromArgs(args, opts)];
80
+ if (command !== 'run')
81
+ return [binary, ...fromArgs(args, opts)];
82
+ const input = toBinary(filePath, { optional: true });
83
+ if (dir)
84
+ input.dir = dir;
85
+ return [binary, input];
78
86
  };
@@ -1,4 +1,5 @@
1
1
  import parseArgs from '../../util/parse-args.js';
2
+ import { expandScript } from '../util.js';
2
3
  export const resolve = (_binary, args, options) => {
3
4
  const { fromArgs, manifest } = options;
4
5
  const parsed = parseArgs(args, { '--': true });
@@ -6,7 +7,8 @@ export const resolve = (_binary, args, options) => {
6
7
  const _childArgs = parsed['--'] && parsed['--'].length > 0 ? fromArgs(parsed['--'], { knownBinsOnly: true }) : [];
7
8
  if (command === 'exec')
8
9
  return _childArgs;
9
- if (command === 'run' && manifest.scriptNames.has(script))
10
- return _childArgs;
10
+ if (command === 'run' && manifest.scriptNames.has(script)) {
11
+ return expandScript(script, parsed['--'] ?? [], manifest.scripts, options) ?? _childArgs;
12
+ }
11
13
  return [];
12
14
  };
@@ -1,6 +1,7 @@
1
1
  import parseArgs from '../../util/parse-args.js';
2
2
  import { toBinary } from '../../util/input.js';
3
3
  import { isValidBinary } from '../../util/modules.js';
4
+ import { argsAfter, expandScript } from '../util.js';
4
5
  import { resolveDlx } from './pnpx.js';
5
6
  const commands = [
6
7
  'add',
@@ -98,8 +99,17 @@ export const resolve = (_binary, args, options) => {
98
99
  if (command === 'exec') {
99
100
  return childInputs.length > 0 ? childInputs : fromArgs(parsed._.slice(1));
100
101
  }
102
+ if (command === 'run') {
103
+ const script = parsed._[1];
104
+ if (script && manifest.scriptNames.has(script)) {
105
+ return expandScript(script, argsAfter(args, script), manifest.scripts, options) ?? childInputs;
106
+ }
107
+ return childInputs;
108
+ }
101
109
  const isScript = manifest.scriptNames.has(command);
102
- if (isScript || commands.includes(command))
110
+ if (isScript)
111
+ return expandScript(command, argsAfter(args, command), manifest.scripts, options) ?? childInputs;
112
+ if (commands.includes(command))
103
113
  return childInputs;
104
114
  return command && isValidBinary(command) ? [toBinary(command)] : [];
105
115
  };
@@ -2,7 +2,7 @@ import parseArgs from '../../util/parse-args.js';
2
2
  import { isBinary, isDependency, toBinary, toDependency } from '../../util/input.js';
3
3
  import { stripVersionFromSpecifier } from '../../util/modules.js';
4
4
  import { join } from '../../util/path.js';
5
- import { argsFrom } from '../util.js';
5
+ import { argsAfter, argsFrom, expandScript } from '../util.js';
6
6
  const commands = [
7
7
  'add',
8
8
  'bin',
@@ -58,8 +58,10 @@ export const resolve = (_binary, args, options) => {
58
58
  const dirManifest = (dir && getManifest(dir)) || manifest;
59
59
  const _childArgs = parsed['--'] && parsed['--'].length > 0 ? fromArgs(parsed['--'], { knownBinsOnly: true }) : [];
60
60
  if (command === 'run') {
61
- if (dirManifest.scriptNames.has(binary))
62
- return _childArgs;
61
+ if (dirManifest.scriptNames.has(binary)) {
62
+ const opts = dir ? { cwd: dir, manifest: dirManifest } : {};
63
+ return expandScript(binary, argsAfter(args, binary), dirManifest.scripts, options, opts) ?? _childArgs;
64
+ }
63
65
  const bin = toBinary(binary, { optional: true });
64
66
  if (dir)
65
67
  Object.assign(bin, { dir });
@@ -71,7 +73,11 @@ export const resolve = (_binary, args, options) => {
71
73
  const argsForDlx = args.filter(arg => arg !== 'dlx');
72
74
  return resolveDlx(argsForDlx, options);
73
75
  }
74
- if (dirManifest.scriptNames.has(command) || commands.includes(command))
76
+ if (dirManifest.scriptNames.has(command)) {
77
+ const opts = dir ? { cwd: dir, manifest: dirManifest } : {};
78
+ return expandScript(command, argsAfter(args, command), dirManifest.scripts, options, opts) ?? _childArgs;
79
+ }
80
+ if (commands.includes(command))
75
81
  return _childArgs;
76
82
  const opts = dir ? { cwd: dir } : {};
77
83
  return fromArgs(argsFrom(args, command === 'exec' ? binary : command), opts);
@@ -1,2 +1,6 @@
1
+ import type { BinaryResolverOptions, GetInputsFromScriptsOptions } from '../types/config.ts';
2
+ import type { Input } from '../util/input.ts';
1
3
  export declare const argsFrom: (args: string[], from: string) => string[];
4
+ export declare const argsAfter: (args: string[], token: string) => string[];
5
+ export declare const expandScript: (name: string, forwardedArgs: string[], scripts: Record<string, string> | undefined, options: BinaryResolverOptions, opts?: Partial<GetInputsFromScriptsOptions>) => Input[] | undefined;
2
6
  export declare const parseNodeArgs: (args: string[]) => import("../util/parse-args.ts").ParsedArgs;
@@ -1,5 +1,19 @@
1
1
  import parseArgs from '../util/parse-args.js';
2
2
  export const argsFrom = (args, from) => args.slice(args.indexOf(from));
3
+ export const argsAfter = (args, token) => {
4
+ const index = args.indexOf(token);
5
+ return index === -1 ? [] : args.slice(index + 1).filter(arg => arg !== '--');
6
+ };
7
+ export const expandScript = (name, forwardedArgs, scripts, options, opts = {}) => {
8
+ const source = scripts?.[name];
9
+ if (!source || forwardedArgs.length === 0)
10
+ return;
11
+ const expandedScripts = options.expandedScripts ?? new Set();
12
+ if (expandedScripts.has(name))
13
+ return;
14
+ expandedScripts.add(name);
15
+ return options.fromArgs([source, ...forwardedArgs], { ...opts, expandedScripts });
16
+ };
3
17
  export const parseNodeArgs = (args) => parseArgs(args, {
4
18
  string: ['r'],
5
19
  alias: { require: ['r', 'loader', 'experimental-loader', 'test-reporter', 'watch', 'import'] },
@@ -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;
@@ -703,6 +708,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
703
708
  entry?: string | string[] | undefined;
704
709
  project?: string | string[] | undefined;
705
710
  } | undefined;
711
+ temporal?: string | boolean | string[] | {
712
+ config?: string | string[] | undefined;
713
+ entry?: string | string[] | undefined;
714
+ project?: string | string[] | undefined;
715
+ } | undefined;
706
716
  travis?: string | boolean | string[] | {
707
717
  config?: string | string[] | undefined;
708
718
  entry?: string | string[] | undefined;
@@ -1324,6 +1334,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1324
1334
  entry?: string | string[] | undefined;
1325
1335
  project?: string | string[] | undefined;
1326
1336
  } | undefined;
1337
+ openclaw?: string | boolean | string[] | {
1338
+ config?: string | string[] | undefined;
1339
+ entry?: string | string[] | undefined;
1340
+ project?: string | string[] | undefined;
1341
+ } | undefined;
1327
1342
  orval?: string | boolean | string[] | {
1328
1343
  config?: string | string[] | undefined;
1329
1344
  entry?: string | string[] | undefined;
@@ -1609,6 +1624,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1609
1624
  entry?: string | string[] | undefined;
1610
1625
  project?: string | string[] | undefined;
1611
1626
  } | undefined;
1627
+ temporal?: string | boolean | string[] | {
1628
+ config?: string | string[] | undefined;
1629
+ entry?: string | string[] | undefined;
1630
+ project?: string | string[] | undefined;
1631
+ } | undefined;
1612
1632
  travis?: string | boolean | string[] | {
1613
1633
  config?: string | string[] | undefined;
1614
1634
  entry?: string | string[] | undefined;
@@ -1,6 +1,6 @@
1
1
  import { isScopedPackage, isTildePackage, splitSpec } from './shared.js';
2
2
  const dependencies = ['less'];
3
- const importMatcher = /@import\s+(?:\([^)]*\)\s+)?(?:url\(\s*['"]?([^'")\s]+)['"]?\s*\)|['"]([^'"]+)['"])/g;
3
+ const importMatcher = /"(?:\\(?:\r\n|[\s\S]|$)|[^"\\\r\n\f])*(?:"|[\r\n\f]|$)|'(?:\\(?:\r\n|[\s\S]|$)|[^'\\\r\n\f])*(?:'|[\r\n\f]|$)|\/\*[\s\S]*?(?:\*\/|$)|@import\s+(?:\([^)]*\)\s+)?(?:url\(\s*['"]?([^'")\s]+)['"]?\s*\)|['"]([^'"]+)['"])/g;
4
4
  const isExternalUrl = (s) => s.startsWith('//') || s.startsWith('http://') || s.startsWith('https://');
5
5
  const candidates = (specifier) => {
6
6
  const { dir, name } = splitSpec(specifier);
@@ -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;
@@ -1,6 +1,6 @@
1
1
  import { isScopedPackage, isTildePackage, splitSpec } from './shared.js';
2
2
  const dependencies = ['sass', 'sass-embedded', 'node-sass'];
3
- const importMatcher = /@(?:use|import|forward)\s+['"](pkg:)?([^'"]+)['"]/g;
3
+ const importMatcher = /"(?:\\(?:\r\n|[\s\S]|$)|[^"\\\r\n\f])*(?:"|[\r\n\f]|$)|'(?:\\(?:\r\n|[\s\S]|$)|[^'\\\r\n\f])*(?:'|[\r\n\f]|$)|\/\*[\s\S]*?(?:\*\/|$)|@(?:use|import|forward)\s+['"](pkg:)?([^'"]+)['"]/g;
4
4
  const candidates = (specifier) => {
5
5
  const { dir, name } = splitSpec(specifier);
6
6
  const hasExt = name.endsWith('.scss') || name.endsWith('.sass');
@@ -1,6 +1,6 @@
1
1
  import { isScopedPackage, isTildePackage, splitSpec } from './shared.js';
2
2
  const dependencies = ['stylus'];
3
- const importMatcher = /@(?:import|require)\s+['"]([^'"]+)['"]/g;
3
+ const importMatcher = /"(?:\\(?:\r\n|[\s\S]|$)|[^"\\\r\n\f])*(?:"|[\r\n\f]|$)|'(?:\\(?:\r\n|[\s\S]|$)|[^'\\\r\n\f])*(?:'|[\r\n\f]|$)|\/\*[\s\S]*?(?:\*\/|$)|@(?:import|require)\s+['"]([^'"]+)['"]/g;
4
4
  const candidates = (specifier) => {
5
5
  const { dir, name } = splitSpec(specifier);
6
6
  if (name.endsWith('.styl') || name.endsWith('.stylus') || name.endsWith('.css'))
package/dist/constants.js CHANGED
@@ -36,6 +36,7 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
36
36
  'chmod',
37
37
  'chown',
38
38
  'cksum',
39
+ 'claude',
39
40
  'clear',
40
41
  'cmd',
41
42
  'cmd.exe',
@@ -49,6 +50,7 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
49
50
  'curl',
50
51
  'cut',
51
52
  'date',
53
+ 'defaults',
52
54
  'deno',
53
55
  'devtunnel',
54
56
  'df',
@@ -66,7 +68,9 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
66
68
  'factor',
67
69
  'false',
68
70
  'find',
71
+ 'fuser',
69
72
  'gem',
73
+ 'getconf',
70
74
  'gh',
71
75
  'git',
72
76
  'grep',
@@ -77,9 +81,11 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
77
81
  'id',
78
82
  'join',
79
83
  'kill',
84
+ 'launchctl',
80
85
  'ln',
81
86
  'logname',
82
87
  'ls',
88
+ 'lsof',
83
89
  'md5sum',
84
90
  'mkdir',
85
91
  'mknod',
@@ -102,13 +108,17 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
102
108
  'powershell.exe',
103
109
  'pr',
104
110
  'printenv',
111
+ 'ps',
112
+ 'pulumi',
105
113
  'pwd',
106
114
  'python',
107
115
  'python3',
116
+ 'raft',
108
117
  'rm',
109
118
  'rmdir',
110
119
  'rsync',
111
120
  'scp',
121
+ 'security',
112
122
  'sed',
113
123
  'seq',
114
124
  'set',
@@ -124,13 +134,19 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
124
134
  'stat',
125
135
  'stty',
126
136
  'sudo',
137
+ 'sw_vers',
127
138
  'sync',
139
+ 'sysctl',
140
+ 'systemctl',
128
141
  'tac',
129
142
  'tar',
143
+ 'taskkill',
130
144
  'tee',
131
145
  'test',
132
146
  'time',
133
147
  'timeout',
148
+ 'tmux',
149
+ 'tmuxinator',
134
150
  'touch',
135
151
  'trap',
136
152
  'tr',
@@ -142,14 +158,18 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
142
158
  'uniq',
143
159
  'unzip',
144
160
  'wc',
161
+ 'which',
145
162
  'who',
146
163
  'whoami',
147
164
  'xargs',
148
165
  'xcodebuild',
166
+ 'xcrun',
149
167
  'xvfb-run',
150
168
  'yarn',
151
169
  'yes',
152
170
  'zip',
171
+ 'zsh',
172
+ 'zstd',
153
173
  ]);
154
174
  export const IGNORED_DEPENDENCIES = new Set(['knip', 'typescript']);
155
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';
@@ -193,7 +195,7 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
193
195
  for (const extImport of file.imports.external) {
194
196
  const packageName = getPackageNameFromModuleSpecifier(extImport.specifier);
195
197
  const isHandled = packageName &&
196
- deputy.maybeAddReferencedExternalDependency(ws, packageName, undefined, extImport.isTypeOnly);
198
+ deputy.maybeAddReferencedExternalDependency(ws, packageName, undefined, extImport.isTypeOnly, extImport.filePath !== undefined);
197
199
  if (!isHandled)
198
200
  collector.addIssue({
199
201
  type: 'unlisted',
@@ -18,6 +18,7 @@ import { getPackageNameFromModuleSpecifier, isStartsLikePackageName, sanitizeSpe
18
18
  import { perfObserver } from '../util/Performance.js';
19
19
  import { getEntrySpecifiersFromManifest, getManifestImportDependencies } from '../util/package-json.js';
20
20
  import { dirname, extname, isAbsolute, isInNodeModules, join, relative } from '../util/path.js';
21
+ import { extensionAlias } from '../util/resolve.js';
21
22
  import { augmentWorkspace, getToSourcePathsHandler, toSourceMappedSpecifiers } from '../util/to-source-path.js';
22
23
  import { WorkspaceWorker } from '../WorkspaceWorker.js';
23
24
  export async function build({ chief, collector, counselor, deputy, principal, isGitIgnored, streamer, workspaces, options, }) {
@@ -331,10 +332,21 @@ export async function build({ chief, collector, counselor, deputy, principal, is
331
332
  file.imports.external.add({ ...unresolvedImport, specifier: sanitizedSpecifier });
332
333
  }
333
334
  else {
334
- if (!isGitIgnored(join(dirname(filePath), sanitizedSpecifier))) {
335
- const ext = extname(sanitizedSpecifier);
336
- if (!ext || (ext !== '.json' && !FOREIGN_FILE_EXTENSIONS.has(ext)))
337
- unresolvedImports.add(unresolvedImport);
335
+ const candidate = join(dirname(filePath), sanitizedSpecifier);
336
+ const ext = extname(sanitizedSpecifier);
337
+ const aliases = extensionAlias[ext];
338
+ let isIgnored = isGitIgnored(candidate);
339
+ if (!isIgnored && aliases) {
340
+ const basePath = candidate.slice(0, -ext.length);
341
+ for (const alias of aliases) {
342
+ if (alias !== ext && isGitIgnored(basePath + alias)) {
343
+ isIgnored = true;
344
+ break;
345
+ }
346
+ }
347
+ }
348
+ if (!isIgnored && (!ext || (ext !== '.json' && !FOREIGN_FILE_EXTENSIONS.has(ext)))) {
349
+ unresolvedImports.add(unresolvedImport);
338
350
  }
339
351
  }
340
352
  }
@@ -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];