knip 5.33.2 → 5.34.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 (309) hide show
  1. package/dist/ConfigurationChief.d.ts +27 -27
  2. package/dist/ConfigurationChief.js +20 -36
  3. package/dist/ConfigurationValidator.d.ts +392 -0
  4. package/dist/ConfigurationValidator.js +7 -0
  5. package/dist/DependencyDeputy.js +5 -2
  6. package/dist/PrincipalFactory.d.ts +3 -20
  7. package/dist/PrincipalFactory.js +4 -4
  8. package/dist/ProjectPrincipal.d.ts +2 -5
  9. package/dist/ProjectPrincipal.js +0 -5
  10. package/dist/WorkspaceWorker.d.ts +15 -13
  11. package/dist/WorkspaceWorker.js +144 -105
  12. package/dist/binaries/bash-parser.d.ts +3 -2
  13. package/dist/binaries/bash-parser.js +33 -22
  14. package/dist/binaries/fallback.d.ts +2 -0
  15. package/dist/binaries/fallback.js +12 -0
  16. package/dist/binaries/index.d.ts +2 -2
  17. package/dist/binaries/index.js +15 -26
  18. package/dist/binaries/package-manager/bun.d.ts +2 -0
  19. package/dist/binaries/{resolvers → package-manager}/bun.js +6 -4
  20. package/dist/binaries/package-manager/index.d.ts +8 -0
  21. package/dist/binaries/package-manager/index.js +12 -0
  22. package/dist/binaries/{resolvers → package-manager}/node.d.ts +0 -2
  23. package/dist/binaries/package-manager/node.js +5 -0
  24. package/dist/binaries/package-manager/npm.d.ts +2 -0
  25. package/dist/binaries/package-manager/npm.js +8 -0
  26. package/dist/binaries/package-manager/npx.d.ts +2 -0
  27. package/dist/binaries/{resolvers → package-manager}/npx.js +6 -6
  28. package/dist/binaries/package-manager/pnpm.d.ts +2 -0
  29. package/dist/binaries/{resolvers → package-manager}/pnpm.js +6 -3
  30. package/dist/binaries/package-manager/yarn.d.ts +2 -0
  31. package/dist/binaries/{resolvers → package-manager}/yarn.js +9 -7
  32. package/dist/binaries/plugins.d.ts +2 -0
  33. package/dist/binaries/plugins.js +61 -0
  34. package/dist/binaries/util.d.ts +0 -2
  35. package/dist/binaries/util.js +0 -25
  36. package/dist/compilers/index.d.ts +70 -0
  37. package/dist/constants.d.ts +1 -0
  38. package/dist/constants.js +2 -1
  39. package/dist/index.js +74 -46
  40. package/dist/manifest/helpers.d.ts +1 -5
  41. package/dist/manifest/helpers.js +8 -7
  42. package/dist/plugins/_template/index.d.ts +2 -2
  43. package/dist/plugins/_template/index.js +4 -3
  44. package/dist/plugins/angular/index.d.ts +1 -1
  45. package/dist/plugins/angular/index.js +13 -10
  46. package/dist/plugins/astro/index.d.ts +1 -1
  47. package/dist/plugins/astro/index.js +6 -5
  48. package/dist/plugins/ava/index.d.ts +1 -1
  49. package/dist/plugins/ava/index.js +4 -5
  50. package/dist/plugins/babel/helpers.js +1 -1
  51. package/dist/plugins/babel/index.d.ts +3 -2
  52. package/dist/plugins/babel/index.js +4 -3
  53. package/dist/plugins/c8/index.d.ts +10 -0
  54. package/dist/plugins/c8/index.js +11 -0
  55. package/dist/plugins/capacitor/index.d.ts +1 -1
  56. package/dist/plugins/capacitor/index.js +5 -4
  57. package/dist/plugins/changesets/index.d.ts +1 -1
  58. package/dist/plugins/changesets/index.js +4 -3
  59. package/dist/plugins/commitizen/index.d.ts +1 -1
  60. package/dist/plugins/commitizen/index.js +3 -2
  61. package/dist/plugins/commitlint/index.d.ts +1 -1
  62. package/dist/plugins/commitlint/index.js +4 -2
  63. package/dist/plugins/cspell/index.d.ts +1 -1
  64. package/dist/plugins/cspell/index.js +3 -2
  65. package/dist/plugins/cucumber/index.d.ts +2 -2
  66. package/dist/plugins/cucumber/index.js +4 -4
  67. package/dist/plugins/cypress/helpers.d.ts +1 -1
  68. package/dist/plugins/cypress/helpers.js +3 -4
  69. package/dist/plugins/cypress/index.d.ts +1 -1
  70. package/dist/plugins/cypress/index.js +6 -5
  71. package/dist/plugins/dotenv/index.d.ts +8 -0
  72. package/dist/plugins/dotenv/index.js +9 -0
  73. package/dist/plugins/drizzle/index.d.ts +1 -1
  74. package/dist/plugins/drizzle/index.js +3 -3
  75. package/dist/plugins/eleventy/index.d.ts +1 -1
  76. package/dist/plugins/eleventy/index.js +6 -6
  77. package/dist/plugins/eslint/helpers.d.ts +4 -5
  78. package/dist/plugins/eslint/helpers.js +10 -32
  79. package/dist/plugins/eslint/index.d.ts +1 -1
  80. package/dist/plugins/eslint/index.js +3 -6
  81. package/dist/plugins/gatsby/index.d.ts +1 -1
  82. package/dist/plugins/gatsby/index.js +6 -3
  83. package/dist/plugins/github-actions/index.d.ts +1 -1
  84. package/dist/plugins/github-actions/index.js +23 -7
  85. package/dist/plugins/graphql-codegen/index.d.ts +1 -1
  86. package/dist/plugins/graphql-codegen/index.js +7 -7
  87. package/dist/plugins/husky/index.d.ts +1 -1
  88. package/dist/plugins/husky/index.js +4 -3
  89. package/dist/plugins/index.d.ts +685 -77
  90. package/dist/plugins/index.js +170 -77
  91. package/dist/plugins/jest/index.d.ts +1 -1
  92. package/dist/plugins/jest/index.js +22 -24
  93. package/dist/plugins/ladle/index.d.ts +2 -2
  94. package/dist/plugins/ladle/index.js +4 -4
  95. package/dist/plugins/lefthook/index.d.ts +1 -1
  96. package/dist/plugins/lefthook/index.js +18 -14
  97. package/dist/plugins/lint-staged/index.d.ts +1 -1
  98. package/dist/plugins/lint-staged/index.js +6 -5
  99. package/dist/plugins/linthtml/index.d.ts +1 -1
  100. package/dist/plugins/linthtml/index.js +6 -8
  101. package/dist/plugins/lockfile-lint/index.d.ts +2 -2
  102. package/dist/plugins/lockfile-lint/index.js +2 -1
  103. package/dist/plugins/lost-pixel/index.d.ts +2 -2
  104. package/dist/plugins/lost-pixel/index.js +1 -1
  105. package/dist/plugins/markdownlint/index.d.ts +1 -1
  106. package/dist/plugins/markdownlint/index.js +3 -2
  107. package/dist/plugins/mocha/index.d.ts +4 -1
  108. package/dist/plugins/mocha/index.js +8 -4
  109. package/dist/plugins/moonrepo/index.d.ts +2 -2
  110. package/dist/plugins/moonrepo/index.js +4 -4
  111. package/dist/plugins/msw/index.d.ts +1 -1
  112. package/dist/plugins/msw/index.js +4 -4
  113. package/dist/plugins/nest/index.d.ts +2 -2
  114. package/dist/plugins/nest/index.js +4 -3
  115. package/dist/plugins/netlify/index.d.ts +1 -1
  116. package/dist/plugins/netlify/index.js +6 -6
  117. package/dist/plugins/next/index.d.ts +1 -1
  118. package/dist/plugins/next/index.js +1 -1
  119. package/dist/plugins/node/index.d.ts +8 -0
  120. package/dist/plugins/node/index.js +9 -0
  121. package/dist/plugins/node-test-runner/index.d.ts +1 -1
  122. package/dist/plugins/nodemon/index.d.ts +10 -0
  123. package/dist/plugins/nodemon/index.js +11 -0
  124. package/dist/plugins/npm-package-json-lint/index.d.ts +1 -1
  125. package/dist/plugins/npm-package-json-lint/index.js +4 -2
  126. package/dist/plugins/nuxt/index.d.ts +1 -1
  127. package/dist/plugins/nuxt/index.js +4 -4
  128. package/dist/plugins/nx/index.d.ts +5 -1
  129. package/dist/plugins/nx/index.js +10 -8
  130. package/dist/plugins/nyc/index.d.ts +1 -1
  131. package/dist/plugins/nyc/index.js +3 -2
  132. package/dist/plugins/oclif/index.d.ts +2 -2
  133. package/dist/plugins/oclif/index.js +3 -2
  134. package/dist/plugins/playwright/index.d.ts +13 -1
  135. package/dist/plugins/playwright/index.js +13 -6
  136. package/dist/plugins/playwright-ct/index.d.ts +9 -3
  137. package/dist/plugins/playwright-ct/index.js +3 -2
  138. package/dist/plugins/playwright-test/index.d.ts +13 -0
  139. package/dist/plugins/playwright-test/index.js +16 -0
  140. package/dist/plugins/postcss/index.d.ts +1 -1
  141. package/dist/plugins/postcss/index.js +5 -2
  142. package/dist/plugins/preconstruct/index.d.ts +1 -1
  143. package/dist/plugins/preconstruct/index.js +3 -3
  144. package/dist/plugins/prettier/index.d.ts +1 -1
  145. package/dist/plugins/prettier/index.js +5 -5
  146. package/dist/plugins/react-cosmos/index.d.ts +2 -2
  147. package/dist/plugins/react-cosmos/index.js +5 -6
  148. package/dist/plugins/release-it/index.d.ts +1 -1
  149. package/dist/plugins/release-it/index.js +4 -3
  150. package/dist/plugins/remark/index.d.ts +1 -1
  151. package/dist/plugins/remark/index.js +3 -2
  152. package/dist/plugins/remix/index.d.ts +1 -1
  153. package/dist/plugins/remix/index.js +1 -1
  154. package/dist/plugins/rollup/index.d.ts +3 -1
  155. package/dist/plugins/rollup/index.js +8 -1
  156. package/dist/plugins/rsbuild/index.d.ts +2 -2
  157. package/dist/plugins/rsbuild/index.js +1 -1
  158. package/dist/plugins/rspack/index.d.ts +2 -2
  159. package/dist/plugins/rspack/index.js +4 -8
  160. package/dist/plugins/semantic-release/index.d.ts +1 -1
  161. package/dist/plugins/semantic-release/index.js +4 -2
  162. package/dist/plugins/sentry/index.d.ts +1 -1
  163. package/dist/plugins/sentry/index.js +1 -1
  164. package/dist/plugins/simple-git-hooks/index.d.ts +2 -2
  165. package/dist/plugins/simple-git-hooks/index.js +5 -5
  166. package/dist/plugins/size-limit/index.d.ts +2 -2
  167. package/dist/plugins/size-limit/index.js +2 -1
  168. package/dist/plugins/storybook/index.d.ts +1 -1
  169. package/dist/plugins/storybook/index.js +5 -5
  170. package/dist/plugins/stryker/index.d.ts +1 -1
  171. package/dist/plugins/stryker/index.js +3 -2
  172. package/dist/plugins/stylelint/index.d.ts +1 -1
  173. package/dist/plugins/stylelint/index.js +4 -3
  174. package/dist/plugins/svelte/index.d.ts +1 -1
  175. package/dist/plugins/svelte/index.js +1 -1
  176. package/dist/plugins/syncpack/index.d.ts +2 -3
  177. package/dist/plugins/syncpack/index.js +2 -4
  178. package/dist/plugins/tailwind/index.d.ts +1 -1
  179. package/dist/plugins/tailwind/index.js +1 -1
  180. package/dist/plugins/travis/index.d.ts +1 -1
  181. package/dist/plugins/travis/index.js +3 -4
  182. package/dist/plugins/ts-node/index.d.ts +15 -0
  183. package/dist/plugins/ts-node/index.js +12 -0
  184. package/dist/plugins/tsup/index.d.ts +4 -1
  185. package/dist/plugins/tsup/index.js +7 -3
  186. package/dist/plugins/tsx/index.d.ts +9 -0
  187. package/dist/plugins/tsx/index.js +10 -0
  188. package/dist/plugins/typedoc/index.d.ts +4 -1
  189. package/dist/plugins/typedoc/index.js +10 -3
  190. package/dist/plugins/typedoc/types.d.ts +1 -0
  191. package/dist/plugins/typescript/index.d.ts +11 -2
  192. package/dist/plugins/typescript/index.js +19 -34
  193. package/dist/plugins/unbuild/index.d.ts +1 -1
  194. package/dist/plugins/unbuild/index.js +3 -3
  195. package/dist/plugins/unocss/index.d.ts +2 -2
  196. package/dist/plugins/unocss/index.js +2 -1
  197. package/dist/plugins/vercel-og/index.d.ts +1 -1
  198. package/dist/plugins/vercel-og/index.js +1 -1
  199. package/dist/plugins/vike/index.d.ts +2 -2
  200. package/dist/plugins/vike/index.js +1 -1
  201. package/dist/plugins/vite/index.d.ts +3 -3
  202. package/dist/plugins/vite/index.js +2 -2
  203. package/dist/plugins/vitest/index.d.ts +4 -1
  204. package/dist/plugins/vitest/index.js +31 -20
  205. package/dist/plugins/vue/index.d.ts +1 -1
  206. package/dist/plugins/vue/index.js +10 -10
  207. package/dist/plugins/webdriver-io/index.d.ts +1 -1
  208. package/dist/plugins/webdriver-io/index.js +3 -2
  209. package/dist/plugins/webpack/index.d.ts +3 -5
  210. package/dist/plugins/webpack/index.js +18 -19
  211. package/dist/plugins/wireit/index.d.ts +1 -1
  212. package/dist/plugins/wireit/index.js +2 -2
  213. package/dist/plugins/wrangler/index.d.ts +1 -1
  214. package/dist/plugins/wrangler/index.js +3 -2
  215. package/dist/plugins/xo/index.d.ts +2 -2
  216. package/dist/plugins/xo/index.js +4 -4
  217. package/dist/plugins/yorkie/index.d.ts +1 -1
  218. package/dist/plugins/yorkie/index.js +6 -5
  219. package/dist/plugins.d.ts +7 -4
  220. package/dist/plugins.js +17 -10
  221. package/dist/reporters/symbols.js +1 -1
  222. package/dist/types/PluginNames.d.ts +2 -0
  223. package/dist/types/PluginNames.js +86 -0
  224. package/dist/types/args.d.ts +14 -0
  225. package/dist/types/config.d.ts +84 -21
  226. package/dist/types/package-json.d.ts +10 -0
  227. package/dist/types/project.d.ts +18 -0
  228. package/dist/typescript/ast-helpers.d.ts +1 -1
  229. package/dist/typescript/ast-helpers.js +5 -1
  230. package/dist/typescript/find-internal-references.d.ts +1 -1
  231. package/dist/typescript/find-internal-references.js +12 -10
  232. package/dist/typescript/get-imports-and-exports.d.ts +1 -11
  233. package/dist/typescript/get-imports-and-exports.js +19 -14
  234. package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
  235. package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
  236. package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
  237. package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +1 -1
  238. package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
  239. package/dist/typescript/visitors/dynamic-imports/resolveCall.d.ts +1 -1
  240. package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
  241. package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
  242. package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
  243. package/dist/typescript/visitors/exports/exportKeyword.js +2 -0
  244. package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +1 -1
  245. package/dist/typescript/visitors/exports/index.d.ts +1 -1
  246. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
  247. package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
  248. package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
  249. package/dist/typescript/visitors/imports/index.d.ts +1 -1
  250. package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
  251. package/dist/typescript/visitors/index.d.ts +1 -1
  252. package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
  253. package/dist/typescript/visitors/scripts/execa.d.ts +1 -1
  254. package/dist/typescript/visitors/scripts/index.d.ts +1 -1
  255. package/dist/typescript/visitors/scripts/zx.d.ts +1 -1
  256. package/dist/util/create-workspace-graph.d.ts +1 -1
  257. package/dist/util/create-workspace-graph.js +7 -7
  258. package/dist/util/debug.d.ts +2 -2
  259. package/dist/util/debug.js +1 -1
  260. package/dist/util/glob.js +2 -2
  261. package/dist/util/{handle-dependency.d.ts → handle-referenced-dependency.d.ts} +2 -1
  262. package/dist/util/handle-referenced-dependency.js +82 -0
  263. package/dist/util/input.d.ts +37 -0
  264. package/dist/util/input.js +36 -0
  265. package/dist/util/map-workspaces.d.ts +5 -2
  266. package/dist/util/map-workspaces.js +6 -6
  267. package/dist/util/modules.d.ts +1 -0
  268. package/dist/util/modules.js +4 -3
  269. package/dist/util/object.d.ts +1 -0
  270. package/dist/util/object.js +19 -0
  271. package/dist/util/plugin-config.d.ts +24 -0
  272. package/dist/util/plugin-config.js +32 -0
  273. package/dist/util/plugin.d.ts +3 -31
  274. package/dist/util/plugin.js +9 -54
  275. package/dist/util/regex.js +3 -2
  276. package/dist/version.d.ts +1 -1
  277. package/dist/version.js +1 -1
  278. package/package.json +7 -10
  279. package/schema.json +28 -0
  280. package/dist/binaries/resolvers/bun.d.ts +0 -2
  281. package/dist/binaries/resolvers/c8.d.ts +0 -2
  282. package/dist/binaries/resolvers/c8.js +0 -11
  283. package/dist/binaries/resolvers/dotenv.d.ts +0 -2
  284. package/dist/binaries/resolvers/dotenv.js +0 -7
  285. package/dist/binaries/resolvers/fallback.d.ts +0 -2
  286. package/dist/binaries/resolvers/fallback.js +0 -26
  287. package/dist/binaries/resolvers/index.d.ts +0 -15
  288. package/dist/binaries/resolvers/index.js +0 -26
  289. package/dist/binaries/resolvers/node.js +0 -11
  290. package/dist/binaries/resolvers/nodemon.d.ts +0 -2
  291. package/dist/binaries/resolvers/nodemon.js +0 -16
  292. package/dist/binaries/resolvers/npx.d.ts +0 -2
  293. package/dist/binaries/resolvers/nx.d.ts +0 -2
  294. package/dist/binaries/resolvers/nx.js +0 -9
  295. package/dist/binaries/resolvers/pnpm.d.ts +0 -2
  296. package/dist/binaries/resolvers/rollup.d.ts +0 -2
  297. package/dist/binaries/resolvers/rollup.js +0 -12
  298. package/dist/binaries/resolvers/ts-node.d.ts +0 -2
  299. package/dist/binaries/resolvers/ts-node.js +0 -16
  300. package/dist/binaries/resolvers/tsx.d.ts +0 -2
  301. package/dist/binaries/resolvers/tsx.js +0 -6
  302. package/dist/binaries/resolvers/yarn.d.ts +0 -2
  303. package/dist/binaries/types.d.ts +0 -11
  304. package/dist/types/plugins.d.ts +0 -42
  305. package/dist/util/handle-dependency.js +0 -63
  306. package/dist/util/protocols.d.ts +0 -9
  307. package/dist/util/protocols.js +0 -9
  308. /package/dist/{binaries/types.js → types/args.js} +0 -0
  309. /package/dist/types/{plugins.js → project.js} +0 -0
package/dist/index.js CHANGED
@@ -6,19 +6,19 @@ import { IssueCollector } from './IssueCollector.js';
6
6
  import { IssueFixer } from './IssueFixer.js';
7
7
  import { PrincipalFactory } from './PrincipalFactory.js';
8
8
  import { WorkspaceWorker } from './WorkspaceWorker.js';
9
- import { _getDependenciesFromScripts } from './binaries/index.js';
9
+ import { _getInputsFromScripts } from './binaries/index.js';
10
10
  import { getCompilerExtensions, getIncludedCompilers } from './compilers/index.js';
11
- import { getFilteredScripts } from './manifest/helpers.js';
12
11
  import { debugLog, debugLogArray, debugLogObject } from './util/debug.js';
13
12
  import { getOrCreateFileNode, updateImportMap } from './util/dependency-graph.js';
14
13
  import { getGitIgnoredHandler } from './util/glob-core.js';
15
14
  import { _glob, negate } from './util/glob.js';
16
- import { getReferencedDependencyHandler } from './util/handle-dependency.js';
15
+ import { getReferencedDependencyHandler } from './util/handle-referenced-dependency.js';
17
16
  import { getHasStrictlyNsReferences, getType } from './util/has-strictly-ns-references.js';
17
+ import { isConfigPattern, isEntry, isProductionEntry, toProductionEntry } from './util/input.js';
18
18
  import { getIsIdentifierReferencedHandler } from './util/is-identifier-referenced.js';
19
19
  import { getPackageNameFromModuleSpecifier } from './util/modules.js';
20
20
  import { getEntryPathsFromManifest } from './util/package-json.js';
21
- import { dirname, join } from './util/path.js';
21
+ import { dirname, isAbsolute, join, relative } from './util/path.js';
22
22
  import { findMatch } from './util/regex.js';
23
23
  import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from './util/tag.js';
24
24
  import { augmentWorkspace, getToSourcePathHandler } from './util/to-source-path.js';
@@ -52,47 +52,39 @@ export const main = async (unresolvedConfiguration) => {
52
52
  const isReportClassMembers = report.classMembers;
53
53
  const isSkipLibs = !(isIncludeLibs || isReportClassMembers);
54
54
  const collector = new IssueCollector({ cwd, rules, filters });
55
+ const allConfigFilePaths = new Set();
55
56
  const enabledPluginsStore = new Map();
56
57
  const o = () => workspaces.map(w => ({ pkgName: w.pkgName, name: w.name, config: w.config, ancestors: w.ancestors }));
57
58
  debugLogObject('*', 'Included workspaces', () => workspaces.map(w => w.pkgName));
58
59
  debugLogObject('*', 'Included workspace configs', o);
59
60
  const isGitIgnored = await getGitIgnoredHandler({ cwd, gitignore });
60
61
  const toSourceFilePath = getToSourcePathHandler(chief);
61
- const handleReferencedDependency = getReferencedDependencyHandler(collector, deputy, chief);
62
+ const getReferencedInternalFilePath = getReferencedDependencyHandler(collector, deputy, chief, isGitIgnored);
62
63
  const shouldIgnore = getShouldIgnoreHandler(isProduction);
63
64
  const shouldIgnoreTags = getShouldIgnoreTagHandler(tags);
64
65
  for (const workspace of workspaces) {
65
- const { name, dir, ancestors, pkgName, manifestPath } = workspace;
66
- streamer.cast(`Analyzing workspace ${name}...`);
66
+ const { name, dir, manifestPath } = workspace;
67
67
  const manifest = chief.getManifestForWorkspace(name);
68
- const { ignoreBinaries, ignoreDependencies } = chief.getIgnores(name);
69
68
  if (!manifest)
70
69
  continue;
70
+ const { ignoreBinaries, ignoreDependencies } = chief.getIgnores(name);
71
71
  deputy.addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreBinaries, ignoreDependencies });
72
+ }
73
+ for (const workspace of workspaces) {
74
+ const { name, dir, ancestors, pkgName } = workspace;
75
+ streamer.cast(`Analyzing workspace ${name}...`);
76
+ const manifest = chief.getManifestForWorkspace(name);
77
+ if (!manifest) {
78
+ continue;
79
+ }
72
80
  const dependencies = deputy.getDependencies(name);
73
81
  const compilers = getIncludedCompilers(chief.config.syncCompilers, chief.config.asyncCompilers, dependencies);
74
82
  const extensions = getCompilerExtensions(compilers);
75
83
  const config = chief.getConfigForWorkspace(name, extensions);
76
- const filteredScripts = getFilteredScripts({ isProduction, scripts: manifest.scripts });
77
- const manifestScripts = Object.values(filteredScripts);
78
- const manifestScriptNames = new Set(Object.keys(manifest.scripts ?? {}));
79
- const { isFile, compilerOptions, definitionPaths } = await loadTSConfig(join(dir, tsConfigFile ?? 'tsconfig.json'));
84
+ const tsConfigFilePath = join(dir, tsConfigFile ?? 'tsconfig.json');
85
+ const { isFile, compilerOptions, definitionPaths } = await loadTSConfig(tsConfigFilePath);
80
86
  if (isFile)
81
87
  augmentWorkspace(workspace, dir, compilerOptions);
82
- const principal = factory.getPrincipal({
83
- cwd: dir,
84
- paths: config.paths,
85
- isFile,
86
- compilerOptions,
87
- compilers,
88
- pkgName,
89
- isIsolateWorkspaces,
90
- isSkipLibs,
91
- isWatch,
92
- toSourceFilePath,
93
- isCache,
94
- cacheLocation,
95
- });
96
88
  const worker = new WorkspaceWorker({
97
89
  name,
98
90
  dir,
@@ -100,29 +92,64 @@ export const main = async (unresolvedConfiguration) => {
100
92
  config,
101
93
  manifest,
102
94
  dependencies,
95
+ getReferencedInternalFilePath: (input) => getReferencedInternalFilePath(input, workspace),
103
96
  isProduction,
104
97
  isStrict,
105
98
  rootIgnore: chief.config.ignore,
106
99
  negatedWorkspacePatterns: chief.getNegatedWorkspacePatterns(name),
100
+ ignoredWorkspacePatterns: chief.getIgnoredWorkspacesFor(name),
107
101
  enabledPluginsInAncestors: ancestors.flatMap(ancestor => enabledPluginsStore.get(ancestor) ?? []),
108
102
  isCache,
109
103
  cacheLocation,
104
+ allConfigFilePaths,
110
105
  });
111
106
  await worker.init();
112
- principal.addEntryPaths(definitionPaths);
107
+ const deps = new Set();
113
108
  debugLogArray(name, 'Definition paths', definitionPaths);
109
+ for (const id of definitionPaths)
110
+ deps.add(toProductionEntry(id, { containingFilePath: tsConfigFilePath }));
114
111
  const ignore = worker.getIgnorePatterns();
115
112
  const sharedGlobOptions = { cwd, dir, gitignore };
116
113
  collector.addIgnorePatterns(ignore.map(pattern => join(cwd, pattern)));
117
- const options = { manifestScriptNames, cwd: dir, dependencies };
118
- const dependenciesFromManifest = _getDependenciesFromScripts(manifestScripts, options);
119
- principal.addReferencedDependencies(name, new Set(dependenciesFromManifest.map(id => [manifestPath, id])));
120
114
  const entryPathsFromManifest = await getEntryPathsFromManifest(manifest, { ...sharedGlobOptions, ignore });
121
115
  debugLogArray(name, 'Entry paths in package.json', entryPathsFromManifest);
122
- principal.addEntryPaths(entryPathsFromManifest);
123
- const { referencedDependencies, enabledPlugins, entryFilePatterns, productionEntryFilePatterns } = await worker.findDependenciesByPlugins();
124
- enabledPluginsStore.set(name, enabledPlugins);
125
- principal.addReferencedDependencies(name, referencedDependencies);
116
+ for (const id of entryPathsFromManifest.map(id => toProductionEntry(id)))
117
+ deps.add(id);
118
+ const dependenciesFromPlugins = await worker.findDependenciesByPlugins();
119
+ for (const id of dependenciesFromPlugins)
120
+ deps.add(id);
121
+ enabledPluginsStore.set(name, worker.enabledPlugins);
122
+ const principal = factory.createPrincipal({
123
+ cwd: dir,
124
+ paths: config.paths,
125
+ isFile,
126
+ compilerOptions,
127
+ compilers,
128
+ pkgName,
129
+ isIsolateWorkspaces,
130
+ isSkipLibs,
131
+ isWatch,
132
+ toSourceFilePath,
133
+ isCache,
134
+ cacheLocation,
135
+ });
136
+ const entryFilePatterns = new Set();
137
+ const productionEntryFilePatterns = new Set();
138
+ for (const dependency of deps) {
139
+ const s = dependency.specifier;
140
+ if (isEntry(dependency)) {
141
+ entryFilePatterns.add(isAbsolute(s) ? relative(dir, s) : s);
142
+ }
143
+ else if (isProductionEntry(dependency)) {
144
+ productionEntryFilePatterns.add(isAbsolute(s) ? relative(dir, s) : s);
145
+ }
146
+ else if (!isConfigPattern(dependency)) {
147
+ const ws = (dependency.containingFilePath && chief.findWorkspaceByFilePath(dependency.containingFilePath)) || workspace;
148
+ const specifierFilePath = getReferencedInternalFilePath(dependency, ws);
149
+ if (specifierFilePath)
150
+ principal.addEntryPath(specifierFilePath);
151
+ }
152
+ }
126
153
  if (isProduction) {
127
154
  const negatedEntryPatterns = Array.from(entryFilePatterns).map(negate);
128
155
  {
@@ -160,7 +187,7 @@ export const main = async (unresolvedConfiguration) => {
160
187
  principal.addProjectPath(projectPath);
161
188
  }
162
189
  {
163
- const patterns = [...entryFilePatterns, ...productionEntryFilePatterns];
190
+ const patterns = worker.getPluginEntryFilePatterns([...entryFilePatterns, ...productionEntryFilePatterns]);
164
191
  const pluginWorkspaceEntryPaths = await _glob({ ...sharedGlobOptions, patterns });
165
192
  debugLogArray(name, 'Plugin entry paths', pluginWorkspaceEntryPaths);
166
193
  principal.addEntryPaths(pluginWorkspaceEntryPaths, { skipExportsAnalysis: true });
@@ -220,12 +247,21 @@ export const main = async (unresolvedConfiguration) => {
220
247
  file.internalImportCache = imports.internal;
221
248
  graph.set(filePath, file);
222
249
  if (scripts && scripts.size > 0) {
223
- const cwd = dirname(filePath);
224
250
  const dependencies = deputy.getDependencies(workspace.name);
225
251
  const manifestScriptNames = new Set();
226
- const specifiers = _getDependenciesFromScripts(scripts, { cwd, manifestScriptNames, dependencies });
252
+ const rootCwd = cwd;
253
+ const options = {
254
+ cwd: dirname(filePath),
255
+ rootCwd,
256
+ containingFilePath: filePath,
257
+ dependencies,
258
+ manifestScriptNames,
259
+ };
260
+ const specifiers = _getInputsFromScripts(scripts, options);
227
261
  for (const specifier of specifiers) {
228
- const specifierFilePath = handleReferencedDependency(specifier, filePath, workspace);
262
+ specifier.containingFilePath = filePath;
263
+ specifier.dir = cwd;
264
+ const specifierFilePath = getReferencedInternalFilePath(specifier, workspace);
229
265
  if (specifierFilePath)
230
266
  analyzeSourceFile(specifierFilePath, principal);
231
267
  }
@@ -234,14 +270,6 @@ export const main = async (unresolvedConfiguration) => {
234
270
  };
235
271
  for (const principal of principals) {
236
272
  principal.init();
237
- for (const [containingFilePath, specifier, workspaceName] of principal.referencedDependencies) {
238
- const workspace = chief.findWorkspaceByName(workspaceName);
239
- if (workspace) {
240
- const specifierFilePath = handleReferencedDependency(specifier, containingFilePath, workspace);
241
- if (specifierFilePath && !isGitIgnored(specifierFilePath))
242
- principal.addEntryPath(specifierFilePath);
243
- }
244
- }
245
273
  streamer.cast('Running async compilers...');
246
274
  await principal.runAsyncCompilers();
247
275
  streamer.cast('Analyzing source files...');
@@ -5,9 +5,5 @@ type LoadPackageManifestOptions = {
5
5
  cwd: string;
6
6
  };
7
7
  export declare const loadPackageManifest: ({ dir, packageName, cwd }: LoadPackageManifestOptions) => any;
8
- type GetFilteredScriptsOptions = {
9
- isProduction: boolean;
10
- scripts?: Scripts;
11
- };
12
- export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) => Scripts;
8
+ export declare const getFilteredScripts: (scripts: Scripts) => Scripts[];
13
9
  export {};
@@ -14,16 +14,17 @@ export const loadPackageManifest = ({ dir, packageName, cwd }) => {
14
14
  }
15
15
  }
16
16
  };
17
- export const getFilteredScripts = ({ isProduction, scripts }) => {
17
+ export const getFilteredScripts = (scripts) => {
18
18
  if (!scripts)
19
- return {};
20
- if (!isProduction)
21
- return scripts;
19
+ return [{}, {}];
22
20
  const scriptFilter = new Set(['start', 'postinstall']);
23
- const filteredScripts = {};
21
+ const productionScripts = {};
22
+ const developmentScripts = {};
24
23
  for (const scriptName in scripts) {
25
24
  if (scriptFilter.has(scriptName))
26
- filteredScripts[scriptName] = scripts[scriptName];
25
+ productionScripts[scriptName] = scripts[scriptName];
26
+ else
27
+ developmentScripts[scriptName] = scripts[scriptName];
27
28
  }
28
- return filteredScripts;
29
+ return [productionScripts, developmentScripts];
29
30
  };
@@ -1,8 +1,8 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { PluginConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: import("#p/types/config.js").IgnorePatterns;
5
+ enablers: string[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
8
  entry: string[];
@@ -1,4 +1,5 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { toDeferResolve } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
2
3
  const title = '_template';
3
4
  const enablers = ['__PLUGIN_NAME__'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -6,8 +7,8 @@ const config = [];
6
7
  const entry = [];
7
8
  const production = [];
8
9
  const resolveConfig = async (config) => {
9
- const dependencies = config?.plugins ?? [];
10
- return [...dependencies];
10
+ const inputs = config?.plugins ?? [];
11
+ return [...inputs].map(toDeferResolve);
11
12
  };
12
13
  export default {
13
14
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { AngularCLIWorkspaceConfiguration } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,16 +1,16 @@
1
- import { join } from '#p/util/path.js';
2
- import { hasDependency } from '#p/util/plugin.js';
3
- import { toProductionEntryPattern } from '#p/util/protocols.js';
1
+ import { toConfig, toDependency, toProductionEntry } from '../../util/input.js';
2
+ import { join } from '../../util/path.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Angular';
5
5
  const enablers = ['@angular/cli'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['angular.json'];
8
8
  const production = [];
9
9
  const resolveConfig = async (config, options) => {
10
- const { cwd } = options;
10
+ const { cwd, configFilePath } = options;
11
11
  if (!config?.projects)
12
12
  return [];
13
- const dependencies = new Set();
13
+ const inputs = new Set();
14
14
  for (const project of Object.values(config.projects)) {
15
15
  if (!project.architect)
16
16
  return [];
@@ -18,23 +18,26 @@ const resolveConfig = async (config, options) => {
18
18
  const { options: opts } = target;
19
19
  const [packageName] = typeof target.builder === 'string' ? target.builder.split(':') : [];
20
20
  if (typeof packageName === 'string')
21
- dependencies.add(packageName);
21
+ inputs.add(toDependency(packageName));
22
22
  if (opts) {
23
23
  if ('main' in opts && typeof opts.main === 'string') {
24
- dependencies.add(toProductionEntryPattern(join(cwd, opts.main)));
24
+ inputs.add(toProductionEntry(join(cwd, opts.main)));
25
25
  }
26
26
  if ('browser' in opts && typeof opts.browser === 'string') {
27
- dependencies.add(toProductionEntryPattern(join(cwd, opts.browser)));
27
+ inputs.add(toProductionEntry(join(cwd, opts.browser)));
28
28
  }
29
29
  if ('ssr' in opts && opts.ssr && typeof opts.ssr === 'object') {
30
30
  if ('entry' in opts.ssr && typeof opts.ssr.entry === 'string') {
31
- dependencies.add(toProductionEntryPattern(join(cwd, opts.ssr.entry)));
31
+ inputs.add(toProductionEntry(join(cwd, opts.ssr.entry)));
32
32
  }
33
33
  }
34
+ if ('tsConfig' in opts && typeof opts.tsConfig === 'string') {
35
+ inputs.add(toConfig('typescript', opts.tsConfig, configFilePath));
36
+ }
34
37
  }
35
38
  }
36
39
  }
37
- return Array.from(dependencies);
40
+ return Array.from(inputs);
38
41
  };
39
42
  export default {
40
43
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, Resolve } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, Resolve } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
@@ -1,18 +1,19 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { toDependency } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
2
3
  const title = 'Astro';
3
4
  const enablers = ['astro'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
6
  const entry = ['astro.config.{js,cjs,mjs,ts}', 'src/content/config.ts'];
6
7
  const production = ['src/pages/**/*.{astro,mdx,js,ts}', 'src/content/**/*.mdx'];
7
8
  const resolve = options => {
8
- const { isProduction, manifest } = options;
9
- const dependencies = [];
9
+ const { manifest, isProduction } = options;
10
+ const inputs = [];
10
11
  if (!isProduction &&
11
12
  manifest.scripts &&
12
13
  Object.values(manifest.scripts).some(script => /(?<=^|\s)astro(\s|\s.+\s)check(?=\s|$)/.test(script))) {
13
- dependencies.push('@astrojs/check');
14
+ inputs.push(toDependency('@astrojs/check'));
14
15
  }
15
- return dependencies;
16
+ return inputs;
16
17
  };
17
18
  export default {
18
19
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
2
2
  import type { AvaConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,5 +1,5 @@
1
- import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
2
- import { toEntryPattern } from '../../util/protocols.js';
1
+ import { toEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Ava';
4
4
  const enablers = ['ava'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -19,7 +19,7 @@ const entry = [
19
19
  const resolveEntryPaths = localConfig => {
20
20
  if (typeof localConfig === 'function')
21
21
  localConfig = localConfig();
22
- return (localConfig?.files ?? []).map(toEntryPattern);
22
+ return (localConfig?.files ?? []).map(toEntry);
23
23
  };
24
24
  const resolveConfig = async (localConfig, options) => {
25
25
  if (typeof localConfig === 'function')
@@ -27,8 +27,7 @@ const resolveConfig = async (localConfig, options) => {
27
27
  const nodeArgs = localConfig.nodeArguments ?? [];
28
28
  const requireArgs = (localConfig.require ?? []).map(require => `--require ${require}`);
29
29
  const fakeCommand = `node ${nodeArgs.join(' ')} ${requireArgs.join(' ')}`;
30
- const dependencies = getDependenciesFromScripts([fakeCommand], { ...options, knownGlobalsOnly: true });
31
- return [...dependencies];
30
+ return options.getInputsFromScripts(fakeCommand, { knownBinsOnly: true });
32
31
  };
33
32
  export default {
34
33
  title,
@@ -1,4 +1,4 @@
1
- import { isAbsolute, isInternal } from '#p/util/path.js';
1
+ import { isAbsolute, isInternal } from '../../util/path.js';
2
2
  export const resolveName = (identifier, namespace) => {
3
3
  if (isAbsolute(identifier) || isInternal(identifier))
4
4
  return identifier;
@@ -1,6 +1,7 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
+ import { type Input } from '../../util/input.js';
2
3
  import type { BabelConfig, BabelConfigObj } from './types.js';
3
- export declare const getDependenciesFromConfig: (config: BabelConfigObj) => string[];
4
+ export declare const getDependenciesFromConfig: (config: BabelConfigObj) => Input[];
4
5
  declare const _default: {
5
6
  title: string;
6
7
  enablers: RegExp[];
@@ -1,5 +1,6 @@
1
- import { compact } from '#p/util/array.js';
2
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { compact } from '../../util/array.js';
2
+ import { toDeferResolve } from '../../util/input.js';
3
+ import { hasDependency } from '../../util/plugin.js';
3
4
  import { api, resolveName } from './helpers.js';
4
5
  const title = 'Babel';
5
6
  const enablers = [/^@babel\//];
@@ -11,7 +12,7 @@ export const getDependenciesFromConfig = (config) => {
11
12
  const plugins = config.plugins?.flatMap(getName).map(name => resolveName(name, 'plugin')) ?? [];
12
13
  const nested = config.env ? Object.values(config.env).flatMap(getDependenciesFromConfig) : [];
13
14
  const overrides = config.overrides ? [config.overrides].flat().flatMap(getDependenciesFromConfig) : [];
14
- return compact([...presets, ...plugins, ...nested, ...overrides]);
15
+ return compact([...presets.map(toDeferResolve), ...plugins.map(toDeferResolve), ...nested, ...overrides]);
15
16
  };
16
17
  const resolveConfig = async (config) => {
17
18
  if (typeof config === 'function')
@@ -0,0 +1,10 @@
1
+ import type { ParsedArgs } from 'minimist';
2
+ declare const _default: {
3
+ title: string;
4
+ args: {
5
+ args: (args: string[]) => string[];
6
+ boolean: string[];
7
+ fromArgs: (parsed: ParsedArgs, args: string[]) => string[];
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { argsFrom } from '../../binaries/util.js';
2
+ const title = 'c8';
3
+ const args = {
4
+ args: (args) => args.filter(arg => arg !== 'check-coverage'),
5
+ boolean: ['all', 'check-coverage', 'clean', 'exclude-after-remap', 'per-file', 'skip-full'],
6
+ fromArgs: (parsed, args) => argsFrom(args, parsed._[0]),
7
+ };
8
+ export default {
9
+ title,
10
+ args,
11
+ };
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { CapacitorConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,6 +1,7 @@
1
- import { isFile } from '#p/util/fs.js';
2
- import { join } from '#p/util/path.js';
3
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { isFile } from '../../util/fs.js';
2
+ import { toDependency } from '../../util/input.js';
3
+ import { join } from '../../util/path.js';
4
+ import { hasDependency } from '../../util/plugin.js';
4
5
  const title = 'Capacitor';
5
6
  const enablers = [/^@capacitor\//];
6
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -10,7 +11,7 @@ const resolveConfig = async (config, { configFileDir }) => {
10
11
  const plugins = config.includePlugins ?? [];
11
12
  const android = (await exists('android/capacitor.settings.gradle')) ? ['@capacitor/android'] : [];
12
13
  const ios = (await exists('ios/App/Podfile')) ? ['@capacitor/ios'] : [];
13
- return [...plugins, ...android, ...ios];
14
+ return [...plugins, ...android, ...ios].map(toDependency);
14
15
  };
15
16
  export default {
16
17
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { ChangesetsConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,14 +1,15 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { toDependency } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
2
3
  const title = 'Changesets';
3
4
  const enablers = ['@changesets/cli'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
6
  const config = ['.changeset/config.json'];
6
7
  const resolveConfig = config => {
7
- return Array.isArray(config.changelog)
8
+ return (Array.isArray(config.changelog)
8
9
  ? [config.changelog[0]]
9
10
  : typeof config.changelog === 'string'
10
11
  ? [config.changelog]
11
- : [];
12
+ : []).map(toDependency);
12
13
  };
13
14
  export default {
14
15
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { CommitizenConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,11 +1,12 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { toDependency } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
2
3
  const title = 'Commitizen';
3
4
  const enablers = ['commitizen'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
6
  const packageJsonPath = 'config.commitizen';
6
7
  const config = ['.czrc', '.cz.json', 'package.json'];
7
8
  const resolveConfig = config => {
8
- return config.path ? [config.path] : [];
9
+ return config.path ? [toDependency(config.path)] : [];
9
10
  };
10
11
  export default {
11
12
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { CommitLintConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,4 +1,6 @@
1
- import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
1
+ import { toDependency } from '../../util/input.js';
2
+ import { toCosmiconfig } from '../../util/plugin-config.js';
3
+ import { hasDependency } from '../../util/plugin.js';
2
4
  const title = 'commitlint';
3
5
  const enablers = ['@commitlint/cli'];
4
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -19,7 +21,7 @@ const resolveConfig = async (config) => {
19
21
  ? [parserPreset.path ?? parserPreset]
20
22
  : []
21
23
  : [];
22
- return [...extendsConfigs, ...plugins, ...formatter, ...parserPresetPaths];
24
+ return [...extendsConfigs, ...plugins, ...formatter, ...parserPresetPaths].map(toDependency);
23
25
  };
24
26
  export default {
25
27
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
2
  import type { CSpellConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,4 +1,5 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { toDeferResolve } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
2
3
  const title = 'CSpell';
3
4
  const enablers = ['cspell'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -9,7 +10,7 @@ const config = [
9
10
  'c{s,S}pell.json',
10
11
  ];
11
12
  const resolveConfig = config => {
12
- return config.import ?? [];
13
+ return (config.import ?? []).map(toDeferResolve);
13
14
  };
14
15
  export default {
15
16
  title,
@@ -1,8 +1,8 @@
1
- import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
2
2
  import type { CucumberConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: import("#p/types/config.js").IgnorePatterns;
5
+ enablers: string[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
8
  entry: string[];
@@ -1,17 +1,17 @@
1
- import { hasDependency } from '#p/util/plugin.js';
2
- import { toEntryPattern } from '../../util/protocols.js';
1
+ import { toDeferResolve, toEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Cucumber';
4
4
  const enablers = ['@cucumber/cucumber'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
6
  const config = ['cucumber.{json,yaml,yml,js,cjs,mjs}'];
7
7
  const entry = ['features/**/*.@(js|cjs|mjs)'];
8
8
  const resolveEntryPaths = config => {
9
- return (config?.import ? config.import : []).map(toEntryPattern);
9
+ return (config?.import ? config.import : []).map(toEntry);
10
10
  };
11
11
  const resolveConfig = config => {
12
12
  const formatters = config?.format ? config.format : [];
13
13
  const requires = config?.require ? config.require : [];
14
- return [...formatters, ...requires];
14
+ return [...formatters, ...requires].map(toDeferResolve);
15
15
  };
16
16
  export default {
17
17
  title,
@@ -1,3 +1,3 @@
1
- import type { PluginOptions } from '#p/types/plugins.js';
1
+ import type { PluginOptions } from '../../types/config.js';
2
2
  import type { CypressConfig } from './types.js';
3
3
  export declare const resolveDependencies: (config: CypressConfig, options: PluginOptions) => Promise<string[]>;