knip 5.85.0 → 5.87.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 (608) hide show
  1. package/dist/CacheConsultant.d.ts +2 -2
  2. package/dist/CacheConsultant.js +3 -3
  3. package/dist/CatalogCounselor.d.ts +3 -3
  4. package/dist/CatalogCounselor.js +5 -5
  5. package/dist/ConfigurationChief.d.ts +161 -143
  6. package/dist/ConfigurationChief.js +15 -16
  7. package/dist/ConsoleStreamer.d.ts +1 -1
  8. package/dist/DependencyDeputy.d.ts +6 -6
  9. package/dist/DependencyDeputy.js +13 -10
  10. package/dist/IssueCollector.d.ts +7 -7
  11. package/dist/IssueCollector.js +3 -3
  12. package/dist/IssueFixer.d.ts +3 -3
  13. package/dist/IssueFixer.js +17 -6
  14. package/dist/JsonCatalogPeeker.js +1 -1
  15. package/dist/PrincipalFactory.d.ts +3 -3
  16. package/dist/PrincipalFactory.js +3 -3
  17. package/dist/ProjectPrincipal.d.ts +9 -9
  18. package/dist/ProjectPrincipal.js +15 -9
  19. package/dist/WorkspaceWorker.d.ts +9 -9
  20. package/dist/WorkspaceWorker.js +17 -17
  21. package/dist/YamlCatalogPeeker.js +1 -1
  22. package/dist/binaries/bash-parser.d.ts +2 -2
  23. package/dist/binaries/bash-parser.js +84 -50
  24. package/dist/binaries/fallback.d.ts +1 -1
  25. package/dist/binaries/fallback.js +4 -6
  26. package/dist/binaries/index.d.ts +1 -1
  27. package/dist/binaries/index.js +3 -3
  28. package/dist/binaries/plugins.d.ts +1 -1
  29. package/dist/binaries/plugins.js +6 -6
  30. package/dist/binaries/resolvers/bun.d.ts +2 -0
  31. package/dist/binaries/{package-manager → resolvers}/bun.js +4 -6
  32. package/dist/binaries/{package-manager → resolvers}/bunx.d.ts +2 -2
  33. package/dist/binaries/{package-manager → resolvers}/bunx.js +4 -4
  34. package/dist/binaries/resolvers/find.d.ts +2 -0
  35. package/dist/binaries/resolvers/find.js +19 -0
  36. package/dist/binaries/resolvers/index.d.ts +11 -0
  37. package/dist/binaries/resolvers/index.js +18 -0
  38. package/dist/binaries/resolvers/npm.d.ts +2 -0
  39. package/dist/binaries/resolvers/npx.d.ts +2 -0
  40. package/dist/binaries/{package-manager → resolvers}/npx.js +4 -4
  41. package/dist/binaries/resolvers/pnpm.d.ts +2 -0
  42. package/dist/binaries/{package-manager → resolvers}/pnpm.js +4 -3
  43. package/dist/binaries/{package-manager → resolvers}/pnpx.d.ts +2 -2
  44. package/dist/binaries/{package-manager → resolvers}/pnpx.js +2 -2
  45. package/dist/binaries/resolvers/yarn.d.ts +2 -0
  46. package/dist/binaries/{package-manager → resolvers}/yarn.js +4 -4
  47. package/dist/cli.js +11 -11
  48. package/dist/compilers/compilers.d.ts +1 -1
  49. package/dist/compilers/index.d.ts +33 -3
  50. package/dist/compilers/index.js +2 -2
  51. package/dist/compilers/mdx.d.ts +1 -1
  52. package/dist/compilers/mdx.js +9 -2
  53. package/dist/compilers/scss.d.ts +1 -1
  54. package/dist/compilers/scss.js +1 -1
  55. package/dist/constants.d.ts +1 -1
  56. package/dist/constants.js +1 -1
  57. package/dist/graph/analyze.d.ts +8 -8
  58. package/dist/graph/analyze.js +8 -6
  59. package/dist/graph/build.d.ts +9 -9
  60. package/dist/graph/build.js +19 -17
  61. package/dist/graph-explorer/cache.d.ts +3 -3
  62. package/dist/graph-explorer/explorer.d.ts +7 -7
  63. package/dist/graph-explorer/explorer.js +9 -9
  64. package/dist/graph-explorer/operations/build-exports-tree.d.ts +2 -2
  65. package/dist/graph-explorer/operations/build-exports-tree.js +2 -2
  66. package/dist/graph-explorer/operations/find-cycles.d.ts +2 -2
  67. package/dist/graph-explorer/operations/get-contention.d.ts +2 -2
  68. package/dist/graph-explorer/operations/get-contention.js +3 -3
  69. package/dist/graph-explorer/operations/get-dependency-usage.d.ts +1 -1
  70. package/dist/graph-explorer/operations/get-dependency-usage.js +1 -1
  71. package/dist/graph-explorer/operations/get-usage.d.ts +2 -2
  72. package/dist/graph-explorer/operations/get-usage.js +5 -5
  73. package/dist/graph-explorer/operations/has-strictly-ns-references.d.ts +1 -1
  74. package/dist/graph-explorer/operations/has-strictly-ns-references.js +1 -1
  75. package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
  76. package/dist/graph-explorer/operations/is-referenced.js +2 -2
  77. package/dist/graph-explorer/operations/resolve-definition.d.ts +2 -2
  78. package/dist/graph-explorer/operations/resolve-definition.js +3 -3
  79. package/dist/graph-explorer/utils.d.ts +1 -1
  80. package/dist/graph-explorer/utils.js +2 -2
  81. package/dist/graph-explorer/visitors.d.ts +1 -1
  82. package/dist/graph-explorer/visitors.js +1 -1
  83. package/dist/graph-explorer/walk-down.d.ts +1 -1
  84. package/dist/graph-explorer/walk-down.js +2 -2
  85. package/dist/graph-explorer/walk-up.d.ts +2 -2
  86. package/dist/graph-explorer/walk-up.js +2 -2
  87. package/dist/index.d.ts +5 -5
  88. package/dist/index.js +3 -3
  89. package/dist/manifest/helpers.d.ts +1 -1
  90. package/dist/manifest/helpers.js +2 -2
  91. package/dist/manifest/index.d.ts +1 -1
  92. package/dist/manifest/index.js +3 -3
  93. package/dist/plugins/_template/index.d.ts +1 -1
  94. package/dist/plugins/_template/index.js +2 -2
  95. package/dist/plugins/angular/index.d.ts +1 -1
  96. package/dist/plugins/angular/index.js +4 -4
  97. package/dist/plugins/astro/compiler-mdx.js +1 -1
  98. package/dist/plugins/astro/compiler.js +1 -1
  99. package/dist/plugins/astro/index.d.ts +1 -1
  100. package/dist/plugins/astro/index.js +9 -6
  101. package/dist/plugins/astro/resolveFromAST.d.ts +1 -0
  102. package/dist/plugins/astro/resolveFromAST.js +18 -1
  103. package/dist/plugins/astro-db/index.d.ts +1 -1
  104. package/dist/plugins/astro-db/index.js +1 -1
  105. package/dist/plugins/astro-og-canvas/index.d.ts +1 -1
  106. package/dist/plugins/astro-og-canvas/index.js +2 -2
  107. package/dist/plugins/ava/index.d.ts +1 -1
  108. package/dist/plugins/ava/index.js +2 -2
  109. package/dist/plugins/babel/helpers.js +1 -1
  110. package/dist/plugins/babel/index.d.ts +3 -3
  111. package/dist/plugins/babel/index.js +7 -4
  112. package/dist/plugins/babel/types.d.ts +1 -1
  113. package/dist/plugins/biome/index.d.ts +1 -1
  114. package/dist/plugins/biome/index.js +4 -4
  115. package/dist/plugins/bumpp/index.d.ts +1 -1
  116. package/dist/plugins/bumpp/index.js +2 -2
  117. package/dist/plugins/bun/index.d.ts +1 -1
  118. package/dist/plugins/bun/index.js +8 -2
  119. package/dist/plugins/c8/index.d.ts +1 -1
  120. package/dist/plugins/c8/index.js +1 -1
  121. package/dist/plugins/capacitor/index.d.ts +1 -1
  122. package/dist/plugins/capacitor/index.js +3 -3
  123. package/dist/plugins/changelogen/index.d.ts +1 -1
  124. package/dist/plugins/changelogen/index.js +2 -2
  125. package/dist/plugins/changelogithub/index.d.ts +1 -1
  126. package/dist/plugins/changelogithub/index.js +2 -2
  127. package/dist/plugins/changesets/index.d.ts +1 -1
  128. package/dist/plugins/changesets/index.js +10 -3
  129. package/dist/plugins/changesets/types.d.ts +1 -0
  130. package/dist/plugins/commitizen/index.d.ts +1 -1
  131. package/dist/plugins/commitizen/index.js +2 -2
  132. package/dist/plugins/commitlint/index.d.ts +1 -1
  133. package/dist/plugins/commitlint/index.js +3 -3
  134. package/dist/plugins/convex/index.d.ts +1 -1
  135. package/dist/plugins/convex/index.js +1 -1
  136. package/dist/plugins/create-typescript-app/index.d.ts +1 -1
  137. package/dist/plugins/create-typescript-app/index.js +1 -1
  138. package/dist/plugins/cspell/index.d.ts +1 -1
  139. package/dist/plugins/cspell/index.js +2 -2
  140. package/dist/plugins/cucumber/index.d.ts +1 -1
  141. package/dist/plugins/cucumber/index.js +2 -2
  142. package/dist/plugins/cypress/helpers.d.ts +2 -2
  143. package/dist/plugins/cypress/helpers.js +2 -2
  144. package/dist/plugins/cypress/index.d.ts +1 -1
  145. package/dist/plugins/cypress/index.js +3 -3
  146. package/dist/plugins/danger/index.d.ts +1 -1
  147. package/dist/plugins/danger/index.js +1 -1
  148. package/dist/plugins/dependency-cruiser/index.d.ts +1 -1
  149. package/dist/plugins/dependency-cruiser/index.js +1 -1
  150. package/dist/plugins/docusaurus/helpers.d.ts +3 -3
  151. package/dist/plugins/docusaurus/helpers.js +2 -2
  152. package/dist/plugins/docusaurus/index.d.ts +1 -1
  153. package/dist/plugins/docusaurus/index.js +3 -3
  154. package/dist/plugins/docusaurus/types.d.ts +1 -1
  155. package/dist/plugins/dotenv/index.d.ts +1 -1
  156. package/dist/plugins/dotenv/index.js +1 -1
  157. package/dist/plugins/drizzle/index.d.ts +1 -1
  158. package/dist/plugins/drizzle/index.js +2 -2
  159. package/dist/plugins/eleventy/index.d.ts +1 -1
  160. package/dist/plugins/eleventy/index.js +6 -6
  161. package/dist/plugins/eleventy/types.d.ts +1 -1
  162. package/dist/plugins/eslint/helpers.d.ts +3 -3
  163. package/dist/plugins/eslint/helpers.js +5 -5
  164. package/dist/plugins/eslint/index.d.ts +1 -1
  165. package/dist/plugins/eslint/index.js +3 -3
  166. package/dist/plugins/execa/index.d.ts +1 -1
  167. package/dist/plugins/execa/index.js +2 -2
  168. package/dist/plugins/execa/visitors/execa.d.ts +1 -1
  169. package/dist/plugins/execa/visitors/execa.js +3 -3
  170. package/dist/plugins/expo/helpers.d.ts +2 -2
  171. package/dist/plugins/expo/helpers.js +3 -3
  172. package/dist/plugins/expo/index.d.ts +1 -1
  173. package/dist/plugins/expo/index.js +4 -4
  174. package/dist/plugins/expressive-code/index.d.ts +1 -1
  175. package/dist/plugins/expressive-code/index.js +1 -1
  176. package/dist/plugins/gatsby/index.d.ts +1 -1
  177. package/dist/plugins/gatsby/index.js +2 -2
  178. package/dist/plugins/github-action/index.d.ts +1 -1
  179. package/dist/plugins/github-action/index.js +4 -4
  180. package/dist/plugins/github-actions/index.d.ts +1 -1
  181. package/dist/plugins/github-actions/index.js +4 -4
  182. package/dist/plugins/glob/index.d.ts +1 -1
  183. package/dist/plugins/graphql-codegen/index.d.ts +1 -1
  184. package/dist/plugins/graphql-codegen/index.js +5 -5
  185. package/dist/plugins/hardhat/index.d.ts +1 -1
  186. package/dist/plugins/hardhat/index.js +2 -2
  187. package/dist/plugins/husky/index.d.ts +1 -1
  188. package/dist/plugins/husky/index.js +3 -3
  189. package/dist/plugins/i18next-parser/index.d.ts +1 -1
  190. package/dist/plugins/i18next-parser/index.js +1 -1
  191. package/dist/plugins/index.d.ts +139 -136
  192. package/dist/plugins/index.js +142 -136
  193. package/dist/plugins/jest/helpers.d.ts +2 -2
  194. package/dist/plugins/jest/helpers.js +2 -2
  195. package/dist/plugins/jest/index.d.ts +1 -1
  196. package/dist/plugins/jest/index.js +4 -4
  197. package/dist/plugins/karma/helpers.d.ts +2 -2
  198. package/dist/plugins/karma/helpers.js +2 -2
  199. package/dist/plugins/karma/index.d.ts +1 -1
  200. package/dist/plugins/karma/index.js +4 -4
  201. package/dist/plugins/knex/index.d.ts +1 -1
  202. package/dist/plugins/knex/index.js +3 -3
  203. package/dist/plugins/ladle/index.d.ts +1 -1
  204. package/dist/plugins/ladle/index.js +4 -4
  205. package/dist/plugins/lefthook/index.d.ts +1 -1
  206. package/dist/plugins/lefthook/index.js +5 -5
  207. package/dist/plugins/lint-staged/index.d.ts +1 -1
  208. package/dist/plugins/lint-staged/index.js +2 -2
  209. package/dist/plugins/linthtml/index.d.ts +1 -1
  210. package/dist/plugins/linthtml/index.js +3 -3
  211. package/dist/plugins/lockfile-lint/index.d.ts +1 -1
  212. package/dist/plugins/lockfile-lint/index.js +2 -2
  213. package/dist/plugins/lost-pixel/index.d.ts +1 -1
  214. package/dist/plugins/lost-pixel/index.js +1 -1
  215. package/dist/plugins/markdownlint/index.d.ts +1 -1
  216. package/dist/plugins/markdownlint/index.js +3 -3
  217. package/dist/plugins/mdx/index.d.ts +1 -1
  218. package/dist/plugins/mdx/index.js +2 -2
  219. package/dist/plugins/mdxlint/index.d.ts +1 -1
  220. package/dist/plugins/mdxlint/index.js +3 -3
  221. package/dist/plugins/metro/index.d.ts +1 -1
  222. package/dist/plugins/metro/index.js +4 -4
  223. package/dist/plugins/mocha/index.d.ts +1 -1
  224. package/dist/plugins/mocha/index.js +2 -2
  225. package/dist/plugins/moonrepo/index.d.ts +1 -1
  226. package/dist/plugins/moonrepo/index.js +1 -1
  227. package/dist/plugins/msw/index.d.ts +1 -1
  228. package/dist/plugins/msw/index.js +3 -3
  229. package/dist/plugins/nano-staged/index.d.ts +1 -1
  230. package/dist/plugins/nano-staged/index.js +1 -1
  231. package/dist/plugins/nest/index.d.ts +1 -1
  232. package/dist/plugins/nest/index.js +2 -2
  233. package/dist/plugins/netlify/helpers.d.ts +1 -1
  234. package/dist/plugins/netlify/index.d.ts +1 -1
  235. package/dist/plugins/netlify/index.js +4 -4
  236. package/dist/plugins/next/index.d.ts +1 -1
  237. package/dist/plugins/next/index.js +4 -4
  238. package/dist/plugins/next/resolveFromAST.js +1 -1
  239. package/dist/plugins/next-intl/index.d.ts +1 -1
  240. package/dist/plugins/next-intl/index.js +1 -1
  241. package/dist/plugins/next-mdx/index.d.ts +1 -1
  242. package/dist/plugins/next-mdx/index.js +3 -3
  243. package/dist/plugins/next-mdx/resolveFromAST.js +1 -1
  244. package/dist/plugins/nitro/index.d.ts +1 -1
  245. package/dist/plugins/nitro/index.js +3 -3
  246. package/dist/plugins/node/index.d.ts +1 -1
  247. package/dist/plugins/node/index.js +1 -1
  248. package/dist/plugins/node-modules-inspector/index.d.ts +1 -1
  249. package/dist/plugins/node-modules-inspector/index.js +2 -2
  250. package/dist/plugins/nodemon/index.d.ts +1 -1
  251. package/dist/plugins/npm-package-json-lint/index.d.ts +1 -1
  252. package/dist/plugins/npm-package-json-lint/index.js +3 -3
  253. package/dist/plugins/nuxt/helpers.d.ts +15 -0
  254. package/dist/plugins/nuxt/helpers.js +133 -0
  255. package/dist/plugins/nuxt/index.d.ts +1 -4
  256. package/dist/plugins/nuxt/index.js +177 -35
  257. package/dist/plugins/nuxt/types.d.ts +50 -0
  258. package/dist/plugins/nx/index.d.ts +1 -1
  259. package/dist/plugins/nx/index.js +13 -11
  260. package/dist/plugins/nx/types.d.ts +1 -0
  261. package/dist/plugins/nyc/index.d.ts +1 -1
  262. package/dist/plugins/nyc/index.js +2 -2
  263. package/dist/plugins/oclif/index.d.ts +1 -1
  264. package/dist/plugins/oclif/index.js +2 -2
  265. package/dist/plugins/openapi-ts/index.d.ts +3 -0
  266. package/dist/plugins/openapi-ts/index.js +13 -0
  267. package/dist/plugins/oxfmt/index.d.ts +3 -0
  268. package/dist/plugins/oxfmt/index.js +16 -0
  269. package/dist/plugins/oxlint/index.d.ts +1 -1
  270. package/dist/plugins/oxlint/index.js +2 -2
  271. package/dist/plugins/parcel/index.d.ts +1 -1
  272. package/dist/plugins/parcel/index.js +2 -2
  273. package/dist/plugins/payload/index.d.ts +1 -1
  274. package/dist/plugins/payload/index.js +2 -2
  275. package/dist/plugins/playwright/index.d.ts +2 -2
  276. package/dist/plugins/playwright/index.js +5 -5
  277. package/dist/plugins/playwright-ct/index.d.ts +1 -1
  278. package/dist/plugins/playwright-ct/index.js +3 -3
  279. package/dist/plugins/playwright-test/index.d.ts +1 -1
  280. package/dist/plugins/playwright-test/index.js +1 -1
  281. package/dist/plugins/plop/index.d.ts +1 -1
  282. package/dist/plugins/plop/index.js +1 -1
  283. package/dist/plugins/pm2/index.d.ts +1 -1
  284. package/dist/plugins/pm2/index.js +3 -3
  285. package/dist/plugins/pnpm/index.d.ts +1 -1
  286. package/dist/plugins/pnpm/index.js +1 -1
  287. package/dist/plugins/postcss/index.d.ts +1 -1
  288. package/dist/plugins/postcss/index.js +3 -3
  289. package/dist/plugins/preconstruct/index.d.ts +1 -1
  290. package/dist/plugins/preconstruct/index.js +3 -3
  291. package/dist/plugins/prettier/index.d.ts +1 -1
  292. package/dist/plugins/prettier/index.js +2 -2
  293. package/dist/plugins/prisma/index.d.ts +1 -1
  294. package/dist/plugins/prisma/index.js +5 -5
  295. package/dist/plugins/qwik/index.d.ts +3 -0
  296. package/dist/plugins/qwik/index.js +47 -0
  297. package/dist/plugins/qwik/resolveFromAST.d.ts +3 -0
  298. package/dist/plugins/qwik/resolveFromAST.js +37 -0
  299. package/dist/plugins/react-cosmos/index.d.ts +1 -1
  300. package/dist/plugins/react-cosmos/index.js +3 -3
  301. package/dist/plugins/react-native/index.d.ts +1 -1
  302. package/dist/plugins/react-native/index.js +2 -2
  303. package/dist/plugins/react-router/index.d.ts +1 -1
  304. package/dist/plugins/react-router/index.js +5 -5
  305. package/dist/plugins/relay/index.d.ts +1 -1
  306. package/dist/plugins/relay/index.js +3 -3
  307. package/dist/plugins/release-it/index.d.ts +1 -1
  308. package/dist/plugins/release-it/index.js +2 -2
  309. package/dist/plugins/remark/index.d.ts +1 -1
  310. package/dist/plugins/remark/index.js +3 -3
  311. package/dist/plugins/remix/index.d.ts +1 -1
  312. package/dist/plugins/remix/index.js +1 -1
  313. package/dist/plugins/rollup/index.d.ts +1 -1
  314. package/dist/plugins/rollup/index.js +1 -1
  315. package/dist/plugins/rsbuild/index.d.ts +1 -1
  316. package/dist/plugins/rsbuild/index.js +2 -2
  317. package/dist/plugins/rslib/index.d.ts +1 -1
  318. package/dist/plugins/rslib/index.js +1 -1
  319. package/dist/plugins/rspack/index.d.ts +1 -1
  320. package/dist/plugins/rspack/index.js +2 -2
  321. package/dist/plugins/rstest/index.d.ts +1 -1
  322. package/dist/plugins/rstest/index.js +2 -2
  323. package/dist/plugins/semantic-release/index.d.ts +1 -1
  324. package/dist/plugins/semantic-release/index.js +3 -3
  325. package/dist/plugins/sentry/index.d.ts +1 -1
  326. package/dist/plugins/sentry/index.js +1 -1
  327. package/dist/plugins/simple-git-hooks/index.d.ts +1 -1
  328. package/dist/plugins/simple-git-hooks/index.js +2 -2
  329. package/dist/plugins/size-limit/index.d.ts +1 -1
  330. package/dist/plugins/size-limit/index.js +3 -3
  331. package/dist/plugins/sst/index.d.ts +1 -1
  332. package/dist/plugins/sst/index.js +2 -2
  333. package/dist/plugins/sst/resolveFromAST.d.ts +1 -1
  334. package/dist/plugins/sst/resolveFromAST.js +4 -4
  335. package/dist/plugins/starlight/index.d.ts +1 -1
  336. package/dist/plugins/starlight/index.js +4 -4
  337. package/dist/plugins/starlight/resolveFromAST.js +1 -1
  338. package/dist/plugins/storybook/index.d.ts +1 -1
  339. package/dist/plugins/storybook/index.js +3 -3
  340. package/dist/plugins/stryker/index.d.ts +1 -1
  341. package/dist/plugins/stryker/index.js +2 -2
  342. package/dist/plugins/stylelint/index.d.ts +1 -1
  343. package/dist/plugins/stylelint/index.js +3 -3
  344. package/dist/plugins/svelte/compiler.d.ts +1 -1
  345. package/dist/plugins/svelte/compiler.js +1 -1
  346. package/dist/plugins/svelte/index.d.ts +1 -1
  347. package/dist/plugins/svelte/index.js +3 -3
  348. package/dist/plugins/sveltekit/index.d.ts +1 -1
  349. package/dist/plugins/sveltekit/index.js +3 -3
  350. package/dist/plugins/svgo/index.d.ts +1 -1
  351. package/dist/plugins/svgo/index.js +1 -1
  352. package/dist/plugins/svgr/index.d.ts +1 -1
  353. package/dist/plugins/svgr/index.js +2 -2
  354. package/dist/plugins/swc/index.d.ts +1 -1
  355. package/dist/plugins/swc/index.js +5 -3
  356. package/dist/plugins/swc/types.d.ts +1 -0
  357. package/dist/plugins/syncpack/index.d.ts +1 -1
  358. package/dist/plugins/syncpack/index.js +2 -2
  359. package/dist/plugins/tailwind/index.d.ts +1 -1
  360. package/dist/plugins/tailwind/index.js +2 -2
  361. package/dist/plugins/tanstack-router/index.d.ts +1 -1
  362. package/dist/plugins/tanstack-router/index.js +3 -3
  363. package/dist/plugins/taskfile/index.d.ts +1 -1
  364. package/dist/plugins/taskfile/index.js +3 -3
  365. package/dist/plugins/travis/index.d.ts +1 -1
  366. package/dist/plugins/travis/index.js +1 -1
  367. package/dist/plugins/ts-node/index.d.ts +1 -1
  368. package/dist/plugins/tsdown/index.d.ts +1 -1
  369. package/dist/plugins/tsdown/index.js +4 -4
  370. package/dist/plugins/tsup/index.d.ts +1 -1
  371. package/dist/plugins/tsup/index.js +2 -2
  372. package/dist/plugins/tsx/index.d.ts +1 -1
  373. package/dist/plugins/tsx/index.js +2 -2
  374. package/dist/plugins/typedoc/index.d.ts +1 -1
  375. package/dist/plugins/typedoc/index.js +2 -2
  376. package/dist/plugins/typescript/index.d.ts +1 -1
  377. package/dist/plugins/typescript/index.js +10 -4
  378. package/dist/plugins/unbuild/index.d.ts +1 -1
  379. package/dist/plugins/unbuild/index.js +2 -2
  380. package/dist/plugins/unocss/index.d.ts +1 -1
  381. package/dist/plugins/unocss/index.js +2 -2
  382. package/dist/plugins/vercel-og/index.d.ts +1 -1
  383. package/dist/plugins/vercel-og/index.js +1 -1
  384. package/dist/plugins/vike/index.d.ts +1 -1
  385. package/dist/plugins/vike/index.js +1 -1
  386. package/dist/plugins/vite/helpers.d.ts +1 -1
  387. package/dist/plugins/vite/helpers.js +4 -4
  388. package/dist/plugins/vite/index.d.ts +1 -1
  389. package/dist/plugins/vite/index.js +5 -5
  390. package/dist/plugins/vite/visitors/importMetaGlob.d.ts +1 -1
  391. package/dist/plugins/vite/visitors/importMetaGlob.js +4 -4
  392. package/dist/plugins/vitepress/index.d.ts +1 -1
  393. package/dist/plugins/vitepress/index.js +1 -1
  394. package/dist/plugins/vitest/helpers.d.ts +1 -1
  395. package/dist/plugins/vitest/index.d.ts +2 -2
  396. package/dist/plugins/vitest/index.js +15 -7
  397. package/dist/plugins/vitest/types.d.ts +1 -0
  398. package/dist/plugins/vue/compiler.d.ts +1 -1
  399. package/dist/plugins/vue/compiler.js +1 -1
  400. package/dist/plugins/vue/index.d.ts +1 -1
  401. package/dist/plugins/vue/index.js +4 -4
  402. package/dist/plugins/webdriver-io/index.d.ts +1 -1
  403. package/dist/plugins/webdriver-io/index.js +2 -2
  404. package/dist/plugins/webpack/index.d.ts +2 -2
  405. package/dist/plugins/webpack/index.js +5 -5
  406. package/dist/plugins/webpack/visitors/requireContext.d.ts +1 -1
  407. package/dist/plugins/webpack/visitors/requireContext.js +4 -4
  408. package/dist/plugins/wireit/index.d.ts +1 -1
  409. package/dist/plugins/wireit/index.js +1 -1
  410. package/dist/plugins/wrangler/index.d.ts +1 -1
  411. package/dist/plugins/wrangler/index.js +3 -3
  412. package/dist/plugins/xo/index.d.ts +1 -1
  413. package/dist/plugins/xo/index.js +2 -2
  414. package/dist/plugins/xo/types.d.ts +1 -1
  415. package/dist/plugins/yarn/index.d.ts +1 -1
  416. package/dist/plugins/yarn/index.js +5 -4
  417. package/dist/plugins/yorkie/index.d.ts +1 -1
  418. package/dist/plugins/yorkie/index.js +2 -2
  419. package/dist/plugins/zx/index.d.ts +1 -1
  420. package/dist/plugins/zx/index.js +2 -2
  421. package/dist/plugins/zx/visitors/zx.d.ts +1 -1
  422. package/dist/plugins/zx/visitors/zx.js +2 -2
  423. package/dist/plugins.d.ts +3 -3
  424. package/dist/plugins.js +2 -2
  425. package/dist/reporters/codeclimate.d.ts +1 -1
  426. package/dist/reporters/codeclimate.js +2 -2
  427. package/dist/reporters/codeowners.d.ts +1 -1
  428. package/dist/reporters/codeowners.js +3 -3
  429. package/dist/reporters/compact.d.ts +1 -1
  430. package/dist/reporters/compact.js +2 -2
  431. package/dist/reporters/disclosure.d.ts +1 -1
  432. package/dist/reporters/disclosure.js +1 -1
  433. package/dist/reporters/github-actions.d.ts +1 -1
  434. package/dist/reporters/github-actions.js +4 -4
  435. package/dist/reporters/index.d.ts +8 -8
  436. package/dist/reporters/index.js +8 -8
  437. package/dist/reporters/json.d.ts +1 -1
  438. package/dist/reporters/json.js +4 -4
  439. package/dist/reporters/markdown.d.ts +1 -1
  440. package/dist/reporters/markdown.js +2 -2
  441. package/dist/reporters/symbols.d.ts +1 -1
  442. package/dist/reporters/symbols.js +2 -2
  443. package/dist/reporters/trace.d.ts +4 -4
  444. package/dist/reporters/trace.js +4 -4
  445. package/dist/reporters/util/configuration-hints.d.ts +2 -2
  446. package/dist/reporters/util/configuration-hints.js +4 -4
  447. package/dist/reporters/util/util.d.ts +3 -3
  448. package/dist/reporters/util/util.js +3 -3
  449. package/dist/reporters/watch.d.ts +3 -3
  450. package/dist/reporters/watch.js +3 -3
  451. package/dist/run.d.ts +12 -12
  452. package/dist/run.js +12 -12
  453. package/dist/schema/configuration.d.ts +45 -0
  454. package/dist/schema/configuration.js +2 -2
  455. package/dist/schema/plugins.d.ts +15 -0
  456. package/dist/schema/plugins.js +3 -0
  457. package/dist/session/build-maps.d.ts +3 -3
  458. package/dist/session/build-maps.js +3 -3
  459. package/dist/session/file-descriptor.d.ts +2 -2
  460. package/dist/session/file-descriptor.js +3 -3
  461. package/dist/session/index.d.ts +12 -12
  462. package/dist/session/index.js +7 -7
  463. package/dist/session/package-json-descriptor.d.ts +2 -2
  464. package/dist/session/package-json-descriptor.js +1 -1
  465. package/dist/session/session.d.ts +7 -7
  466. package/dist/session/session.js +3 -3
  467. package/dist/session/types.d.ts +2 -2
  468. package/dist/types/PluginNames.d.ts +2 -2
  469. package/dist/types/PluginNames.js +3 -0
  470. package/dist/types/args.d.ts +1 -1
  471. package/dist/types/config.d.ts +11 -11
  472. package/dist/types/exports.d.ts +1 -1
  473. package/dist/types/issues.d.ts +2 -2
  474. package/dist/types/module-graph.d.ts +2 -2
  475. package/dist/types/package-json.d.ts +1 -1
  476. package/dist/types/project.d.ts +2 -2
  477. package/dist/types.d.ts +2 -2
  478. package/dist/typescript/SourceFileManager.d.ts +1 -1
  479. package/dist/typescript/SourceFileManager.js +4 -4
  480. package/dist/typescript/ast-helpers.d.ts +3 -3
  481. package/dist/typescript/ast-helpers.js +2 -2
  482. package/dist/typescript/create-hosts.d.ts +3 -3
  483. package/dist/typescript/create-hosts.js +2 -2
  484. package/dist/typescript/get-imports-and-exports.d.ts +3 -3
  485. package/dist/typescript/get-imports-and-exports.js +24 -15
  486. package/dist/typescript/has-refs-in-file.d.ts +1 -1
  487. package/dist/typescript/has-refs-in-file.js +2 -2
  488. package/dist/typescript/pragmas/custom.d.ts +2 -2
  489. package/dist/typescript/pragmas/custom.js +4 -4
  490. package/dist/typescript/pragmas/index.d.ts +2 -2
  491. package/dist/typescript/pragmas/index.js +2 -2
  492. package/dist/typescript/pragmas/typescript.d.ts +2 -2
  493. package/dist/typescript/pragmas/typescript.js +1 -1
  494. package/dist/typescript/resolve-module-names.d.ts +1 -1
  495. package/dist/typescript/resolve-module-names.js +7 -7
  496. package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
  497. package/dist/typescript/visitors/dynamic-imports/importCall.js +3 -3
  498. package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
  499. package/dist/typescript/visitors/dynamic-imports/importType.js +2 -2
  500. package/dist/typescript/visitors/dynamic-imports/index.d.ts +2 -2
  501. package/dist/typescript/visitors/dynamic-imports/index.js +7 -7
  502. package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +2 -2
  503. package/dist/typescript/visitors/dynamic-imports/jsDocType.js +2 -2
  504. package/dist/typescript/visitors/dynamic-imports/moduleRegister.d.ts +1 -1
  505. package/dist/typescript/visitors/dynamic-imports/moduleRegister.js +3 -3
  506. package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
  507. package/dist/typescript/visitors/dynamic-imports/requireCall.js +4 -4
  508. package/dist/typescript/visitors/dynamic-imports/resolveCall.d.ts +1 -1
  509. package/dist/typescript/visitors/dynamic-imports/resolveCall.js +3 -3
  510. package/dist/typescript/visitors/dynamic-imports/urlConstructor.d.ts +1 -1
  511. package/dist/typescript/visitors/dynamic-imports/urlConstructor.js +2 -2
  512. package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
  513. package/dist/typescript/visitors/exports/exportAssignment.js +4 -4
  514. package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
  515. package/dist/typescript/visitors/exports/exportDeclaration.js +3 -3
  516. package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
  517. package/dist/typescript/visitors/exports/exportKeyword.js +5 -5
  518. package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +1 -1
  519. package/dist/typescript/visitors/exports/exportsAccessExpression.js +3 -3
  520. package/dist/typescript/visitors/exports/index.d.ts +1 -1
  521. package/dist/typescript/visitors/exports/index.js +5 -5
  522. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
  523. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.js +4 -4
  524. package/dist/typescript/visitors/helpers.d.ts +1 -1
  525. package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
  526. package/dist/typescript/visitors/imports/importDeclaration.js +3 -3
  527. package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
  528. package/dist/typescript/visitors/imports/importEqualsDeclaration.js +3 -3
  529. package/dist/typescript/visitors/imports/index.d.ts +1 -1
  530. package/dist/typescript/visitors/imports/index.js +3 -3
  531. package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
  532. package/dist/typescript/visitors/imports/reExportDeclaration.js +2 -2
  533. package/dist/typescript/visitors/index.d.ts +3 -3
  534. package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
  535. package/dist/typescript/visitors/scripts/bun.js +3 -3
  536. package/dist/typescript/visitors/scripts/index.d.ts +2 -2
  537. package/dist/typescript/visitors/scripts/index.js +1 -1
  538. package/dist/util/Performance.d.ts +3 -5
  539. package/dist/util/Performance.js +37 -20
  540. package/dist/util/catalog.d.ts +2 -2
  541. package/dist/util/catalog.js +3 -3
  542. package/dist/util/codeowners.js +2 -2
  543. package/dist/util/create-input-handler.d.ts +6 -6
  544. package/dist/util/create-input-handler.js +8 -8
  545. package/dist/util/create-options.d.ts +52 -22
  546. package/dist/util/create-options.js +13 -13
  547. package/dist/util/create-workspace-graph.d.ts +1 -1
  548. package/dist/util/create-workspace-graph.js +1 -1
  549. package/dist/util/file-entry-cache.js +4 -4
  550. package/dist/util/fs.d.ts +2 -2
  551. package/dist/util/fs.js +4 -4
  552. package/dist/util/get-included-issue-types.d.ts +1 -1
  553. package/dist/util/get-included-issue-types.js +2 -2
  554. package/dist/util/git.js +1 -1
  555. package/dist/util/glob-core.js +55 -36
  556. package/dist/util/glob.js +4 -4
  557. package/dist/util/input.d.ts +2 -2
  558. package/dist/util/input.js +1 -1
  559. package/dist/util/issue-initializers.d.ts +1 -1
  560. package/dist/util/issue-initializers.js +1 -1
  561. package/dist/util/jiti.js +1 -1
  562. package/dist/util/load-config.d.ts +1 -1
  563. package/dist/util/load-config.js +3 -3
  564. package/dist/util/load-tsconfig.js +2 -2
  565. package/dist/util/loader.js +14 -6
  566. package/dist/util/map-workspaces.d.ts +1 -1
  567. package/dist/util/map-workspaces.js +4 -4
  568. package/dist/util/module-graph.d.ts +1 -1
  569. package/dist/util/modules.js +3 -4
  570. package/dist/util/package-json.d.ts +1 -1
  571. package/dist/util/package-json.js +10 -0
  572. package/dist/util/package-name.d.ts +1 -1
  573. package/dist/util/package-name.js +1 -1
  574. package/dist/util/path.js +1 -1
  575. package/dist/util/plugin.d.ts +2 -2
  576. package/dist/util/plugin.js +5 -5
  577. package/dist/util/remove-export.js +1 -1
  578. package/dist/util/reporter.d.ts +1 -1
  579. package/dist/util/reporter.js +3 -3
  580. package/dist/util/require.js +1 -1
  581. package/dist/util/resolve.d.ts +2 -3
  582. package/dist/util/resolve.js +7 -6
  583. package/dist/util/table.js +1 -1
  584. package/dist/util/tag.d.ts +1 -1
  585. package/dist/util/tag.js +1 -1
  586. package/dist/util/to-source-path.d.ts +1 -1
  587. package/dist/util/to-source-path.js +5 -5
  588. package/dist/util/trace.d.ts +1 -1
  589. package/dist/util/watch.d.ts +10 -10
  590. package/dist/util/watch.js +12 -9
  591. package/dist/util/workspace-file-filter.js +2 -2
  592. package/dist/util/workspace-selectors.d.ts +1 -1
  593. package/dist/util/workspace-selectors.js +4 -4
  594. package/dist/version.d.ts +1 -1
  595. package/dist/version.js +1 -1
  596. package/package.json +64 -64
  597. package/schema.json +12 -0
  598. package/dist/binaries/package-manager/bun.d.ts +0 -2
  599. package/dist/binaries/package-manager/index.d.ts +0 -10
  600. package/dist/binaries/package-manager/index.js +0 -16
  601. package/dist/binaries/package-manager/npm.d.ts +0 -2
  602. package/dist/binaries/package-manager/npx.d.ts +0 -2
  603. package/dist/binaries/package-manager/pnpm.d.ts +0 -2
  604. package/dist/binaries/package-manager/yarn.d.ts +0 -2
  605. package/vendor/bash-parser/README.md +0 -7
  606. package/vendor/bash-parser/index.d.ts +0 -79
  607. package/vendor/bash-parser/index.js +0 -58
  608. /package/dist/binaries/{package-manager → resolvers}/npm.js +0 -0
@@ -0,0 +1,133 @@
1
+ import { createRequire } from 'node:module';
2
+ import ts from 'typescript';
3
+ import { scriptBodies } from "../../compilers/compilers.js";
4
+ import { basename, dirname, isInNodeModules, join } from "../../util/path.js";
5
+ export const getVueSfc = (cwd) => {
6
+ try {
7
+ return createRequire(join(cwd, 'package.json'))('vue/compiler-sfc');
8
+ }
9
+ catch { }
10
+ return {
11
+ parse: (source, path) => ({
12
+ descriptor: { script: { content: scriptBodies(source, path) }, scriptSetup: null, template: { content: '' } },
13
+ }),
14
+ };
15
+ };
16
+ export const createSourceFile = (filePath, contents) => {
17
+ const c = contents ?? ts.sys.readFile(filePath, 'utf8') ?? '';
18
+ return ts.createSourceFile(filePath, c, ts.ScriptTarget.Latest);
19
+ };
20
+ export const collectIdentifiers = (source, fileName) => {
21
+ const identifiers = new Set();
22
+ const sourceFile = createSourceFile(fileName, source);
23
+ const visit = (node) => {
24
+ if (ts.isIdentifier(node))
25
+ identifiers.add(node.text);
26
+ ts.forEachChild(node, visit);
27
+ };
28
+ ts.forEachChild(sourceFile, visit);
29
+ return identifiers;
30
+ };
31
+ export const collectTemplateInfo = (tree) => {
32
+ const tags = new Set();
33
+ const identifiers = new Set();
34
+ const addExprIdentifiers = (expr) => {
35
+ for (const id of collectIdentifiers(expr, 'expr.ts'))
36
+ identifiers.add(id);
37
+ };
38
+ const visit = (node) => {
39
+ if (node.tag)
40
+ tags.add(node.tag);
41
+ if (node.type === 5 && node.content && !node.content.isStatic)
42
+ addExprIdentifiers(node.content.content);
43
+ if (node.props) {
44
+ for (const prop of node.props) {
45
+ if (prop.type === 7) {
46
+ if (prop.exp && !prop.exp.isStatic)
47
+ addExprIdentifiers(prop.exp.content);
48
+ if (prop.arg && !prop.arg.isStatic)
49
+ addExprIdentifiers(prop.arg.content);
50
+ }
51
+ }
52
+ }
53
+ if (node.children)
54
+ for (const child of node.children)
55
+ visit(child);
56
+ };
57
+ visit(tree);
58
+ return { tags, identifiers };
59
+ };
60
+ export const toKebabCase = (s) => s.replace(/[A-Z]/g, (m, i) => (i ? '-' : '') + m.toLowerCase());
61
+ const isLocalSpecifier = (specifier) => specifier.startsWith('.') && !isInNodeModules(specifier);
62
+ export const collectLocalImportPaths = (sourceFile) => {
63
+ const dir = dirname(sourceFile.fileName);
64
+ const paths = new Set();
65
+ const visit = (node) => {
66
+ if (ts.isImportTypeNode(node) && ts.isLiteralTypeNode(node.argument) && ts.isStringLiteral(node.argument.literal)) {
67
+ const specifier = node.argument.literal.text;
68
+ if (isLocalSpecifier(specifier))
69
+ paths.add(join(dir, specifier));
70
+ }
71
+ ts.forEachChild(node, visit);
72
+ };
73
+ ts.forEachChild(sourceFile, visit);
74
+ return paths;
75
+ };
76
+ export function buildAutoImportMap(sourceFile) {
77
+ const dir = dirname(sourceFile.fileName);
78
+ const isComponents = basename(sourceFile.fileName) === 'components.d.ts';
79
+ const importMap = new Map();
80
+ const componentMap = new Map();
81
+ function visit(node) {
82
+ if (ts.isVariableStatement(node)) {
83
+ if (node.declarationList.declarations.length === 0)
84
+ return;
85
+ const decl = node.declarationList.declarations[0];
86
+ if (!ts.isIdentifier(decl.name))
87
+ return;
88
+ const name = decl.name.text;
89
+ if (name.startsWith('Lazy'))
90
+ return;
91
+ if (!decl.type)
92
+ return;
93
+ const tNode = ts.isImportTypeNode(decl.type)
94
+ ? decl.type
95
+ : ts.isTypeQueryNode(decl.type)
96
+ ? ts.isImportTypeNode(decl.type.exprName)
97
+ ? decl.type.exprName
98
+ : ts.isQualifiedName(decl.type.exprName) &&
99
+ ts.isImportTypeNode(decl.type.exprName.left) &&
100
+ decl.type.exprName.left
101
+ : ts.isIndexedAccessTypeNode(decl.type) && ts.isImportTypeNode(decl.type.objectType) && decl.type.objectType;
102
+ if (!tNode || !ts.isLiteralTypeNode(tNode.argument) || !ts.isStringLiteral(tNode.argument.literal))
103
+ return;
104
+ const specifier = tNode.argument.literal.text;
105
+ if (!isLocalSpecifier(specifier))
106
+ return;
107
+ const absSpecifier = join(dir, specifier);
108
+ if (isComponents) {
109
+ const components = componentMap.get(name);
110
+ if (components)
111
+ components.push(absSpecifier);
112
+ else
113
+ componentMap.set(name, [absSpecifier]);
114
+ }
115
+ else {
116
+ importMap.set(name, absSpecifier);
117
+ }
118
+ }
119
+ else if (ts.isExportDeclaration(node) && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) {
120
+ const specifier = node.moduleSpecifier.text;
121
+ if (!isLocalSpecifier(specifier))
122
+ return;
123
+ if (node.exportClause && ts.isNamedExports(node.exportClause)) {
124
+ for (const element of node.exportClause.elements) {
125
+ importMap.set(element.name.text, join(dir, specifier));
126
+ }
127
+ }
128
+ }
129
+ ts.forEachChild(node, visit);
130
+ }
131
+ ts.forEachChild(sourceFile, visit);
132
+ return { importMap, componentMap };
133
+ }
@@ -1,6 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
2
- export declare const docs: {
3
- note: string;
4
- };
1
+ import type { Plugin } from '../../types/config.ts';
5
2
  declare const plugin: Plugin;
6
3
  export default plugin;
@@ -1,20 +1,30 @@
1
- import { toDependency, toProductionEntry } from '../../util/input.js';
2
- import { join } from '../../util/path.js';
3
- import { hasDependency } from '../../util/plugin.js';
1
+ import { isDirectory } from "../../util/fs.js";
2
+ import { _syncGlob } from "../../util/glob.js";
3
+ import { toAlias, toConfig, toDeferResolveProductionEntry, toDependency, toEntry, toIgnore, toProductionEntry, } from "../../util/input.js";
4
+ import { loadTSConfig } from "../../util/load-tsconfig.js";
5
+ import { join } from "../../util/path.js";
6
+ import { hasDependency } from "../../util/plugin.js";
7
+ import { buildAutoImportMap, collectIdentifiers, collectLocalImportPaths, collectTemplateInfo, createSourceFile, getVueSfc, toKebabCase, } from "./helpers.js";
4
8
  const title = 'Nuxt';
5
- const enablers = ['nuxt'];
9
+ const enablers = ['nuxt', 'nuxt-nightly'];
6
10
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
11
  const config = ['nuxt.config.{js,mjs,ts}'];
12
+ const entry = ['app.config.ts', '**/*.d.vue.ts'];
13
+ const app = ['app.{vue,jsx,tsx}', 'error.{vue,jsx,tsx}', 'router.options.ts'];
14
+ const layout = (dir = 'layouts') => join(dir, '**/*.{vue,jsx,tsx}');
15
+ const middleware = (dir = 'middleware') => join(dir, '**/*.ts');
16
+ const pages = (dir = 'pages') => join(dir, '**/*.{vue,jsx,tsx}');
17
+ const plugins = (dir = 'plugins') => join(dir, '**/*.ts');
18
+ const modules = 'modules/**/*.{ts,vue}';
19
+ const server = ['api/**/*.ts', 'middleware/**/*.ts', 'plugins/**/*.ts', 'routes/**/*.ts', 'tasks/**/*.ts'];
8
20
  const production = [
9
- 'app.{vue,jsx,tsx}',
10
- 'error.{vue,jsx,tsx}',
11
- 'pages/**/*.{vue,jsx,tsx}',
12
- 'layouts/default.{vue,jsx,tsx}',
13
- 'middleware/**/*.ts',
14
- 'server/api/**/*.ts',
15
- 'server/routes/**/*.ts',
16
- 'server/middleware/**/*.ts',
17
- 'server/plugins/**/*.ts',
21
+ ...app,
22
+ layout(),
23
+ middleware(),
24
+ pages(),
25
+ plugins(),
26
+ modules,
27
+ ...server.map(id => join('server', id)),
18
28
  ];
19
29
  const setup = async () => {
20
30
  if (globalThis && !('defineNuxtConfig' in globalThis)) {
@@ -25,38 +35,170 @@ const setup = async () => {
25
35
  });
26
36
  }
27
37
  };
28
- const resolveConfig = async (localConfig) => {
29
- const srcDir = localConfig.srcDir ?? '.';
30
- const patterns = [
31
- 'app.{vue,jsx,tsx}',
32
- 'error.{vue,jsx,tsx}',
33
- join(typeof localConfig.dir?.pages === 'string' ? localConfig.dir.pages : 'pages', '**/*.{vue,jsx,tsx}'),
34
- join(typeof localConfig.dir?.layouts === 'string' ? localConfig.dir.layouts : 'layouts', '**/*.{vue,jsx,tsx}'),
35
- join(typeof localConfig.dir?.middleware === 'string' ? localConfig.dir.middleware : 'middleware', '**/*.ts'),
36
- 'server/api/**/*.ts',
37
- 'server/routes/**/*.ts',
38
- 'server/middleware/**/*.ts',
39
- 'server/plugins/**/*.ts',
40
- ].map(pattern => toProductionEntry(join(srcDir, pattern)));
41
- const deps = localConfig.modules?.reduce((acc, id) => {
38
+ const resolveAlias = (specifier, srcDir, rootDir) => {
39
+ if (specifier.startsWith('~~/') || specifier.startsWith('@@/'))
40
+ return join(rootDir, specifier.slice(3));
41
+ if (specifier.startsWith('~/') || specifier.startsWith('@/'))
42
+ return join(srcDir, specifier.slice(2));
43
+ return specifier;
44
+ };
45
+ const addAppEntries = (inputs, srcDir, serverDir, config, dir) => {
46
+ for (const id of entry)
47
+ inputs.push(toEntry(join(srcDir, id)));
48
+ for (const id of app)
49
+ inputs.push(toProductionEntry(join(srcDir, id)));
50
+ inputs.push(toProductionEntry(join(srcDir, layout(config.dir?.layouts))));
51
+ inputs.push(toProductionEntry(join(srcDir, middleware(config.dir?.middleware))));
52
+ inputs.push(toProductionEntry(join(srcDir, pages(config.dir?.pages))));
53
+ inputs.push(toProductionEntry(join(srcDir, plugins(config.dir?.plugins))));
54
+ inputs.push(toProductionEntry(join(srcDir, 'components/global/**/*.{vue,jsx,tsx}')));
55
+ for (const id of server)
56
+ inputs.push(toProductionEntry(join(dir, serverDir, id)));
57
+ inputs.push(toProductionEntry(join(dir, modules)));
58
+ if (config.css)
59
+ for (const id of config.css)
60
+ inputs.push(toDeferResolveProductionEntry(resolveAlias(id, srcDir, dir)));
61
+ };
62
+ const findLayerConfigs = (cwd) => _syncGlob({ cwd, patterns: [`layers/*/${config.at(0)}`] });
63
+ const registerCompilers = async ({ cwd, hasDependency, registerCompiler }) => {
64
+ if (hasDependency('nuxt') || hasDependency('nuxt-nightly')) {
65
+ const vueSfc = getVueSfc(cwd);
66
+ const importMap = new Map();
67
+ const componentMap = new Map();
68
+ const definitionFiles = [
69
+ '.nuxt/imports.d.ts',
70
+ '.nuxt/components.d.ts',
71
+ '.nuxt/types/nitro-routes.d.ts',
72
+ '.nuxt/types/nitro-imports.d.ts',
73
+ ];
74
+ for (const file of definitionFiles) {
75
+ const sourceFile = createSourceFile(join(cwd, file));
76
+ const maps = buildAutoImportMap(sourceFile);
77
+ for (const [id, specifier] of maps.importMap)
78
+ importMap.set(id, specifier);
79
+ for (const [id, components] of maps.componentMap) {
80
+ const store = componentMap.get(id);
81
+ if (store)
82
+ store.push(...components);
83
+ else
84
+ componentMap.set(id, [...components]);
85
+ }
86
+ }
87
+ const getSyntheticImports = (identifiers, templateTags) => {
88
+ const syntheticImports = [];
89
+ for (const [name, specifier] of importMap) {
90
+ if (identifiers.has(name))
91
+ syntheticImports.push(`import { ${name} } from '${specifier}';`);
92
+ }
93
+ if (templateTags) {
94
+ for (const [name, specifiers] of componentMap) {
95
+ const kebab = toKebabCase(name);
96
+ if (templateTags.has(name) ||
97
+ templateTags.has(kebab) ||
98
+ templateTags.has(`Lazy${name}`) ||
99
+ templateTags.has(`lazy-${kebab}`)) {
100
+ syntheticImports.push(`import { default as ${name} } from '${specifiers[0]}';`);
101
+ for (let i = 1; i < specifiers.length; i++)
102
+ syntheticImports.push(`import '${specifiers[i]}';`);
103
+ }
104
+ }
105
+ }
106
+ return syntheticImports;
107
+ };
108
+ const compiler = (source, path) => {
109
+ const { descriptor } = vueSfc.parse(source, path);
110
+ const scripts = [];
111
+ if (descriptor.script?.content)
112
+ scripts.push(descriptor.script.content);
113
+ if (descriptor.scriptSetup?.content)
114
+ scripts.push(descriptor.scriptSetup.content);
115
+ const identifiers = collectIdentifiers(scripts.join('\n'), path);
116
+ let templateTags;
117
+ if (descriptor.template?.ast) {
118
+ const info = collectTemplateInfo(descriptor.template.ast);
119
+ templateTags = info.tags;
120
+ for (const id of info.identifiers)
121
+ identifiers.add(id);
122
+ }
123
+ const synthetic = getSyntheticImports(identifiers, templateTags);
124
+ scripts.push(...synthetic);
125
+ return scripts.join(';\n');
126
+ };
127
+ const tsCompiler = (source, path) => {
128
+ if (path.endsWith('.d.ts') || path.endsWith('.config.ts'))
129
+ return source;
130
+ const identifiers = collectIdentifiers(source, path);
131
+ const syntheticImports = getSyntheticImports(identifiers);
132
+ if (syntheticImports.length === 0)
133
+ return source;
134
+ return `${source}\n${syntheticImports.join('\n')}`;
135
+ };
136
+ registerCompiler({ extension: '.vue', compiler });
137
+ registerCompiler({ extension: '.ts', compiler: tsCompiler });
138
+ }
139
+ };
140
+ const resolveConfig = async (localConfig, options) => {
141
+ const { configFileDir: cwd } = options;
142
+ const hasAppDir = isDirectory(cwd, 'app');
143
+ const srcDir = localConfig.srcDir ?? (hasAppDir ? join(cwd, 'app') : cwd);
144
+ const serverDir = localConfig.serverDir ?? 'server';
145
+ const inputs = [];
146
+ for (const id of localConfig.modules ?? []) {
42
147
  if (Array.isArray(id) && typeof id[0] === 'string')
43
- acc.push(toDependency(id[0]));
148
+ inputs.push(toDependency(id[0]));
44
149
  if (typeof id === 'string')
45
- acc.push(toDependency(id));
46
- return acc;
47
- }, []) ?? [];
48
- return [...deps, ...patterns];
150
+ inputs.push(toDependency(id));
151
+ }
152
+ addAppEntries(inputs, srcDir, serverDir, localConfig, cwd);
153
+ const aliases = localConfig.alias;
154
+ if (aliases) {
155
+ for (const key in aliases) {
156
+ const prefix = resolveAlias(aliases[key], srcDir, cwd);
157
+ inputs.push(toAlias(key, prefix));
158
+ if (prefix.endsWith('/') || isDirectory(prefix)) {
159
+ inputs.push(toAlias(join(key, '*'), join(prefix, '*'), { dir: cwd }));
160
+ }
161
+ }
162
+ }
163
+ for (const ext of localConfig.extends ?? []) {
164
+ const resolved = resolveAlias(ext, srcDir, cwd);
165
+ for (const cfg of _syncGlob({ cwd: resolved, patterns: config })) {
166
+ inputs.push(toConfig('nuxt', join(resolved, cfg)));
167
+ }
168
+ }
169
+ for (const layerConfig of findLayerConfigs(cwd)) {
170
+ inputs.push(toConfig('nuxt', layerConfig));
171
+ }
172
+ if (cwd !== options.cwd)
173
+ return inputs;
174
+ for (const file of _syncGlob({ cwd, patterns: ['.nuxt/module/*.d.ts'] })) {
175
+ const sourceFile = createSourceFile(join(cwd, file));
176
+ for (const path of collectLocalImportPaths(sourceFile))
177
+ inputs.push(toProductionEntry(path));
178
+ }
179
+ const dir = join(cwd, '.nuxt');
180
+ const tsConfig = await loadTSConfig(join(dir, 'tsconfig.json'));
181
+ const paths = tsConfig.compilerOptions?.paths;
182
+ if (paths) {
183
+ for (const key in paths) {
184
+ if (key === '#imports' || key === '#components')
185
+ continue;
186
+ inputs.push(toAlias(key, paths[key], { dir }));
187
+ }
188
+ }
189
+ inputs.push(toIgnore('#imports', 'unresolved'));
190
+ inputs.push(toIgnore('#components', 'unresolved'));
191
+ return inputs;
49
192
  };
50
- const note = `Knip works best with [explicit imports](https://nuxt.com/docs/guide/concepts/auto-imports#explicit-imports).
51
- Nuxt allows to [disable auto-imports](https://nuxt.com/docs/guide/concepts/auto-imports#disabling-auto-imports).`;
52
- export const docs = { note };
53
193
  const plugin = {
54
194
  title,
55
195
  enablers,
56
196
  isEnabled,
57
197
  config,
198
+ entry,
58
199
  production,
59
200
  setup,
60
201
  resolveConfig,
202
+ registerCompilers,
61
203
  };
62
204
  export default plugin;
@@ -1,9 +1,59 @@
1
1
  export interface NuxtConfig {
2
2
  srcDir?: string;
3
+ buildDir?: string;
4
+ serverDir?: string;
3
5
  dir?: {
4
6
  pages?: string;
5
7
  layouts?: string;
6
8
  middleware?: string;
9
+ plugins?: string;
7
10
  };
8
11
  modules?: Array<string | ((inlineOptions: any, nuxt: any) => any) | [string, Record<string, any>]>;
12
+ imports?: {
13
+ autoImport?: boolean;
14
+ dirs?: string[];
15
+ };
16
+ extends?: string[];
17
+ components?: Array<string | {
18
+ path: string;
19
+ }> | {
20
+ dirs?: Array<string | {
21
+ path: string;
22
+ }>;
23
+ };
24
+ css?: string[];
25
+ alias?: Record<string, string>;
26
+ }
27
+ export interface TemplateExpressionNode {
28
+ content: string;
29
+ isStatic: boolean;
30
+ }
31
+ export interface TemplateAstProp {
32
+ type: number;
33
+ exp?: TemplateExpressionNode;
34
+ arg?: TemplateExpressionNode;
9
35
  }
36
+ export interface TemplateAstNode {
37
+ type?: number;
38
+ tag?: string;
39
+ props?: TemplateAstProp[];
40
+ content?: TemplateExpressionNode;
41
+ children?: TemplateAstNode[];
42
+ }
43
+ export interface Descriptor {
44
+ script: {
45
+ content: string;
46
+ } | null;
47
+ scriptSetup: {
48
+ content: string;
49
+ } | null;
50
+ template: {
51
+ content: string;
52
+ ast?: TemplateAstNode;
53
+ } | null;
54
+ }
55
+ export type VueSfc = {
56
+ parse: (source: string, path: string) => {
57
+ descriptor: Descriptor;
58
+ };
59
+ };
@@ -1,4 +1,4 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  export declare const docs: {
3
3
  note: string;
4
4
  };
@@ -1,6 +1,7 @@
1
- import { compact } from '../../util/array.js';
2
- import { toConfig, toDependency } from '../../util/input.js';
3
- import { hasDependency } from '../../util/plugin.js';
1
+ import { compact } from "../../util/array.js";
2
+ import { toConfig, toDependency } from "../../util/input.js";
3
+ import { join } from "../../util/path.js";
4
+ import { hasDependency } from "../../util/plugin.js";
4
5
  const title = 'Nx';
5
6
  const enablers = ['nx', /^@nrwl\//, /^@nx\//];
6
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -34,18 +35,19 @@ const resolveConfig = async (localConfig, options) => {
34
35
  .map(target => target?.executor)
35
36
  .filter(executor => executor && !executor.startsWith('.'))
36
37
  .map(executor => executor?.split(':')[0]);
37
- const scripts = targets
38
+ const inputs = targets
38
39
  .filter(target => target.executor === 'nx:run-commands' || target.command)
39
40
  .flatMap(target => {
41
+ let commands = [];
40
42
  if (target.command)
41
- return [target.command];
42
- if (target.options?.command)
43
- return [target.options.command];
44
- if (target.options?.commands)
45
- return target.options.commands.map(commandConfig => typeof commandConfig === 'string' ? commandConfig : commandConfig.command);
46
- return [];
43
+ commands = [target.command];
44
+ else if (target.options?.command)
45
+ commands = [target.options.command];
46
+ else if (target.options?.commands)
47
+ commands = target.options.commands.map(commandConfig => typeof commandConfig === 'string' ? commandConfig : commandConfig.command);
48
+ const cwd = target.options?.cwd ? join(options.cwd, target.options.cwd) : undefined;
49
+ return options.getInputsFromScripts(commands, { cwd });
47
50
  });
48
- const inputs = options.getInputsFromScripts(scripts);
49
51
  const configInputs = targets.flatMap(target => {
50
52
  const opts = target.options;
51
53
  if (!opts)
@@ -8,6 +8,7 @@ export interface NxProjectConfiguration {
8
8
  commands?: Array<string | {
9
9
  command: string;
10
10
  }>;
11
+ cwd?: string;
11
12
  eslintConfig?: string;
12
13
  jestConfig?: string;
13
14
  tsConfig?: string;
@@ -1,3 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  declare const plugin: Plugin;
3
3
  export default plugin;
@@ -1,5 +1,5 @@
1
- import { toDeferResolve } from '../../util/input.js';
2
- import { hasDependency } from '../../util/plugin.js';
1
+ import { toDeferResolve } from "../../util/input.js";
2
+ import { hasDependency } from "../../util/plugin.js";
3
3
  const title = 'nyc';
4
4
  const enablers = ['nyc'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -1,3 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  declare const plugin: Plugin;
3
3
  export default plugin;
@@ -1,5 +1,5 @@
1
- import { toDependency } from '../../util/input.js';
2
- import { hasDependency } from '../../util/plugin.js';
1
+ import { toDependency } from "../../util/input.js";
2
+ import { hasDependency } from "../../util/plugin.js";
3
3
  const title = 'oclif';
4
4
  const enablers = ['oclif'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,13 @@
1
+ import { hasDependency } from "../../util/plugin.js";
2
+ import { toC12config } from "../../util/plugin-config.js";
3
+ const title = 'openapi-ts';
4
+ const enablers = ['@hey-api/openapi-ts'];
5
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
+ const config = ['package.json', ...toC12config('openapi-ts')];
7
+ const plugin = {
8
+ title,
9
+ enablers,
10
+ isEnabled,
11
+ config,
12
+ };
13
+ export default plugin;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,16 @@
1
+ import { hasDependency } from "../../util/plugin.js";
2
+ const title = 'Oxfmt';
3
+ const enablers = ['oxfmt'];
4
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
+ const config = ['.oxfmtrc.json', '.oxfmtrc.jsonc'];
6
+ const args = {
7
+ config: true,
8
+ };
9
+ const plugin = {
10
+ title,
11
+ enablers,
12
+ isEnabled,
13
+ config,
14
+ args,
15
+ };
16
+ export default plugin;
@@ -1,3 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  declare const plugin: Plugin;
3
3
  export default plugin;
@@ -1,8 +1,8 @@
1
- import { hasDependency } from '../../util/plugin.js';
1
+ import { hasDependency } from "../../util/plugin.js";
2
2
  const title = 'Oxlint';
3
3
  const enablers = ['oxlint'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['.oxlintrc.json'];
5
+ const config = ['.oxlintrc.json', 'oxlint.config.ts'];
6
6
  const args = {
7
7
  config: true,
8
8
  };
@@ -1,3 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  declare const plugin: Plugin;
3
3
  export default plugin;
@@ -1,5 +1,5 @@
1
- import { toDeferResolve } from '../../util/input.js';
2
- import { hasDependency } from '../../util/plugin.js';
1
+ import { toDeferResolve } from "../../util/input.js";
2
+ import { hasDependency } from "../../util/plugin.js";
3
3
  const title = 'Parcel';
4
4
  const enablers = ['parcel', '@parcel/core'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -1,3 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  declare const plugin: Plugin;
3
3
  export default plugin;
@@ -1,5 +1,5 @@
1
- import { toDeferResolve } from '../../util/input.js';
2
- import { hasDependency } from '../../util/plugin.js';
1
+ import { toDeferResolve } from "../../util/input.js";
2
+ import { hasDependency } from "../../util/plugin.js";
3
3
  const title = 'Payload CMS';
4
4
  const enablers = ['payload'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -1,5 +1,5 @@
1
- import type { Plugin, ResolveConfig } from '../../types/config.js';
2
- import type { PlaywrightTestConfig } from './types.js';
1
+ import type { Plugin, ResolveConfig } from '../../types/config.ts';
2
+ import type { PlaywrightTestConfig } from './types.ts';
3
3
  export declare const entry: string[];
4
4
  export declare const resolveConfig: ResolveConfig<PlaywrightTestConfig>;
5
5
  declare const plugin: Plugin;
@@ -1,7 +1,7 @@
1
- import { arrayify } from '../../util/array.js';
2
- import { toDeferResolve, toEntry } from '../../util/input.js';
3
- import { join, relative } from '../../util/path.js';
4
- import { hasDependency } from '../../util/plugin.js';
1
+ import { arrayify } from "../../util/array.js";
2
+ import { toDeferResolve, toEntry } from "../../util/input.js";
3
+ import { join, relative } from "../../util/path.js";
4
+ import { hasDependency } from "../../util/plugin.js";
5
5
  const title = 'Playwright';
6
6
  const enablers = ['@playwright/test'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -13,7 +13,7 @@ const toEntryPatterns = (testMatch, cwd, configDir, localConfig, rootConfig) =>
13
13
  const patterns = [testMatch].flat().filter((p) => typeof p === 'string');
14
14
  return patterns.map(pattern => toEntry(join(dir, pattern)));
15
15
  };
16
- const builtinReporters = ['dot', 'line', 'list', 'junit', 'html', 'blob', 'json', 'github'];
16
+ const builtinReporters = ['dot', 'line', 'list', 'junit', 'html', 'blob', 'json', 'github', 'null'];
17
17
  export const resolveConfig = async (localConfig, options) => {
18
18
  const { cwd, configFileDir } = options;
19
19
  const inputs = [];
@@ -1,3 +1,3 @@
1
- import type { Plugin } from '../../types/config.js';
1
+ import type { Plugin } from '../../types/config.ts';
2
2
  declare const plugin: Plugin;
3
3
  export default plugin;