@pipelab/plugin-discord 1.0.0-beta.17 → 1.0.0-beta.19
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.
- package/dist/{chunks-DUObX0Hn.mjs → chunks-CfRneOgh.mjs} +7 -7
- package/dist/chunks-CfRneOgh.mjs.map +1 -0
- package/dist/index.cjs +457 -500
- package/dist/index.mjs +83 -126
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/chunks-DUObX0Hn.mjs.map +0 -1
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, { basename as basename$1, delimiter, dirname, join as join$1, sep } from "node:path";
|
|
5
|
+
import path$1, { 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";
|
|
@@ -2095,7 +2095,7 @@ const settingsMigratorInternal = createMigrator();
|
|
|
2095
2095
|
const defaultAppSettings = settingsMigratorInternal.createDefault({
|
|
2096
2096
|
locale: "en-US",
|
|
2097
2097
|
theme: "light",
|
|
2098
|
-
version: "
|
|
2098
|
+
version: "7.0.0",
|
|
2099
2099
|
autosave: true,
|
|
2100
2100
|
agents: [],
|
|
2101
2101
|
tours: {
|
|
@@ -2108,11 +2108,6 @@ const defaultAppSettings = settingsMigratorInternal.createDefault({
|
|
|
2108
2108
|
completed: false
|
|
2109
2109
|
}
|
|
2110
2110
|
},
|
|
2111
|
-
buildHistory: { retentionPolicy: {
|
|
2112
|
-
enabled: false,
|
|
2113
|
-
maxEntries: 50,
|
|
2114
|
-
maxAge: 30
|
|
2115
|
-
} },
|
|
2116
2111
|
plugins: DEFAULT_PLUGINS,
|
|
2117
2112
|
isInternalMigrationBannerClosed: false
|
|
2118
2113
|
});
|
|
@@ -2169,18 +2164,13 @@ settingsMigratorInternal.createMigrations({
|
|
|
2169
2164
|
return {
|
|
2170
2165
|
...rest,
|
|
2171
2166
|
agents: [],
|
|
2172
|
-
buildHistory: { retentionPolicy: {
|
|
2173
|
-
enabled: false,
|
|
2174
|
-
maxEntries: 50,
|
|
2175
|
-
maxAge: 30
|
|
2176
|
-
} },
|
|
2177
2167
|
plugins: DEFAULT_PLUGINS,
|
|
2178
2168
|
isInternalMigrationBannerClosed: false
|
|
2179
2169
|
};
|
|
2180
2170
|
}
|
|
2181
2171
|
}),
|
|
2182
2172
|
createMigration({
|
|
2183
|
-
version: "
|
|
2173
|
+
version: "7.0.0",
|
|
2184
2174
|
up: finalVersion
|
|
2185
2175
|
})
|
|
2186
2176
|
]
|
|
@@ -2199,7 +2189,7 @@ connectionsMigratorInternal.createMigrations({
|
|
|
2199
2189
|
});
|
|
2200
2190
|
const fileRepoMigratorInternal = createMigrator();
|
|
2201
2191
|
const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
2202
|
-
version: "
|
|
2192
|
+
version: "3.0.0",
|
|
2203
2193
|
projects: [{
|
|
2204
2194
|
id: "main",
|
|
2205
2195
|
name: "Default project",
|
|
@@ -2209,30 +2199,39 @@ const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
|
2209
2199
|
});
|
|
2210
2200
|
fileRepoMigratorInternal.createMigrations({
|
|
2211
2201
|
defaultValue: defaultFileRepo,
|
|
2212
|
-
migrations: [
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2202
|
+
migrations: [
|
|
2203
|
+
createMigration({
|
|
2204
|
+
version: "1.0.0",
|
|
2205
|
+
up: (state) => {
|
|
2206
|
+
const pipelines = Object.entries(state.data || {}).map(([id, file]) => {
|
|
2207
|
+
return {
|
|
2208
|
+
...file,
|
|
2209
|
+
id,
|
|
2210
|
+
project: "main"
|
|
2211
|
+
};
|
|
2212
|
+
});
|
|
2216
2213
|
return {
|
|
2217
|
-
...
|
|
2218
|
-
|
|
2219
|
-
|
|
2214
|
+
...state,
|
|
2215
|
+
projects: [{
|
|
2216
|
+
id: "main",
|
|
2217
|
+
name: "Default project",
|
|
2218
|
+
description: "The initial default project"
|
|
2219
|
+
}],
|
|
2220
|
+
pipelines
|
|
2220
2221
|
};
|
|
2221
|
-
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
up: finalVersion
|
|
2235
|
-
})]
|
|
2222
|
+
}
|
|
2223
|
+
}),
|
|
2224
|
+
createMigration({
|
|
2225
|
+
version: "2.0.0",
|
|
2226
|
+
up: (state) => {
|
|
2227
|
+
return { ...state };
|
|
2228
|
+
}
|
|
2229
|
+
}),
|
|
2230
|
+
createMigration({
|
|
2231
|
+
version: "3.0.0",
|
|
2232
|
+
up: finalVersion
|
|
2233
|
+
})
|
|
2234
|
+
]
|
|
2236
2235
|
});
|
|
2237
2236
|
const savedFileMigratorInternal = createMigrator();
|
|
2238
2237
|
const savedFileDefaultValue = savedFileMigratorInternal.createDefault({
|
|
@@ -2393,14 +2392,19 @@ object({
|
|
|
2393
2392
|
version: literal("1.0.0"),
|
|
2394
2393
|
data: optional(record(string(), SaveLocationValidator), {})
|
|
2395
2394
|
});
|
|
2396
|
-
const FileRepoProjectValidatorV2
|
|
2395
|
+
const FileRepoProjectValidatorV2 = object({
|
|
2397
2396
|
id: string(),
|
|
2398
2397
|
name: string(),
|
|
2399
2398
|
description: string()
|
|
2400
2399
|
});
|
|
2401
2400
|
object({
|
|
2402
2401
|
version: literal("2.0.0"),
|
|
2403
|
-
projects: array(FileRepoProjectValidatorV2
|
|
2402
|
+
projects: array(FileRepoProjectValidatorV2),
|
|
2403
|
+
pipelines: optional(array(SaveLocationValidator), [])
|
|
2404
|
+
});
|
|
2405
|
+
object({
|
|
2406
|
+
version: literal("3.0.0"),
|
|
2407
|
+
projects: array(FileRepoProjectValidatorV2),
|
|
2404
2408
|
pipelines: optional(array(SaveLocationValidator), [])
|
|
2405
2409
|
});
|
|
2406
2410
|
object({
|
|
@@ -2509,44 +2513,6 @@ object({
|
|
|
2509
2513
|
name: string(),
|
|
2510
2514
|
url: string()
|
|
2511
2515
|
})),
|
|
2512
|
-
buildHistory: object({ retentionPolicy: object({
|
|
2513
|
-
enabled: boolean(),
|
|
2514
|
-
maxEntries: number(),
|
|
2515
|
-
maxAge: number()
|
|
2516
|
-
}) })
|
|
2517
|
-
});
|
|
2518
|
-
object({
|
|
2519
|
-
theme: union([literal("light"), literal("dark")]),
|
|
2520
|
-
version: literal("8.0.0"),
|
|
2521
|
-
locale: union([
|
|
2522
|
-
literal("en-US"),
|
|
2523
|
-
literal("fr-FR"),
|
|
2524
|
-
literal("pt-BR"),
|
|
2525
|
-
literal("zh-CN"),
|
|
2526
|
-
literal("es-ES"),
|
|
2527
|
-
literal("de-DE")
|
|
2528
|
-
]),
|
|
2529
|
-
tours: object({
|
|
2530
|
-
dashboard: object({
|
|
2531
|
-
step: number(),
|
|
2532
|
-
completed: boolean()
|
|
2533
|
-
}),
|
|
2534
|
-
editor: object({
|
|
2535
|
-
step: number(),
|
|
2536
|
-
completed: boolean()
|
|
2537
|
-
})
|
|
2538
|
-
}),
|
|
2539
|
-
autosave: boolean(),
|
|
2540
|
-
agents: array(object({
|
|
2541
|
-
id: string(),
|
|
2542
|
-
name: string(),
|
|
2543
|
-
url: string()
|
|
2544
|
-
})),
|
|
2545
|
-
buildHistory: object({ retentionPolicy: object({
|
|
2546
|
-
enabled: boolean(),
|
|
2547
|
-
maxEntries: number(),
|
|
2548
|
-
maxAge: number()
|
|
2549
|
-
}) }),
|
|
2550
2516
|
plugins: array(object({
|
|
2551
2517
|
name: string(),
|
|
2552
2518
|
enabled: boolean(),
|
|
@@ -45410,26 +45376,12 @@ var WebSocketError = class extends Error {
|
|
|
45410
45376
|
const isWebSocketRequestMessage = (message) => {
|
|
45411
45377
|
return message && typeof message.channel === "string" && message.requestId;
|
|
45412
45378
|
};
|
|
45413
|
-
object({
|
|
45414
|
-
version: literal("1.0.0"),
|
|
45415
|
-
data: optional(record(string(), SaveLocationValidator), {})
|
|
45416
|
-
});
|
|
45417
|
-
const FileRepoProjectValidatorV2 = object({
|
|
45418
|
-
id: string(),
|
|
45419
|
-
name: string(),
|
|
45420
|
-
description: string()
|
|
45421
|
-
});
|
|
45422
|
-
object({
|
|
45423
|
-
version: literal("2.0.0"),
|
|
45424
|
-
projects: array(FileRepoProjectValidatorV2),
|
|
45425
|
-
pipelines: optional(array(SaveLocationValidator), [])
|
|
45426
|
-
});
|
|
45427
45379
|
//#endregion
|
|
45428
45380
|
//#region ../../node_modules/tsdown/esm-shims.js
|
|
45429
45381
|
var getFilename, getDirname, __dirname;
|
|
45430
45382
|
var init_esm_shims = __esmMin((() => {
|
|
45431
45383
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
45432
|
-
getDirname = () => path.dirname(getFilename());
|
|
45384
|
+
getDirname = () => path$1.dirname(getFilename());
|
|
45433
45385
|
__dirname = /* @__PURE__ */ getDirname();
|
|
45434
45386
|
}));
|
|
45435
45387
|
//#endregion
|
|
@@ -45455,6 +45407,11 @@ function findProjectRoot(startDir) {
|
|
|
45455
45407
|
return null;
|
|
45456
45408
|
}
|
|
45457
45409
|
const projectRoot = findProjectRoot(_dirname);
|
|
45410
|
+
const CacheFolder = {
|
|
45411
|
+
Actions: "actions",
|
|
45412
|
+
Pipelines: "pipelines",
|
|
45413
|
+
Pacote: "pacote"
|
|
45414
|
+
};
|
|
45458
45415
|
//#endregion
|
|
45459
45416
|
//#region ../../packages/core-node/node_modules/ws/lib/constants.js
|
|
45460
45417
|
var require_constants$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -50376,33 +50333,33 @@ function toPath(urlOrPath) {
|
|
|
50376
50333
|
}
|
|
50377
50334
|
function traversePathUp(startPath) {
|
|
50378
50335
|
return { *[Symbol.iterator]() {
|
|
50379
|
-
let currentPath = path.resolve(toPath(startPath));
|
|
50336
|
+
let currentPath = path$1.resolve(toPath(startPath));
|
|
50380
50337
|
let previousPath;
|
|
50381
50338
|
while (previousPath !== currentPath) {
|
|
50382
50339
|
yield currentPath;
|
|
50383
50340
|
previousPath = currentPath;
|
|
50384
|
-
currentPath = path.resolve(currentPath, "..");
|
|
50341
|
+
currentPath = path$1.resolve(currentPath, "..");
|
|
50385
50342
|
}
|
|
50386
50343
|
} };
|
|
50387
50344
|
}
|
|
50388
50345
|
//#endregion
|
|
50389
50346
|
//#region ../../node_modules/npm-run-path/index.js
|
|
50390
50347
|
const npmRunPath = ({ cwd = g$1.cwd(), path: pathOption = g$1.env[pathKey()], preferLocal = true, execPath = g$1.execPath, addExecPath = true } = {}) => {
|
|
50391
|
-
const cwdPath = path.resolve(toPath(cwd));
|
|
50348
|
+
const cwdPath = path$1.resolve(toPath(cwd));
|
|
50392
50349
|
const result = [];
|
|
50393
|
-
const pathParts = pathOption.split(path.delimiter);
|
|
50350
|
+
const pathParts = pathOption.split(path$1.delimiter);
|
|
50394
50351
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
50395
50352
|
if (addExecPath) applyExecPath(result, pathParts, execPath, cwdPath);
|
|
50396
|
-
return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
|
|
50353
|
+
return pathOption === "" || pathOption === path$1.delimiter ? `${result.join(path$1.delimiter)}${pathOption}` : [...result, pathOption].join(path$1.delimiter);
|
|
50397
50354
|
};
|
|
50398
50355
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
50399
50356
|
for (const directory of traversePathUp(cwdPath)) {
|
|
50400
|
-
const pathPart = path.join(directory, "node_modules/.bin");
|
|
50357
|
+
const pathPart = path$1.join(directory, "node_modules/.bin");
|
|
50401
50358
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
50402
50359
|
}
|
|
50403
50360
|
};
|
|
50404
50361
|
const applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
50405
|
-
const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
|
|
50362
|
+
const pathPart = path$1.resolve(cwdPath, toPath(execPath), "..");
|
|
50406
50363
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
50407
50364
|
};
|
|
50408
50365
|
const npmRunPathEnv = ({ env = g$1.env, ...options } = {}) => {
|
|
@@ -51412,7 +51369,7 @@ const mapNode = ({ options }) => {
|
|
|
51412
51369
|
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath, ...options }) => {
|
|
51413
51370
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
51414
51371
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
51415
|
-
const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
|
|
51372
|
+
const resolvedNodePath = path$1.resolve(cwd, normalizedNodePath);
|
|
51416
51373
|
const newOptions = {
|
|
51417
51374
|
...options,
|
|
51418
51375
|
nodePath: resolvedNodePath,
|
|
@@ -51424,7 +51381,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
51424
51381
|
commandArguments,
|
|
51425
51382
|
newOptions
|
|
51426
51383
|
];
|
|
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\".");
|
|
51384
|
+
if (path$1.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
|
|
51428
51385
|
return [
|
|
51429
51386
|
resolvedNodePath,
|
|
51430
51387
|
[
|
|
@@ -51508,7 +51465,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
|
|
|
51508
51465
|
//#region ../../packages/core-node/node_modules/execa/lib/arguments/cwd.js
|
|
51509
51466
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
51510
51467
|
const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
|
|
51511
|
-
return path.resolve(cwdString);
|
|
51468
|
+
return path$1.resolve(cwdString);
|
|
51512
51469
|
};
|
|
51513
51470
|
const getDefaultCwd = () => {
|
|
51514
51471
|
try {
|
|
@@ -51546,7 +51503,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
51546
51503
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
51547
51504
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
51548
51505
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
51549
|
-
if (g$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
51506
|
+
if (g$1.platform === "win32" && path$1.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
51550
51507
|
return {
|
|
51551
51508
|
file,
|
|
51552
51509
|
commandArguments,
|
|
@@ -150643,7 +150600,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150643
150600
|
}));
|
|
150644
150601
|
(/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
150645
150602
|
const { promisify: promisify$1 } = __require("util");
|
|
150646
|
-
const path
|
|
150603
|
+
const path = __require("path");
|
|
150647
150604
|
const { createHash } = __require("crypto");
|
|
150648
150605
|
const { realpath, lstat, createReadStream: createReadStream$1, readdir: readdir$1 } = __require("fs");
|
|
150649
150606
|
const url = __require("url");
|
|
@@ -150660,7 +150617,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150660
150617
|
const etags = /* @__PURE__ */ new Map();
|
|
150661
150618
|
const calculateSha = (handlers, absolutePath) => new Promise((resolve, reject) => {
|
|
150662
150619
|
const hash = createHash("sha1");
|
|
150663
|
-
hash.update(path
|
|
150620
|
+
hash.update(path.extname(absolutePath));
|
|
150664
150621
|
hash.update("-");
|
|
150665
150622
|
const rs = handlers.createReadStream(absolutePath);
|
|
150666
150623
|
rs.on("error", reject);
|
|
@@ -150672,7 +150629,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150672
150629
|
const sourceMatches = (source, requestPath, allowSegments) => {
|
|
150673
150630
|
const keys = [];
|
|
150674
150631
|
const slashed = slasher(source);
|
|
150675
|
-
const resolvedPath = path
|
|
150632
|
+
const resolvedPath = path.posix.resolve(requestPath);
|
|
150676
150633
|
let results = null;
|
|
150677
150634
|
if (allowSegments) {
|
|
150678
150635
|
results = pathToRegExp(slashed.replace("*", "(.*)"), keys).exec(resolvedPath);
|
|
@@ -150727,7 +150684,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150727
150684
|
};
|
|
150728
150685
|
}
|
|
150729
150686
|
if (slashing) {
|
|
150730
|
-
const { ext, name } = path
|
|
150687
|
+
const { ext, name } = path.parse(decodedPath);
|
|
150731
150688
|
const isTrailed = decodedPath.endsWith("/");
|
|
150732
150689
|
const isDotfile = name.startsWith(".");
|
|
150733
150690
|
let target = null;
|
|
@@ -150758,8 +150715,8 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150758
150715
|
const getHeaders = async (handlers, config, current, absolutePath, stats) => {
|
|
150759
150716
|
const { headers: customHeaders = [], etag = false } = config;
|
|
150760
150717
|
const related = {};
|
|
150761
|
-
const { base } = path
|
|
150762
|
-
const relativePath = path
|
|
150718
|
+
const { base } = path.parse(absolutePath);
|
|
150719
|
+
const relativePath = path.relative(current, absolutePath);
|
|
150763
150720
|
if (customHeaders.length > 0) for (let index = 0; index < customHeaders.length; index++) {
|
|
150764
150721
|
const { source, headers } = customHeaders[index];
|
|
150765
150722
|
if (sourceMatches(source, slasher(relativePath))) appendHeaders(related, headers);
|
|
@@ -150797,13 +150754,13 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150797
150754
|
}
|
|
150798
150755
|
return true;
|
|
150799
150756
|
};
|
|
150800
|
-
const getPossiblePaths = (relativePath, extension) => [path
|
|
150757
|
+
const getPossiblePaths = (relativePath, extension) => [path.join(relativePath, `index${extension}`), relativePath.endsWith("/") ? relativePath.replace(/\/$/g, extension) : relativePath + extension].filter((item) => path.basename(item) !== extension);
|
|
150801
150758
|
const findRelated = async (current, relativePath, rewrittenPath, originalStat) => {
|
|
150802
150759
|
const possible = rewrittenPath ? [rewrittenPath] : getPossiblePaths(relativePath, ".html");
|
|
150803
150760
|
let stats = null;
|
|
150804
150761
|
for (let index = 0; index < possible.length; index++) {
|
|
150805
150762
|
const related = possible[index];
|
|
150806
|
-
const absolutePath = path
|
|
150763
|
+
const absolutePath = path.join(current, related);
|
|
150807
150764
|
try {
|
|
150808
150765
|
stats = await originalStat(absolutePath);
|
|
150809
150766
|
} catch (err) {
|
|
@@ -150842,12 +150799,12 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150842
150799
|
const canRenderSingle = renderSingle && files.length === 1;
|
|
150843
150800
|
for (let index = 0; index < files.length; index++) {
|
|
150844
150801
|
const file = files[index];
|
|
150845
|
-
const filePath = path
|
|
150846
|
-
const details = path
|
|
150802
|
+
const filePath = path.resolve(absolutePath, file);
|
|
150803
|
+
const details = path.parse(filePath);
|
|
150847
150804
|
let stats = null;
|
|
150848
150805
|
if (methods.lstat) stats = await handlers.lstat(filePath, true);
|
|
150849
150806
|
else stats = await handlers.lstat(filePath);
|
|
150850
|
-
details.relative = path
|
|
150807
|
+
details.relative = path.join(relativePath, details.base);
|
|
150851
150808
|
if (stats.isDirectory()) {
|
|
150852
150809
|
details.base += slashSuffix;
|
|
150853
150810
|
details.relative += slashSuffix;
|
|
@@ -150869,9 +150826,9 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150869
150826
|
if (canBeListed(excluded, file)) files[index] = details;
|
|
150870
150827
|
else delete files[index];
|
|
150871
150828
|
}
|
|
150872
|
-
const toRoot = path
|
|
150873
|
-
const directory = path
|
|
150874
|
-
const pathParts = directory.split(path
|
|
150829
|
+
const toRoot = path.relative(current, absolutePath);
|
|
150830
|
+
const directory = path.join(path.basename(current), toRoot, slashSuffix);
|
|
150831
|
+
const pathParts = directory.split(path.sep).filter(Boolean);
|
|
150875
150832
|
files = files.sort((a, b) => {
|
|
150876
150833
|
const aIsDir = a.type === "directory";
|
|
150877
150834
|
const bIsDir = b.type === "directory";
|
|
@@ -150885,7 +150842,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150885
150842
|
}).filter(Boolean);
|
|
150886
150843
|
if (toRoot.length > 0) {
|
|
150887
150844
|
const directoryPath = [...pathParts].slice(1);
|
|
150888
|
-
const relative = path
|
|
150845
|
+
const relative = path.join("/", ...directoryPath, "..", slashSuffix);
|
|
150889
150846
|
files.unshift({
|
|
150890
150847
|
type: "directory",
|
|
150891
150848
|
base: "..",
|
|
@@ -150930,7 +150887,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150930
150887
|
return;
|
|
150931
150888
|
}
|
|
150932
150889
|
let stats = null;
|
|
150933
|
-
const errorPage = path
|
|
150890
|
+
const errorPage = path.join(current, `${statusCode}.html`);
|
|
150934
150891
|
try {
|
|
150935
150892
|
stats = await handlers.lstat(errorPage);
|
|
150936
150893
|
} catch (err) {
|
|
@@ -150975,7 +150932,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150975
150932
|
}, methods);
|
|
150976
150933
|
module.exports = async (request, response, config = {}, methods = {}) => {
|
|
150977
150934
|
const cwd = process.cwd();
|
|
150978
|
-
const current = config.public ? path
|
|
150935
|
+
const current = config.public ? path.resolve(cwd, config.public) : cwd;
|
|
150979
150936
|
const handlers = getHandlers(methods);
|
|
150980
150937
|
let relativePath = null;
|
|
150981
150938
|
let acceptsJSON = null;
|
|
@@ -150989,7 +150946,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150989
150946
|
message: "Bad Request"
|
|
150990
150947
|
});
|
|
150991
150948
|
}
|
|
150992
|
-
let absolutePath = path
|
|
150949
|
+
let absolutePath = path.join(current, relativePath);
|
|
150993
150950
|
if (!isPathInside(absolutePath, current)) return sendError(absolutePath, response, acceptsJSON, current, handlers, config, {
|
|
150994
150951
|
statusCode: 400,
|
|
150995
150952
|
code: "bad_request",
|
|
@@ -151003,7 +150960,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151003
150960
|
return;
|
|
151004
150961
|
}
|
|
151005
150962
|
let stats = null;
|
|
151006
|
-
if (path
|
|
150963
|
+
if (path.extname(relativePath) !== "") try {
|
|
151007
150964
|
stats = await handlers.lstat(absolutePath);
|
|
151008
150965
|
} catch (err) {
|
|
151009
150966
|
if (err.code !== "ENOENT" && err.code !== "ENOTDIR") return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err);
|
|
@@ -151196,7 +151153,7 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151196
151153
|
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
151197
151154
|
} else throw new Error(`Offline and no local fallback version available for ${packageName}`);
|
|
151198
151155
|
} else try {
|
|
151199
|
-
const cachePath =
|
|
151156
|
+
const cachePath = ctx.getCachePath(CacheFolder.Pacote);
|
|
151200
151157
|
let packumentPromise = packumentRequests.get(packageName);
|
|
151201
151158
|
if (!packumentPromise) {
|
|
151202
151159
|
packumentPromise = import_lib.default.packument(packageName, { cache: cachePath });
|
|
@@ -151227,7 +151184,7 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151227
151184
|
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
151228
151185
|
} else throw error;
|
|
151229
151186
|
}
|
|
151230
|
-
const cachePath =
|
|
151187
|
+
const cachePath = ctx.getCachePath(CacheFolder.Pacote);
|
|
151231
151188
|
const packageDir = join$1(baseDir, resolvedVersion);
|
|
151232
151189
|
const checkStart = Date.now();
|
|
151233
151190
|
const isInstalled = options?.installDeps ? isPackageComplete(packageDir) && isDependenciesInstalledSync(packageDir) : isPackageComplete(packageDir);
|
|
@@ -151304,7 +151261,7 @@ async function runPnpm(cwd, options) {
|
|
|
151304
151261
|
...process.env,
|
|
151305
151262
|
NODE_ENV: "production",
|
|
151306
151263
|
PATH: nodePath ? `${dirname(nodePath)}${delimiter}${process.env.PATH}` : process.env.PATH,
|
|
151307
|
-
PNPM_HOME:
|
|
151264
|
+
PNPM_HOME: ctx.getPnpmPath(),
|
|
151308
151265
|
PNPM_ONLY_ALLOW_TRUSTED_DEPENDENCIES: "false",
|
|
151309
151266
|
...extraEnv
|
|
151310
151267
|
}
|
|
@@ -151539,7 +151496,7 @@ async function resolveEntryPoint(packageDir, packageName) {
|
|
|
151539
151496
|
}
|
|
151540
151497
|
//#endregion
|
|
151541
151498
|
//#region ../../packages/core-node/src/handler-func.ts
|
|
151542
|
-
const { join: join$2 } = path;
|
|
151499
|
+
const { join: join$2 } = path$1;
|
|
151543
151500
|
//#endregion
|
|
151544
151501
|
//#region ../../packages/core-node/src/handlers/plugins.ts
|
|
151545
151502
|
const localPluginsMap = /* @__PURE__ */ new Map();
|
|
@@ -152621,7 +152578,7 @@ const consola = createConsola();
|
|
|
152621
152578
|
//#endregion
|
|
152622
152579
|
//#region ../../node_modules/untun/dist/index.mjs
|
|
152623
152580
|
async function startTunnel(opts) {
|
|
152624
|
-
const { installCloudflared, startCloudflaredTunnel, cloudflaredBinPath, cloudflaredNotice } = await import("./chunks-
|
|
152581
|
+
const { installCloudflared, startCloudflaredTunnel, cloudflaredBinPath, cloudflaredNotice } = await import("./chunks-CfRneOgh.mjs");
|
|
152625
152582
|
const url = opts.url || `${opts.protocol || "http"}://${opts.hostname ?? "localhost"}:${opts.port ?? 3e3}`;
|
|
152626
152583
|
consola.start(`Starting cloudflared tunnel to ${url}`);
|
|
152627
152584
|
if (!existsSync(cloudflaredBinPath)) {
|