| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 | var __accessCheck = (obj, member, msg) => {  if (!member.has(obj))    throw TypeError("Cannot " + msg);};var __privateGet = (obj, member, getter) => {  __accessCheck(obj, member, "read from private field");  return getter ? getter.call(obj) : member.get(obj);};var __privateAdd = (obj, member, value) => {  if (member.has(obj))    throw TypeError("Cannot add the same private member more than once");  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);};var __privateSet = (obj, member, value, setter) => {  __accessCheck(obj, member, "write to private field");  setter ? setter.call(obj, value) : member.set(obj, value);  return value;};var __privateWrapper = (obj, member, setter, getter) => {  return {    set _(value) {      __privateSet(obj, member, value, setter);    },    get _() {      return __privateGet(obj, member, getter);    }  };};// shared.tsimport { existsSync, promises as fs2 } from "fs";// node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.jsimport path2 from "path";import { fileURLToPath as fileURLToPath2 } from "url";// node_modules/.pnpm/locate-path@7.1.1/node_modules/locate-path/index.jsimport process2 from "process";import path from "path";import fs, { promises as fsPromises } from "fs";import { fileURLToPath } from "url";// node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.jsvar Node = class {  value;  next;  constructor(value) {    this.value = value;  }};var _head, _tail, _size;var Queue = class {  constructor() {    __privateAdd(this, _head, void 0);    __privateAdd(this, _tail, void 0);    __privateAdd(this, _size, void 0);    this.clear();  }  enqueue(value) {    const node = new Node(value);    if (__privateGet(this, _head)) {      __privateGet(this, _tail).next = node;      __privateSet(this, _tail, node);    } else {      __privateSet(this, _head, node);      __privateSet(this, _tail, node);    }    __privateWrapper(this, _size)._++;  }  dequeue() {    const current = __privateGet(this, _head);    if (!current) {      return;    }    __privateSet(this, _head, __privateGet(this, _head).next);    __privateWrapper(this, _size)._--;    return current.value;  }  clear() {    __privateSet(this, _head, void 0);    __privateSet(this, _tail, void 0);    __privateSet(this, _size, 0);  }  get size() {    return __privateGet(this, _size);  }  *[Symbol.iterator]() {    let current = __privateGet(this, _head);    while (current) {      yield current.value;      current = current.next;    }  }};_head = new WeakMap();_tail = new WeakMap();_size = new WeakMap();// node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.jsfunction pLimit(concurrency) {  if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {    throw new TypeError("Expected `concurrency` to be a number from 1 and up");  }  const queue = new Queue();  let activeCount = 0;  const next = () => {    activeCount--;    if (queue.size > 0) {      queue.dequeue()();    }  };  const run = async (fn, resolve, args) => {    activeCount++;    const result = (async () => fn(...args))();    resolve(result);    try {      await result;    } catch {    }    next();  };  const enqueue = (fn, resolve, args) => {    queue.enqueue(run.bind(void 0, fn, resolve, args));    (async () => {      await Promise.resolve();      if (activeCount < concurrency && queue.size > 0) {        queue.dequeue()();      }    })();  };  const generator = (fn, ...args) => new Promise((resolve) => {    enqueue(fn, resolve, args);  });  Object.defineProperties(generator, {    activeCount: {      get: () => activeCount    },    pendingCount: {      get: () => queue.size    },    clearQueue: {      value: () => {        queue.clear();      }    }  });  return generator;}// node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.jsvar EndError = class extends Error {  constructor(value) {    super();    this.value = value;  }};var testElement = async (element, tester) => tester(await element);var finder = async (element) => {  const values = await Promise.all(element);  if (values[1] === true) {    throw new EndError(values[0]);  }  return false;};async function pLocate(iterable, tester, {  concurrency = Number.POSITIVE_INFINITY,  preserveOrder = true} = {}) {  const limit = pLimit(concurrency);  const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);  const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);  try {    await Promise.all(items.map((element) => checkLimit(finder, element)));  } catch (error) {    if (error instanceof EndError) {      return error.value;    }    throw error;  }}// node_modules/.pnpm/locate-path@7.1.1/node_modules/locate-path/index.jsvar typeMappings = {  directory: "isDirectory",  file: "isFile"};function checkType(type) {  if (Object.hasOwnProperty.call(typeMappings, type)) {    return;  }  throw new Error(`Invalid type specified: ${type}`);}var matchType = (type, stat) => stat[typeMappings[type]]();var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;async function locatePath(paths, {  cwd = process2.cwd(),  type = "file",  allowSymlinks = true,  concurrency,  preserveOrder} = {}) {  checkType(type);  cwd = toPath(cwd);  const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;  return pLocate(paths, async (path_) => {    try {      const stat = await statFunction(path.resolve(cwd, path_));      return matchType(type, stat);    } catch {      return false;    }  }, { concurrency, preserveOrder });}// node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.jsvar toPath2 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;var findUpStop = Symbol("findUpStop");async function findUpMultiple(name, options = {}) {  let directory = path2.resolve(toPath2(options.cwd) || "");  const { root } = path2.parse(directory);  const stopAt = path2.resolve(directory, options.stopAt || root);  const limit = options.limit || Number.POSITIVE_INFINITY;  const paths = [name].flat();  const runMatcher = async (locateOptions) => {    if (typeof name !== "function") {      return locatePath(paths, locateOptions);    }    const foundPath = await name(locateOptions.cwd);    if (typeof foundPath === "string") {      return locatePath([foundPath], locateOptions);    }    return foundPath;  };  const matches = [];  while (true) {    const foundPath = await runMatcher({ ...options, cwd: directory });    if (foundPath === findUpStop) {      break;    }    if (foundPath) {      matches.push(path2.resolve(directory, foundPath));    }    if (directory === stopAt || matches.length >= limit) {      break;    }    directory = path2.dirname(directory);  }  return matches;}async function findUp(name, options = {}) {  const matches = await findUpMultiple(name, { ...options, limit: 1 });  return matches[0];}// shared.tsasync function loadPackageJSON(cwd = process.cwd()) {  const path3 = await findUp("package.json", { cwd });  if (!path3 || !existsSync(path3))    return null;  return JSON.parse(await fs2.readFile(path3, "utf-8"));}async function isPackageListed(name, cwd) {  const pkg = await loadPackageJSON(cwd) || {};  return name in (pkg.dependencies || {}) || name in (pkg.devDependencies || {});}export {  isPackageListed,  loadPackageJSON};
 |