initial commit

This commit is contained in:
Zoe
2023-01-03 09:29:04 -06:00
commit 7851137d88
12889 changed files with 2557443 additions and 0 deletions

21
node_modules/local-pkg/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

56
node_modules/local-pkg/README.md generated vendored Normal file
View File

@@ -0,0 +1,56 @@
# local-pkg
[![NPM version](https://img.shields.io/npm/v/local-pkg?color=a1b858&label=)](https://www.npmjs.com/package/local-pkg)
Get information on local packages. Works on both CJS and ESM.
## Install
```bash
npm i local-pkg
```
## Usage
```ts
import {
getPackageInfo,
importModule,
isPackageExists,
resolveModule,
} from 'local-pkg'
isPackageExists('local-pkg') // true
isPackageExists('foo') // false
await getPackageInfo('local-pkg')
/* {
* name: "local-pkg",
* version: "0.1.0",
* rootPath: "/path/to/node_modules/local-pkg",
* packageJson: {
* ...
* }
* }
*/
// similar to `require.resolve` but works also in ESM
resolveModule('local-pkg')
// '/path/to/node_modules/local-pkg/dist/index.cjs'
// similar to `await import()` but works also in CJS
const { importModule } = await importModule('local-pkg')
```
## Sponsors
<p align="center">
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
</a>
</p>
## License
[MIT](./LICENSE) License © 2021 [Anthony Fu](https://github.com/antfu)

300
node_modules/local-pkg/dist/shared.cjs generated vendored Normal file
View File

@@ -0,0 +1,300 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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.ts
var shared_exports = {};
__export(shared_exports, {
isPackageListed: () => isPackageListed,
loadPackageJSON: () => loadPackageJSON
});
module.exports = __toCommonJS(shared_exports);
var import_fs = require("fs");
// node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
var import_node_path2 = __toESM(require("path"), 1);
var import_node_url2 = require("url");
// node_modules/.pnpm/locate-path@7.1.1/node_modules/locate-path/index.js
var import_node_process = __toESM(require("process"), 1);
var import_node_path = __toESM(require("path"), 1);
var import_node_fs = __toESM(require("fs"), 1);
var import_node_url = require("url");
// node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
var 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.js
function 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.js
var 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.js
var 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 ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
async function locatePath(paths, {
cwd = import_node_process.default.cwd(),
type = "file",
allowSymlinks = true,
concurrency,
preserveOrder
} = {}) {
checkType(type);
cwd = toPath(cwd);
const statFunction = allowSymlinks ? import_node_fs.promises.stat : import_node_fs.promises.lstat;
return pLocate(paths, async (path_) => {
try {
const stat = await statFunction(import_node_path.default.resolve(cwd, path_));
return matchType(type, stat);
} catch {
return false;
}
}, { concurrency, preserveOrder });
}
// node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
var import_node_fs2 = __toESM(require("fs"), 1);
// node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
var findUpStop = Symbol("findUpStop");
async function findUpMultiple(name, options = {}) {
let directory = import_node_path2.default.resolve(toPath2(options.cwd) || "");
const { root } = import_node_path2.default.parse(directory);
const stopAt = import_node_path2.default.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(import_node_path2.default.resolve(directory, foundPath));
}
if (directory === stopAt || matches.length >= limit) {
break;
}
directory = import_node_path2.default.dirname(directory);
}
return matches;
}
async function findUp(name, options = {}) {
const matches = await findUpMultiple(name, { ...options, limit: 1 });
return matches[0];
}
// shared.ts
async function loadPackageJSON(cwd = process.cwd()) {
const path3 = await findUp("package.json", { cwd });
if (!path3 || !(0, import_fs.existsSync)(path3))
return null;
return JSON.parse(await import_fs.promises.readFile(path3, "utf-8"));
}
async function isPackageListed(name, cwd) {
const pkg = await loadPackageJSON(cwd) || {};
return name in (pkg.dependencies || {}) || name in (pkg.devDependencies || {});
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
isPackageListed,
loadPackageJSON
});

4
node_modules/local-pkg/dist/shared.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
declare function loadPackageJSON(cwd?: string): Promise<Record<string, any> | null>;
declare function isPackageListed(name: string, cwd?: string): Promise<boolean>;
export { isPackageListed, loadPackageJSON };

269
node_modules/local-pkg/dist/shared.mjs generated vendored Normal file
View File

@@ -0,0 +1,269 @@
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.ts
import { existsSync, promises as fs2 } from "fs";
// node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
import path2 from "path";
import { fileURLToPath as fileURLToPath2 } from "url";
// node_modules/.pnpm/locate-path@7.1.1/node_modules/locate-path/index.js
import 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.js
var 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.js
function 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.js
var 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.js
var 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.js
var 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.ts
async 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
};

109
node_modules/local-pkg/index.cjs generated vendored Normal file
View File

@@ -0,0 +1,109 @@
const { dirname, join } = require('path')
const { existsSync, readFileSync } = require('fs')
const fs = require('fs').promises
const { loadPackageJSON, isPackageListed } = require('./dist/shared.cjs')
function resolveModule(name, options) {
try {
return require.resolve(name, options)
}
catch (e) {
return undefined
}
}
function importModule(path) {
const mod = require(path)
if (mod.__esModule)
return Promise.resolve(mod)
else
return Promise.resolve({ default: mod })
}
function isPackageExists(name, options) {
return !!resolvePackage(name, options)
}
function getPackageJsonPath(name, options) {
const entry = resolvePackage(name, options)
if (!entry)
return
return searchPackageJSON(entry)
}
async function getPackageInfo(name, options) {
const packageJsonPath = getPackageJsonPath(name, options)
if (!packageJsonPath)
return
const pkg = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'))
return {
name,
version: pkg.version,
rootPath: dirname(packageJsonPath),
packageJsonPath,
packageJson: pkg,
}
}
function getPackageInfoSync(name, options) {
const packageJsonPath = getPackageJsonPath(name, options)
if (!packageJsonPath)
return
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
return {
name,
version: pkg.version,
rootPath: dirname(packageJsonPath),
packageJsonPath,
packageJson: pkg,
}
}
function resolvePackage(name, options = {}) {
try {
return require.resolve(`${name}/package.json`, options)
}
catch {
}
try {
return require.resolve(name, options)
}
catch (e) {
if (e.code !== 'MODULE_NOT_FOUND')
throw e
return false
}
}
function searchPackageJSON(dir) {
let packageJsonPath
while (true) {
if (!dir)
return
const newDir = dirname(dir)
if (newDir === dir)
return
dir = newDir
packageJsonPath = join(dir, 'package.json')
if (existsSync(packageJsonPath))
break
}
return packageJsonPath
}
module.exports = {
resolveModule,
importModule,
isPackageExists,
getPackageInfo,
getPackageInfoSync,
loadPackageJSON,
isPackageListed,
}
Object.defineProperty(module.exports, '__esModule', { value: true, enumerable: false })

29
node_modules/local-pkg/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,29 @@
export * from './dist/shared'
export interface PackageInfo {
name: string
rootPath: string
packageJsonPath: string
version: string
packageJson: {
name: string
version: string
dependencies?: Record<string, string>
devDependencies?: Record<string, string>
[key: string]: any
}
}
export interface PackageResolvingOptions {
paths?: string[]
}
export function isPackageExists(name: string, options?: PackageResolvingOptions): boolean
export function getPackageInfo(name: string, options?: PackageResolvingOptions): Promise<PackageInfo | undefined>
export function getPackageInfoSync(name: string, options?: PackageResolvingOptions): PackageInfo | undefined
export function resolveModule(path: string, options?: PackageResolvingOptions): string | undefined
export function importModule<T = any>(path: string): Promise<T>

101
node_modules/local-pkg/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,101 @@
import { dirname, join } from 'path'
import { existsSync, promises as fs, readFileSync } from 'fs'
import { createRequire } from 'module'
export { loadPackageJSON, isPackageListed } from './dist/shared.mjs'
const _require = createRequire(import.meta.url)
export function resolveModule(name, options) {
try {
return _require.resolve(name, options)
}
catch (e) {
return undefined
}
}
export function importModule(path) {
return import(path).then((i) => {
if (i && i.default && i.default.__esModule)
return i.default
return i
})
}
export function isPackageExists(name, options) {
return !!resolvePackage(name, options)
}
function getPackageJsonPath(name, options) {
const entry = resolvePackage(name, options)
if (!entry)
return
return searchPackageJSON(entry)
}
export async function getPackageInfo(name, options) {
const packageJsonPath = getPackageJsonPath(name, options)
if (!packageJsonPath)
return
const pkg = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'))
return {
name,
version: pkg.version,
rootPath: dirname(packageJsonPath),
packageJsonPath,
packageJson: pkg,
}
}
export function getPackageInfoSync(name, options) {
const packageJsonPath = getPackageJsonPath(name, options)
if (!packageJsonPath)
return
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
return {
name,
version: pkg.version,
rootPath: dirname(packageJsonPath),
packageJsonPath,
packageJson: pkg,
}
}
function resolvePackage(name, options = {}) {
try {
return _require.resolve(`${name}/package.json`, options)
}
catch {
}
try {
return _require.resolve(name, options)
}
catch (e) {
if (e.code !== 'MODULE_NOT_FOUND')
console.error(e)
return false
}
}
function searchPackageJSON(dir) {
let packageJsonPath
while (true) {
if (!dir)
return
const newDir = dirname(dir)
if (newDir === dir)
return
dir = newDir
packageJsonPath = join(dir, 'package.json')
if (existsSync(packageJsonPath))
break
}
return packageJsonPath
}

60
node_modules/local-pkg/package.json generated vendored Normal file
View File

@@ -0,0 +1,60 @@
{
"name": "local-pkg",
"version": "0.4.2",
"packageManager": "pnpm@7.5.0",
"description": "Get information on local packages.",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/antfu/local-pkg#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/antfu/local-pkg.git"
},
"bugs": {
"url": "https://github.com/antfu/local-pkg/issues"
},
"keywords": [
"package"
],
"sideEffects": false,
"exports": {
".": {
"require": "./index.cjs",
"import": "./index.mjs"
}
},
"main": "index.cjs",
"module": "index.mjs",
"types": "index.d.ts",
"files": [
"dist",
"index.cjs",
"index.mjs",
"index.d.ts"
],
"engines": {
"node": ">=14"
},
"scripts": {
"prepublishOnly": "nr build",
"build": "tsup shared.ts --format esm,cjs --dts && esno scripts/postbuild.ts",
"lint": "eslint .",
"release": "bumpp && npm publish",
"test": "node test/cjs.cjs && node test/esm.mjs"
},
"devDependencies": {
"@antfu/eslint-config": "^0.25.2",
"@antfu/ni": "^0.16.3",
"@antfu/utils": "^0.5.2",
"@types/chai": "^4.3.1",
"@types/node": "^18.0.3",
"bumpp": "^8.2.1",
"chai": "^4.3.6",
"eslint": "^8.19.0",
"esno": "^0.16.3",
"find-up": "^6.3.0",
"tsup": "^6.1.3",
"typescript": "^4.7.4"
}
}