@pipelab/cli 2.0.0-beta.14 → 2.0.0-beta.16
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/index.mjs +45 -12
- package/package.json +1 -1
- package/{src-D_Ep0XH3.mjs → src-CHr-wGNr.mjs} +1 -1
package/index.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import { promisify, stripVTControlCharacters, styleText } from "node:util";
|
|
|
17
17
|
import P, { platform as platform$1, stdin, stdout } from "node:process";
|
|
18
18
|
import { ReadStream } from "node:tty";
|
|
19
19
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
20
|
+
import dns from "node:dns/promises";
|
|
20
21
|
import * as _ from "node:readline";
|
|
21
22
|
import P$1, { createInterface } from "node:readline";
|
|
22
23
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -39232,7 +39233,7 @@ var require_auth = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
39232
39233
|
//#endregion
|
|
39233
39234
|
//#region ../../node_modules/make-fetch-happen/lib/options.js
|
|
39234
39235
|
var require_options$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
39235
|
-
const dns$
|
|
39236
|
+
const dns$3 = __require("dns");
|
|
39236
39237
|
const conditionalHeaders = [
|
|
39237
39238
|
"if-modified-since",
|
|
39238
39239
|
"if-none-match",
|
|
@@ -39257,7 +39258,7 @@ var require_options$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
39257
39258
|
};
|
|
39258
39259
|
options.dns = {
|
|
39259
39260
|
ttl: 300 * 1e3,
|
|
39260
|
-
lookup: dns$
|
|
39261
|
+
lookup: dns$3.lookup,
|
|
39261
39262
|
...options.dns
|
|
39262
39263
|
};
|
|
39263
39264
|
options.cache = options.cache || "default";
|
|
@@ -40674,9 +40675,9 @@ var require_key$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
40674
40675
|
//#region ../../node_modules/@npmcli/agent/lib/dns.js
|
|
40675
40676
|
var require_dns = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
40676
40677
|
const { LRUCache } = require_index_min$5();
|
|
40677
|
-
const dns$
|
|
40678
|
+
const dns$2 = __require("dns");
|
|
40678
40679
|
const cache = new LRUCache({ max: 50 });
|
|
40679
|
-
const getOptions = ({ family = 0, hints = dns$
|
|
40680
|
+
const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
|
|
40680
40681
|
hints,
|
|
40681
40682
|
lookup: (hostname, ...args) => {
|
|
40682
40683
|
const callback = args.pop();
|
|
@@ -45715,7 +45716,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
45715
45716
|
const socks_1 = require_build$1();
|
|
45716
45717
|
const agent_base_1 = require_dist$12();
|
|
45717
45718
|
const debug_1 = __importDefault(require_src$2());
|
|
45718
|
-
const dns = __importStar(__require("dns"));
|
|
45719
|
+
const dns$1 = __importStar(__require("dns"));
|
|
45719
45720
|
const net$1 = __importStar(__require("net"));
|
|
45720
45721
|
const tls$1 = __importStar(__require("tls"));
|
|
45721
45722
|
const url_1$1 = __require("url");
|
|
@@ -45787,7 +45788,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
45787
45788
|
const { shouldLookup, proxy, timeout } = this;
|
|
45788
45789
|
if (!opts.host) throw new Error("No `host` defined!");
|
|
45789
45790
|
let { host } = opts;
|
|
45790
|
-
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
45791
|
+
const { port, lookup: lookupFn = dns$1.lookup } = opts;
|
|
45791
45792
|
if (shouldLookup) host = await new Promise((resolve, reject) => {
|
|
45792
45793
|
lookupFn(host, {}, (err, res) => {
|
|
45793
45794
|
if (err) reject(err);
|
|
@@ -66655,6 +66656,20 @@ async function withLock(key, fn) {
|
|
|
66655
66656
|
activeOperations.set(key, promise);
|
|
66656
66657
|
return promise;
|
|
66657
66658
|
}
|
|
66659
|
+
let isOnlineCached = null;
|
|
66660
|
+
let lastCheckTime = 0;
|
|
66661
|
+
async function isOnline() {
|
|
66662
|
+
const now = Date.now();
|
|
66663
|
+
if (isOnlineCached !== null && now - lastCheckTime < 1e4) return isOnlineCached;
|
|
66664
|
+
try {
|
|
66665
|
+
await Promise.race([dns.lookup("registry.npmjs.org"), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500))]);
|
|
66666
|
+
isOnlineCached = true;
|
|
66667
|
+
} catch {
|
|
66668
|
+
isOnlineCached = false;
|
|
66669
|
+
}
|
|
66670
|
+
lastCheckTime = now;
|
|
66671
|
+
return isOnlineCached;
|
|
66672
|
+
}
|
|
66658
66673
|
/**
|
|
66659
66674
|
* Robust utility to fetch, cache, and resolve an NPM package.
|
|
66660
66675
|
* Centralized in core-node to avoid circular dependencies.
|
|
@@ -66668,7 +66683,15 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
66668
66683
|
if (resolvedVersionOrRange === "local") resolvedVersionOrRange = "latest";
|
|
66669
66684
|
console.log(`[Fetcher] Resolving ${packageName}@${resolvedVersionOrRange || "latest"}...`);
|
|
66670
66685
|
const resolveStart = Date.now();
|
|
66671
|
-
|
|
66686
|
+
if (!await isOnline()) {
|
|
66687
|
+
console.warn(`[Fetcher] ${packageName}: offline mode detected (${Date.now() - resolveStart}ms), trying local fallback...`);
|
|
66688
|
+
const fallbackStart = Date.now();
|
|
66689
|
+
const fallbackVersion = await tryLocalFallback(resolvedVersionOrRange, /* @__PURE__ */ new Error("Offline"), baseDir, packageName);
|
|
66690
|
+
if (fallbackVersion) {
|
|
66691
|
+
resolvedVersion = fallbackVersion;
|
|
66692
|
+
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
66693
|
+
} else throw new Error(`Offline and no local fallback version available for ${packageName}`);
|
|
66694
|
+
} else try {
|
|
66672
66695
|
const cachePath = join(ctx.userDataPath, "cache", "pacote");
|
|
66673
66696
|
let packumentPromise = packumentRequests.get(packageName);
|
|
66674
66697
|
if (!packumentPromise) {
|
|
@@ -66678,7 +66701,16 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
66678
66701
|
const packument = await packumentPromise;
|
|
66679
66702
|
const versions = Object.keys(packument.versions);
|
|
66680
66703
|
const range = resolvedVersionOrRange || "latest";
|
|
66681
|
-
|
|
66704
|
+
let foundVersion = packument["dist-tags"]?.[range] || import_semver.default.maxSatisfying(versions, range);
|
|
66705
|
+
if (range === "latest" && ctx.releaseTag && ctx.releaseTag !== "latest") {
|
|
66706
|
+
const releaseTagVersion = packument["dist-tags"]?.[ctx.releaseTag];
|
|
66707
|
+
if (releaseTagVersion && import_semver.default.valid(releaseTagVersion)) {
|
|
66708
|
+
if (!foundVersion || import_semver.default.valid(foundVersion) && import_semver.default.gte(releaseTagVersion, foundVersion)) {
|
|
66709
|
+
console.log(`[Fetcher] Using release tag "${ctx.releaseTag}" (${releaseTagVersion}) instead of "latest" (${foundVersion || "none"}) for ${packageName}`);
|
|
66710
|
+
foundVersion = releaseTagVersion;
|
|
66711
|
+
} else if (foundVersion) console.warn(`[Fetcher] Tag "${ctx.releaseTag}" (${releaseTagVersion}) is older than "latest" (${foundVersion}) for ${packageName}, keeping "latest"`);
|
|
66712
|
+
}
|
|
66713
|
+
}
|
|
66682
66714
|
if (!foundVersion) throw new Error(`Package ${packageName}@${range} not found on npm (available tags: ${Object.keys(packument["dist-tags"] || {}).join(", ")})`);
|
|
66683
66715
|
resolvedVersion = foundVersion;
|
|
66684
66716
|
console.log(`[Fetcher] ${packageName}: Resolved to v${resolvedVersion} via npm (${Date.now() - resolveStart}ms)`);
|
|
@@ -67189,7 +67221,8 @@ const builtInPlugins = async (options) => {
|
|
|
67189
67221
|
console.log(`[Plugins] Environment preparation took ${Date.now() - envStart}ms`);
|
|
67190
67222
|
const { usePlugins } = await import("./src-XVe3IQMi.mjs");
|
|
67191
67223
|
const { registerPlugins } = usePlugins();
|
|
67192
|
-
const { webSocketServer } = await import("./src-
|
|
67224
|
+
const { webSocketServer } = await import("./src-CHr-wGNr.mjs");
|
|
67225
|
+
webSocketServer.broadcast("startup:progress", { type: "ready" });
|
|
67193
67226
|
(async () => {
|
|
67194
67227
|
const totalStart = Date.now();
|
|
67195
67228
|
const pluginsToLoad = /* @__PURE__ */ new Map();
|
|
@@ -67234,7 +67267,7 @@ const builtInPlugins = async (options) => {
|
|
|
67234
67267
|
console.log(`[Plugins] All startup plugins loaded in ${Date.now() - totalStart}ms.`);
|
|
67235
67268
|
sendStartupProgress("All plugins loaded.");
|
|
67236
67269
|
setTimeout(() => {
|
|
67237
|
-
webSocketServer.broadcast("startup:progress", { type: "
|
|
67270
|
+
webSocketServer.broadcast("startup:progress", { type: "done" });
|
|
67238
67271
|
}, 2e3);
|
|
67239
67272
|
})();
|
|
67240
67273
|
};
|
|
@@ -68443,7 +68476,7 @@ async function runPipelineCommand(file, options, version) {
|
|
|
68443
68476
|
}
|
|
68444
68477
|
//#endregion
|
|
68445
68478
|
//#region package.json
|
|
68446
|
-
var version$2 = "2.0.0-beta.
|
|
68479
|
+
var version$2 = "2.0.0-beta.16";
|
|
68447
68480
|
//#endregion
|
|
68448
68481
|
//#region src/paths.ts
|
|
68449
68482
|
const getDefaultUserDataPath = () => {
|
|
@@ -76519,4 +76552,4 @@ program.hook("postAction", (thisCommand) => {
|
|
|
76519
76552
|
program.parse(process.argv);
|
|
76520
76553
|
if (!process.argv.slice(2).length) program.outputHelp();
|
|
76521
76554
|
//#endregion
|
|
76522
|
-
export {
|
|
76555
|
+
export { useAPI as A, registerHistoryHandlers as C, registerShellHandlers as D, registerFsHandlers as E, getDefaultUserDataPath$1 as M, projectRoot as N, WebSocketServer as O, registerMigrationHandlers as S, registerConfigHandlers as T, isOnline as _, executeGraphWithHistory as a, sendStartupReady as b, findInstalledPlugins as c, handleActionExecute as d, ensureNodeJS as f, fetchPipelabPlugin as g, fetchPipelabAsset as h, registerEngineHandlers as i, PipelabContext as j, webSocketServer as k, loadCustomPlugin as l, fetchPackage as m, registerAllHandlers as n, getFinalPlugins as o, ensurePNPM as p, registerAgentsHandlers as r, builtInPlugins as s, runPipelineCommand as t, loadPipelabPlugin as u, runPnpm as v, BuildHistoryStorage as w, serveCommand as x, sendStartupProgress as y };
|
package/package.json
CHANGED