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
@@ -1,9 +1,7 @@
1
- import { readFileSync } from 'node:fs';
2
1
  import { parseTsconfig } from 'get-tsconfig';
3
- import stripJsonComments from 'strip-json-comments';
4
- import { isFile as _isFile } from "./fs.js";
5
- import { _syncGlob } from "./glob.js";
6
- import { dirname, isAbsolute, join, toAbsolute } from "./path.js";
2
+ import { isFile } from './fs.js';
3
+ import { _syncGlob } from './glob.js';
4
+ import { dirname, isAbsolute, join, toAbsolute } from './path.js';
7
5
  const hasGlobChar = (p) => p.includes('*') || p.includes('?');
8
6
  const hasExtension = (p) => {
9
7
  const last = p.lastIndexOf('/');
@@ -47,56 +45,70 @@ const expandFileNames = (dir, compilerOptions, include, exclude, files) => {
47
45
  }
48
46
  return result;
49
47
  };
50
- const findRootDirsBase = (tsConfigFilePath) => {
51
- try {
52
- const raw = JSON.parse(stripJsonComments(readFileSync(tsConfigFilePath, 'utf8')));
53
- if (raw.compilerOptions?.rootDirs)
54
- return dirname(tsConfigFilePath);
55
- if (raw.extends) {
56
- const extPath = join(dirname(tsConfigFilePath), raw.extends);
57
- return findRootDirsBase(extPath);
58
- }
59
- }
60
- catch { }
61
- return undefined;
48
+ const resolveReference = (refPath, dir) => {
49
+ const abs = isAbsolute(refPath) ? refPath : join(dir, refPath);
50
+ if (isFile(abs))
51
+ return abs;
52
+ const withTsconfig = join(abs, 'tsconfig.json');
53
+ return isFile(withTsconfig) ? withTsconfig : undefined;
62
54
  };
63
- const resolveConfig = (tsConfigFilePath) => {
64
- try {
65
- return parseTsconfig(tsConfigFilePath);
66
- }
67
- catch {
68
- try {
69
- const raw = readFileSync(tsConfigFilePath, 'utf8');
70
- return JSON.parse(stripJsonComments(raw));
71
- }
72
- catch {
73
- return undefined;
74
- }
55
+ const fillFromReferences = (target, references, dir, visited) => {
56
+ if (!references?.length)
57
+ return;
58
+ for (const ref of references) {
59
+ if (target.outDir && target.rootDir)
60
+ return;
61
+ const refPath = resolveReference(ref.path, dir);
62
+ if (!refPath || visited.has(refPath))
63
+ continue;
64
+ visited.add(refPath);
65
+ const refConfig = parseTsconfig(refPath);
66
+ const refDir = dirname(refPath);
67
+ const refOpts = refConfig.compilerOptions;
68
+ if (refOpts?.outDir && !target.outDir)
69
+ target.outDir = toAbsolute(refOpts.outDir, refDir).replace(/\/+$/, '');
70
+ if (refOpts?.rootDir && !target.rootDir)
71
+ target.rootDir = toAbsolute(refOpts.rootDir, refDir).replace(/\/+$/, '');
72
+ if (!refOpts?.outDir || !refOpts?.rootDir)
73
+ fillFromReferences(target, refConfig.references, refDir, visited);
75
74
  }
76
75
  };
77
76
  export const loadTSConfig = async (tsConfigFilePath) => {
78
- if (_isFile(tsConfigFilePath)) {
79
- const config = resolveConfig(tsConfigFilePath);
80
- if (!config)
81
- return { isFile: true, compilerOptions: {}, fileNames: [] };
82
- const dir = dirname(tsConfigFilePath);
83
- const compilerOptions = (config.compilerOptions ?? {});
84
- if (compilerOptions.outDir)
85
- compilerOptions.outDir = toAbsolute(compilerOptions.outDir, dir).replace(/\/+$/, '');
86
- if (compilerOptions.rootDir)
87
- compilerOptions.rootDir = toAbsolute(compilerOptions.rootDir, dir).replace(/\/+$/, '');
88
- if (compilerOptions.paths) {
89
- compilerOptions.pathsBasePath ??= dir;
77
+ if (isFile(tsConfigFilePath)) {
78
+ try {
79
+ const config = parseTsconfig(tsConfigFilePath);
80
+ const dir = dirname(tsConfigFilePath);
81
+ const compilerOptions = (config.compilerOptions ?? {});
82
+ if (compilerOptions.outDir)
83
+ compilerOptions.outDir = toAbsolute(compilerOptions.outDir, dir).replace(/\/+$/, '');
84
+ if (compilerOptions.rootDir)
85
+ compilerOptions.rootDir = toAbsolute(compilerOptions.rootDir, dir).replace(/\/+$/, '');
86
+ if (compilerOptions.paths) {
87
+ compilerOptions.pathsBasePath ??= dir;
88
+ }
89
+ if (compilerOptions.rootDirs) {
90
+ compilerOptions.rootDirs = compilerOptions.rootDirs.map((d) => (isAbsolute(d) ? d : join(dir, d)));
91
+ }
92
+ if ((!compilerOptions.outDir || !compilerOptions.rootDir) && config.references?.length) {
93
+ fillFromReferences(compilerOptions, config.references, dir, new Set([tsConfigFilePath]));
94
+ }
95
+ const include = resolvePatterns(config.include, dir, true);
96
+ const exclude = resolvePatterns(config.exclude, dir, true);
97
+ const files = resolvePatterns(config.files, dir);
98
+ const fileNames = expandFileNames(dir, compilerOptions, include, exclude, files);
99
+ return { isFile: true, compilerOptions, fileNames };
90
100
  }
91
- if (compilerOptions.rootDirs) {
92
- const rootDirsBase = findRootDirsBase(tsConfigFilePath) ?? dir;
93
- compilerOptions.rootDirs = compilerOptions.rootDirs.map((d) => isAbsolute(d) ? d : join(rootDirsBase, d));
101
+ catch {
102
+ return {
103
+ isFile: true,
104
+ compilerOptions: {},
105
+ fileNames: [],
106
+ };
94
107
  }
95
- const include = resolvePatterns(config.include, dir, true);
96
- const exclude = resolvePatterns(config.exclude, dir, true);
97
- const files = resolvePatterns(config.files, dir);
98
- const fileNames = expandFileNames(dir, compilerOptions, include, exclude, files);
99
- return { isFile: true, compilerOptions, fileNames };
100
108
  }
101
- return { isFile: false, compilerOptions: {}, fileNames: [] };
109
+ return {
110
+ isFile: false,
111
+ compilerOptions: {},
112
+ fileNames: [],
113
+ };
102
114
  };
@@ -6,11 +6,11 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
6
6
  }
7
7
  return path;
8
8
  };
9
- import { LoaderError } from "./errors.js";
10
- import { loadFile, loadJSON, loadJSONC, loadTOML, loadYAML, parseJSONC, parseYAML } from "./fs.js";
11
- import { jiti } from "./jiti.js";
12
- import { timerify } from "./Performance.js";
13
- import { extname, isInternal } from "./path.js";
9
+ import { LoaderError } from './errors.js';
10
+ import { loadFile, loadJSON, loadJSONC, loadTOML, loadYAML, parseJSONC, parseYAML } from './fs.js';
11
+ import { jiti } from './jiti.js';
12
+ import { timerify } from './Performance.js';
13
+ import { extname, isInternal } from './path.js';
14
14
  const load = async (filePath) => {
15
15
  try {
16
16
  const ext = extname(filePath);
package/dist/util/log.js CHANGED
@@ -1,7 +1,7 @@
1
- import picocolors from 'picocolors';
1
+ import st from './colors.js';
2
2
  export const logWarning = (prefix, message) => {
3
- console.warn(`${picocolors.yellow(prefix)}: ${message}`);
3
+ console.warn(`${st.yellow(prefix)}: ${message}`);
4
4
  };
5
5
  export const logError = (prefix, message) => {
6
- console.error(`${picocolors.red(prefix)}: ${message}`);
6
+ console.error(`${st.red(prefix)}: ${message}`);
7
7
  };
@@ -1,9 +1,9 @@
1
1
  import { readFile } from 'node:fs/promises';
2
- import fg from 'fast-glob';
3
- import { partition } from "./array.js";
4
- import { ConfigurationError } from "./errors.js";
5
- import { getPackageName } from "./package-name.js";
6
- import { join } from "./path.js";
2
+ import { glob } from 'tinyglobby';
3
+ import { partition } from './array.js';
4
+ import { ConfigurationError } from './errors.js';
5
+ import { getPackageName } from './package-name.js';
6
+ import { join } from './path.js';
7
7
  export default async function mapWorkspaces(cwd, workspaces) {
8
8
  const [negatedPatterns, patterns] = partition(workspaces, p => p.match(/^!/));
9
9
  const packages = new Map();
@@ -11,7 +11,7 @@ export default async function mapWorkspaces(cwd, workspaces) {
11
11
  if (patterns.length === 0 && negatedPatterns.length === 0)
12
12
  return [packages, wsPkgNames];
13
13
  const manifestPatterns = patterns.map(p => join(p, 'package.json'));
14
- const matches = await fg.glob(manifestPatterns, {
14
+ const matches = await glob(manifestPatterns, {
15
15
  cwd,
16
16
  ignore: ['**/node_modules/**', ...negatedPatterns.map(p => p.slice(1))],
17
17
  });
@@ -1,5 +1,5 @@
1
- import { DT_SCOPE, PROTOCOL_VIRTUAL } from "../constants.js";
2
- import { isAbsolute, isInNodeModules, toPosix } from "./path.js";
1
+ import { DT_SCOPE, PROTOCOL_VIRTUAL } from '../constants.js';
2
+ import { isAbsolute, isInNodeModules, toPosix } from './path.js';
3
3
  export const getPackageNameFromModuleSpecifier = (specifier) => {
4
4
  if (!isStartsLikePackageName(specifier))
5
5
  return;
@@ -8,5 +8,10 @@ interface ExtendedPackageJson extends PackageJson {
8
8
  export declare const load: (filePath: string) => Promise<ExtendedPackageJson>;
9
9
  export declare const save: (filePath: string, content: ExtendedPackageJson) => Promise<void>;
10
10
  export declare const getEntrySpecifiersFromManifest: (manifest: PackageJson) => Set<string>;
11
+ export type Manifest = PackageJson & {
12
+ scriptNames: Set<string>;
13
+ getMajor: (name: string) => number | undefined;
14
+ };
15
+ export declare const createManifest: (raw: PackageJson) => Manifest;
11
16
  export declare const getManifestImportDependencies: (manifest: PackageJson) => Set<string>;
12
17
  export {};
@@ -87,6 +87,15 @@ export const getEntrySpecifiersFromManifest = (manifest) => {
87
87
  }
88
88
  return entryPaths;
89
89
  };
90
+ export const createManifest = (raw) => Object.assign(raw, {
91
+ ...raw,
92
+ scriptNames: new Set(Object.keys(raw.scripts ?? {})),
93
+ getMajor(name) {
94
+ const range = raw.dependencies?.[name] ?? raw.devDependencies?.[name];
95
+ const match = range?.match(/\d+/)?.[0];
96
+ return match ? Number.parseInt(match, 10) : undefined;
97
+ },
98
+ });
90
99
  export const getManifestImportDependencies = (manifest) => {
91
100
  const dependencies = new Set();
92
101
  if (!manifest.imports)
@@ -1,4 +1,4 @@
1
- import { basename, dirname } from "./path.js";
1
+ import { basename, dirname } from './path.js';
2
2
  const getPkgName = (parent, base) => (parent.charAt(0) === '@' ? `${parent}/${base}` : base);
3
3
  const getName = (dir) => (dir ? getPkgName(basename(dirname(dir)), basename(dir)) : undefined);
4
4
  export function getPackageName(pkg, pathname) {
@@ -1,8 +1,10 @@
1
+ export declare const toExtendedIgnorePattern: (pattern: string) => string;
2
+ export declare const expandIgnorePatterns: (patterns: Iterable<string>) => string[];
1
3
  export declare const convertGitignoreToPicomatchIgnorePatterns: (pattern: string) => {
2
4
  negated: boolean;
3
- patterns: string[];
5
+ pattern: string;
4
6
  };
5
7
  export declare const parseAndConvertGitignorePatterns: (patterns: string, ancestor?: string) => {
6
8
  negated: boolean;
7
- patterns: string[];
9
+ pattern: string;
8
10
  }[];
@@ -1,23 +1,35 @@
1
+ export const toExtendedIgnorePattern = (pattern) => {
2
+ if (pattern === '*' || pattern === '**')
3
+ return pattern;
4
+ if (pattern.endsWith('/*'))
5
+ return pattern;
6
+ return `${pattern}/**`;
7
+ };
8
+ export const expandIgnorePatterns = (patterns) => {
9
+ const result = [];
10
+ for (const p of patterns) {
11
+ result.push(p);
12
+ const ext = toExtendedIgnorePattern(p);
13
+ if (ext !== p)
14
+ result.push(ext);
15
+ }
16
+ return result;
17
+ };
1
18
  export const convertGitignoreToPicomatchIgnorePatterns = (pattern) => {
2
19
  const negated = pattern[0] === '!';
3
20
  if (negated)
4
21
  pattern = pattern.slice(1);
5
- let extPattern;
6
22
  if (pattern.endsWith('/'))
7
23
  pattern = pattern.slice(0, -1);
8
24
  if (pattern.startsWith('*/**/'))
9
25
  pattern = pattern.slice(5);
10
26
  if (pattern === '*' || pattern === '**')
11
- return { negated, patterns: [pattern, pattern] };
27
+ return { negated, pattern };
12
28
  if (pattern.startsWith('/'))
13
29
  pattern = pattern.slice(1);
14
30
  else if (!pattern.startsWith('**/'))
15
31
  pattern = `**/${pattern}`;
16
- if (pattern.endsWith('/*'))
17
- extPattern = pattern;
18
- else
19
- extPattern = `${pattern}/**`;
20
- return { negated, patterns: [pattern, extPattern] };
32
+ return { negated, pattern };
21
33
  };
22
34
  export const parseAndConvertGitignorePatterns = (patterns, ancestor) => {
23
35
  const matchFrom = ancestor ? new RegExp(`^(!?/?)(${ancestor})`) : undefined;
@@ -1,8 +1,8 @@
1
- export { _load as load } from "./loader.js";
2
- import { arrayify } from "./array.js";
3
- import { _load as load } from "./loader.js";
4
- import { get } from "./object.js";
5
- import { basename } from "./path.js";
1
+ export { _load as load } from './loader.js';
2
+ import { arrayify } from './array.js';
3
+ import { _load as load } from './loader.js';
4
+ import { get } from './object.js';
5
+ import { basename } from './path.js';
6
6
  export const hasDependency = (dependencies, values) => values.some(value => {
7
7
  if (typeof value === 'string') {
8
8
  return dependencies.has(value);
@@ -1,4 +1,4 @@
1
- import { FIX_FLAGS } from "../constants.js";
1
+ import { FIX_FLAGS } from '../constants.js';
2
2
  const getOpeningBracketIndex = (text) => {
3
3
  let bracketOpenIndex = -1;
4
4
  let j = text.length - 1;
@@ -1,6 +1,6 @@
1
- import internalReporters from "../reporters/index.js";
2
- import { _load } from "./loader.js";
3
- import { isAbsolute, isInternal, resolve } from "./path.js";
1
+ import internalReporters from '../reporters/index.js';
2
+ import { _load } from './loader.js';
3
+ import { isAbsolute, isInternal, resolve } from './path.js';
4
4
  export const runPreprocessors = async (processors, data) => {
5
5
  const preprocessors = await Promise.all(processors.map(proc => _load(isInternal(proc) && !isAbsolute(proc) ? resolve(proc) : proc)));
6
6
  return preprocessors.length === 0
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'node:module';
2
- import { timerify } from "./Performance.js";
2
+ import { timerify } from './Performance.js';
3
3
  const require = createRequire(process.cwd());
4
4
  export const _require = timerify(require);
@@ -1,7 +1,7 @@
1
1
  import { ResolverFactory } from 'oxc-resolver';
2
- import { DEFAULT_EXTENSIONS, DTS_EXTENSIONS } from "../constants.js";
3
- import { timerify } from "./Performance.js";
4
- import { toPosix } from "./path.js";
2
+ import { DEFAULT_EXTENSIONS, DTS_EXTENSIONS } from '../constants.js';
3
+ import { timerify } from './Performance.js';
4
+ import { toPosix } from './path.js';
5
5
  const extensionAlias = {
6
6
  '.js': ['.js', '.ts', '.tsx', '.d.ts'],
7
7
  '.jsx': ['.jsx', '.tsx'],
@@ -1,5 +1,5 @@
1
1
  export declare const ELLIPSIS = "\u2026";
2
2
  export declare const truncate: (text: string, width: number) => string;
3
3
  export declare const truncateStart: (text: string, width: number) => string;
4
- export declare const pad: (text: string, width: number, fillString?: string, align?: "left" | "center" | "right") => string;
4
+ export declare const pad: (text: string, width: number, fillString?: string, align?: 'left' | 'center' | 'right') => string;
5
5
  export declare const prettyMilliseconds: (ms: number) => string;
@@ -1,5 +1,5 @@
1
1
  import { stripVTControlCharacters } from 'node:util';
2
- import { pad, truncate, truncateStart } from "./string.js";
2
+ import { pad, truncate, truncateStart } from './string.js';
3
3
  const DEFAULT_MAX_WIDTH = process.stdout.columns || 120;
4
4
  const MIN_TRUNCATED_WIDTH = 4;
5
5
  const COLUMN_SEPARATOR = ' ';
package/dist/util/tag.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ALIAS_TAG, BETA_TAG, INTERNAL_TAG, PUBLIC_TAG } from "../constants.js";
1
+ import { ALIAS_TAG, BETA_TAG, INTERNAL_TAG, PUBLIC_TAG } from '../constants.js';
2
2
  export const splitTags = (rawTags) => {
3
3
  const tags = rawTags.flatMap(tag => tag.split(','));
4
4
  return tags.reduce(([incl, excl], tag) => {
@@ -1,6 +1,8 @@
1
+ import type { SourceMap } from '../types/config.ts';
1
2
  import type { CompilerOptions } from '../types/project.ts';
2
3
  import type { ConfigurationChief, Workspace } from '../ConfigurationChief.ts';
3
- export declare const augmentWorkspace: (workspace: Workspace, dir: string, compilerOptions: CompilerOptions) => void;
4
+ export declare const augmentWorkspace: (workspace: Workspace, dir: string, compilerOptions: CompilerOptions | undefined, pluginSourceMaps?: SourceMap[]) => void;
4
5
  export declare const getModuleSourcePathHandler: (chief: ConfigurationChief) => (filePath: string) => string | undefined;
5
- export declare const getToSourcePathsHandler: (chief: ConfigurationChief) => (specifiers: Set<string>, dir: string, extensions: string | undefined, label: string) => Promise<string[]>;
6
+ export declare const getToSourcePathsHandler: (chief: ConfigurationChief) => (specifiers: Set<string>, dir: string, extensions: (string | undefined) | undefined, label: string) => Promise<string[]>;
7
+ export declare const toSourceMappedSpecifiers: (ws: Workspace | undefined, absSpecifier: string, extensions?: string) => string[];
6
8
  export type ToSourceFilePath = ReturnType<typeof getModuleSourcePathHandler>;
@@ -1,17 +1,32 @@
1
- import { DEFAULT_EXTENSIONS } from "../constants.js";
2
- import { debugLog, debugLogArray } from "./debug.js";
3
- import { findFileWithExtensions, isDirectory } from "./fs.js";
4
- import { _glob, prependDirToPattern } from "./glob.js";
5
- import { isAbsolute, isInternal, join, toRelative } from "./path.js";
1
+ import { DEFAULT_EXTENSIONS } from '../constants.js';
2
+ import { debugLog, debugLogArray } from './debug.js';
3
+ import { findFileWithExtensions, isDirectory } from './fs.js';
4
+ import { _glob, prependDirToPattern } from './glob.js';
5
+ import { isAbsolute, isInternal, join, toRelative } from './path.js';
6
6
  const defaultExtensions = `.{${[...DEFAULT_EXTENSIONS].map(ext => ext.slice(1)).join(',')}}`;
7
7
  const hasTSExt = /(?<!\.d)\.(m|c)?tsx?$/;
8
8
  const matchExt = /(\.d)?\.(m|c)?(j|t)s$/;
9
9
  const sourceExtensions = [...DEFAULT_EXTENSIONS];
10
- export const augmentWorkspace = (workspace, dir, compilerOptions) => {
10
+ const tsconfigSourceMap = (dir, compilerOptions) => {
11
11
  const srcDir = join(dir, 'src');
12
12
  const outDirHasSrc = compilerOptions.outDir && isDirectory(compilerOptions.outDir, 'src');
13
- workspace.srcDir = compilerOptions.rootDir ?? (outDirHasSrc ? dir : isDirectory(srcDir) ? srcDir : dir);
14
- workspace.outDir = compilerOptions.outDir || workspace.srcDir;
13
+ const resolvedSrc = compilerOptions.rootDir ?? (outDirHasSrc ? dir : isDirectory(srcDir) ? srcDir : dir);
14
+ return { srcDir: resolvedSrc, outDir: compilerOptions.outDir || resolvedSrc };
15
+ };
16
+ export const augmentWorkspace = (workspace, dir, compilerOptions, pluginSourceMaps = []) => {
17
+ const all = compilerOptions ? [...pluginSourceMaps, tsconfigSourceMap(dir, compilerOptions)] : pluginSourceMaps;
18
+ if (all.length === 0)
19
+ return;
20
+ workspace.sourceMaps = all.sort((a, b) => b.outDir.length - a.outDir.length);
21
+ };
22
+ const isUnderOutDir = (absPath, outDir) => absPath === outDir || absPath.startsWith(`${outDir}/`);
23
+ const isUnderSrcDir = (absPath, srcDir) => absPath === srcDir || absPath.startsWith(`${srcDir}/`);
24
+ const rewritePattern = (sourceMaps, absSpecifier, extensions) => {
25
+ for (const { srcDir, outDir } of sourceMaps) {
26
+ if (!isUnderSrcDir(absSpecifier, srcDir) && isUnderOutDir(absSpecifier, outDir)) {
27
+ return srcDir + absSpecifier.slice(outDir.length).replace(matchExt, extensions);
28
+ }
29
+ }
15
30
  };
16
31
  export const getModuleSourcePathHandler = (chief) => {
17
32
  const toSourceMapCache = new Map();
@@ -21,13 +36,16 @@ export const getModuleSourcePathHandler = (chief) => {
21
36
  if (toSourceMapCache.has(filePath))
22
37
  return toSourceMapCache.get(filePath);
23
38
  const workspace = chief.findWorkspaceByFilePath(filePath);
24
- if (workspace?.srcDir && workspace.outDir) {
25
- if (filePath.startsWith(workspace.outDir) || workspace.srcDir === workspace.outDir) {
26
- const basePath = filePath.replace(workspace.outDir, workspace.srcDir).replace(matchExt, '');
27
- const srcFilePath = findFileWithExtensions(basePath, sourceExtensions);
28
- if (srcFilePath)
29
- toSourceMapCache.set(filePath, srcFilePath);
30
- if (srcFilePath && srcFilePath !== filePath) {
39
+ if (!workspace?.sourceMaps)
40
+ return;
41
+ for (const { srcDir, outDir } of workspace.sourceMaps) {
42
+ if (!(isUnderOutDir(filePath, outDir) || srcDir === outDir))
43
+ continue;
44
+ const basePath = (srcDir + filePath.slice(outDir.length)).replace(matchExt, '');
45
+ const srcFilePath = findFileWithExtensions(basePath, sourceExtensions);
46
+ if (srcFilePath) {
47
+ toSourceMapCache.set(filePath, srcFilePath);
48
+ if (srcFilePath !== filePath) {
31
49
  debugLog('*', `Source mapping ${toRelative(filePath, chief.cwd)} → ${toRelative(srcFilePath, chief.cwd)}`);
32
50
  return srcFilePath;
33
51
  }
@@ -41,16 +59,22 @@ export const getToSourcePathsHandler = (chief) => {
41
59
  for (const specifier of specifiers) {
42
60
  const absSpecifier = isAbsolute(specifier) ? specifier : prependDirToPattern(dir, specifier);
43
61
  const ws = chief.findWorkspaceByFilePath(absSpecifier);
44
- if (ws?.srcDir && ws.outDir && !absSpecifier.startsWith(ws.srcDir) && absSpecifier.startsWith(ws.outDir)) {
45
- const pattern = absSpecifier.replace(ws.outDir, ws.srcDir).replace(matchExt, extensions);
46
- patterns.add(pattern);
47
- }
48
- else {
49
- patterns.add(absSpecifier);
50
- }
62
+ const mapped = ws?.sourceMaps && rewritePattern(ws.sourceMaps, absSpecifier, extensions);
63
+ patterns.add(mapped ?? absSpecifier);
51
64
  }
52
65
  const filePaths = await _glob({ patterns: Array.from(patterns), cwd: dir, label });
53
66
  debugLogArray(toRelative(dir, chief.cwd), 'Source mapping (package.json)', filePaths);
54
67
  return filePaths;
55
68
  };
56
69
  };
70
+ export const toSourceMappedSpecifiers = (ws, absSpecifier, extensions = defaultExtensions) => {
71
+ const out = [];
72
+ if (!ws?.sourceMaps)
73
+ return out;
74
+ for (const { srcDir, outDir } of ws.sourceMaps) {
75
+ if (!isUnderSrcDir(absSpecifier, srcDir) && isUnderOutDir(absSpecifier, outDir)) {
76
+ out.push(srcDir + absSpecifier.slice(outDir.length).replace(matchExt, extensions));
77
+ }
78
+ }
79
+ return out;
80
+ };
@@ -1,13 +1,13 @@
1
- import pc from 'picocolors';
1
+ import st from './colors.js';
2
2
  export const formatTrace = (node, toRelative, isReferenced, memberStatuses) => {
3
3
  const lines = [];
4
- const file = pc.white;
5
- const id = pc.cyanBright;
6
- const ref = pc.cyanBright;
7
- const via = pc.dim;
8
- const ok = pc.green;
9
- const fail = pc.red;
10
- const dim = pc.dim;
4
+ const file = st.white;
5
+ const id = st.cyanBright;
6
+ const ref = st.cyanBright;
7
+ const via = st.dim;
8
+ const ok = st.green;
9
+ const fail = st.red;
10
+ const dim = st.dim;
11
11
  const entryMarker = node.isEntry ? dim(' ⎆') : '';
12
12
  lines.push(`${file(toRelative(node.filePath))}${dim(':')}${id(node.identifier)}${entryMarker}`);
13
13
  const formatVia = (child) => {
@@ -1,12 +1,12 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { invalidateCache } from "../graph-explorer/cache.js";
3
- import { debugLog } from "./debug.js";
4
- import { isFile } from "./fs.js";
5
- import { updateImportMap } from "./module-graph.js";
6
- import { toAbsolute, toPosix, toRelative } from "./path.js";
7
- import { clearModuleResolutionCaches } from "../typescript/resolve-module-names.js";
8
- import { clearGlobCache } from "./glob-cache.js";
9
- import { clearResolverCache } from "./resolve.js";
2
+ import { invalidateCache } from '../graph-explorer/cache.js';
3
+ import { debugLog } from './debug.js';
4
+ import { isFile } from './fs.js';
5
+ import { updateImportMap } from './module-graph.js';
6
+ import { toAbsolute, toPosix, toRelative } from './path.js';
7
+ import { clearModuleResolutionCaches } from '../typescript/resolve-module-names.js';
8
+ import { clearGlobCache } from './glob-cache.js';
9
+ import { clearResolverCache } from './resolve.js';
10
10
  const createUpdate = (options) => {
11
11
  const duration = performance.now() - options.startTime;
12
12
  const mem = process.memoryUsage().heapUsed;
@@ -1,5 +1,5 @@
1
- import { ROOT_WORKSPACE_NAME } from "../constants.js";
2
- import { join } from "./path.js";
1
+ import { ROOT_WORKSPACE_NAME } from '../constants.js';
2
+ import { join } from './path.js';
3
3
  export const createWorkspaceFilePathFilter = (cwd, selectedWorkspaces, availableWorkspaceNames) => {
4
4
  if (!selectedWorkspaces || !availableWorkspaceNames)
5
5
  return () => true;
@@ -1,8 +1,8 @@
1
1
  import picomatch from 'picomatch';
2
- import { partition } from "./array.js";
3
- import { ConfigurationError } from "./errors.js";
4
- import { isDirectory, isFile } from "./fs.js";
5
- import { join } from "./path.js";
2
+ import { partition } from './array.js';
3
+ import { ConfigurationError } from './errors.js';
4
+ import { isDirectory, isFile } from './fs.js';
5
+ import { join } from './path.js';
6
6
  export function parseWorkspaceSelector(token, cwd) {
7
7
  const trimmed = token.trim();
8
8
  let isNegated = false;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.4.1";
1
+ export declare const version = "6.6.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.4.1';
1
+ export const version = '6.6.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.4.1",
3
+ "version": "6.6.1",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "keywords": [
6
6
  "analysis",
@@ -77,18 +77,17 @@
77
77
  }
78
78
  },
79
79
  "dependencies": {
80
- "@nodelib/fs.walk": "^1.2.3",
81
- "fast-glob": "^3.3.3",
80
+ "fdir": "^6.5.0",
82
81
  "formatly": "^0.3.0",
83
- "get-tsconfig": "4.13.7",
82
+ "get-tsconfig": "4.14.0",
84
83
  "jiti": "^2.6.0",
85
84
  "minimist": "^1.2.8",
86
- "oxc-parser": "^0.121.0",
85
+ "oxc-parser": "^0.126.0",
87
86
  "oxc-resolver": "^11.19.1",
88
- "picocolors": "^1.1.1",
89
- "picomatch": "^4.0.1",
87
+ "picomatch": "^4.0.4",
90
88
  "smol-toml": "^1.6.1",
91
89
  "strip-json-comments": "5.0.3",
90
+ "tinyglobby": "^0.2.16",
92
91
  "unbash": "^2.2.0",
93
92
  "yaml": "^2.8.2",
94
93
  "zod": "^4.1.11"
@@ -99,12 +98,11 @@
99
98
  "@types/minimist": "^1.2.5",
100
99
  "@types/picomatch": "^4.0.1",
101
100
  "@types/webpack": "^5.28.5",
101
+ "@typescript/native-preview": "7.0.0-dev.20260415.1",
102
102
  "@wdio/types": "^9.20.0",
103
103
  "codeclimate-types": "^0.3.1",
104
- "glob-bin": "^1.0.0",
105
104
  "prettier": "^3.8.1",
106
- "tsx": "^4.21.0",
107
- "typescript": "^5.8.3"
105
+ "tsx": "^4.21.0"
108
106
  },
109
107
  "engines": {
110
108
  "node": "^20.19.0 || >=22.12.0"
@@ -114,16 +112,11 @@
114
112
  "knip": "node ./src/cli.ts --directory ../..",
115
113
  "knip:production": "node ./src/cli.ts --directory ../.. --production --strict",
116
114
  "lint": "oxlint",
117
- "format": "oxfmt -c ../../.oxfmtrc.json --ignore-path ../../.prettierignore",
118
- "test": "node scripts/run-test.ts",
119
- "test:node": "tsx --test test/*.test.ts test/**/*.test.ts",
120
- "test:bun": "bun test test/*.test.ts test/**/*.test.ts",
121
- "test:smoke": "glob-bin -c \"tsx --test\" \"test/*.test.ts\" && glob-bin -c \"tsx --test\" \"test/plugins/*.test.ts\" && glob-bin -c \"tsx --test\" \"test/util/*.test.ts\"",
122
- "test:bun:smoke": "bun test test/*.test.ts test/{plugins,util}/*.test.ts",
123
- "watch": "npm link && tsc --watch",
115
+ "fmt": "oxfmt -c ../../.oxfmtrc.json --ignore-path ../../.prettierignore",
116
+ "test": "node scripts/run-test.js",
124
117
  "prebuild": "pnpm run generate-plugin-defs && node rmdir.js dist",
125
- "build": "tsc",
126
- "qa": "pnpm lint && pnpm build && pnpm knip && pnpm knip:production && pnpm run test",
118
+ "build": "tsgo",
119
+ "qa": "pnpm lint && pnpm build && pnpm knip && pnpm knip:production && pnpm test",
127
120
  "release": "NODE_OPTIONS=--no-deprecation release-it",
128
121
  "create-plugin": "node ./scripts/create-new-plugin.ts",
129
122
  "postcreate-plugin": "pnpm run build && (oxfmt schema.json schema-jsonc.json src/schema/plugins.ts || true)",