@pipelab/plugin-discord 1.0.0-beta.16 → 1.0.0-beta.17
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path
|
|
1
|
+
import path from "node:path";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { execSync, spawn } from "node:child_process";
|
|
@@ -160,7 +160,7 @@ const parse = function(p) {
|
|
|
160
160
|
name: base.slice(0, base.length - extension.length)
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
|
-
const path = {
|
|
163
|
+
const path$1 = {
|
|
164
164
|
__proto__: null,
|
|
165
165
|
basename: basename$1,
|
|
166
166
|
delimiter: ":",
|
|
@@ -181,7 +181,7 @@ const path = {
|
|
|
181
181
|
//#region ../../node_modules/untun/dist/chunks/index.mjs
|
|
182
182
|
const CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || "2023.10.0";
|
|
183
183
|
const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
|
|
184
|
-
const cloudflaredBinPath = path.join(tmpdir(), "node-untun", process.platform === "win32" ? `cloudflared.${CLOUDFLARED_VERSION}.exe` : `cloudflared.${CLOUDFLARED_VERSION}`);
|
|
184
|
+
const cloudflaredBinPath = path$1.join(tmpdir(), "node-untun", process.platform === "win32" ? `cloudflared.${CLOUDFLARED_VERSION}.exe` : `cloudflared.${CLOUDFLARED_VERSION}`);
|
|
185
185
|
const cloudflaredNotice = `
|
|
186
186
|
\u{1F525} Your installation of cloudflared software constitutes a symbol of your signature
|
|
187
187
|
indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.
|
|
@@ -232,9 +232,9 @@ async function installMacos(to, version = CLOUDFLARED_VERSION) {
|
|
|
232
232
|
if (file === void 0) throw new Error("Unsupported architecture: " + process.arch);
|
|
233
233
|
await download(resolveBase(version) + file, `${to}.tgz`);
|
|
234
234
|
process.env.DEBUG && console.log(`Extracting to ${to}`);
|
|
235
|
-
execSync(`tar -xzf ${path
|
|
235
|
+
execSync(`tar -xzf ${path.basename(`${to}.tgz`)}`, { cwd: path.dirname(to) });
|
|
236
236
|
fs.unlinkSync(`${to}.tgz`);
|
|
237
|
-
fs.renameSync(`${path
|
|
237
|
+
fs.renameSync(`${path.dirname(to)}/cloudflared`, to);
|
|
238
238
|
return to;
|
|
239
239
|
}
|
|
240
240
|
async function installWindows(to, version = CLOUDFLARED_VERSION) {
|
|
@@ -247,7 +247,7 @@ function download(url, to, redirect = 0) {
|
|
|
247
247
|
if (redirect === 0) process.env.DEBUG && console.log(`Downloading ${url} to ${to}`);
|
|
248
248
|
else process.env.DEBUG && console.log(`Redirecting to ${url}`);
|
|
249
249
|
return new Promise((resolve, reject) => {
|
|
250
|
-
if (!fs.existsSync(path
|
|
250
|
+
if (!fs.existsSync(path.dirname(to))) fs.mkdirSync(path.dirname(to), { recursive: true });
|
|
251
251
|
let done = true;
|
|
252
252
|
const file = fs.createWriteStream(to);
|
|
253
253
|
const request = https.get(url, (res) => {
|
|
@@ -327,4 +327,4 @@ function startCloudflaredTunnel(options = {}) {
|
|
|
327
327
|
//#endregion
|
|
328
328
|
export { cloudflaredBinPath, cloudflaredNotice, installCloudflared, startCloudflaredTunnel };
|
|
329
329
|
|
|
330
|
-
//# sourceMappingURL=chunks-
|
|
330
|
+
//# sourceMappingURL=chunks-DUObX0Hn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks-DUObX0Hn.mjs","names":["sep","delimiter","join","dirname","basename","path","path","path$1"],"sources":["../../../node_modules/untun/node_modules/pathe/dist/shared/pathe.ff20891b.mjs","../../../node_modules/untun/dist/chunks/index.mjs"],"sourcesContent":["const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\\//;\nfunction normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n return input.replace(/\\\\/g, \"/\").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());\n}\n\nconst _UNC_REGEX = /^[/\\\\]{2}/;\nconst _IS_ABSOLUTE_RE = /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;\nconst _DRIVE_LETTER_RE = /^[A-Za-z]:$/;\nconst _ROOT_FOLDER_RE = /^\\/([A-Za-z]:)?$/;\nconst sep = \"/\";\nconst delimiter = \":\";\nconst normalize = function(path) {\n if (path.length === 0) {\n return \".\";\n }\n path = normalizeWindowsPath(path);\n const isUNCPath = path.match(_UNC_REGEX);\n const isPathAbsolute = isAbsolute(path);\n const trailingSeparator = path[path.length - 1] === \"/\";\n path = normalizeString(path, !isPathAbsolute);\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n if (trailingSeparator) {\n path += \"/\";\n }\n if (_DRIVE_LETTER_RE.test(path)) {\n path += \"/\";\n }\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n};\nconst join = function(...arguments_) {\n if (arguments_.length === 0) {\n return \".\";\n }\n let joined;\n for (const argument of arguments_) {\n if (argument && argument.length > 0) {\n if (joined === void 0) {\n joined = argument;\n } else {\n joined += `/${argument}`;\n }\n }\n }\n if (joined === void 0) {\n return \".\";\n }\n return normalize(joined.replace(/\\/\\/+/g, \"/\"));\n};\nfunction cwd() {\n if (typeof process !== \"undefined\" && typeof process.cwd === \"function\") {\n return process.cwd().replace(/\\\\/g, \"/\");\n }\n return \"/\";\n}\nconst resolve = function(...arguments_) {\n arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));\n let resolvedPath = \"\";\n let resolvedAbsolute = false;\n for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {\n const path = index >= 0 ? arguments_[index] : cwd();\n if (!path || path.length === 0) {\n continue;\n }\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = isAbsolute(path);\n }\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);\n if (resolvedAbsolute && !isAbsolute(resolvedPath)) {\n return `/${resolvedPath}`;\n }\n return resolvedPath.length > 0 ? resolvedPath : \".\";\n};\nfunction normalizeString(path, allowAboveRoot) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n char = path[index];\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== \".\" || res[res.length - 2] !== \".\") {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\nconst isAbsolute = function(p) {\n return _IS_ABSOLUTE_RE.test(p);\n};\nconst toNamespacedPath = function(p) {\n return normalizeWindowsPath(p);\n};\nconst _EXTNAME_RE = /.(\\.[^./]+)$/;\nconst extname = function(p) {\n const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));\n return match && match[1] || \"\";\n};\nconst relative = function(from, to) {\n const _from = resolve(from).replace(_ROOT_FOLDER_RE, \"$1\").split(\"/\");\n const _to = resolve(to).replace(_ROOT_FOLDER_RE, \"$1\").split(\"/\");\n if (_to[0][1] === \":\" && _from[0][1] === \":\" && _from[0] !== _to[0]) {\n return _to.join(\"/\");\n }\n const _fromCopy = [..._from];\n for (const segment of _fromCopy) {\n if (_to[0] !== segment) {\n break;\n }\n _from.shift();\n _to.shift();\n }\n return [..._from.map(() => \"..\"), ..._to].join(\"/\");\n};\nconst dirname = function(p) {\n const segments = normalizeWindowsPath(p).replace(/\\/$/, \"\").split(\"/\").slice(0, -1);\n if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {\n segments[0] += \"/\";\n }\n return segments.join(\"/\") || (isAbsolute(p) ? \"/\" : \".\");\n};\nconst format = function(p) {\n const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);\n return normalizeWindowsPath(\n p.root ? resolve(...segments) : segments.join(\"/\")\n );\n};\nconst basename = function(p, extension) {\n const lastSegment = normalizeWindowsPath(p).split(\"/\").pop();\n return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;\n};\nconst parse = function(p) {\n const root = normalizeWindowsPath(p).split(\"/\").shift() || \"/\";\n const base = basename(p);\n const extension = extname(base);\n return {\n root,\n dir: dirname(p),\n base,\n ext: extension,\n name: base.slice(0, base.length - extension.length)\n };\n};\n\nconst path = {\n __proto__: null,\n basename: basename,\n delimiter: delimiter,\n dirname: dirname,\n extname: extname,\n format: format,\n isAbsolute: isAbsolute,\n join: join,\n normalize: normalize,\n normalizeString: normalizeString,\n parse: parse,\n relative: relative,\n resolve: resolve,\n sep: sep,\n toNamespacedPath: toNamespacedPath\n};\n\nexport { normalize as a, normalizeString as b, relative as c, delimiter as d, extname as e, dirname as f, format as g, basename as h, isAbsolute as i, join as j, parse as k, normalizeWindowsPath as n, path as p, resolve as r, sep as s, toNamespacedPath as t };\n","import { tmpdir } from 'node:os';\nimport path from 'pathe';\nimport fs from 'node:fs';\nimport path$1 from 'node:path';\nimport https from 'node:https';\nimport { execSync, spawn } from 'node:child_process';\n\nconst CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || \"2023.10.0\";\nconst RELEASE_BASE = \"https://github.com/cloudflare/cloudflared/releases/\";\nconst cloudflaredBinPath = path.join(\n tmpdir(),\n \"node-untun\",\n process.platform === \"win32\" ? `cloudflared.${CLOUDFLARED_VERSION}.exe` : `cloudflared.${CLOUDFLARED_VERSION}`\n);\nconst cloudflaredNotice = `\n\\u{1F525} Your installation of cloudflared software constitutes a symbol of your signature\n indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.\n\n\\u276F License: \\`https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/license/\\`\n\\u276F Terms: \\`https://www.cloudflare.com/terms/\\`\n\\u276F Privacy Policy: \\`https://www.cloudflare.com/privacypolicy/\\`\n`;\nconst connRegex = /connection[ =]([\\da-z-]+)/i;\nconst ipRegex = /ip=([\\d.]+)/;\nconst locationRegex = /location=([A-Z]+)/;\nconst indexRegex = /connIndex=(\\d)/;\n\nconst LINUX_URL = {\n arm64: \"cloudflared-linux-arm64\",\n arm: \"cloudflared-linux-arm\",\n x64: \"cloudflared-linux-amd64\",\n ia32: \"cloudflared-linux-386\"\n};\nconst MACOS_URL = {\n arm64: \"cloudflared-darwin-amd64.tgz\",\n x64: \"cloudflared-darwin-amd64.tgz\"\n};\nconst WINDOWS_URL = {\n x64: \"cloudflared-windows-amd64.exe\",\n ia32: \"cloudflared-windows-386.exe\"\n};\nfunction resolveBase(version) {\n if (version === \"latest\") {\n return `${RELEASE_BASE}latest/download/`;\n }\n return `${RELEASE_BASE}download/${version}/`;\n}\nfunction installCloudflared(to = cloudflaredBinPath, version = CLOUDFLARED_VERSION) {\n switch (process.platform) {\n case \"linux\": {\n return installLinux(to, version);\n }\n case \"darwin\": {\n return installMacos(to, version);\n }\n case \"win32\": {\n return installWindows(to, version);\n }\n default: {\n throw new Error(\"Unsupported platform: \" + process.platform);\n }\n }\n}\nasync function installLinux(to, version = CLOUDFLARED_VERSION) {\n const file = LINUX_URL[process.arch];\n if (file === void 0) {\n throw new Error(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolveBase(version) + file, to);\n fs.chmodSync(to, \"755\");\n return to;\n}\nasync function installMacos(to, version = CLOUDFLARED_VERSION) {\n const file = MACOS_URL[process.arch];\n if (file === void 0) {\n throw new Error(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolveBase(version) + file, `${to}.tgz`);\n process.env.DEBUG && console.log(`Extracting to ${to}`);\n execSync(`tar -xzf ${path$1.basename(`${to}.tgz`)}`, { cwd: path$1.dirname(to) });\n fs.unlinkSync(`${to}.tgz`);\n fs.renameSync(`${path$1.dirname(to)}/cloudflared`, to);\n return to;\n}\nasync function installWindows(to, version = CLOUDFLARED_VERSION) {\n const file = WINDOWS_URL[process.arch];\n if (file === void 0) {\n throw new Error(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolveBase(version) + file, to);\n return to;\n}\nfunction download(url, to, redirect = 0) {\n if (redirect === 0) {\n process.env.DEBUG && console.log(`Downloading ${url} to ${to}`);\n } else {\n process.env.DEBUG && console.log(`Redirecting to ${url}`);\n }\n return new Promise((resolve, reject) => {\n if (!fs.existsSync(path$1.dirname(to))) {\n fs.mkdirSync(path$1.dirname(to), { recursive: true });\n }\n let done = true;\n const file = fs.createWriteStream(to);\n const request = https.get(url, (res) => {\n if (res.statusCode === 302 && res.headers.location !== void 0) {\n const redirection = res.headers.location;\n done = false;\n file.close(() => resolve(download(redirection, to, redirect + 1)));\n return;\n }\n res.pipe(file);\n });\n file.on(\"finish\", () => {\n if (done) {\n file.close(() => resolve(to));\n }\n });\n request.on(\"error\", (err) => {\n fs.unlink(to, () => reject(err));\n });\n file.on(\"error\", (err) => {\n fs.unlink(to, () => reject(err));\n });\n request.end();\n });\n}\n\nfunction startCloudflaredTunnel(options = {}) {\n const args = [\"tunnel\"];\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === \"string\") {\n args.push(`${key}`, value);\n } else if (typeof value === \"number\") {\n args.push(`${key}`, value.toString());\n } else if (value === null) {\n args.push(`${key}`);\n }\n }\n if (args.length === 1) {\n args.push(\"--url\", \"localhost:8080\");\n }\n const child = spawn(cloudflaredBinPath, args, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"]\n });\n if (process.env.DEBUG) {\n child.stdout.pipe(process.stdout);\n child.stderr.pipe(process.stderr);\n }\n const urlRegex = /\\|\\s+(https?:\\/\\/\\S+)/;\n let urlResolver = () => void 0;\n let urlRejector = () => void 0;\n const url = new Promise(\n (...pair) => [urlResolver, urlRejector] = pair\n );\n const connectionResolvers = [];\n const connectionRejectors = [];\n const connections = [];\n for (let i = 0; i < 1; i++) {\n connections.push(\n new Promise(\n (...pair) => [connectionResolvers[i], connectionRejectors[i]] = pair\n )\n );\n }\n const parser = (data) => {\n const str = data.toString();\n const urlMatch = str.match(urlRegex);\n urlMatch && urlResolver(urlMatch[1]);\n const connMatch = str.match(connRegex);\n const ipMatch = str.match(ipRegex);\n const locationMatch = str.match(locationRegex);\n const indexMatch = str.match(indexRegex);\n if (connMatch && ipMatch && locationMatch && indexMatch) {\n const [, id] = connMatch;\n const [, ip] = ipMatch;\n const [, location] = locationMatch;\n const [, idx] = indexMatch;\n connectionResolvers[+idx]?.({ id, ip, location });\n }\n };\n child.stdout.on(\"data\", parser).on(\"error\", urlRejector);\n child.stderr.on(\"data\", parser).on(\"error\", urlRejector);\n const stop = () => child.kill(\"SIGINT\");\n return { url, connections, child, stop };\n}\n\nexport { cloudflaredBinPath, cloudflaredNotice, installCloudflared, startCloudflaredTunnel };\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;AAAA,MAAM,yBAAyB;AAC/B,SAAS,qBAAqB,QAAQ,IAAI;AACxC,KAAI,CAAC,MACH,QAAO;AAET,QAAO,MAAM,QAAQ,OAAO,IAAI,CAAC,QAAQ,yBAAyB,MAA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E;EAAK;EAAa;EAAO;EAAM"}
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { a as __require, i as __reExport, n as __esmMin, o as __toESM, r as __ex
|
|
|
2
2
|
import { hostname } from "os";
|
|
3
3
|
import { basename, join, normalize } from "path";
|
|
4
4
|
import { formatWithOptions, types } from "util";
|
|
5
|
-
import path
|
|
5
|
+
import path, { basename as basename$1, delimiter, dirname, join as join$1, sep } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { constants } from "node:os";
|
|
8
8
|
import { appendFileSync, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -45429,7 +45429,7 @@ object({
|
|
|
45429
45429
|
var getFilename, getDirname, __dirname;
|
|
45430
45430
|
var init_esm_shims = __esmMin((() => {
|
|
45431
45431
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
45432
|
-
getDirname = () => path
|
|
45432
|
+
getDirname = () => path.dirname(getFilename());
|
|
45433
45433
|
__dirname = /* @__PURE__ */ getDirname();
|
|
45434
45434
|
}));
|
|
45435
45435
|
//#endregion
|
|
@@ -50376,33 +50376,33 @@ function toPath(urlOrPath) {
|
|
|
50376
50376
|
}
|
|
50377
50377
|
function traversePathUp(startPath) {
|
|
50378
50378
|
return { *[Symbol.iterator]() {
|
|
50379
|
-
let currentPath = path
|
|
50379
|
+
let currentPath = path.resolve(toPath(startPath));
|
|
50380
50380
|
let previousPath;
|
|
50381
50381
|
while (previousPath !== currentPath) {
|
|
50382
50382
|
yield currentPath;
|
|
50383
50383
|
previousPath = currentPath;
|
|
50384
|
-
currentPath = path
|
|
50384
|
+
currentPath = path.resolve(currentPath, "..");
|
|
50385
50385
|
}
|
|
50386
50386
|
} };
|
|
50387
50387
|
}
|
|
50388
50388
|
//#endregion
|
|
50389
50389
|
//#region ../../node_modules/npm-run-path/index.js
|
|
50390
50390
|
const npmRunPath = ({ cwd = g$1.cwd(), path: pathOption = g$1.env[pathKey()], preferLocal = true, execPath = g$1.execPath, addExecPath = true } = {}) => {
|
|
50391
|
-
const cwdPath = path
|
|
50391
|
+
const cwdPath = path.resolve(toPath(cwd));
|
|
50392
50392
|
const result = [];
|
|
50393
|
-
const pathParts = pathOption.split(path
|
|
50393
|
+
const pathParts = pathOption.split(path.delimiter);
|
|
50394
50394
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
50395
50395
|
if (addExecPath) applyExecPath(result, pathParts, execPath, cwdPath);
|
|
50396
|
-
return pathOption === "" || pathOption === path
|
|
50396
|
+
return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
|
|
50397
50397
|
};
|
|
50398
50398
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
50399
50399
|
for (const directory of traversePathUp(cwdPath)) {
|
|
50400
|
-
const pathPart = path
|
|
50400
|
+
const pathPart = path.join(directory, "node_modules/.bin");
|
|
50401
50401
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
50402
50402
|
}
|
|
50403
50403
|
};
|
|
50404
50404
|
const applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
50405
|
-
const pathPart = path
|
|
50405
|
+
const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
|
|
50406
50406
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
50407
50407
|
};
|
|
50408
50408
|
const npmRunPathEnv = ({ env = g$1.env, ...options } = {}) => {
|
|
@@ -51412,7 +51412,7 @@ const mapNode = ({ options }) => {
|
|
|
51412
51412
|
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath, ...options }) => {
|
|
51413
51413
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
51414
51414
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
51415
|
-
const resolvedNodePath = path
|
|
51415
|
+
const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
|
|
51416
51416
|
const newOptions = {
|
|
51417
51417
|
...options,
|
|
51418
51418
|
nodePath: resolvedNodePath,
|
|
@@ -51424,7 +51424,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
51424
51424
|
commandArguments,
|
|
51425
51425
|
newOptions
|
|
51426
51426
|
];
|
|
51427
|
-
if (path
|
|
51427
|
+
if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
|
|
51428
51428
|
return [
|
|
51429
51429
|
resolvedNodePath,
|
|
51430
51430
|
[
|
|
@@ -51508,7 +51508,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
|
|
|
51508
51508
|
//#region ../../packages/core-node/node_modules/execa/lib/arguments/cwd.js
|
|
51509
51509
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
51510
51510
|
const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
|
|
51511
|
-
return path
|
|
51511
|
+
return path.resolve(cwdString);
|
|
51512
51512
|
};
|
|
51513
51513
|
const getDefaultCwd = () => {
|
|
51514
51514
|
try {
|
|
@@ -51546,7 +51546,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
51546
51546
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
51547
51547
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
51548
51548
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
51549
|
-
if (g$1.platform === "win32" && path
|
|
51549
|
+
if (g$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
51550
51550
|
return {
|
|
51551
51551
|
file,
|
|
51552
51552
|
commandArguments,
|
|
@@ -150643,7 +150643,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150643
150643
|
}));
|
|
150644
150644
|
(/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
150645
150645
|
const { promisify: promisify$1 } = __require("util");
|
|
150646
|
-
const path = __require("path");
|
|
150646
|
+
const path$1 = __require("path");
|
|
150647
150647
|
const { createHash } = __require("crypto");
|
|
150648
150648
|
const { realpath, lstat, createReadStream: createReadStream$1, readdir: readdir$1 } = __require("fs");
|
|
150649
150649
|
const url = __require("url");
|
|
@@ -150660,7 +150660,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150660
150660
|
const etags = /* @__PURE__ */ new Map();
|
|
150661
150661
|
const calculateSha = (handlers, absolutePath) => new Promise((resolve, reject) => {
|
|
150662
150662
|
const hash = createHash("sha1");
|
|
150663
|
-
hash.update(path.extname(absolutePath));
|
|
150663
|
+
hash.update(path$1.extname(absolutePath));
|
|
150664
150664
|
hash.update("-");
|
|
150665
150665
|
const rs = handlers.createReadStream(absolutePath);
|
|
150666
150666
|
rs.on("error", reject);
|
|
@@ -150672,7 +150672,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150672
150672
|
const sourceMatches = (source, requestPath, allowSegments) => {
|
|
150673
150673
|
const keys = [];
|
|
150674
150674
|
const slashed = slasher(source);
|
|
150675
|
-
const resolvedPath = path.posix.resolve(requestPath);
|
|
150675
|
+
const resolvedPath = path$1.posix.resolve(requestPath);
|
|
150676
150676
|
let results = null;
|
|
150677
150677
|
if (allowSegments) {
|
|
150678
150678
|
results = pathToRegExp(slashed.replace("*", "(.*)"), keys).exec(resolvedPath);
|
|
@@ -150727,7 +150727,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150727
150727
|
};
|
|
150728
150728
|
}
|
|
150729
150729
|
if (slashing) {
|
|
150730
|
-
const { ext, name } = path.parse(decodedPath);
|
|
150730
|
+
const { ext, name } = path$1.parse(decodedPath);
|
|
150731
150731
|
const isTrailed = decodedPath.endsWith("/");
|
|
150732
150732
|
const isDotfile = name.startsWith(".");
|
|
150733
150733
|
let target = null;
|
|
@@ -150758,8 +150758,8 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150758
150758
|
const getHeaders = async (handlers, config, current, absolutePath, stats) => {
|
|
150759
150759
|
const { headers: customHeaders = [], etag = false } = config;
|
|
150760
150760
|
const related = {};
|
|
150761
|
-
const { base } = path.parse(absolutePath);
|
|
150762
|
-
const relativePath = path.relative(current, absolutePath);
|
|
150761
|
+
const { base } = path$1.parse(absolutePath);
|
|
150762
|
+
const relativePath = path$1.relative(current, absolutePath);
|
|
150763
150763
|
if (customHeaders.length > 0) for (let index = 0; index < customHeaders.length; index++) {
|
|
150764
150764
|
const { source, headers } = customHeaders[index];
|
|
150765
150765
|
if (sourceMatches(source, slasher(relativePath))) appendHeaders(related, headers);
|
|
@@ -150797,13 +150797,13 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150797
150797
|
}
|
|
150798
150798
|
return true;
|
|
150799
150799
|
};
|
|
150800
|
-
const getPossiblePaths = (relativePath, extension) => [path.join(relativePath, `index${extension}`), relativePath.endsWith("/") ? relativePath.replace(/\/$/g, extension) : relativePath + extension].filter((item) => path.basename(item) !== extension);
|
|
150800
|
+
const getPossiblePaths = (relativePath, extension) => [path$1.join(relativePath, `index${extension}`), relativePath.endsWith("/") ? relativePath.replace(/\/$/g, extension) : relativePath + extension].filter((item) => path$1.basename(item) !== extension);
|
|
150801
150801
|
const findRelated = async (current, relativePath, rewrittenPath, originalStat) => {
|
|
150802
150802
|
const possible = rewrittenPath ? [rewrittenPath] : getPossiblePaths(relativePath, ".html");
|
|
150803
150803
|
let stats = null;
|
|
150804
150804
|
for (let index = 0; index < possible.length; index++) {
|
|
150805
150805
|
const related = possible[index];
|
|
150806
|
-
const absolutePath = path.join(current, related);
|
|
150806
|
+
const absolutePath = path$1.join(current, related);
|
|
150807
150807
|
try {
|
|
150808
150808
|
stats = await originalStat(absolutePath);
|
|
150809
150809
|
} catch (err) {
|
|
@@ -150842,12 +150842,12 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150842
150842
|
const canRenderSingle = renderSingle && files.length === 1;
|
|
150843
150843
|
for (let index = 0; index < files.length; index++) {
|
|
150844
150844
|
const file = files[index];
|
|
150845
|
-
const filePath = path.resolve(absolutePath, file);
|
|
150846
|
-
const details = path.parse(filePath);
|
|
150845
|
+
const filePath = path$1.resolve(absolutePath, file);
|
|
150846
|
+
const details = path$1.parse(filePath);
|
|
150847
150847
|
let stats = null;
|
|
150848
150848
|
if (methods.lstat) stats = await handlers.lstat(filePath, true);
|
|
150849
150849
|
else stats = await handlers.lstat(filePath);
|
|
150850
|
-
details.relative = path.join(relativePath, details.base);
|
|
150850
|
+
details.relative = path$1.join(relativePath, details.base);
|
|
150851
150851
|
if (stats.isDirectory()) {
|
|
150852
150852
|
details.base += slashSuffix;
|
|
150853
150853
|
details.relative += slashSuffix;
|
|
@@ -150869,9 +150869,9 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150869
150869
|
if (canBeListed(excluded, file)) files[index] = details;
|
|
150870
150870
|
else delete files[index];
|
|
150871
150871
|
}
|
|
150872
|
-
const toRoot = path.relative(current, absolutePath);
|
|
150873
|
-
const directory = path.join(path.basename(current), toRoot, slashSuffix);
|
|
150874
|
-
const pathParts = directory.split(path.sep).filter(Boolean);
|
|
150872
|
+
const toRoot = path$1.relative(current, absolutePath);
|
|
150873
|
+
const directory = path$1.join(path$1.basename(current), toRoot, slashSuffix);
|
|
150874
|
+
const pathParts = directory.split(path$1.sep).filter(Boolean);
|
|
150875
150875
|
files = files.sort((a, b) => {
|
|
150876
150876
|
const aIsDir = a.type === "directory";
|
|
150877
150877
|
const bIsDir = b.type === "directory";
|
|
@@ -150885,7 +150885,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150885
150885
|
}).filter(Boolean);
|
|
150886
150886
|
if (toRoot.length > 0) {
|
|
150887
150887
|
const directoryPath = [...pathParts].slice(1);
|
|
150888
|
-
const relative = path.join("/", ...directoryPath, "..", slashSuffix);
|
|
150888
|
+
const relative = path$1.join("/", ...directoryPath, "..", slashSuffix);
|
|
150889
150889
|
files.unshift({
|
|
150890
150890
|
type: "directory",
|
|
150891
150891
|
base: "..",
|
|
@@ -150930,7 +150930,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150930
150930
|
return;
|
|
150931
150931
|
}
|
|
150932
150932
|
let stats = null;
|
|
150933
|
-
const errorPage = path.join(current, `${statusCode}.html`);
|
|
150933
|
+
const errorPage = path$1.join(current, `${statusCode}.html`);
|
|
150934
150934
|
try {
|
|
150935
150935
|
stats = await handlers.lstat(errorPage);
|
|
150936
150936
|
} catch (err) {
|
|
@@ -150975,7 +150975,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150975
150975
|
}, methods);
|
|
150976
150976
|
module.exports = async (request, response, config = {}, methods = {}) => {
|
|
150977
150977
|
const cwd = process.cwd();
|
|
150978
|
-
const current = config.public ? path.resolve(cwd, config.public) : cwd;
|
|
150978
|
+
const current = config.public ? path$1.resolve(cwd, config.public) : cwd;
|
|
150979
150979
|
const handlers = getHandlers(methods);
|
|
150980
150980
|
let relativePath = null;
|
|
150981
150981
|
let acceptsJSON = null;
|
|
@@ -150989,7 +150989,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150989
150989
|
message: "Bad Request"
|
|
150990
150990
|
});
|
|
150991
150991
|
}
|
|
150992
|
-
let absolutePath = path.join(current, relativePath);
|
|
150992
|
+
let absolutePath = path$1.join(current, relativePath);
|
|
150993
150993
|
if (!isPathInside(absolutePath, current)) return sendError(absolutePath, response, acceptsJSON, current, handlers, config, {
|
|
150994
150994
|
statusCode: 400,
|
|
150995
150995
|
code: "bad_request",
|
|
@@ -151003,7 +151003,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151003
151003
|
return;
|
|
151004
151004
|
}
|
|
151005
151005
|
let stats = null;
|
|
151006
|
-
if (path.extname(relativePath) !== "") try {
|
|
151006
|
+
if (path$1.extname(relativePath) !== "") try {
|
|
151007
151007
|
stats = await handlers.lstat(absolutePath);
|
|
151008
151008
|
} catch (err) {
|
|
151009
151009
|
if (err.code !== "ENOENT" && err.code !== "ENOTDIR") return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err);
|
|
@@ -151539,7 +151539,7 @@ async function resolveEntryPoint(packageDir, packageName) {
|
|
|
151539
151539
|
}
|
|
151540
151540
|
//#endregion
|
|
151541
151541
|
//#region ../../packages/core-node/src/handler-func.ts
|
|
151542
|
-
const { join: join$2 } = path
|
|
151542
|
+
const { join: join$2 } = path;
|
|
151543
151543
|
//#endregion
|
|
151544
151544
|
//#region ../../packages/core-node/src/handlers/plugins.ts
|
|
151545
151545
|
const localPluginsMap = /* @__PURE__ */ new Map();
|
|
@@ -152621,7 +152621,7 @@ const consola = createConsola();
|
|
|
152621
152621
|
//#endregion
|
|
152622
152622
|
//#region ../../node_modules/untun/dist/index.mjs
|
|
152623
152623
|
async function startTunnel(opts) {
|
|
152624
|
-
const { installCloudflared, startCloudflaredTunnel, cloudflaredBinPath, cloudflaredNotice } = await import("./chunks-
|
|
152624
|
+
const { installCloudflared, startCloudflaredTunnel, cloudflaredBinPath, cloudflaredNotice } = await import("./chunks-DUObX0Hn.mjs");
|
|
152625
152625
|
const url = opts.url || `${opts.protocol || "http"}://${opts.hostname ?? "localhost"}:${opts.port ?? 3e3}`;
|
|
152626
152626
|
consola.start(`Starting cloudflared tunnel to ${url}`);
|
|
152627
152627
|
if (!existsSync(cloudflaredBinPath)) {
|