Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
135
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.cjs
generated
vendored
Normal file
135
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
"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(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
detectPackageManager: () => detectPackageManager,
|
||||
installPackage: () => installPackage,
|
||||
uninstallPackage: () => uninstallPackage
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/detect.ts
|
||||
var import_node_process = __toESM(require("process"), 1);
|
||||
var import_detect = require("package-manager-detector/detect");
|
||||
async function detectPackageManager(cwd = import_node_process.default.cwd()) {
|
||||
const result = await (0, import_detect.detect)({
|
||||
cwd,
|
||||
onUnknown(packageManager) {
|
||||
console.warn("[@antfu/install-pkg] Unknown packageManager:", packageManager);
|
||||
return void 0;
|
||||
}
|
||||
});
|
||||
return result?.agent || null;
|
||||
}
|
||||
|
||||
// src/install.ts
|
||||
var import_node_fs = require("fs");
|
||||
var import_node_path = require("path");
|
||||
var import_node_process2 = __toESM(require("process"), 1);
|
||||
var import_tinyexec = require("tinyexec");
|
||||
async function installPackage(names, options = {}) {
|
||||
const detectedAgent = options.packageManager || await detectPackageManager(options.cwd) || "npm";
|
||||
const [agent] = detectedAgent.split("@");
|
||||
if (!Array.isArray(names))
|
||||
names = [names];
|
||||
const args = (typeof options.additionalArgs === "function" ? options.additionalArgs(agent, detectedAgent) : options.additionalArgs) || [];
|
||||
if (options.preferOffline) {
|
||||
if (detectedAgent === "yarn@berry")
|
||||
args.unshift("--cached");
|
||||
else
|
||||
args.unshift("--prefer-offline");
|
||||
}
|
||||
if (agent === "pnpm") {
|
||||
args.unshift(
|
||||
/**
|
||||
* Prevent pnpm from removing installed devDeps while `NODE_ENV` is `production`
|
||||
* @see https://pnpm.io/cli/install#--prod--p
|
||||
*/
|
||||
"--prod=false"
|
||||
);
|
||||
if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(options.cwd ?? import_node_process2.default.cwd(), "pnpm-workspace.yaml"))) {
|
||||
args.unshift("-w");
|
||||
}
|
||||
}
|
||||
return (0, import_tinyexec.x)(
|
||||
agent,
|
||||
[
|
||||
agent === "yarn" ? "add" : "install",
|
||||
options.dev ? "-D" : "",
|
||||
...args,
|
||||
...names
|
||||
].filter(Boolean),
|
||||
{
|
||||
nodeOptions: {
|
||||
stdio: options.silent ? "ignore" : "inherit",
|
||||
cwd: options.cwd
|
||||
},
|
||||
throwOnError: true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// src/uninstall.ts
|
||||
var import_node_fs2 = require("fs");
|
||||
var import_node_process3 = __toESM(require("process"), 1);
|
||||
var import_node_path2 = require("path");
|
||||
var import_tinyexec2 = require("tinyexec");
|
||||
async function uninstallPackage(names, options = {}) {
|
||||
const detectedAgent = options.packageManager || await detectPackageManager(options.cwd) || "npm";
|
||||
const [agent] = detectedAgent.split("@");
|
||||
if (!Array.isArray(names))
|
||||
names = [names];
|
||||
const args = options.additionalArgs || [];
|
||||
if (agent === "pnpm" && (0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(options.cwd ?? import_node_process3.default.cwd(), "pnpm-workspace.yaml")))
|
||||
args.unshift("-w");
|
||||
return (0, import_tinyexec2.x)(
|
||||
agent,
|
||||
[
|
||||
agent === "yarn" ? "remove" : "uninstall",
|
||||
options.dev ? "-D" : "",
|
||||
...args,
|
||||
...names
|
||||
].filter(Boolean),
|
||||
{
|
||||
nodeOptions: {
|
||||
stdio: options.silent ? "ignore" : "inherit",
|
||||
cwd: options.cwd
|
||||
},
|
||||
throwOnError: true
|
||||
}
|
||||
);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
detectPackageManager,
|
||||
installPackage,
|
||||
uninstallPackage
|
||||
});
|
||||
27
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.d.cts
generated
vendored
Normal file
27
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { Agent } from 'package-manager-detector';
|
||||
export { Agent } from 'package-manager-detector';
|
||||
import * as tinyexec from 'tinyexec';
|
||||
|
||||
type PackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
||||
declare function detectPackageManager(cwd?: string): Promise<Agent | null>;
|
||||
|
||||
interface InstallPackageOptions {
|
||||
cwd?: string;
|
||||
dev?: boolean;
|
||||
silent?: boolean;
|
||||
packageManager?: string;
|
||||
preferOffline?: boolean;
|
||||
additionalArgs?: string[] | ((agent: string, detectedAgent: string) => string[] | undefined);
|
||||
}
|
||||
declare function installPackage(names: string | string[], options?: InstallPackageOptions): Promise<tinyexec.Output>;
|
||||
|
||||
interface UninstallPackageOptions {
|
||||
cwd?: string;
|
||||
dev?: boolean;
|
||||
silent?: boolean;
|
||||
packageManager?: string;
|
||||
additionalArgs?: string[];
|
||||
}
|
||||
declare function uninstallPackage(names: string | string[], options?: UninstallPackageOptions): Promise<tinyexec.Output>;
|
||||
|
||||
export { type InstallPackageOptions, type PackageManager, type UninstallPackageOptions, detectPackageManager, installPackage, uninstallPackage };
|
||||
27
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.d.ts
generated
vendored
Normal file
27
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { Agent } from 'package-manager-detector';
|
||||
export { Agent } from 'package-manager-detector';
|
||||
import * as tinyexec from 'tinyexec';
|
||||
|
||||
type PackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
||||
declare function detectPackageManager(cwd?: string): Promise<Agent | null>;
|
||||
|
||||
interface InstallPackageOptions {
|
||||
cwd?: string;
|
||||
dev?: boolean;
|
||||
silent?: boolean;
|
||||
packageManager?: string;
|
||||
preferOffline?: boolean;
|
||||
additionalArgs?: string[] | ((agent: string, detectedAgent: string) => string[] | undefined);
|
||||
}
|
||||
declare function installPackage(names: string | string[], options?: InstallPackageOptions): Promise<tinyexec.Output>;
|
||||
|
||||
interface UninstallPackageOptions {
|
||||
cwd?: string;
|
||||
dev?: boolean;
|
||||
silent?: boolean;
|
||||
packageManager?: string;
|
||||
additionalArgs?: string[];
|
||||
}
|
||||
declare function uninstallPackage(names: string | string[], options?: UninstallPackageOptions): Promise<tinyexec.Output>;
|
||||
|
||||
export { type InstallPackageOptions, type PackageManager, type UninstallPackageOptions, detectPackageManager, installPackage, uninstallPackage };
|
||||
96
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.js
generated
vendored
Normal file
96
Frontend-Learner/node_modules/@antfu/install-pkg/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
// src/detect.ts
|
||||
import process from "node:process";
|
||||
import { detect } from "package-manager-detector/detect";
|
||||
async function detectPackageManager(cwd = process.cwd()) {
|
||||
const result = await detect({
|
||||
cwd,
|
||||
onUnknown(packageManager) {
|
||||
console.warn("[@antfu/install-pkg] Unknown packageManager:", packageManager);
|
||||
return void 0;
|
||||
}
|
||||
});
|
||||
return result?.agent || null;
|
||||
}
|
||||
|
||||
// src/install.ts
|
||||
import { existsSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import process2 from "node:process";
|
||||
import { x } from "tinyexec";
|
||||
async function installPackage(names, options = {}) {
|
||||
const detectedAgent = options.packageManager || await detectPackageManager(options.cwd) || "npm";
|
||||
const [agent] = detectedAgent.split("@");
|
||||
if (!Array.isArray(names))
|
||||
names = [names];
|
||||
const args = (typeof options.additionalArgs === "function" ? options.additionalArgs(agent, detectedAgent) : options.additionalArgs) || [];
|
||||
if (options.preferOffline) {
|
||||
if (detectedAgent === "yarn@berry")
|
||||
args.unshift("--cached");
|
||||
else
|
||||
args.unshift("--prefer-offline");
|
||||
}
|
||||
if (agent === "pnpm") {
|
||||
args.unshift(
|
||||
/**
|
||||
* Prevent pnpm from removing installed devDeps while `NODE_ENV` is `production`
|
||||
* @see https://pnpm.io/cli/install#--prod--p
|
||||
*/
|
||||
"--prod=false"
|
||||
);
|
||||
if (existsSync(resolve(options.cwd ?? process2.cwd(), "pnpm-workspace.yaml"))) {
|
||||
args.unshift("-w");
|
||||
}
|
||||
}
|
||||
return x(
|
||||
agent,
|
||||
[
|
||||
agent === "yarn" ? "add" : "install",
|
||||
options.dev ? "-D" : "",
|
||||
...args,
|
||||
...names
|
||||
].filter(Boolean),
|
||||
{
|
||||
nodeOptions: {
|
||||
stdio: options.silent ? "ignore" : "inherit",
|
||||
cwd: options.cwd
|
||||
},
|
||||
throwOnError: true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// src/uninstall.ts
|
||||
import { existsSync as existsSync2 } from "node:fs";
|
||||
import process3 from "node:process";
|
||||
import { resolve as resolve2 } from "node:path";
|
||||
import { x as x2 } from "tinyexec";
|
||||
async function uninstallPackage(names, options = {}) {
|
||||
const detectedAgent = options.packageManager || await detectPackageManager(options.cwd) || "npm";
|
||||
const [agent] = detectedAgent.split("@");
|
||||
if (!Array.isArray(names))
|
||||
names = [names];
|
||||
const args = options.additionalArgs || [];
|
||||
if (agent === "pnpm" && existsSync2(resolve2(options.cwd ?? process3.cwd(), "pnpm-workspace.yaml")))
|
||||
args.unshift("-w");
|
||||
return x2(
|
||||
agent,
|
||||
[
|
||||
agent === "yarn" ? "remove" : "uninstall",
|
||||
options.dev ? "-D" : "",
|
||||
...args,
|
||||
...names
|
||||
].filter(Boolean),
|
||||
{
|
||||
nodeOptions: {
|
||||
stdio: options.silent ? "ignore" : "inherit",
|
||||
cwd: options.cwd
|
||||
},
|
||||
throwOnError: true
|
||||
}
|
||||
);
|
||||
}
|
||||
export {
|
||||
detectPackageManager,
|
||||
installPackage,
|
||||
uninstallPackage
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue