package-management 0.0.2 → 0.0.3

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/index.d.cts CHANGED
@@ -3,6 +3,8 @@ import { Options } from 'execa';
3
3
  import * as async_cache_fn_index from 'async-cache-fn/index';
4
4
  import { InstallPackageOptions as InstallPackageOptions$1 } from '@antfu/install-pkg';
5
5
  import { ResolveOptions } from 'mlly';
6
+ import * as parse_gitignore from 'parse-gitignore';
7
+ import * as WST from 'workspace-tools';
6
8
 
7
9
  type __<T> = {
8
10
  [K in keyof T]: T[K];
@@ -48,12 +50,19 @@ type OmitNever<T> = Omit<T, {
48
50
  type OmitByValue<T, V> = OmitNever<{
49
51
  [K in keyof T]: T[K] extends V ? never : T[K];
50
52
  }>;
53
+ type NoInfer<T> = [T][T extends any ? 0 : never];
51
54
 
52
55
  interface PathOptions {
53
56
  cwd?: string;
54
57
  }
55
58
  type AsyncCacheFn<TReturn = unknown, TOption extends object | undefined = undefined, C extends "required" | "optional" = "optional"> = AsyncCacheFn$1<TReturn, C extends "optional" ? [TOption | undefined] | [] : [TOption]>;
56
59
 
60
+ interface StackFrameOptions {
61
+ rootFunctionName?: string;
62
+ }
63
+ declare const _filename: (options?: StackFrameOptions) => string | undefined;
64
+ declare const _dirname: (options?: StackFrameOptions) => string | undefined;
65
+
57
66
  interface PackageManagerConfig<ID extends string = string> {
58
67
  id: ID;
59
68
  command: string;
@@ -121,6 +130,7 @@ type Module<T = any> = Promise<T>;
121
130
  type ImportCallback<T = any> = () => Module<T>;
122
131
  type ImportMap = Record<string, ImportOption>;
123
132
  type ImportList = ImportOption[];
133
+ type ImportModuleFn = <T = any>(name: string) => ImportModuleData<T>;
124
134
  type ImportOptionData<T extends ImportOption> = ResolvedPromise<ExtractImportOptionModule<T>>;
125
135
  type ResolvedImportMap<$Imports extends ImportMap> = {
126
136
  [P in keyof $Imports]: ImportOptionData<$Imports[P]>;
@@ -129,6 +139,11 @@ type ResolvedImportMapPromise<T extends ImportMap> = Promise<ResolvedImportMap<T
129
139
  type ResolvedImportList<$Imports extends ImportList> = {
130
140
  [P in keyof $Imports]: ImportOptionData<$Imports[P]>;
131
141
  };
142
+ type ResolvedImportListPromise<T extends ImportList> = Promise<ResolvedImportList<T>>;
143
+ type ResolvedImportOption<TOption extends ImportOption> = __<{
144
+ name?: string;
145
+ import: () => ExtractImportOptionModule<TOption>;
146
+ } & Partial<ImportPackageData>>;
132
147
  type ExtractImportOptionModule<TOption> = Extract<TOption extends {
133
148
  import: () => infer I;
134
149
  } ? I : TOption extends () => infer I ? I : TOption extends Module ? TOption : never, Module>;
@@ -261,4 +276,405 @@ declare function definePackageManagerClient(options: DetectPackageManagerOptions
261
276
 
262
277
  declare function isPackageDependency(packageName: string | string[]): boolean;
263
278
 
264
- export { type AsyncCacheFn, type Awaitable, type DefinePackageFn, type DetectPackageManagerOptions, type Entry, type EntryOf, type EnumToLiteral, type FromEntries, type Func, type ImportMapFn, type ImportMapOptions, type ImporterOptions, type InstallPackageOptions, type InstallerFn, type IsExactBoolean, type IsUnion, type KeyOf, type KeyOfValue, type MergeObject, type OmitByValue, type OmitIndexSignature, type OmitNever, type PackageManagerCommandName, type PackageManagerCommandSpec, type PackageManagerCommands, type PackageManagerConfig, type PackageManagerId, type PackageManagerScriptOptions, type PathOptions, type PickByValue, type PickKeyOf, type RequireExactlyOne, type ResolveModulePathOptions, type ResolvedPromise, type Select, type SelectionMap, type StringLiteral, type UninstallPackageOptions, type ValueOf, type __, definePackage, definePackageManagerClient, detectGlobalPackageManagers, detectLockfilePackageManagers, detectPackageManagers, filterPackageManagers, findPackageManager, findPackageManagerSafely, findResolvedModulePath, importMap, importer, isPackageDependency, isPackageModuleFound, packageManagerConfigs, resolveModule, resolveModulePath, resolvePackageModulePath };
279
+ interface AliasDefinition {
280
+ resolve: ResolvePathAliasFn;
281
+ subpaths?: Subpath[] | Readonly<Subpath[]>;
282
+ }
283
+ interface Subpath {
284
+ to: string;
285
+ description?: string;
286
+ }
287
+ type AliasDefinitionMap<TAlias extends string = string> = Record<TAlias, AliasDefinition>;
288
+ type AliasMap<TAliases extends AliasDefinitionMap = AliasDefinitionMap> = {
289
+ [K in keyof TAliases]: TAliases[K]["resolve"];
290
+ } & {
291
+ [K in keyof TAliases as `${Extract<K, string>}/${NonNullable<TAliases[K]["subpaths"]>[number]["to"]}`]: TAliases[K]["resolve"];
292
+ };
293
+ type ResolvePathAliasFn = (opts?: {
294
+ cwd?: string;
295
+ }) => string;
296
+ declare function definePathAliases<const T extends AliasDefinitionMap>(aliasDefinitions: T): {
297
+ aliasDefinitions: T;
298
+ aliasMap: AliasMap<T>;
299
+ getFilePath: <TValidate extends boolean = false, TGlob extends boolean = false>(options: PathTo<Extract<keyof T, string> | Extract<keyof { [K in keyof T as `${Extract<K, string>}/${NonNullable<T[K]["subpaths"]>[number]["to"]}`]: T[K]["resolve"]; }, string>> | GetPathOptions<Extract<keyof T, string> | Extract<keyof { [K in keyof T as `${Extract<K, string>}/${NonNullable<T[K]["subpaths"]>[number]["to"]}`]: T[K]["resolve"]; }, string>, TValidate, TGlob>, aliases?: Record<string, string>) => TValidate extends true ? string | undefined : TGlob extends true ? string | undefined : string;
300
+ };
301
+ type PathTo<TBaseDirAlias extends string = string> = string | [baseDir: TBaseDirAlias, subpath?: string];
302
+ interface GetPathOptions<TAlias extends string, TValidate extends boolean = false, TGlob extends boolean = false> {
303
+ to: PathTo<TAlias>;
304
+ startingFrom?: PathTo<TAlias>;
305
+ cwd?: string;
306
+ checkExistence?: TValidate;
307
+ glob?: TGlob;
308
+ }
309
+ declare function getAliasMap<const T extends AliasDefinitionMap>(aliasDefs: T): AliasMap<T>;
310
+
311
+ /**
312
+ * ### Path Aliases:
313
+ *
314
+ *
315
+ ```jsx
316
+ Notation: <user_home>/Projects/<workspace_folder>/apps/<package_folder>/src/
317
+ ```
318
+
319
+ * - **`<workspace_folder>`**:
320
+ * > Starting from `cwd`, searches up the directory hierarchy for the workspace root, falling back to the git root if no workspace is detected.
321
+ *
322
+ * - **`<workspace_folder?>`**:
323
+ * > Starting from `cwd`, searches up the directory hierarchy for the workspace root, unlike `<workspace_folder>` it will not fallback to the git root if no workspace is detected.
324
+ * > - *Note that the `?` seen in `<workspace_folder?>` indicates that it has no fallback.*
325
+ *
326
+ * - **`<workspace_folder>/node_modules`**:
327
+ * > Subpath for node modules in the workspace folder.
328
+ * > - Example: `<workspace_folder>/node_modules`
329
+ *
330
+ * - **`<package_folder>`**:
331
+ * > Starting from `cwd`, searches up the directory hierarchy for package.json.
332
+ * > - Example: `<workspace_folder>/apps/package-folder`
333
+ *
334
+ * - **`<package_folder>/node_modules`**:
335
+ * > Subpath for node modules in the package folder.
336
+ *
337
+ * - **`<package_folder>/node_modules/.bin`**:
338
+ * > Subpath for executable scripts in the package folder.
339
+ *
340
+ * - **`<user_home>`**:
341
+ * > Path to the current user's home directory.
342
+ * > - Example: `/Users/username`
343
+ *
344
+ * - **`<user_tmpdir>`**:
345
+ * > Path to the OS tmpdir folder.
346
+ * > - Example: `/var/folders/vb/62qmb9fj2qsxcwhr8tb16krrw0000gn/T`
347
+ *
348
+ * - **`<cwd>`**:
349
+ * > Path to the current working directory.
350
+ *
351
+ * - **`<current_file>`**:
352
+ * > Path to the current file.
353
+ * > - Example: `/Users/username/Projects/monorepo/package-folder/src/utils/getPath.ts`
354
+ *
355
+ * - **`<current-folder>`**:
356
+ * > Path to the current folder.
357
+ * > - Example: `/Users/username/Projects/monorepo/package-folder/src/utils`
358
+ */
359
+ declare const getPath: <TValidate extends boolean = false, TGlob extends boolean = false>(options: PathTo<"<workspace_folder>" | "<workspace_folder?>" | "<package_folder>" | "<gitroot_folder>" | "<user_home>" | "<user_tmpdir>" | "<cwd>" | "<current_file>" | "<current_folder>" | `<user_home>/${any}` | `<user_tmpdir>/${any}` | `<cwd>/${any}` | `<current_file>/${any}` | `<current_folder>/${any}` | "<workspace_folder>/node_modules" | "<workspace_folder>/node_modules/.bin" | "<workspace_folder?>/node_modules" | "<workspace_folder?>/node_modules/.bin" | "<package_folder>/node_modules" | "<package_folder>/node_modules/.bin" | "<package_folder>/src" | "<gitroot_folder>/node_modules" | "<gitroot_folder>/node_modules/.bin" | "<gitroot_folder>/.vscode"> | GetPathOptions<"<workspace_folder>" | "<workspace_folder?>" | "<package_folder>" | "<gitroot_folder>" | "<user_home>" | "<user_tmpdir>" | "<cwd>" | "<current_file>" | "<current_folder>" | `<user_home>/${any}` | `<user_tmpdir>/${any}` | `<cwd>/${any}` | `<current_file>/${any}` | `<current_folder>/${any}` | "<workspace_folder>/node_modules" | "<workspace_folder>/node_modules/.bin" | "<workspace_folder?>/node_modules" | "<workspace_folder?>/node_modules/.bin" | "<package_folder>/node_modules" | "<package_folder>/node_modules/.bin" | "<package_folder>/src" | "<gitroot_folder>/node_modules" | "<gitroot_folder>/node_modules/.bin" | "<gitroot_folder>/.vscode", TValidate, TGlob>, aliases?: Record<string, string> | undefined) => TValidate extends true ? string | undefined : TGlob extends true ? string | undefined : string;
360
+
361
+ type PathAlias = keyof PredefinedPathAliases;
362
+ type PickPathAlias<K extends PathAlias> = K;
363
+ type PredefinedPathAliases = typeof predefinedPathAliases;
364
+ declare const predefinedPathAliases: {
365
+ readonly "<workspace_folder>": {
366
+ readonly resolve: (opts: {
367
+ cwd?: string | undefined;
368
+ } | undefined) => string;
369
+ readonly subpaths: [{
370
+ readonly to: "node_modules";
371
+ }, {
372
+ readonly to: "node_modules/.bin";
373
+ }];
374
+ };
375
+ readonly "<workspace_folder?>": {
376
+ readonly resolve: (opts: {
377
+ cwd?: string | undefined;
378
+ } | undefined) => string;
379
+ readonly subpaths: [{
380
+ readonly to: "node_modules";
381
+ }, {
382
+ readonly to: "node_modules/.bin";
383
+ }];
384
+ };
385
+ readonly "<package_folder>": {
386
+ readonly resolve: (opts: {
387
+ cwd?: string | undefined;
388
+ } | undefined) => string;
389
+ readonly subpaths: [{
390
+ readonly to: "node_modules";
391
+ }, {
392
+ readonly to: "node_modules/.bin";
393
+ }, {
394
+ readonly to: "src";
395
+ }];
396
+ };
397
+ readonly "<gitroot_folder>": {
398
+ readonly resolve: (opts: {
399
+ cwd?: string | undefined;
400
+ } | undefined) => string;
401
+ readonly subpaths: [{
402
+ readonly to: "node_modules";
403
+ }, {
404
+ readonly to: "node_modules/.bin";
405
+ }, {
406
+ readonly to: ".vscode";
407
+ }];
408
+ };
409
+ readonly "<user_home>": {
410
+ readonly resolve: () => string;
411
+ readonly subpaths: any[];
412
+ };
413
+ readonly "<user_tmpdir>": {
414
+ readonly resolve: () => string;
415
+ readonly subpaths: any[];
416
+ };
417
+ readonly "<cwd>": {
418
+ readonly resolve: () => string;
419
+ readonly subpaths: any[];
420
+ };
421
+ readonly "<current_file>": {
422
+ readonly resolve: () => string;
423
+ readonly subpaths: any[];
424
+ };
425
+ readonly "<current_folder>": {
426
+ readonly resolve: () => string;
427
+ readonly subpaths: any[];
428
+ };
429
+ };
430
+
431
+ type PackageName = string;
432
+ interface PackageInfo {
433
+ name: PackageName;
434
+ dirpath: string;
435
+ path: string;
436
+ packageJson: PackageJson;
437
+ }
438
+ type PackageInfoMap = Record<PackageName, PackageInfo>;
439
+ interface PackageDependencyItem {
440
+ name: string;
441
+ type: PackageDependencyType;
442
+ version: string;
443
+ }
444
+ type PackageDependencyType = "dependency" | "devDependency" | "peerDependency" | "optionalDependency";
445
+ interface PackageJson {
446
+ /**
447
+ * The name is what your thing is called.
448
+ * Some rules:
449
+
450
+ - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
451
+ - The name can’t start with a dot or an underscore.
452
+ - New packages must not have uppercase letters in the name.
453
+ - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
454
+
455
+ */
456
+ name: PackageName;
457
+ /**
458
+ * Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
459
+ */
460
+ version?: string;
461
+ /**
462
+ * Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
463
+ */
464
+ description?: string;
465
+ /**
466
+ * Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
467
+ */
468
+ keywords?: string[];
469
+ /**
470
+ * The url to the project homepage.
471
+ */
472
+ homepage?: string;
473
+ /**
474
+ * The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
475
+ */
476
+ bugs?: string | {
477
+ url?: string;
478
+ email?: string;
479
+ };
480
+ /**
481
+ * You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
482
+ */
483
+ license?: string;
484
+ /**
485
+ * Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
486
+ * For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
487
+ */
488
+ repository?: string | {
489
+ type: string;
490
+ url: string;
491
+ /**
492
+ * If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
493
+ */
494
+ directory?: string;
495
+ };
496
+ scripts?: Record<string, string>;
497
+ /**
498
+ * If you set `"private": true` in your package.json, then npm will refuse to publish it.
499
+ */
500
+ private?: boolean;
501
+ /**
502
+ * The “author” is one person.
503
+ */
504
+ author?: PackageJsonPerson;
505
+ /**
506
+ * “contributors” is an array of people.
507
+ */
508
+ contributors?: PackageJsonPerson[];
509
+ /**
510
+ * The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
511
+ */
512
+ files?: string[];
513
+ /**
514
+ * The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
515
+ * This should be a module ID relative to the root of your package folder.
516
+ * For most modules, it makes the most sense to have a main script and often not much else.
517
+ */
518
+ main?: string;
519
+ /**
520
+ * If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
521
+ */
522
+ browser?: string;
523
+ /**
524
+ * A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
525
+ */
526
+ bin?: string | Record<string, string>;
527
+ /**
528
+ * Specify either a single file or an array of filenames to put in place for the `man` program to find.
529
+ */
530
+ man?: string | string[];
531
+ /**
532
+ * Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
533
+ */
534
+ dependencies?: Record<string, string>;
535
+ /**
536
+ * If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
537
+ * In this case, it’s best to map these additional items in a `devDependencies` object.
538
+ */
539
+ devDependencies?: Record<string, string>;
540
+ /**
541
+ * If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
542
+ */
543
+ optionalDependencies?: Record<string, string>;
544
+ /**
545
+ * In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
546
+ */
547
+ peerDependencies?: Record<string, string>;
548
+ /**
549
+ * TypeScript typings, typically ending by .d.ts
550
+ */
551
+ types?: string;
552
+ typings?: string;
553
+ /**
554
+ * Non-Standard Node.js alternate entry-point to main.
555
+ * An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
556
+ */
557
+ module?: string;
558
+ /**
559
+ * Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
560
+ *
561
+ * Docs:
562
+ * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
563
+ *
564
+ * @default 'commonjs'
565
+ * @since Node.js v14
566
+ */
567
+ type?: "module" | "commonjs";
568
+ /**
569
+ * Alternate and extensible alternative to "main" entry point.
570
+ *
571
+ * When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
572
+ *
573
+ * Docs:
574
+ * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
575
+ *
576
+ * @default 'commonjs'
577
+ * @since Node.js v14
578
+ */
579
+ exports?: string | Record<"import" | "require" | "." | "node" | "browser" | string, string | Record<"import" | "require" | string, string>>;
580
+ workspaces?: string[];
581
+ [key: string]: any;
582
+ }
583
+ /**
584
+ * A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
585
+ */
586
+ type PackageJsonPerson = string | {
587
+ name: string;
588
+ email?: string;
589
+ url?: string;
590
+ };
591
+
592
+ interface FindDependencyInPackageJsonOptions {
593
+ name: string;
594
+ type?: PackageDependencyType | AllowedDependencyTypesOption;
595
+ }
596
+ type AllowedDependencyTypesOption = SelectionMap<Record<PackageDependencyType, any>>;
597
+
598
+ type ProjectFolderTypeOption = WorkspaceFolderTypeOption | PackageFolderTypeOption | GitRootFolderTypeOption | PackageNameFolderTypeOption;
599
+ type PackageFolderTypeOption = PickPathAlias<"<package_folder>">;
600
+ type GitRootFolderTypeOption = PickPathAlias<"<gitroot_folder>">;
601
+ type PackageNameFolderTypeOption = RequireExactlyOne<{
602
+ packageName: PackageName;
603
+ }>;
604
+ type WorkspaceFolderTypeOption = PickPathAlias<"<workspace_folder>"> | RequireExactlyOne<{
605
+ "<workspace_folder>": Pick<GetWorkspaceFolderOptions, "fallbackToGitRoot" | "throwIfNotFound">;
606
+ }>;
607
+
608
+ declare function getFolderByPackageName(name: PackageName, options?: PathOptions): string | undefined;
609
+
610
+ declare function getGitRootFolder(options?: PathOptions): string | undefined;
611
+
612
+ /**
613
+ *
614
+ * Finds the nearest `package.json` directory, starting from `cwd`
615
+ *
616
+ */
617
+ declare function getPackageFolder(options?: {
618
+ cwd?: string;
619
+ }): string;
620
+
621
+ interface GetWorkspaceFolderOptions<$Validate extends boolean = true> extends PathOptions {
622
+ /** @default true */
623
+ fallbackToGitRoot?: boolean;
624
+ /** @default true */
625
+ throwIfNotFound?: $Validate;
626
+ }
627
+ /**
628
+ * Starting from cwd, searches up the directory hierarchy for the workspace root,
629
+ * falling back to the git root if no workspace is detected.
630
+ */
631
+ declare function getWorkspaceFolder<$ThrowIfNotFound extends boolean = true>(options?: GetWorkspaceFolderOptions<$ThrowIfNotFound>): $ThrowIfNotFound extends true ? string : string | undefined;
632
+
633
+ declare function getWorkspacePackageInfoMap(options?: PathOptions & {
634
+ includeRoot?: boolean;
635
+ }): PackageInfoMap;
636
+
637
+ interface GetPackageInfoListOptions {
638
+ cwd?: string;
639
+ includeRoot?: boolean;
640
+ }
641
+ declare function getWorkspacePackageInfoList(options?: GetPackageInfoListOptions): (PackageInfo | {
642
+ name: string;
643
+ path: string;
644
+ packageJson: WST.PackageInfo;
645
+ })[];
646
+
647
+ declare function getWorkspacePackageNames(options?: GetPackageInfoListOptions): string[];
648
+
649
+ declare const workspace: {
650
+ packageNames: typeof getWorkspacePackageNames;
651
+ packageGraph: typeof getWorkspacePackageInfoMap;
652
+ packageList: typeof getWorkspacePackageInfoList;
653
+ workspaceRootDir: typeof getWorkspaceFolder;
654
+ getProject: (source: ProjectFolderTypeOption, options?: PathOptions | undefined) => {
655
+ packageJson: PackageJson | undefined;
656
+ packageJsonPath: string | undefined;
657
+ packageName: string | undefined;
658
+ projectDir: string | undefined;
659
+ findPackageManager: async_cache_fn_index.AsyncCacheFn<PackageManager<"pnpm" | "yarn" | "bun" | "npm">, [options?: DetectPackageManagerOptions | undefined]>;
660
+ detectPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"pnpm" | "yarn" | "bun" | "npm">[], [options?: DetectPackageManagerOptions | undefined]>;
661
+ detectGlobalPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"pnpm" | "yarn" | "bun" | "npm">[], [options?: DetectPackageManagerOptions | undefined]>;
662
+ detectLockfilePackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"pnpm" | "yarn" | "bun" | "npm">[], [options?: DetectPackageManagerOptions | undefined]>;
663
+ tsconfig: {
664
+ readonly paths: string[];
665
+ };
666
+ gitignore: {
667
+ readonly data: parse_gitignore.ParsedGitignoreObject;
668
+ readonly patterns: string[];
669
+ };
670
+ filterPackageManagers: (filterFn: (packageManager: PackageManager<"pnpm" | "yarn" | "bun" | "npm">) => boolean | Promise<boolean>, options?: DetectPackageManagerOptions | undefined) => Promise<PackageManager<"pnpm" | "yarn" | "bun" | "npm">[]>;
671
+ getPackageJson: () => PackageJson;
672
+ findDependencyInPackageJson: (options: string | FindDependencyInPackageJsonOptions) => {
673
+ firstMatch: PackageDependencyItem | undefined;
674
+ matches: PackageDependencyItem[];
675
+ } | undefined;
676
+ isDependencyInPackageJson: (options: string | FindDependencyInPackageJsonOptions) => boolean;
677
+ };
678
+ };
679
+
680
+ export { type AliasDefinition, type AliasDefinitionMap, type AliasMap, type AsyncCacheFn, type Awaitable, type DefinePackageFn, type DetectPackageManagerOptions, type Entry, type EntryOf, type EnumToLiteral, type ExtractImportOptionModule, type FromEntries, type Func, type GetPathOptions, type GetWorkspaceFolderOptions, type ImportCallback, type ImportList, type ImportMap, type ImportMapFn, type ImportMapOptions, type ImportModuleData, type ImportModuleFn, type ImportOption, type ImportOptionData, type ImportPackageData, type ImporterOptions, type InstallPackageOptions, type InstallerFn, type IsExactBoolean, type IsUnion, type KeyOf, type KeyOfValue, type MergeObject, type Module, type NoInfer, type OmitByValue, type OmitIndexSignature, type OmitNever, type PackageManagerCommandName, type PackageManagerCommandSpec, type PackageManagerCommands, type PackageManagerConfig, type PackageManagerId, type PackageManagerScriptOptions, type PathAlias, type PathOptions, type PathTo, type PickByValue, type PickKeyOf, type PickPathAlias, type PredefinedPathAliases, type RequireExactlyOne, type ResolveModulePathOptions, type ResolvedImportList, type ResolvedImportListPromise, type ResolvedImportMap, type ResolvedImportMapPromise, type ResolvedImportOption, type ResolvedPromise, type Select, type SelectionMap, type StringLiteral, type UninstallPackageOptions, type ValueOf, type __, _dirname, _filename, definePackage, definePackageManagerClient, definePathAliases, detectGlobalPackageManagers, detectLockfilePackageManagers, detectPackageManagers, filterPackageManagers, findPackageManager, findPackageManagerSafely, findResolvedModulePath, getAliasMap, getFolderByPackageName, getGitRootFolder, getPackageFolder, getPath, getWorkspaceFolder, importMap, importer, isPackageDependency, isPackageModuleFound, packageManagerConfigs, predefinedPathAliases, resolveModule, resolveModulePath, resolvePackageModulePath, workspace };