knip 6.38.0 → 6.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/ConfigurationChief.d.ts +18 -0
  2. package/dist/WorkspaceWorker.d.ts +3 -4
  3. package/dist/WorkspaceWorker.js +12 -38
  4. package/dist/compilers/compilers.js +1 -1
  5. package/dist/constants.js +1 -0
  6. package/dist/graph/analyze.js +14 -5
  7. package/dist/graph/build.js +17 -10
  8. package/dist/graph-explorer/explorer.d.ts +1 -1
  9. package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
  10. package/dist/graph-explorer/operations/is-referenced.js +8 -4
  11. package/dist/plugins/_vue/auto-import.js +17 -10
  12. package/dist/plugins/angular/index.js +1 -1
  13. package/dist/plugins/capacitor/index.js +1 -1
  14. package/dist/plugins/commitlint/index.js +34 -9
  15. package/dist/plugins/cucumber/index.js +36 -4
  16. package/dist/plugins/cucumber/types.d.ts +2 -1
  17. package/dist/plugins/eslint/resolveFromAST.d.ts +0 -1
  18. package/dist/plugins/eslint/resolveFromAST.js +1 -1
  19. package/dist/plugins/index.d.ts +3 -0
  20. package/dist/plugins/index.js +6 -0
  21. package/dist/plugins/jasmine/index.d.ts +3 -0
  22. package/dist/plugins/jasmine/index.js +55 -0
  23. package/dist/plugins/jasmine/types.d.ts +7 -0
  24. package/dist/plugins/jasmine/types.js +1 -0
  25. package/dist/plugins/jest/helpers.d.ts +1 -0
  26. package/dist/plugins/jest/helpers.js +2 -0
  27. package/dist/plugins/jest/index.js +20 -11
  28. package/dist/plugins/osls/index.d.ts +3 -0
  29. package/dist/plugins/osls/index.js +13 -0
  30. package/dist/plugins/oxlint/index.d.ts +3 -0
  31. package/dist/plugins/oxlint/index.js +4 -31
  32. package/dist/plugins/oxlint/types.d.ts +1 -0
  33. package/dist/plugins/playwright/index.js +20 -3
  34. package/dist/plugins/playwright/types.d.ts +5 -0
  35. package/dist/plugins/postcss/index.js +5 -1
  36. package/dist/plugins/railway/index.d.ts +3 -0
  37. package/dist/plugins/railway/index.js +129 -0
  38. package/dist/plugins/rsbuild/index.js +42 -4
  39. package/dist/plugins/rsbuild/types.d.ts +18 -1
  40. package/dist/plugins/rspack/index.d.ts +3 -1
  41. package/dist/plugins/rspack/index.js +1 -1
  42. package/dist/plugins/rstest/index.js +116 -17
  43. package/dist/plugins/rstest/types.d.ts +29 -5
  44. package/dist/plugins/rstest/visitors/mock.d.ts +2 -0
  45. package/dist/plugins/rstest/visitors/mock.js +52 -0
  46. package/dist/plugins/serverless-framework/index.d.ts +4 -1
  47. package/dist/plugins/serverless-framework/index.js +40 -7
  48. package/dist/plugins/serverless-framework/types.d.ts +4 -2
  49. package/dist/plugins/simple-git-hooks/index.js +1 -1
  50. package/dist/plugins/vite/helpers.d.ts +1 -1
  51. package/dist/plugins/vite/helpers.js +7 -8
  52. package/dist/plugins/vitest/index.js +31 -7
  53. package/dist/plugins/vitest/types.d.ts +12 -0
  54. package/dist/schema/configuration.d.ts +45 -0
  55. package/dist/schema/plugins.d.ts +15 -0
  56. package/dist/schema/plugins.js +3 -0
  57. package/dist/types/PluginNames.d.ts +2 -2
  58. package/dist/types/PluginNames.js +3 -0
  59. package/dist/types/package-json.d.ts +5 -0
  60. package/dist/typescript/ast-nodes.js +291 -0
  61. package/dist/typescript/resolve-module-names.js +15 -4
  62. package/dist/typescript/visitors/walk.js +12 -0
  63. package/dist/util/create-options.d.ts +30 -0
  64. package/dist/util/filter-transitive-dependencies.d.ts +2 -0
  65. package/dist/util/filter-transitive-dependencies.js +38 -0
  66. package/dist/util/git.d.ts +1 -0
  67. package/dist/util/git.js +23 -1
  68. package/dist/util/package-json.d.ts +1 -348
  69. package/dist/util/package-json.js +56 -10
  70. package/dist/util/tag.d.ts +1 -0
  71. package/dist/util/tag.js +1 -1
  72. package/dist/util/to-source-path.d.ts +1 -1
  73. package/dist/util/to-source-path.js +7 -5
  74. package/dist/version.d.ts +1 -1
  75. package/dist/version.js +1 -1
  76. package/package.json +1 -1
  77. package/schema.json +12 -0
@@ -241,6 +241,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
241
241
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
242
242
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
243
243
  }, z.core.$strip>]>;
244
+ jasmine: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
245
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
246
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
247
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
248
+ }, z.core.$strip>]>;
244
249
  jest: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
245
250
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
246
251
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -446,6 +451,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
446
451
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
447
452
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
448
453
  }, z.core.$strip>]>;
454
+ osls: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
455
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
456
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
457
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
458
+ }, z.core.$strip>]>;
449
459
  oxfmt: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
450
460
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
451
461
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -541,6 +551,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
541
551
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
542
552
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
543
553
  }, z.core.$strip>]>;
554
+ railway: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
555
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
556
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
557
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
558
+ }, z.core.$strip>]>;
544
559
  raycast: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
545
560
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
546
561
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -57,6 +57,7 @@ export const pluginsSchema = z.object({
57
57
  hardhat: pluginSchema,
58
58
  husky: pluginSchema,
59
59
  'i18next-parser': pluginSchema,
60
+ jasmine: pluginSchema,
60
61
  jest: pluginSchema,
61
62
  karma: pluginSchema,
62
63
  knex: pluginSchema,
@@ -98,6 +99,7 @@ export const pluginsSchema = z.object({
98
99
  'openapi-ts': pluginSchema,
99
100
  openclaw: pluginSchema,
100
101
  orval: pluginSchema,
102
+ osls: pluginSchema,
101
103
  oxfmt: pluginSchema,
102
104
  oxlint: pluginSchema,
103
105
  'panda-css': pluginSchema,
@@ -117,6 +119,7 @@ export const pluginsSchema = z.object({
117
119
  prisma: pluginSchema,
118
120
  quasar: pluginSchema,
119
121
  qwik: pluginSchema,
122
+ railway: pluginSchema,
120
123
  raycast: pluginSchema,
121
124
  'react-cosmos': pluginSchema,
122
125
  'react-email': pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'borp' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'eve' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'marko' | 'mdx' | 'mdxlint' | 'metro' | 'mise' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'quasar' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsup' | 'tsx' | 'turbo' | 'typedoc' | 'typescript' | 'typescript-content-mapper' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
- export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'borp', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'eve', 'execa', 'expo', 'expressive-code', 'fast', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'marko', 'mdx', 'mdxlint', 'metro', 'mise', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'quasar', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsup', 'tsx', 'turbo', 'typedoc', 'typescript', 'typescript-content-mapper', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
1
+ export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'borp' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'eve' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jasmine' | 'jest' | 'karma' | 'knex' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'marko' | 'mdx' | 'mdxlint' | 'metro' | 'mise' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'osls' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'quasar' | 'qwik' | 'railway' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsup' | 'tsx' | 'turbo' | 'typedoc' | 'typescript' | 'typescript-content-mapper' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
+ export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'borp', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'eve', 'execa', 'expo', 'expressive-code', 'fast', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jasmine', 'jest', 'karma', 'knex', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'marko', 'mdx', 'mdxlint', 'metro', 'mise', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'osls', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'quasar', 'qwik', 'railway', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsup', 'tsx', 'turbo', 'typedoc', 'typescript', 'typescript-content-mapper', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
@@ -46,6 +46,7 @@ export const pluginNames = [
46
46
  'hardhat',
47
47
  'husky',
48
48
  'i18next-parser',
49
+ 'jasmine',
49
50
  'jest',
50
51
  'karma',
51
52
  'knex',
@@ -87,6 +88,7 @@ export const pluginNames = [
87
88
  'openapi-ts',
88
89
  'openclaw',
89
90
  'orval',
91
+ 'osls',
90
92
  'oxfmt',
91
93
  'oxlint',
92
94
  'panda-css',
@@ -106,6 +108,7 @@ export const pluginNames = [
106
108
  'prisma',
107
109
  'quasar',
108
110
  'qwik',
111
+ 'railway',
109
112
  'raycast',
110
113
  'react-cosmos',
111
114
  'react-email',
@@ -36,6 +36,11 @@ export type PackageJson = {
36
36
  name?: string;
37
37
  main?: string;
38
38
  bin?: string | Record<string, string>;
39
+ repository?: string | {
40
+ type?: string;
41
+ url?: string;
42
+ directory?: string;
43
+ };
39
44
  version?: string;
40
45
  private?: boolean;
41
46
  workspaces?: string[] | {
@@ -145,8 +145,299 @@ export function extractNamespaceMembers(decl, options, lineStarts, getJSDocTags,
145
145
  addMember(d.id.name, d.id.start, stmt.start, stmt.end);
146
146
  }
147
147
  }
148
+ if (!prefix && members.length > 0)
149
+ markNamespaceMemberRefs(decl.body.body, members);
148
150
  return members;
149
151
  }
152
+ const noNames = new Set();
153
+ const addBindingNames = (pattern, names) => {
154
+ if (!pattern)
155
+ return;
156
+ if (pattern.type === 'Identifier')
157
+ names.add(pattern.name);
158
+ else if (pattern.type === 'ObjectPattern')
159
+ for (const p of pattern.properties)
160
+ addBindingNames(p.value ?? p.argument, names);
161
+ else if (pattern.type === 'ArrayPattern')
162
+ for (const el of pattern.elements)
163
+ addBindingNames(el, names);
164
+ else if (pattern.type === 'AssignmentPattern')
165
+ addBindingNames(pattern.left, names);
166
+ else if (pattern.type === 'RestElement')
167
+ addBindingNames(pattern.argument, names);
168
+ };
169
+ const addDeclaredNames = (statements, names) => {
170
+ for (const stmt of statements) {
171
+ if (stmt.type === 'VariableDeclaration')
172
+ for (const d of stmt.declarations)
173
+ addBindingNames(d.id, names);
174
+ else if (stmt.type !== 'ExpressionStatement' && stmt.id?.type === 'Identifier')
175
+ names.add(stmt.id.name);
176
+ }
177
+ };
178
+ const addVarNames = (node, names) => {
179
+ if (!node)
180
+ return;
181
+ switch (node.type) {
182
+ case 'VariableDeclaration':
183
+ if (node.kind === 'var')
184
+ for (const d of node.declarations)
185
+ addBindingNames(d.id, names);
186
+ return;
187
+ case 'BlockStatement':
188
+ for (const stmt of node.body)
189
+ addVarNames(stmt, names);
190
+ return;
191
+ case 'IfStatement':
192
+ addVarNames(node.consequent, names);
193
+ addVarNames(node.alternate, names);
194
+ return;
195
+ case 'ForStatement':
196
+ addVarNames(node.init, names);
197
+ addVarNames(node.body, names);
198
+ return;
199
+ case 'ForInStatement':
200
+ case 'ForOfStatement':
201
+ addVarNames(node.left, names);
202
+ addVarNames(node.body, names);
203
+ return;
204
+ case 'WhileStatement':
205
+ case 'DoWhileStatement':
206
+ case 'LabeledStatement':
207
+ addVarNames(node.body, names);
208
+ return;
209
+ case 'TryStatement':
210
+ addVarNames(node.block, names);
211
+ addVarNames(node.handler?.body, names);
212
+ addVarNames(node.finalizer, names);
213
+ return;
214
+ case 'SwitchStatement':
215
+ for (const c of node.cases)
216
+ for (const stmt of c.consequent)
217
+ addVarNames(stmt, names);
218
+ return;
219
+ }
220
+ };
221
+ const getShadowedNames = (node) => {
222
+ switch (node.type) {
223
+ case 'BlockStatement':
224
+ case 'StaticBlock': {
225
+ const names = new Set();
226
+ addDeclaredNames(node.body, names);
227
+ return names;
228
+ }
229
+ case 'SwitchStatement': {
230
+ const names = new Set();
231
+ for (const c of node.cases)
232
+ addDeclaredNames(c.consequent, names);
233
+ return names;
234
+ }
235
+ case 'ForStatement':
236
+ case 'ForInStatement':
237
+ case 'ForOfStatement': {
238
+ const init = node.init ?? node.left;
239
+ if (init?.type !== 'VariableDeclaration')
240
+ return;
241
+ const names = new Set();
242
+ addDeclaredNames([init], names);
243
+ return names;
244
+ }
245
+ case 'CatchClause': {
246
+ const names = new Set();
247
+ addBindingNames(node.param, names);
248
+ return names;
249
+ }
250
+ case 'ClassExpression':
251
+ return node.id?.type === 'Identifier' ? new Set([node.id.name]) : undefined;
252
+ }
253
+ const params = node.params;
254
+ if (!params || node.type === 'TSTypeParameterDeclaration')
255
+ return;
256
+ const names = new Set();
257
+ for (const param of Array.isArray(params) ? params : (params.items ?? [])) {
258
+ addBindingNames(param.type === 'TSParameterProperty' ? param.parameter : param, names);
259
+ }
260
+ if (node.type === 'FunctionExpression' && node.id?.type === 'Identifier')
261
+ names.add(node.id.name);
262
+ if (node.body?.type === 'BlockStatement')
263
+ addVarNames(node.body, names);
264
+ return names;
265
+ };
266
+ const markNamespaceMemberRefs = (body, members) => {
267
+ const byIdentifier = new Map();
268
+ for (const member of members)
269
+ byIdentifier.set(member.identifier, member);
270
+ const scopes = [];
271
+ const addRef = (name, path) => {
272
+ for (let i = scopes.length - 1; i >= 0; i--) {
273
+ const scope = scopes[i];
274
+ if (!scope.names.has(name))
275
+ continue;
276
+ if (scope.isShadow)
277
+ return;
278
+ let id = scope.prefix ? `${scope.prefix}.${name}` : name;
279
+ for (let j = 0; j <= path.length; j++) {
280
+ if (!scope.own.has(id)) {
281
+ const member = byIdentifier.get(id);
282
+ if (member)
283
+ member.hasRefsInFile = true;
284
+ }
285
+ if (j < path.length)
286
+ id = `${id}.${path[j]}`;
287
+ }
288
+ return;
289
+ }
290
+ };
291
+ const visitBinding = (node) => {
292
+ if (!node)
293
+ return;
294
+ switch (node.type) {
295
+ case 'Identifier':
296
+ visit(node.typeAnnotation);
297
+ return;
298
+ case 'ObjectPattern':
299
+ for (const p of node.properties) {
300
+ if (p.type === 'RestElement')
301
+ visitBinding(p);
302
+ else {
303
+ if (p.computed)
304
+ visit(p.key);
305
+ visitBinding(p.value);
306
+ }
307
+ }
308
+ visit(node.typeAnnotation);
309
+ return;
310
+ case 'ArrayPattern':
311
+ for (const el of node.elements)
312
+ visitBinding(el);
313
+ visit(node.typeAnnotation);
314
+ return;
315
+ case 'AssignmentPattern':
316
+ visitBinding(node.left);
317
+ visit(node.right);
318
+ return;
319
+ case 'RestElement':
320
+ visitBinding(node.argument);
321
+ visit(node.typeAnnotation);
322
+ return;
323
+ case 'TSParameterProperty':
324
+ visit(node.decorators);
325
+ visitBinding(node.parameter);
326
+ return;
327
+ }
328
+ visit(node);
329
+ };
330
+ const visit = (node) => {
331
+ if (!node)
332
+ return;
333
+ if (Array.isArray(node)) {
334
+ for (const item of node)
335
+ visit(item);
336
+ return;
337
+ }
338
+ const type = node.type;
339
+ if (!type)
340
+ return;
341
+ if (type === 'Identifier') {
342
+ addRef(node.name, []);
343
+ visit(node.typeAnnotation);
344
+ return;
345
+ }
346
+ if (type === 'JSXIdentifier') {
347
+ addRef(node.name, []);
348
+ return;
349
+ }
350
+ if (type === 'JSXMemberExpression') {
351
+ visit(node.object);
352
+ return;
353
+ }
354
+ if (type === 'JSXAttribute') {
355
+ visit(node.value);
356
+ return;
357
+ }
358
+ if (type === 'TSModuleDeclaration' && node.body?.type === 'TSModuleBlock') {
359
+ visitNamespace(node.body.body, node.id.type === 'Identifier' ? node.id.name : undefined);
360
+ return;
361
+ }
362
+ if (type === 'MemberExpression' || type === 'TSQualifiedName') {
363
+ const path = [];
364
+ let object = node;
365
+ while ((object.type === 'MemberExpression' && !object.computed && object.property.type === 'Identifier') ||
366
+ (object.type === 'TSQualifiedName' && object.right.type === 'Identifier')) {
367
+ path.unshift(object.type === 'MemberExpression' ? object.property.name : object.right.name);
368
+ object = object.type === 'MemberExpression' ? object.object : object.left;
369
+ }
370
+ if (path.length > 0) {
371
+ if (object.type === 'Identifier')
372
+ addRef(object.name, path);
373
+ else
374
+ visit(object);
375
+ return;
376
+ }
377
+ }
378
+ const keys = visitorKeys[type];
379
+ if (!keys)
380
+ return;
381
+ const shadowed = getShadowedNames(node);
382
+ const shadow = shadowed && shadowed.size > 0 ? { prefix: '', names: shadowed, own: noNames, isShadow: true } : undefined;
383
+ if (shadow)
384
+ scopes.push(shadow);
385
+ for (const key of keys) {
386
+ const val = node[key];
387
+ if (!val || key === 'label')
388
+ continue;
389
+ if (key === 'key' && !node.computed)
390
+ continue;
391
+ if (key === 'id' || (key === 'name' && type === 'TSTypeParameter') || key.startsWith('param')) {
392
+ if (Array.isArray(val))
393
+ for (const item of val)
394
+ visitBinding(item);
395
+ else
396
+ visitBinding(val);
397
+ }
398
+ else
399
+ visit(val);
400
+ }
401
+ if (shadow)
402
+ scopes.pop();
403
+ };
404
+ const visitNamespace = (statements, name) => {
405
+ const parent = scopes.at(-1);
406
+ const prefix = !parent ? '' : parent.prefix ? `${parent.prefix}.${name}` : (name ?? '');
407
+ const scope = { prefix, names: new Set(), own: new Set() };
408
+ for (const stmt of statements) {
409
+ const d = stmt.type === 'ExportNamedDeclaration' ? stmt.declaration : stmt;
410
+ if (d?.type === 'VariableDeclaration')
411
+ for (const v of d.declarations)
412
+ addBindingNames(v.id, scope.names);
413
+ else if (d?.id?.type === 'Identifier')
414
+ scope.names.add(d.id.name);
415
+ }
416
+ scopes.push(scope);
417
+ for (const stmt of statements) {
418
+ const d = stmt.type === 'ExportNamedDeclaration' && stmt.declaration ? stmt.declaration : stmt;
419
+ if (d.type === 'VariableDeclaration') {
420
+ for (const declarator of d.declarations) {
421
+ const names = new Set();
422
+ addBindingNames(declarator.id, names);
423
+ scope.own = new Set();
424
+ for (const n of names)
425
+ scope.own.add(prefix ? `${prefix}.${n}` : n);
426
+ visitBinding(declarator.id);
427
+ visit(declarator.init);
428
+ }
429
+ }
430
+ else {
431
+ scope.own = new Set();
432
+ if (d.id?.type === 'Identifier')
433
+ scope.own.add(prefix ? `${prefix}.${d.id.name}` : d.id.name);
434
+ visit(d);
435
+ }
436
+ }
437
+ scopes.pop();
438
+ };
439
+ visitNamespace(body);
440
+ };
150
441
  export const collectAugmentationRefs = (node) => {
151
442
  if (!node.body || node.body.type !== 'TSModuleBlock')
152
443
  return [];
@@ -9,10 +9,20 @@ import { _createSyncModuleResolver, _resolveModuleSync, resolvePackageManifestPa
9
9
  function pickStringTarget(value) {
10
10
  if (typeof value === 'string')
11
11
  return value;
12
- if (!value || typeof value !== 'object' || Array.isArray(value))
12
+ if (!value || typeof value !== 'object')
13
13
  return;
14
+ if (Array.isArray(value)) {
15
+ for (const item of value) {
16
+ const target = pickStringTarget(item);
17
+ if (target)
18
+ return target;
19
+ }
20
+ return;
21
+ }
14
22
  const obj = value;
15
- for (const key of ['default', 'node', 'import', 'require']) {
23
+ for (const key of Object.keys(obj)) {
24
+ if (key !== 'default' && key !== 'node' && key !== 'import' && key !== 'require')
25
+ continue;
16
26
  const v = pickStringTarget(obj[key]);
17
27
  if (v)
18
28
  return v;
@@ -147,12 +157,13 @@ export function createCustomModuleResolver(compilerOptions, customCompilerExtens
147
157
  const moduleExtensions = new Set([...DEFAULT_EXTENSIONS, ...customCompilerExtensions, '.json', '.jsonc']);
148
158
  const hasCustomExts = customCompilerExtensionsSet.size > 0;
149
159
  const extensions = [...DEFAULT_EXTENSIONS, ...customCompilerExtensions, ...DTS_EXTENSIONS, '.json', '.jsonc'];
160
+ const sourceExtensions = [...DEFAULT_EXTENSIONS, ...customCompilerExtensions];
150
161
  const resolveSync = hasCustomExts || tsConfigFile ? _createSyncModuleResolver(extensions, tsConfigFile) : _resolveModuleSync;
151
162
  const pathMappings = compilePathMappings(compilerOptions.scopedPaths);
152
163
  const rootDirMappings = compileRootDirs(compilerOptions.scopedRootDirs);
153
164
  function toSourcePath(resolvedFileName) {
154
165
  if (!hasCustomExts || !customCompilerExtensionsSet.has(extname(resolvedFileName))) {
155
- return toSourceFilePath(resolvedFileName) || resolvedFileName;
166
+ return toSourceFilePath(resolvedFileName, sourceExtensions) || resolvedFileName;
156
167
  }
157
168
  return resolvedFileName;
158
169
  }
@@ -232,7 +243,7 @@ export function createCustomModuleResolver(compilerOptions, customCompilerExtens
232
243
  const target = expandPackageTarget(pickStringTarget(workspaceTarget.target), workspaceTarget.patternMatch);
233
244
  if (target) {
234
245
  const targetPath = toPackagePath(workspaceTarget.dir, target);
235
- const sourcePath = targetPath && toSourceFilePath(targetPath);
246
+ const sourcePath = targetPath && toSourceFilePath(targetPath, sourceExtensions);
236
247
  if (sourcePath)
237
248
  return toResult(specifier, containingFile, sourcePath);
238
249
  }
@@ -408,6 +408,18 @@ const coreVisitorObject = {
408
408
  }
409
409
  }
410
410
  },
411
+ ArrayExpression(node) {
412
+ for (const element of node.elements ?? []) {
413
+ if (element?.type !== 'Identifier')
414
+ continue;
415
+ const _import = state.localImportMap.get(element.name);
416
+ if (_import?.isNamespace) {
417
+ const internalImport = state.internal.get(_import.filePath);
418
+ if (internalImport)
419
+ addValue(internalImport.import, OPAQUE, state.filePath);
420
+ }
421
+ }
422
+ },
411
423
  TSQualifiedName(node) {
412
424
  let left = node;
413
425
  const parts = [];
@@ -281,6 +281,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
281
281
  entry?: string | string[] | undefined;
282
282
  project?: string | string[] | undefined;
283
283
  } | undefined;
284
+ jasmine?: string | boolean | string[] | {
285
+ config?: string | string[] | undefined;
286
+ entry?: string | string[] | undefined;
287
+ project?: string | string[] | undefined;
288
+ } | undefined;
284
289
  jest?: string | boolean | string[] | {
285
290
  config?: string | string[] | undefined;
286
291
  entry?: string | string[] | undefined;
@@ -486,6 +491,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
486
491
  entry?: string | string[] | undefined;
487
492
  project?: string | string[] | undefined;
488
493
  } | undefined;
494
+ osls?: string | boolean | string[] | {
495
+ config?: string | string[] | undefined;
496
+ entry?: string | string[] | undefined;
497
+ project?: string | string[] | undefined;
498
+ } | undefined;
489
499
  oxfmt?: string | boolean | string[] | {
490
500
  config?: string | string[] | undefined;
491
501
  entry?: string | string[] | undefined;
@@ -581,6 +591,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
581
591
  entry?: string | string[] | undefined;
582
592
  project?: string | string[] | undefined;
583
593
  } | undefined;
594
+ railway?: string | boolean | string[] | {
595
+ config?: string | string[] | undefined;
596
+ entry?: string | string[] | undefined;
597
+ project?: string | string[] | undefined;
598
+ } | undefined;
584
599
  raycast?: string | boolean | string[] | {
585
600
  config?: string | string[] | undefined;
586
601
  entry?: string | string[] | undefined;
@@ -1248,6 +1263,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1248
1263
  entry?: string | string[] | undefined;
1249
1264
  project?: string | string[] | undefined;
1250
1265
  } | undefined;
1266
+ jasmine?: string | boolean | string[] | {
1267
+ config?: string | string[] | undefined;
1268
+ entry?: string | string[] | undefined;
1269
+ project?: string | string[] | undefined;
1270
+ } | undefined;
1251
1271
  jest?: string | boolean | string[] | {
1252
1272
  config?: string | string[] | undefined;
1253
1273
  entry?: string | string[] | undefined;
@@ -1453,6 +1473,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1453
1473
  entry?: string | string[] | undefined;
1454
1474
  project?: string | string[] | undefined;
1455
1475
  } | undefined;
1476
+ osls?: string | boolean | string[] | {
1477
+ config?: string | string[] | undefined;
1478
+ entry?: string | string[] | undefined;
1479
+ project?: string | string[] | undefined;
1480
+ } | undefined;
1456
1481
  oxfmt?: string | boolean | string[] | {
1457
1482
  config?: string | string[] | undefined;
1458
1483
  entry?: string | string[] | undefined;
@@ -1548,6 +1573,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1548
1573
  entry?: string | string[] | undefined;
1549
1574
  project?: string | string[] | undefined;
1550
1575
  } | undefined;
1576
+ railway?: string | boolean | string[] | {
1577
+ config?: string | string[] | undefined;
1578
+ entry?: string | string[] | undefined;
1579
+ project?: string | string[] | undefined;
1580
+ } | undefined;
1551
1581
  raycast?: string | boolean | string[] | {
1552
1582
  config?: string | string[] | undefined;
1553
1583
  entry?: string | string[] | undefined;
@@ -0,0 +1,2 @@
1
+ import { type Input } from './input.ts';
2
+ export declare const filterTransitiveDependencies: (inputs: Input[], configFilePath: string, readRawFile?: (filePath: string) => string | undefined) => void;
@@ -0,0 +1,38 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { collectStringLiterals } from '../typescript/ast-helpers.js';
3
+ import { isDeferResolve, isDependency } from './input.js';
4
+ import { getPackageNameFromSpecifier } from './modules.js';
5
+ import { dirname, isInternal, join } from './path.js';
6
+ const readFile = (filePath) => {
7
+ try {
8
+ return readFileSync(filePath, 'utf8');
9
+ }
10
+ catch {
11
+ return undefined;
12
+ }
13
+ };
14
+ export const filterTransitiveDependencies = (inputs, configFilePath, readRawFile = readFile) => {
15
+ const literals = new Set();
16
+ const visited = new Set();
17
+ const collect = (filePath) => {
18
+ if (visited.has(filePath))
19
+ return;
20
+ visited.add(filePath);
21
+ const sourceText = readRawFile(filePath);
22
+ if (!sourceText)
23
+ return;
24
+ for (const literal of collectStringLiterals(sourceText, filePath)) {
25
+ literals.add(literal);
26
+ if (isInternal(literal))
27
+ collect(join(dirname(filePath), literal));
28
+ }
29
+ };
30
+ collect(configFilePath);
31
+ for (const input of inputs) {
32
+ if (!input.optional && (isDeferResolve(input) || isDependency(input))) {
33
+ const name = getPackageNameFromSpecifier(input.specifier);
34
+ if (name && !literals.has(name))
35
+ input.optional = true;
36
+ }
37
+ }
38
+ };
@@ -1 +1,2 @@
1
+ export declare const getGitRemoteUrls: (cwd: string) => string[];
1
2
  export declare const getGitHookPaths: (defaultPath?: string, followGitConfig?: boolean, cwd?: string) => string[];
package/dist/util/git.js CHANGED
@@ -1,4 +1,4 @@
1
- import { execSync } from 'node:child_process';
1
+ import { execFileSync, execSync } from 'node:child_process';
2
2
  import { join } from './path.js';
3
3
  const hookFileNames = [
4
4
  'prepare-commit-msg',
@@ -18,6 +18,28 @@ const getGitHooksPath = (defaultPath = '.git/hooks', cwd) => {
18
18
  return defaultPath;
19
19
  }
20
20
  };
21
+ const remoteUrlCache = new Map();
22
+ export const getGitRemoteUrls = (cwd) => {
23
+ const cached = remoteUrlCache.get(cwd);
24
+ if (cached)
25
+ return cached;
26
+ const urls = [];
27
+ try {
28
+ const output = execFileSync('git', ['config', '--local', '--get-regexp', String.raw `^remote\..*\.url$`], {
29
+ encoding: 'utf8',
30
+ stdio: ['pipe', 'pipe', 'ignore'],
31
+ cwd,
32
+ });
33
+ for (const line of output.trim().split('\n')) {
34
+ const separator = line.indexOf(' ');
35
+ if (separator !== -1)
36
+ urls.push(line.slice(separator + 1));
37
+ }
38
+ }
39
+ catch (_error) { }
40
+ remoteUrlCache.set(cwd, urls);
41
+ return urls;
42
+ };
21
43
  export const getGitHookPaths = (defaultPath = '.git/hooks', followGitConfig = true, cwd) => {
22
44
  const gitHooksPath = followGitConfig ? getGitHooksPath(defaultPath, cwd) : defaultPath;
23
45
  return hookFileNames.map(fileName => join(gitHooksPath, fileName));