knip 5.33.3 → 5.34.1

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 (304) 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 -23
  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 +17 -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/package-manager/npm.d.ts +2 -0
  23. package/dist/binaries/package-manager/npm.js +8 -0
  24. package/dist/binaries/package-manager/npx.d.ts +2 -0
  25. package/dist/binaries/{resolvers → package-manager}/npx.js +6 -6
  26. package/dist/binaries/package-manager/pnpm.d.ts +2 -0
  27. package/dist/binaries/{resolvers → package-manager}/pnpm.js +6 -3
  28. package/dist/binaries/package-manager/yarn.d.ts +2 -0
  29. package/dist/binaries/{resolvers → package-manager}/yarn.js +9 -7
  30. package/dist/binaries/plugins.d.ts +2 -0
  31. package/dist/binaries/plugins.js +61 -0
  32. package/dist/binaries/util.d.ts +2 -2
  33. package/dist/binaries/util.js +5 -25
  34. package/dist/compilers/index.d.ts +70 -0
  35. package/dist/constants.d.ts +1 -0
  36. package/dist/constants.js +2 -1
  37. package/dist/index.js +74 -46
  38. package/dist/manifest/helpers.d.ts +1 -5
  39. package/dist/manifest/helpers.js +8 -7
  40. package/dist/plugins/_template/index.d.ts +2 -2
  41. package/dist/plugins/_template/index.js +4 -3
  42. package/dist/plugins/angular/index.d.ts +1 -1
  43. package/dist/plugins/angular/index.js +13 -10
  44. package/dist/plugins/astro/index.d.ts +1 -1
  45. package/dist/plugins/astro/index.js +6 -5
  46. package/dist/plugins/ava/index.d.ts +1 -1
  47. package/dist/plugins/ava/index.js +4 -5
  48. package/dist/plugins/babel/helpers.js +1 -1
  49. package/dist/plugins/babel/index.d.ts +3 -2
  50. package/dist/plugins/babel/index.js +4 -3
  51. package/dist/plugins/c8/index.d.ts +10 -0
  52. package/dist/plugins/c8/index.js +11 -0
  53. package/dist/plugins/capacitor/index.d.ts +1 -1
  54. package/dist/plugins/capacitor/index.js +5 -4
  55. package/dist/plugins/changesets/index.d.ts +1 -1
  56. package/dist/plugins/changesets/index.js +4 -3
  57. package/dist/plugins/commitizen/index.d.ts +1 -1
  58. package/dist/plugins/commitizen/index.js +3 -2
  59. package/dist/plugins/commitlint/index.d.ts +1 -1
  60. package/dist/plugins/commitlint/index.js +4 -2
  61. package/dist/plugins/cspell/index.d.ts +1 -1
  62. package/dist/plugins/cspell/index.js +3 -2
  63. package/dist/plugins/cucumber/index.d.ts +2 -2
  64. package/dist/plugins/cucumber/index.js +4 -4
  65. package/dist/plugins/cypress/helpers.d.ts +1 -1
  66. package/dist/plugins/cypress/helpers.js +3 -4
  67. package/dist/plugins/cypress/index.d.ts +1 -1
  68. package/dist/plugins/cypress/index.js +6 -5
  69. package/dist/plugins/dotenv/index.d.ts +8 -0
  70. package/dist/plugins/dotenv/index.js +9 -0
  71. package/dist/plugins/drizzle/index.d.ts +1 -1
  72. package/dist/plugins/drizzle/index.js +3 -3
  73. package/dist/plugins/eleventy/index.d.ts +1 -1
  74. package/dist/plugins/eleventy/index.js +6 -6
  75. package/dist/plugins/eslint/helpers.d.ts +4 -5
  76. package/dist/plugins/eslint/helpers.js +10 -32
  77. package/dist/plugins/eslint/index.d.ts +1 -1
  78. package/dist/plugins/eslint/index.js +3 -6
  79. package/dist/plugins/gatsby/index.d.ts +1 -1
  80. package/dist/plugins/gatsby/index.js +6 -3
  81. package/dist/plugins/github-actions/index.d.ts +1 -1
  82. package/dist/plugins/github-actions/index.js +23 -7
  83. package/dist/plugins/graphql-codegen/index.d.ts +1 -1
  84. package/dist/plugins/graphql-codegen/index.js +7 -7
  85. package/dist/plugins/husky/index.d.ts +1 -1
  86. package/dist/plugins/husky/index.js +4 -3
  87. package/dist/plugins/index.d.ts +685 -77
  88. package/dist/plugins/index.js +170 -77
  89. package/dist/plugins/jest/index.d.ts +1 -1
  90. package/dist/plugins/jest/index.js +22 -24
  91. package/dist/plugins/ladle/index.d.ts +2 -2
  92. package/dist/plugins/ladle/index.js +4 -4
  93. package/dist/plugins/lefthook/index.d.ts +1 -1
  94. package/dist/plugins/lefthook/index.js +18 -14
  95. package/dist/plugins/lint-staged/index.d.ts +1 -1
  96. package/dist/plugins/lint-staged/index.js +6 -5
  97. package/dist/plugins/linthtml/index.d.ts +1 -1
  98. package/dist/plugins/linthtml/index.js +6 -8
  99. package/dist/plugins/lockfile-lint/index.d.ts +2 -2
  100. package/dist/plugins/lockfile-lint/index.js +2 -1
  101. package/dist/plugins/lost-pixel/index.d.ts +2 -2
  102. package/dist/plugins/lost-pixel/index.js +1 -1
  103. package/dist/plugins/markdownlint/index.d.ts +1 -1
  104. package/dist/plugins/markdownlint/index.js +3 -2
  105. package/dist/plugins/mocha/index.d.ts +4 -1
  106. package/dist/plugins/mocha/index.js +8 -4
  107. package/dist/plugins/moonrepo/index.d.ts +2 -2
  108. package/dist/plugins/moonrepo/index.js +4 -4
  109. package/dist/plugins/msw/index.d.ts +1 -1
  110. package/dist/plugins/msw/index.js +4 -4
  111. package/dist/plugins/nest/index.d.ts +2 -2
  112. package/dist/plugins/nest/index.js +4 -3
  113. package/dist/plugins/netlify/index.d.ts +1 -1
  114. package/dist/plugins/netlify/index.js +6 -6
  115. package/dist/plugins/next/index.d.ts +1 -1
  116. package/dist/plugins/next/index.js +1 -1
  117. package/dist/plugins/node/index.d.ts +8 -0
  118. package/dist/plugins/node/index.js +9 -0
  119. package/dist/plugins/node-test-runner/index.d.ts +1 -1
  120. package/dist/plugins/nodemon/index.d.ts +10 -0
  121. package/dist/plugins/nodemon/index.js +11 -0
  122. package/dist/plugins/npm-package-json-lint/index.d.ts +1 -1
  123. package/dist/plugins/npm-package-json-lint/index.js +4 -2
  124. package/dist/plugins/nuxt/index.d.ts +1 -1
  125. package/dist/plugins/nuxt/index.js +4 -4
  126. package/dist/plugins/nx/index.d.ts +5 -1
  127. package/dist/plugins/nx/index.js +10 -8
  128. package/dist/plugins/nyc/index.d.ts +1 -1
  129. package/dist/plugins/nyc/index.js +3 -2
  130. package/dist/plugins/oclif/index.d.ts +2 -2
  131. package/dist/plugins/oclif/index.js +3 -2
  132. package/dist/plugins/playwright/index.d.ts +13 -1
  133. package/dist/plugins/playwright/index.js +13 -6
  134. package/dist/plugins/playwright-ct/index.d.ts +9 -3
  135. package/dist/plugins/playwright-ct/index.js +3 -2
  136. package/dist/plugins/playwright-test/index.d.ts +13 -0
  137. package/dist/plugins/playwright-test/index.js +16 -0
  138. package/dist/plugins/postcss/index.d.ts +1 -1
  139. package/dist/plugins/postcss/index.js +5 -2
  140. package/dist/plugins/preconstruct/index.d.ts +1 -1
  141. package/dist/plugins/preconstruct/index.js +3 -3
  142. package/dist/plugins/prettier/index.d.ts +1 -1
  143. package/dist/plugins/prettier/index.js +5 -5
  144. package/dist/plugins/react-cosmos/index.d.ts +2 -2
  145. package/dist/plugins/react-cosmos/index.js +5 -6
  146. package/dist/plugins/release-it/index.d.ts +1 -1
  147. package/dist/plugins/release-it/index.js +4 -3
  148. package/dist/plugins/remark/index.d.ts +1 -1
  149. package/dist/plugins/remark/index.js +3 -2
  150. package/dist/plugins/remix/index.d.ts +1 -1
  151. package/dist/plugins/remix/index.js +1 -1
  152. package/dist/plugins/rollup/index.d.ts +3 -1
  153. package/dist/plugins/rollup/index.js +8 -1
  154. package/dist/plugins/rsbuild/index.d.ts +2 -2
  155. package/dist/plugins/rsbuild/index.js +1 -1
  156. package/dist/plugins/rspack/index.d.ts +2 -2
  157. package/dist/plugins/rspack/index.js +4 -8
  158. package/dist/plugins/semantic-release/index.d.ts +1 -1
  159. package/dist/plugins/semantic-release/index.js +4 -2
  160. package/dist/plugins/sentry/index.d.ts +1 -1
  161. package/dist/plugins/sentry/index.js +1 -1
  162. package/dist/plugins/simple-git-hooks/index.d.ts +2 -2
  163. package/dist/plugins/simple-git-hooks/index.js +5 -5
  164. package/dist/plugins/size-limit/index.d.ts +2 -2
  165. package/dist/plugins/size-limit/index.js +2 -1
  166. package/dist/plugins/storybook/index.d.ts +1 -1
  167. package/dist/plugins/storybook/index.js +5 -5
  168. package/dist/plugins/stryker/index.d.ts +1 -1
  169. package/dist/plugins/stryker/index.js +3 -2
  170. package/dist/plugins/stylelint/index.d.ts +1 -1
  171. package/dist/plugins/stylelint/index.js +4 -3
  172. package/dist/plugins/svelte/index.d.ts +1 -1
  173. package/dist/plugins/svelte/index.js +1 -1
  174. package/dist/plugins/syncpack/index.d.ts +2 -3
  175. package/dist/plugins/syncpack/index.js +2 -4
  176. package/dist/plugins/tailwind/index.d.ts +1 -1
  177. package/dist/plugins/tailwind/index.js +1 -1
  178. package/dist/plugins/travis/index.d.ts +1 -1
  179. package/dist/plugins/travis/index.js +2 -3
  180. package/dist/plugins/ts-node/index.d.ts +15 -0
  181. package/dist/plugins/ts-node/index.js +12 -0
  182. package/dist/plugins/tsup/index.d.ts +4 -1
  183. package/dist/plugins/tsup/index.js +7 -3
  184. package/dist/plugins/tsx/index.d.ts +9 -0
  185. package/dist/plugins/tsx/index.js +10 -0
  186. package/dist/plugins/typedoc/index.d.ts +4 -1
  187. package/dist/plugins/typedoc/index.js +10 -3
  188. package/dist/plugins/typedoc/types.d.ts +1 -0
  189. package/dist/plugins/typescript/index.d.ts +11 -2
  190. package/dist/plugins/typescript/index.js +19 -34
  191. package/dist/plugins/unbuild/index.d.ts +1 -1
  192. package/dist/plugins/unbuild/index.js +3 -3
  193. package/dist/plugins/unocss/index.d.ts +2 -2
  194. package/dist/plugins/unocss/index.js +2 -1
  195. package/dist/plugins/vercel-og/index.d.ts +1 -1
  196. package/dist/plugins/vercel-og/index.js +1 -1
  197. package/dist/plugins/vike/index.d.ts +2 -2
  198. package/dist/plugins/vike/index.js +1 -1
  199. package/dist/plugins/vite/index.d.ts +3 -3
  200. package/dist/plugins/vite/index.js +2 -2
  201. package/dist/plugins/vitest/index.d.ts +4 -1
  202. package/dist/plugins/vitest/index.js +31 -20
  203. package/dist/plugins/vue/index.d.ts +1 -1
  204. package/dist/plugins/vue/index.js +10 -10
  205. package/dist/plugins/webdriver-io/index.d.ts +1 -1
  206. package/dist/plugins/webdriver-io/index.js +3 -2
  207. package/dist/plugins/webpack/index.d.ts +3 -5
  208. package/dist/plugins/webpack/index.js +18 -19
  209. package/dist/plugins/wireit/index.d.ts +1 -1
  210. package/dist/plugins/wireit/index.js +2 -2
  211. package/dist/plugins/wrangler/index.d.ts +1 -1
  212. package/dist/plugins/wrangler/index.js +3 -2
  213. package/dist/plugins/xo/index.d.ts +2 -2
  214. package/dist/plugins/xo/index.js +4 -4
  215. package/dist/plugins/yorkie/index.d.ts +1 -1
  216. package/dist/plugins/yorkie/index.js +6 -5
  217. package/dist/plugins.d.ts +7 -4
  218. package/dist/plugins.js +17 -10
  219. package/dist/reporters/symbols.js +1 -1
  220. package/dist/types/PluginNames.d.ts +2 -0
  221. package/dist/types/PluginNames.js +86 -0
  222. package/dist/types/args.d.ts +14 -0
  223. package/dist/types/config.d.ts +84 -21
  224. package/dist/types/package-json.d.ts +10 -0
  225. package/dist/types/project.d.ts +18 -0
  226. package/dist/typescript/get-imports-and-exports.d.ts +1 -11
  227. package/dist/typescript/get-imports-and-exports.js +3 -1
  228. package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
  229. package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
  230. package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
  231. package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +1 -1
  232. package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
  233. package/dist/typescript/visitors/dynamic-imports/resolveCall.d.ts +1 -1
  234. package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
  235. package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
  236. package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
  237. package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +1 -1
  238. package/dist/typescript/visitors/exports/index.d.ts +1 -1
  239. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
  240. package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
  241. package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
  242. package/dist/typescript/visitors/imports/index.d.ts +1 -1
  243. package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
  244. package/dist/typescript/visitors/index.d.ts +1 -1
  245. package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
  246. package/dist/typescript/visitors/scripts/execa.d.ts +1 -1
  247. package/dist/typescript/visitors/scripts/index.d.ts +1 -1
  248. package/dist/typescript/visitors/scripts/zx.d.ts +1 -1
  249. package/dist/util/create-workspace-graph.d.ts +1 -1
  250. package/dist/util/create-workspace-graph.js +7 -7
  251. package/dist/util/debug.d.ts +2 -2
  252. package/dist/util/debug.js +1 -1
  253. package/dist/util/glob.js +2 -2
  254. package/dist/util/handle-referenced-inputs.d.ts +5 -0
  255. package/dist/util/handle-referenced-inputs.js +86 -0
  256. package/dist/util/input.d.ts +37 -0
  257. package/dist/util/input.js +36 -0
  258. package/dist/util/map-workspaces.d.ts +5 -2
  259. package/dist/util/map-workspaces.js +6 -6
  260. package/dist/util/modules.d.ts +1 -0
  261. package/dist/util/modules.js +4 -3
  262. package/dist/util/object.d.ts +1 -0
  263. package/dist/util/object.js +19 -0
  264. package/dist/util/plugin-config.d.ts +24 -0
  265. package/dist/util/plugin-config.js +32 -0
  266. package/dist/util/plugin.d.ts +3 -31
  267. package/dist/util/plugin.js +9 -54
  268. package/dist/util/regex.js +3 -2
  269. package/dist/version.d.ts +1 -1
  270. package/dist/version.js +1 -1
  271. package/package.json +7 -10
  272. package/schema.json +28 -0
  273. package/dist/binaries/resolvers/bun.d.ts +0 -2
  274. package/dist/binaries/resolvers/c8.d.ts +0 -2
  275. package/dist/binaries/resolvers/c8.js +0 -11
  276. package/dist/binaries/resolvers/dotenv.d.ts +0 -2
  277. package/dist/binaries/resolvers/dotenv.js +0 -7
  278. package/dist/binaries/resolvers/fallback.d.ts +0 -2
  279. package/dist/binaries/resolvers/fallback.js +0 -26
  280. package/dist/binaries/resolvers/index.d.ts +0 -15
  281. package/dist/binaries/resolvers/index.js +0 -26
  282. package/dist/binaries/resolvers/node.d.ts +0 -4
  283. package/dist/binaries/resolvers/node.js +0 -11
  284. package/dist/binaries/resolvers/nodemon.d.ts +0 -2
  285. package/dist/binaries/resolvers/nodemon.js +0 -16
  286. package/dist/binaries/resolvers/npx.d.ts +0 -2
  287. package/dist/binaries/resolvers/nx.d.ts +0 -2
  288. package/dist/binaries/resolvers/nx.js +0 -9
  289. package/dist/binaries/resolvers/pnpm.d.ts +0 -2
  290. package/dist/binaries/resolvers/rollup.d.ts +0 -2
  291. package/dist/binaries/resolvers/rollup.js +0 -12
  292. package/dist/binaries/resolvers/ts-node.d.ts +0 -2
  293. package/dist/binaries/resolvers/ts-node.js +0 -16
  294. package/dist/binaries/resolvers/tsx.d.ts +0 -2
  295. package/dist/binaries/resolvers/tsx.js +0 -6
  296. package/dist/binaries/resolvers/yarn.d.ts +0 -2
  297. package/dist/binaries/types.d.ts +0 -11
  298. package/dist/types/plugins.d.ts +0 -42
  299. package/dist/util/handle-dependency.d.ts +0 -4
  300. package/dist/util/handle-dependency.js +0 -63
  301. package/dist/util/protocols.d.ts +0 -9
  302. package/dist/util/protocols.js +0 -9
  303. /package/dist/{binaries/types.js → types/args.js} +0 -0
  304. /package/dist/types/{plugins.js → project.js} +0 -0
@@ -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 { RemarkConfig } 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 = 'Remark';
3
4
  const enablers = ['remark-cli'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -14,7 +15,7 @@ const resolveConfig = config => {
14
15
  return [];
15
16
  })
16
17
  .map(plugin => (plugin.startsWith('remark-') ? plugin : `remark-${plugin}`)) ?? [];
17
- return plugins;
18
+ return plugins.map(toDeferResolve);
18
19
  };
19
20
  export default {
20
21
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  enablers: RegExp[];
@@ -1,4 +1,4 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Remix';
3
3
  const enablers = [/^@remix-run\//];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -1,8 +1,10 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { Args } from '../../types/args.js';
2
+ import type { IsPluginEnabled } from '../../types/config.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string[];
5
6
  isEnabled: IsPluginEnabled;
6
7
  entry: string[];
8
+ args: Args;
7
9
  };
8
10
  export default _default;
@@ -1,11 +1,18 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Rollup';
3
3
  const enablers = ['rollup'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const entry = ['rollup.config.{js,cjs,mjs,ts}'];
6
+ const args = {
7
+ alias: { plugin: ['p'] },
8
+ args: (args) => args.map(arg => (arg.startsWith('--watch.onEnd') ? `--_exec${arg.slice(13)}` : arg)),
9
+ fromArgs: ['_exec'],
10
+ resolve: ['plugin', 'configPlugin'],
11
+ };
6
12
  export default {
7
13
  title,
8
14
  enablers,
9
15
  isEnabled,
10
16
  entry,
17
+ args,
11
18
  };
@@ -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 { RsbuildConfig } 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
  resolveConfig: ResolveConfig<RsbuildConfig>;
@@ -1,4 +1,4 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Rsbuild';
3
3
  const enablers = ['@rsbuild/core'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -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 { WebpackConfig } from '../webpack/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
  resolveConfig: ResolveConfig<WebpackConfig>;
@@ -1,17 +1,13 @@
1
- import { hasDependency } from '#p/util/plugin.js';
2
- import { compact } from '../../util/array.js';
1
+ import { hasDependency } from '../../util/plugin.js';
3
2
  import { findWebpackDependenciesFromConfig } from '../webpack/index.js';
4
3
  const title = 'Rspack';
5
4
  const enablers = ['@rspack/core'];
6
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
6
  const config = ['rspack.config*.{js,ts,mjs,cjs}'];
8
7
  const resolveConfig = async (localConfig, options) => {
9
- const { cwd, isProduction } = options;
10
- const { entryPatterns, dependencies } = await findWebpackDependenciesFromConfig({ config: localConfig, cwd });
11
- const deps = Array.from(dependencies).filter(dependency => !dependency.startsWith('builtin:'));
12
- if (isProduction)
13
- return [...entryPatterns];
14
- return compact([...entryPatterns, ...deps]);
8
+ const { cwd } = options;
9
+ const inputs = await findWebpackDependenciesFromConfig({ config: localConfig, cwd });
10
+ return Array.from(inputs).filter(input => !input.specifier.startsWith('builtin:'));
15
11
  };
16
12
  export default {
17
13
  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 { SemanticReleaseConfig } 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 { toDeferResolve } from '../../util/input.js';
2
+ import { toCosmiconfig } from '../../util/plugin-config.js';
3
+ import { hasDependency } from '../../util/plugin.js';
2
4
  const title = 'Semantic Release';
3
5
  const enablers = ['semantic-release'];
4
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -6,7 +8,7 @@ const packageJsonPath = 'release';
6
8
  const config = ['package.json', ...toCosmiconfig('release')];
7
9
  const resolveConfig = config => {
8
10
  const plugins = (config?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
9
- return plugins;
11
+ return plugins.map(toDeferResolve);
10
12
  };
11
13
  export default {
12
14
  title,
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  enablers: RegExp[];
@@ -1,4 +1,4 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Sentry';
3
3
  const enablers = [/^@sentry\//];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -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
  packageJsonPath: string;
8
8
  config: string[];
@@ -1,4 +1,4 @@
1
- import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'simple-git-hooks';
3
3
  const enablers = ['simple-git-hooks'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -15,12 +15,12 @@ const resolveConfig = async (config, options) => {
15
15
  config = config();
16
16
  if (!config)
17
17
  return [];
18
- const dependencies = new Set();
18
+ const inputs = new Set();
19
19
  for (const hook of Object.values(config)) {
20
- for (const id of getDependenciesFromScripts(hook, options))
21
- dependencies.add(id);
20
+ for (const id of options.getInputsFromScripts(hook))
21
+ inputs.add(id);
22
22
  }
23
- return Array.from(dependencies);
23
+ return Array.from(inputs);
24
24
  };
25
25
  export default {
26
26
  title,
@@ -1,7 +1,7 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
- enablers: import("#p/types/config.js").IgnorePatterns;
4
+ enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  config: string[];
7
7
  };
@@ -1,4 +1,5 @@
1
- import { hasDependency, toLilconfig } from '#p/util/plugin.js';
1
+ import { toLilconfig } from '../../util/plugin-config.js';
2
+ import { hasDependency } from '../../util/plugin.js';
2
3
  const title = 'size-limit';
3
4
  const enablers = ['size-limit'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -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 { StorybookConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,6 +1,6 @@
1
- import { join, relative } from '#p/util/path.js';
2
- import { hasDependency } from '#p/util/plugin.js';
3
- import { toEntryPattern } from '../../util/protocols.js';
1
+ import { toDeferResolve, toDependency, toEntry } from '../../util/input.js';
2
+ import { join, relative } from '../../util/path.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Storybook';
5
5
  const enablers = [/^@storybook\//, '@nrwl/storybook'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -18,7 +18,7 @@ const resolveEntryPaths = async (localConfig, options) => {
18
18
  return relative(cwd, join(configFileDir, pattern.directory, pattern.files ?? stories[0]));
19
19
  });
20
20
  const patterns = [...restEntry, ...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : stories)];
21
- return patterns.map(toEntryPattern);
21
+ return patterns.map(toEntry);
22
22
  };
23
23
  const resolveConfig = async (localConfig) => {
24
24
  const addons = localConfig.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
@@ -30,7 +30,7 @@ const resolveConfig = async (localConfig) => {
30
30
  : [builder]
31
31
  : [];
32
32
  const frameworks = localConfig.framework?.name ? [localConfig.framework.name] : [];
33
- return [...addons, ...builderPackages, ...frameworks];
33
+ return [...addons.map(toDeferResolve), ...builderPackages.map(toDependency), ...frameworks.map(toDependency)];
34
34
  };
35
35
  export default {
36
36
  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 { StrykerConfig } 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 = 'Stryker';
3
4
  const enablers = ['@stryker-mutator/core'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -9,7 +10,7 @@ const resolveConfig = localConfig => {
9
10
  ? localConfig.checkers.map(checker => `@stryker-mutator/${checker}-checker`)
10
11
  : [];
11
12
  const plugins = localConfig.plugins ?? [];
12
- return [...runners, ...checkers, ...plugins];
13
+ return [...runners, ...checkers, ...plugins].map(toDeferResolve);
13
14
  };
14
15
  export default {
15
16
  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 { StyleLintConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,5 +1,6 @@
1
- import { isInternal } from '#p/util/path.js';
2
- import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
1
+ import { toDeferResolve } from '../../util/input.js';
2
+ import { toCosmiconfig } from '../../util/plugin-config.js';
3
+ import { hasDependency } from '../../util/plugin.js';
3
4
  const title = 'Stylelint';
4
5
  const enablers = ['stylelint'];
5
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -9,7 +10,7 @@ const resolve = (config) => {
9
10
  const plugins = config.plugins ? [config.plugins].flat() : [];
10
11
  const customSyntax = config.customSyntax ? [config.customSyntax] : [];
11
12
  const overrideConfigs = 'overrides' in config ? config.overrides.flatMap(resolve) : [];
12
- return [...extend, ...plugins, ...overrideConfigs, ...customSyntax].filter(id => !isInternal(id));
13
+ return [...[...extend, ...plugins, ...customSyntax].map(toDeferResolve), ...overrideConfigs];
13
14
  };
14
15
  const resolveConfig = config => resolve(config);
15
16
  export default {
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
@@ -1,4 +1,4 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  import { config as viteConfig } from '../vite/index.js';
3
3
  const title = 'Svelte';
4
4
  const enablers = ['svelte'];
@@ -1,9 +1,8 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
- enablers: import("#p/types/config.js").IgnorePatterns;
4
+ enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  config: string[];
7
- packageJsonPath: (manifest: import("../../types/package-json.js").PackageJson) => string;
8
7
  };
9
8
  export default _default;
@@ -1,14 +1,12 @@
1
- import { get } from '#p/util/object.js';
2
- import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
1
+ import { toCosmiconfig } from '../../util/plugin-config.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Syncpack';
4
4
  const enablers = ['syncpack'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
6
  const config = ['package.json', ...toCosmiconfig('syncpack')];
7
- const packageJsonPath = manifest => get(manifest, 'syncpack');
8
7
  export default {
9
8
  title,
10
9
  enablers,
11
10
  isEnabled,
12
11
  config,
13
- packageJsonPath,
14
12
  };
@@ -1,4 +1,4 @@
1
- import type { IsPluginEnabled } from '#p/types/plugins.js';
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
@@ -1,4 +1,4 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Tailwind';
3
3
  const enablers = ['tailwindcss'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -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
  declare const _default: {
3
3
  title: string;
4
4
  enablers: string;
@@ -1,5 +1,4 @@
1
- import { _glob } from '#p/util/glob.js';
2
- import { getDependenciesFromScripts } from '../../util/plugin.js';
1
+ import { _glob } from '../../util/glob.js';
3
2
  const title = 'Travis CI';
4
3
  const enablers = 'This plugin is enabled when a `.travis.yml` file is found in the root folder.';
5
4
  const isEnabled = async ({ cwd }) => (await _glob({ cwd, patterns: ['.travis.yml'] })).length > 0;
@@ -11,7 +10,7 @@ const resolveConfig = async (config, options) => {
11
10
  const beforeInstall = [config.before_install ?? []].flat();
12
11
  const beforeScript = [config.before_script ?? []].flat();
13
12
  const scripts = [...beforeDeploy, ...beforeInstall, ...beforeScript];
14
- return getDependenciesFromScripts(scripts, { ...options, knownGlobalsOnly: true });
13
+ return options.getInputsFromScripts(scripts, { knownBinsOnly: true });
15
14
  };
16
15
  export default {
17
16
  title,
@@ -0,0 +1,15 @@
1
+ declare const _default: {
2
+ title: string;
3
+ args: {
4
+ binaries: string[];
5
+ positional: boolean;
6
+ nodeImportArgs: boolean;
7
+ boolean: string[];
8
+ alias: {
9
+ transpileOnly: string[];
10
+ compilerHost: string[];
11
+ ignoreDiagnostics: string[];
12
+ };
13
+ };
14
+ };
15
+ export default _default;
@@ -0,0 +1,12 @@
1
+ const title = 'ts-node';
2
+ const args = {
3
+ binaries: [title],
4
+ positional: true,
5
+ nodeImportArgs: true,
6
+ boolean: ['transpileOnly', 'compilerHost', 'ignoreDiagnostics', 'swc', 'preferTsExts'],
7
+ alias: { transpileOnly: ['T'], compilerHost: ['H'], ignoreDiagnostics: ['D'] },
8
+ };
9
+ export default {
10
+ title,
11
+ args,
12
+ };
@@ -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 { TsupConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -6,5 +6,8 @@ declare const _default: {
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
8
  resolveConfig: ResolveConfig<TsupConfig>;
9
+ args: {
10
+ config: boolean;
11
+ };
9
12
  };
10
13
  export default _default;
@@ -1,5 +1,5 @@
1
- import { hasDependency } from '#p/util/plugin.js';
2
- import { toProductionEntryPattern } from '#p/util/protocols.js';
1
+ import { toProductionEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'tsup';
4
4
  const enablers = ['tsup'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -16,13 +16,17 @@ const resolveConfig = async (config) => {
16
16
  return config.entry;
17
17
  return Object.values(config.entry);
18
18
  })
19
- .map(toProductionEntryPattern);
19
+ .map(id => toProductionEntry(id));
20
20
  return entryPatterns;
21
21
  };
22
+ const args = {
23
+ config: true,
24
+ };
22
25
  export default {
23
26
  title,
24
27
  enablers,
25
28
  isEnabled,
26
29
  config,
27
30
  resolveConfig,
31
+ args,
28
32
  };
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ title: string;
3
+ args: {
4
+ positional: boolean;
5
+ nodeImportArgs: boolean;
6
+ args: (args: string[]) => string[];
7
+ };
8
+ };
9
+ export default _default;
@@ -0,0 +1,10 @@
1
+ const title = 'tsx';
2
+ const args = {
3
+ positional: true,
4
+ nodeImportArgs: true,
5
+ args: (args) => args.filter(arg => arg !== 'watch'),
6
+ };
7
+ export default {
8
+ title,
9
+ args,
10
+ };
@@ -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 { TypeDocConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
@@ -9,5 +9,8 @@ declare const _default: {
9
9
  resolveConfig: ResolveConfig<TypeDocConfig | {
10
10
  typedocOptions: TypeDocConfig;
11
11
  }>;
12
+ args: {
13
+ resolve: string[];
14
+ };
12
15
  };
13
16
  export default _default;
@@ -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 = 'TypeDoc';
3
4
  const enablers = ['typedoc'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -12,8 +13,13 @@ const config = [
12
13
  'tsconfig.json',
13
14
  ];
14
15
  const resolveConfig = config => {
15
- config = 'typedocOptions' in config ? config.typedocOptions : config;
16
- return config?.plugin ?? [];
16
+ const cfg = 'typedocOptions' in config ? config.typedocOptions : config;
17
+ const plugins = cfg?.plugin ?? [];
18
+ const themes = cfg?.theme ?? [];
19
+ return [...plugins, ...themes].map(toDeferResolve);
20
+ };
21
+ const args = {
22
+ resolve: ['plugin', 'theme'],
17
23
  };
18
24
  export default {
19
25
  title,
@@ -22,4 +28,5 @@ export default {
22
28
  packageJsonPath,
23
29
  config,
24
30
  resolveConfig,
31
+ args,
25
32
  };
@@ -1,3 +1,4 @@
1
1
  export type TypeDocConfig = {
2
2
  plugin?: string[];
3
+ theme?: string[];
3
4
  };
@@ -1,10 +1,19 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
1
+ import type { TsConfigJson } from 'type-fest';
2
+ import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string[];
5
6
  isEnabled: IsPluginEnabled;
6
7
  config: string[];
7
8
  production: string[];
8
- resolveConfig: ResolveConfig;
9
+ resolveConfig: ResolveConfig<TsConfigJson>;
10
+ args: {
11
+ binaries: string[];
12
+ string: string[];
13
+ alias: {
14
+ project: string[];
15
+ };
16
+ config: [string, (p: string) => string][];
17
+ };
9
18
  };
10
19
  export default _default;
@@ -1,48 +1,32 @@
1
- import { compact } from '#p/util/array.js';
2
- import { dirname, isInternal, join, toAbsolute } from '#p/util/path.js';
3
- import { hasDependency, loadJSON } from '#p/util/plugin.js';
4
- import { loadTSConfig } from '#p/util/tsconfig-loader.js';
1
+ import { compact } from '../../util/array.js';
2
+ import { toConfig, toDeferResolve, toProductionDependency } from '../../util/input.js';
3
+ import { join } from '../../util/path.js';
4
+ import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'TypeScript';
6
6
  const enablers = ['typescript'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
- const config = ['tsconfig.json', 'tsconfig.*.json'];
8
+ const config = ['tsconfig.json'];
9
9
  const production = [];
10
- const getExtends = async (configFilePath, internalExtends = new Set()) => {
11
- const filePath = configFilePath.replace(/(\.json)?$/, '.json');
12
- const localConfig = await loadJSON(filePath);
13
- if (!localConfig)
14
- return internalExtends;
15
- const extends_ = localConfig.extends ? [localConfig.extends].flat() : [];
16
- for (const extend of extends_) {
17
- if (isInternal(extend)) {
18
- const presetConfigPath = toAbsolute(extend, dirname(configFilePath));
19
- await getExtends(presetConfigPath, internalExtends);
20
- }
21
- }
22
- for (const extend of extends_) {
23
- if (isInternal(extend))
24
- internalExtends.add(toAbsolute(extend, dirname(configFilePath)));
25
- else
26
- internalExtends.add(extend);
27
- }
28
- return internalExtends;
29
- };
30
10
  const resolveConfig = async (localConfig, options) => {
31
- const { isProduction, configFileDir, configFileName } = options;
32
- const configFilePath = join(configFileDir, configFileName);
33
- const { compilerOptions } = await loadTSConfig(configFilePath);
34
- const extend = await getExtends(configFilePath);
11
+ const { compilerOptions } = localConfig;
12
+ const extend = localConfig.extends
13
+ ? [localConfig.extends].flat().map(specifier => toConfig('typescript', specifier, options.configFilePath))
14
+ : [];
35
15
  if (!(compilerOptions && localConfig))
36
- return [];
37
- const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
38
- if (isProduction)
39
- return [...jsx];
16
+ return extend;
17
+ const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(toProductionDependency);
40
18
  const types = compilerOptions.types ?? [];
41
19
  const plugins = Array.isArray(compilerOptions?.plugins)
42
20
  ? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
43
21
  : [];
44
22
  const importHelpers = compilerOptions?.importHelpers ? ['tslib'] : [];
45
- return compact([...extend, ...types, ...plugins, ...importHelpers, ...jsx]);
23
+ return compact([...extend, ...[...types, ...plugins, ...importHelpers].map(toDeferResolve), ...jsx]);
24
+ };
25
+ const args = {
26
+ binaries: ['tsc'],
27
+ string: ['project'],
28
+ alias: { project: ['p'] },
29
+ config: [['project', (p) => (p.endsWith('.json') ? p : join(p, 'tsconfig.json'))]],
46
30
  };
47
31
  export default {
48
32
  title,
@@ -51,4 +35,5 @@ export default {
51
35
  config,
52
36
  production,
53
37
  resolveConfig,
38
+ args,
54
39
  };