package-management 0.0.0-dev.1

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.
@@ -0,0 +1,844 @@
1
+ import { Split } from 'string-ts';
2
+ import { AsyncCacheFn as AsyncCacheFn$1 } from 'async-cache-fn';
3
+ import { Options } from 'execa';
4
+ import * as async_cache_fn_index from 'async-cache-fn/index';
5
+ import { InstallPackageOptions as InstallPackageOptions$1 } from '@antfu/install-pkg';
6
+ import { ResolveOptions } from 'mlly';
7
+ import * as parse_gitignore from 'parse-gitignore';
8
+ import * as WST from 'workspace-tools';
9
+ import { ModificationOptions } from 'jsonc-parser';
10
+ import { Storage, StorageValue, TransactionOptions, Snapshot } from 'unstorage';
11
+ import { FSStorageOptions } from 'unstorage/drivers/fs-lite';
12
+
13
+ type Equals<A1 extends any, A2 extends any> = (<A>() => A extends A2 ? 1 : 0) extends <A>() => A extends A1 ? 1 : 0 ? 1 : 0;
14
+ type Cast<A1 extends any, A2 extends any> = A1 extends A2 ? A1 : A2;
15
+ type __<T> = {
16
+ [K in keyof T]: T[K];
17
+ } & {};
18
+ type Prettify<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
21
+ type ValueOf<T> = T[keyof T];
22
+ type EnumToLiteral<T extends string | number> = T extends string ? `${T}` : `${T}` extends `${infer N extends number}` ? N : never;
23
+ type IsUnknown<t> = unknown extends t ? [t] extends [{}] ? false : true : false;
24
+ type AnyFunction = (...args: any[]) => any;
25
+ type StringLiteral<T extends string> = T | (string & {});
26
+ type Awaitable<T> = T | Promise<T>;
27
+ type ResolvedPromise<T> = T extends Promise<infer U> ? U : never;
28
+ type KeyOf<T, K> = K extends keyof T ? K : never;
29
+ type ValueKeyOf<T, K> = T[KeyOf<T, K>];
30
+ type ValueAtPath<T, $dot_path extends string> = ValueKeyOfDeep<Extract<T, object>, Split<$dot_path, ".">>;
31
+ type ValueKeyOfDeep<T, $path extends PropertyKey[]> = $path extends [
32
+ infer K,
33
+ ...infer $Path
34
+ ] ? ValueKeyOfDeep<ValueKeyOf<T, K>, Extract<$Path, PropertyKey[]>> : T;
35
+ type PickKeyOf<T, K extends keyof T> = K extends keyof T ? K : never;
36
+ type SelectionMap<T> = __<{
37
+ [K in keyof T]?: boolean;
38
+ }>;
39
+ type PickByValue<T, V> = {
40
+ [K in keyof T as T[K] extends V ? K : never]: T[K];
41
+ };
42
+ type Entry<key extends PropertyKey = PropertyKey, value = unknown> = readonly [key: key, value: value];
43
+ type EntryOf<O> = {
44
+ [k in keyof O]-?: [k, O[k] & ({} | null)];
45
+ }[O extends readonly unknown[] ? keyof O & number : keyof O] & unknown;
46
+ type FromEntries<entries extends readonly Entry[]> = {
47
+ [entry in entries[number] as entry[0]]: entry[1];
48
+ };
49
+ type IsExactBoolean<T> = Equals<T, boolean> extends 1 ? true : false;
50
+ type UnionizedSelectionMap<T, TSelection extends SelectionMap<T>, V> = __<V & {
51
+ [K in keyof T as IsExactBoolean<TSelection[K]> extends true ? K : never]?: T[K];
52
+ }>;
53
+ type Select<T, TSelection extends SelectionMap<T>, TMode extends "true:pick" | "true:omit"> = __<UnionizedSelectionMap<T, TSelection, TMode extends "true:pick" ? Pick<T, KeyOf<T, keyof PickByValue<TSelection, true>>> : Omit<T, KeyOf<T, keyof PickByValue<TSelection, true>>>>>;
54
+ type IsUnion<T, U = T> = T extends U ? [U] extends [T] ? false : true : never;
55
+ type MergeObject<T extends object, O extends object | unknown = unknown> = __<T & (O extends object ? O : Record<never, never>)>;
56
+ type OmitIndexSignature<ObjectType> = {
57
+ [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType];
58
+ };
59
+ type RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = {
60
+ [Key in KeysType]: Required<Pick<ObjectType, Key>> & Partial<Record<Exclude<KeysType, Key>, never>>;
61
+ }[KeysType] & Omit<ObjectType, KeysType>;
62
+ type OmitNever<T> = Omit<T, {
63
+ [K in keyof T]: T[K] extends never ? K : never;
64
+ }[keyof T]> & {};
65
+ type OmitByValue<T, V> = OmitNever<{
66
+ [K in keyof T]: T[K] extends V ? never : T[K];
67
+ }>;
68
+ type NoInfer<T> = [T][T extends any ? 0 : never];
69
+ type SingleProp<$key, $value> = Prettify<FromEntries<[[key: $key & PropertyKey, value: $value]]>>;
70
+
71
+ interface PathOptions {
72
+ cwd?: string;
73
+ }
74
+ type AsyncCacheFn<TReturn = unknown, TOption extends object | undefined = undefined, C extends "required" | "optional" = "optional"> = AsyncCacheFn$1<TReturn, C extends "optional" ? [TOption | undefined] | [] : [TOption]>;
75
+ type CheckResult<$data, $error = Error, $data_key extends string = "data", $error_key extends string = "error"> = Prettify<RequireExactlyOne<SingleProp<$data_key, $data> & SingleProp<$error_key, $error>>>;
76
+
77
+ interface StackFrameOptions {
78
+ rootFunctionName?: string;
79
+ }
80
+ declare const _filename: (options?: StackFrameOptions) => string | undefined;
81
+ declare const _dirname: (options?: StackFrameOptions) => string | undefined;
82
+
83
+ interface PackageManagerConfig<ID extends string = string> {
84
+ id: ID;
85
+ command: string;
86
+ name: string;
87
+ meta: {
88
+ lockfile: string | string[];
89
+ };
90
+ runner: string;
91
+ args: {
92
+ install: {
93
+ command: string;
94
+ options: {
95
+ preferOffline: string;
96
+ dev: string;
97
+ };
98
+ };
99
+ uninstall: {
100
+ command: string;
101
+ };
102
+ };
103
+ options: {
104
+ version: string;
105
+ };
106
+ }
107
+ type InstallPackageOptions = PackageManagerScriptOptions<"install">;
108
+ type UninstallPackageOptions = PackageManagerScriptOptions<"uninstall">;
109
+ type PackageManagerCommands = PackageManagerConfig["args"];
110
+ type PackageManagerCommandName = keyof PackageManagerCommands;
111
+ type PackageManagerCommandSpec<K> = ValueKeyOf<PackageManagerCommands, K> extends {
112
+ options: infer O;
113
+ } ? SelectionMap<O> : Record<never, never>;
114
+ type PackageManagerScriptOptions<K extends PackageManagerCommandName | undefined = undefined> = __<{
115
+ cwd?: string;
116
+ silent?: boolean;
117
+ shellOptions?: Options;
118
+ } & PackageManagerCommandSpec<K>>;
119
+
120
+ interface ImportModuleData<T = any> {
121
+ /**
122
+ * The name of the package to import. This should match the name used in the import statement.
123
+ */
124
+ name: string;
125
+ /**
126
+ * A callback which returns a module import statement
127
+ */
128
+ import: ImportCallback<T>;
129
+ }
130
+ interface ImportPackageData<T = any> extends ImportModuleData<T> {
131
+ /**
132
+ * When enabled, the package will be installed if it is not found
133
+ * @default true
134
+ */
135
+ install?: boolean;
136
+ /**
137
+ * When enabled, the package will be installed as a dev dependency
138
+ */
139
+ dev?: boolean;
140
+ /**
141
+ * Additional installation options
142
+ */
143
+ installOptions?: Omit<InstallPackageOptions$1, "dev">;
144
+ }
145
+ type ImportOption<T = any> = Module | ImportCallback<T> | ImportModuleData<T> | ImportPackageData<T>;
146
+ type Module<T = any> = Promise<T>;
147
+ type ImportCallback<T = any> = () => Module<T>;
148
+ type ImportMap = Record<string, ImportOption>;
149
+ type ImportList = ImportOption[];
150
+ type ImportModuleFn = <T = any>(name: string) => ImportModuleData<T>;
151
+ type ImportOptionData<T extends ImportOption> = ResolvedPromise<ExtractImportOptionModule<T>>;
152
+ type ResolvedImportMap<$Imports extends ImportMap> = {
153
+ [P in keyof $Imports]: ImportOptionData<$Imports[P]>;
154
+ };
155
+ type ResolvedImportMapPromise<T extends ImportMap> = Promise<ResolvedImportMap<T>>;
156
+ type ResolvedImportList<$Imports extends ImportList> = {
157
+ [P in keyof $Imports]: ImportOptionData<$Imports[P]>;
158
+ };
159
+ type ResolvedImportListPromise<T extends ImportList> = Promise<ResolvedImportList<T>>;
160
+ type ResolvedImportOption<TOption extends ImportOption> = __<{
161
+ name?: string;
162
+ import: () => ExtractImportOptionModule<TOption>;
163
+ } & Partial<ImportPackageData>>;
164
+ type ExtractImportOptionModule<TOption> = Extract<TOption extends {
165
+ import: () => infer I;
166
+ } ? I : TOption extends () => infer I ? I : TOption extends Module ? TOption : never, Module>;
167
+
168
+ interface ImporterOptions {
169
+ /**
170
+ * When enabled, the default behavior is to install packages that are not found if the name is provided.
171
+ * @default true
172
+ */
173
+ install?: boolean;
174
+ installer?: InstallerFn;
175
+ }
176
+ /**
177
+ * Dynamically imports modules and returns their exports in a tuple.
178
+ * This function ensures type safety and maintains the order of imports.
179
+ *
180
+ * @param imports An array of dynamic import promises.
181
+ * @returns A promise that resolves to a tuple containing the default exports of the imported modules.
182
+ *
183
+ * @example
184
+ * ```typescript
185
+ * // Usage example with dynamic imports
186
+ * const [package1, package2] = await importer([
187
+ * import('@antfu/eslint-config'),
188
+ * import('@antfu/install-pkg')
189
+ * ]);
190
+ *
191
+ * // package1 and package2 will be the default exports of the respective modules
192
+ * ```
193
+ *
194
+ * @typeparam Imports An array type representing the dynamic imports.
195
+ */
196
+ declare function importer<T extends ImportList>(imports: [...T], options?: ImporterOptions): Promise<ResolvedImportList<T>>;
197
+ type DefinePackageFn = <T = any>(options: __<string | Pick<ImportPackageData, "name" | "dev">>) => ImportPackageData<T>;
198
+ declare const definePackage: DefinePackageFn;
199
+ type InstallerFn = (packageName: string | string[], options?: {
200
+ dev?: boolean;
201
+ checkExists?: boolean;
202
+ }) => Promise<void>;
203
+
204
+ interface ImportMapOptions extends ImporterOptions {
205
+ }
206
+ type ImportMapFn = <T extends ImportMap>(importMap: T, options?: ImportMapOptions) => ResolvedImportMapPromise<T>;
207
+ /**
208
+ * Asynchronously imports modules from a record of dynamic import promises.
209
+ * Returns a promise that resolves to a record with the same keys, each mapped to the resolved import.
210
+ * This function maintains the key-value mapping and ensures type safety.
211
+ *
212
+ * @param importMap A record where each key is associated with a dynamic import promise.
213
+ * @returns A promise that resolves to a record containing the default exports of the imported modules,
214
+ * maintaining the original key structure.
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * // Usage example with a record of dynamic imports
219
+ *
220
+ * const { package1, package2 } = await importMap({
221
+ * package1: import('package-1'),
222
+ * package2: import('package-2')
223
+ * });
224
+ *
225
+ * // importedModules.config and importedModules.pkg will be the default exports of the respective modules
226
+ * ```
227
+ *
228
+ */
229
+ declare const importMap: ImportMapFn;
230
+
231
+ declare function resolveModule<T>(module: Awaitable<T>): Promise<T extends {
232
+ default: infer U;
233
+ } ? U : T>;
234
+ interface ResolveModulePathOptions extends Omit<ResolveOptions, "url"> {
235
+ paths?: string | URL | (string | URL)[];
236
+ normalize?: ((path: string) => string) | boolean;
237
+ }
238
+ declare function isPackageModuleFound(name: string, options?: ResolveModulePathOptions): boolean;
239
+ declare function resolvePackageModulePath(name: string, options?: ResolveModulePathOptions): string | undefined;
240
+ declare function findResolvedModulePath(paths: string[], options?: ResolveModulePathOptions): string | undefined;
241
+ declare function resolveModulePath(modulePath: string, options?: ResolveModulePathOptions): string | undefined;
242
+
243
+ type PackageManagers = PackageManager<PackageManagerId>[];
244
+ interface PackageManager<ID extends string = PackageManagerId> {
245
+ id: ID;
246
+ config: PackageManagerConfig;
247
+ findLockfilePath: AsyncCacheFn<string | undefined, {
248
+ cwd?: string;
249
+ }>;
250
+ hasLockfile: AsyncCacheFn<boolean, {
251
+ cwd?: string;
252
+ }>;
253
+ readLockfile: AsyncCacheFn<string | undefined, {
254
+ cwd?: string;
255
+ }>;
256
+ globalVersion: AsyncCacheFn<string | undefined, PackageManagerScriptOptions>;
257
+ definePackage: DefinePackageFn;
258
+ defineImportMap: <T extends ImportMap>(importMap: T, options?: {
259
+ /**
260
+ * When enabled, the default behavior is to install packages that are not found.
261
+ * @default true
262
+ */
263
+ install?: boolean;
264
+ }) => ResolvedImportMapPromise<T>;
265
+ uninstallPackage: (packageNames: string | string[], options?: UninstallPackageOptions) => Promise<void>;
266
+ installPackage: (packageNames: string | string[], options?: PackageManagerScriptOptions<"install">) => Promise<void>;
267
+ }
268
+
269
+ interface DetectPackageManagerOptions {
270
+ allowed?: SelectionMap<Record<PackageManagerId, unknown>>;
271
+ cwd?: string;
272
+ }
273
+ declare function findPackageManager(packageManagers: PackageManagers, options?: DetectPackageManagerOptions): Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">>;
274
+ declare function findPackageManagerSafely<TAssert extends boolean = true>(packageManagers: PackageManagers, options?: DetectPackageManagerOptions & {
275
+ assert?: TAssert;
276
+ }): Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun"> | undefined>;
277
+ declare function detectPackageManagers(packageManagers: PackageManagers, options?: DetectPackageManagerOptions): Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
278
+ declare function detectLockfilePackageManagers(packageManagers: PackageManagers, options?: DetectPackageManagerOptions): Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
279
+ declare function detectGlobalPackageManagers(packageManagers: PackageManagers, options?: DetectPackageManagerOptions): Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
280
+ declare function filterPackageManagers(packageManagers: PackageManagers, filterFn: (packageManager: PackageManager) => Promise<boolean> | boolean, options?: DetectPackageManagerOptions): Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
281
+
282
+ type PackageManagerId = (typeof packageManagerConfigs)[number]["id"];
283
+ declare const packageManagerConfigs: (PackageManagerConfig<"pnpm"> | PackageManagerConfig<"yarn"> | PackageManagerConfig<"bun"> | PackageManagerConfig<"npm">)[];
284
+ declare function definePackageManagerClient(options: DetectPackageManagerOptions): {
285
+ configs: PackageManager<"yarn" | "pnpm" | "npm" | "bun">[];
286
+ findPackageManager: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">, [options?: DetectPackageManagerOptions | undefined]>;
287
+ findPackageManagerSafely: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun"> | undefined, [options?: DetectPackageManagerOptions | undefined]>;
288
+ detectPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
289
+ detectLockfilePackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
290
+ detectGlobalPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
291
+ filterPackageManagers: (filterFn: (packageManager: PackageManager) => Promise<boolean> | boolean, options?: DetectPackageManagerOptions) => Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
292
+ };
293
+
294
+ declare function isPackageDependency(packageName: string | string[]): boolean;
295
+
296
+ interface AliasDefinition {
297
+ resolve: ResolvePathAliasFn;
298
+ subpaths?: Subpath[] | Readonly<Subpath[]>;
299
+ }
300
+ interface Subpath {
301
+ to: string;
302
+ description?: string;
303
+ }
304
+ type AliasDefinitionMap<TAlias extends string = string> = Record<TAlias, AliasDefinition>;
305
+ type AliasMap<TAliases extends AliasDefinitionMap = AliasDefinitionMap> = {
306
+ [K in keyof TAliases]: TAliases[K]["resolve"];
307
+ } & {
308
+ [K in keyof TAliases as `${Extract<K, string>}/${NonNullable<TAliases[K]["subpaths"]>[number]["to"]}`]: TAliases[K]["resolve"];
309
+ };
310
+ type ResolvePathAliasFn = (opts?: {
311
+ cwd?: string;
312
+ }) => string;
313
+ declare function definePathAliases<const T extends AliasDefinitionMap>(aliasDefinitions: T): {
314
+ aliasDefinitions: T;
315
+ aliasMap: AliasMap<T>;
316
+ 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;
317
+ };
318
+ type PathTo<TBaseDirAlias extends string = string> = string | [baseDir: TBaseDirAlias, subpath?: string];
319
+ interface GetPathOptions<TAlias extends string, TValidate extends boolean = false, TGlob extends boolean = false> {
320
+ to: PathTo<TAlias>;
321
+ startingFrom?: PathTo<TAlias>;
322
+ cwd?: string;
323
+ checkExistence?: TValidate;
324
+ glob?: TGlob;
325
+ }
326
+ declare function getAliasMap<const T extends AliasDefinitionMap>(aliasDefs: T): AliasMap<T>;
327
+
328
+ /**
329
+ * ### Path Aliases:
330
+ *
331
+ *
332
+ ```jsx
333
+ Notation: <user_home>/Projects/<workspace_folder>/apps/<package_folder>/src/
334
+ ```
335
+
336
+ * - **`<workspace_folder>`**:
337
+ * > Starting from `cwd`, searches up the directory hierarchy for the workspace root, falling back to the git root if no workspace is detected.
338
+ *
339
+ * - **`<workspace_folder?>`**:
340
+ * > 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.
341
+ * > - *Note that the `?` seen in `<workspace_folder?>` indicates that it has no fallback.*
342
+ *
343
+ * - **`<workspace_folder>/node_modules`**:
344
+ * > Subpath for node modules in the workspace folder.
345
+ * > - Example: `<workspace_folder>/node_modules`
346
+ *
347
+ * - **`<package_folder>`**:
348
+ * > Starting from `cwd`, searches up the directory hierarchy for package.json.
349
+ * > - Example: `<workspace_folder>/apps/package-folder`
350
+ *
351
+ * - **`<package_folder>/node_modules`**:
352
+ * > Subpath for node modules in the package folder.
353
+ *
354
+ * - **`<package_folder>/node_modules/.bin`**:
355
+ * > Subpath for executable scripts in the package folder.
356
+ *
357
+ * - **`<user_home>`**:
358
+ * > Path to the current user's home directory.
359
+ * > - Example: `/Users/username`
360
+ *
361
+ * - **`<user_tmpdir>`**:
362
+ * > Path to the OS tmpdir folder.
363
+ * > - Example: `/var/folders/vb/62qmb9fj2qsxcwhr8tb16krrw0000gn/T`
364
+ *
365
+ * - **`<cwd>`**:
366
+ * > Path to the current working directory.
367
+ *
368
+ * - **`<current_file>`**:
369
+ * > Path to the current file.
370
+ * > - Example: `/Users/username/Projects/monorepo/package-folder/src/utils/getPath.ts`
371
+ *
372
+ * - **`<current-folder>`**:
373
+ * > Path to the current folder.
374
+ * > - Example: `/Users/username/Projects/monorepo/package-folder/src/utils`
375
+ */
376
+ 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>) => TValidate extends true ? string | undefined : TGlob extends true ? string | undefined : string;
377
+
378
+ type PathAlias = keyof PredefinedPathAliases;
379
+ type PickPathAlias<K extends PathAlias> = K;
380
+ type PredefinedPathAliases = typeof predefinedPathAliases;
381
+ declare const predefinedPathAliases: {
382
+ readonly "<workspace_folder>": {
383
+ readonly resolve: (opts: {
384
+ cwd?: string | undefined;
385
+ } | undefined) => string;
386
+ readonly subpaths: [{
387
+ readonly to: "node_modules";
388
+ }, {
389
+ readonly to: "node_modules/.bin";
390
+ }];
391
+ };
392
+ readonly "<workspace_folder?>": {
393
+ readonly resolve: (opts: {
394
+ cwd?: string | undefined;
395
+ } | undefined) => string;
396
+ readonly subpaths: [{
397
+ readonly to: "node_modules";
398
+ }, {
399
+ readonly to: "node_modules/.bin";
400
+ }];
401
+ };
402
+ readonly "<package_folder>": {
403
+ readonly resolve: (opts: {
404
+ cwd?: string | undefined;
405
+ } | undefined) => string;
406
+ readonly subpaths: [{
407
+ readonly to: "node_modules";
408
+ }, {
409
+ readonly to: "node_modules/.bin";
410
+ }, {
411
+ readonly to: "src";
412
+ }];
413
+ };
414
+ readonly "<gitroot_folder>": {
415
+ readonly resolve: (opts: {
416
+ cwd?: string | undefined;
417
+ } | undefined) => string;
418
+ readonly subpaths: [{
419
+ readonly to: "node_modules";
420
+ }, {
421
+ readonly to: "node_modules/.bin";
422
+ }, {
423
+ readonly to: ".vscode";
424
+ }];
425
+ };
426
+ readonly "<user_home>": {
427
+ readonly resolve: () => string;
428
+ readonly subpaths: any[];
429
+ };
430
+ readonly "<user_tmpdir>": {
431
+ readonly resolve: () => string;
432
+ readonly subpaths: any[];
433
+ };
434
+ readonly "<cwd>": {
435
+ readonly resolve: () => string;
436
+ readonly subpaths: any[];
437
+ };
438
+ readonly "<current_file>": {
439
+ readonly resolve: () => string;
440
+ readonly subpaths: any[];
441
+ };
442
+ readonly "<current_folder>": {
443
+ readonly resolve: () => string;
444
+ readonly subpaths: any[];
445
+ };
446
+ };
447
+
448
+ type PackageName = string;
449
+ interface PackageInfo {
450
+ name: PackageName;
451
+ dirpath: string;
452
+ path: string;
453
+ packageJson: PackageJson;
454
+ }
455
+ type PackageInfoList = PackageInfo[];
456
+ type PackageInfoMap = Record<PackageName, PackageInfo>;
457
+ interface PackageDependencyItem {
458
+ name: string;
459
+ type: PackageDependencyType;
460
+ version: string;
461
+ }
462
+ type PackageDependencyType = "dependency" | "devDependency" | "peerDependency" | "optionalDependency";
463
+ declare const dependencyTypeMap: {
464
+ dependency: "dependencies";
465
+ devDependency: "devDependencies";
466
+ peerDependency: "peerDependencies";
467
+ optionalDependency: "optionalDependencies";
468
+ };
469
+ type KnownPackageJson = OmitIndexSignature<PackageJson>;
470
+ interface PackageJson {
471
+ /**
472
+ * The name is what your thing is called.
473
+ * Some rules:
474
+
475
+ - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
476
+ - The name can’t start with a dot or an underscore.
477
+ - New packages must not have uppercase letters in the name.
478
+ - 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.
479
+
480
+ */
481
+ name: PackageName;
482
+ /**
483
+ * Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
484
+ */
485
+ version?: string;
486
+ /**
487
+ * Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
488
+ */
489
+ description?: string;
490
+ /**
491
+ * Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
492
+ */
493
+ keywords?: string[];
494
+ /**
495
+ * The url to the project homepage.
496
+ */
497
+ homepage?: string;
498
+ /**
499
+ * 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.
500
+ */
501
+ bugs?: string | {
502
+ url?: string;
503
+ email?: string;
504
+ };
505
+ /**
506
+ * 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.
507
+ */
508
+ license?: string;
509
+ /**
510
+ * 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.
511
+ * For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
512
+ */
513
+ repository?: string | {
514
+ type: string;
515
+ url: string;
516
+ /**
517
+ * 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:
518
+ */
519
+ directory?: string;
520
+ };
521
+ scripts?: Record<string, string>;
522
+ /**
523
+ * If you set `"private": true` in your package.json, then npm will refuse to publish it.
524
+ */
525
+ private?: boolean;
526
+ /**
527
+ * The “author” is one person.
528
+ */
529
+ author?: PackageJsonPerson;
530
+ /**
531
+ * “contributors” is an array of people.
532
+ */
533
+ contributors?: PackageJsonPerson[];
534
+ /**
535
+ * 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.
536
+ */
537
+ files?: string[];
538
+ /**
539
+ * 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.
540
+ * This should be a module ID relative to the root of your package folder.
541
+ * For most modules, it makes the most sense to have a main script and often not much else.
542
+ */
543
+ main?: string;
544
+ /**
545
+ * 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)
546
+ */
547
+ browser?: string;
548
+ /**
549
+ * 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.
550
+ */
551
+ bin?: string | Record<string, string>;
552
+ /**
553
+ * Specify either a single file or an array of filenames to put in place for the `man` program to find.
554
+ */
555
+ man?: string | string[];
556
+ /**
557
+ * 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.
558
+ */
559
+ dependencies?: Record<string, string>;
560
+ /**
561
+ * 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.
562
+ * In this case, it’s best to map these additional items in a `devDependencies` object.
563
+ */
564
+ devDependencies?: Record<string, string>;
565
+ /**
566
+ * 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.
567
+ */
568
+ optionalDependencies?: Record<string, string>;
569
+ /**
570
+ * 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.
571
+ */
572
+ peerDependencies?: Record<string, string>;
573
+ /**
574
+ * TypeScript typings, typically ending by .d.ts
575
+ */
576
+ types?: string;
577
+ typings?: string;
578
+ /**
579
+ * Non-Standard Node.js alternate entry-point to main.
580
+ * An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
581
+ */
582
+ module?: string;
583
+ /**
584
+ * Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
585
+ *
586
+ * Docs:
587
+ * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
588
+ *
589
+ * @default 'commonjs'
590
+ * @since Node.js v14
591
+ */
592
+ type?: "module" | "commonjs";
593
+ /**
594
+ * Alternate and extensible alternative to "main" entry point.
595
+ *
596
+ * When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
597
+ *
598
+ * Docs:
599
+ * - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
600
+ *
601
+ * @default 'commonjs'
602
+ * @since Node.js v14
603
+ */
604
+ exports?: string | Record<"import" | "require" | "." | "node" | "browser" | string, string | Record<"import" | "require" | string, string>>;
605
+ workspaces?: string[];
606
+ [key: string]: any;
607
+ }
608
+ /**
609
+ * 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.
610
+ */
611
+ type PackageJsonPerson = string | {
612
+ name: string;
613
+ email?: string;
614
+ url?: string;
615
+ };
616
+
617
+ interface FindDependencyInPackageJsonOptions {
618
+ name: string;
619
+ type?: PackageDependencyType | AllowedDependencyTypesOption;
620
+ }
621
+ type AllowedDependencyTypesOption = SelectionMap<Record<PackageDependencyType, any>>;
622
+ declare function isDependencyInPackageJson(options: string | FindDependencyInPackageJsonOptions, packageJson?: PackageJson): boolean;
623
+ declare function findDependencyInPackageJson(option: string | FindDependencyInPackageJsonOptions, packageJson: PackageJson | undefined): {
624
+ firstMatch: PackageDependencyItem | undefined;
625
+ matches: PackageDependencyItem[];
626
+ } | undefined;
627
+
628
+ type ProjectFolderTypeOption = WorkspaceFolderTypeOption | PackageFolderTypeOption | GitRootFolderTypeOption | PackageNameFolderTypeOption;
629
+ type PackageFolderTypeOption = PickPathAlias<"<package_folder>">;
630
+ type GitRootFolderTypeOption = PickPathAlias<"<gitroot_folder>">;
631
+ type PackageNameFolderTypeOption = RequireExactlyOne<{
632
+ packageName: PackageName;
633
+ }>;
634
+ type WorkspaceFolderTypeOption = PickPathAlias<"<workspace_folder>"> | RequireExactlyOne<{
635
+ "<workspace_folder>": Pick<GetWorkspaceFolderOptions, "fallbackToGitRoot" | "throwIfNotFound">;
636
+ }>;
637
+
638
+ type ProjectParams = [
639
+ source: ProjectFolderTypeOption,
640
+ options?: PathOptions
641
+ ];
642
+ declare const project: (source: ProjectFolderTypeOption, options?: PathOptions | undefined) => {
643
+ packageJson: PackageJson | undefined;
644
+ packageJsonPath: string | undefined;
645
+ packageName: string | undefined;
646
+ projectDir: string | undefined;
647
+ findPackageManager: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">, [options?: DetectPackageManagerOptions | undefined]>;
648
+ detectPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
649
+ detectGlobalPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
650
+ detectLockfilePackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
651
+ tsconfig: {
652
+ readonly paths: string[];
653
+ };
654
+ gitignore: {
655
+ readonly data: parse_gitignore.ParsedGitignoreObject;
656
+ readonly patterns: string[];
657
+ };
658
+ filterPackageManagers: (filterFn: (packageManager: PackageManager<"yarn" | "pnpm" | "npm" | "bun">) => boolean | Promise<boolean>, options?: DetectPackageManagerOptions | undefined) => Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
659
+ getPackageJson: () => PackageJson;
660
+ findDependencyInPackageJson: (options: string | FindDependencyInPackageJsonOptions) => {
661
+ firstMatch: PackageDependencyItem | undefined;
662
+ matches: PackageDependencyItem[];
663
+ } | undefined;
664
+ isDependencyInPackageJson: (options: string | FindDependencyInPackageJsonOptions) => boolean;
665
+ };
666
+
667
+ declare function getFolderByPackageName(name: PackageName, options?: PathOptions): string | undefined;
668
+
669
+ declare function getGitRootFolder(options?: PathOptions): string | undefined;
670
+
671
+ /**
672
+ *
673
+ * Finds the nearest `package.json` directory, starting from `cwd`
674
+ *
675
+ */
676
+ declare function getPackageFolder(options?: {
677
+ cwd?: string;
678
+ }): string;
679
+
680
+ interface GetWorkspaceFolderOptions<$Validate extends boolean = true> extends PathOptions {
681
+ /** @default true */
682
+ fallbackToGitRoot?: boolean;
683
+ /** @default true */
684
+ throwIfNotFound?: $Validate;
685
+ }
686
+ /**
687
+ * Starting from cwd, searches up the directory hierarchy for the workspace root,
688
+ * falling back to the git root if no workspace is detected.
689
+ */
690
+ declare function getWorkspaceFolder<$ThrowIfNotFound extends boolean = true>(options?: GetWorkspaceFolderOptions<$ThrowIfNotFound>): $ThrowIfNotFound extends true ? string : string | undefined;
691
+
692
+ declare function getWorkspacePackageInfoMap(options?: PathOptions & {
693
+ includeRoot?: boolean;
694
+ }): PackageInfoMap;
695
+
696
+ interface GetPackageInfoListOptions {
697
+ cwd?: string;
698
+ includeRoot?: boolean;
699
+ }
700
+ declare function getWorkspacePackageInfoList(options?: GetPackageInfoListOptions): (PackageInfo | {
701
+ name: string;
702
+ path: string;
703
+ packageJson: WST.PackageInfo;
704
+ })[];
705
+
706
+ declare function getWorkspacePackageNames(options?: GetPackageInfoListOptions): string[];
707
+
708
+ declare const workspace: {
709
+ packageNames: typeof getWorkspacePackageNames;
710
+ packageGraph: typeof getWorkspacePackageInfoMap;
711
+ packageList: typeof getWorkspacePackageInfoList;
712
+ workspaceRootDir: typeof getWorkspaceFolder;
713
+ getProject: (source: ProjectFolderTypeOption, options?: PathOptions | undefined) => {
714
+ packageJson: PackageJson | undefined;
715
+ packageJsonPath: string | undefined;
716
+ packageName: string | undefined;
717
+ projectDir: string | undefined;
718
+ findPackageManager: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">, [options?: DetectPackageManagerOptions | undefined]>;
719
+ detectPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
720
+ detectGlobalPackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
721
+ detectLockfilePackageManagers: async_cache_fn_index.AsyncCacheFn<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[], [options?: DetectPackageManagerOptions | undefined]>;
722
+ tsconfig: {
723
+ readonly paths: string[];
724
+ };
725
+ gitignore: {
726
+ readonly data: parse_gitignore.ParsedGitignoreObject;
727
+ readonly patterns: string[];
728
+ };
729
+ filterPackageManagers: (filterFn: (packageManager: PackageManager<"yarn" | "pnpm" | "npm" | "bun">) => boolean | Promise<boolean>, options?: DetectPackageManagerOptions | undefined) => Promise<PackageManager<"yarn" | "pnpm" | "npm" | "bun">[]>;
730
+ getPackageJson: () => PackageJson;
731
+ findDependencyInPackageJson: (options: string | FindDependencyInPackageJsonOptions) => {
732
+ firstMatch: PackageDependencyItem | undefined;
733
+ matches: PackageDependencyItem[];
734
+ } | undefined;
735
+ isDependencyInPackageJson: (options: string | FindDependencyInPackageJsonOptions) => boolean;
736
+ };
737
+ };
738
+
739
+ interface JsonSourceData<$json extends object = object> {
740
+ text: string;
741
+ data: $json;
742
+ }
743
+ type JsonSourceInput<data extends object = object> = Prettify<RequireExactlyOne<{
744
+ data?: data;
745
+ filepath?: string;
746
+ text?: string;
747
+ }>>;
748
+
749
+ interface JSONEditMap {
750
+ [$dot_path: string | number]: Omit<JSONEditData, "path">;
751
+ }
752
+ interface JSONEditData {
753
+ path: (string | number)[] | string | number;
754
+ value: any;
755
+ options?: JSONEditOptions;
756
+ }
757
+ interface JSONEditOptions extends ModificationOptions {
758
+ /** @default "." */
759
+ pathSeparator?: string | false;
760
+ }
761
+ type JSONEdits = JSONEditMap | JSONEditData[];
762
+ interface ModifyJSONCDataOptions<$data extends object = object> {
763
+ json: JsonSourceInput<$data>;
764
+ edits: JSONEdits;
765
+ defaultEditOptions?: JSONEditOptions;
766
+ }
767
+ type ModifyJSONDataResult = CheckResult<JsonSourceData>;
768
+ declare function modifyJSON({ json, edits, defaultEditOptions, }: ModifyJSONCDataOptions): ModifyJSONDataResult;
769
+ interface MoodifyJSONFileOptions<$auto_commit extends boolean = boolean> {
770
+ autoCommit?: $auto_commit;
771
+ defaultEditOptions?: JSONEditOptions;
772
+ }
773
+ type ModifyJSONFileResult<$auto_commit extends boolean = true> = $auto_commit extends true ? CheckResult<JsonSourceData> : CheckResult<{
774
+ json: JsonSourceData;
775
+ commit: () => void;
776
+ }>;
777
+ declare function modifyJSONFile<$auto_commit extends boolean = true>(filepath: string, edits: JSONEdits, options?: MoodifyJSONFileOptions<$auto_commit>): ModifyJSONFileResult<$auto_commit>;
778
+
779
+ declare const storage: Storage<StorageValue>;
780
+ declare const tempFileSystem: {
781
+ definition: {
782
+ readonly base: string;
783
+ };
784
+ initialize: () => Promise<FileSystemStorage<unknown, string & {}>>;
785
+ };
786
+ type FileSystemEntriesDefinition<$filepath extends string = string> = {
787
+ [K in $filepath]: StorageValue | (<$file_data extends StorageValue>() => {
788
+ file: $file_data;
789
+ options?: TransactionOptions;
790
+ serialize?: (file_data: $file_data) => string;
791
+ deserialize?: (file_content: string) => $file_data;
792
+ });
793
+ };
794
+ interface FileSystemEntry<$key extends string = string> {
795
+ key: $key;
796
+ value: string;
797
+ options?: TransactionOptions;
798
+ }
799
+ type DefineFileSystemOptions<$filepath extends string = string> = {
800
+ base: string;
801
+ initial?: FileSystemEntriesDefinition<$filepath>;
802
+ } & Omit<FSStorageOptions, "base">;
803
+ type FileSystemPath<$fs_def> = Extract<keyof $fs_def, string>;
804
+ type FileSystemPathCompletion<$fs_def> = StringLiteral<FileSystemPath<$fs_def>>;
805
+ interface FileSystemStorage<$fs_def extends FileSystemEntriesDefinition | undefined = FileSystemEntriesDefinition, // prettier-ignore
806
+ $path_completion extends FileSystemPathCompletion<$fs_def> = FileSystemPathCompletion<$fs_def>> {
807
+ meta: {
808
+ fileEntriesData: FileSystemEntriesData<$fs_def>;
809
+ };
810
+ createFile: (key: string, data: string) => Promise<{
811
+ key: string;
812
+ filepath: string;
813
+ get: () => Promise<StorageValue>;
814
+ update: (data: string) => Promise<void>;
815
+ }>;
816
+ getFile: (filepath: $path_completion) => Promise<{
817
+ key: string;
818
+ filepath: string;
819
+ data: any;
820
+ read: () => Promise<any>;
821
+ }>;
822
+ readFile: (filepath: $path_completion) => Promise<string>;
823
+ getFilePath: <$filepath extends $path_completion>(key: $filepath) => Promise<string>;
824
+ restoreFs(snapshot: Snapshot, base?: string): Promise<void>;
825
+ snapshotFs: (base?: string) => Promise<Snapshot<string>>;
826
+ initializeFs: (newInitial?: FileSystemEntriesDefinition) => Promise<void>;
827
+ removeAllFiles(base?: string, opts?: TransactionOptions): Promise<void>;
828
+ deleteFileSystem(): Promise<void>;
829
+ defineFileSystemEntries: typeof defineFileSystemEntries;
830
+ storage: Storage;
831
+ }
832
+ interface FileSystemEntriesData<T extends FileSystemEntriesDefinition | undefined = undefined, $fs_def extends ExtractFsEntriesDef<T> = ExtractFsEntriesDef<T>> {
833
+ definition: $fs_def;
834
+ fileSystemEntries: FileSystemEntry<FileSystemPath<$fs_def>>[];
835
+ }
836
+ declare function defineFileSystemEntries<const $fs_def extends FileSystemEntriesDefinition>(definition: $fs_def): FileSystemEntriesData<$fs_def>;
837
+ type ExtractFsEntriesDef<$fs_def> = Cast<$fs_def, FileSystemEntriesDefinition>;
838
+ declare function defineFileSystemStorage<const $fs_storage_def extends DefineFileSystemOptions = DefineFileSystemOptions, // prettier-ignore
839
+ $fs_def extends $fs_storage_def['initial'] = $fs_storage_def['initial']>(options: $fs_storage_def): $fs_storage_def["initial"] extends undefined ? FileSystemStorage : {
840
+ definition: $fs_storage_def;
841
+ initialize: () => Promise<FileSystemStorage<$fs_def>>;
842
+ };
843
+
844
+ export { type AliasDefinition, type AliasDefinitionMap, type AliasMap, type AnyFunction, type AsyncCacheFn, type Awaitable, type Cast, type CheckResult, type DefinePackageFn, type DetectPackageManagerOptions, type Entry, type EntryOf, type EnumToLiteral, type Equals, type ExtractImportOptionModule, type FileSystemEntriesDefinition, type FindDependencyInPackageJsonOptions, type FromEntries, 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 IsUnknown, type JSONEditData, type JSONEditMap, type JSONEditOptions, type JSONEdits, type KeyOf, type KnownPackageJson, type MergeObject, type ModifyJSONCDataOptions, type Module, type MoodifyJSONFileOptions, type NoInfer, type OmitByValue, type OmitIndexSignature, type OmitNever, type PackageDependencyItem, type PackageDependencyType, type PackageInfo, type PackageInfoList, type PackageInfoMap, type PackageJson, type PackageJsonPerson, type PackageManagerCommandName, type PackageManagerCommandSpec, type PackageManagerCommands, type PackageManagerConfig, type PackageManagerId, type PackageManagerScriptOptions, type PackageName, type PathAlias, type PathOptions, type PathTo, type PickByValue, type PickKeyOf, type PickPathAlias, type PredefinedPathAliases, type Prettify, type ProjectParams, type RequireExactlyOne, type ResolveModulePathOptions, type ResolvedImportList, type ResolvedImportListPromise, type ResolvedImportMap, type ResolvedImportMapPromise, type ResolvedImportOption, type ResolvedPromise, type Select, type SelectionMap, type SingleProp, type StringLiteral, type UninstallPackageOptions, type ValueAtPath, type ValueKeyOf, type ValueKeyOfDeep, type ValueOf, type __, _dirname, _filename, defineFileSystemEntries, defineFileSystemStorage, definePackage, definePackageManagerClient, definePathAliases, dependencyTypeMap, detectGlobalPackageManagers, detectLockfilePackageManagers, detectPackageManagers, filterPackageManagers, findDependencyInPackageJson, findPackageManager, findPackageManagerSafely, findResolvedModulePath, getAliasMap, getFolderByPackageName, getGitRootFolder, getPackageFolder, getPath, getWorkspaceFolder, importMap, importer, isDependencyInPackageJson, isPackageDependency, isPackageModuleFound, modifyJSON, modifyJSONFile, packageManagerConfigs, predefinedPathAliases, project, resolveModule, resolveModulePath, resolvePackageModulePath, storage, tempFileSystem, workspace };