isolated-deps 0.1.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/index.cjs ADDED
@@ -0,0 +1,1034 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
+ return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
+ }();
5
+ var __webpack_modules__ = {
6
+ child_process: function(module) {
7
+ module.exports = import("child_process").then(function(module) {
8
+ return module;
9
+ });
10
+ }
11
+ };
12
+ var __webpack_module_cache__ = {};
13
+ function __webpack_require__(moduleId) {
14
+ var cachedModule = __webpack_module_cache__[moduleId];
15
+ if (void 0 !== cachedModule) return cachedModule.exports;
16
+ var module = __webpack_module_cache__[moduleId] = {
17
+ exports: {}
18
+ };
19
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
20
+ return module.exports;
21
+ }
22
+ (()=>{
23
+ __webpack_require__.n = (module)=>{
24
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
25
+ __webpack_require__.d(getter, {
26
+ a: getter
27
+ });
28
+ return getter;
29
+ };
30
+ })();
31
+ (()=>{
32
+ __webpack_require__.d = (exports1, definition)=>{
33
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
34
+ enumerable: true,
35
+ get: definition[key]
36
+ });
37
+ };
38
+ })();
39
+ (()=>{
40
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
41
+ })();
42
+ (()=>{
43
+ __webpack_require__.r = (exports1)=>{
44
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
45
+ value: 'Module'
46
+ });
47
+ Object.defineProperty(exports1, '__esModule', {
48
+ value: true
49
+ });
50
+ };
51
+ })();
52
+ var __webpack_exports__ = {};
53
+ (()=>{
54
+ __webpack_require__.r(__webpack_exports__);
55
+ __webpack_require__.d(__webpack_exports__, {
56
+ resolveDevelopInstallRoot: ()=>resolveDevelopInstallRoot,
57
+ resolvePackageFromInstallRoot: ()=>resolvePackageFromInstallRoot,
58
+ hasDependency: ()=>hasDependency,
59
+ resolveOptionalInstallRoot: ()=>resolveOptionalInstallRoot,
60
+ installOptionalDependenciesBatch: ()=>installOptionalDependenciesBatch,
61
+ installOptionalDependencies: ()=>installOptionalDependencies
62
+ });
63
+ const external_pintor_namespaceObject = require("pintor");
64
+ var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
65
+ function optionalToolingSetup(integrations, fallback, isAuthor) {
66
+ const list = integrations && integrations.length > 0 ? integrations : [
67
+ fallback
68
+ ];
69
+ const prefix = isAuthor ? external_pintor_default().brightMagenta("\u25BA\u25BA\u25BA Author says") : external_pintor_default().gray("\u25BA\u25BA\u25BA");
70
+ const suffix = 'true' === process.env.EXTENSION_ONE_TIME_INSTALL_HINT ? ' (this is a one time operation)' : '';
71
+ return list.map((integration)=>`${prefix} Installing specialized dependencies for ${integration}...${suffix}`);
72
+ }
73
+ function optionalToolingRootInstall(integration) {
74
+ return `${external_pintor_default().brightMagenta("\u25BA\u25BA\u25BA Author says")} [${integration}] Installing root dependencies for dev...`;
75
+ }
76
+ function optionalToolingReady(integration) {
77
+ return `${external_pintor_default().brightMagenta("\u25BA\u25BA\u25BA Author says")} ${integration} tooling ready.`;
78
+ }
79
+ function optionalInstallFailed(integration, error, isAuthor) {
80
+ const prefix = isAuthor ? external_pintor_default().brightMagenta('ERROR Author says') : external_pintor_default().red('ERROR');
81
+ return `${prefix} [${integration}] Failed to install dependencies.\n${external_pintor_default().red(String((null == error ? void 0 : error.message) || error))}`;
82
+ }
83
+ function optionalInstallManagerMissing(integration) {
84
+ const prefix = external_pintor_default().red('ERROR');
85
+ return [
86
+ `${prefix} [${integration}] No supported package manager found in PATH.`,
87
+ 'Install pnpm, npm, yarn, or bun and retry.',
88
+ 'If you use pnpm, ensure it is available in your environment (e.g. corepack or PATH).',
89
+ 'Override detection with:',
90
+ ` ${external_pintor_default().gray('EXTENSION_JS_PACKAGE_MANAGER=pnpm|npm|yarn|bun')}`,
91
+ ` ${external_pintor_default().gray('EXTENSION_JS_PM_EXEC_PATH=/path/to/npm-cli.js')}`,
92
+ 'If you are on WSL, run the CLI inside a WSL shell so PATH is consistent.'
93
+ ].join('\n');
94
+ }
95
+ function parseOptionalDependencySpec(spec) {
96
+ const normalized = String(spec || '').trim();
97
+ const versionSeparator = normalized.lastIndexOf('@');
98
+ if (versionSeparator <= 0) throw new Error(`Expected an exact dependency spec like "postcss@8.5.6" or "@scope/pkg@1.2.3", received "${spec}".`);
99
+ const packageId = normalized.slice(0, versionSeparator);
100
+ const versionSpecifier = normalized.slice(versionSeparator + 1);
101
+ if (!packageId || !versionSpecifier) throw new Error(`Expected an exact dependency spec like "postcss@8.5.6" or "@scope/pkg@1.2.3", received "${spec}".`);
102
+ return {
103
+ packageId,
104
+ versionSpecifier
105
+ };
106
+ }
107
+ function getPackageIdFromSpec(spec) {
108
+ return parseOptionalDependencySpec(spec).packageId;
109
+ }
110
+ function getVersionSpecifierFromSpec(spec) {
111
+ return parseOptionalDependencySpec(spec).versionSpecifier;
112
+ }
113
+ const external_fs_namespaceObject = require("fs");
114
+ const external_path_namespaceObject = require("path");
115
+ const external_child_process_namespaceObject = require("child_process");
116
+ const external_module_namespaceObject = require("module");
117
+ const external_url_namespaceObject = require("url");
118
+ const package_manager_require = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
119
+ const package_manager_currentDir = external_path_namespaceObject.dirname((0, external_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
120
+ function getRuntimeRequire() {
121
+ return globalThis.__OPTIONAL_DEPS_REQUIRE__ || package_manager_require;
122
+ }
123
+ function normalizePackageManager(value) {
124
+ if (!value) return;
125
+ const lower = value.toLowerCase().trim();
126
+ if ('pnpm' === lower) return 'pnpm';
127
+ if ('yarn' === lower) return 'yarn';
128
+ if ('bun' === lower) return 'bun';
129
+ if ('npm' === lower) return 'npm';
130
+ }
131
+ function inferPackageManagerFromPath(value) {
132
+ if (!value) return;
133
+ const lower = value.toLowerCase();
134
+ if (lower.includes('pnpm')) return 'pnpm';
135
+ if (lower.includes('yarn')) return 'yarn';
136
+ if (lower.includes('bun')) return 'bun';
137
+ if (lower.includes('npm')) return 'npm';
138
+ }
139
+ function getPackageManagerOverride() {
140
+ const name = normalizePackageManager(process.env.EXTENSION_JS_PACKAGE_MANAGER);
141
+ const explicitExecPath = process.env.EXTENSION_JS_PM_EXEC_PATH;
142
+ const inheritedExecPath = process.env.npm_execpath || process.env.NPM_EXEC_PATH || void 0;
143
+ const execPath = explicitExecPath || (name ? void 0 : inheritedExecPath);
144
+ if (!name && !execPath) return;
145
+ const inferredName = name || inferPackageManagerFromPath(execPath) || 'npm';
146
+ return {
147
+ name: inferredName,
148
+ execPath
149
+ };
150
+ }
151
+ function detectPackageManagerFromEnv() {
152
+ const userAgent = process.env.npm_config_user_agent || '';
153
+ const execPath = process.env.npm_execpath || process.env.NPM_EXEC_PATH || '';
154
+ if (userAgent.includes('pnpm')) return {
155
+ name: 'pnpm',
156
+ execPath: execPath || void 0
157
+ };
158
+ if (userAgent.includes('yarn')) return {
159
+ name: 'yarn',
160
+ execPath: execPath || void 0
161
+ };
162
+ if (userAgent.includes('bun')) return {
163
+ name: 'bun',
164
+ execPath: execPath || void 0
165
+ };
166
+ if (userAgent.includes('npm')) return {
167
+ name: 'npm',
168
+ execPath: execPath || void 0
169
+ };
170
+ if (execPath) {
171
+ const inferred = inferPackageManagerFromPath(execPath) || 'npm';
172
+ return {
173
+ name: inferred,
174
+ execPath
175
+ };
176
+ }
177
+ }
178
+ function resolveNpmCliFromNode(execPath) {
179
+ const execDir = external_path_namespaceObject.dirname(execPath);
180
+ const candidates = [
181
+ external_path_namespaceObject.join(execDir, 'node_modules', 'npm', 'bin', 'npm-cli.js'),
182
+ external_path_namespaceObject.join(execDir, '..', 'lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'),
183
+ external_path_namespaceObject.join(execDir, '..', 'node_modules', 'npm', 'bin', 'npm-cli.js')
184
+ ];
185
+ for (const candidate of candidates)if (external_fs_namespaceObject.existsSync(candidate)) return candidate;
186
+ }
187
+ function resolveBundledNpmCliPath() {
188
+ if (process.env.EXTENSION_JS_PM_EXEC_PATH) {
189
+ const overridePath = process.env.EXTENSION_JS_PM_EXEC_PATH;
190
+ if (overridePath && external_fs_namespaceObject.existsSync(overridePath)) return overridePath;
191
+ }
192
+ try {
193
+ const resolved = getRuntimeRequire().resolve('npm/bin/npm-cli.js', {
194
+ paths: [
195
+ process.cwd(),
196
+ package_manager_currentDir
197
+ ]
198
+ });
199
+ if (resolved && external_fs_namespaceObject.existsSync(resolved)) return resolved;
200
+ } catch {}
201
+ return resolveNpmCliFromNode(process.execPath);
202
+ }
203
+ function isWindowsExecutablePath(value) {
204
+ if (!value || 'win32' !== process.platform) return false;
205
+ return /\.(cmd|bat|exe)$/i.test(value);
206
+ }
207
+ function isNodeScriptPath(value) {
208
+ if (!value) return false;
209
+ return /\.(mjs|cjs|js)$/i.test(value);
210
+ }
211
+ function resolveWindowsCommandPath(command) {
212
+ if ('win32' !== process.platform) return;
213
+ try {
214
+ const systemRoot = process.env.SystemRoot || 'C:\\Windows';
215
+ const whereExe = external_path_namespaceObject.join(systemRoot, 'System32', 'where.exe');
216
+ const whereCommand = external_fs_namespaceObject.existsSync(whereExe) ? whereExe : 'where';
217
+ const output = (0, external_child_process_namespaceObject.execFileSync)(whereCommand, [
218
+ command
219
+ ], {
220
+ encoding: 'utf8',
221
+ stdio: [
222
+ 'ignore',
223
+ 'pipe',
224
+ 'ignore'
225
+ ],
226
+ windowsHide: true
227
+ });
228
+ const candidates = String(output).split(/\r?\n/).map((line)=>line.trim()).filter(Boolean);
229
+ const cmdMatch = candidates.find((line)=>/\.cmd$/i.test(line));
230
+ return cmdMatch || candidates[0];
231
+ } catch {
232
+ return;
233
+ }
234
+ }
235
+ function resolveUnixCommandPath(command) {
236
+ if ('win32' === process.platform) return;
237
+ try {
238
+ const output = (0, external_child_process_namespaceObject.execFileSync)('which', [
239
+ command
240
+ ], {
241
+ encoding: 'utf8',
242
+ stdio: [
243
+ 'ignore',
244
+ 'pipe',
245
+ 'ignore'
246
+ ]
247
+ });
248
+ const candidate = String(output).trim();
249
+ return candidate || void 0;
250
+ } catch {
251
+ return;
252
+ }
253
+ }
254
+ function resolveCommandOnPath(command) {
255
+ return resolveWindowsCommandPath(command) || resolveUnixCommandPath(command) || void 0;
256
+ }
257
+ function canRunCorepack() {
258
+ try {
259
+ const fallback = getRuntimeRequire()('child_process');
260
+ const spawnSync = (null === external_child_process_namespaceObject.spawnSync || void 0 === external_child_process_namespaceObject.spawnSync ? void 0 : external_child_process_namespaceObject.spawnSync.mock) !== void 0 ? external_child_process_namespaceObject.spawnSync : fallback.spawnSync || external_child_process_namespaceObject.spawnSync;
261
+ const result = spawnSync('corepack', [
262
+ '--version'
263
+ ], {
264
+ stdio: 'ignore',
265
+ windowsHide: true
266
+ });
267
+ return (null == result ? void 0 : result.status) === 0;
268
+ } catch {
269
+ return false;
270
+ }
271
+ }
272
+ function detectByLockfile(cwd) {
273
+ if (!cwd) return;
274
+ const hasPnpmLock = external_fs_namespaceObject.existsSync(external_path_namespaceObject.join(cwd, 'pnpm-lock.yaml'));
275
+ const hasYarnLock = external_fs_namespaceObject.existsSync(external_path_namespaceObject.join(cwd, 'yarn.lock'));
276
+ const hasNpmLock = external_fs_namespaceObject.existsSync(external_path_namespaceObject.join(cwd, 'package-lock.json'));
277
+ if (hasPnpmLock) return 'pnpm';
278
+ if (hasYarnLock) return 'yarn';
279
+ if (hasNpmLock) return 'npm';
280
+ }
281
+ function hydrateResolvedPackageManager(name) {
282
+ const resolvedCommand = resolveCommandOnPath(name);
283
+ if (resolvedCommand) return {
284
+ name,
285
+ execPath: resolvedCommand
286
+ };
287
+ if ('npm' === name) {
288
+ const bundledNpmCli = resolveBundledNpmCliPath();
289
+ if (bundledNpmCli) return {
290
+ name: 'npm',
291
+ execPath: bundledNpmCli,
292
+ runnerCommand: process.execPath,
293
+ runnerArgs: [
294
+ bundledNpmCli
295
+ ]
296
+ };
297
+ }
298
+ }
299
+ function resolvePackageManager(opts) {
300
+ const lockPm = detectByLockfile(null == opts ? void 0 : opts.cwd);
301
+ if (lockPm) {
302
+ const hydrated = hydrateResolvedPackageManager(lockPm);
303
+ if (hydrated) return hydrated;
304
+ return {
305
+ name: lockPm
306
+ };
307
+ }
308
+ const override = getPackageManagerOverride();
309
+ if (override) return override;
310
+ const envPm = detectPackageManagerFromEnv();
311
+ if (envPm) return envPm;
312
+ const candidates = [
313
+ 'pnpm',
314
+ 'yarn',
315
+ 'bun'
316
+ ];
317
+ for (const candidate of candidates){
318
+ const resolved = resolveCommandOnPath(candidate);
319
+ if (resolved) return {
320
+ name: candidate,
321
+ execPath: resolved
322
+ };
323
+ }
324
+ const corepackPath = resolveCommandOnPath('corepack');
325
+ if (corepackPath || canRunCorepack()) return {
326
+ name: 'pnpm',
327
+ runnerCommand: corepackPath || 'corepack',
328
+ runnerArgs: [
329
+ 'pnpm'
330
+ ]
331
+ };
332
+ const bundledNpmCli = resolveBundledNpmCliPath();
333
+ if (bundledNpmCli) return {
334
+ name: 'npm',
335
+ execPath: bundledNpmCli,
336
+ runnerCommand: process.execPath,
337
+ runnerArgs: [
338
+ bundledNpmCli
339
+ ]
340
+ };
341
+ return {
342
+ name: 'npm'
343
+ };
344
+ }
345
+ function buildExecEnv() {
346
+ if ('win32' !== process.platform) return;
347
+ const nodeDir = external_path_namespaceObject.dirname(process.execPath);
348
+ const pathSep = external_path_namespaceObject.delimiter;
349
+ const existing = process.env.PATH || process.env.Path || '';
350
+ if (existing.includes(nodeDir)) return;
351
+ return {
352
+ ...process.env,
353
+ PATH: `${nodeDir}${pathSep}${existing}`.trim(),
354
+ Path: `${nodeDir}${pathSep}${existing}`.trim()
355
+ };
356
+ }
357
+ function buildInstallCommand(pm, args) {
358
+ if (pm.runnerCommand) return {
359
+ command: pm.runnerCommand,
360
+ args: [
361
+ ...pm.runnerArgs || [],
362
+ ...args
363
+ ]
364
+ };
365
+ if (pm.execPath) {
366
+ if (isWindowsExecutablePath(pm.execPath)) return {
367
+ command: pm.execPath,
368
+ args
369
+ };
370
+ if (isNodeScriptPath(pm.execPath)) return {
371
+ command: process.execPath,
372
+ args: [
373
+ pm.execPath,
374
+ ...args
375
+ ]
376
+ };
377
+ return {
378
+ command: pm.execPath,
379
+ args
380
+ };
381
+ }
382
+ return {
383
+ command: pm.name,
384
+ args
385
+ };
386
+ }
387
+ function buildNpmCliFallback(args) {
388
+ const npmCli = resolveBundledNpmCliPath();
389
+ if (!npmCli) return;
390
+ return {
391
+ command: process.execPath,
392
+ args: [
393
+ npmCli,
394
+ ...args
395
+ ]
396
+ };
397
+ }
398
+ function buildSpawnInvocation(command, args) {
399
+ return {
400
+ command,
401
+ args
402
+ };
403
+ }
404
+ function execInstallCommand(command, args, options) {
405
+ const invocation = buildSpawnInvocation(command, args);
406
+ const env = buildExecEnv();
407
+ const stdio = (null == options ? void 0 : options.stdio) ?? 'ignore';
408
+ const useShell = 'win32' === process.platform && /\.(cmd|bat)$/i.test(invocation.command);
409
+ return new Promise((resolve, reject)=>{
410
+ const child = (0, external_child_process_namespaceObject.spawn)(invocation.command, invocation.args, {
411
+ cwd: null == options ? void 0 : options.cwd,
412
+ stdio,
413
+ env: (null == options ? void 0 : options.env) || env || process.env,
414
+ ...useShell ? {
415
+ shell: true
416
+ } : {}
417
+ });
418
+ child.on('close', (code)=>{
419
+ if (0 !== code) reject(new Error(`Install failed with exit code ${code}`));
420
+ else resolve();
421
+ });
422
+ child.on('error', (error)=>reject(error));
423
+ });
424
+ }
425
+ var package_namespaceObject = {
426
+ i8: "0.1.0"
427
+ };
428
+ function parseJsonSafe(text) {
429
+ const raw = 'string' == typeof text ? text : String(text || '');
430
+ const s = raw && 0xfeff === raw.charCodeAt(0) ? raw.slice(1) : raw;
431
+ return JSON.parse(s || '{}');
432
+ }
433
+ function ensureOptionalInstallBaseDir(installBaseDir) {
434
+ external_fs_namespaceObject.mkdirSync(installBaseDir, {
435
+ recursive: true
436
+ });
437
+ const packageJsonPath = external_path_namespaceObject.join(installBaseDir, 'package.json');
438
+ if (!external_fs_namespaceObject.existsSync(packageJsonPath)) external_fs_namespaceObject.writeFileSync(packageJsonPath, JSON.stringify({
439
+ name: `extensionjs-optional-deps-${package_namespaceObject.i8}`,
440
+ private: true,
441
+ version: package_namespaceObject.i8
442
+ }, null, 2) + '\n');
443
+ }
444
+ function removePathIfExists(targetPath) {
445
+ if (!external_fs_namespaceObject.existsSync(targetPath)) return;
446
+ external_fs_namespaceObject.rmSync(targetPath, {
447
+ recursive: true,
448
+ force: true
449
+ });
450
+ }
451
+ function resetOptionalInstallRoot(installBaseDir) {
452
+ removePathIfExists(external_path_namespaceObject.join(installBaseDir, 'node_modules'));
453
+ removePathIfExists(external_path_namespaceObject.join(installBaseDir, 'package-lock.json'));
454
+ removePathIfExists(external_path_namespaceObject.join(installBaseDir, 'npm-shrinkwrap.json'));
455
+ removePathIfExists(external_path_namespaceObject.join(installBaseDir, 'pnpm-lock.yaml'));
456
+ removePathIfExists(external_path_namespaceObject.join(installBaseDir, 'yarn.lock'));
457
+ removePathIfExists(external_path_namespaceObject.join(installBaseDir, 'bun.lock'));
458
+ }
459
+ function getOptionalDependencyMap(dependencySpecs) {
460
+ const dependencyMap = {};
461
+ for (const spec of dependencySpecs){
462
+ const dependencyId = getPackageIdFromSpec(spec);
463
+ dependencyMap[dependencyId] = getVersionSpecifierFromSpec(spec);
464
+ }
465
+ return dependencyMap;
466
+ }
467
+ function ensureOptionalDependenciesManifest(installBaseDir, dependencySpecs) {
468
+ if (!dependencySpecs.length) return;
469
+ const packageJsonPath = external_path_namespaceObject.join(installBaseDir, 'package.json');
470
+ const current = parseJsonSafe(external_fs_namespaceObject.readFileSync(packageJsonPath, 'utf8'));
471
+ const nextOptionalDependencies = {
472
+ ...current.optionalDependencies || {},
473
+ ...getOptionalDependencyMap(dependencySpecs)
474
+ };
475
+ const didChange = dependencySpecs.some((spec)=>{
476
+ var _current_optionalDependencies;
477
+ return (null == (_current_optionalDependencies = current.optionalDependencies) ? void 0 : _current_optionalDependencies[getPackageIdFromSpec(spec)]) !== nextOptionalDependencies[getPackageIdFromSpec(spec)];
478
+ });
479
+ if (!didChange) return;
480
+ external_fs_namespaceObject.writeFileSync(packageJsonPath, JSON.stringify({
481
+ ...current,
482
+ private: true,
483
+ optionalDependencies: nextOptionalDependencies
484
+ }, null, 2) + '\n');
485
+ }
486
+ function prepareOptionalInstallState(input) {
487
+ if (input.forceRecreateInstallRoot) resetOptionalInstallRoot(input.installBaseDir);
488
+ ensureOptionalInstallBaseDir(input.installBaseDir);
489
+ ensureOptionalDependenciesManifest(input.installBaseDir, input.dependencySpecs);
490
+ }
491
+ function isPackageEntry(entry) {
492
+ return entry.isDirectory() || entry.isSymbolicLink();
493
+ }
494
+ function getDirectPackageDir(dependencyId, installRoot) {
495
+ return external_path_namespaceObject.join(installRoot, 'node_modules', ...dependencyId.split('/'));
496
+ }
497
+ function listInstalledPackageDirs(nodeModulesDir) {
498
+ if (!external_fs_namespaceObject.existsSync(nodeModulesDir)) return [];
499
+ try {
500
+ const entries = external_fs_namespaceObject.readdirSync(nodeModulesDir, {
501
+ withFileTypes: true
502
+ });
503
+ const packageDirs = [];
504
+ for (const entry of entries){
505
+ if (!isPackageEntry(entry) || '.bin' === entry.name) continue;
506
+ const entryPath = external_path_namespaceObject.join(nodeModulesDir, entry.name);
507
+ if (!entry.name.startsWith('@')) {
508
+ packageDirs.push(entryPath);
509
+ continue;
510
+ }
511
+ const scopedEntries = external_fs_namespaceObject.readdirSync(entryPath, {
512
+ withFileTypes: true
513
+ });
514
+ for (const scopedEntry of scopedEntries)if (isPackageEntry(scopedEntry)) packageDirs.push(external_path_namespaceObject.join(entryPath, scopedEntry.name));
515
+ }
516
+ return packageDirs;
517
+ } catch {
518
+ return [];
519
+ }
520
+ }
521
+ function findPackageDirInPnpmStore(dependencyId, installRoot) {
522
+ const pnpmStoreDir = external_path_namespaceObject.join(installRoot, 'node_modules', '.pnpm');
523
+ if (!external_fs_namespaceObject.existsSync(pnpmStoreDir)) return;
524
+ try {
525
+ const storeEntries = external_fs_namespaceObject.readdirSync(pnpmStoreDir, {
526
+ withFileTypes: true
527
+ });
528
+ for (const entry of storeEntries){
529
+ if (!isPackageEntry(entry) || 'node_modules' === entry.name) continue;
530
+ const candidatePackageJson = external_path_namespaceObject.join(pnpmStoreDir, entry.name, 'node_modules', ...dependencyId.split('/'), 'package.json');
531
+ if (external_fs_namespaceObject.existsSync(candidatePackageJson)) return external_path_namespaceObject.dirname(candidatePackageJson);
532
+ }
533
+ } catch {}
534
+ }
535
+ function findNestedPackageDir(dependencyId, installRoot) {
536
+ const directPackageJson = external_path_namespaceObject.join(getDirectPackageDir(dependencyId, installRoot), 'package.json');
537
+ if (external_fs_namespaceObject.existsSync(directPackageJson)) return external_path_namespaceObject.dirname(directPackageJson);
538
+ const fromPnpmStore = findPackageDirInPnpmStore(dependencyId, installRoot);
539
+ if (fromPnpmStore) return fromPnpmStore;
540
+ const visited = new Set();
541
+ const queue = [
542
+ {
543
+ nodeModulesDir: external_path_namespaceObject.join(installRoot, 'node_modules'),
544
+ depth: 0
545
+ }
546
+ ];
547
+ const maxDepth = 4;
548
+ while(queue.length > 0){
549
+ const current = queue.shift();
550
+ if (visited.has(current.nodeModulesDir)) continue;
551
+ visited.add(current.nodeModulesDir);
552
+ const candidatePackageJson = external_path_namespaceObject.join(current.nodeModulesDir, ...dependencyId.split('/'), 'package.json');
553
+ if (external_fs_namespaceObject.existsSync(candidatePackageJson)) return external_path_namespaceObject.dirname(candidatePackageJson);
554
+ if (current.depth >= maxDepth) continue;
555
+ for (const packageDir of listInstalledPackageDirs(current.nodeModulesDir)){
556
+ const nestedNodeModulesDir = external_path_namespaceObject.join(packageDir, 'node_modules');
557
+ if (external_fs_namespaceObject.existsSync(nestedNodeModulesDir)) queue.push({
558
+ nodeModulesDir: nestedNodeModulesDir,
559
+ depth: current.depth + 1
560
+ });
561
+ }
562
+ }
563
+ }
564
+ function readPackageJsonFromDir(packageDir) {
565
+ const manifestPath = external_path_namespaceObject.join(packageDir, 'package.json');
566
+ if (!external_fs_namespaceObject.existsSync(manifestPath)) return;
567
+ try {
568
+ return JSON.parse(external_fs_namespaceObject.readFileSync(manifestPath, 'utf8') || '{}');
569
+ } catch {
570
+ return;
571
+ }
572
+ }
573
+ function getPackageEntryCandidates(pkg) {
574
+ var _pkg_exports;
575
+ const candidateEntries = [];
576
+ if ('string' == typeof (null == pkg ? void 0 : pkg.main)) candidateEntries.push(pkg.main);
577
+ if ('string' == typeof (null == pkg ? void 0 : pkg.module)) candidateEntries.push(pkg.module);
578
+ if ('string' == typeof (null == pkg ? void 0 : pkg.exports)) candidateEntries.push(pkg.exports);
579
+ const dotExport = null == pkg ? void 0 : null == (_pkg_exports = pkg.exports) ? void 0 : _pkg_exports['.'];
580
+ if ('string' == typeof dotExport) candidateEntries.push(dotExport);
581
+ if (dotExport && 'object' == typeof dotExport) {
582
+ if ('string' == typeof dotExport.require) candidateEntries.push(dotExport.require);
583
+ if ('string' == typeof dotExport.default) candidateEntries.push(dotExport.default);
584
+ if ('string' == typeof dotExport.import) candidateEntries.push(dotExport.import);
585
+ }
586
+ candidateEntries.push('index.js', 'index.cjs', 'index.mjs');
587
+ return candidateEntries;
588
+ }
589
+ function resolveFromPackageDir(packageDir) {
590
+ if (!external_fs_namespaceObject.existsSync(packageDir)) return;
591
+ const pkg = readPackageJsonFromDir(packageDir);
592
+ if (!pkg) return;
593
+ for (const relativeEntry of getPackageEntryCandidates(pkg)){
594
+ const absoluteEntry = external_path_namespaceObject.resolve(packageDir, relativeEntry);
595
+ if (external_fs_namespaceObject.existsSync(absoluteEntry)) return absoluteEntry;
596
+ }
597
+ }
598
+ function resolvePackageFromInstallRoot(dependencyId, installRoot) {
599
+ const packageDir = findNestedPackageDir(dependencyId, installRoot);
600
+ if (!packageDir) return;
601
+ return resolveFromPackageDir(packageDir);
602
+ }
603
+ const external_os_namespaceObject = require("os");
604
+ const runtime_context_require = (0, external_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
605
+ const runtime_context_currentDir = external_path_namespaceObject.dirname((0, external_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
606
+ function runtime_context_getRuntimeRequire() {
607
+ return globalThis.__OPTIONAL_DEPS_REQUIRE__ || runtime_context_require;
608
+ }
609
+ function runtime_context_parseJsonSafe(text) {
610
+ const raw = 'string' == typeof text ? text : String(text || '');
611
+ const s = raw && 0xfeff === raw.charCodeAt(0) ? raw.slice(1) : raw;
612
+ return JSON.parse(s || '{}');
613
+ }
614
+ function resolveDevelopRootFromDir(dir) {
615
+ try {
616
+ const packageJsonPath = external_path_namespaceObject.join(dir, 'package.json');
617
+ if (!external_fs_namespaceObject.existsSync(packageJsonPath)) return;
618
+ const pkg = runtime_context_parseJsonSafe(external_fs_namespaceObject.readFileSync(packageJsonPath, 'utf8'));
619
+ if ((null == pkg ? void 0 : pkg.name) === 'extension-develop') return dir;
620
+ } catch {}
621
+ }
622
+ function findDevelopRootFrom(startDir) {
623
+ let currentDir = startDir;
624
+ const maxDepth = 6;
625
+ for(let i = 0; i < maxDepth; i++){
626
+ const root = resolveDevelopRootFromDir(currentDir);
627
+ if (root) return root;
628
+ const parent = external_path_namespaceObject.dirname(currentDir);
629
+ if (parent === currentDir) break;
630
+ currentDir = parent;
631
+ }
632
+ }
633
+ function resolveDevelopInstallRoot() {
634
+ const directRoot = findExtensionDevelopRoot();
635
+ if (directRoot) return directRoot;
636
+ try {
637
+ const candidateRoot = findDevelopRootFrom(runtime_context_currentDir);
638
+ if (candidateRoot) return candidateRoot;
639
+ } catch {}
640
+ try {
641
+ const pkgPath = runtime_context_getRuntimeRequire().resolve('extension-develop/package.json', {
642
+ paths: [
643
+ runtime_context_currentDir
644
+ ]
645
+ });
646
+ return resolveDevelopRootFromDir(external_path_namespaceObject.dirname(pkgPath));
647
+ } catch {
648
+ return;
649
+ }
650
+ }
651
+ function findExtensionDevelopRoot() {
652
+ const webpackDir = external_path_namespaceObject.resolve(runtime_context_currentDir, '..');
653
+ const packageRoot = external_path_namespaceObject.resolve(webpackDir, '..');
654
+ const packageJsonPath = external_path_namespaceObject.join(packageRoot, 'package.json');
655
+ if (!external_fs_namespaceObject.existsSync(packageJsonPath)) return null;
656
+ try {
657
+ const pkg = JSON.parse(external_fs_namespaceObject.readFileSync(packageJsonPath, 'utf8'));
658
+ if ('extension-develop' === pkg.name) return packageRoot;
659
+ } catch {}
660
+ return null;
661
+ }
662
+ function getExtensionJsCacheBaseDir() {
663
+ const override = process.env.EXTENSION_JS_CACHE_DIR;
664
+ if (override) return external_path_namespaceObject.resolve(override);
665
+ if ('win32' === process.platform && process.env.LOCALAPPDATA) return external_path_namespaceObject.join(process.env.LOCALAPPDATA, 'extensionjs');
666
+ if (process.env.XDG_CACHE_HOME) return external_path_namespaceObject.join(process.env.XDG_CACHE_HOME, 'extensionjs');
667
+ return external_path_namespaceObject.join(external_os_namespaceObject.homedir(), '.cache', 'extensionjs');
668
+ }
669
+ function resolveOptionalInstallRoot() {
670
+ const version = process.env.EXTENSION_JS_OPTIONAL_DEPS_VERSION || package_namespaceObject.i8;
671
+ return external_path_namespaceObject.join(getExtensionJsCacheBaseDir(), 'optional-deps', version);
672
+ }
673
+ function hasDependency(projectPath, dependency) {
674
+ const findNearestPackageJsonDirectory = (startPath)=>{
675
+ let currentDirectory = startPath;
676
+ const maxDepth = 4;
677
+ for(let i = 0; i < maxDepth; i++){
678
+ const candidate = external_path_namespaceObject.join(currentDirectory, 'package.json');
679
+ if (external_fs_namespaceObject.existsSync(candidate)) return currentDirectory;
680
+ const parentDirectory = external_path_namespaceObject.dirname(currentDirectory);
681
+ if (parentDirectory === currentDirectory) break;
682
+ currentDirectory = parentDirectory;
683
+ }
684
+ };
685
+ const packageJsonDirectory = findNearestPackageJsonDirectory(projectPath);
686
+ if (!packageJsonDirectory) return false;
687
+ const packageJsonPath = external_path_namespaceObject.join(packageJsonDirectory, 'package.json');
688
+ if (!external_fs_namespaceObject.existsSync(packageJsonPath)) return false;
689
+ const parsed = runtime_context_parseJsonSafe(external_fs_namespaceObject.readFileSync(packageJsonPath, 'utf8'));
690
+ const dependencies = parsed.dependencies || {};
691
+ const devDependencies = parsed.devDependencies || {};
692
+ return !!dependencies[dependency] || !!devDependencies[dependency];
693
+ }
694
+ function getMissingDependenciesAtInstallRoot(dependencyIds, installBaseDir) {
695
+ return dependencyIds.filter((dependencyId)=>!resolvePackageFromInstallRoot(dependencyId, installBaseDir));
696
+ }
697
+ function filterSpecsByPackageIds(dependencySpecs, dependencyIds) {
698
+ const wantedIds = new Set(dependencyIds);
699
+ return dependencySpecs.filter((spec)=>wantedIds.has(getPackageIdFromSpec(spec)));
700
+ }
701
+ function parseWslUncPath(value) {
702
+ const match = /^\\\\wsl(?:\.localhost)?\\([^\\]+)\\(.+)$/.exec(value);
703
+ if (!match) return null;
704
+ const distro = match[1];
705
+ const rel = match[2].replace(/\\/g, '/').replace(/^\/+/, '');
706
+ return {
707
+ distro,
708
+ path: `/${rel}`
709
+ };
710
+ }
711
+ function isWslMountPath(value) {
712
+ return /^\/mnt\/[a-z]\//i.test(value);
713
+ }
714
+ function resolveWslContext(installBaseDir) {
715
+ if ('win32' !== process.platform) return {
716
+ useWsl: false
717
+ };
718
+ const trimmed = String(installBaseDir || '').trim();
719
+ if (!trimmed) return {
720
+ useWsl: false
721
+ };
722
+ const unc = parseWslUncPath(trimmed);
723
+ if (unc) return {
724
+ useWsl: true,
725
+ distro: unc.distro,
726
+ installDir: unc.path
727
+ };
728
+ if (isWslMountPath(trimmed)) return {
729
+ useWsl: true,
730
+ installDir: trimmed
731
+ };
732
+ return {
733
+ useWsl: false
734
+ };
735
+ }
736
+ function wrapCommandForWsl(command, context) {
737
+ if (!context.useWsl) return command;
738
+ const args = [
739
+ ...context.distro ? [
740
+ '-d',
741
+ context.distro
742
+ ] : [],
743
+ '--'
744
+ ];
745
+ args.push(command.command, ...command.args);
746
+ return {
747
+ command: 'wsl.exe',
748
+ args
749
+ };
750
+ }
751
+ function isMissingManagerError(error) {
752
+ const err = error;
753
+ return (null == err ? void 0 : err.code) === 'ENOENT' || String((null == err ? void 0 : err.message) || '').includes('ENOENT') || String((null == err ? void 0 : err.message) || '').includes('not found');
754
+ }
755
+ function isInstallExitFailure(error) {
756
+ return /Install failed with exit code \d+/.test(String((null == error ? void 0 : error.message) || error || ''));
757
+ }
758
+ async function execInstallWithFallback(command, options) {
759
+ try {
760
+ await execInstallCommand(command.command, command.args, {
761
+ cwd: options.cwd,
762
+ env: options.env,
763
+ stdio: 'inherit'
764
+ });
765
+ return;
766
+ } catch (error) {
767
+ if (options.fallbackNpmCommand && (isMissingManagerError(error) || options.allowFallbackOnFailure && isInstallExitFailure(error))) return void await execInstallCommand(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
768
+ cwd: options.cwd,
769
+ env: options.env,
770
+ stdio: 'inherit'
771
+ });
772
+ throw error;
773
+ }
774
+ }
775
+ async function preferCorepackFallback(pm) {
776
+ if ('npm' !== pm.name || pm.execPath || pm.runnerCommand) return pm;
777
+ const npmUserAgent = process.env.npm_config_user_agent || '';
778
+ const npmExecPath = process.env.npm_execpath || process.env.NPM_EXEC_PATH || '';
779
+ if (npmUserAgent.includes('npm') || npmExecPath) return pm;
780
+ try {
781
+ const { spawnSync } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "child_process"));
782
+ const result = spawnSync('corepack', [
783
+ '--version'
784
+ ], {
785
+ stdio: 'ignore',
786
+ windowsHide: true
787
+ });
788
+ if ((null == result ? void 0 : result.status) === 0) return {
789
+ name: 'pnpm',
790
+ runnerCommand: 'corepack',
791
+ runnerArgs: [
792
+ 'pnpm'
793
+ ]
794
+ };
795
+ } catch {}
796
+ return pm;
797
+ }
798
+ function getOptionalInstallCommand(pm, dependencySpecs, installBaseDir) {
799
+ const pmName = pm.name;
800
+ if ('yarn' === pmName) return buildInstallCommand(pm, [
801
+ '--cwd',
802
+ installBaseDir,
803
+ 'add',
804
+ ...dependencySpecs,
805
+ '--optional'
806
+ ]);
807
+ if ('npm' === pmName) return getRootInstallCommand(pm, installBaseDir);
808
+ if ('pnpm' === pmName) return buildInstallCommand(pm, [
809
+ 'install',
810
+ '--dir',
811
+ installBaseDir,
812
+ '--ignore-workspace',
813
+ '--lockfile=false',
814
+ '--silent'
815
+ ]);
816
+ if ('bun' === pmName) return buildInstallCommand(pm, [
817
+ 'add',
818
+ ...dependencySpecs,
819
+ '--cwd',
820
+ installBaseDir,
821
+ '--optional'
822
+ ]);
823
+ return buildInstallCommand(pm, [
824
+ '--silent',
825
+ 'install',
826
+ ...dependencySpecs,
827
+ '--cwd',
828
+ installBaseDir,
829
+ '--optional'
830
+ ]);
831
+ }
832
+ function getRootInstallCommand(pm, installBaseDir) {
833
+ const pmName = pm.name;
834
+ const dirArgs = installBaseDir ? 'yarn' === pmName ? [
835
+ '--cwd',
836
+ installBaseDir
837
+ ] : 'pnpm' === pmName ? [
838
+ '--dir',
839
+ installBaseDir
840
+ ] : 'bun' === pmName ? [
841
+ '--cwd',
842
+ installBaseDir
843
+ ] : [
844
+ '--prefix',
845
+ installBaseDir
846
+ ] : [];
847
+ if ('yarn' === pmName) return buildInstallCommand(pm, [
848
+ ...dirArgs,
849
+ 'install'
850
+ ]);
851
+ if ('npm' === pmName) return buildInstallCommand(pm, [
852
+ 'install',
853
+ '--silent',
854
+ ...dirArgs
855
+ ]);
856
+ if ('pnpm' === pmName) return buildInstallCommand(pm, [
857
+ 'install',
858
+ '--silent',
859
+ ...dirArgs,
860
+ '--ignore-workspace',
861
+ '--lockfile=false'
862
+ ]);
863
+ if ('bun' === pmName) return buildInstallCommand(pm, [
864
+ 'install',
865
+ ...dirArgs
866
+ ]);
867
+ return buildInstallCommand(pm, [
868
+ 'install',
869
+ '--silent',
870
+ ...dirArgs
871
+ ]);
872
+ }
873
+ async function runInstallAttempt(input) {
874
+ const env = 'yarn' === input.pm.name ? {
875
+ ...process.env,
876
+ YARN_ENABLE_IMMUTABLE_INSTALLS: 'false',
877
+ YARN_NODE_LINKER: 'node-modules'
878
+ } : process.env;
879
+ const installCommand = getOptionalInstallCommand(input.pm, input.dependencySpecs, input.wslContext.installDir || input.installBaseDir);
880
+ const execCommand = wrapCommandForWsl(installCommand, input.wslContext);
881
+ const fallbackNpmCommand = input.wslContext.useWsl ? void 0 : buildNpmCliFallback([
882
+ '--silent',
883
+ 'install',
884
+ ...input.dependencySpecs,
885
+ '--prefix',
886
+ input.installBaseDir,
887
+ '--save-optional'
888
+ ]);
889
+ await execInstallWithFallback(execCommand, {
890
+ cwd: input.wslContext.useWsl ? void 0 : input.installBaseDir,
891
+ env,
892
+ fallbackNpmCommand,
893
+ allowFallbackOnFailure: !input.wslContext.useWsl && 'npm' !== input.pm.name && void 0 !== fallbackNpmCommand
894
+ });
895
+ await new Promise((resolve)=>setTimeout(resolve, 500));
896
+ const needsRootRelink = 'npm' !== input.pm.name && (input.isAuthor || input.dependencySpecs.length > 1);
897
+ if (!needsRootRelink) return;
898
+ if (input.isAuthor) console.log(optionalToolingRootInstall(input.integration));
899
+ const rootInstall = getRootInstallCommand(input.pm, input.wslContext.useWsl ? input.wslContext.installDir : void 0);
900
+ const rootCommand = wrapCommandForWsl(rootInstall, input.wslContext);
901
+ const rootFallbackCommand = input.wslContext.useWsl ? void 0 : buildNpmCliFallback([
902
+ '--silent',
903
+ 'install',
904
+ '--prefix',
905
+ input.installBaseDir
906
+ ]);
907
+ await execInstallWithFallback(rootCommand, {
908
+ cwd: input.wslContext.useWsl ? void 0 : input.installBaseDir,
909
+ env,
910
+ fallbackNpmCommand: rootFallbackCommand,
911
+ allowFallbackOnFailure: !input.wslContext.useWsl && 'npm' !== input.pm.name && void 0 !== rootFallbackCommand
912
+ });
913
+ if (input.isAuthor) console.log(optionalToolingReady(input.integration));
914
+ }
915
+ async function installOptionalDependencies(integration, dependencySpecs, options) {
916
+ if (!dependencySpecs.length) return;
917
+ let pm;
918
+ let wslContext;
919
+ let installBaseDir;
920
+ const dependencyIds = dependencySpecs.map((spec)=>getPackageIdFromSpec(spec));
921
+ try {
922
+ installBaseDir = resolveOptionalInstallRoot();
923
+ prepareOptionalInstallState({
924
+ installBaseDir,
925
+ dependencySpecs,
926
+ forceRecreateInstallRoot: null == options ? void 0 : options.forceRecreateInstallRoot
927
+ });
928
+ pm = resolvePackageManager({
929
+ cwd: installBaseDir
930
+ });
931
+ wslContext = resolveWslContext(installBaseDir);
932
+ if (!wslContext.useWsl) pm = await preferCorepackFallback(pm);
933
+ const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
934
+ const setupMessages = optionalToolingSetup([
935
+ integration
936
+ ], integration, isAuthor);
937
+ const setupMessage = setupMessages[0];
938
+ const hasIndex = Boolean((null == options ? void 0 : options.index) && (null == options ? void 0 : options.total));
939
+ const setupMessageWithIndex = hasIndex ? setupMessage.replace("\u25BA\u25BA\u25BA ", `\u{25BA}\u{25BA}\u{25BA} [${null == options ? void 0 : options.index}/${null == options ? void 0 : options.total}] `) : setupMessage;
940
+ if (isAuthor) console.warn(setupMessageWithIndex);
941
+ else console.log(setupMessageWithIndex);
942
+ await runInstallAttempt({
943
+ pm,
944
+ wslContext,
945
+ installBaseDir,
946
+ dependencySpecs,
947
+ isAuthor,
948
+ integration
949
+ });
950
+ let missingDependencies = getMissingDependenciesAtInstallRoot(dependencyIds, installBaseDir);
951
+ if (missingDependencies.length > 0 && 'npm' !== pm.name) {
952
+ await runInstallAttempt({
953
+ pm,
954
+ wslContext,
955
+ installBaseDir,
956
+ dependencySpecs: filterSpecsByPackageIds(dependencySpecs, missingDependencies),
957
+ isAuthor,
958
+ integration
959
+ });
960
+ missingDependencies = getMissingDependenciesAtInstallRoot(dependencyIds, installBaseDir);
961
+ }
962
+ if (missingDependencies.length > 0) {
963
+ prepareOptionalInstallState({
964
+ installBaseDir,
965
+ dependencySpecs,
966
+ forceRecreateInstallRoot: true
967
+ });
968
+ await runInstallAttempt({
969
+ pm,
970
+ wslContext,
971
+ installBaseDir,
972
+ dependencySpecs,
973
+ isAuthor,
974
+ integration
975
+ });
976
+ missingDependencies = getMissingDependenciesAtInstallRoot(dependencyIds, installBaseDir);
977
+ }
978
+ if (missingDependencies.length > 0) throw new Error(`[${integration}] Optional dependency install reported success but packages are missing: ${missingDependencies.join(', ')}`);
979
+ return true;
980
+ } catch (error) {
981
+ console.error('[extension.js][optional-deps] debug', {
982
+ platform: process.platform,
983
+ execPath: process.execPath,
984
+ cwd: process.cwd(),
985
+ path: process.env.PATH || process.env.Path,
986
+ comspec: process.env.ComSpec,
987
+ systemRoot: process.env.SystemRoot,
988
+ npm_execpath: process.env.npm_execpath,
989
+ npm_config_user_agent: process.env.npm_config_user_agent,
990
+ npm_config_prefix: process.env.npm_config_prefix,
991
+ npm_config_cache: process.env.npm_config_cache,
992
+ npm_config_userconfig: process.env.npm_config_userconfig,
993
+ installBaseDir,
994
+ wslContext,
995
+ pm,
996
+ errorCode: null == error ? void 0 : error.code,
997
+ errorMessage: error instanceof Error ? error.message : String(error || 'unknown error')
998
+ });
999
+ const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
1000
+ if (isMissingManagerError(error)) console.error(optionalInstallManagerMissing(integration));
1001
+ else console.error(optionalInstallFailed(integration, error, isAuthor));
1002
+ return false;
1003
+ }
1004
+ }
1005
+ async function installOptionalDependenciesBatch(plans) {
1006
+ if (!plans.length) return;
1007
+ console.log(`${external_pintor_default().gray("\u25BA\u25BA\u25BA")} Found ${external_pintor_default().yellow(String(plans.length))} specialized integration${1 === plans.length ? '' : 's'} needing installation...`);
1008
+ for (const [index, plan] of plans.entries()){
1009
+ const didInstall = await installOptionalDependencies(plan.integration, plan.dependencySpecs, {
1010
+ index: index + 1,
1011
+ total: plans.length
1012
+ });
1013
+ if (!didInstall) return false;
1014
+ }
1015
+ return true;
1016
+ }
1017
+ })();
1018
+ exports.hasDependency = __webpack_exports__.hasDependency;
1019
+ exports.installOptionalDependencies = __webpack_exports__.installOptionalDependencies;
1020
+ exports.installOptionalDependenciesBatch = __webpack_exports__.installOptionalDependenciesBatch;
1021
+ exports.resolveDevelopInstallRoot = __webpack_exports__.resolveDevelopInstallRoot;
1022
+ exports.resolveOptionalInstallRoot = __webpack_exports__.resolveOptionalInstallRoot;
1023
+ exports.resolvePackageFromInstallRoot = __webpack_exports__.resolvePackageFromInstallRoot;
1024
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
1025
+ "hasDependency",
1026
+ "installOptionalDependencies",
1027
+ "installOptionalDependenciesBatch",
1028
+ "resolveDevelopInstallRoot",
1029
+ "resolveOptionalInstallRoot",
1030
+ "resolvePackageFromInstallRoot"
1031
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1032
+ Object.defineProperty(exports, '__esModule', {
1033
+ value: true
1034
+ });