{
  "version": 3,
  "sources": ["../../../../src/packages/plugin-commands-installation/fetch.ts"],
  "sourcesContent": ["import { docsUrl } from '../cli-utils/index.ts';\nimport { UNIVERSAL_OPTIONS } from '../common-cli-options-help/index.ts';\nimport { type Config, getOptionsFromRootManifest } from '../config/index.ts';\nimport {\n  createOrConnectStoreController,\n  type CreateStoreControllerOptions,\n} from '../store-connection-manager/index.ts';\nimport type { LockFileDir, ProjectRootDir } from '../types/index.ts';\nimport renderHelp from 'render-help';\nimport { cliOptionsTypes } from './install.ts';\nimport { mutateModulesInSingleProject } from '../core/install/index.ts';\nimport path from 'node:path';\n\nexport const rcOptionsTypes = cliOptionsTypes;\n\nexport { cliOptionsTypes };\n\nexport const shorthands: Record<string, string> = {\n  D: '--dev',\n  P: '--production',\n};\n\nexport const commandNames = ['fetch'];\n\nexport function help(): string {\n  return renderHelp({\n    description:\n      'Fetch packages from a lockfile into virtual store, package manifest is ignored. WARNING! This is an experimental command. Breaking changes may be introduced in non-major versions of the CLI',\n    descriptionLists: [\n      {\n        title: 'Options',\n\n        list: [\n          {\n            description: 'Only development packages will be fetched',\n            name: '--dev',\n            shortAlias: '-D',\n          },\n          {\n            description: 'Development packages will not be fetched',\n            name: '--prod',\n            shortAlias: '-P',\n          },\n          ...UNIVERSAL_OPTIONS,\n        ],\n      },\n    ],\n    url: docsUrl('fetch'),\n    usages: ['pnpm fetch [--dev | --prod]'],\n  });\n}\n\ntype FetchCommandOptions = Pick<\n  Config,\n  'production' | 'dev' | 'rootProjectManifest' | 'rootProjectManifestDir'\n> &\n  CreateStoreControllerOptions;\n\nexport async function handler(opts: FetchCommandOptions): Promise<void> {\n  const store = await createOrConnectStoreController(opts);\n\n  const include = {\n    dependencies: opts.production !== false,\n    devDependencies: opts.dev !== false,\n    // when including optional deps, production is also required when perform headless install\n    optionalDependencies: opts.production !== false,\n  };\n\n  await mutateModulesInSingleProject(\n    {\n      binsDir: path.join('node_modules', '.bin'),\n      manifest: { name: '', version: '' },\n      update: false,\n      mutation: 'install',\n      pruneDirectDependencies: true,\n      rootDir: process.cwd() as ProjectRootDir,\n    },\n    {\n      bin: path.join('node_modules', '.bin'),\n      lockfileDir: '' as LockFileDir,\n      update: false,\n      ...opts,\n      ...getOptionsFromRootManifest(\n        opts.rootProjectManifestDir,\n        opts.rootProjectManifest\n      ),\n      ignoreScripts: opts.ignoreScripts ?? false,\n      nodeVersion: opts.nodeVersion ?? 'latest',\n      force: opts.force ?? false,\n      engineStrict: opts.engineStrict ?? false,\n      ignorePackageManifest: true,\n      include,\n      modulesCacheMaxAge: 0,\n      pruneStore: true,\n      storeController: store.ctrl,\n      storeDir: store.dir,\n      userAgent: opts.userAgent ?? '',\n      packageExtensions: {},\n      hooks: {},\n      unsafePerm: opts.unsafePerm ?? false,\n      allowNonAppliedPatches: false,\n      resolutionMode: opts.resolutionMode ?? 'highest',\n      ignoredOptionalDependencies: [],\n      resolveSymlinksInInjectedDirs:\n        opts.resolveSymlinksInInjectedDirs ?? false,\n      overrides: {},\n      allowedDeprecatedVersions: {},\n    }\n  );\n}\n"],
  "mappings": "AAAA,SAAS,eAAe;AACxB,SAAS,yBAAyB;AAClC,SAAsB,kCAAkC;AACxD;AAAA,EACE;AAAA,OAEK;AAEP,OAAO,gBAAgB;AACvB,SAAS,uBAAuB;AAChC,SAAS,oCAAoC;AAC7C,OAAO,UAAU;AAEV,MAAM,iBAAiB;AAIvB,MAAM,aAAqC;AAAA,EAChD,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,eAAe,CAAC,OAAO;AAE7B,SAAS,OAAe;AAC7B,SAAO,WAAW;AAAA,IAChB,aACE;AAAA,IACF,kBAAkB;AAAA,MAChB;AAAA,QACE,OAAO;AAAA,QAEP,MAAM;AAAA,UACJ;AAAA,YACE,aAAa;AAAA,YACb,MAAM;AAAA,YACN,YAAY;AAAA,UACd;AAAA,UACA;AAAA,YACE,aAAa;AAAA,YACb,MAAM;AAAA,YACN,YAAY;AAAA,UACd;AAAA,UACA,GAA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