{
  "version": 3,
  "sources": ["../../../../src/packages/plugin-commands-listing/why.ts"],
  "sourcesContent": ["import { docsUrl } from '../cli-utils/index.ts';\nimport {\n  FILTERING,\n  OPTIONS,\n  UNIVERSAL_OPTIONS,\n} from '../common-cli-options-help/index.ts';\nimport { types as allTypes } from '../config/index.ts';\nimport { PnpmError } from '../error/index.ts';\nimport pick from 'ramda/src/pick';\nimport renderHelp from 'render-help';\nimport { handler as list, type ListCommandOptions } from './list.ts';\n\nexport function rcOptionsTypes(): Record<string, unknown> {\n  return pick.default(\n    [\n      'depth',\n      'dev',\n      'global-dir',\n      'global',\n      'json',\n      'long',\n      'only',\n      'optional',\n      'parseable',\n      'production',\n    ],\n    allTypes\n  );\n}\n\nexport const cliOptionsTypes = (): Record<string, unknown> => ({\n  ...rcOptionsTypes(),\n  recursive: Boolean,\n});\n\nexport const shorthands: Record<string, string> = {\n  D: '--dev',\n  P: '--production',\n};\n\nexport const commandNames = ['why'];\n\nexport function help(): string {\n  return renderHelp({\n    description: `Shows the packages that depend on <pkg>\nFor example: pnpm why babel-* eslint-*`,\n    descriptionLists: [\n      {\n        title: 'Options',\n\n        list: [\n          {\n            description:\n              'Perform command on every package in subdirectories \\\nor on every workspace package, when executed inside a workspace. \\\nFor options that may be used with `-r`, see \"pnpm help recursive\"',\n            name: '--recursive',\n            shortAlias: '-r',\n          },\n          {\n            description: 'Show extended information',\n            name: '--long',\n          },\n          {\n            description: 'Show parseable output instead of tree view',\n            name: '--parseable',\n          },\n          {\n            description: 'Show information in JSON format',\n            name: '--json',\n          },\n          {\n            description:\n              'List packages in the global install prefix instead of in the current project',\n            name: '--global',\n            shortAlias: '-g',\n          },\n          {\n            description:\n              'Display only the dependency graph for packages in `dependencies` and `optionalDependencies`',\n            name: '--prod',\n            shortAlias: '-P',\n          },\n          {\n            description:\n              'Display only the dependency graph for packages in `devDependencies`',\n            name: '--dev',\n            shortAlias: '-D',\n          },\n          {\n            description: \"Don't display packages from `optionalDependencies`\",\n            name: '--no-optional',\n          },\n          {\n            name: '--depth <number>',\n            description: 'Max display depth of the dependency graph',\n          },\n          OPTIONS.globalDir,\n          ...UNIVERSAL_OPTIONS,\n        ],\n      },\n      FILTERING,\n    ],\n    url: docsUrl('why'),\n    usages: ['pnpm why <pkg> ...'],\n  });\n}\n\nexport async function handler(\n  opts: ListCommandOptions,\n  params: string[]\n): Promise<string> {\n  if (params.length === 0) {\n    throw new PnpmError(\n      'MISSING_PACKAGE_NAME',\n      '`pnpm why` requires the package name'\n    );\n  }\n\n  return list(\n    {\n      ...opts,\n      cliOptions: {\n        ...(opts.cliOptions ?? {}),\n        depth: opts.depth ?? Number.POSITIVE_INFINITY,\n      },\n    },\n    params\n  );\n}\n"],
  "mappings": "AAAA,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,gBAAgB;AAClC,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,SAAS,WAAW,YAAqC;AAElD,SAAS,iBAA0C;AACxD,SAAO,KAAK;AAAA,IACV;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,kBAAkB,OAAgC;AAAA,EAC7D,GAAG,eAAe;AAAA,EAClB,WAAW;AACb;AAEO,MAAM,aAAqC;AAAA,EAChD,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,eAAe,CAAC,KAAK;AAE3B,SAAS,OAAe;AAC7B,SAAO,WAAW;AAAA,IAChB,aAAa;AAAA;AAAA,IAEb,kBAAkB;AAAA,MAChB;AAAA,QACE,OAAO;AAAA,QAEP,MAAM;AAAA,UACJ;AAAA,YACE,aACE;AAAA,YAGF,MAAM;AAAA,YACN,YAAY;AAAA,UACd;AAAA,UACA;AAAA,YACE,aAAa;AAAA,YACb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