knip 5.85.0 → 5.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CacheConsultant.d.ts +2 -2
- package/dist/CacheConsultant.js +3 -3
- package/dist/CatalogCounselor.d.ts +3 -3
- package/dist/CatalogCounselor.js +5 -5
- package/dist/ConfigurationChief.d.ts +161 -143
- package/dist/ConfigurationChief.js +15 -16
- package/dist/ConsoleStreamer.d.ts +1 -1
- package/dist/DependencyDeputy.d.ts +6 -6
- package/dist/DependencyDeputy.js +13 -10
- package/dist/IssueCollector.d.ts +7 -7
- package/dist/IssueCollector.js +3 -3
- package/dist/IssueFixer.d.ts +3 -3
- package/dist/IssueFixer.js +17 -6
- package/dist/JsonCatalogPeeker.js +1 -1
- package/dist/PrincipalFactory.d.ts +3 -3
- package/dist/PrincipalFactory.js +3 -3
- package/dist/ProjectPrincipal.d.ts +9 -9
- package/dist/ProjectPrincipal.js +15 -9
- package/dist/WorkspaceWorker.d.ts +9 -9
- package/dist/WorkspaceWorker.js +17 -17
- package/dist/YamlCatalogPeeker.js +1 -1
- package/dist/binaries/bash-parser.d.ts +2 -2
- package/dist/binaries/bash-parser.js +84 -50
- package/dist/binaries/fallback.d.ts +1 -1
- package/dist/binaries/fallback.js +4 -6
- package/dist/binaries/index.d.ts +1 -1
- package/dist/binaries/index.js +3 -3
- package/dist/binaries/plugins.d.ts +1 -1
- package/dist/binaries/plugins.js +6 -6
- package/dist/binaries/resolvers/bun.d.ts +2 -0
- package/dist/binaries/{package-manager → resolvers}/bun.js +4 -6
- package/dist/binaries/{package-manager → resolvers}/bunx.d.ts +2 -2
- package/dist/binaries/{package-manager → resolvers}/bunx.js +4 -4
- package/dist/binaries/resolvers/find.d.ts +2 -0
- package/dist/binaries/resolvers/find.js +19 -0
- package/dist/binaries/resolvers/index.d.ts +11 -0
- package/dist/binaries/resolvers/index.js +18 -0
- package/dist/binaries/resolvers/npm.d.ts +2 -0
- package/dist/binaries/resolvers/npx.d.ts +2 -0
- package/dist/binaries/{package-manager → resolvers}/npx.js +4 -4
- package/dist/binaries/resolvers/pnpm.d.ts +2 -0
- package/dist/binaries/{package-manager → resolvers}/pnpm.js +4 -3
- package/dist/binaries/{package-manager → resolvers}/pnpx.d.ts +2 -2
- package/dist/binaries/{package-manager → resolvers}/pnpx.js +2 -2
- package/dist/binaries/resolvers/yarn.d.ts +2 -0
- package/dist/binaries/{package-manager → resolvers}/yarn.js +4 -4
- package/dist/cli.js +11 -11
- package/dist/compilers/compilers.d.ts +1 -1
- package/dist/compilers/index.d.ts +33 -3
- package/dist/compilers/index.js +2 -2
- package/dist/compilers/mdx.d.ts +1 -1
- package/dist/compilers/mdx.js +9 -2
- package/dist/compilers/scss.d.ts +1 -1
- package/dist/compilers/scss.js +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/graph/analyze.d.ts +8 -8
- package/dist/graph/analyze.js +8 -6
- package/dist/graph/build.d.ts +9 -9
- package/dist/graph/build.js +19 -17
- package/dist/graph-explorer/cache.d.ts +3 -3
- package/dist/graph-explorer/explorer.d.ts +7 -7
- package/dist/graph-explorer/explorer.js +9 -9
- package/dist/graph-explorer/operations/build-exports-tree.d.ts +2 -2
- package/dist/graph-explorer/operations/build-exports-tree.js +2 -2
- package/dist/graph-explorer/operations/find-cycles.d.ts +2 -2
- package/dist/graph-explorer/operations/get-contention.d.ts +2 -2
- package/dist/graph-explorer/operations/get-contention.js +3 -3
- package/dist/graph-explorer/operations/get-dependency-usage.d.ts +1 -1
- package/dist/graph-explorer/operations/get-dependency-usage.js +1 -1
- package/dist/graph-explorer/operations/get-usage.d.ts +2 -2
- package/dist/graph-explorer/operations/get-usage.js +5 -5
- package/dist/graph-explorer/operations/has-strictly-ns-references.d.ts +1 -1
- package/dist/graph-explorer/operations/has-strictly-ns-references.js +1 -1
- package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
- package/dist/graph-explorer/operations/is-referenced.js +2 -2
- package/dist/graph-explorer/operations/resolve-definition.d.ts +2 -2
- package/dist/graph-explorer/operations/resolve-definition.js +3 -3
- package/dist/graph-explorer/utils.d.ts +1 -1
- package/dist/graph-explorer/utils.js +2 -2
- package/dist/graph-explorer/visitors.d.ts +1 -1
- package/dist/graph-explorer/visitors.js +1 -1
- package/dist/graph-explorer/walk-down.d.ts +1 -1
- package/dist/graph-explorer/walk-down.js +2 -2
- package/dist/graph-explorer/walk-up.d.ts +2 -2
- package/dist/graph-explorer/walk-up.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/manifest/helpers.d.ts +1 -1
- package/dist/manifest/helpers.js +2 -2
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/index.js +3 -3
- package/dist/plugins/_template/index.d.ts +1 -1
- package/dist/plugins/_template/index.js +2 -2
- package/dist/plugins/angular/index.d.ts +1 -1
- package/dist/plugins/angular/index.js +4 -4
- package/dist/plugins/astro/compiler-mdx.js +1 -1
- package/dist/plugins/astro/compiler.js +1 -1
- package/dist/plugins/astro/index.d.ts +1 -1
- package/dist/plugins/astro/index.js +9 -6
- package/dist/plugins/astro/resolveFromAST.d.ts +1 -0
- package/dist/plugins/astro/resolveFromAST.js +18 -1
- package/dist/plugins/astro-db/index.d.ts +1 -1
- package/dist/plugins/astro-db/index.js +1 -1
- package/dist/plugins/astro-og-canvas/index.d.ts +1 -1
- package/dist/plugins/astro-og-canvas/index.js +2 -2
- package/dist/plugins/ava/index.d.ts +1 -1
- package/dist/plugins/ava/index.js +2 -2
- package/dist/plugins/babel/helpers.js +1 -1
- package/dist/plugins/babel/index.d.ts +3 -3
- package/dist/plugins/babel/index.js +7 -4
- package/dist/plugins/babel/types.d.ts +1 -1
- package/dist/plugins/biome/index.d.ts +1 -1
- package/dist/plugins/biome/index.js +4 -4
- package/dist/plugins/bumpp/index.d.ts +1 -1
- package/dist/plugins/bumpp/index.js +2 -2
- package/dist/plugins/bun/index.d.ts +1 -1
- package/dist/plugins/bun/index.js +8 -2
- package/dist/plugins/c8/index.d.ts +1 -1
- package/dist/plugins/c8/index.js +1 -1
- package/dist/plugins/capacitor/index.d.ts +1 -1
- package/dist/plugins/capacitor/index.js +3 -3
- package/dist/plugins/changelogen/index.d.ts +1 -1
- package/dist/plugins/changelogen/index.js +2 -2
- package/dist/plugins/changelogithub/index.d.ts +1 -1
- package/dist/plugins/changelogithub/index.js +2 -2
- package/dist/plugins/changesets/index.d.ts +1 -1
- package/dist/plugins/changesets/index.js +10 -3
- package/dist/plugins/changesets/types.d.ts +1 -0
- package/dist/plugins/commitizen/index.d.ts +1 -1
- package/dist/plugins/commitizen/index.js +2 -2
- package/dist/plugins/commitlint/index.d.ts +1 -1
- package/dist/plugins/commitlint/index.js +3 -3
- package/dist/plugins/convex/index.d.ts +1 -1
- package/dist/plugins/convex/index.js +1 -1
- package/dist/plugins/create-typescript-app/index.d.ts +1 -1
- package/dist/plugins/create-typescript-app/index.js +1 -1
- package/dist/plugins/cspell/index.d.ts +1 -1
- package/dist/plugins/cspell/index.js +2 -2
- package/dist/plugins/cucumber/index.d.ts +1 -1
- package/dist/plugins/cucumber/index.js +2 -2
- package/dist/plugins/cypress/helpers.d.ts +2 -2
- package/dist/plugins/cypress/helpers.js +2 -2
- package/dist/plugins/cypress/index.d.ts +1 -1
- package/dist/plugins/cypress/index.js +3 -3
- package/dist/plugins/danger/index.d.ts +1 -1
- package/dist/plugins/danger/index.js +1 -1
- package/dist/plugins/dependency-cruiser/index.d.ts +1 -1
- package/dist/plugins/dependency-cruiser/index.js +1 -1
- package/dist/plugins/docusaurus/helpers.d.ts +3 -3
- package/dist/plugins/docusaurus/helpers.js +2 -2
- package/dist/plugins/docusaurus/index.d.ts +1 -1
- package/dist/plugins/docusaurus/index.js +3 -3
- package/dist/plugins/docusaurus/types.d.ts +1 -1
- package/dist/plugins/dotenv/index.d.ts +1 -1
- package/dist/plugins/dotenv/index.js +1 -1
- package/dist/plugins/drizzle/index.d.ts +1 -1
- package/dist/plugins/drizzle/index.js +2 -2
- package/dist/plugins/eleventy/index.d.ts +1 -1
- package/dist/plugins/eleventy/index.js +6 -6
- package/dist/plugins/eleventy/types.d.ts +1 -1
- package/dist/plugins/eslint/helpers.d.ts +3 -3
- package/dist/plugins/eslint/helpers.js +5 -5
- package/dist/plugins/eslint/index.d.ts +1 -1
- package/dist/plugins/eslint/index.js +3 -3
- package/dist/plugins/execa/index.d.ts +1 -1
- package/dist/plugins/execa/index.js +2 -2
- package/dist/plugins/execa/visitors/execa.d.ts +1 -1
- package/dist/plugins/execa/visitors/execa.js +3 -3
- package/dist/plugins/expo/helpers.d.ts +2 -2
- package/dist/plugins/expo/helpers.js +3 -3
- package/dist/plugins/expo/index.d.ts +1 -1
- package/dist/plugins/expo/index.js +4 -4
- package/dist/plugins/expressive-code/index.d.ts +1 -1
- package/dist/plugins/expressive-code/index.js +1 -1
- package/dist/plugins/gatsby/index.d.ts +1 -1
- package/dist/plugins/gatsby/index.js +2 -2
- package/dist/plugins/github-action/index.d.ts +1 -1
- package/dist/plugins/github-action/index.js +4 -4
- package/dist/plugins/github-actions/index.d.ts +1 -1
- package/dist/plugins/github-actions/index.js +4 -4
- package/dist/plugins/glob/index.d.ts +1 -1
- package/dist/plugins/graphql-codegen/index.d.ts +1 -1
- package/dist/plugins/graphql-codegen/index.js +5 -5
- package/dist/plugins/hardhat/index.d.ts +1 -1
- package/dist/plugins/hardhat/index.js +2 -2
- package/dist/plugins/husky/index.d.ts +1 -1
- package/dist/plugins/husky/index.js +3 -3
- package/dist/plugins/i18next-parser/index.d.ts +1 -1
- package/dist/plugins/i18next-parser/index.js +1 -1
- package/dist/plugins/index.d.ts +139 -136
- package/dist/plugins/index.js +142 -136
- package/dist/plugins/jest/helpers.d.ts +2 -2
- package/dist/plugins/jest/helpers.js +2 -2
- package/dist/plugins/jest/index.d.ts +1 -1
- package/dist/plugins/jest/index.js +4 -4
- package/dist/plugins/karma/helpers.d.ts +2 -2
- package/dist/plugins/karma/helpers.js +2 -2
- package/dist/plugins/karma/index.d.ts +1 -1
- package/dist/plugins/karma/index.js +4 -4
- package/dist/plugins/knex/index.d.ts +1 -1
- package/dist/plugins/knex/index.js +3 -3
- package/dist/plugins/ladle/index.d.ts +1 -1
- package/dist/plugins/ladle/index.js +4 -4
- package/dist/plugins/lefthook/index.d.ts +1 -1
- package/dist/plugins/lefthook/index.js +5 -5
- package/dist/plugins/lint-staged/index.d.ts +1 -1
- package/dist/plugins/lint-staged/index.js +2 -2
- package/dist/plugins/linthtml/index.d.ts +1 -1
- package/dist/plugins/linthtml/index.js +3 -3
- package/dist/plugins/lockfile-lint/index.d.ts +1 -1
- package/dist/plugins/lockfile-lint/index.js +2 -2
- package/dist/plugins/lost-pixel/index.d.ts +1 -1
- package/dist/plugins/lost-pixel/index.js +1 -1
- package/dist/plugins/markdownlint/index.d.ts +1 -1
- package/dist/plugins/markdownlint/index.js +3 -3
- package/dist/plugins/mdx/index.d.ts +1 -1
- package/dist/plugins/mdx/index.js +2 -2
- package/dist/plugins/mdxlint/index.d.ts +1 -1
- package/dist/plugins/mdxlint/index.js +3 -3
- package/dist/plugins/metro/index.d.ts +1 -1
- package/dist/plugins/metro/index.js +4 -4
- package/dist/plugins/mocha/index.d.ts +1 -1
- package/dist/plugins/mocha/index.js +2 -2
- package/dist/plugins/moonrepo/index.d.ts +1 -1
- package/dist/plugins/moonrepo/index.js +1 -1
- package/dist/plugins/msw/index.d.ts +1 -1
- package/dist/plugins/msw/index.js +3 -3
- package/dist/plugins/nano-staged/index.d.ts +1 -1
- package/dist/plugins/nano-staged/index.js +1 -1
- package/dist/plugins/nest/index.d.ts +1 -1
- package/dist/plugins/nest/index.js +2 -2
- package/dist/plugins/netlify/helpers.d.ts +1 -1
- package/dist/plugins/netlify/index.d.ts +1 -1
- package/dist/plugins/netlify/index.js +4 -4
- package/dist/plugins/next/index.d.ts +1 -1
- package/dist/plugins/next/index.js +4 -4
- package/dist/plugins/next/resolveFromAST.js +1 -1
- package/dist/plugins/next-intl/index.d.ts +1 -1
- package/dist/plugins/next-intl/index.js +1 -1
- package/dist/plugins/next-mdx/index.d.ts +1 -1
- package/dist/plugins/next-mdx/index.js +3 -3
- package/dist/plugins/next-mdx/resolveFromAST.js +1 -1
- package/dist/plugins/nitro/index.d.ts +1 -1
- package/dist/plugins/nitro/index.js +3 -3
- package/dist/plugins/node/index.d.ts +1 -1
- package/dist/plugins/node/index.js +1 -1
- package/dist/plugins/node-modules-inspector/index.d.ts +1 -1
- package/dist/plugins/node-modules-inspector/index.js +2 -2
- package/dist/plugins/nodemon/index.d.ts +1 -1
- package/dist/plugins/npm-package-json-lint/index.d.ts +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +3 -3
- package/dist/plugins/nuxt/helpers.d.ts +15 -0
- package/dist/plugins/nuxt/helpers.js +133 -0
- package/dist/plugins/nuxt/index.d.ts +1 -4
- package/dist/plugins/nuxt/index.js +177 -35
- package/dist/plugins/nuxt/types.d.ts +50 -0
- package/dist/plugins/nx/index.d.ts +1 -1
- package/dist/plugins/nx/index.js +13 -11
- package/dist/plugins/nx/types.d.ts +1 -0
- package/dist/plugins/nyc/index.d.ts +1 -1
- package/dist/plugins/nyc/index.js +2 -2
- package/dist/plugins/oclif/index.d.ts +1 -1
- package/dist/plugins/oclif/index.js +2 -2
- package/dist/plugins/openapi-ts/index.d.ts +3 -0
- package/dist/plugins/openapi-ts/index.js +13 -0
- package/dist/plugins/oxfmt/index.d.ts +3 -0
- package/dist/plugins/oxfmt/index.js +16 -0
- package/dist/plugins/oxlint/index.d.ts +1 -1
- package/dist/plugins/oxlint/index.js +2 -2
- package/dist/plugins/parcel/index.d.ts +1 -1
- package/dist/plugins/parcel/index.js +2 -2
- package/dist/plugins/payload/index.d.ts +1 -1
- package/dist/plugins/payload/index.js +2 -2
- package/dist/plugins/playwright/index.d.ts +2 -2
- package/dist/plugins/playwright/index.js +5 -5
- package/dist/plugins/playwright-ct/index.d.ts +1 -1
- package/dist/plugins/playwright-ct/index.js +3 -3
- package/dist/plugins/playwright-test/index.d.ts +1 -1
- package/dist/plugins/playwright-test/index.js +1 -1
- package/dist/plugins/plop/index.d.ts +1 -1
- package/dist/plugins/plop/index.js +1 -1
- package/dist/plugins/pm2/index.d.ts +1 -1
- package/dist/plugins/pm2/index.js +3 -3
- package/dist/plugins/pnpm/index.d.ts +1 -1
- package/dist/plugins/pnpm/index.js +1 -1
- package/dist/plugins/postcss/index.d.ts +1 -1
- package/dist/plugins/postcss/index.js +3 -3
- package/dist/plugins/preconstruct/index.d.ts +1 -1
- package/dist/plugins/preconstruct/index.js +3 -3
- package/dist/plugins/prettier/index.d.ts +1 -1
- package/dist/plugins/prettier/index.js +2 -2
- package/dist/plugins/prisma/index.d.ts +1 -1
- package/dist/plugins/prisma/index.js +5 -5
- package/dist/plugins/qwik/index.d.ts +3 -0
- package/dist/plugins/qwik/index.js +47 -0
- package/dist/plugins/qwik/resolveFromAST.d.ts +3 -0
- package/dist/plugins/qwik/resolveFromAST.js +37 -0
- package/dist/plugins/react-cosmos/index.d.ts +1 -1
- package/dist/plugins/react-cosmos/index.js +3 -3
- package/dist/plugins/react-native/index.d.ts +1 -1
- package/dist/plugins/react-native/index.js +2 -2
- package/dist/plugins/react-router/index.d.ts +1 -1
- package/dist/plugins/react-router/index.js +5 -5
- package/dist/plugins/relay/index.d.ts +1 -1
- package/dist/plugins/relay/index.js +3 -3
- package/dist/plugins/release-it/index.d.ts +1 -1
- package/dist/plugins/release-it/index.js +2 -2
- package/dist/plugins/remark/index.d.ts +1 -1
- package/dist/plugins/remark/index.js +3 -3
- package/dist/plugins/remix/index.d.ts +1 -1
- package/dist/plugins/remix/index.js +1 -1
- package/dist/plugins/rollup/index.d.ts +1 -1
- package/dist/plugins/rollup/index.js +1 -1
- package/dist/plugins/rsbuild/index.d.ts +1 -1
- package/dist/plugins/rsbuild/index.js +2 -2
- package/dist/plugins/rslib/index.d.ts +1 -1
- package/dist/plugins/rslib/index.js +1 -1
- package/dist/plugins/rspack/index.d.ts +1 -1
- package/dist/plugins/rspack/index.js +2 -2
- package/dist/plugins/rstest/index.d.ts +1 -1
- package/dist/plugins/rstest/index.js +2 -2
- package/dist/plugins/semantic-release/index.d.ts +1 -1
- package/dist/plugins/semantic-release/index.js +3 -3
- package/dist/plugins/sentry/index.d.ts +1 -1
- package/dist/plugins/sentry/index.js +1 -1
- package/dist/plugins/simple-git-hooks/index.d.ts +1 -1
- package/dist/plugins/simple-git-hooks/index.js +2 -2
- package/dist/plugins/size-limit/index.d.ts +1 -1
- package/dist/plugins/size-limit/index.js +3 -3
- package/dist/plugins/sst/index.d.ts +1 -1
- package/dist/plugins/sst/index.js +2 -2
- package/dist/plugins/sst/resolveFromAST.d.ts +1 -1
- package/dist/plugins/sst/resolveFromAST.js +4 -4
- package/dist/plugins/starlight/index.d.ts +1 -1
- package/dist/plugins/starlight/index.js +4 -4
- package/dist/plugins/starlight/resolveFromAST.js +1 -1
- package/dist/plugins/storybook/index.d.ts +1 -1
- package/dist/plugins/storybook/index.js +3 -3
- package/dist/plugins/stryker/index.d.ts +1 -1
- package/dist/plugins/stryker/index.js +2 -2
- package/dist/plugins/stylelint/index.d.ts +1 -1
- package/dist/plugins/stylelint/index.js +3 -3
- package/dist/plugins/svelte/compiler.d.ts +1 -1
- package/dist/plugins/svelte/compiler.js +1 -1
- package/dist/plugins/svelte/index.d.ts +1 -1
- package/dist/plugins/svelte/index.js +3 -3
- package/dist/plugins/sveltekit/index.d.ts +1 -1
- package/dist/plugins/sveltekit/index.js +3 -3
- package/dist/plugins/svgo/index.d.ts +1 -1
- package/dist/plugins/svgo/index.js +1 -1
- package/dist/plugins/svgr/index.d.ts +1 -1
- package/dist/plugins/svgr/index.js +2 -2
- package/dist/plugins/swc/index.d.ts +1 -1
- package/dist/plugins/swc/index.js +5 -3
- package/dist/plugins/swc/types.d.ts +1 -0
- package/dist/plugins/syncpack/index.d.ts +1 -1
- package/dist/plugins/syncpack/index.js +2 -2
- package/dist/plugins/tailwind/index.d.ts +1 -1
- package/dist/plugins/tailwind/index.js +2 -2
- package/dist/plugins/tanstack-router/index.d.ts +1 -1
- package/dist/plugins/tanstack-router/index.js +3 -3
- package/dist/plugins/taskfile/index.d.ts +1 -1
- package/dist/plugins/taskfile/index.js +3 -3
- package/dist/plugins/travis/index.d.ts +1 -1
- package/dist/plugins/travis/index.js +1 -1
- package/dist/plugins/ts-node/index.d.ts +1 -1
- package/dist/plugins/tsdown/index.d.ts +1 -1
- package/dist/plugins/tsdown/index.js +4 -4
- package/dist/plugins/tsup/index.d.ts +1 -1
- package/dist/plugins/tsup/index.js +2 -2
- package/dist/plugins/tsx/index.d.ts +1 -1
- package/dist/plugins/tsx/index.js +2 -2
- package/dist/plugins/typedoc/index.d.ts +1 -1
- package/dist/plugins/typedoc/index.js +2 -2
- package/dist/plugins/typescript/index.d.ts +1 -1
- package/dist/plugins/typescript/index.js +10 -4
- package/dist/plugins/unbuild/index.d.ts +1 -1
- package/dist/plugins/unbuild/index.js +2 -2
- package/dist/plugins/unocss/index.d.ts +1 -1
- package/dist/plugins/unocss/index.js +2 -2
- package/dist/plugins/vercel-og/index.d.ts +1 -1
- package/dist/plugins/vercel-og/index.js +1 -1
- package/dist/plugins/vike/index.d.ts +1 -1
- package/dist/plugins/vike/index.js +1 -1
- package/dist/plugins/vite/helpers.d.ts +1 -1
- package/dist/plugins/vite/helpers.js +4 -4
- package/dist/plugins/vite/index.d.ts +1 -1
- package/dist/plugins/vite/index.js +5 -5
- package/dist/plugins/vite/visitors/importMetaGlob.d.ts +1 -1
- package/dist/plugins/vite/visitors/importMetaGlob.js +4 -4
- package/dist/plugins/vitepress/index.d.ts +1 -1
- package/dist/plugins/vitepress/index.js +1 -1
- package/dist/plugins/vitest/helpers.d.ts +1 -1
- package/dist/plugins/vitest/index.d.ts +2 -2
- package/dist/plugins/vitest/index.js +15 -7
- package/dist/plugins/vitest/types.d.ts +1 -0
- package/dist/plugins/vue/compiler.d.ts +1 -1
- package/dist/plugins/vue/compiler.js +1 -1
- package/dist/plugins/vue/index.d.ts +1 -1
- package/dist/plugins/vue/index.js +4 -4
- package/dist/plugins/webdriver-io/index.d.ts +1 -1
- package/dist/plugins/webdriver-io/index.js +2 -2
- package/dist/plugins/webpack/index.d.ts +2 -2
- package/dist/plugins/webpack/index.js +5 -5
- package/dist/plugins/webpack/visitors/requireContext.d.ts +1 -1
- package/dist/plugins/webpack/visitors/requireContext.js +4 -4
- package/dist/plugins/wireit/index.d.ts +1 -1
- package/dist/plugins/wireit/index.js +1 -1
- package/dist/plugins/wrangler/index.d.ts +1 -1
- package/dist/plugins/wrangler/index.js +3 -3
- package/dist/plugins/xo/index.d.ts +1 -1
- package/dist/plugins/xo/index.js +2 -2
- package/dist/plugins/xo/types.d.ts +1 -1
- package/dist/plugins/yarn/index.d.ts +1 -1
- package/dist/plugins/yarn/index.js +5 -4
- package/dist/plugins/yorkie/index.d.ts +1 -1
- package/dist/plugins/yorkie/index.js +2 -2
- package/dist/plugins/zx/index.d.ts +1 -1
- package/dist/plugins/zx/index.js +2 -2
- package/dist/plugins/zx/visitors/zx.d.ts +1 -1
- package/dist/plugins/zx/visitors/zx.js +2 -2
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +2 -2
- package/dist/reporters/codeclimate.d.ts +1 -1
- package/dist/reporters/codeclimate.js +2 -2
- package/dist/reporters/codeowners.d.ts +1 -1
- package/dist/reporters/codeowners.js +3 -3
- package/dist/reporters/compact.d.ts +1 -1
- package/dist/reporters/compact.js +2 -2
- package/dist/reporters/disclosure.d.ts +1 -1
- package/dist/reporters/disclosure.js +1 -1
- package/dist/reporters/github-actions.d.ts +1 -1
- package/dist/reporters/github-actions.js +4 -4
- package/dist/reporters/index.d.ts +8 -8
- package/dist/reporters/index.js +8 -8
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/json.js +4 -4
- package/dist/reporters/markdown.d.ts +1 -1
- package/dist/reporters/markdown.js +2 -2
- package/dist/reporters/symbols.d.ts +1 -1
- package/dist/reporters/symbols.js +2 -2
- package/dist/reporters/trace.d.ts +4 -4
- package/dist/reporters/trace.js +4 -4
- package/dist/reporters/util/configuration-hints.d.ts +2 -2
- package/dist/reporters/util/configuration-hints.js +4 -4
- package/dist/reporters/util/util.d.ts +3 -3
- package/dist/reporters/util/util.js +3 -3
- package/dist/reporters/watch.d.ts +3 -3
- package/dist/reporters/watch.js +3 -3
- package/dist/run.d.ts +12 -12
- package/dist/run.js +12 -12
- package/dist/schema/configuration.d.ts +45 -0
- package/dist/schema/configuration.js +2 -2
- package/dist/schema/plugins.d.ts +15 -0
- package/dist/schema/plugins.js +3 -0
- package/dist/session/build-maps.d.ts +3 -3
- package/dist/session/build-maps.js +3 -3
- package/dist/session/file-descriptor.d.ts +2 -2
- package/dist/session/file-descriptor.js +3 -3
- package/dist/session/index.d.ts +12 -12
- package/dist/session/index.js +7 -7
- package/dist/session/package-json-descriptor.d.ts +2 -2
- package/dist/session/package-json-descriptor.js +1 -1
- package/dist/session/session.d.ts +7 -7
- package/dist/session/session.js +3 -3
- package/dist/session/types.d.ts +2 -2
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +3 -0
- package/dist/types/args.d.ts +1 -1
- package/dist/types/config.d.ts +11 -11
- package/dist/types/exports.d.ts +1 -1
- package/dist/types/issues.d.ts +2 -2
- package/dist/types/module-graph.d.ts +2 -2
- package/dist/types/package-json.d.ts +1 -1
- package/dist/types/project.d.ts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/typescript/SourceFileManager.d.ts +1 -1
- package/dist/typescript/SourceFileManager.js +4 -4
- package/dist/typescript/ast-helpers.d.ts +3 -3
- package/dist/typescript/ast-helpers.js +2 -2
- package/dist/typescript/create-hosts.d.ts +3 -3
- package/dist/typescript/create-hosts.js +2 -2
- package/dist/typescript/get-imports-and-exports.d.ts +3 -3
- package/dist/typescript/get-imports-and-exports.js +24 -15
- package/dist/typescript/has-refs-in-file.d.ts +1 -1
- package/dist/typescript/has-refs-in-file.js +2 -2
- package/dist/typescript/pragmas/custom.d.ts +2 -2
- package/dist/typescript/pragmas/custom.js +4 -4
- package/dist/typescript/pragmas/index.d.ts +2 -2
- package/dist/typescript/pragmas/index.js +2 -2
- package/dist/typescript/pragmas/typescript.d.ts +2 -2
- package/dist/typescript/pragmas/typescript.js +1 -1
- package/dist/typescript/resolve-module-names.d.ts +1 -1
- package/dist/typescript/resolve-module-names.js +7 -7
- package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/importCall.js +3 -3
- package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/importType.js +2 -2
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +2 -2
- package/dist/typescript/visitors/dynamic-imports/index.js +7 -7
- package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +2 -2
- package/dist/typescript/visitors/dynamic-imports/jsDocType.js +2 -2
- package/dist/typescript/visitors/dynamic-imports/moduleRegister.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/moduleRegister.js +3 -3
- package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/requireCall.js +4 -4
- package/dist/typescript/visitors/dynamic-imports/resolveCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/resolveCall.js +3 -3
- package/dist/typescript/visitors/dynamic-imports/urlConstructor.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/urlConstructor.js +2 -2
- package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportAssignment.js +4 -4
- package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportDeclaration.js +3 -3
- package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportKeyword.js +5 -5
- package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportsAccessExpression.js +3 -3
- package/dist/typescript/visitors/exports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/index.js +5 -5
- package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
- package/dist/typescript/visitors/exports/moduleExportsAccessExpression.js +4 -4
- package/dist/typescript/visitors/helpers.d.ts +1 -1
- package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/importDeclaration.js +3 -3
- package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/importEqualsDeclaration.js +3 -3
- package/dist/typescript/visitors/imports/index.d.ts +1 -1
- package/dist/typescript/visitors/imports/index.js +3 -3
- package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/reExportDeclaration.js +2 -2
- package/dist/typescript/visitors/index.d.ts +3 -3
- package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
- package/dist/typescript/visitors/scripts/bun.js +3 -3
- package/dist/typescript/visitors/scripts/index.d.ts +2 -2
- package/dist/typescript/visitors/scripts/index.js +1 -1
- package/dist/util/Performance.d.ts +3 -5
- package/dist/util/Performance.js +37 -20
- package/dist/util/catalog.d.ts +2 -2
- package/dist/util/catalog.js +3 -3
- package/dist/util/codeowners.js +2 -2
- package/dist/util/create-input-handler.d.ts +6 -6
- package/dist/util/create-input-handler.js +8 -8
- package/dist/util/create-options.d.ts +52 -22
- package/dist/util/create-options.js +13 -13
- package/dist/util/create-workspace-graph.d.ts +1 -1
- package/dist/util/create-workspace-graph.js +1 -1
- package/dist/util/file-entry-cache.js +4 -4
- package/dist/util/fs.d.ts +2 -2
- package/dist/util/fs.js +4 -4
- package/dist/util/get-included-issue-types.d.ts +1 -1
- package/dist/util/get-included-issue-types.js +2 -2
- package/dist/util/git.js +1 -1
- package/dist/util/glob-core.js +55 -36
- package/dist/util/glob.js +4 -4
- package/dist/util/input.d.ts +2 -2
- package/dist/util/input.js +1 -1
- package/dist/util/issue-initializers.d.ts +1 -1
- package/dist/util/issue-initializers.js +1 -1
- package/dist/util/jiti.js +1 -1
- package/dist/util/load-config.d.ts +1 -1
- package/dist/util/load-config.js +3 -3
- package/dist/util/load-tsconfig.js +2 -2
- package/dist/util/loader.js +14 -6
- package/dist/util/map-workspaces.d.ts +1 -1
- package/dist/util/map-workspaces.js +4 -4
- package/dist/util/module-graph.d.ts +1 -1
- package/dist/util/modules.js +3 -4
- package/dist/util/package-json.d.ts +1 -1
- package/dist/util/package-json.js +10 -0
- package/dist/util/package-name.d.ts +1 -1
- package/dist/util/package-name.js +1 -1
- package/dist/util/path.js +1 -1
- package/dist/util/plugin.d.ts +2 -2
- package/dist/util/plugin.js +5 -5
- package/dist/util/remove-export.js +1 -1
- package/dist/util/reporter.d.ts +1 -1
- package/dist/util/reporter.js +3 -3
- package/dist/util/require.js +1 -1
- package/dist/util/resolve.d.ts +2 -3
- package/dist/util/resolve.js +7 -6
- package/dist/util/table.js +1 -1
- package/dist/util/tag.d.ts +1 -1
- package/dist/util/tag.js +1 -1
- package/dist/util/to-source-path.d.ts +1 -1
- package/dist/util/to-source-path.js +5 -5
- package/dist/util/trace.d.ts +1 -1
- package/dist/util/watch.d.ts +10 -10
- package/dist/util/watch.js +12 -9
- package/dist/util/workspace-file-filter.js +2 -2
- package/dist/util/workspace-selectors.d.ts +1 -1
- package/dist/util/workspace-selectors.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +64 -64
- package/schema.json +12 -0
- package/dist/binaries/package-manager/bun.d.ts +0 -2
- package/dist/binaries/package-manager/index.d.ts +0 -10
- package/dist/binaries/package-manager/index.js +0 -16
- package/dist/binaries/package-manager/npm.d.ts +0 -2
- package/dist/binaries/package-manager/npx.d.ts +0 -2
- package/dist/binaries/package-manager/pnpm.d.ts +0 -2
- package/dist/binaries/package-manager/yarn.d.ts +0 -2
- package/vendor/bash-parser/README.md +0 -7
- package/vendor/bash-parser/index.d.ts +0 -79
- package/vendor/bash-parser/index.js +0 -58
- /package/dist/binaries/{package-manager → resolvers}/npm.js +0 -0
package/dist/util/Performance.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import os from 'node:os';
|
|
2
1
|
import { PerformanceObserver, performance } from 'node:perf_hooks';
|
|
3
2
|
import { memoryUsage } from 'node:process';
|
|
4
3
|
import { parseArgs } from 'node:util';
|
|
5
|
-
import { getStats } from
|
|
6
|
-
import { Table } from
|
|
4
|
+
import { getStats } from "./math.js";
|
|
5
|
+
import { Table } from "./table.js";
|
|
7
6
|
const { values } = parseArgs({
|
|
8
7
|
strict: false,
|
|
9
8
|
options: {
|
|
@@ -24,12 +23,15 @@ export const timerify = (fn, name = fn.name) => {
|
|
|
24
23
|
return fn;
|
|
25
24
|
return performance.timerify(Object.defineProperty(fn, 'name', { get: () => name }));
|
|
26
25
|
};
|
|
27
|
-
const getMemInfo = () =>
|
|
26
|
+
const getMemInfo = (label) => {
|
|
27
|
+
const usage = memoryUsage();
|
|
28
|
+
return { label, heapUsed: usage.heapUsed, heapTotal: usage.heapTotal, rss: usage.rss };
|
|
29
|
+
};
|
|
28
30
|
const twoFixed = (value) => (typeof value === 'number' ? value.toFixed(2) : value);
|
|
29
31
|
const inMB = (bytes) => bytes / 1024 / 1024;
|
|
30
|
-
const keys = ['heapUsed', 'heapTotal', '
|
|
31
|
-
const logHead = () => console.log(keys.map(key => key.padStart(10)).join(' '));
|
|
32
|
-
const log = (memInfo) => console.log(keys.map(key => twoFixed(inMB(memInfo[key])).padStart(10)).join(' '));
|
|
32
|
+
const keys = ['heapUsed', 'heapTotal', 'rss'];
|
|
33
|
+
const logHead = () => console.log(['phase', ...keys].map(key => key.padStart(10)).join(' '));
|
|
34
|
+
const log = (memInfo) => console.log([memInfo.label.padStart(10), ...keys.map(key => twoFixed(inMB(memInfo[key])).padStart(10))].join(' '));
|
|
33
35
|
class Performance {
|
|
34
36
|
isEnabled;
|
|
35
37
|
isTimerifyFunctions;
|
|
@@ -42,8 +44,6 @@ class Performance {
|
|
|
42
44
|
memId;
|
|
43
45
|
fnObserver;
|
|
44
46
|
memObserver;
|
|
45
|
-
memoryUsageStart;
|
|
46
|
-
freeMemoryStart;
|
|
47
47
|
constructor({ isTimerifyFunctions = false, isMemoryUsageEnabled = false }) {
|
|
48
48
|
this.isEnabled = isTimerifyFunctions || isMemoryUsageEnabled;
|
|
49
49
|
this.isTimerifyFunctions = isTimerifyFunctions;
|
|
@@ -69,7 +69,7 @@ class Performance {
|
|
|
69
69
|
this.memObserver.observe({ type: 'mark' });
|
|
70
70
|
if (isMemoryRealtime)
|
|
71
71
|
logHead();
|
|
72
|
-
this.addMemoryMark(
|
|
72
|
+
this.addMemoryMark('start');
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
setMark(name) {
|
|
@@ -98,6 +98,7 @@ class Performance {
|
|
|
98
98
|
}
|
|
99
99
|
getTimerifiedFunctionsTable() {
|
|
100
100
|
const entriesByName = this.getPerfEntriesByName();
|
|
101
|
+
const totalDuration = this.getCurrentDurationInMs();
|
|
101
102
|
const table = new Table({ header: true });
|
|
102
103
|
for (const [name, values] of Object.entries(entriesByName)) {
|
|
103
104
|
const stats = getStats(values);
|
|
@@ -108,38 +109,53 @@ class Performance {
|
|
|
108
109
|
table.cell('max', stats.max, twoFixed);
|
|
109
110
|
table.cell('median', stats.median, twoFixed);
|
|
110
111
|
table.cell('sum', stats.sum, twoFixed);
|
|
112
|
+
table.cell('%', (stats.sum / totalDuration) * 100, v => (typeof v === 'number' ? `${v.toFixed(0)}%` : ''));
|
|
111
113
|
}
|
|
112
114
|
table.sort('sum|desc');
|
|
113
115
|
return table.toString();
|
|
114
116
|
}
|
|
115
|
-
addMemoryMark(
|
|
117
|
+
addMemoryMark(label) {
|
|
116
118
|
if (!this.isMemoryUsageEnabled)
|
|
117
119
|
return;
|
|
118
|
-
const id = `${this.memId}:${
|
|
119
|
-
const detail = getMemInfo();
|
|
120
|
+
const id = `${this.memId}:${label}`;
|
|
121
|
+
const detail = getMemInfo(label);
|
|
120
122
|
performance.mark(id, { detail });
|
|
121
|
-
if (isMemoryRealtime
|
|
123
|
+
if (isMemoryRealtime)
|
|
122
124
|
log(detail);
|
|
123
125
|
}
|
|
124
126
|
getMemoryUsageTable() {
|
|
125
127
|
const table = new Table({ header: true });
|
|
126
|
-
let
|
|
128
|
+
let prevHeapUsed = 0;
|
|
129
|
+
let peakHeapUsed = 0;
|
|
130
|
+
let peakRss = 0;
|
|
127
131
|
for (const entry of this.memEntries) {
|
|
128
132
|
if (!entry.detail)
|
|
129
133
|
continue;
|
|
134
|
+
const { label, heapUsed, rss } = entry.detail;
|
|
135
|
+
const delta = heapUsed - prevHeapUsed;
|
|
136
|
+
if (heapUsed > peakHeapUsed)
|
|
137
|
+
peakHeapUsed = heapUsed;
|
|
138
|
+
if (rss > peakRss)
|
|
139
|
+
peakRss = rss;
|
|
130
140
|
table.row();
|
|
131
|
-
table.cell('
|
|
132
|
-
table.cell('heapUsed', inMB(
|
|
133
|
-
table.cell('
|
|
134
|
-
table.cell('
|
|
141
|
+
table.cell('Phase', label);
|
|
142
|
+
table.cell('heapUsed', inMB(heapUsed), twoFixed);
|
|
143
|
+
table.cell('rss', inMB(rss), twoFixed);
|
|
144
|
+
table.cell('Δheap', prevHeapUsed === 0 ? '' : `${delta > 0 ? '+' : ''}${twoFixed(inMB(delta))}`, String);
|
|
145
|
+
prevHeapUsed = heapUsed;
|
|
135
146
|
}
|
|
147
|
+
table.row();
|
|
148
|
+
table.cell('Phase', 'peak');
|
|
149
|
+
table.cell('heapUsed', inMB(peakHeapUsed), twoFixed);
|
|
150
|
+
table.cell('rss', inMB(peakRss), twoFixed);
|
|
151
|
+
table.cell('Δheap', '');
|
|
136
152
|
return table.toString();
|
|
137
153
|
}
|
|
138
154
|
getCurrentDurationInMs() {
|
|
139
155
|
return performance.now() - this.startTime;
|
|
140
156
|
}
|
|
141
157
|
getMemHeapUsage() {
|
|
142
|
-
return
|
|
158
|
+
return memoryUsage().heapUsed;
|
|
143
159
|
}
|
|
144
160
|
getCurrentMemUsageInMb() {
|
|
145
161
|
return twoFixed(inMB(this.getMemHeapUsage()));
|
|
@@ -147,6 +163,7 @@ class Performance {
|
|
|
147
163
|
async finalize() {
|
|
148
164
|
if (!this.isEnabled)
|
|
149
165
|
return;
|
|
166
|
+
this.addMemoryMark('end');
|
|
150
167
|
await this.flush();
|
|
151
168
|
}
|
|
152
169
|
reset() {
|
package/dist/util/catalog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CatalogContainer } from '../CatalogCounselor.
|
|
2
|
-
import type { PackageJson } from '../types/package-json.
|
|
1
|
+
import type { CatalogContainer } from '../CatalogCounselor.ts';
|
|
2
|
+
import type { PackageJson } from '../types/package-json.ts';
|
|
3
3
|
export declare const DEFAULT_CATALOG = "default";
|
|
4
4
|
export declare const getCatalogContainer: (cwd: string, manifest: PackageJson, manifestPath: string, pnpmWorkspacePath?: string, pnpmWorkspace?: any) => Promise<CatalogContainer>;
|
|
5
5
|
export declare const parseCatalog: (container: CatalogContainer) => Set<string>;
|
package/dist/util/catalog.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isFile } from
|
|
2
|
-
import { _load } from
|
|
3
|
-
import { basename, join } from
|
|
1
|
+
import { isFile } from "./fs.js";
|
|
2
|
+
import { _load } from "./loader.js";
|
|
3
|
+
import { basename, join } from "./path.js";
|
|
4
4
|
export const DEFAULT_CATALOG = 'default';
|
|
5
5
|
export const getCatalogContainer = async (cwd, manifest, manifestPath, pnpmWorkspacePath, pnpmWorkspace) => {
|
|
6
6
|
const filePath = pnpmWorkspacePath ?? (isFile(cwd, '.yarnrc.yml') ? join(cwd, '.yarnrc.yml') : manifestPath);
|
package/dist/util/codeowners.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import picomatch from 'picomatch';
|
|
3
|
-
import { debugLog } from
|
|
4
|
-
import { convertGitignoreToPicomatchIgnorePatterns } from
|
|
3
|
+
import { debugLog } from "./debug.js";
|
|
4
|
+
import { convertGitignoreToPicomatchIgnorePatterns } from "./parse-and-convert-gitignores.js";
|
|
5
5
|
export function parseCodeowners(content) {
|
|
6
6
|
const matchers = content
|
|
7
7
|
.split(/\r?\n/)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ConfigurationChief, Workspace } from '../ConfigurationChief.
|
|
2
|
-
import type { DependencyDeputy } from '../DependencyDeputy.
|
|
3
|
-
import type { Issue } from '../types/issues.
|
|
4
|
-
import type { ExternalRef } from '../types/module-graph.
|
|
5
|
-
import type { MainOptions } from './create-options.
|
|
6
|
-
import { type Input } from './input.
|
|
1
|
+
import type { ConfigurationChief, Workspace } from '../ConfigurationChief.ts';
|
|
2
|
+
import type { DependencyDeputy } from '../DependencyDeputy.ts';
|
|
3
|
+
import type { Issue } from '../types/issues.ts';
|
|
4
|
+
import type { ExternalRef } from '../types/module-graph.ts';
|
|
5
|
+
import type { MainOptions } from './create-options.ts';
|
|
6
|
+
import { type Input } from './input.ts';
|
|
7
7
|
export type ExternalRefsFromInputs = Map<string, Set<ExternalRef>>;
|
|
8
8
|
export declare const createInputHandler: (deputy: DependencyDeputy, chief: ConfigurationChief, isGitIgnored: (filePath: string) => boolean, addIssue: (issue: Issue) => void, externalRefs: ExternalRefsFromInputs | undefined, options: MainOptions) => (input: Input, workspace: Workspace) => string | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IGNORED_RUNTIME_DEPENDENCIES } from
|
|
2
|
-
import { debugLog } from
|
|
3
|
-
import { fromBinary, isBinary, isConfig, isDeferResolve, isDeferResolveEntry, isDependency, toDebugString, } from
|
|
4
|
-
import { getPackageNameFromSpecifier } from
|
|
5
|
-
import { dirname, isAbsolute, isInNodeModules, isInternal, join } from
|
|
6
|
-
import {
|
|
1
|
+
import { IGNORED_RUNTIME_DEPENDENCIES } from "../constants.js";
|
|
2
|
+
import { debugLog } from "./debug.js";
|
|
3
|
+
import { fromBinary, isBinary, isConfig, isDeferResolve, isDeferResolveEntry, isDependency, toDebugString, } from "./input.js";
|
|
4
|
+
import { getPackageNameFromSpecifier } from "./modules.js";
|
|
5
|
+
import { dirname, isAbsolute, isInNodeModules, isInternal, join } from "./path.js";
|
|
6
|
+
import { resolveModuleSync, _resolveSync } from "./resolve.js";
|
|
7
7
|
const isJoinable = (specifier) => {
|
|
8
8
|
const char = specifier.charCodeAt(0);
|
|
9
9
|
return char !== 35 && char !== 126 && char !== 64 && !isAbsolute(specifier);
|
|
@@ -53,7 +53,7 @@ export const createInputHandler = (deputy, chief, isGitIgnored, addIssue, extern
|
|
|
53
53
|
const isWorkspace = chief.workspacesByPkgName.has(packageName);
|
|
54
54
|
const inputWorkspace = getWorkspaceFor(input, chief, workspace);
|
|
55
55
|
if (inputWorkspace) {
|
|
56
|
-
const isHandled = deputy.maybeAddReferencedExternalDependency(inputWorkspace, packageName);
|
|
56
|
+
const isHandled = deputy.maybeAddReferencedExternalDependency(inputWorkspace, packageName, isConfig(input));
|
|
57
57
|
if (externalRefs && !isWorkspace) {
|
|
58
58
|
addExternalRef(externalRefs, containingFilePath, { specifier: packageName, identifier: undefined });
|
|
59
59
|
}
|
|
@@ -84,7 +84,7 @@ export const createInputHandler = (deputy, chief, isGitIgnored, addIssue, extern
|
|
|
84
84
|
}
|
|
85
85
|
const filePath = isJoinable(specifier) ? join(input.dir ?? dirname(containingFilePath), specifier) : specifier;
|
|
86
86
|
const basePath = input.dir ? join(input.dir, 'file.ts') : containingFilePath;
|
|
87
|
-
const resolvedFilePath =
|
|
87
|
+
const resolvedFilePath = resolveModuleSync(filePath, basePath);
|
|
88
88
|
if (resolvedFilePath && isInternal(resolvedFilePath)) {
|
|
89
89
|
return isGitIgnored(resolvedFilePath) ? undefined : resolvedFilePath;
|
|
90
90
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { Options } from '../types/options.
|
|
2
|
-
import type { ParsedCLIArgs } from './cli-arguments.
|
|
1
|
+
import type { Options } from '../types/options.ts';
|
|
2
|
+
import type { ParsedCLIArgs } from './cli-arguments.ts';
|
|
3
3
|
interface CreateOptions extends Partial<Options> {
|
|
4
4
|
args?: ParsedCLIArgs;
|
|
5
5
|
}
|
|
6
6
|
export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
7
7
|
cacheLocation: string;
|
|
8
|
-
catalog: import("../CatalogCounselor.
|
|
8
|
+
catalog: import("../CatalogCounselor.ts").CatalogContainer;
|
|
9
9
|
config: string | undefined;
|
|
10
10
|
configFilePath: string | undefined;
|
|
11
11
|
cwd: string;
|
|
12
12
|
dependencies: boolean;
|
|
13
|
-
experimentalTags: import("../types/options.
|
|
13
|
+
experimentalTags: import("../types/options.ts").Tags;
|
|
14
14
|
exports: boolean;
|
|
15
15
|
files: boolean;
|
|
16
16
|
fixTypes: string[];
|
|
17
17
|
gitignore: boolean;
|
|
18
|
-
includedIssueTypes: import("../types/issues.
|
|
18
|
+
includedIssueTypes: import("../types/issues.ts").Report;
|
|
19
19
|
isCache: boolean;
|
|
20
20
|
isDebug: boolean;
|
|
21
21
|
isDisableConfigHints: boolean;
|
|
@@ -395,6 +395,16 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
395
395
|
entry?: string | string[] | undefined;
|
|
396
396
|
project?: string | string[] | undefined;
|
|
397
397
|
} | undefined;
|
|
398
|
+
'openapi-ts'?: string | boolean | string[] | {
|
|
399
|
+
config?: string | string[] | undefined;
|
|
400
|
+
entry?: string | string[] | undefined;
|
|
401
|
+
project?: string | string[] | undefined;
|
|
402
|
+
} | undefined;
|
|
403
|
+
oxfmt?: string | boolean | string[] | {
|
|
404
|
+
config?: string | string[] | undefined;
|
|
405
|
+
entry?: string | string[] | undefined;
|
|
406
|
+
project?: string | string[] | undefined;
|
|
407
|
+
} | undefined;
|
|
398
408
|
oxlint?: string | boolean | string[] | {
|
|
399
409
|
config?: string | string[] | undefined;
|
|
400
410
|
entry?: string | string[] | undefined;
|
|
@@ -460,6 +470,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
460
470
|
entry?: string | string[] | undefined;
|
|
461
471
|
project?: string | string[] | undefined;
|
|
462
472
|
} | undefined;
|
|
473
|
+
qwik?: string | boolean | string[] | {
|
|
474
|
+
config?: string | string[] | undefined;
|
|
475
|
+
entry?: string | string[] | undefined;
|
|
476
|
+
project?: string | string[] | undefined;
|
|
477
|
+
} | undefined;
|
|
463
478
|
'react-cosmos'?: string | boolean | string[] | {
|
|
464
479
|
config?: string | string[] | undefined;
|
|
465
480
|
entry?: string | string[] | undefined;
|
|
@@ -1076,6 +1091,16 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
1076
1091
|
entry?: string | string[] | undefined;
|
|
1077
1092
|
project?: string | string[] | undefined;
|
|
1078
1093
|
} | undefined;
|
|
1094
|
+
'openapi-ts'?: string | boolean | string[] | {
|
|
1095
|
+
config?: string | string[] | undefined;
|
|
1096
|
+
entry?: string | string[] | undefined;
|
|
1097
|
+
project?: string | string[] | undefined;
|
|
1098
|
+
} | undefined;
|
|
1099
|
+
oxfmt?: string | boolean | string[] | {
|
|
1100
|
+
config?: string | string[] | undefined;
|
|
1101
|
+
entry?: string | string[] | undefined;
|
|
1102
|
+
project?: string | string[] | undefined;
|
|
1103
|
+
} | undefined;
|
|
1079
1104
|
oxlint?: string | boolean | string[] | {
|
|
1080
1105
|
config?: string | string[] | undefined;
|
|
1081
1106
|
entry?: string | string[] | undefined;
|
|
@@ -1141,6 +1166,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
1141
1166
|
entry?: string | string[] | undefined;
|
|
1142
1167
|
project?: string | string[] | undefined;
|
|
1143
1168
|
} | undefined;
|
|
1169
|
+
qwik?: string | boolean | string[] | {
|
|
1170
|
+
config?: string | string[] | undefined;
|
|
1171
|
+
entry?: string | string[] | undefined;
|
|
1172
|
+
project?: string | string[] | undefined;
|
|
1173
|
+
} | undefined;
|
|
1144
1174
|
'react-cosmos'?: string | boolean | string[] | {
|
|
1145
1175
|
config?: string | string[] | undefined;
|
|
1146
1176
|
entry?: string | string[] | undefined;
|
|
@@ -1441,24 +1471,24 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
1441
1471
|
treatConfigHintsAsErrors?: boolean | undefined;
|
|
1442
1472
|
};
|
|
1443
1473
|
rules: {
|
|
1444
|
-
files: import("../types/issues.
|
|
1445
|
-
dependencies: import("../types/issues.
|
|
1446
|
-
devDependencies: import("../types/issues.
|
|
1447
|
-
optionalPeerDependencies: import("../types/issues.
|
|
1448
|
-
unlisted: import("../types/issues.
|
|
1449
|
-
binaries: import("../types/issues.
|
|
1450
|
-
unresolved: import("../types/issues.
|
|
1451
|
-
exports: import("../types/issues.
|
|
1452
|
-
nsExports: import("../types/issues.
|
|
1453
|
-
types: import("../types/issues.
|
|
1454
|
-
nsTypes: import("../types/issues.
|
|
1455
|
-
enumMembers: import("../types/issues.
|
|
1456
|
-
classMembers: import("../types/issues.
|
|
1457
|
-
duplicates: import("../types/issues.
|
|
1458
|
-
catalog: import("../types/issues.
|
|
1459
|
-
_files: import("../types/issues.
|
|
1474
|
+
files: import("../types/issues.ts").IssueSeverity;
|
|
1475
|
+
dependencies: import("../types/issues.ts").IssueSeverity;
|
|
1476
|
+
devDependencies: import("../types/issues.ts").IssueSeverity;
|
|
1477
|
+
optionalPeerDependencies: import("../types/issues.ts").IssueSeverity;
|
|
1478
|
+
unlisted: import("../types/issues.ts").IssueSeverity;
|
|
1479
|
+
binaries: import("../types/issues.ts").IssueSeverity;
|
|
1480
|
+
unresolved: import("../types/issues.ts").IssueSeverity;
|
|
1481
|
+
exports: import("../types/issues.ts").IssueSeverity;
|
|
1482
|
+
nsExports: import("../types/issues.ts").IssueSeverity;
|
|
1483
|
+
types: import("../types/issues.ts").IssueSeverity;
|
|
1484
|
+
nsTypes: import("../types/issues.ts").IssueSeverity;
|
|
1485
|
+
enumMembers: import("../types/issues.ts").IssueSeverity;
|
|
1486
|
+
classMembers: import("../types/issues.ts").IssueSeverity;
|
|
1487
|
+
duplicates: import("../types/issues.ts").IssueSeverity;
|
|
1488
|
+
catalog: import("../types/issues.ts").IssueSeverity;
|
|
1489
|
+
_files: import("../types/issues.ts").IssueSeverity;
|
|
1460
1490
|
};
|
|
1461
|
-
tags: import("../types/options.
|
|
1491
|
+
tags: import("../types/options.ts").Tags;
|
|
1462
1492
|
traceDependency: string | undefined;
|
|
1463
1493
|
traceExport: string | undefined;
|
|
1464
1494
|
traceFile: string | undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { partitionCompilers } from
|
|
2
|
-
import { KNIP_CONFIG_LOCATIONS } from
|
|
3
|
-
import { knipConfigurationSchema } from
|
|
4
|
-
import { getCatalogContainer } from
|
|
5
|
-
import { ConfigurationError } from
|
|
6
|
-
import { findFile, loadJSON } from
|
|
7
|
-
import { getIncludedIssueTypes, shorthandDeps, shorthandExports, shorthandFiles } from
|
|
8
|
-
import { defaultRules } from
|
|
9
|
-
import { loadResolvedConfigFile } from
|
|
10
|
-
import { _load } from
|
|
11
|
-
import { getKeysByValue } from
|
|
12
|
-
import { isAbsolute, join, normalize, toAbsolute, toPosix } from
|
|
13
|
-
import { splitTags } from
|
|
1
|
+
import { partitionCompilers } from "../compilers/index.js";
|
|
2
|
+
import { 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 { getKeysByValue } from "./object.js";
|
|
12
|
+
import { isAbsolute, join, normalize, toAbsolute, toPosix } from "./path.js";
|
|
13
|
+
import { splitTags } from "./tag.js";
|
|
14
14
|
export const createOptions = async (options) => {
|
|
15
15
|
const { args = {} } = options;
|
|
16
16
|
const pcwd = process.cwd();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { WorkspacePackage } from '../types/package-json.
|
|
1
|
+
import type { WorkspacePackage } from '../types/package-json.ts';
|
|
2
2
|
export type WorkspaceGraph = Map<string, Set<string>>;
|
|
3
3
|
export declare function createWorkspaceGraph(cwd: string, wsNames: string[], wsPkgNames: Set<string>, wsPackages: Map<string, WorkspacePackage>): WorkspaceGraph;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join } from
|
|
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,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
|
|
5
|
-
import { isDirectory, isFile } from
|
|
6
|
-
import { timerify } from
|
|
7
|
-
import { dirname, isAbsolute, resolve } from
|
|
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.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const loadFile: (filePath: string) => Promise<string>;
|
|
|
5
5
|
export declare const hasFileWithExtension: (cwd: string, dirName: string, extensions: string[]) => boolean;
|
|
6
6
|
export declare const loadJSON: (filePath: string) => Promise<any>;
|
|
7
7
|
export declare const loadJSONC: (filePath: string) => Promise<any>;
|
|
8
|
-
export declare const loadYAML: (filePath: string) => Promise<
|
|
8
|
+
export declare const loadYAML: (filePath: string) => Promise<any>;
|
|
9
9
|
export declare const loadTOML: (filePath: string) => Promise<import("smol-toml").TomlTable>;
|
|
10
10
|
export declare const parseJSONC: (filePath: string, contents: string) => Promise<any>;
|
|
11
|
-
export declare const parseYAML: (contents: string) =>
|
|
11
|
+
export declare const parseYAML: (contents: string) => any;
|
package/dist/util/fs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { readdirSync, statSync } from 'node:fs';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import
|
|
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
|
|
7
|
-
import { extname, join } from
|
|
6
|
+
import { LoaderError } from "./errors.js";
|
|
7
|
+
import { extname, join } from "./path.js";
|
|
8
8
|
export const isDirectory = (cwdOrPath, name) => {
|
|
9
9
|
try {
|
|
10
10
|
return statSync(name ? join(cwdOrPath, name) : cwdOrPath).isDirectory();
|
|
@@ -77,5 +77,5 @@ export const parseJSONC = async (filePath, contents) => {
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
export const parseYAML = (contents) => {
|
|
80
|
-
return
|
|
80
|
+
return parseYAMLContents(contents, { logLevel: 'error' });
|
|
81
81
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISSUE_TYPES } from
|
|
2
|
-
import { ConfigurationError } from
|
|
1
|
+
import { ISSUE_TYPES } from "../constants.js";
|
|
2
|
+
import { ConfigurationError } from "./errors.js";
|
|
3
3
|
export const defaultExcludedIssueTypes = ['classMembers', '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
package/dist/util/glob-core.js
CHANGED
|
@@ -3,15 +3,14 @@ import { promisify } from 'node:util';
|
|
|
3
3
|
import { walk as _walk } from '@nodelib/fs.walk';
|
|
4
4
|
import fg, {} from 'fast-glob';
|
|
5
5
|
import picomatch from 'picomatch';
|
|
6
|
-
import { GLOBAL_IGNORE_PATTERNS } from
|
|
7
|
-
import { compact, partition } from
|
|
8
|
-
import { debugLogObject } from
|
|
9
|
-
import { isDirectory, isFile } from
|
|
10
|
-
import { timerify } from
|
|
11
|
-
import { parseAndConvertGitignorePatterns } from
|
|
12
|
-
import { dirname, join, relative, toPosix } from
|
|
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
13
|
const walk = promisify(_walk);
|
|
14
|
-
const _picomatch = timerify(picomatch);
|
|
15
14
|
const cachedGitIgnores = new Map();
|
|
16
15
|
const cachedGlobIgnores = new Map();
|
|
17
16
|
const isGitRoot = (dir) => isDirectory(dir, '.git') || isFile(dir, '.git');
|
|
@@ -46,15 +45,23 @@ const findAncestorGitignoreFiles = (cwd) => {
|
|
|
46
45
|
return gitignorePaths;
|
|
47
46
|
};
|
|
48
47
|
export const findAndParseGitignores = async (cwd, workspaceDirs) => {
|
|
49
|
-
const
|
|
50
|
-
const ignores = new Set(init);
|
|
48
|
+
const ignores = new Set(GLOBAL_IGNORE_PATTERNS);
|
|
51
49
|
const unignores = [];
|
|
52
50
|
const gitignoreFiles = [];
|
|
53
51
|
const pmOptions = { ignore: unignores };
|
|
54
52
|
let deepFilterMatcher;
|
|
53
|
+
let prevUnignoreLength = unignores.length;
|
|
54
|
+
const pendingIgnores = [];
|
|
55
55
|
const getMatcher = () => {
|
|
56
|
-
if (!deepFilterMatcher)
|
|
57
|
-
deepFilterMatcher =
|
|
56
|
+
if (!deepFilterMatcher) {
|
|
57
|
+
deepFilterMatcher = picomatch(Array.from(ignores), pmOptions);
|
|
58
|
+
pendingIgnores.length = 0;
|
|
59
|
+
}
|
|
60
|
+
else if (pendingIgnores.length > 0) {
|
|
61
|
+
const prev = deepFilterMatcher;
|
|
62
|
+
const incr = picomatch(pendingIgnores.splice(0), pmOptions);
|
|
63
|
+
deepFilterMatcher = (path) => prev(path) || incr(path);
|
|
64
|
+
}
|
|
58
65
|
return deepFilterMatcher;
|
|
59
66
|
};
|
|
60
67
|
const addFile = (filePath, baseDir) => {
|
|
@@ -62,8 +69,9 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
|
|
|
62
69
|
const dir = baseDir ?? dirname(toPosix(filePath));
|
|
63
70
|
const base = relative(cwd, dir);
|
|
64
71
|
const ancestor = base.startsWith('..') ? `${relative(dir, cwd)}/` : undefined;
|
|
65
|
-
const ignoresForDir = new Set(base === '' ?
|
|
72
|
+
const ignoresForDir = new Set(base === '' ? GLOBAL_IGNORE_PATTERNS : []);
|
|
66
73
|
const unignoresForDir = new Set();
|
|
74
|
+
const prevIgnoreSize = ignores.size;
|
|
67
75
|
const patterns = readFileSync(filePath, 'utf8');
|
|
68
76
|
for (const rule of parseAndConvertGitignorePatterns(patterns, ancestor)) {
|
|
69
77
|
const [pattern, extraPattern] = rule.patterns;
|
|
@@ -113,7 +121,15 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
|
|
|
113
121
|
else {
|
|
114
122
|
cachedGitIgnores.set(cacheDir, { ignores: ignoresForDir, unignores: unignoresForDir });
|
|
115
123
|
}
|
|
116
|
-
|
|
124
|
+
if (unignores.length !== prevUnignoreLength) {
|
|
125
|
+
deepFilterMatcher = undefined;
|
|
126
|
+
prevUnignoreLength = unignores.length;
|
|
127
|
+
}
|
|
128
|
+
else if (ignores.size !== prevIgnoreSize) {
|
|
129
|
+
for (const p of ignoresForDir)
|
|
130
|
+
if (!GLOBAL_IGNORE_PATTERNS.includes(p))
|
|
131
|
+
pendingIgnores.push(p);
|
|
132
|
+
}
|
|
117
133
|
};
|
|
118
134
|
for (const filePath of findAncestorGitignoreFiles(cwd))
|
|
119
135
|
addFile(filePath);
|
|
@@ -144,7 +160,7 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
|
|
|
144
160
|
if (relevantAncestors.has(absPath))
|
|
145
161
|
return true;
|
|
146
162
|
for (const wsDir of nonRootDirs)
|
|
147
|
-
if (absPath.startsWith(wsDir
|
|
163
|
+
if (absPath.startsWith(`${wsDir}/`))
|
|
148
164
|
return true;
|
|
149
165
|
return false;
|
|
150
166
|
};
|
|
@@ -160,8 +176,8 @@ export const findAndParseGitignores = async (cwd, workspaceDirs) => {
|
|
|
160
176
|
const deepFilter = (entry) => (!isRelevantDir || isRelevantDir(toPosix(entry.path))) && !getMatcher()(relative(cwd, entry.path));
|
|
161
177
|
await walk(cwd, {
|
|
162
178
|
concurrency: 16,
|
|
163
|
-
entryFilter
|
|
164
|
-
deepFilter
|
|
179
|
+
entryFilter,
|
|
180
|
+
deepFilter,
|
|
165
181
|
});
|
|
166
182
|
debugLogObject('*', 'Parsed gitignore files', { gitignoreFiles });
|
|
167
183
|
return { gitignoreFiles, ignores, unignores };
|
|
@@ -173,26 +189,21 @@ export async function glob(_patterns, options) {
|
|
|
173
189
|
const hasCache = cachedGlobIgnores.has(options.dir);
|
|
174
190
|
const willCache = !hasCache && options.gitignore && options.label;
|
|
175
191
|
const cachedIgnores = options.gitignore ? cachedGlobIgnores.get(options.dir) : undefined;
|
|
176
|
-
const _ignore = [];
|
|
192
|
+
const _ignore = [...GLOBAL_IGNORE_PATTERNS];
|
|
177
193
|
const [negatedPatterns, patterns] = partition(_patterns, pattern => pattern.startsWith('!'));
|
|
178
|
-
if (options.gitignore) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
_ignore.push(...cacheForDir.ignores);
|
|
186
|
-
}
|
|
187
|
-
dir = dirname((prev = dir));
|
|
188
|
-
if (prev === dir || dir === '.')
|
|
189
|
-
break;
|
|
194
|
+
if (options.gitignore && willCache) {
|
|
195
|
+
let dir = options.dir;
|
|
196
|
+
let prev;
|
|
197
|
+
while (dir) {
|
|
198
|
+
const cacheForDir = cachedGitIgnores.get(dir);
|
|
199
|
+
if (cacheForDir) {
|
|
200
|
+
_ignore.push(...cacheForDir.ignores);
|
|
190
201
|
}
|
|
202
|
+
dir = dirname((prev = dir));
|
|
203
|
+
if (prev === dir || dir === '.')
|
|
204
|
+
break;
|
|
191
205
|
}
|
|
192
206
|
}
|
|
193
|
-
else {
|
|
194
|
-
_ignore.push(...GLOBAL_IGNORE_PATTERNS);
|
|
195
|
-
}
|
|
196
207
|
if (willCache)
|
|
197
208
|
cachedGlobIgnores.set(options.dir, compact(_ignore));
|
|
198
209
|
const ignorePatterns = (cachedIgnores || _ignore).concat(negatedPatterns.map(pattern => pattern.slice(1)));
|
|
@@ -213,7 +224,15 @@ export async function getGitIgnoredHandler(options, workspaceDirs) {
|
|
|
213
224
|
if (options.gitignore === false)
|
|
214
225
|
return () => false;
|
|
215
226
|
const { ignores, unignores } = await _parseFindGitignores(options.cwd, workspaceDirs);
|
|
216
|
-
const matcher =
|
|
217
|
-
const
|
|
218
|
-
|
|
227
|
+
const matcher = picomatch(Array.from(ignores), { ignore: unignores });
|
|
228
|
+
const cache = new Map();
|
|
229
|
+
const isGitIgnored = (filePath) => {
|
|
230
|
+
let result = cache.get(filePath);
|
|
231
|
+
if (result === undefined) {
|
|
232
|
+
result = matcher(relative(options.cwd, filePath));
|
|
233
|
+
cache.set(filePath, result);
|
|
234
|
+
}
|
|
235
|
+
return result;
|
|
236
|
+
};
|
|
237
|
+
return isGitIgnored;
|
|
219
238
|
}
|
package/dist/util/glob.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fg from 'fast-glob';
|
|
2
|
-
import { compact } from
|
|
3
|
-
import { glob } from
|
|
4
|
-
import { timerify } from
|
|
5
|
-
import { isAbsolute, join, relative } from
|
|
2
|
+
import { compact } from "./array.js";
|
|
3
|
+
import { glob } from "./glob-core.js";
|
|
4
|
+
import { timerify } from "./Performance.js";
|
|
5
|
+
import { isAbsolute, join, relative } from "./path.js";
|
|
6
6
|
const prepend = (pattern, relativePath) => isAbsolute(pattern.replace(/^!/, '')) ? pattern : prependDirToPattern(relativePath, pattern);
|
|
7
7
|
const prependDirToPatterns = (cwd, dir, patterns) => {
|
|
8
8
|
const relativePath = relative(cwd, dir);
|
package/dist/util/input.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IssueType } from '../types/issues.
|
|
2
|
-
import type { PluginName } from '../types/PluginNames.
|
|
1
|
+
import type { IssueType } from '../types/issues.ts';
|
|
2
|
+
import type { PluginName } from '../types/PluginNames.ts';
|
|
3
3
|
type InputType = 'binary' | 'entry' | 'project' | 'config' | 'dependency' | 'deferResolve' | 'deferResolveEntry' | 'alias' | 'ignore';
|
|
4
4
|
export interface Input {
|
|
5
5
|
type: InputType;
|