@pipelab/plugin-discord 1.0.0-beta.15 → 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.cjs
CHANGED
|
@@ -26,6 +26,8 @@ let node_v8 = require("node:v8");
|
|
|
26
26
|
let node_stream_promises = require("node:stream/promises");
|
|
27
27
|
let node_stream = require("node:stream");
|
|
28
28
|
let node_buffer = require("node:buffer");
|
|
29
|
+
let node_dns_promises = require("node:dns/promises");
|
|
30
|
+
node_dns_promises = require_chunk.__toESM(node_dns_promises);
|
|
29
31
|
let fs_promises = require("fs/promises");
|
|
30
32
|
//#region ../../packages/migration/src/models/createMigration.ts
|
|
31
33
|
function createMigration$1(migration) {
|
|
@@ -123823,7 +123825,7 @@ var require_auth = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
|
|
|
123823
123825
|
//#endregion
|
|
123824
123826
|
//#region ../../node_modules/make-fetch-happen/lib/options.js
|
|
123825
123827
|
var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
123826
|
-
const dns$
|
|
123828
|
+
const dns$3 = require("dns");
|
|
123827
123829
|
const conditionalHeaders = [
|
|
123828
123830
|
"if-modified-since",
|
|
123829
123831
|
"if-none-match",
|
|
@@ -123848,7 +123850,7 @@ var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
123848
123850
|
};
|
|
123849
123851
|
options.dns = {
|
|
123850
123852
|
ttl: 300 * 1e3,
|
|
123851
|
-
lookup: dns$
|
|
123853
|
+
lookup: dns$3.lookup,
|
|
123852
123854
|
...options.dns
|
|
123853
123855
|
};
|
|
123854
123856
|
options.cache = options.cache || "default";
|
|
@@ -125265,9 +125267,9 @@ var require_key$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
125265
125267
|
//#region ../../node_modules/@npmcli/agent/lib/dns.js
|
|
125266
125268
|
var require_dns = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
125267
125269
|
const { LRUCache } = require_index_min$5();
|
|
125268
|
-
const dns$
|
|
125270
|
+
const dns$2 = require("dns");
|
|
125269
125271
|
const cache = new LRUCache({ max: 50 });
|
|
125270
|
-
const getOptions = ({ family = 0, hints = dns$
|
|
125272
|
+
const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
|
|
125271
125273
|
hints,
|
|
125272
125274
|
lookup: (hostname, ...args) => {
|
|
125273
125275
|
const callback = args.pop();
|
|
@@ -130306,7 +130308,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
|
130306
130308
|
const socks_1 = require_build$1();
|
|
130307
130309
|
const agent_base_1 = require_dist$12();
|
|
130308
130310
|
const debug_1 = __importDefault(require_src$1());
|
|
130309
|
-
const dns = __importStar(require("dns"));
|
|
130311
|
+
const dns$1 = __importStar(require("dns"));
|
|
130310
130312
|
const net$1 = __importStar(require("net"));
|
|
130311
130313
|
const tls$1 = __importStar(require("tls"));
|
|
130312
130314
|
const url_1$1 = require("url");
|
|
@@ -130378,7 +130380,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
|
130378
130380
|
const { shouldLookup, proxy, timeout } = this;
|
|
130379
130381
|
if (!opts.host) throw new Error("No `host` defined!");
|
|
130380
130382
|
let { host } = opts;
|
|
130381
|
-
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
130383
|
+
const { port, lookup: lookupFn = dns$1.lookup } = opts;
|
|
130382
130384
|
if (shouldLookup) host = await new Promise((resolve, reject) => {
|
|
130383
130385
|
lookupFn(host, {}, (err, res) => {
|
|
130384
130386
|
if (err) reject(err);
|
|
@@ -151147,6 +151149,20 @@ async function withLock(key, fn) {
|
|
|
151147
151149
|
activeOperations.set(key, promise);
|
|
151148
151150
|
return promise;
|
|
151149
151151
|
}
|
|
151152
|
+
let isOnlineCached = null;
|
|
151153
|
+
let lastCheckTime = 0;
|
|
151154
|
+
async function isOnline() {
|
|
151155
|
+
const now = Date.now();
|
|
151156
|
+
if (isOnlineCached !== null && now - lastCheckTime < 1e4) return isOnlineCached;
|
|
151157
|
+
try {
|
|
151158
|
+
await Promise.race([node_dns_promises.default.lookup("registry.npmjs.org"), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500))]);
|
|
151159
|
+
isOnlineCached = true;
|
|
151160
|
+
} catch {
|
|
151161
|
+
isOnlineCached = false;
|
|
151162
|
+
}
|
|
151163
|
+
lastCheckTime = now;
|
|
151164
|
+
return isOnlineCached;
|
|
151165
|
+
}
|
|
151150
151166
|
/**
|
|
151151
151167
|
* Robust utility to fetch, cache, and resolve an NPM package.
|
|
151152
151168
|
* Centralized in core-node to avoid circular dependencies.
|
|
@@ -151173,7 +151189,15 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151173
151189
|
if (resolvedVersionOrRange === "local") resolvedVersionOrRange = "latest";
|
|
151174
151190
|
console.log(`[Fetcher] Resolving ${packageName}@${resolvedVersionOrRange || "latest"}...`);
|
|
151175
151191
|
const resolveStart = Date.now();
|
|
151176
|
-
|
|
151192
|
+
if (!await isOnline()) {
|
|
151193
|
+
console.warn(`[Fetcher] ${packageName}: offline mode detected (${Date.now() - resolveStart}ms), trying local fallback...`);
|
|
151194
|
+
const fallbackStart = Date.now();
|
|
151195
|
+
const fallbackVersion = await tryLocalFallback(resolvedVersionOrRange, /* @__PURE__ */ new Error("Offline"), baseDir, packageName);
|
|
151196
|
+
if (fallbackVersion) {
|
|
151197
|
+
resolvedVersion = fallbackVersion;
|
|
151198
|
+
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
151199
|
+
} else throw new Error(`Offline and no local fallback version available for ${packageName}`);
|
|
151200
|
+
} else try {
|
|
151177
151201
|
const cachePath = (0, node_path.join)(ctx.userDataPath, "cache", "pacote");
|
|
151178
151202
|
let packumentPromise = packumentRequests.get(packageName);
|
|
151179
151203
|
if (!packumentPromise) {
|
|
@@ -151183,7 +151207,16 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151183
151207
|
const packument = await packumentPromise;
|
|
151184
151208
|
const versions = Object.keys(packument.versions);
|
|
151185
151209
|
const range = resolvedVersionOrRange || "latest";
|
|
151186
|
-
|
|
151210
|
+
let foundVersion = packument["dist-tags"]?.[range] || import_semver.default.maxSatisfying(versions, range);
|
|
151211
|
+
if (range === "latest" && ctx.releaseTag && ctx.releaseTag !== "latest") {
|
|
151212
|
+
const releaseTagVersion = packument["dist-tags"]?.[ctx.releaseTag];
|
|
151213
|
+
if (releaseTagVersion && import_semver.default.valid(releaseTagVersion)) {
|
|
151214
|
+
if (!foundVersion || import_semver.default.valid(foundVersion) && import_semver.default.gte(releaseTagVersion, foundVersion)) {
|
|
151215
|
+
console.log(`[Fetcher] Using release tag "${ctx.releaseTag}" (${releaseTagVersion}) instead of "latest" (${foundVersion || "none"}) for ${packageName}`);
|
|
151216
|
+
foundVersion = releaseTagVersion;
|
|
151217
|
+
} else if (foundVersion) console.warn(`[Fetcher] Tag "${ctx.releaseTag}" (${releaseTagVersion}) is older than "latest" (${foundVersion}) for ${packageName}, keeping "latest"`);
|
|
151218
|
+
}
|
|
151219
|
+
}
|
|
151187
151220
|
if (!foundVersion) throw new Error(`Package ${packageName}@${range} not found on npm (available tags: ${Object.keys(packument["dist-tags"] || {}).join(", ")})`);
|
|
151188
151221
|
resolvedVersion = foundVersion;
|
|
151189
151222
|
console.log(`[Fetcher] ${packageName}: Resolved to v${resolvedVersion} via npm (${Date.now() - resolveStart}ms)`);
|
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";
|
|
@@ -21,6 +21,7 @@ import { serialize } from "node:v8";
|
|
|
21
21
|
import { finished, pipeline } from "node:stream/promises";
|
|
22
22
|
import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
|
|
23
23
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
24
|
+
import dns from "node:dns/promises";
|
|
24
25
|
import { cp as cp$1 } from "fs/promises";
|
|
25
26
|
//#region ../../packages/migration/src/models/createMigration.ts
|
|
26
27
|
function createMigration$1(migration) {
|
|
@@ -45428,7 +45429,7 @@ object({
|
|
|
45428
45429
|
var getFilename, getDirname, __dirname;
|
|
45429
45430
|
var init_esm_shims = __esmMin((() => {
|
|
45430
45431
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
45431
|
-
getDirname = () => path
|
|
45432
|
+
getDirname = () => path.dirname(getFilename());
|
|
45432
45433
|
__dirname = /* @__PURE__ */ getDirname();
|
|
45433
45434
|
}));
|
|
45434
45435
|
//#endregion
|
|
@@ -50375,33 +50376,33 @@ function toPath(urlOrPath) {
|
|
|
50375
50376
|
}
|
|
50376
50377
|
function traversePathUp(startPath) {
|
|
50377
50378
|
return { *[Symbol.iterator]() {
|
|
50378
|
-
let currentPath = path
|
|
50379
|
+
let currentPath = path.resolve(toPath(startPath));
|
|
50379
50380
|
let previousPath;
|
|
50380
50381
|
while (previousPath !== currentPath) {
|
|
50381
50382
|
yield currentPath;
|
|
50382
50383
|
previousPath = currentPath;
|
|
50383
|
-
currentPath = path
|
|
50384
|
+
currentPath = path.resolve(currentPath, "..");
|
|
50384
50385
|
}
|
|
50385
50386
|
} };
|
|
50386
50387
|
}
|
|
50387
50388
|
//#endregion
|
|
50388
50389
|
//#region ../../node_modules/npm-run-path/index.js
|
|
50389
50390
|
const npmRunPath = ({ cwd = g$1.cwd(), path: pathOption = g$1.env[pathKey()], preferLocal = true, execPath = g$1.execPath, addExecPath = true } = {}) => {
|
|
50390
|
-
const cwdPath = path
|
|
50391
|
+
const cwdPath = path.resolve(toPath(cwd));
|
|
50391
50392
|
const result = [];
|
|
50392
|
-
const pathParts = pathOption.split(path
|
|
50393
|
+
const pathParts = pathOption.split(path.delimiter);
|
|
50393
50394
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
50394
50395
|
if (addExecPath) applyExecPath(result, pathParts, execPath, cwdPath);
|
|
50395
|
-
return pathOption === "" || pathOption === path
|
|
50396
|
+
return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
|
|
50396
50397
|
};
|
|
50397
50398
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
50398
50399
|
for (const directory of traversePathUp(cwdPath)) {
|
|
50399
|
-
const pathPart = path
|
|
50400
|
+
const pathPart = path.join(directory, "node_modules/.bin");
|
|
50400
50401
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
50401
50402
|
}
|
|
50402
50403
|
};
|
|
50403
50404
|
const applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
50404
|
-
const pathPart = path
|
|
50405
|
+
const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
|
|
50405
50406
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
50406
50407
|
};
|
|
50407
50408
|
const npmRunPathEnv = ({ env = g$1.env, ...options } = {}) => {
|
|
@@ -51411,7 +51412,7 @@ const mapNode = ({ options }) => {
|
|
|
51411
51412
|
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath, ...options }) => {
|
|
51412
51413
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
51413
51414
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
51414
|
-
const resolvedNodePath = path
|
|
51415
|
+
const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
|
|
51415
51416
|
const newOptions = {
|
|
51416
51417
|
...options,
|
|
51417
51418
|
nodePath: resolvedNodePath,
|
|
@@ -51423,7 +51424,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
51423
51424
|
commandArguments,
|
|
51424
51425
|
newOptions
|
|
51425
51426
|
];
|
|
51426
|
-
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\".");
|
|
51427
51428
|
return [
|
|
51428
51429
|
resolvedNodePath,
|
|
51429
51430
|
[
|
|
@@ -51507,7 +51508,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
|
|
|
51507
51508
|
//#region ../../packages/core-node/node_modules/execa/lib/arguments/cwd.js
|
|
51508
51509
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
51509
51510
|
const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
|
|
51510
|
-
return path
|
|
51511
|
+
return path.resolve(cwdString);
|
|
51511
51512
|
};
|
|
51512
51513
|
const getDefaultCwd = () => {
|
|
51513
51514
|
try {
|
|
@@ -51545,7 +51546,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
51545
51546
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
51546
51547
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
51547
51548
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
51548
|
-
if (g$1.platform === "win32" && path
|
|
51549
|
+
if (g$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
51549
51550
|
return {
|
|
51550
51551
|
file,
|
|
51551
51552
|
commandArguments,
|
|
@@ -123822,7 +123823,7 @@ var require_auth = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
123822
123823
|
//#endregion
|
|
123823
123824
|
//#region ../../node_modules/make-fetch-happen/lib/options.js
|
|
123824
123825
|
var require_options$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
123825
|
-
const dns$
|
|
123826
|
+
const dns$3 = __require("dns");
|
|
123826
123827
|
const conditionalHeaders = [
|
|
123827
123828
|
"if-modified-since",
|
|
123828
123829
|
"if-none-match",
|
|
@@ -123847,7 +123848,7 @@ var require_options$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
123847
123848
|
};
|
|
123848
123849
|
options.dns = {
|
|
123849
123850
|
ttl: 300 * 1e3,
|
|
123850
|
-
lookup: dns$
|
|
123851
|
+
lookup: dns$3.lookup,
|
|
123851
123852
|
...options.dns
|
|
123852
123853
|
};
|
|
123853
123854
|
options.cache = options.cache || "default";
|
|
@@ -125264,9 +125265,9 @@ var require_key$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
125264
125265
|
//#region ../../node_modules/@npmcli/agent/lib/dns.js
|
|
125265
125266
|
var require_dns = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
125266
125267
|
const { LRUCache } = require_index_min$5();
|
|
125267
|
-
const dns$
|
|
125268
|
+
const dns$2 = __require("dns");
|
|
125268
125269
|
const cache = new LRUCache({ max: 50 });
|
|
125269
|
-
const getOptions = ({ family = 0, hints = dns$
|
|
125270
|
+
const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
|
|
125270
125271
|
hints,
|
|
125271
125272
|
lookup: (hostname, ...args) => {
|
|
125272
125273
|
const callback = args.pop();
|
|
@@ -130305,7 +130306,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130305
130306
|
const socks_1 = require_build$1();
|
|
130306
130307
|
const agent_base_1 = require_dist$12();
|
|
130307
130308
|
const debug_1 = __importDefault(require_src$1());
|
|
130308
|
-
const dns = __importStar(__require("dns"));
|
|
130309
|
+
const dns$1 = __importStar(__require("dns"));
|
|
130309
130310
|
const net$1 = __importStar(__require("net"));
|
|
130310
130311
|
const tls$1 = __importStar(__require("tls"));
|
|
130311
130312
|
const url_1$1 = __require("url");
|
|
@@ -130377,7 +130378,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130377
130378
|
const { shouldLookup, proxy, timeout } = this;
|
|
130378
130379
|
if (!opts.host) throw new Error("No `host` defined!");
|
|
130379
130380
|
let { host } = opts;
|
|
130380
|
-
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
130381
|
+
const { port, lookup: lookupFn = dns$1.lookup } = opts;
|
|
130381
130382
|
if (shouldLookup) host = await new Promise((resolve, reject) => {
|
|
130382
130383
|
lookupFn(host, {}, (err, res) => {
|
|
130383
130384
|
if (err) reject(err);
|
|
@@ -150642,7 +150643,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150642
150643
|
}));
|
|
150643
150644
|
(/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
150644
150645
|
const { promisify: promisify$1 } = __require("util");
|
|
150645
|
-
const path = __require("path");
|
|
150646
|
+
const path$1 = __require("path");
|
|
150646
150647
|
const { createHash } = __require("crypto");
|
|
150647
150648
|
const { realpath, lstat, createReadStream: createReadStream$1, readdir: readdir$1 } = __require("fs");
|
|
150648
150649
|
const url = __require("url");
|
|
@@ -150659,7 +150660,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150659
150660
|
const etags = /* @__PURE__ */ new Map();
|
|
150660
150661
|
const calculateSha = (handlers, absolutePath) => new Promise((resolve, reject) => {
|
|
150661
150662
|
const hash = createHash("sha1");
|
|
150662
|
-
hash.update(path.extname(absolutePath));
|
|
150663
|
+
hash.update(path$1.extname(absolutePath));
|
|
150663
150664
|
hash.update("-");
|
|
150664
150665
|
const rs = handlers.createReadStream(absolutePath);
|
|
150665
150666
|
rs.on("error", reject);
|
|
@@ -150671,7 +150672,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150671
150672
|
const sourceMatches = (source, requestPath, allowSegments) => {
|
|
150672
150673
|
const keys = [];
|
|
150673
150674
|
const slashed = slasher(source);
|
|
150674
|
-
const resolvedPath = path.posix.resolve(requestPath);
|
|
150675
|
+
const resolvedPath = path$1.posix.resolve(requestPath);
|
|
150675
150676
|
let results = null;
|
|
150676
150677
|
if (allowSegments) {
|
|
150677
150678
|
results = pathToRegExp(slashed.replace("*", "(.*)"), keys).exec(resolvedPath);
|
|
@@ -150726,7 +150727,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150726
150727
|
};
|
|
150727
150728
|
}
|
|
150728
150729
|
if (slashing) {
|
|
150729
|
-
const { ext, name } = path.parse(decodedPath);
|
|
150730
|
+
const { ext, name } = path$1.parse(decodedPath);
|
|
150730
150731
|
const isTrailed = decodedPath.endsWith("/");
|
|
150731
150732
|
const isDotfile = name.startsWith(".");
|
|
150732
150733
|
let target = null;
|
|
@@ -150757,8 +150758,8 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150757
150758
|
const getHeaders = async (handlers, config, current, absolutePath, stats) => {
|
|
150758
150759
|
const { headers: customHeaders = [], etag = false } = config;
|
|
150759
150760
|
const related = {};
|
|
150760
|
-
const { base } = path.parse(absolutePath);
|
|
150761
|
-
const relativePath = path.relative(current, absolutePath);
|
|
150761
|
+
const { base } = path$1.parse(absolutePath);
|
|
150762
|
+
const relativePath = path$1.relative(current, absolutePath);
|
|
150762
150763
|
if (customHeaders.length > 0) for (let index = 0; index < customHeaders.length; index++) {
|
|
150763
150764
|
const { source, headers } = customHeaders[index];
|
|
150764
150765
|
if (sourceMatches(source, slasher(relativePath))) appendHeaders(related, headers);
|
|
@@ -150796,13 +150797,13 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150796
150797
|
}
|
|
150797
150798
|
return true;
|
|
150798
150799
|
};
|
|
150799
|
-
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);
|
|
150800
150801
|
const findRelated = async (current, relativePath, rewrittenPath, originalStat) => {
|
|
150801
150802
|
const possible = rewrittenPath ? [rewrittenPath] : getPossiblePaths(relativePath, ".html");
|
|
150802
150803
|
let stats = null;
|
|
150803
150804
|
for (let index = 0; index < possible.length; index++) {
|
|
150804
150805
|
const related = possible[index];
|
|
150805
|
-
const absolutePath = path.join(current, related);
|
|
150806
|
+
const absolutePath = path$1.join(current, related);
|
|
150806
150807
|
try {
|
|
150807
150808
|
stats = await originalStat(absolutePath);
|
|
150808
150809
|
} catch (err) {
|
|
@@ -150841,12 +150842,12 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150841
150842
|
const canRenderSingle = renderSingle && files.length === 1;
|
|
150842
150843
|
for (let index = 0; index < files.length; index++) {
|
|
150843
150844
|
const file = files[index];
|
|
150844
|
-
const filePath = path.resolve(absolutePath, file);
|
|
150845
|
-
const details = path.parse(filePath);
|
|
150845
|
+
const filePath = path$1.resolve(absolutePath, file);
|
|
150846
|
+
const details = path$1.parse(filePath);
|
|
150846
150847
|
let stats = null;
|
|
150847
150848
|
if (methods.lstat) stats = await handlers.lstat(filePath, true);
|
|
150848
150849
|
else stats = await handlers.lstat(filePath);
|
|
150849
|
-
details.relative = path.join(relativePath, details.base);
|
|
150850
|
+
details.relative = path$1.join(relativePath, details.base);
|
|
150850
150851
|
if (stats.isDirectory()) {
|
|
150851
150852
|
details.base += slashSuffix;
|
|
150852
150853
|
details.relative += slashSuffix;
|
|
@@ -150868,9 +150869,9 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150868
150869
|
if (canBeListed(excluded, file)) files[index] = details;
|
|
150869
150870
|
else delete files[index];
|
|
150870
150871
|
}
|
|
150871
|
-
const toRoot = path.relative(current, absolutePath);
|
|
150872
|
-
const directory = path.join(path.basename(current), toRoot, slashSuffix);
|
|
150873
|
-
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);
|
|
150874
150875
|
files = files.sort((a, b) => {
|
|
150875
150876
|
const aIsDir = a.type === "directory";
|
|
150876
150877
|
const bIsDir = b.type === "directory";
|
|
@@ -150884,7 +150885,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150884
150885
|
}).filter(Boolean);
|
|
150885
150886
|
if (toRoot.length > 0) {
|
|
150886
150887
|
const directoryPath = [...pathParts].slice(1);
|
|
150887
|
-
const relative = path.join("/", ...directoryPath, "..", slashSuffix);
|
|
150888
|
+
const relative = path$1.join("/", ...directoryPath, "..", slashSuffix);
|
|
150888
150889
|
files.unshift({
|
|
150889
150890
|
type: "directory",
|
|
150890
150891
|
base: "..",
|
|
@@ -150929,7 +150930,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150929
150930
|
return;
|
|
150930
150931
|
}
|
|
150931
150932
|
let stats = null;
|
|
150932
|
-
const errorPage = path.join(current, `${statusCode}.html`);
|
|
150933
|
+
const errorPage = path$1.join(current, `${statusCode}.html`);
|
|
150933
150934
|
try {
|
|
150934
150935
|
stats = await handlers.lstat(errorPage);
|
|
150935
150936
|
} catch (err) {
|
|
@@ -150974,7 +150975,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150974
150975
|
}, methods);
|
|
150975
150976
|
module.exports = async (request, response, config = {}, methods = {}) => {
|
|
150976
150977
|
const cwd = process.cwd();
|
|
150977
|
-
const current = config.public ? path.resolve(cwd, config.public) : cwd;
|
|
150978
|
+
const current = config.public ? path$1.resolve(cwd, config.public) : cwd;
|
|
150978
150979
|
const handlers = getHandlers(methods);
|
|
150979
150980
|
let relativePath = null;
|
|
150980
150981
|
let acceptsJSON = null;
|
|
@@ -150988,7 +150989,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150988
150989
|
message: "Bad Request"
|
|
150989
150990
|
});
|
|
150990
150991
|
}
|
|
150991
|
-
let absolutePath = path.join(current, relativePath);
|
|
150992
|
+
let absolutePath = path$1.join(current, relativePath);
|
|
150992
150993
|
if (!isPathInside(absolutePath, current)) return sendError(absolutePath, response, acceptsJSON, current, handlers, config, {
|
|
150993
150994
|
statusCode: 400,
|
|
150994
150995
|
code: "bad_request",
|
|
@@ -151002,7 +151003,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151002
151003
|
return;
|
|
151003
151004
|
}
|
|
151004
151005
|
let stats = null;
|
|
151005
|
-
if (path.extname(relativePath) !== "") try {
|
|
151006
|
+
if (path$1.extname(relativePath) !== "") try {
|
|
151006
151007
|
stats = await handlers.lstat(absolutePath);
|
|
151007
151008
|
} catch (err) {
|
|
151008
151009
|
if (err.code !== "ENOENT" && err.code !== "ENOTDIR") return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err);
|
|
@@ -151146,6 +151147,20 @@ async function withLock(key, fn) {
|
|
|
151146
151147
|
activeOperations.set(key, promise);
|
|
151147
151148
|
return promise;
|
|
151148
151149
|
}
|
|
151150
|
+
let isOnlineCached = null;
|
|
151151
|
+
let lastCheckTime = 0;
|
|
151152
|
+
async function isOnline() {
|
|
151153
|
+
const now = Date.now();
|
|
151154
|
+
if (isOnlineCached !== null && now - lastCheckTime < 1e4) return isOnlineCached;
|
|
151155
|
+
try {
|
|
151156
|
+
await Promise.race([dns.lookup("registry.npmjs.org"), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500))]);
|
|
151157
|
+
isOnlineCached = true;
|
|
151158
|
+
} catch {
|
|
151159
|
+
isOnlineCached = false;
|
|
151160
|
+
}
|
|
151161
|
+
lastCheckTime = now;
|
|
151162
|
+
return isOnlineCached;
|
|
151163
|
+
}
|
|
151149
151164
|
/**
|
|
151150
151165
|
* Robust utility to fetch, cache, and resolve an NPM package.
|
|
151151
151166
|
* Centralized in core-node to avoid circular dependencies.
|
|
@@ -151172,7 +151187,15 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151172
151187
|
if (resolvedVersionOrRange === "local") resolvedVersionOrRange = "latest";
|
|
151173
151188
|
console.log(`[Fetcher] Resolving ${packageName}@${resolvedVersionOrRange || "latest"}...`);
|
|
151174
151189
|
const resolveStart = Date.now();
|
|
151175
|
-
|
|
151190
|
+
if (!await isOnline()) {
|
|
151191
|
+
console.warn(`[Fetcher] ${packageName}: offline mode detected (${Date.now() - resolveStart}ms), trying local fallback...`);
|
|
151192
|
+
const fallbackStart = Date.now();
|
|
151193
|
+
const fallbackVersion = await tryLocalFallback(resolvedVersionOrRange, /* @__PURE__ */ new Error("Offline"), baseDir, packageName);
|
|
151194
|
+
if (fallbackVersion) {
|
|
151195
|
+
resolvedVersion = fallbackVersion;
|
|
151196
|
+
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
151197
|
+
} else throw new Error(`Offline and no local fallback version available for ${packageName}`);
|
|
151198
|
+
} else try {
|
|
151176
151199
|
const cachePath = join$1(ctx.userDataPath, "cache", "pacote");
|
|
151177
151200
|
let packumentPromise = packumentRequests.get(packageName);
|
|
151178
151201
|
if (!packumentPromise) {
|
|
@@ -151182,7 +151205,16 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151182
151205
|
const packument = await packumentPromise;
|
|
151183
151206
|
const versions = Object.keys(packument.versions);
|
|
151184
151207
|
const range = resolvedVersionOrRange || "latest";
|
|
151185
|
-
|
|
151208
|
+
let foundVersion = packument["dist-tags"]?.[range] || import_semver.default.maxSatisfying(versions, range);
|
|
151209
|
+
if (range === "latest" && ctx.releaseTag && ctx.releaseTag !== "latest") {
|
|
151210
|
+
const releaseTagVersion = packument["dist-tags"]?.[ctx.releaseTag];
|
|
151211
|
+
if (releaseTagVersion && import_semver.default.valid(releaseTagVersion)) {
|
|
151212
|
+
if (!foundVersion || import_semver.default.valid(foundVersion) && import_semver.default.gte(releaseTagVersion, foundVersion)) {
|
|
151213
|
+
console.log(`[Fetcher] Using release tag "${ctx.releaseTag}" (${releaseTagVersion}) instead of "latest" (${foundVersion || "none"}) for ${packageName}`);
|
|
151214
|
+
foundVersion = releaseTagVersion;
|
|
151215
|
+
} else if (foundVersion) console.warn(`[Fetcher] Tag "${ctx.releaseTag}" (${releaseTagVersion}) is older than "latest" (${foundVersion}) for ${packageName}, keeping "latest"`);
|
|
151216
|
+
}
|
|
151217
|
+
}
|
|
151186
151218
|
if (!foundVersion) throw new Error(`Package ${packageName}@${range} not found on npm (available tags: ${Object.keys(packument["dist-tags"] || {}).join(", ")})`);
|
|
151187
151219
|
resolvedVersion = foundVersion;
|
|
151188
151220
|
console.log(`[Fetcher] ${packageName}: Resolved to v${resolvedVersion} via npm (${Date.now() - resolveStart}ms)`);
|
|
@@ -151507,7 +151539,7 @@ async function resolveEntryPoint(packageDir, packageName) {
|
|
|
151507
151539
|
}
|
|
151508
151540
|
//#endregion
|
|
151509
151541
|
//#region ../../packages/core-node/src/handler-func.ts
|
|
151510
|
-
const { join: join$2 } = path
|
|
151542
|
+
const { join: join$2 } = path;
|
|
151511
151543
|
//#endregion
|
|
151512
151544
|
//#region ../../packages/core-node/src/handlers/plugins.ts
|
|
151513
151545
|
const localPluginsMap = /* @__PURE__ */ new Map();
|
|
@@ -152589,7 +152621,7 @@ const consola = createConsola();
|
|
|
152589
152621
|
//#endregion
|
|
152590
152622
|
//#region ../../node_modules/untun/dist/index.mjs
|
|
152591
152623
|
async function startTunnel(opts) {
|
|
152592
|
-
const { installCloudflared, startCloudflaredTunnel, cloudflaredBinPath, cloudflaredNotice } = await import("./chunks-
|
|
152624
|
+
const { installCloudflared, startCloudflaredTunnel, cloudflaredBinPath, cloudflaredNotice } = await import("./chunks-DUObX0Hn.mjs");
|
|
152593
152625
|
const url = opts.url || `${opts.protocol || "http"}://${opts.hostname ?? "localhost"}:${opts.port ?? 3e3}`;
|
|
152594
152626
|
consola.start(`Starting cloudflared tunnel to ${url}`);
|
|
152595
152627
|
if (!existsSync(cloudflaredBinPath)) {
|