knip 6.4.1 → 6.6.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 (343) hide show
  1. package/dist/CacheConsultant.js +3 -3
  2. package/dist/CatalogCounselor.js +5 -5
  3. package/dist/ConfigurationChief.d.ts +39 -16
  4. package/dist/ConfigurationChief.js +15 -15
  5. package/dist/DependencyDeputy.d.ts +1 -1
  6. package/dist/DependencyDeputy.js +5 -5
  7. package/dist/IssueCollector.js +3 -3
  8. package/dist/IssueFixer.js +5 -5
  9. package/dist/JsonCatalogPeeker.js +1 -1
  10. package/dist/ProjectPrincipal.js +13 -13
  11. package/dist/WorkspaceWorker.d.ts +7 -5
  12. package/dist/WorkspaceWorker.js +43 -30
  13. package/dist/YamlCatalogPeeker.js +1 -1
  14. package/dist/binaries/bash-parser.js +10 -10
  15. package/dist/binaries/fallback.js +3 -3
  16. package/dist/binaries/index.js +3 -3
  17. package/dist/binaries/plugins.js +8 -8
  18. package/dist/binaries/resolvers/bun.js +7 -7
  19. package/dist/binaries/resolvers/bunx.js +4 -4
  20. package/dist/binaries/resolvers/find.js +1 -1
  21. package/dist/binaries/resolvers/index.js +8 -8
  22. package/dist/binaries/resolvers/npm.js +2 -2
  23. package/dist/binaries/resolvers/npx.js +4 -4
  24. package/dist/binaries/resolvers/pnpm.js +5 -5
  25. package/dist/binaries/resolvers/pnpx.js +2 -2
  26. package/dist/binaries/resolvers/yarn.js +7 -7
  27. package/dist/cli.js +10 -10
  28. package/dist/compilers/index.d.ts +62 -22
  29. package/dist/compilers/index.js +2 -2
  30. package/dist/compilers/mdx.js +1 -1
  31. package/dist/compilers/scss.js +1 -1
  32. package/dist/constants.d.ts +25 -25
  33. package/dist/constants.js +1 -1
  34. package/dist/graph/analyze.js +7 -7
  35. package/dist/graph/build.d.ts +2 -2
  36. package/dist/graph/build.js +40 -30
  37. package/dist/graph-explorer/constants.d.ts +5 -5
  38. package/dist/graph-explorer/explorer.js +9 -9
  39. package/dist/graph-explorer/operations/build-exports-tree.js +2 -2
  40. package/dist/graph-explorer/operations/get-contention.js +3 -3
  41. package/dist/graph-explorer/operations/get-dependency-usage.js +1 -1
  42. package/dist/graph-explorer/operations/get-usage.js +5 -5
  43. package/dist/graph-explorer/operations/has-strictly-ns-references.js +1 -1
  44. package/dist/graph-explorer/operations/is-referenced.js +2 -2
  45. package/dist/graph-explorer/operations/resolve-definition.js +3 -3
  46. package/dist/graph-explorer/utils.d.ts +1 -1
  47. package/dist/graph-explorer/utils.js +2 -2
  48. package/dist/graph-explorer/visitors.js +1 -1
  49. package/dist/graph-explorer/walk-down.js +2 -2
  50. package/dist/graph-explorer/walk-up.js +2 -2
  51. package/dist/index.js +2 -2
  52. package/dist/manifest/helpers.js +2 -2
  53. package/dist/manifest/index.js +3 -3
  54. package/dist/plugins/_template/index.js +2 -2
  55. package/dist/plugins/angular/index.js +4 -4
  56. package/dist/plugins/astro/compiler-mdx.js +1 -1
  57. package/dist/plugins/astro/compiler.js +1 -1
  58. package/dist/plugins/astro/index.js +8 -6
  59. package/dist/plugins/astro/resolveFromAST.d.ts +1 -0
  60. package/dist/plugins/astro/resolveFromAST.js +40 -1
  61. package/dist/plugins/astro-db/index.js +1 -1
  62. package/dist/plugins/astro-og-canvas/index.js +2 -2
  63. package/dist/plugins/ava/index.js +2 -2
  64. package/dist/plugins/babel/helpers.d.ts +44 -6
  65. package/dist/plugins/babel/helpers.js +1 -1
  66. package/dist/plugins/babel/index.js +4 -4
  67. package/dist/plugins/biome/index.js +4 -4
  68. package/dist/plugins/bumpp/index.js +2 -2
  69. package/dist/plugins/bun/index.js +1 -1
  70. package/dist/plugins/c8/index.js +1 -1
  71. package/dist/plugins/capacitor/index.js +3 -3
  72. package/dist/plugins/changelogen/index.js +2 -2
  73. package/dist/plugins/changelogithub/index.js +2 -2
  74. package/dist/plugins/changesets/index.js +3 -3
  75. package/dist/plugins/commitizen/index.js +2 -2
  76. package/dist/plugins/commitlint/index.js +3 -3
  77. package/dist/plugins/convex/index.js +1 -1
  78. package/dist/plugins/create-typescript-app/index.js +1 -1
  79. package/dist/plugins/cspell/index.js +2 -2
  80. package/dist/plugins/cucumber/index.js +2 -2
  81. package/dist/plugins/cypress/helpers.js +2 -2
  82. package/dist/plugins/cypress/index.js +3 -3
  83. package/dist/plugins/danger/index.js +1 -1
  84. package/dist/plugins/dependency-cruiser/index.js +1 -1
  85. package/dist/plugins/docusaurus/helpers.js +2 -2
  86. package/dist/plugins/docusaurus/index.js +4 -4
  87. package/dist/plugins/dotenv/index.js +1 -1
  88. package/dist/plugins/drizzle/index.js +2 -2
  89. package/dist/plugins/eleventy/index.js +6 -6
  90. package/dist/plugins/eslint/helpers.js +5 -5
  91. package/dist/plugins/eslint/index.js +6 -11
  92. package/dist/plugins/eslint/resolveFromAST.js +3 -3
  93. package/dist/plugins/execa/index.js +2 -2
  94. package/dist/plugins/execa/visitors/execa.js +1 -1
  95. package/dist/plugins/expo/helpers.d.ts +3 -3
  96. package/dist/plugins/expo/helpers.js +3 -3
  97. package/dist/plugins/expo/index.js +4 -4
  98. package/dist/plugins/expressive-code/index.js +1 -1
  99. package/dist/plugins/gatsby/index.js +2 -2
  100. package/dist/plugins/github-action/index.js +4 -4
  101. package/dist/plugins/github-actions/index.js +4 -4
  102. package/dist/plugins/graphql-codegen/index.js +5 -5
  103. package/dist/plugins/hardhat/index.js +2 -2
  104. package/dist/plugins/husky/index.js +3 -3
  105. package/dist/plugins/i18next-parser/index.js +1 -1
  106. package/dist/plugins/index.d.ts +4 -0
  107. package/dist/plugins/index.js +152 -144
  108. package/dist/plugins/jest/helpers.js +2 -2
  109. package/dist/plugins/jest/index.js +4 -4
  110. package/dist/plugins/karma/helpers.d.ts +1 -1
  111. package/dist/plugins/karma/helpers.js +2 -2
  112. package/dist/plugins/karma/index.js +4 -4
  113. package/dist/plugins/knex/index.js +3 -3
  114. package/dist/plugins/ladle/index.js +4 -4
  115. package/dist/plugins/lefthook/index.js +5 -5
  116. package/dist/plugins/lint-staged/index.js +2 -2
  117. package/dist/plugins/linthtml/index.js +3 -3
  118. package/dist/plugins/lockfile-lint/index.js +2 -2
  119. package/dist/plugins/lost-pixel/index.js +1 -1
  120. package/dist/plugins/markdownlint/index.js +3 -3
  121. package/dist/plugins/mdx/index.js +2 -2
  122. package/dist/plugins/mdxlint/index.js +3 -3
  123. package/dist/plugins/metro/index.js +4 -4
  124. package/dist/plugins/mocha/index.js +2 -2
  125. package/dist/plugins/moonrepo/index.js +1 -1
  126. package/dist/plugins/msw/index.js +3 -3
  127. package/dist/plugins/nano-staged/index.js +1 -1
  128. package/dist/plugins/nest/index.js +2 -2
  129. package/dist/plugins/netlify/index.js +4 -4
  130. package/dist/plugins/next/index.js +3 -3
  131. package/dist/plugins/next/resolveFromAST.js +1 -1
  132. package/dist/plugins/next-intl/index.js +1 -1
  133. package/dist/plugins/next-mdx/index.js +3 -3
  134. package/dist/plugins/next-mdx/resolveFromAST.js +1 -1
  135. package/dist/plugins/nitro/index.js +3 -3
  136. package/dist/plugins/node/index.js +1 -1
  137. package/dist/plugins/node-modules-inspector/index.js +2 -2
  138. package/dist/plugins/npm-package-json-lint/index.js +3 -3
  139. package/dist/plugins/nuxt/helpers.js +3 -3
  140. package/dist/plugins/nuxt/index.js +10 -11
  141. package/dist/plugins/nx/index.js +4 -4
  142. package/dist/plugins/nyc/index.js +2 -2
  143. package/dist/plugins/oclif/index.js +2 -2
  144. package/dist/plugins/openapi-ts/index.js +2 -2
  145. package/dist/plugins/oxfmt/index.js +1 -1
  146. package/dist/plugins/oxlint/index.js +3 -3
  147. package/dist/plugins/panda-css/index.js +2 -2
  148. package/dist/plugins/parcel/index.js +2 -2
  149. package/dist/plugins/payload/index.js +2 -2
  150. package/dist/plugins/pino/index.d.ts +3 -0
  151. package/dist/plugins/pino/index.js +15 -0
  152. package/dist/plugins/pino/visitors/transportCall.d.ts +2 -0
  153. package/dist/plugins/pino/visitors/transportCall.js +87 -0
  154. package/dist/plugins/playwright/index.js +4 -4
  155. package/dist/plugins/playwright-ct/index.js +3 -3
  156. package/dist/plugins/playwright-test/index.js +1 -1
  157. package/dist/plugins/plop/index.js +1 -1
  158. package/dist/plugins/pm2/index.js +3 -3
  159. package/dist/plugins/pnpm/index.js +1 -1
  160. package/dist/plugins/postcss/index.js +3 -3
  161. package/dist/plugins/preconstruct/index.js +3 -3
  162. package/dist/plugins/prettier/index.js +6 -2
  163. package/dist/plugins/prisma/index.js +5 -5
  164. package/dist/plugins/qwik/index.js +5 -5
  165. package/dist/plugins/qwik/resolveFromAST.js +1 -1
  166. package/dist/plugins/raycast/index.js +3 -3
  167. package/dist/plugins/react-cosmos/index.js +3 -3
  168. package/dist/plugins/react-email/index.d.ts +3 -0
  169. package/dist/plugins/react-email/index.js +28 -0
  170. package/dist/plugins/react-native/index.js +2 -2
  171. package/dist/plugins/react-router/index.js +6 -10
  172. package/dist/plugins/relay/index.js +3 -3
  173. package/dist/plugins/release-it/index.js +2 -2
  174. package/dist/plugins/remark/index.js +3 -3
  175. package/dist/plugins/remix/index.js +1 -1
  176. package/dist/plugins/rolldown/index.js +3 -3
  177. package/dist/plugins/rolldown/resolveFromAST.js +1 -1
  178. package/dist/plugins/rollup/index.js +3 -3
  179. package/dist/plugins/rollup/resolveFromAST.js +1 -1
  180. package/dist/plugins/rsbuild/index.js +2 -2
  181. package/dist/plugins/rslib/index.js +9 -6
  182. package/dist/plugins/rslib/resolveFromAST.d.ts +2 -0
  183. package/dist/plugins/rslib/resolveFromAST.js +4 -0
  184. package/dist/plugins/rspack/index.js +2 -2
  185. package/dist/plugins/rstest/index.js +2 -2
  186. package/dist/plugins/sanity/index.js +1 -1
  187. package/dist/plugins/semantic-release/index.js +3 -3
  188. package/dist/plugins/sentry/index.js +1 -1
  189. package/dist/plugins/serverless-framework/index.d.ts +3 -0
  190. package/dist/plugins/serverless-framework/index.js +23 -0
  191. package/dist/plugins/serverless-framework/types.d.ts +7 -0
  192. package/dist/plugins/simple-git-hooks/index.js +2 -2
  193. package/dist/plugins/size-limit/index.js +3 -3
  194. package/dist/plugins/sst/index.js +2 -2
  195. package/dist/plugins/sst/resolveFromAST.js +5 -5
  196. package/dist/plugins/starlight/index.js +4 -4
  197. package/dist/plugins/starlight/resolveFromAST.js +1 -1
  198. package/dist/plugins/stencil/index.js +3 -3
  199. package/dist/plugins/storybook/index.js +3 -3
  200. package/dist/plugins/stryker/index.js +2 -2
  201. package/dist/plugins/stylelint/index.js +3 -3
  202. package/dist/plugins/svelte/compiler.js +1 -1
  203. package/dist/plugins/svelte/index.js +3 -3
  204. package/dist/plugins/sveltejs-package/helpers.d.ts +8 -0
  205. package/dist/plugins/sveltejs-package/helpers.js +65 -0
  206. package/dist/plugins/sveltejs-package/index.d.ts +3 -0
  207. package/dist/plugins/sveltejs-package/index.js +27 -0
  208. package/dist/plugins/sveltekit/index.js +3 -3
  209. package/dist/plugins/svgo/index.js +1 -1
  210. package/dist/plugins/svgr/index.js +2 -2
  211. package/dist/plugins/swc/index.js +3 -3
  212. package/dist/plugins/syncpack/index.js +2 -2
  213. package/dist/plugins/tailwind/index.js +2 -2
  214. package/dist/plugins/tanstack-router/index.js +3 -3
  215. package/dist/plugins/taskfile/index.js +3 -3
  216. package/dist/plugins/travis/index.js +1 -1
  217. package/dist/plugins/tsdown/index.js +3 -3
  218. package/dist/plugins/tsdown/resolveFromAST.js +1 -1
  219. package/dist/plugins/tsup/index.js +3 -3
  220. package/dist/plugins/tsup/resolveFromAST.js +1 -1
  221. package/dist/plugins/tsx/index.js +2 -2
  222. package/dist/plugins/typedoc/index.js +2 -2
  223. package/dist/plugins/typescript/index.js +4 -4
  224. package/dist/plugins/unbuild/index.js +2 -2
  225. package/dist/plugins/unocss/index.js +2 -2
  226. package/dist/plugins/vercel-og/index.js +1 -1
  227. package/dist/plugins/vike/index.js +1 -1
  228. package/dist/plugins/vite/helpers.js +4 -4
  229. package/dist/plugins/vite/index.js +5 -5
  230. package/dist/plugins/vite/visitors/importMetaGlob.js +4 -4
  231. package/dist/plugins/vitepress/index.js +1 -1
  232. package/dist/plugins/vitest/helpers.d.ts +4 -2
  233. package/dist/plugins/vitest/helpers.js +18 -0
  234. package/dist/plugins/vitest/index.js +9 -23
  235. package/dist/plugins/vue/compiler.js +1 -1
  236. package/dist/plugins/vue/index.js +4 -4
  237. package/dist/plugins/webdriver-io/index.js +2 -2
  238. package/dist/plugins/webpack/index.js +5 -5
  239. package/dist/plugins/webpack/visitors/requireContext.js +6 -7
  240. package/dist/plugins/wireit/index.js +1 -1
  241. package/dist/plugins/wrangler/index.js +2 -2
  242. package/dist/plugins/xo/index.js +2 -2
  243. package/dist/plugins/yarn/index.js +2 -2
  244. package/dist/plugins/yorkie/index.js +2 -2
  245. package/dist/plugins/zx/index.js +2 -2
  246. package/dist/plugins.js +2 -2
  247. package/dist/reporters/codeclimate.js +2 -2
  248. package/dist/reporters/codeowners.js +3 -3
  249. package/dist/reporters/compact.js +1 -1
  250. package/dist/reporters/disclosure.js +1 -1
  251. package/dist/reporters/github-actions.js +4 -4
  252. package/dist/reporters/index.js +8 -8
  253. package/dist/reporters/json.js +4 -4
  254. package/dist/reporters/markdown.js +2 -2
  255. package/dist/reporters/symbols.js +2 -2
  256. package/dist/reporters/trace.js +7 -7
  257. package/dist/reporters/util/configuration-hints.d.ts +2 -2
  258. package/dist/reporters/util/configuration-hints.js +7 -10
  259. package/dist/reporters/util/util.d.ts +3 -3
  260. package/dist/reporters/util/util.js +16 -15
  261. package/dist/reporters/watch.js +7 -7
  262. package/dist/run.js +14 -14
  263. package/dist/schema/configuration.d.ts +89 -31
  264. package/dist/schema/configuration.js +2 -2
  265. package/dist/schema/plugins.d.ts +20 -0
  266. package/dist/schema/plugins.js +4 -0
  267. package/dist/session/build-maps.js +3 -3
  268. package/dist/session/file-descriptor.js +3 -3
  269. package/dist/session/index.js +7 -7
  270. package/dist/session/package-json-descriptor.js +1 -1
  271. package/dist/session/session.js +3 -3
  272. package/dist/types/PluginNames.d.ts +2 -2
  273. package/dist/types/PluginNames.js +4 -0
  274. package/dist/types/args.d.ts +2 -0
  275. package/dist/types/config.d.ts +17 -4
  276. package/dist/types/issues.d.ts +1 -1
  277. package/dist/typescript/SourceFileManager.js +3 -3
  278. package/dist/typescript/ast-helpers.d.ts +2 -0
  279. package/dist/typescript/ast-helpers.js +5 -5
  280. package/dist/typescript/comments.js +1 -1
  281. package/dist/typescript/follow-imports.js +2 -2
  282. package/dist/typescript/get-imports-and-exports.js +10 -10
  283. package/dist/typescript/resolve-module-names.js +5 -5
  284. package/dist/typescript/visitors/calls.js +3 -3
  285. package/dist/typescript/visitors/exports.js +4 -4
  286. package/dist/typescript/visitors/helpers.js +3 -3
  287. package/dist/typescript/visitors/imports.js +4 -4
  288. package/dist/typescript/visitors/members.js +4 -4
  289. package/dist/typescript/visitors/walk.js +9 -9
  290. package/dist/util/Performance.d.ts +1 -1
  291. package/dist/util/Performance.js +2 -2
  292. package/dist/util/catalog.js +3 -3
  293. package/dist/util/codeowners.js +4 -4
  294. package/dist/util/colors.d.ts +18 -0
  295. package/dist/util/colors.js +24 -0
  296. package/dist/util/create-input-handler.js +6 -6
  297. package/dist/util/create-options.d.ts +72 -33
  298. package/dist/util/create-options.js +14 -15
  299. package/dist/util/create-workspace-graph.js +1 -1
  300. package/dist/util/debug.js +2 -4
  301. package/dist/util/file-entry-cache.js +4 -4
  302. package/dist/util/fs.js +2 -2
  303. package/dist/util/get-included-issue-types.js +2 -2
  304. package/dist/util/git.js +1 -1
  305. package/dist/util/glob-cache.js +4 -4
  306. package/dist/util/glob-core.d.ts +3 -3
  307. package/dist/util/glob-core.js +80 -64
  308. package/dist/util/glob.d.ts +1 -1
  309. package/dist/util/glob.js +14 -7
  310. package/dist/util/input.js +1 -1
  311. package/dist/util/issue-initializers.js +1 -1
  312. package/dist/util/jiti.js +1 -1
  313. package/dist/util/load-config.js +3 -3
  314. package/dist/util/load-tsconfig.js +62 -50
  315. package/dist/util/loader.js +5 -5
  316. package/dist/util/log.js +3 -3
  317. package/dist/util/map-workspaces.js +6 -6
  318. package/dist/util/modules.js +2 -2
  319. package/dist/util/package-json.d.ts +5 -0
  320. package/dist/util/package-json.js +9 -0
  321. package/dist/util/package-name.js +1 -1
  322. package/dist/util/parse-and-convert-gitignores.d.ts +4 -2
  323. package/dist/util/parse-and-convert-gitignores.js +19 -7
  324. package/dist/util/plugin.js +5 -5
  325. package/dist/util/remove-export.js +1 -1
  326. package/dist/util/reporter.js +3 -3
  327. package/dist/util/require.js +1 -1
  328. package/dist/util/resolve.js +3 -3
  329. package/dist/util/string.d.ts +1 -1
  330. package/dist/util/table.js +1 -1
  331. package/dist/util/tag.js +1 -1
  332. package/dist/util/to-source-path.d.ts +4 -2
  333. package/dist/util/to-source-path.js +46 -22
  334. package/dist/util/trace.js +8 -8
  335. package/dist/util/watch.js +8 -8
  336. package/dist/util/workspace-file-filter.js +2 -2
  337. package/dist/util/workspace-selectors.js +4 -4
  338. package/dist/version.d.ts +1 -1
  339. package/dist/version.js +1 -1
  340. package/package.json +12 -19
  341. package/schema.json +13 -1
  342. package/dist/plugins/rslib/types.d.ts +0 -1
  343. /package/dist/plugins/{rslib → serverless-framework}/types.js +0 -0
@@ -10,7 +10,6 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
10
10
  configFilePath: string | undefined;
11
11
  cwd: string;
12
12
  dependencies: boolean;
13
- experimentalTags: import("../types/options.ts").Tags;
14
13
  exports: boolean;
15
14
  files: boolean;
16
15
  fixTypes: string[];
@@ -422,6 +421,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
422
421
  entry?: string | string[] | undefined;
423
422
  project?: string | string[] | undefined;
424
423
  } | undefined;
424
+ pino?: string | boolean | string[] | {
425
+ config?: string | string[] | undefined;
426
+ entry?: string | string[] | undefined;
427
+ project?: string | string[] | undefined;
428
+ } | undefined;
425
429
  playwright?: string | boolean | string[] | {
426
430
  config?: string | string[] | undefined;
427
431
  entry?: string | string[] | undefined;
@@ -487,6 +491,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
487
491
  entry?: string | string[] | undefined;
488
492
  project?: string | string[] | undefined;
489
493
  } | undefined;
494
+ 'react-email'?: string | boolean | string[] | {
495
+ config?: string | string[] | undefined;
496
+ entry?: string | string[] | undefined;
497
+ project?: string | string[] | undefined;
498
+ } | undefined;
490
499
  'react-native'?: string | boolean | string[] | {
491
500
  config?: string | string[] | undefined;
492
501
  entry?: string | string[] | undefined;
@@ -562,6 +571,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
562
571
  entry?: string | string[] | undefined;
563
572
  project?: string | string[] | undefined;
564
573
  } | undefined;
574
+ 'serverless-framework'?: string | boolean | string[] | {
575
+ config?: string | string[] | undefined;
576
+ entry?: string | string[] | undefined;
577
+ project?: string | string[] | undefined;
578
+ } | undefined;
565
579
  'simple-git-hooks'?: string | boolean | string[] | {
566
580
  config?: string | string[] | undefined;
567
581
  entry?: string | string[] | undefined;
@@ -607,6 +621,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
607
621
  entry?: string | string[] | undefined;
608
622
  project?: string | string[] | undefined;
609
623
  } | undefined;
624
+ 'sveltejs-package'?: string | boolean | string[] | {
625
+ config?: string | string[] | undefined;
626
+ entry?: string | string[] | undefined;
627
+ project?: string | string[] | undefined;
628
+ } | undefined;
610
629
  sveltekit?: string | boolean | string[] | {
611
630
  config?: string | string[] | undefined;
612
631
  entry?: string | string[] | undefined;
@@ -762,6 +781,28 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
762
781
  entry?: string | string[] | undefined;
763
782
  project?: string | string[] | undefined;
764
783
  } | undefined;
784
+ $schema?: string | undefined;
785
+ rules?: Partial<Record<"binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved", "error" | "off" | "warn">> | undefined;
786
+ entry?: string | string[] | undefined;
787
+ project?: string | string[] | undefined;
788
+ paths?: Record<string, string[]> | undefined;
789
+ ignore?: string | string[] | undefined;
790
+ ignoreFiles?: string | string[] | undefined;
791
+ ignoreBinaries?: (string | RegExp)[] | undefined;
792
+ ignoreDependencies?: (string | RegExp)[] | undefined;
793
+ ignoreMembers?: (string | RegExp)[] | undefined;
794
+ ignoreUnresolved?: (string | RegExp)[] | undefined;
795
+ ignoreExportsUsedInFile?: boolean | Record<string, boolean | undefined> | undefined;
796
+ ignoreIssues?: Record<string, ("binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved")[]> | undefined;
797
+ ignoreWorkspaces?: string[] | undefined;
798
+ includeEntryExports?: boolean | undefined;
799
+ compilers?: Record<string, true | import("../compilers/types.ts").CompilerAsync | import("../compilers/types.ts").CompilerSync> | undefined;
800
+ syncCompilers?: Record<string, true | import("../compilers/types.ts").CompilerSync> | undefined;
801
+ asyncCompilers?: Record<string, import("../compilers/types.ts").CompilerAsync> | undefined;
802
+ tags?: string[] | undefined;
803
+ treatConfigHintsAsErrors?: boolean | undefined;
804
+ include?: ("binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved")[] | undefined;
805
+ exclude?: ("binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved")[] | undefined;
765
806
  workspaces?: Record<string, {
766
807
  angular?: string | boolean | string[] | {
767
808
  config?: string | string[] | undefined;
@@ -1143,6 +1184,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1143
1184
  entry?: string | string[] | undefined;
1144
1185
  project?: string | string[] | undefined;
1145
1186
  } | undefined;
1187
+ pino?: string | boolean | string[] | {
1188
+ config?: string | string[] | undefined;
1189
+ entry?: string | string[] | undefined;
1190
+ project?: string | string[] | undefined;
1191
+ } | undefined;
1146
1192
  playwright?: string | boolean | string[] | {
1147
1193
  config?: string | string[] | undefined;
1148
1194
  entry?: string | string[] | undefined;
@@ -1208,6 +1254,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1208
1254
  entry?: string | string[] | undefined;
1209
1255
  project?: string | string[] | undefined;
1210
1256
  } | undefined;
1257
+ 'react-email'?: string | boolean | string[] | {
1258
+ config?: string | string[] | undefined;
1259
+ entry?: string | string[] | undefined;
1260
+ project?: string | string[] | undefined;
1261
+ } | undefined;
1211
1262
  'react-native'?: string | boolean | string[] | {
1212
1263
  config?: string | string[] | undefined;
1213
1264
  entry?: string | string[] | undefined;
@@ -1283,6 +1334,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1283
1334
  entry?: string | string[] | undefined;
1284
1335
  project?: string | string[] | undefined;
1285
1336
  } | undefined;
1337
+ 'serverless-framework'?: string | boolean | string[] | {
1338
+ config?: string | string[] | undefined;
1339
+ entry?: string | string[] | undefined;
1340
+ project?: string | string[] | undefined;
1341
+ } | undefined;
1286
1342
  'simple-git-hooks'?: string | boolean | string[] | {
1287
1343
  config?: string | string[] | undefined;
1288
1344
  entry?: string | string[] | undefined;
@@ -1328,6 +1384,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1328
1384
  entry?: string | string[] | undefined;
1329
1385
  project?: string | string[] | undefined;
1330
1386
  } | undefined;
1387
+ 'sveltejs-package'?: string | boolean | string[] | {
1388
+ config?: string | string[] | undefined;
1389
+ entry?: string | string[] | undefined;
1390
+ project?: string | string[] | undefined;
1391
+ } | undefined;
1331
1392
  sveltekit?: string | boolean | string[] | {
1332
1393
  config?: string | string[] | undefined;
1333
1394
  entry?: string | string[] | undefined;
@@ -1494,45 +1555,23 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1494
1555
  ignoreUnresolved?: (string | RegExp)[] | undefined;
1495
1556
  includeEntryExports?: boolean | undefined;
1496
1557
  }> | undefined;
1497
- include?: ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "nsExports" | "types" | "nsTypes" | "enumMembers" | "namespaceMembers" | "duplicates" | "catalog")[] | undefined;
1498
- exclude?: ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "nsExports" | "types" | "nsTypes" | "enumMembers" | "namespaceMembers" | "duplicates" | "catalog")[] | undefined;
1499
- $schema?: string | undefined;
1500
- rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "nsExports" | "types" | "nsTypes" | "enumMembers" | "namespaceMembers" | "duplicates" | "catalog", "error" | "warn" | "off">> | undefined;
1501
- entry?: string | string[] | undefined;
1502
- project?: string | string[] | undefined;
1503
- paths?: Record<string, string[]> | undefined;
1504
- ignore?: string | string[] | undefined;
1505
- ignoreFiles?: string | string[] | undefined;
1506
- ignoreBinaries?: (string | RegExp)[] | undefined;
1507
- ignoreDependencies?: (string | RegExp)[] | undefined;
1508
- ignoreMembers?: (string | RegExp)[] | undefined;
1509
- ignoreUnresolved?: (string | RegExp)[] | undefined;
1510
- ignoreExportsUsedInFile?: boolean | Record<string, boolean | undefined> | undefined;
1511
- ignoreIssues?: Record<string, ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "nsExports" | "types" | "nsTypes" | "enumMembers" | "namespaceMembers" | "duplicates" | "catalog")[]> | undefined;
1512
- ignoreWorkspaces?: string[] | undefined;
1513
- includeEntryExports?: boolean | undefined;
1514
- compilers?: Record<string, true | ((filename: string, contents: string) => string) | ((filename: string, contents: string) => Promise<string>)> | undefined;
1515
- syncCompilers?: Record<string, true | ((filename: string, contents: string) => string)> | undefined;
1516
- asyncCompilers?: Record<string, (filename: string, contents: string) => Promise<string>> | undefined;
1517
- tags?: string[] | undefined;
1518
- treatConfigHintsAsErrors?: boolean | undefined;
1519
1558
  };
1520
1559
  rules: {
1521
- files: import("../types/issues.ts").IssueSeverity;
1560
+ binaries: import("../types/issues.ts").IssueSeverity;
1561
+ catalog: import("../types/issues.ts").IssueSeverity;
1522
1562
  dependencies: import("../types/issues.ts").IssueSeverity;
1523
1563
  devDependencies: import("../types/issues.ts").IssueSeverity;
1524
- optionalPeerDependencies: import("../types/issues.ts").IssueSeverity;
1525
- unlisted: import("../types/issues.ts").IssueSeverity;
1526
- binaries: import("../types/issues.ts").IssueSeverity;
1527
- unresolved: import("../types/issues.ts").IssueSeverity;
1564
+ duplicates: import("../types/issues.ts").IssueSeverity;
1565
+ enumMembers: import("../types/issues.ts").IssueSeverity;
1528
1566
  exports: import("../types/issues.ts").IssueSeverity;
1567
+ files: import("../types/issues.ts").IssueSeverity;
1568
+ namespaceMembers: import("../types/issues.ts").IssueSeverity;
1529
1569
  nsExports: import("../types/issues.ts").IssueSeverity;
1530
- types: import("../types/issues.ts").IssueSeverity;
1531
1570
  nsTypes: import("../types/issues.ts").IssueSeverity;
1532
- enumMembers: import("../types/issues.ts").IssueSeverity;
1533
- namespaceMembers: import("../types/issues.ts").IssueSeverity;
1534
- duplicates: import("../types/issues.ts").IssueSeverity;
1535
- catalog: import("../types/issues.ts").IssueSeverity;
1571
+ optionalPeerDependencies: import("../types/issues.ts").IssueSeverity;
1572
+ types: import("../types/issues.ts").IssueSeverity;
1573
+ unlisted: import("../types/issues.ts").IssueSeverity;
1574
+ unresolved: import("../types/issues.ts").IssueSeverity;
1536
1575
  };
1537
1576
  tags: import("../types/options.ts").Tags;
1538
1577
  traceDependency: string | undefined;
@@ -1,17 +1,17 @@
1
- import { partitionCompilers } from "../compilers/index.js";
2
- import { ISSUE_TYPES, KNIP_CONFIG_LOCATIONS } from "../constants.js";
3
- import { knipConfigurationSchema } from "../schema/configuration.js";
4
- import { getCatalogContainer } from "./catalog.js";
5
- import { ConfigurationError } from "./errors.js";
6
- import { findFile, loadJSON } from "./fs.js";
7
- import { getIncludedIssueTypes, shorthandDeps, shorthandExports, shorthandFiles } from "./get-included-issue-types.js";
8
- import { defaultRules } from "./issue-initializers.js";
9
- import { loadResolvedConfigFile } from "./load-config.js";
10
- import { _load } from "./loader.js";
11
- import { logWarning } from "./log.js";
12
- import { getKeysByValue } from "./object.js";
13
- import { isAbsolute, join, normalize, toAbsolute, toPosix } from "./path.js";
14
- import { splitTags } from "./tag.js";
1
+ import { partitionCompilers } from '../compilers/index.js';
2
+ import { ISSUE_TYPES, KNIP_CONFIG_LOCATIONS } from '../constants.js';
3
+ import { knipConfigurationSchema } from '../schema/configuration.js';
4
+ import { getCatalogContainer } from './catalog.js';
5
+ import { ConfigurationError } from './errors.js';
6
+ import { findFile, loadJSON } from './fs.js';
7
+ import { getIncludedIssueTypes, shorthandDeps, shorthandExports, shorthandFiles } from './get-included-issue-types.js';
8
+ import { defaultRules } from './issue-initializers.js';
9
+ import { loadResolvedConfigFile } from './load-config.js';
10
+ import { _load } from './loader.js';
11
+ import { logWarning } from './log.js';
12
+ import { getKeysByValue } from './object.js';
13
+ import { isAbsolute, join, normalize, toAbsolute, toPosix } from './path.js';
14
+ import { splitTags } from './tag.js';
15
15
  export const createOptions = async (options) => {
16
16
  const { args = {} } = options;
17
17
  const pcwd = process.cwd();
@@ -99,7 +99,6 @@ export const createOptions = async (options) => {
99
99
  configFilePath,
100
100
  cwd,
101
101
  dependencies: args.dependencies ?? false,
102
- experimentalTags: tags,
103
102
  exports: args.exports ?? false,
104
103
  files: args.files ?? false,
105
104
  fixTypes,
@@ -1,4 +1,4 @@
1
- import { join } from "./path.js";
1
+ import { join } from './path.js';
2
2
  const types = ['peerDependencies', 'devDependencies', 'optionalDependencies', 'dependencies'];
3
3
  export function createWorkspaceGraph(cwd, wsNames, wsPkgNames, wsPackages) {
4
4
  const graph = new Map();
@@ -1,14 +1,12 @@
1
1
  import util, { parseArgs } from 'node:util';
2
- import picocolors from 'picocolors';
2
+ import st from './colors.js';
3
3
  const { values } = parseArgs({ strict: false, options: { debug: { type: 'boolean' } } });
4
4
  const IS_DEBUG_ENABLED = values.debug ?? false;
5
5
  const IS_COLORS = !process.env.NO_COLOR;
6
6
  const noop = () => { };
7
7
  const inspectOptions = { maxArrayLength: null, depth: null, colors: IS_COLORS };
8
8
  export const inspect = (obj) => console.log(util.inspect(obj, inspectOptions));
9
- const ctx = (text) => typeof text === 'string'
10
- ? picocolors.yellow(`[${text}]`)
11
- : `${picocolors.yellow(`[${text[0]}]`)} ${picocolors.cyan(text[1])}`;
9
+ const ctx = (text) => typeof text === 'string' ? st.yellow(`[${text}]`) : `${st.yellow(`[${text[0]}]`)} ${st.cyan(text[1])}`;
12
10
  const logArray = (collection) => {
13
11
  console.log(util.inspect(collection.sort(), inspectOptions));
14
12
  };
@@ -1,10 +1,10 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { deserialize, serialize } from 'node:v8';
4
- import { debugLog } from "./debug.js";
5
- import { isDirectory, isFile } from "./fs.js";
6
- import { timerify } from "./Performance.js";
7
- import { dirname, isAbsolute, resolve } from "./path.js";
4
+ import { debugLog } from './debug.js';
5
+ import { isDirectory, isFile } from './fs.js';
6
+ import { timerify } from './Performance.js';
7
+ import { dirname, isAbsolute, resolve } from './path.js';
8
8
  const createCache = (filePath) => {
9
9
  try {
10
10
  return deserialize(fs.readFileSync(filePath));
package/dist/util/fs.js CHANGED
@@ -3,8 +3,8 @@ import { readFile } from 'node:fs/promises';
3
3
  import { parse as parseYAMLContents } from 'yaml';
4
4
  import { parse as parseTOML } from 'smol-toml';
5
5
  import stripJsonComments from 'strip-json-comments';
6
- import { LoaderError } from "./errors.js";
7
- import { extname, join, toPosix } from "./path.js";
6
+ import { LoaderError } from './errors.js';
7
+ import { extname, join, toPosix } from './path.js';
8
8
  export const isDirectory = (cwdOrPath, name) => {
9
9
  try {
10
10
  return statSync(name ? join(cwdOrPath, name) : cwdOrPath).isDirectory();
@@ -1,5 +1,5 @@
1
- import { ISSUE_TYPES } from "../constants.js";
2
- import { ConfigurationError } from "./errors.js";
1
+ import { ISSUE_TYPES } from '../constants.js';
2
+ import { ConfigurationError } from './errors.js';
3
3
  export const defaultExcludedIssueTypes = ['nsExports', 'nsTypes'];
4
4
  const defaultIssueTypes = ISSUE_TYPES.filter(type => !defaultExcludedIssueTypes.includes(type));
5
5
  const normalize = (values) => values.flatMap(value => value.split(','));
package/dist/util/git.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { execSync } from 'node:child_process';
2
- import { join } from "./path.js";
2
+ import { join } from './path.js';
3
3
  const hookFileNames = [
4
4
  'prepare-commit-msg',
5
5
  'commit-msg',
@@ -2,10 +2,10 @@ import { createHash } from 'node:crypto';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { deserialize, serialize } from 'node:v8';
5
- import { version } from "../version.js";
6
- import { debugLog } from "./debug.js";
7
- import { isDirectory, isFile } from "./fs.js";
8
- import { dirname } from "./path.js";
5
+ import { version } from '../version.js';
6
+ import { debugLog } from './debug.js';
7
+ import { isDirectory, isFile } from './fs.js';
8
+ import { dirname } from './path.js';
9
9
  const CACHE_FILENAME = `glob-${version}.cache`;
10
10
  let cacheFilePath;
11
11
  let cache;
@@ -1,9 +1,9 @@
1
- import { type Options as FastGlobOptions } from 'fast-glob';
1
+ import { type GlobOptions as TinyGlobOptions } from 'tinyglobby';
2
2
  type Options = {
3
3
  gitignore: boolean;
4
4
  cwd: string;
5
5
  };
6
- interface GlobOptions extends FastGlobOptions {
6
+ interface GlobOptions extends TinyGlobOptions {
7
7
  gitignore: boolean;
8
8
  cwd: string;
9
9
  dir: string;
@@ -12,7 +12,7 @@ interface GlobOptions extends FastGlobOptions {
12
12
  export declare const findAndParseGitignores: (cwd: string, workspaceDirs?: Set<string>) => Promise<{
13
13
  gitignoreFiles: string[];
14
14
  ignores: Set<string>;
15
- unignores: string[];
15
+ unignores: Set<string>;
16
16
  }>;
17
17
  export declare function glob(_patterns: string[], options: GlobOptions): Promise<string[]>;
18
18
  export declare function getGitIgnoredHandler(options: Options, workspaceDirs?: Set<string>): Promise<(path: string) => boolean>;
@@ -1,16 +1,15 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { promisify } from 'node:util';
3
- import { walk as _walk } from '@nodelib/fs.walk';
4
- import fg, {} from 'fast-glob';
2
+ import { basename } from 'node:path';
3
+ import { fdir } from 'fdir';
4
+ import { glob as tinyGlob } from 'tinyglobby';
5
5
  import picomatch from 'picomatch';
6
- import { GLOBAL_IGNORE_PATTERNS } from "../constants.js";
7
- import { compact, partition } from "./array.js";
8
- import { debugLogObject } from "./debug.js";
9
- import { isDirectory, isFile } from "./fs.js";
10
- import { timerify } from "./Performance.js";
11
- import { parseAndConvertGitignorePatterns } from "./parse-and-convert-gitignores.js";
12
- import { dirname, join, relative, toPosix } from "./path.js";
13
- const walk = promisify(_walk);
6
+ import { GLOBAL_IGNORE_PATTERNS } from '../constants.js';
7
+ import { compact, partition } from './array.js';
8
+ import { debugLogObject } from './debug.js';
9
+ import { isDirectory, isFile } from './fs.js';
10
+ import { timerify } from './Performance.js';
11
+ import { expandIgnorePatterns, parseAndConvertGitignorePatterns } from './parse-and-convert-gitignores.js';
12
+ import { dirname, join, relative, toPosix } from './path.js';
14
13
  const cachedGitIgnores = new Map();
15
14
  const cachedGlobIgnores = new Map();
16
15
  const isGitRoot = (dir) => isDirectory(dir, '.git') || isFile(dir, '.git');
@@ -46,20 +45,21 @@ const findAncestorGitignoreFiles = (cwd) => {
46
45
  };
47
46
  export const findAndParseGitignores = async (cwd, workspaceDirs) => {
48
47
  const ignores = new Set(GLOBAL_IGNORE_PATTERNS);
49
- const unignores = [];
48
+ const unignores = new Set();
50
49
  const gitignoreFiles = [];
51
- const pmOptions = { ignore: unignores };
52
50
  let deepFilterMatcher;
53
- let prevUnignoreLength = unignores.length;
51
+ let prevUnignoreSize = unignores.size;
52
+ let unignoresArray = [];
54
53
  const pendingIgnores = [];
55
54
  const getMatcher = () => {
56
55
  if (!deepFilterMatcher) {
57
- deepFilterMatcher = picomatch(Array.from(ignores), pmOptions);
56
+ unignoresArray = Array.from(unignores);
57
+ deepFilterMatcher = picomatch(Array.from(ignores), { ignore: unignoresArray });
58
58
  pendingIgnores.length = 0;
59
59
  }
60
60
  else if (pendingIgnores.length > 0) {
61
61
  const prev = deepFilterMatcher;
62
- const incr = picomatch(pendingIgnores.splice(0), pmOptions);
62
+ const incr = picomatch(pendingIgnores.splice(0), { ignore: unignoresArray });
63
63
  deepFilterMatcher = (path) => prev(path) || incr(path);
64
64
  }
65
65
  return deepFilterMatcher;
@@ -73,41 +73,29 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
73
73
  const unignoresForDir = new Set();
74
74
  const prevIgnoreSize = ignores.size;
75
75
  const patterns = readFileSync(filePath, 'utf8');
76
- for (const rule of parseAndConvertGitignorePatterns(patterns, ancestor)) {
77
- const [pattern, extraPattern] = rule.patterns;
78
- if (rule.negated) {
79
- if (base === '' || base.startsWith('..')) {
80
- if (!unignores.includes(extraPattern)) {
81
- unignores.push(...rule.patterns);
76
+ const isRoot = base === '' || base.startsWith('..');
77
+ for (const { negated, pattern } of parseAndConvertGitignorePatterns(patterns, ancestor)) {
78
+ if (negated) {
79
+ if (isRoot) {
80
+ if (!unignores.has(pattern)) {
81
+ unignores.add(pattern);
82
82
  unignoresForDir.add(pattern);
83
- unignoresForDir.add(extraPattern);
84
83
  }
85
84
  }
86
- else {
87
- if (!unignores.includes(extraPattern.startsWith('**/') ? extraPattern : `**/${extraPattern}`)) {
88
- const unignore = join(base, pattern);
89
- const extraUnignore = join(base, extraPattern);
90
- unignores.push(unignore, extraUnignore);
91
- unignoresForDir.add(unignore);
92
- unignoresForDir.add(extraUnignore);
93
- }
85
+ else if (!unignores.has(pattern)) {
86
+ const unignore = join(base, pattern);
87
+ unignores.add(unignore);
88
+ unignoresForDir.add(unignore);
94
89
  }
95
90
  }
96
- else {
97
- if (base === '' || base.startsWith('..')) {
98
- ignores.add(pattern);
99
- ignores.add(extraPattern);
100
- ignoresForDir.add(pattern);
101
- ignoresForDir.add(extraPattern);
102
- }
103
- else if (!unignores.includes(extraPattern.startsWith('**/') ? extraPattern : `**/${extraPattern}`)) {
104
- const ignore = join(base, pattern);
105
- const extraIgnore = join(base, extraPattern);
106
- ignores.add(ignore);
107
- ignores.add(extraIgnore);
108
- ignoresForDir.add(ignore);
109
- ignoresForDir.add(extraIgnore);
110
- }
91
+ else if (isRoot) {
92
+ ignores.add(pattern);
93
+ ignoresForDir.add(pattern);
94
+ }
95
+ else if (!unignores.has(pattern)) {
96
+ const ignore = join(base, pattern);
97
+ ignores.add(ignore);
98
+ ignoresForDir.add(ignore);
111
99
  }
112
100
  }
113
101
  const cacheDir = ancestor ? cwd : dir;
@@ -121,9 +109,9 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
121
109
  else {
122
110
  cachedGitIgnores.set(cacheDir, { ignores: ignoresForDir, unignores: unignoresForDir });
123
111
  }
124
- if (unignores.length !== prevUnignoreLength) {
112
+ if (unignores.size !== prevUnignoreSize) {
125
113
  deepFilterMatcher = undefined;
126
- prevUnignoreLength = unignores.length;
114
+ prevUnignoreSize = unignores.size;
127
115
  }
128
116
  else if (ignores.size !== prevIgnoreSize) {
129
117
  for (const p of ignoresForDir)
@@ -166,19 +154,48 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
166
154
  };
167
155
  }
168
156
  }
169
- const entryFilter = (entry) => {
170
- if (entry.dirent.isFile() && entry.name === '.gitignore') {
171
- addFile(entry.path);
157
+ const cwdPrefixLen = cwd.length + 1;
158
+ const walkGitignores = async () => {
159
+ await new fdir()
160
+ .withFullPaths()
161
+ .exclude((_dirName, dirPath) => {
162
+ const absPath = toPosix(dirPath.slice(0, -1));
163
+ return (isRelevantDir && !isRelevantDir(absPath)) || getMatcher()(absPath.slice(cwdPrefixLen));
164
+ })
165
+ .filter((filePath, isDir) => {
166
+ if (isDir || basename(filePath) !== '.gitignore')
167
+ return false;
168
+ addFile(filePath);
172
169
  return true;
173
- }
174
- return false;
170
+ })
171
+ .crawl(cwd)
172
+ .withPromise();
175
173
  };
176
- const deepFilter = (entry) => (!isRelevantDir || isRelevantDir(toPosix(entry.path))) && !getMatcher()(relative(cwd, entry.path));
177
- await walk(cwd, {
178
- concurrency: 16,
179
- entryFilter,
180
- deepFilter,
181
- });
174
+ await timerify(walkGitignores)();
175
+ if (unignores.size > 0) {
176
+ const unignorePaths = new Set();
177
+ for (const u of unignores) {
178
+ let p = u.replace(/^\*\*\//, '');
179
+ while (p && p !== '.' && p !== '/') {
180
+ unignorePaths.add(p);
181
+ const parent = dirname(p);
182
+ if (parent === p)
183
+ break;
184
+ p = parent;
185
+ }
186
+ }
187
+ for (const cacheForDir of cachedGitIgnores.values()) {
188
+ for (const pattern of cacheForDir.ignores) {
189
+ const match = picomatch(pattern);
190
+ for (const p of unignorePaths) {
191
+ if (match(p)) {
192
+ cacheForDir.ignores.delete(pattern);
193
+ break;
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
182
199
  debugLogObject('*', 'Parsed gitignore files', { gitignoreFiles });
183
200
  return { gitignoreFiles, ignores, unignores };
184
201
  };
@@ -196,9 +213,8 @@ export async function glob(_patterns, options) {
196
213
  let prev;
197
214
  while (dir) {
198
215
  const cacheForDir = cachedGitIgnores.get(dir);
199
- if (cacheForDir) {
216
+ if (cacheForDir)
200
217
  _ignore.push(...cacheForDir.ignores);
201
- }
202
218
  dir = dirname((prev = dir));
203
219
  if (prev === dir || dir === '.')
204
220
  break;
@@ -207,8 +223,8 @@ export async function glob(_patterns, options) {
207
223
  if (willCache)
208
224
  cachedGlobIgnores.set(options.dir, compact(_ignore));
209
225
  const ignorePatterns = (cachedIgnores || _ignore).concat(negatedPatterns.map(pattern => pattern.slice(1)));
210
- const { dir, label, ...fgOptions } = { ...options, ignore: ignorePatterns };
211
- const paths = await fg.glob(patterns, fgOptions);
226
+ const { dir, label, ...fgOptions } = { ...options, ignore: ignorePatterns, expandDirectories: false };
227
+ const paths = await tinyGlob(patterns, fgOptions);
212
228
  debugLogObject(relative(options.cwd, dir), label ? `Finding ${label}` : 'Finding paths', () => ({
213
229
  patterns,
214
230
  ...fgOptions,
@@ -224,7 +240,7 @@ export async function getGitIgnoredHandler(options, workspaceDirs) {
224
240
  if (options.gitignore === false)
225
241
  return () => false;
226
242
  const { ignores, unignores } = await _parseFindGitignores(options.cwd, workspaceDirs);
227
- const matcher = picomatch(Array.from(ignores), { ignore: unignores });
243
+ const matcher = picomatch(expandIgnorePatterns(ignores), { ignore: expandIgnorePatterns(unignores) });
228
244
  const cache = new Map();
229
245
  const isGitIgnored = (filePath) => {
230
246
  let result = cache.get(filePath);
@@ -13,7 +13,7 @@ export declare const hasProductionSuffix: (pattern: string) => boolean;
13
13
  export declare const hasNoProductionSuffix: (pattern: string) => boolean;
14
14
  export declare const _glob: ({ cwd, dir, patterns, gitignore, label }: GlobOptions) => Promise<string[]>;
15
15
  export declare const _syncGlob: ({ cwd, patterns }: {
16
- cwd?: string;
16
+ cwd: string;
17
17
  patterns: string | string[];
18
18
  }) => string[];
19
19
  export declare const _dirGlob: ({ cwd, patterns, gitignore }: GlobOptions) => Promise<string[]>;
package/dist/util/glob.js CHANGED
@@ -1,9 +1,9 @@
1
- import fg from 'fast-glob';
2
- import { compact } from "./array.js";
3
- import { computeGlobCacheKey, getCachedGlob, isGlobCacheEnabled, setCachedGlob } from "./glob-cache.js";
4
- import { glob } from "./glob-core.js";
5
- import { timerify } from "./Performance.js";
6
- import { isAbsolute, join, relative } from "./path.js";
1
+ import { globSync } from 'tinyglobby';
2
+ import { compact } from './array.js';
3
+ import { computeGlobCacheKey, getCachedGlob, isGlobCacheEnabled, setCachedGlob } from './glob-cache.js';
4
+ import { glob } from './glob-core.js';
5
+ import { timerify } from './Performance.js';
6
+ import { isAbsolute, join, relative } from './path.js';
7
7
  const prepend = (pattern, relativePath) => isAbsolute(pattern.replace(/^!/, '')) ? pattern : prependDirToPattern(relativePath, pattern);
8
8
  const prependDirToPatterns = (cwd, dir, patterns) => {
9
9
  const relativePath = relative(cwd, dir);
@@ -44,7 +44,14 @@ const defaultGlob = async ({ cwd, dir = cwd, patterns, gitignore = true, label }
44
44
  setCachedGlob(cacheKey, paths, dir);
45
45
  return paths;
46
46
  };
47
- const syncGlob = ({ cwd, patterns }) => fg.sync(patterns, { cwd, followSymbolicLinks: false });
47
+ const syncGlob = ({ cwd, patterns }) => {
48
+ return globSync(patterns, {
49
+ cwd,
50
+ absolute: true,
51
+ followSymbolicLinks: false,
52
+ expandDirectories: false,
53
+ });
54
+ };
48
55
  const dirGlob = async ({ cwd, patterns, gitignore = true }) => glob(patterns, {
49
56
  cwd,
50
57
  dir: cwd,
@@ -1,4 +1,4 @@
1
- import { isAbsolute, toRelative } from "./path.js";
1
+ import { isAbsolute, toRelative } from './path.js';
2
2
  export const fromBinary = (input) => input.specifier;
3
3
  export const toBinary = (specifier, options = {}) => ({
4
4
  type: 'binary',
@@ -1,4 +1,4 @@
1
- import { ISSUE_TYPES } from "../constants.js";
1
+ import { ISSUE_TYPES } from '../constants.js';
2
2
  export const initIssues = () => Object.fromEntries(ISSUE_TYPES.map(issueType => [issueType, {}]));
3
3
  export const initCounters = () => ({
4
4
  ...Object.fromEntries(ISSUE_TYPES.map(issueType => [issueType, 0])),
package/dist/util/jiti.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { createJiti } from 'jiti';
3
- import { join } from "./path.js";
3
+ import { join } from './path.js';
4
4
  const empty = join(fileURLToPath(import.meta.url), '../empty.js');
5
5
  const options = {
6
6
  alias: {
@@ -1,6 +1,6 @@
1
- import { debugLogObject } from "./debug.js";
2
- import { ConfigurationError } from "./errors.js";
3
- import { _load } from "./loader.js";
1
+ import { debugLogObject } from './debug.js';
2
+ import { ConfigurationError } from './errors.js';
3
+ import { _load } from './loader.js';
4
4
  const unwrapFunction = async (maybeFunction, options) => {
5
5
  if (typeof maybeFunction === 'function') {
6
6
  try {