@pipelab/plugin-core 1.0.1-beta.2 → 1.0.1-beta.20
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/CHANGELOG.md +118 -0
- package/dist/index.cjs +96 -194
- package/dist/index.d.cts +39 -78
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +39 -78
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +53 -188
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -15
- package/src/archive-utils.ts +5 -15
- package/src/pipelab.ts +62 -70
- package/src/utils.ts +17 -242
- package/tsdown.config.ts +7 -0
- package/.turbo/turbo-build.log +0 -364
- package/.turbo/turbo-lint.log +0 -36
package/dist/index.mjs
CHANGED
|
@@ -2,14 +2,11 @@ import { o as debugLog, t as QuickJSEmscriptenModuleError } from "./chunk-JTKJZQ
|
|
|
2
2
|
import { hostname } from "os";
|
|
3
3
|
import { normalize } from "path";
|
|
4
4
|
import { formatWithOptions, types } from "util";
|
|
5
|
-
import {
|
|
6
|
-
import { dirname, join } from "node:path";
|
|
5
|
+
import { PipelabContext, downloadFile, fetchPackage, fetchPipelabAsset, fetchPipelabCli, fetchPipelabPlugin, runPnpm, runWithLiveLogs } from "@pipelab/core-node";
|
|
7
6
|
import { access, mkdir, mkdtemp, realpath, writeFile } from "node:fs/promises";
|
|
8
|
-
import {
|
|
9
|
-
import { pipeline } from "node:stream/promises";
|
|
10
|
-
import pacote from "pacote";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
11
8
|
import { tmpdir } from "node:os";
|
|
12
|
-
import
|
|
9
|
+
import { createWriteStream } from "node:fs";
|
|
13
10
|
import tar from "tar";
|
|
14
11
|
import yauzl from "yauzl";
|
|
15
12
|
import archiver from "archiver";
|
|
@@ -49,7 +46,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
49
46
|
}) : target, mod));
|
|
50
47
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
51
48
|
//#endregion
|
|
52
|
-
//#region
|
|
49
|
+
//#region ../../packages/migration/src/models/createMigration.ts
|
|
53
50
|
function createMigration(migration) {
|
|
54
51
|
return {
|
|
55
52
|
version: migration.version,
|
|
@@ -1354,7 +1351,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1354
1351
|
module.exports = subset;
|
|
1355
1352
|
}));
|
|
1356
1353
|
//#endregion
|
|
1357
|
-
//#region
|
|
1354
|
+
//#region ../../packages/migration/src/utils/object-keys.ts
|
|
1358
1355
|
var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1359
1356
|
const internalRe = require_re();
|
|
1360
1357
|
const constants = require_constants$2();
|
|
@@ -2013,7 +2010,7 @@ var Migrator = class {
|
|
|
2013
2010
|
}
|
|
2014
2011
|
};
|
|
2015
2012
|
//#endregion
|
|
2016
|
-
//#region
|
|
2013
|
+
//#region ../../packages/migration/src/models/createMigrator.ts
|
|
2017
2014
|
const createMigrator = () => {
|
|
2018
2015
|
return {
|
|
2019
2016
|
createDefault(defaultState) {
|
|
@@ -2025,7 +2022,7 @@ const createMigrator = () => {
|
|
|
2025
2022
|
};
|
|
2026
2023
|
};
|
|
2027
2024
|
//#endregion
|
|
2028
|
-
//#region
|
|
2025
|
+
//#region ../../packages/shared/src/config/migrators.ts
|
|
2029
2026
|
const settingsMigratorInternal = createMigrator();
|
|
2030
2027
|
const defaultAppSettings$1 = settingsMigratorInternal.createDefault({
|
|
2031
2028
|
cacheFolder: "",
|
|
@@ -2265,10 +2262,10 @@ const configRegistry$1 = {
|
|
|
2265
2262
|
pipeline: savedFileMigrator$1
|
|
2266
2263
|
};
|
|
2267
2264
|
//#endregion
|
|
2268
|
-
//#region
|
|
2265
|
+
//#region ../../packages/shared/src/apis.ts
|
|
2269
2266
|
const ShellChannels = ["dialog:showOpenDialog", "dialog:showSaveDialog"];
|
|
2270
2267
|
//#endregion
|
|
2271
|
-
//#region
|
|
2268
|
+
//#region ../../packages/shared/src/config.schema.ts
|
|
2272
2269
|
const createVersionSchema = (schema) => schema;
|
|
2273
2270
|
const AppSettingsValidatorV1 = object({
|
|
2274
2271
|
cacheFolder: string(),
|
|
@@ -2377,7 +2374,12 @@ const AppSettingsValidatorV7 = object({
|
|
|
2377
2374
|
id: string(),
|
|
2378
2375
|
name: string(),
|
|
2379
2376
|
url: string()
|
|
2380
|
-
}))
|
|
2377
|
+
})),
|
|
2378
|
+
buildHistory: object({ retentionPolicy: object({
|
|
2379
|
+
enabled: boolean(),
|
|
2380
|
+
maxEntries: number(),
|
|
2381
|
+
maxAge: number()
|
|
2382
|
+
}) })
|
|
2381
2383
|
});
|
|
2382
2384
|
const AppSettingsValidator = AppSettingsValidatorV7;
|
|
2383
2385
|
//#endregion
|
|
@@ -2880,7 +2882,7 @@ var Logger = class extends BaseLogger {
|
|
|
2880
2882
|
}
|
|
2881
2883
|
};
|
|
2882
2884
|
//#endregion
|
|
2883
|
-
//#region
|
|
2885
|
+
//#region ../../packages/shared/src/logger.ts
|
|
2884
2886
|
const createDefaultLogger = () => new Logger({
|
|
2885
2887
|
minLevel: 3,
|
|
2886
2888
|
hideLogPositionForProduction: false
|
|
@@ -3881,7 +3883,7 @@ var we = class {
|
|
|
3881
3883
|
}
|
|
3882
3884
|
};
|
|
3883
3885
|
//#endregion
|
|
3884
|
-
//#region
|
|
3886
|
+
//#region ../../packages/shared/src/fmt.ts
|
|
3885
3887
|
const fmt = { param: (value, variant, ifEmpty = "") => {
|
|
3886
3888
|
return `<span class="param ${variant ? variant : ""}">${value ? value : ifEmpty}</span>`;
|
|
3887
3889
|
} };
|
|
@@ -3893,7 +3895,7 @@ var src_default$1 = {
|
|
|
3893
3895
|
importModuleLoader: () => import("./emscripten-module-VHMWRAJ2-Czcf6BHN.mjs").then((mod) => mod.default)
|
|
3894
3896
|
};
|
|
3895
3897
|
//#endregion
|
|
3896
|
-
//#region
|
|
3898
|
+
//#region ../../packages/shared/src/quickjs.ts
|
|
3897
3899
|
var EvaluationError = class extends Error {
|
|
3898
3900
|
constructor(name, description) {
|
|
3899
3901
|
super(description);
|
|
@@ -3965,7 +3967,7 @@ const createQuickJsFromVariant = async (variant) => {
|
|
|
3965
3967
|
};
|
|
3966
3968
|
const createQuickJs = () => createQuickJsFromVariant(src_default$1);
|
|
3967
3969
|
//#endregion
|
|
3968
|
-
//#region
|
|
3970
|
+
//#region ../../packages/shared/src/evaluator.ts
|
|
3969
3971
|
const makeResolvedParams = async (data, onItem = (item) => item, _vm) => {
|
|
3970
3972
|
const { logger } = useLogger();
|
|
3971
3973
|
const vm = _vm ?? await createQuickJs();
|
|
@@ -3991,7 +3993,7 @@ const makeResolvedParams = async (data, onItem = (item) => item, _vm) => {
|
|
|
3991
3993
|
return result;
|
|
3992
3994
|
};
|
|
3993
3995
|
//#endregion
|
|
3994
|
-
//#region
|
|
3996
|
+
//#region ../../packages/shared/src/variables.ts
|
|
3995
3997
|
const variableToFormattedVariable = async (vm, variables) => {
|
|
3996
3998
|
const result = {};
|
|
3997
3999
|
for (const variable of variables) {
|
|
@@ -4002,7 +4004,7 @@ const variableToFormattedVariable = async (vm, variables) => {
|
|
|
4002
4004
|
return result;
|
|
4003
4005
|
};
|
|
4004
4006
|
//#endregion
|
|
4005
|
-
//#region
|
|
4007
|
+
//#region ../../packages/shared/src/graph.ts
|
|
4006
4008
|
const getPluginDefinition = (pluginId, definitions) => {
|
|
4007
4009
|
return definitions.find((nodeDef) => {
|
|
4008
4010
|
return nodeDef.id === pluginId;
|
|
@@ -4063,7 +4065,7 @@ const processGraph = async (options) => {
|
|
|
4063
4065
|
return options;
|
|
4064
4066
|
};
|
|
4065
4067
|
//#endregion
|
|
4066
|
-
//#region
|
|
4068
|
+
//#region ../../packages/shared/src/i18n/en_US.json
|
|
4067
4069
|
var en_US_default = {
|
|
4068
4070
|
settings: {
|
|
4069
4071
|
"darkTheme": "Dark theme",
|
|
@@ -4208,7 +4210,7 @@ var en_US_default = {
|
|
|
4208
4210
|
}
|
|
4209
4211
|
};
|
|
4210
4212
|
//#endregion
|
|
4211
|
-
//#region
|
|
4213
|
+
//#region ../../packages/shared/src/i18n/fr_FR.json
|
|
4212
4214
|
var fr_FR_default = {
|
|
4213
4215
|
settings: {
|
|
4214
4216
|
"darkTheme": "Thème sombre",
|
|
@@ -4297,7 +4299,7 @@ var fr_FR_default = {
|
|
|
4297
4299
|
scenarios: { "scenarios": "Scénarios" }
|
|
4298
4300
|
};
|
|
4299
4301
|
//#endregion
|
|
4300
|
-
//#region
|
|
4302
|
+
//#region ../../packages/shared/src/i18n/pt_BR.json
|
|
4301
4303
|
var pt_BR_default = {
|
|
4302
4304
|
settings: {
|
|
4303
4305
|
"darkTheme": "Tema escuro",
|
|
@@ -4383,7 +4385,7 @@ var pt_BR_default = {
|
|
|
4383
4385
|
scenarios: { "scenarios": "Scenarios" }
|
|
4384
4386
|
};
|
|
4385
4387
|
//#endregion
|
|
4386
|
-
//#region
|
|
4388
|
+
//#region ../../packages/shared/src/i18n/zh_CN.json
|
|
4387
4389
|
var zh_CN_default = {
|
|
4388
4390
|
settings: {
|
|
4389
4391
|
"darkTheme": "Dark theme",
|
|
@@ -4469,7 +4471,7 @@ var zh_CN_default = {
|
|
|
4469
4471
|
scenarios: { "scenarios": "Scenarios" }
|
|
4470
4472
|
};
|
|
4471
4473
|
//#endregion
|
|
4472
|
-
//#region
|
|
4474
|
+
//#region ../../packages/shared/src/i18n/es_ES.json
|
|
4473
4475
|
var es_ES_default = {
|
|
4474
4476
|
settings: {
|
|
4475
4477
|
"darkTheme": "Dark theme",
|
|
@@ -4555,7 +4557,7 @@ var es_ES_default = {
|
|
|
4555
4557
|
scenarios: { "scenarios": "Scenarios" }
|
|
4556
4558
|
};
|
|
4557
4559
|
//#endregion
|
|
4558
|
-
//#region
|
|
4560
|
+
//#region ../../packages/shared/src/i18n/de_DE.json
|
|
4559
4561
|
var de_DE_default = {
|
|
4560
4562
|
settings: {
|
|
4561
4563
|
"darkTheme": "Dark theme",
|
|
@@ -4641,7 +4643,7 @@ var de_DE_default = {
|
|
|
4641
4643
|
scenarios: { "scenarios": "Scenarios" }
|
|
4642
4644
|
};
|
|
4643
4645
|
//#endregion
|
|
4644
|
-
//#region
|
|
4646
|
+
//#region ../../packages/shared/src/model.ts
|
|
4645
4647
|
const OriginValidator = object({
|
|
4646
4648
|
pluginId: string(),
|
|
4647
4649
|
nodeId: string()
|
|
@@ -46906,7 +46908,7 @@ var require_vue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46906
46908
|
var vue_exports = /* @__PURE__ */ __exportAll({});
|
|
46907
46909
|
__reExport(vue_exports, /* @__PURE__ */ __toESM(require_vue(), 1));
|
|
46908
46910
|
//#endregion
|
|
46909
|
-
//#region
|
|
46911
|
+
//#region ../../packages/shared/src/plugins.ts
|
|
46910
46912
|
const plugins = (0, vue_exports.shallowRef)([]);
|
|
46911
46913
|
const usePlugins = () => {
|
|
46912
46914
|
const load = () => {};
|
|
@@ -46920,7 +46922,7 @@ const usePlugins = () => {
|
|
|
46920
46922
|
};
|
|
46921
46923
|
};
|
|
46922
46924
|
//#endregion
|
|
46923
|
-
//#region
|
|
46925
|
+
//#region ../../packages/shared/src/plugins/definitions.ts
|
|
46924
46926
|
const createNodeDefinition = (def) => {
|
|
46925
46927
|
return def;
|
|
46926
46928
|
};
|
|
@@ -47037,7 +47039,7 @@ const createEvent = (event) => {
|
|
|
47037
47039
|
};
|
|
47038
47040
|
};
|
|
47039
47041
|
//#endregion
|
|
47040
|
-
//#region
|
|
47042
|
+
//#region ../../packages/shared/src/save-location.ts
|
|
47041
47043
|
const SaveLocationInternalValidator = object({
|
|
47042
47044
|
id: string(),
|
|
47043
47045
|
project: string(),
|
|
@@ -47069,7 +47071,7 @@ const SaveLocationValidator = union([
|
|
|
47069
47071
|
SaveLocationPipelabCloudValidator
|
|
47070
47072
|
]);
|
|
47071
47073
|
//#endregion
|
|
47072
|
-
//#region
|
|
47074
|
+
//#region ../../packages/shared/src/subscription-errors.ts
|
|
47073
47075
|
var SubscriptionRequiredError = class extends Error {
|
|
47074
47076
|
code = "SUBSCRIPTION_REQUIRED";
|
|
47075
47077
|
benefit;
|
|
@@ -64171,7 +64173,7 @@ function shouldShowDeprecationWarning() {
|
|
|
64171
64173
|
}
|
|
64172
64174
|
if (shouldShowDeprecationWarning()) console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");
|
|
64173
64175
|
//#endregion
|
|
64174
|
-
//#region
|
|
64176
|
+
//#region ../../packages/shared/src/supabase.ts
|
|
64175
64177
|
const getSupabaseConfig = () => {
|
|
64176
64178
|
return {
|
|
64177
64179
|
url: process.env.SUPABASE_URL || "",
|
|
@@ -64191,10 +64193,10 @@ const supabase = (options) => {
|
|
|
64191
64193
|
return createClient(url, anonKey, options);
|
|
64192
64194
|
};
|
|
64193
64195
|
//#endregion
|
|
64194
|
-
//#region
|
|
64196
|
+
//#region ../../packages/shared/src/utils.ts
|
|
64195
64197
|
const foo = "bar";
|
|
64196
64198
|
//#endregion
|
|
64197
|
-
//#region
|
|
64199
|
+
//#region ../../packages/shared/src/validation.ts
|
|
64198
64200
|
const isRequired = (param) => {
|
|
64199
64201
|
return param.required === true;
|
|
64200
64202
|
};
|
|
@@ -64204,7 +64206,7 @@ const isRenderer = () => {
|
|
|
64204
64206
|
return process.browser === true || process.title === "browser";
|
|
64205
64207
|
};
|
|
64206
64208
|
//#endregion
|
|
64207
|
-
//#region
|
|
64209
|
+
//#region ../../packages/shared/src/websocket.types.ts
|
|
64208
64210
|
var WebSocketError = class extends Error {
|
|
64209
64211
|
constructor(message, code, requestId) {
|
|
64210
64212
|
super(message);
|
|
@@ -64265,7 +64267,7 @@ object({
|
|
|
64265
64267
|
pipelines: optional(array(SaveLocationValidator), [])
|
|
64266
64268
|
});
|
|
64267
64269
|
//#endregion
|
|
64268
|
-
//#region
|
|
64270
|
+
//#region ../../packages/shared/src/index.ts
|
|
64269
64271
|
const appSettingsMigrator = appSettingsMigrator$1;
|
|
64270
64272
|
const defaultAppSettings = defaultAppSettings$1;
|
|
64271
64273
|
const fileRepoMigrations = fileRepoMigrations$1;
|
|
@@ -64288,155 +64290,16 @@ const createPlugin = (plugin) => {
|
|
|
64288
64290
|
return plugin;
|
|
64289
64291
|
};
|
|
64290
64292
|
//#endregion
|
|
64291
|
-
//#region src/custom-errors.ts
|
|
64292
|
-
var ExternalCommandError = class ExternalCommandError extends Error {
|
|
64293
|
-
code;
|
|
64294
|
-
constructor(message, code) {
|
|
64295
|
-
super(message);
|
|
64296
|
-
this.code = code;
|
|
64297
|
-
Object.setPrototypeOf(this, ExternalCommandError.prototype);
|
|
64298
|
-
}
|
|
64299
|
-
};
|
|
64300
|
-
//#endregion
|
|
64301
64293
|
//#region src/utils.ts
|
|
64302
64294
|
const fileExists = async (path) => {
|
|
64303
64295
|
try {
|
|
64296
|
+
const { access } = await import("node:fs/promises");
|
|
64304
64297
|
await access(path);
|
|
64305
64298
|
return true;
|
|
64306
64299
|
} catch {
|
|
64307
64300
|
return false;
|
|
64308
64301
|
}
|
|
64309
64302
|
};
|
|
64310
|
-
const runWithLiveLogs = async (command, args, execaOptions, log, hooks) => {
|
|
64311
|
-
return new Promise((resolve, reject) => {
|
|
64312
|
-
console.log("command: ", command, args.join(" "));
|
|
64313
|
-
const subprocess = execa(command, args, {
|
|
64314
|
-
...execaOptions,
|
|
64315
|
-
stdout: "pipe",
|
|
64316
|
-
stderr: "pipe",
|
|
64317
|
-
stdin: "pipe"
|
|
64318
|
-
});
|
|
64319
|
-
subprocess.stdout.on("data", (data) => {
|
|
64320
|
-
hooks?.onStdout?.(data.toString(), subprocess);
|
|
64321
|
-
});
|
|
64322
|
-
subprocess.stderr?.on("data", (data) => {
|
|
64323
|
-
hooks?.onStderr?.(data.toString(), subprocess);
|
|
64324
|
-
});
|
|
64325
|
-
subprocess.on("error", (error) => {
|
|
64326
|
-
console.log("error", error);
|
|
64327
|
-
return reject(error);
|
|
64328
|
-
});
|
|
64329
|
-
subprocess.on("close", (code) => {
|
|
64330
|
-
console.log("close", code);
|
|
64331
|
-
hooks?.onExit?.(code);
|
|
64332
|
-
if (code === 0) return resolve();
|
|
64333
|
-
else return reject(/* @__PURE__ */ new Error(`Command exited with non-zero code: ${code}`));
|
|
64334
|
-
});
|
|
64335
|
-
subprocess.on("disconnect", () => {
|
|
64336
|
-
console.log("disconnect");
|
|
64337
|
-
hooks?.onExit?.(0);
|
|
64338
|
-
return resolve();
|
|
64339
|
-
});
|
|
64340
|
-
subprocess.on("exit", (code) => {
|
|
64341
|
-
console.log("exit", code);
|
|
64342
|
-
hooks?.onExit?.(code);
|
|
64343
|
-
if (code === 0) return resolve();
|
|
64344
|
-
else return reject(/* @__PURE__ */ new Error(`Command exited with non-zero code: ${code}`));
|
|
64345
|
-
});
|
|
64346
|
-
});
|
|
64347
|
-
};
|
|
64348
|
-
const runWithLiveLogsPTY = async (command, args, execaOptions, log, hooks, abortSignal) => {
|
|
64349
|
-
return new Promise((resolve, reject) => {
|
|
64350
|
-
console.log("command (execa-pty-fallback): ", command, args.join(" "));
|
|
64351
|
-
const subprocess = execa(command, args, {
|
|
64352
|
-
...execaOptions,
|
|
64353
|
-
stdout: "pipe",
|
|
64354
|
-
stderr: "pipe",
|
|
64355
|
-
stdin: "pipe",
|
|
64356
|
-
env: {
|
|
64357
|
-
...process.env,
|
|
64358
|
-
...execaOptions.env,
|
|
64359
|
-
TERM: "xterm-256color",
|
|
64360
|
-
FORCE_STDERR_LOGGING: "1"
|
|
64361
|
-
},
|
|
64362
|
-
cancelSignal: abortSignal
|
|
64363
|
-
});
|
|
64364
|
-
hooks?.onCreated?.(subprocess);
|
|
64365
|
-
subprocess.stdout?.on("data", (data) => {
|
|
64366
|
-
hooks?.onStdout?.(data.toString(), subprocess);
|
|
64367
|
-
});
|
|
64368
|
-
subprocess.stderr?.on("data", (data) => {
|
|
64369
|
-
hooks?.onStderr?.(data.toString(), subprocess);
|
|
64370
|
-
});
|
|
64371
|
-
subprocess.on("error", (error) => {
|
|
64372
|
-
console.log("error", error);
|
|
64373
|
-
return reject(error);
|
|
64374
|
-
});
|
|
64375
|
-
subprocess.on("exit", (code) => {
|
|
64376
|
-
console.log("exit", code);
|
|
64377
|
-
hooks?.onExit?.(code || 0);
|
|
64378
|
-
if (code === 0) return resolve();
|
|
64379
|
-
else return reject(new ExternalCommandError(`Command exited with non-zero code: ${code}`, code || 1));
|
|
64380
|
-
});
|
|
64381
|
-
});
|
|
64382
|
-
};
|
|
64383
|
-
/**
|
|
64384
|
-
* Downloads a file from a given URL to a specified local path with progress tracking.
|
|
64385
|
-
*
|
|
64386
|
-
* @param url - The URL of the file to download.
|
|
64387
|
-
* @param localPath - The local file path to save the downloaded file.
|
|
64388
|
-
* @returns A promise that resolves when the file is downloaded.
|
|
64389
|
-
*/
|
|
64390
|
-
const downloadFile = async (url, localPath, hooks, abortSignal) => {
|
|
64391
|
-
const response = await fetch(url, { signal: abortSignal });
|
|
64392
|
-
if (!response.ok) throw new Error(`Failed to fetch file: ${response.statusText}`);
|
|
64393
|
-
const contentLength = response.headers.get("content-length");
|
|
64394
|
-
if (!contentLength) throw new Error("Content-Length header is missing");
|
|
64395
|
-
const totalSize = parseInt(contentLength, 10);
|
|
64396
|
-
let downloadedSize = 0;
|
|
64397
|
-
const fileStream = createWriteStream(localPath);
|
|
64398
|
-
const progressStream = new TransformStream({ transform(chunk, controller) {
|
|
64399
|
-
downloadedSize += chunk.length;
|
|
64400
|
-
const progress = downloadedSize / totalSize * 100;
|
|
64401
|
-
if (hooks?.onProgress) hooks.onProgress({
|
|
64402
|
-
progress,
|
|
64403
|
-
downloadedSize
|
|
64404
|
-
});
|
|
64405
|
-
controller.enqueue(chunk);
|
|
64406
|
-
} });
|
|
64407
|
-
const readable = response.body?.pipeThrough(progressStream);
|
|
64408
|
-
if (!readable) throw new Error("Failed to create a readable stream");
|
|
64409
|
-
await pipeline(readable, fileStream);
|
|
64410
|
-
};
|
|
64411
|
-
/**
|
|
64412
|
-
* Installs an NPM package from the npm registry as a tarball if not already present.
|
|
64413
|
-
* @param thirdpartyDir The directory where third-party tools are stored.
|
|
64414
|
-
* @param name The name of the package (e.g., 'pnpm' or '@poki/cli').
|
|
64415
|
-
* @param version The version of the package.
|
|
64416
|
-
* @param options (Optional) configuration for dependency installation.
|
|
64417
|
-
* @returns A Promise that resolves to the path of the extracted package (the 'package' subfolder).
|
|
64418
|
-
*/
|
|
64419
|
-
const ensureNPMPackage = async (thirdpartyDir, name, version, options) => {
|
|
64420
|
-
const packageDir = join(thirdpartyDir, name, version);
|
|
64421
|
-
const finalPath = join(packageDir, "package");
|
|
64422
|
-
if (await fileExists(finalPath)) return finalPath;
|
|
64423
|
-
console.log(`NPM package ${name}@${version} not found at ${finalPath}, installing...`);
|
|
64424
|
-
console.log(`Extracting ${name}@${version} to ${finalPath}...`);
|
|
64425
|
-
await mkdir(packageDir, { recursive: true });
|
|
64426
|
-
await pacote.extract(`${name}@${version}`, finalPath);
|
|
64427
|
-
if (options?.installDeps && options.pnpmPath) {
|
|
64428
|
-
console.log(`Installing dependencies for ${name}@${version} using pnpm at ${options.pnpmPath}...`);
|
|
64429
|
-
await execa(options.nodePath || process.execPath, [
|
|
64430
|
-
options.pnpmPath,
|
|
64431
|
-
"install",
|
|
64432
|
-
"--prod"
|
|
64433
|
-
], {
|
|
64434
|
-
cwd: finalPath,
|
|
64435
|
-
stdio: "inherit"
|
|
64436
|
-
});
|
|
64437
|
-
}
|
|
64438
|
-
return finalPath;
|
|
64439
|
-
};
|
|
64440
64303
|
//#endregion
|
|
64441
64304
|
//#region src/fs-utils.ts
|
|
64442
64305
|
const ensure = async (filesPath, defaultContent = "{}") => {
|
|
@@ -64465,19 +64328,11 @@ const generateTempFolder = async (base) => {
|
|
|
64465
64328
|
async function extractTarGz(archivePath, destinationDir) {
|
|
64466
64329
|
console.log(`Extracting ${archivePath} to ${destinationDir}...`);
|
|
64467
64330
|
await mkdir(destinationDir, { recursive: true });
|
|
64468
|
-
|
|
64469
|
-
|
|
64470
|
-
|
|
64471
|
-
const extractStream = tar.extract({ cwd: destinationDir });
|
|
64472
|
-
readStream.on("error", reject);
|
|
64473
|
-
gunzipStream.on("error", reject);
|
|
64474
|
-
extractStream.on("error", reject);
|
|
64475
|
-
extractStream.on("close", () => {
|
|
64476
|
-
console.log("Extraction finished.");
|
|
64477
|
-
resolve();
|
|
64478
|
-
});
|
|
64479
|
-
readStream.pipe(gunzipStream).pipe(extractStream);
|
|
64331
|
+
await tar.x({
|
|
64332
|
+
file: archivePath,
|
|
64333
|
+
cwd: destinationDir
|
|
64480
64334
|
});
|
|
64335
|
+
console.log("Extraction finished.");
|
|
64481
64336
|
}
|
|
64482
64337
|
/**
|
|
64483
64338
|
* Extracts a .zip archive.
|
|
@@ -64537,6 +64392,16 @@ const zipFolder = async (from, to, log) => {
|
|
|
64537
64392
|
});
|
|
64538
64393
|
};
|
|
64539
64394
|
//#endregion
|
|
64395
|
+
//#region src/custom-errors.ts
|
|
64396
|
+
var ExternalCommandError = class ExternalCommandError extends Error {
|
|
64397
|
+
code;
|
|
64398
|
+
constructor(message, code) {
|
|
64399
|
+
super(message);
|
|
64400
|
+
this.code = code;
|
|
64401
|
+
Object.setPrototypeOf(this, ExternalCommandError.prototype);
|
|
64402
|
+
}
|
|
64403
|
+
};
|
|
64404
|
+
//#endregion
|
|
64540
64405
|
//#region src/node-utils.ts
|
|
64541
64406
|
const fileExists$1 = async (path) => {
|
|
64542
64407
|
try {
|
|
@@ -64566,6 +64431,6 @@ const detectRuntime = async (appFolder) => {
|
|
|
64566
64431
|
return detectedRuntime;
|
|
64567
64432
|
};
|
|
64568
64433
|
//#endregion
|
|
64569
|
-
export { AppSettingsValidator, AppSettingsValidatorV1, AppSettingsValidatorV2, AppSettingsValidatorV3, AppSettingsValidatorV4, AppSettingsValidatorV5, AppSettingsValidatorV6, AppSettingsValidatorV7, BenefitNotFoundError, EditorParamValidatorV3, ExternalCommandError, OriginValidator, src_default as RELEASE_SYNC, SaveLocationExternalValidator, SaveLocationInternalValidator, SaveLocationPipelabCloudValidator, SaveLocationValidator, SavedFileDefaultValidator, SavedFileSimpleValidator, SavedFileValidator, SavedFileValidatorV1, SavedFileValidatorV2, SavedFileValidatorV3, SavedFileValidatorV4, ShellChannels, SubscriptionExpiredError, SubscriptionRequiredError, UnauthorizedError, VariableValidatorV1, WebSocketConnectionError, WebSocketError, WebSocketTimeoutError, appSettingsMigrator, configRegistry, createAction, createActionRunner, createArray, createBooleanParam, createColorPicker, createCondition, createConditionRunner, createDefinition, createEvent, createEventRunner, createExpression, createExpressionRunner, createLoop, createLoopRunner, createNetlifySiteParam, createNodeDefinition, createNumberParam, createPasswordParam, createPathParam, createPlugin, createQuickJs, createQuickJsFromVariant, createRawParam, createStringParam, createSubscriptionError, createVersionSchema, de_DE_default as de_DE, defaultAppSettings, defaultFileRepo, detectRuntime, downloadFile, en_US_default as en_US, ensure,
|
|
64434
|
+
export { AppSettingsValidator, AppSettingsValidatorV1, AppSettingsValidatorV2, AppSettingsValidatorV3, AppSettingsValidatorV4, AppSettingsValidatorV5, AppSettingsValidatorV6, AppSettingsValidatorV7, BenefitNotFoundError, EditorParamValidatorV3, ExternalCommandError, OriginValidator, PipelabContext, src_default as RELEASE_SYNC, SaveLocationExternalValidator, SaveLocationInternalValidator, SaveLocationPipelabCloudValidator, SaveLocationValidator, SavedFileDefaultValidator, SavedFileSimpleValidator, SavedFileValidator, SavedFileValidatorV1, SavedFileValidatorV2, SavedFileValidatorV3, SavedFileValidatorV4, ShellChannels, SubscriptionExpiredError, SubscriptionRequiredError, UnauthorizedError, VariableValidatorV1, WebSocketConnectionError, WebSocketError, WebSocketTimeoutError, appSettingsMigrator, configRegistry, createAction, createActionRunner, createArray, createBooleanParam, createColorPicker, createCondition, createConditionRunner, createDefinition, createEvent, createEventRunner, createExpression, createExpressionRunner, createLoop, createLoopRunner, createNetlifySiteParam, createNodeDefinition, createNumberParam, createPasswordParam, createPathParam, createPlugin, createQuickJs, createQuickJsFromVariant, createRawParam, createStringParam, createSubscriptionError, createVersionSchema, de_DE_default as de_DE, defaultAppSettings, defaultFileRepo, detectRuntime, downloadFile, en_US_default as en_US, ensure, es_ES_default as es_ES, extractTarGz, extractZip, fetchPackage, fetchPipelabAsset, fetchPipelabCli, fetchPipelabPlugin, fileExists, fileRepoMigrations, fmt, foo, fr_FR_default as fr_FR, generateTempFolder, getSubscriptionErrorMessage, isRenderer, isRequired, isSubscriptionError, isSupabaseAvailable, isWebSocketErrorMessage, isWebSocketRequestMessage, isWebSocketResponseMessage, makeResolvedParams, newVariant, processGraph, pt_BR_default as pt_BR, runPnpm, runWithLiveLogs, savedFileMigrator, schema, sleep, supabase, useLogger, usePlugins, variableToFormattedVariable, zh_CN_default as zh_CN, zipFolder };
|
|
64570
64435
|
|
|
64571
64436
|
//# sourceMappingURL=index.mjs.map
|