@pipelab/plugin-tauri 1.0.0-beta.14 → 1.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/dist/index.cjs +211 -115
- package/dist/index.mjs +188 -93
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -6
package/dist/index.cjs
CHANGED
|
@@ -8,11 +8,11 @@ let node_os = require("node:os");
|
|
|
8
8
|
let node_url = require("node:url");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
10
10
|
node_fs = require_chunk.__toESM(node_fs);
|
|
11
|
+
let node_fs_promises = require("node:fs/promises");
|
|
12
|
+
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
11
13
|
let node_http = require("node:http");
|
|
12
14
|
node_http = require_chunk.__toESM(node_http);
|
|
13
15
|
let node_crypto = require("node:crypto");
|
|
14
|
-
let node_fs_promises = require("node:fs/promises");
|
|
15
|
-
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
16
16
|
let node_child_process = require("node:child_process");
|
|
17
17
|
let node_string_decoder = require("node:string_decoder");
|
|
18
18
|
let node_util = require("node:util");
|
|
@@ -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
|
//#region ../../packages/migration/src/models/createMigration.ts
|
|
30
32
|
function createMigration$1(migration) {
|
|
31
33
|
return {
|
|
@@ -1604,6 +1606,56 @@ function literal(literal_, message) {
|
|
|
1604
1606
|
}
|
|
1605
1607
|
};
|
|
1606
1608
|
}
|
|
1609
|
+
function looseObject(entries, message) {
|
|
1610
|
+
return {
|
|
1611
|
+
kind: "schema",
|
|
1612
|
+
type: "loose_object",
|
|
1613
|
+
reference: looseObject,
|
|
1614
|
+
expects: "Object",
|
|
1615
|
+
async: false,
|
|
1616
|
+
entries,
|
|
1617
|
+
message,
|
|
1618
|
+
_run(dataset, config2) {
|
|
1619
|
+
const input = dataset.value;
|
|
1620
|
+
if (input && typeof input === "object") {
|
|
1621
|
+
dataset.typed = true;
|
|
1622
|
+
dataset.value = {};
|
|
1623
|
+
for (const key in this.entries) {
|
|
1624
|
+
const value2 = input[key];
|
|
1625
|
+
const valueDataset = this.entries[key]._run({
|
|
1626
|
+
typed: false,
|
|
1627
|
+
value: value2
|
|
1628
|
+
}, config2);
|
|
1629
|
+
if (valueDataset.issues) {
|
|
1630
|
+
const pathItem = {
|
|
1631
|
+
type: "object",
|
|
1632
|
+
origin: "value",
|
|
1633
|
+
input,
|
|
1634
|
+
key,
|
|
1635
|
+
value: value2
|
|
1636
|
+
};
|
|
1637
|
+
for (const issue of valueDataset.issues) {
|
|
1638
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1639
|
+
else issue.path = [pathItem];
|
|
1640
|
+
dataset.issues?.push(issue);
|
|
1641
|
+
}
|
|
1642
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1643
|
+
if (config2.abortEarly) {
|
|
1644
|
+
dataset.typed = false;
|
|
1645
|
+
break;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1649
|
+
if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
|
|
1650
|
+
}
|
|
1651
|
+
if (!dataset.issues || !config2.abortEarly) {
|
|
1652
|
+
for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1653
|
+
}
|
|
1654
|
+
} else _addIssue(this, "type", dataset, config2);
|
|
1655
|
+
return dataset;
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1607
1659
|
function number(message) {
|
|
1608
1660
|
return {
|
|
1609
1661
|
kind: "schema",
|
|
@@ -2141,6 +2193,18 @@ settingsMigratorInternal.createMigrations({
|
|
|
2141
2193
|
})
|
|
2142
2194
|
]
|
|
2143
2195
|
});
|
|
2196
|
+
const connectionsMigratorInternal = createMigrator();
|
|
2197
|
+
const defaultConnections = connectionsMigratorInternal.createDefault({
|
|
2198
|
+
version: "1.0.0",
|
|
2199
|
+
connections: []
|
|
2200
|
+
});
|
|
2201
|
+
connectionsMigratorInternal.createMigrations({
|
|
2202
|
+
defaultValue: defaultConnections,
|
|
2203
|
+
migrations: [createMigration({
|
|
2204
|
+
version: "1.0.0",
|
|
2205
|
+
up: finalVersion
|
|
2206
|
+
})]
|
|
2207
|
+
});
|
|
2144
2208
|
const fileRepoMigratorInternal = createMigrator();
|
|
2145
2209
|
const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
2146
2210
|
version: "2.0.0",
|
|
@@ -2302,11 +2366,51 @@ const LEGACY_ID_MAP = {
|
|
|
2302
2366
|
};
|
|
2303
2367
|
const getStrictPluginId = (pluginId) => {
|
|
2304
2368
|
if (!pluginId) return pluginId;
|
|
2305
|
-
|
|
2306
|
-
if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
|
|
2307
|
-
const prefixed = `@pipelab/plugin-${pluginId}`;
|
|
2308
|
-
return LEGACY_ID_MAP[prefixed] || prefixed;
|
|
2369
|
+
return LEGACY_ID_MAP[pluginId] || pluginId;
|
|
2309
2370
|
};
|
|
2371
|
+
//#endregion
|
|
2372
|
+
//#region ../../packages/shared/src/save-location.ts
|
|
2373
|
+
const SaveLocationInternalValidator = object({
|
|
2374
|
+
id: string(),
|
|
2375
|
+
project: string(),
|
|
2376
|
+
lastModified: string(),
|
|
2377
|
+
type: literal("internal"),
|
|
2378
|
+
configName: string()
|
|
2379
|
+
});
|
|
2380
|
+
const SaveLocationValidator = union([
|
|
2381
|
+
object({
|
|
2382
|
+
id: string(),
|
|
2383
|
+
project: string(),
|
|
2384
|
+
path: string(),
|
|
2385
|
+
lastModified: string(),
|
|
2386
|
+
type: literal("external"),
|
|
2387
|
+
summary: object({
|
|
2388
|
+
plugins: array(string()),
|
|
2389
|
+
name: string(),
|
|
2390
|
+
description: string()
|
|
2391
|
+
})
|
|
2392
|
+
}),
|
|
2393
|
+
SaveLocationInternalValidator,
|
|
2394
|
+
object({
|
|
2395
|
+
id: string(),
|
|
2396
|
+
project: string(),
|
|
2397
|
+
type: literal("pipelab-cloud")
|
|
2398
|
+
})
|
|
2399
|
+
]);
|
|
2400
|
+
object({
|
|
2401
|
+
version: literal("1.0.0"),
|
|
2402
|
+
data: optional(record(string(), SaveLocationValidator), {})
|
|
2403
|
+
});
|
|
2404
|
+
const FileRepoProjectValidatorV2$1 = object({
|
|
2405
|
+
id: string(),
|
|
2406
|
+
name: string(),
|
|
2407
|
+
description: string()
|
|
2408
|
+
});
|
|
2409
|
+
object({
|
|
2410
|
+
version: literal("2.0.0"),
|
|
2411
|
+
projects: array(FileRepoProjectValidatorV2$1),
|
|
2412
|
+
pipelines: optional(array(SaveLocationValidator), [])
|
|
2413
|
+
});
|
|
2310
2414
|
object({
|
|
2311
2415
|
cacheFolder: string(),
|
|
2312
2416
|
theme: union([literal("light"), literal("dark")]),
|
|
@@ -2458,6 +2562,17 @@ object({
|
|
|
2458
2562
|
})),
|
|
2459
2563
|
isInternalMigrationBannerClosed: optional(boolean(), false)
|
|
2460
2564
|
});
|
|
2565
|
+
const ConnectionValidator = looseObject({
|
|
2566
|
+
id: string(),
|
|
2567
|
+
pluginName: string(),
|
|
2568
|
+
name: string(),
|
|
2569
|
+
createdAt: string(),
|
|
2570
|
+
isDefault: boolean()
|
|
2571
|
+
});
|
|
2572
|
+
object({
|
|
2573
|
+
version: literal("1.0.0"),
|
|
2574
|
+
connections: array(ConnectionValidator)
|
|
2575
|
+
});
|
|
2461
2576
|
//#endregion
|
|
2462
2577
|
//#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
|
|
2463
2578
|
const prettyLogStyles = {
|
|
@@ -2978,7 +3093,7 @@ const useLogger = () => {
|
|
|
2978
3093
|
const OriginValidator = object({
|
|
2979
3094
|
pluginId: string(),
|
|
2980
3095
|
nodeId: string(),
|
|
2981
|
-
version: pipe(
|
|
3096
|
+
version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
|
|
2982
3097
|
});
|
|
2983
3098
|
const BlockActionValidatorV1 = object({
|
|
2984
3099
|
type: literal("action"),
|
|
@@ -2991,7 +3106,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
|
|
|
2991
3106
|
const BlockActionValidatorV3 = object({
|
|
2992
3107
|
type: literal("action"),
|
|
2993
3108
|
uid: string(),
|
|
2994
|
-
name: pipe(
|
|
3109
|
+
name: optional(pipe(string(), description("A custom name provided by the user"))),
|
|
2995
3110
|
disabled: optional(boolean()),
|
|
2996
3111
|
params: record(string(), object({
|
|
2997
3112
|
editor: EditorParamValidatorV3,
|
|
@@ -45314,35 +45429,6 @@ const createBooleanParam = (value, definition) => {
|
|
|
45314
45429
|
};
|
|
45315
45430
|
};
|
|
45316
45431
|
//#endregion
|
|
45317
|
-
//#region ../../packages/shared/src/save-location.ts
|
|
45318
|
-
const SaveLocationInternalValidator = object({
|
|
45319
|
-
id: string(),
|
|
45320
|
-
project: string(),
|
|
45321
|
-
lastModified: string(),
|
|
45322
|
-
type: literal("internal"),
|
|
45323
|
-
configName: string()
|
|
45324
|
-
});
|
|
45325
|
-
const SaveLocationValidator = union([
|
|
45326
|
-
object({
|
|
45327
|
-
id: string(),
|
|
45328
|
-
project: string(),
|
|
45329
|
-
path: string(),
|
|
45330
|
-
lastModified: string(),
|
|
45331
|
-
type: literal("external"),
|
|
45332
|
-
summary: object({
|
|
45333
|
-
plugins: array(string()),
|
|
45334
|
-
name: string(),
|
|
45335
|
-
description: string()
|
|
45336
|
-
})
|
|
45337
|
-
}),
|
|
45338
|
-
SaveLocationInternalValidator,
|
|
45339
|
-
object({
|
|
45340
|
-
id: string(),
|
|
45341
|
-
project: string(),
|
|
45342
|
-
type: literal("pipelab-cloud")
|
|
45343
|
-
})
|
|
45344
|
-
]);
|
|
45345
|
-
//#endregion
|
|
45346
45432
|
//#region ../../packages/shared/src/websocket.types.ts
|
|
45347
45433
|
var WebSocketError = class extends Error {
|
|
45348
45434
|
constructor(message, code, requestId) {
|
|
@@ -45359,20 +45445,6 @@ object({
|
|
|
45359
45445
|
version: literal("1.0.0"),
|
|
45360
45446
|
data: optional(record(string(), SaveLocationValidator), {})
|
|
45361
45447
|
});
|
|
45362
|
-
const FileRepoProjectValidatorV2$1 = object({
|
|
45363
|
-
id: string(),
|
|
45364
|
-
name: string(),
|
|
45365
|
-
description: string()
|
|
45366
|
-
});
|
|
45367
|
-
object({
|
|
45368
|
-
version: literal("2.0.0"),
|
|
45369
|
-
projects: array(FileRepoProjectValidatorV2$1),
|
|
45370
|
-
pipelines: optional(array(SaveLocationValidator), [])
|
|
45371
|
-
});
|
|
45372
|
-
object({
|
|
45373
|
-
version: literal("1.0.0"),
|
|
45374
|
-
data: optional(record(string(), SaveLocationValidator), {})
|
|
45375
|
-
});
|
|
45376
45448
|
const FileRepoProjectValidatorV2 = object({
|
|
45377
45449
|
id: string(),
|
|
45378
45450
|
name: string(),
|
|
@@ -45384,8 +45456,26 @@ object({
|
|
|
45384
45456
|
pipelines: optional(array(SaveLocationValidator), [])
|
|
45385
45457
|
});
|
|
45386
45458
|
//#endregion
|
|
45459
|
+
//#region ../../packages/constants/src/index.ts
|
|
45460
|
+
/**
|
|
45461
|
+
* Get the binary name for a given platform
|
|
45462
|
+
* @param name
|
|
45463
|
+
* @param platform If not provided, it will try to use process.platform (Node.js only)
|
|
45464
|
+
* @returns
|
|
45465
|
+
*/
|
|
45466
|
+
const getBinName = (name, platform) => {
|
|
45467
|
+
const p = platform || (typeof process !== "undefined" ? process.platform : "unknown");
|
|
45468
|
+
if (p === "win32") return `${name}.exe`;
|
|
45469
|
+
if (p === "darwin") return `${name}.app/Contents/MacOS/${name}`;
|
|
45470
|
+
return name;
|
|
45471
|
+
};
|
|
45472
|
+
const websocketPort = 33753;
|
|
45473
|
+
const DEFAULT_NODE_VERSION = "24.14.1";
|
|
45474
|
+
const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
45475
|
+
//#endregion
|
|
45387
45476
|
//#region ../../packages/core-node/src/context.ts
|
|
45388
|
-
const
|
|
45477
|
+
const metaUrl = require("url").pathToFileURL(__filename).href;
|
|
45478
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
|
|
45389
45479
|
const isDev = process.env.NODE_ENV === "development";
|
|
45390
45480
|
/**
|
|
45391
45481
|
* Finds the monorepo root by looking for pnpm-workspace.yaml.
|
|
@@ -48957,21 +49047,6 @@ const useAPI = () => {
|
|
|
48957
49047
|
};
|
|
48958
49048
|
};
|
|
48959
49049
|
//#endregion
|
|
48960
|
-
//#region ../../packages/constants/src/index.ts
|
|
48961
|
-
/**
|
|
48962
|
-
* Get the binary name for a given platform
|
|
48963
|
-
* @param name
|
|
48964
|
-
* @param platform If not provided, it will try to use process.platform (Node.js only)
|
|
48965
|
-
* @returns
|
|
48966
|
-
*/
|
|
48967
|
-
const getBinName = (name, platform) => {
|
|
48968
|
-
const p = platform || (typeof process !== "undefined" ? process.platform : "unknown");
|
|
48969
|
-
if (p === "win32") return `${name}.exe`;
|
|
48970
|
-
if (p === "darwin") return `${name}.app/Contents/MacOS/${name}`;
|
|
48971
|
-
return name;
|
|
48972
|
-
};
|
|
48973
|
-
const websocketPort = 33753;
|
|
48974
|
-
//#endregion
|
|
48975
49050
|
//#region ../../packages/core-node/src/websocket-server.ts
|
|
48976
49051
|
var WebSocketServer = class {
|
|
48977
49052
|
wss = null;
|
|
@@ -59980,14 +60055,14 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
|
|
|
59980
60055
|
const assert$1 = require("assert");
|
|
59981
60056
|
const normalize = require_normalize_unicode();
|
|
59982
60057
|
const stripSlashes = require_strip_trailing_slashes();
|
|
59983
|
-
const { join: join$
|
|
60058
|
+
const { join: join$19 } = require("path");
|
|
59984
60059
|
const isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
|
|
59985
60060
|
module.exports = () => {
|
|
59986
60061
|
const queues = /* @__PURE__ */ new Map();
|
|
59987
60062
|
const reservations = /* @__PURE__ */ new Map();
|
|
59988
60063
|
const getDirs = (path$65) => {
|
|
59989
60064
|
return path$65.split("/").slice(0, -1).reduce((set, path$66) => {
|
|
59990
|
-
if (set.length) path$66 = join$
|
|
60065
|
+
if (set.length) path$66 = join$19(set[set.length - 1], path$66);
|
|
59991
60066
|
set.push(path$66 || "/");
|
|
59992
60067
|
return set;
|
|
59993
60068
|
}, []);
|
|
@@ -60041,7 +60116,7 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
|
|
|
60041
60116
|
};
|
|
60042
60117
|
const reserve = (paths, fn) => {
|
|
60043
60118
|
paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p) => {
|
|
60044
|
-
return stripSlashes(join$
|
|
60119
|
+
return stripSlashes(join$19(normalize(p))).toLowerCase();
|
|
60045
60120
|
});
|
|
60046
60121
|
const dirs = new Set(paths.map((path$70) => getDirs(path$70)).reduce((a, b) => a.concat(b)));
|
|
60047
60122
|
reservations.set(fn, {
|
|
@@ -89379,14 +89454,6 @@ var import_tar = /* @__PURE__ */ require_chunk.__toESM(require_tar$1(), 1);
|
|
|
89379
89454
|
var import_yauzl = /* @__PURE__ */ require_chunk.__toESM(require_yauzl(), 1);
|
|
89380
89455
|
require_archiver();
|
|
89381
89456
|
/**
|
|
89382
|
-
* Generates a unique temporary folder.
|
|
89383
|
-
*/
|
|
89384
|
-
const generateTempFolder = async (base) => {
|
|
89385
|
-
const targetBase = base || (0, node_os.tmpdir)();
|
|
89386
|
-
await (0, node_fs_promises.mkdir)(targetBase, { recursive: true });
|
|
89387
|
-
return await (0, node_fs_promises.mkdtemp)((0, node_path.join)(await (0, node_fs_promises.realpath)(targetBase), "pipelab-"));
|
|
89388
|
-
};
|
|
89389
|
-
/**
|
|
89390
89457
|
* Extracts a .tar.gz archive.
|
|
89391
89458
|
*/
|
|
89392
89459
|
async function extractTarGz(archivePath, destinationDir) {
|
|
@@ -95886,7 +95953,7 @@ var require_index_min$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
|
|
|
95886
95953
|
//#region ../../node_modules/@npmcli/promise-spawn/node_modules/which/lib/index.js
|
|
95887
95954
|
var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
95888
95955
|
const { isexe, sync: isexeSync } = require_index_min$3();
|
|
95889
|
-
const { join: join$
|
|
95956
|
+
const { join: join$16, delimiter: delimiter$4, sep: sep$4, posix: posix$1 } = require("path");
|
|
95890
95957
|
const isWindows = process.platform === "win32";
|
|
95891
95958
|
/* istanbul ignore next */
|
|
95892
95959
|
const rSlash = new RegExp(`[${posix$1.sep}${sep$4 === posix$1.sep ? "" : sep$4}]`.replace(/(\\)/g, "\\$1"));
|
|
@@ -95916,7 +95983,7 @@ var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
95916
95983
|
};
|
|
95917
95984
|
const getPathPart = (raw, cmd) => {
|
|
95918
95985
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
95919
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$
|
|
95986
|
+
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$16(pathPart, cmd);
|
|
95920
95987
|
};
|
|
95921
95988
|
const which = async (cmd, opt = {}) => {
|
|
95922
95989
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -96665,7 +96732,7 @@ var require_index_min$2 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
|
|
|
96665
96732
|
//#region ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
|
|
96666
96733
|
var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
96667
96734
|
const { isexe, sync: isexeSync } = require_index_min$2();
|
|
96668
|
-
const { join: join$
|
|
96735
|
+
const { join: join$15, delimiter: delimiter$3, sep: sep$3, posix } = require("path");
|
|
96669
96736
|
const isWindows = process.platform === "win32";
|
|
96670
96737
|
/* istanbul ignore next */
|
|
96671
96738
|
const rSlash = new RegExp(`[${posix.sep}${sep$3 === posix.sep ? "" : sep$3}]`.replace(/(\\)/g, "\\$1"));
|
|
@@ -96695,7 +96762,7 @@ var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
96695
96762
|
};
|
|
96696
96763
|
const getPathPart = (raw, cmd) => {
|
|
96697
96764
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
96698
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$
|
|
96765
|
+
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$15(pathPart, cmd);
|
|
96699
96766
|
};
|
|
96700
96767
|
const which = async (cmd, opt = {}) => {
|
|
96701
96768
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -98593,7 +98660,7 @@ var require_lib$22 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
98593
98660
|
//#endregion
|
|
98594
98661
|
//#region ../../node_modules/npm-normalize-package-bin/lib/index.js
|
|
98595
98662
|
var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
98596
|
-
const { join: join$
|
|
98663
|
+
const { join: join$14, basename: basename$5 } = require("path");
|
|
98597
98664
|
const normalize = (pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg);
|
|
98598
98665
|
const normalizeString = (pkg) => {
|
|
98599
98666
|
if (!pkg.name) return removeBin(pkg);
|
|
@@ -98616,9 +98683,9 @@ var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
98616
98683
|
const clean = {};
|
|
98617
98684
|
let hasBins = false;
|
|
98618
98685
|
Object.keys(orig).forEach((binKey) => {
|
|
98619
|
-
const base = join$
|
|
98686
|
+
const base = join$14("/", basename$5(binKey.replace(/\\|:/g, "/"))).slice(1);
|
|
98620
98687
|
if (typeof orig[binKey] !== "string" || !base) return;
|
|
98621
|
-
const binTarget = join$
|
|
98688
|
+
const binTarget = join$14("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
|
|
98622
98689
|
if (!binTarget) return;
|
|
98623
98690
|
clean[base] = binTarget;
|
|
98624
98691
|
hasBins = true;
|
|
@@ -100691,7 +100758,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100691
100758
|
const { ERR_FS_CP_DIR_TO_NON_DIR, ERR_FS_CP_EEXIST, ERR_FS_CP_EINVAL, ERR_FS_CP_FIFO_PIPE, ERR_FS_CP_NON_DIR_TO_DIR, ERR_FS_CP_SOCKET, ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, ERR_FS_CP_UNKNOWN, ERR_FS_EISDIR, ERR_INVALID_ARG_TYPE } = require_errors$3();
|
|
100692
100759
|
const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
|
|
100693
100760
|
const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$7, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
|
|
100694
|
-
const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$
|
|
100761
|
+
const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$13, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
|
|
100695
100762
|
const { fileURLToPath: fileURLToPath$1 } = require("url");
|
|
100696
100763
|
const defaultOptions = {
|
|
100697
100764
|
dereference: false,
|
|
@@ -100900,8 +100967,8 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100900
100967
|
const dir = await readdir$6(src);
|
|
100901
100968
|
for (let i = 0; i < dir.length; i++) {
|
|
100902
100969
|
const item = dir[i];
|
|
100903
|
-
const srcItem = join$
|
|
100904
|
-
const destItem = join$
|
|
100970
|
+
const srcItem = join$13(src, item);
|
|
100971
|
+
const destItem = join$13(dest, item);
|
|
100905
100972
|
const { destStat } = await checkPaths(srcItem, destItem, opts);
|
|
100906
100973
|
await startCopy(destStat, srcItem, destItem, opts);
|
|
100907
100974
|
}
|
|
@@ -100965,13 +101032,13 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
100965
101032
|
//#endregion
|
|
100966
101033
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/with-temp-dir.js
|
|
100967
101034
|
var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100968
|
-
const { join: join$
|
|
101035
|
+
const { join: join$12, sep: sep$1 } = require("path");
|
|
100969
101036
|
const getOptions = require_get_options();
|
|
100970
101037
|
const { mkdir: mkdir$6, mkdtemp, rm: rm$7 } = require("fs/promises");
|
|
100971
101038
|
const withTempDir = async (root, fn, opts) => {
|
|
100972
101039
|
const options = getOptions(opts, { copy: ["tmpPrefix"] });
|
|
100973
101040
|
await mkdir$6(root, { recursive: true });
|
|
100974
|
-
const target = await mkdtemp(join$
|
|
101041
|
+
const target = await mkdtemp(join$12(`${root}${sep$1}`, options.tmpPrefix || ""));
|
|
100975
101042
|
let err;
|
|
100976
101043
|
let result;
|
|
100977
101044
|
try {
|
|
@@ -100994,10 +101061,10 @@ var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((export
|
|
|
100994
101061
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/readdir-scoped.js
|
|
100995
101062
|
var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100996
101063
|
const { readdir: readdir$5 } = require("fs/promises");
|
|
100997
|
-
const { join: join$
|
|
101064
|
+
const { join: join$11 } = require("path");
|
|
100998
101065
|
const readdirScoped = async (dir) => {
|
|
100999
101066
|
const results = [];
|
|
101000
|
-
for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$
|
|
101067
|
+
for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$11(dir, item))) results.push(join$11(item, scopedItem));
|
|
101001
101068
|
else results.push(item);
|
|
101002
101069
|
return results;
|
|
101003
101070
|
};
|
|
@@ -101006,7 +101073,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
|
|
|
101006
101073
|
//#endregion
|
|
101007
101074
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
|
|
101008
101075
|
var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
101009
|
-
const { dirname: dirname$8, join: join$
|
|
101076
|
+
const { dirname: dirname$8, join: join$10, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
|
|
101010
101077
|
const fs$12 = require("fs/promises");
|
|
101011
101078
|
const pathExists = async (path$57) => {
|
|
101012
101079
|
try {
|
|
@@ -101031,7 +101098,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
101031
101098
|
const sourceStat = await fs$12.lstat(source);
|
|
101032
101099
|
if (sourceStat.isDirectory()) {
|
|
101033
101100
|
const files = await fs$12.readdir(source);
|
|
101034
|
-
await Promise.all(files.map((file) => moveFile(join$
|
|
101101
|
+
await Promise.all(files.map((file) => moveFile(join$10(source, file), join$10(destination, file), options, false, symlinks)));
|
|
101035
101102
|
} else if (sourceStat.isSymbolicLink()) symlinks.push({
|
|
101036
101103
|
source,
|
|
101037
101104
|
destination
|
|
@@ -110570,9 +110637,9 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
110570
110637
|
//#region ../../node_modules/pacote/lib/util/cache-dir.js
|
|
110571
110638
|
var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
110572
110639
|
const { resolve: resolve$7 } = require("node:path");
|
|
110573
|
-
const { tmpdir
|
|
110640
|
+
const { tmpdir, homedir: homedir$1 } = require("node:os");
|
|
110574
110641
|
module.exports = (fakePlatform = false) => {
|
|
110575
|
-
const temp = tmpdir
|
|
110642
|
+
const temp = tmpdir();
|
|
110576
110643
|
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
110577
110644
|
const home = homedir$1() || resolve$7(temp, "npm-" + uidOrPid);
|
|
110578
110645
|
const platform = fakePlatform || process.platform;
|
|
@@ -112394,7 +112461,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
112394
112461
|
var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112395
112462
|
const { Walker: IgnoreWalker } = require_lib$10();
|
|
112396
112463
|
const { lstatSync: lstat$1, readFileSync: readFile$5 } = require("fs");
|
|
112397
|
-
const { basename: basename$3, dirname: dirname$6, extname: extname$1, join: join$
|
|
112464
|
+
const { basename: basename$3, dirname: dirname$6, extname: extname$1, join: join$9, relative, resolve: resolve$6, sep } = require("path");
|
|
112398
112465
|
const { log } = require_lib$29();
|
|
112399
112466
|
const defaultRules = Symbol("npm-packlist.rules.default");
|
|
112400
112467
|
const strictRules = Symbol("npm-packlist.rules.strict");
|
|
@@ -112427,7 +112494,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112427
112494
|
const normalizePath = (path$49) => path$49.split("\\").join("/");
|
|
112428
112495
|
const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
|
|
112429
112496
|
for (const file of [".npmignore", ".gitignore"]) try {
|
|
112430
|
-
const ignoreContent = readFile$5(join$
|
|
112497
|
+
const ignoreContent = readFile$5(join$9(root, file), { encoding: "utf8" });
|
|
112431
112498
|
result.push(ignoreContent);
|
|
112432
112499
|
break;
|
|
112433
112500
|
} catch (err) {
|
|
@@ -112436,8 +112503,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112436
112503
|
}
|
|
112437
112504
|
if (!rel) return result;
|
|
112438
112505
|
const firstRel = rel.split(sep, 1)[0];
|
|
112439
|
-
const newRoot = join$
|
|
112440
|
-
return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$
|
|
112506
|
+
const newRoot = join$9(root, firstRel);
|
|
112507
|
+
return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$9(root, rel)), result);
|
|
112441
112508
|
};
|
|
112442
112509
|
var PackWalker = class PackWalker extends IgnoreWalker {
|
|
112443
112510
|
constructor(tree, opts) {
|
|
@@ -112504,7 +112571,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112504
112571
|
let ignoreFiles = null;
|
|
112505
112572
|
if (this.tree.workspaces) {
|
|
112506
112573
|
const workspaceDirs = [...this.tree.workspaces.values()].map((dir) => dir.replace(/\\/g, "/"));
|
|
112507
|
-
const entryPath = join$
|
|
112574
|
+
const entryPath = join$9(this.path, entry).replace(/\\/g, "/");
|
|
112508
112575
|
if (workspaceDirs.includes(entryPath)) ignoreFiles = [
|
|
112509
112576
|
defaultRules,
|
|
112510
112577
|
"package.json",
|
|
@@ -112564,7 +112631,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112564
112631
|
if (file.endsWith("/*")) file += "*";
|
|
112565
112632
|
const inverse = `!${file}`;
|
|
112566
112633
|
try {
|
|
112567
|
-
const stat = lstat$1(join$
|
|
112634
|
+
const stat = lstat$1(join$9(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
|
|
112568
112635
|
if (stat.isFile()) {
|
|
112569
112636
|
strict.unshift(inverse);
|
|
112570
112637
|
this.requiredFiles.push(file.startsWith("/") ? file.slice(1) : file);
|
|
@@ -112621,7 +112688,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112621
112688
|
walker.start();
|
|
112622
112689
|
});
|
|
112623
112690
|
const relativeFrom = relative(this.root, walker.path);
|
|
112624
|
-
for (const file of bundled) this.result.add(join$
|
|
112691
|
+
for (const file of bundled) this.result.add(join$9(relativeFrom, file).replace(/\\/g, "/"));
|
|
112625
112692
|
}
|
|
112626
112693
|
}
|
|
112627
112694
|
};
|
|
@@ -123822,7 +123889,7 @@ var require_auth = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
|
|
|
123822
123889
|
//#endregion
|
|
123823
123890
|
//#region ../../node_modules/make-fetch-happen/lib/options.js
|
|
123824
123891
|
var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
123825
|
-
const dns$
|
|
123892
|
+
const dns$3 = require("dns");
|
|
123826
123893
|
const conditionalHeaders = [
|
|
123827
123894
|
"if-modified-since",
|
|
123828
123895
|
"if-none-match",
|
|
@@ -123847,7 +123914,7 @@ var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
123847
123914
|
};
|
|
123848
123915
|
options.dns = {
|
|
123849
123916
|
ttl: 300 * 1e3,
|
|
123850
|
-
lookup: dns$
|
|
123917
|
+
lookup: dns$3.lookup,
|
|
123851
123918
|
...options.dns
|
|
123852
123919
|
};
|
|
123853
123920
|
options.cache = options.cache || "default";
|
|
@@ -125264,9 +125331,9 @@ var require_key$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
125264
125331
|
//#region ../../node_modules/@npmcli/agent/lib/dns.js
|
|
125265
125332
|
var require_dns = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
125266
125333
|
const { LRUCache } = require_index_min$5();
|
|
125267
|
-
const dns$
|
|
125334
|
+
const dns$2 = require("dns");
|
|
125268
125335
|
const cache = new LRUCache({ max: 50 });
|
|
125269
|
-
const getOptions = ({ family = 0, hints = dns$
|
|
125336
|
+
const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
|
|
125270
125337
|
hints,
|
|
125271
125338
|
lookup: (hostname, ...args) => {
|
|
125272
125339
|
const callback = args.pop();
|
|
@@ -130305,7 +130372,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
|
130305
130372
|
const socks_1 = require_build$1();
|
|
130306
130373
|
const agent_base_1 = require_dist$12();
|
|
130307
130374
|
const debug_1 = __importDefault(require_src$1());
|
|
130308
|
-
const dns = __importStar(require("dns"));
|
|
130375
|
+
const dns$1 = __importStar(require("dns"));
|
|
130309
130376
|
const net$1 = __importStar(require("net"));
|
|
130310
130377
|
const tls$1 = __importStar(require("tls"));
|
|
130311
130378
|
const url_1$1 = require("url");
|
|
@@ -130377,7 +130444,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
|
130377
130444
|
const { shouldLookup, proxy, timeout } = this;
|
|
130378
130445
|
if (!opts.host) throw new Error("No `host` defined!");
|
|
130379
130446
|
let { host } = opts;
|
|
130380
|
-
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
130447
|
+
const { port, lookup: lookupFn = dns$1.lookup } = opts;
|
|
130381
130448
|
if (shouldLookup) host = await new Promise((resolve, reject) => {
|
|
130382
130449
|
lookupFn(host, {}, (err, res) => {
|
|
130383
130450
|
if (err) reject(err);
|
|
@@ -151106,8 +151173,6 @@ const sendStartupProgress = (message) => {
|
|
|
151106
151173
|
};
|
|
151107
151174
|
//#endregion
|
|
151108
151175
|
//#region ../../packages/core-node/src/utils/remote.ts
|
|
151109
|
-
const DEFAULT_NODE_VERSION = "24.14.1";
|
|
151110
|
-
const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
151111
151176
|
function isPackageComplete(packageDir) {
|
|
151112
151177
|
return (0, node_fs.existsSync)((0, node_path.join)(packageDir, "package.json"));
|
|
151113
151178
|
}
|
|
@@ -151148,6 +151213,20 @@ async function withLock(key, fn) {
|
|
|
151148
151213
|
activeOperations.set(key, promise);
|
|
151149
151214
|
return promise;
|
|
151150
151215
|
}
|
|
151216
|
+
let isOnlineCached = null;
|
|
151217
|
+
let lastCheckTime = 0;
|
|
151218
|
+
async function isOnline() {
|
|
151219
|
+
const now = Date.now();
|
|
151220
|
+
if (isOnlineCached !== null && now - lastCheckTime < 1e4) return isOnlineCached;
|
|
151221
|
+
try {
|
|
151222
|
+
await Promise.race([node_dns_promises.default.lookup("registry.npmjs.org"), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500))]);
|
|
151223
|
+
isOnlineCached = true;
|
|
151224
|
+
} catch {
|
|
151225
|
+
isOnlineCached = false;
|
|
151226
|
+
}
|
|
151227
|
+
lastCheckTime = now;
|
|
151228
|
+
return isOnlineCached;
|
|
151229
|
+
}
|
|
151151
151230
|
/**
|
|
151152
151231
|
* Robust utility to fetch, cache, and resolve an NPM package.
|
|
151153
151232
|
* Centralized in core-node to avoid circular dependencies.
|
|
@@ -151174,7 +151253,15 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151174
151253
|
if (resolvedVersionOrRange === "local") resolvedVersionOrRange = "latest";
|
|
151175
151254
|
console.log(`[Fetcher] Resolving ${packageName}@${resolvedVersionOrRange || "latest"}...`);
|
|
151176
151255
|
const resolveStart = Date.now();
|
|
151177
|
-
|
|
151256
|
+
if (!await isOnline()) {
|
|
151257
|
+
console.warn(`[Fetcher] ${packageName}: offline mode detected (${Date.now() - resolveStart}ms), trying local fallback...`);
|
|
151258
|
+
const fallbackStart = Date.now();
|
|
151259
|
+
const fallbackVersion = await tryLocalFallback(resolvedVersionOrRange, /* @__PURE__ */ new Error("Offline"), baseDir, packageName);
|
|
151260
|
+
if (fallbackVersion) {
|
|
151261
|
+
resolvedVersion = fallbackVersion;
|
|
151262
|
+
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
151263
|
+
} else throw new Error(`Offline and no local fallback version available for ${packageName}`);
|
|
151264
|
+
} else try {
|
|
151178
151265
|
const cachePath = (0, node_path.join)(ctx.userDataPath, "cache", "pacote");
|
|
151179
151266
|
let packumentPromise = packumentRequests.get(packageName);
|
|
151180
151267
|
if (!packumentPromise) {
|
|
@@ -151184,7 +151271,16 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151184
151271
|
const packument = await packumentPromise;
|
|
151185
151272
|
const versions = Object.keys(packument.versions);
|
|
151186
151273
|
const range = resolvedVersionOrRange || "latest";
|
|
151187
|
-
|
|
151274
|
+
let foundVersion = packument["dist-tags"]?.[range] || import_semver.default.maxSatisfying(versions, range);
|
|
151275
|
+
if (range === "latest" && ctx.releaseTag && ctx.releaseTag !== "latest") {
|
|
151276
|
+
const releaseTagVersion = packument["dist-tags"]?.[ctx.releaseTag];
|
|
151277
|
+
if (releaseTagVersion && import_semver.default.valid(releaseTagVersion)) {
|
|
151278
|
+
if (!foundVersion || import_semver.default.valid(foundVersion) && import_semver.default.gte(releaseTagVersion, foundVersion)) {
|
|
151279
|
+
console.log(`[Fetcher] Using release tag "${ctx.releaseTag}" (${releaseTagVersion}) instead of "latest" (${foundVersion || "none"}) for ${packageName}`);
|
|
151280
|
+
foundVersion = releaseTagVersion;
|
|
151281
|
+
} else if (foundVersion) console.warn(`[Fetcher] Tag "${ctx.releaseTag}" (${releaseTagVersion}) is older than "latest" (${foundVersion}) for ${packageName}, keeping "latest"`);
|
|
151282
|
+
}
|
|
151283
|
+
}
|
|
151188
151284
|
if (!foundVersion) throw new Error(`Package ${packageName}@${range} not found on npm (available tags: ${Object.keys(packument["dist-tags"] || {}).join(", ")})`);
|
|
151189
151285
|
resolvedVersion = foundVersion;
|
|
151190
151286
|
console.log(`[Fetcher] ${packageName}: Resolved to v${resolvedVersion} via npm (${Date.now() - resolveStart}ms)`);
|
|
@@ -151299,7 +151395,7 @@ async function ensureNodeJS(context, version = DEFAULT_NODE_VERSION) {
|
|
|
151299
151395
|
const extension = isWindows ? "zip" : "tar.gz";
|
|
151300
151396
|
const fileName = `node-v${version}-${platform === "osx" ? "darwin" : platform}-${arch}.${extension}`;
|
|
151301
151397
|
const downloadUrl = `https://nodejs.org/dist/v${version}/${fileName}`;
|
|
151302
|
-
const tempDir = await
|
|
151398
|
+
const tempDir = await context.createTempFolder("node-download-");
|
|
151303
151399
|
const archivePath = (0, node_path.join)(tempDir, fileName);
|
|
151304
151400
|
sendStartupProgress(`Downloading Node.js v${version}...`);
|
|
151305
151401
|
console.log(`Downloading Node.js from ${downloadUrl}...`);
|
|
@@ -151509,7 +151605,7 @@ async function resolveEntryPoint(packageDir, packageName) {
|
|
|
151509
151605
|
}
|
|
151510
151606
|
//#endregion
|
|
151511
151607
|
//#region ../../packages/core-node/src/handler-func.ts
|
|
151512
|
-
const { join: join$
|
|
151608
|
+
const { join: join$7 } = node_path.default;
|
|
151513
151609
|
//#endregion
|
|
151514
151610
|
//#region ../../packages/core-node/src/handlers/plugins.ts
|
|
151515
151611
|
const localPluginsMap = /* @__PURE__ */ new Map();
|