@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,123 @@
|
|
|
1
1
|
# @pipelab/plugin-core
|
|
2
2
|
|
|
3
|
+
## 1.0.1-beta.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- gf
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @pipelab/core-node@1.0.1-beta.24
|
|
10
|
+
|
|
11
|
+
## 1.0.1-beta.19
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- azs
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @pipelab/core-node@1.0.1-beta.23
|
|
18
|
+
|
|
19
|
+
## 1.0.1-beta.18
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- sqqd
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @pipelab/core-node@1.0.1-beta.22
|
|
26
|
+
|
|
27
|
+
## 1.0.1-beta.17
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- sd
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @pipelab/core-node@1.0.1-beta.21
|
|
34
|
+
|
|
35
|
+
## 1.0.1-beta.16
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- sd
|
|
40
|
+
- Updated dependencies
|
|
41
|
+
- @pipelab/core-node@1.0.1-beta.20
|
|
42
|
+
|
|
43
|
+
## 1.0.1-beta.15
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- wdf
|
|
48
|
+
|
|
49
|
+
## 1.0.1-beta.14
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- sdf
|
|
54
|
+
|
|
55
|
+
## 1.0.1-beta.13
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- update
|
|
60
|
+
|
|
61
|
+
## 1.0.1-beta.12
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- sd
|
|
66
|
+
|
|
67
|
+
## 1.0.1-beta.11
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- rfg
|
|
72
|
+
|
|
73
|
+
## 1.0.1-beta.10
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- szd
|
|
78
|
+
|
|
79
|
+
## 1.0.1-beta.9
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- sd
|
|
84
|
+
|
|
85
|
+
## 1.0.1-beta.8
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- sd
|
|
90
|
+
|
|
91
|
+
## 1.0.1-beta.7
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- sd
|
|
96
|
+
|
|
97
|
+
## 1.0.1-beta.6
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- sd
|
|
102
|
+
|
|
103
|
+
## 1.0.1-beta.5
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- test
|
|
108
|
+
|
|
109
|
+
## 1.0.1-beta.4
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- test
|
|
114
|
+
|
|
115
|
+
## 1.0.1-beta.3
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- sd
|
|
120
|
+
|
|
3
121
|
## 1.0.1-beta.2
|
|
4
122
|
|
|
5
123
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -38,16 +38,11 @@ const require_chunk_JTKJZQYV = require("./chunk-JTKJZQYV-DwALyGe5.cjs");
|
|
|
38
38
|
let os = require("os");
|
|
39
39
|
let path = require("path");
|
|
40
40
|
let util = require("util");
|
|
41
|
-
let
|
|
42
|
-
let node_path = require("node:path");
|
|
41
|
+
let _pipelab_core_node = require("@pipelab/core-node");
|
|
43
42
|
let node_fs_promises = require("node:fs/promises");
|
|
44
|
-
let
|
|
45
|
-
let node_stream_promises = require("node:stream/promises");
|
|
46
|
-
let pacote = require("pacote");
|
|
47
|
-
pacote = __toESM(pacote);
|
|
43
|
+
let node_path = require("node:path");
|
|
48
44
|
let node_os = require("node:os");
|
|
49
|
-
let
|
|
50
|
-
zlib = __toESM(zlib);
|
|
45
|
+
let node_fs = require("node:fs");
|
|
51
46
|
let tar = require("tar");
|
|
52
47
|
tar = __toESM(tar);
|
|
53
48
|
let yauzl = require("yauzl");
|
|
@@ -55,7 +50,7 @@ yauzl = __toESM(yauzl);
|
|
|
55
50
|
let archiver = require("archiver");
|
|
56
51
|
archiver = __toESM(archiver);
|
|
57
52
|
let zod = require("zod");
|
|
58
|
-
//#region
|
|
53
|
+
//#region ../../packages/migration/src/models/createMigration.ts
|
|
59
54
|
function createMigration(migration) {
|
|
60
55
|
return {
|
|
61
56
|
version: migration.version,
|
|
@@ -1360,7 +1355,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1360
1355
|
module.exports = subset;
|
|
1361
1356
|
}));
|
|
1362
1357
|
//#endregion
|
|
1363
|
-
//#region
|
|
1358
|
+
//#region ../../packages/migration/src/utils/object-keys.ts
|
|
1364
1359
|
var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1365
1360
|
const internalRe = require_re();
|
|
1366
1361
|
const constants = require_constants$2();
|
|
@@ -2019,7 +2014,7 @@ var Migrator = class {
|
|
|
2019
2014
|
}
|
|
2020
2015
|
};
|
|
2021
2016
|
//#endregion
|
|
2022
|
-
//#region
|
|
2017
|
+
//#region ../../packages/migration/src/models/createMigrator.ts
|
|
2023
2018
|
const createMigrator = () => {
|
|
2024
2019
|
return {
|
|
2025
2020
|
createDefault(defaultState) {
|
|
@@ -2031,7 +2026,7 @@ const createMigrator = () => {
|
|
|
2031
2026
|
};
|
|
2032
2027
|
};
|
|
2033
2028
|
//#endregion
|
|
2034
|
-
//#region
|
|
2029
|
+
//#region ../../packages/shared/src/config/migrators.ts
|
|
2035
2030
|
const settingsMigratorInternal = createMigrator();
|
|
2036
2031
|
const defaultAppSettings$1 = settingsMigratorInternal.createDefault({
|
|
2037
2032
|
cacheFolder: "",
|
|
@@ -2271,10 +2266,10 @@ const configRegistry$1 = {
|
|
|
2271
2266
|
pipeline: savedFileMigrator$1
|
|
2272
2267
|
};
|
|
2273
2268
|
//#endregion
|
|
2274
|
-
//#region
|
|
2269
|
+
//#region ../../packages/shared/src/apis.ts
|
|
2275
2270
|
const ShellChannels = ["dialog:showOpenDialog", "dialog:showSaveDialog"];
|
|
2276
2271
|
//#endregion
|
|
2277
|
-
//#region
|
|
2272
|
+
//#region ../../packages/shared/src/config.schema.ts
|
|
2278
2273
|
const createVersionSchema = (schema) => schema;
|
|
2279
2274
|
const AppSettingsValidatorV1 = object({
|
|
2280
2275
|
cacheFolder: string(),
|
|
@@ -2383,7 +2378,12 @@ const AppSettingsValidatorV7 = object({
|
|
|
2383
2378
|
id: string(),
|
|
2384
2379
|
name: string(),
|
|
2385
2380
|
url: string()
|
|
2386
|
-
}))
|
|
2381
|
+
})),
|
|
2382
|
+
buildHistory: object({ retentionPolicy: object({
|
|
2383
|
+
enabled: boolean(),
|
|
2384
|
+
maxEntries: number(),
|
|
2385
|
+
maxAge: number()
|
|
2386
|
+
}) })
|
|
2387
2387
|
});
|
|
2388
2388
|
const AppSettingsValidator = AppSettingsValidatorV7;
|
|
2389
2389
|
//#endregion
|
|
@@ -2886,7 +2886,7 @@ var Logger = class extends BaseLogger {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
};
|
|
2888
2888
|
//#endregion
|
|
2889
|
-
//#region
|
|
2889
|
+
//#region ../../packages/shared/src/logger.ts
|
|
2890
2890
|
const createDefaultLogger = () => new Logger({
|
|
2891
2891
|
minLevel: 3,
|
|
2892
2892
|
hideLogPositionForProduction: false
|
|
@@ -3887,7 +3887,7 @@ var we = class {
|
|
|
3887
3887
|
}
|
|
3888
3888
|
};
|
|
3889
3889
|
//#endregion
|
|
3890
|
-
//#region
|
|
3890
|
+
//#region ../../packages/shared/src/fmt.ts
|
|
3891
3891
|
const fmt = { param: (value, variant, ifEmpty = "") => {
|
|
3892
3892
|
return `<span class="param ${variant ? variant : ""}">${value ? value : ifEmpty}</span>`;
|
|
3893
3893
|
} };
|
|
@@ -3899,7 +3899,7 @@ var src_default$1 = {
|
|
|
3899
3899
|
importModuleLoader: () => Promise.resolve().then(() => require("./emscripten-module-VHMWRAJ2-CZxK3CFi.cjs")).then((mod) => mod.default)
|
|
3900
3900
|
};
|
|
3901
3901
|
//#endregion
|
|
3902
|
-
//#region
|
|
3902
|
+
//#region ../../packages/shared/src/quickjs.ts
|
|
3903
3903
|
var EvaluationError = class extends Error {
|
|
3904
3904
|
constructor(name, description) {
|
|
3905
3905
|
super(description);
|
|
@@ -3971,7 +3971,7 @@ const createQuickJsFromVariant = async (variant) => {
|
|
|
3971
3971
|
};
|
|
3972
3972
|
const createQuickJs = () => createQuickJsFromVariant(src_default$1);
|
|
3973
3973
|
//#endregion
|
|
3974
|
-
//#region
|
|
3974
|
+
//#region ../../packages/shared/src/evaluator.ts
|
|
3975
3975
|
const makeResolvedParams = async (data, onItem = (item) => item, _vm) => {
|
|
3976
3976
|
const { logger } = useLogger();
|
|
3977
3977
|
const vm = _vm ?? await createQuickJs();
|
|
@@ -3997,7 +3997,7 @@ const makeResolvedParams = async (data, onItem = (item) => item, _vm) => {
|
|
|
3997
3997
|
return result;
|
|
3998
3998
|
};
|
|
3999
3999
|
//#endregion
|
|
4000
|
-
//#region
|
|
4000
|
+
//#region ../../packages/shared/src/variables.ts
|
|
4001
4001
|
const variableToFormattedVariable = async (vm, variables) => {
|
|
4002
4002
|
const result = {};
|
|
4003
4003
|
for (const variable of variables) {
|
|
@@ -4008,7 +4008,7 @@ const variableToFormattedVariable = async (vm, variables) => {
|
|
|
4008
4008
|
return result;
|
|
4009
4009
|
};
|
|
4010
4010
|
//#endregion
|
|
4011
|
-
//#region
|
|
4011
|
+
//#region ../../packages/shared/src/graph.ts
|
|
4012
4012
|
const getPluginDefinition = (pluginId, definitions) => {
|
|
4013
4013
|
return definitions.find((nodeDef) => {
|
|
4014
4014
|
return nodeDef.id === pluginId;
|
|
@@ -4069,7 +4069,7 @@ const processGraph = async (options) => {
|
|
|
4069
4069
|
return options;
|
|
4070
4070
|
};
|
|
4071
4071
|
//#endregion
|
|
4072
|
-
//#region
|
|
4072
|
+
//#region ../../packages/shared/src/i18n/en_US.json
|
|
4073
4073
|
var en_US_default = {
|
|
4074
4074
|
settings: {
|
|
4075
4075
|
"darkTheme": "Dark theme",
|
|
@@ -4214,7 +4214,7 @@ var en_US_default = {
|
|
|
4214
4214
|
}
|
|
4215
4215
|
};
|
|
4216
4216
|
//#endregion
|
|
4217
|
-
//#region
|
|
4217
|
+
//#region ../../packages/shared/src/i18n/fr_FR.json
|
|
4218
4218
|
var fr_FR_default = {
|
|
4219
4219
|
settings: {
|
|
4220
4220
|
"darkTheme": "Thème sombre",
|
|
@@ -4303,7 +4303,7 @@ var fr_FR_default = {
|
|
|
4303
4303
|
scenarios: { "scenarios": "Scénarios" }
|
|
4304
4304
|
};
|
|
4305
4305
|
//#endregion
|
|
4306
|
-
//#region
|
|
4306
|
+
//#region ../../packages/shared/src/i18n/pt_BR.json
|
|
4307
4307
|
var pt_BR_default = {
|
|
4308
4308
|
settings: {
|
|
4309
4309
|
"darkTheme": "Tema escuro",
|
|
@@ -4389,7 +4389,7 @@ var pt_BR_default = {
|
|
|
4389
4389
|
scenarios: { "scenarios": "Scenarios" }
|
|
4390
4390
|
};
|
|
4391
4391
|
//#endregion
|
|
4392
|
-
//#region
|
|
4392
|
+
//#region ../../packages/shared/src/i18n/zh_CN.json
|
|
4393
4393
|
var zh_CN_default = {
|
|
4394
4394
|
settings: {
|
|
4395
4395
|
"darkTheme": "Dark theme",
|
|
@@ -4475,7 +4475,7 @@ var zh_CN_default = {
|
|
|
4475
4475
|
scenarios: { "scenarios": "Scenarios" }
|
|
4476
4476
|
};
|
|
4477
4477
|
//#endregion
|
|
4478
|
-
//#region
|
|
4478
|
+
//#region ../../packages/shared/src/i18n/es_ES.json
|
|
4479
4479
|
var es_ES_default = {
|
|
4480
4480
|
settings: {
|
|
4481
4481
|
"darkTheme": "Dark theme",
|
|
@@ -4561,7 +4561,7 @@ var es_ES_default = {
|
|
|
4561
4561
|
scenarios: { "scenarios": "Scenarios" }
|
|
4562
4562
|
};
|
|
4563
4563
|
//#endregion
|
|
4564
|
-
//#region
|
|
4564
|
+
//#region ../../packages/shared/src/i18n/de_DE.json
|
|
4565
4565
|
var de_DE_default = {
|
|
4566
4566
|
settings: {
|
|
4567
4567
|
"darkTheme": "Dark theme",
|
|
@@ -4647,7 +4647,7 @@ var de_DE_default = {
|
|
|
4647
4647
|
scenarios: { "scenarios": "Scenarios" }
|
|
4648
4648
|
};
|
|
4649
4649
|
//#endregion
|
|
4650
|
-
//#region
|
|
4650
|
+
//#region ../../packages/shared/src/model.ts
|
|
4651
4651
|
const OriginValidator = object({
|
|
4652
4652
|
pluginId: string(),
|
|
4653
4653
|
nodeId: string()
|
|
@@ -46912,7 +46912,7 @@ var require_vue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46912
46912
|
var vue_exports = /* @__PURE__ */ __exportAll({});
|
|
46913
46913
|
__reExport(vue_exports, /* @__PURE__ */ __toESM(require_vue(), 1));
|
|
46914
46914
|
//#endregion
|
|
46915
|
-
//#region
|
|
46915
|
+
//#region ../../packages/shared/src/plugins.ts
|
|
46916
46916
|
const plugins = (0, vue_exports.shallowRef)([]);
|
|
46917
46917
|
const usePlugins = () => {
|
|
46918
46918
|
const load = () => {};
|
|
@@ -46926,7 +46926,7 @@ const usePlugins = () => {
|
|
|
46926
46926
|
};
|
|
46927
46927
|
};
|
|
46928
46928
|
//#endregion
|
|
46929
|
-
//#region
|
|
46929
|
+
//#region ../../packages/shared/src/plugins/definitions.ts
|
|
46930
46930
|
const createNodeDefinition = (def) => {
|
|
46931
46931
|
return def;
|
|
46932
46932
|
};
|
|
@@ -47043,7 +47043,7 @@ const createEvent = (event) => {
|
|
|
47043
47043
|
};
|
|
47044
47044
|
};
|
|
47045
47045
|
//#endregion
|
|
47046
|
-
//#region
|
|
47046
|
+
//#region ../../packages/shared/src/save-location.ts
|
|
47047
47047
|
const SaveLocationInternalValidator = object({
|
|
47048
47048
|
id: string(),
|
|
47049
47049
|
project: string(),
|
|
@@ -47075,7 +47075,7 @@ const SaveLocationValidator = union([
|
|
|
47075
47075
|
SaveLocationPipelabCloudValidator
|
|
47076
47076
|
]);
|
|
47077
47077
|
//#endregion
|
|
47078
|
-
//#region
|
|
47078
|
+
//#region ../../packages/shared/src/subscription-errors.ts
|
|
47079
47079
|
var SubscriptionRequiredError = class extends Error {
|
|
47080
47080
|
code = "SUBSCRIPTION_REQUIRED";
|
|
47081
47081
|
benefit;
|
|
@@ -64177,7 +64177,7 @@ function shouldShowDeprecationWarning() {
|
|
|
64177
64177
|
}
|
|
64178
64178
|
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");
|
|
64179
64179
|
//#endregion
|
|
64180
|
-
//#region
|
|
64180
|
+
//#region ../../packages/shared/src/supabase.ts
|
|
64181
64181
|
const getSupabaseConfig = () => {
|
|
64182
64182
|
return {
|
|
64183
64183
|
url: process.env.SUPABASE_URL || "",
|
|
@@ -64197,10 +64197,10 @@ const supabase = (options) => {
|
|
|
64197
64197
|
return createClient(url, anonKey, options);
|
|
64198
64198
|
};
|
|
64199
64199
|
//#endregion
|
|
64200
|
-
//#region
|
|
64200
|
+
//#region ../../packages/shared/src/utils.ts
|
|
64201
64201
|
const foo = "bar";
|
|
64202
64202
|
//#endregion
|
|
64203
|
-
//#region
|
|
64203
|
+
//#region ../../packages/shared/src/validation.ts
|
|
64204
64204
|
const isRequired = (param) => {
|
|
64205
64205
|
return param.required === true;
|
|
64206
64206
|
};
|
|
@@ -64210,7 +64210,7 @@ const isRenderer = () => {
|
|
|
64210
64210
|
return process.browser === true || process.title === "browser";
|
|
64211
64211
|
};
|
|
64212
64212
|
//#endregion
|
|
64213
|
-
//#region
|
|
64213
|
+
//#region ../../packages/shared/src/websocket.types.ts
|
|
64214
64214
|
var WebSocketError = class extends Error {
|
|
64215
64215
|
constructor(message, code, requestId) {
|
|
64216
64216
|
super(message);
|
|
@@ -64271,7 +64271,7 @@ object({
|
|
|
64271
64271
|
pipelines: optional(array(SaveLocationValidator), [])
|
|
64272
64272
|
});
|
|
64273
64273
|
//#endregion
|
|
64274
|
-
//#region
|
|
64274
|
+
//#region ../../packages/shared/src/index.ts
|
|
64275
64275
|
const appSettingsMigrator = appSettingsMigrator$1;
|
|
64276
64276
|
const defaultAppSettings = defaultAppSettings$1;
|
|
64277
64277
|
const fileRepoMigrations = fileRepoMigrations$1;
|
|
@@ -64294,155 +64294,16 @@ const createPlugin = (plugin) => {
|
|
|
64294
64294
|
return plugin;
|
|
64295
64295
|
};
|
|
64296
64296
|
//#endregion
|
|
64297
|
-
//#region src/custom-errors.ts
|
|
64298
|
-
var ExternalCommandError = class ExternalCommandError extends Error {
|
|
64299
|
-
code;
|
|
64300
|
-
constructor(message, code) {
|
|
64301
|
-
super(message);
|
|
64302
|
-
this.code = code;
|
|
64303
|
-
Object.setPrototypeOf(this, ExternalCommandError.prototype);
|
|
64304
|
-
}
|
|
64305
|
-
};
|
|
64306
|
-
//#endregion
|
|
64307
64297
|
//#region src/utils.ts
|
|
64308
64298
|
const fileExists = async (path) => {
|
|
64309
64299
|
try {
|
|
64310
|
-
|
|
64300
|
+
const { access } = await import("node:fs/promises");
|
|
64301
|
+
await access(path);
|
|
64311
64302
|
return true;
|
|
64312
64303
|
} catch {
|
|
64313
64304
|
return false;
|
|
64314
64305
|
}
|
|
64315
64306
|
};
|
|
64316
|
-
const runWithLiveLogs = async (command, args, execaOptions, log, hooks) => {
|
|
64317
|
-
return new Promise((resolve, reject) => {
|
|
64318
|
-
console.log("command: ", command, args.join(" "));
|
|
64319
|
-
const subprocess = (0, execa.execa)(command, args, {
|
|
64320
|
-
...execaOptions,
|
|
64321
|
-
stdout: "pipe",
|
|
64322
|
-
stderr: "pipe",
|
|
64323
|
-
stdin: "pipe"
|
|
64324
|
-
});
|
|
64325
|
-
subprocess.stdout.on("data", (data) => {
|
|
64326
|
-
hooks?.onStdout?.(data.toString(), subprocess);
|
|
64327
|
-
});
|
|
64328
|
-
subprocess.stderr?.on("data", (data) => {
|
|
64329
|
-
hooks?.onStderr?.(data.toString(), subprocess);
|
|
64330
|
-
});
|
|
64331
|
-
subprocess.on("error", (error) => {
|
|
64332
|
-
console.log("error", error);
|
|
64333
|
-
return reject(error);
|
|
64334
|
-
});
|
|
64335
|
-
subprocess.on("close", (code) => {
|
|
64336
|
-
console.log("close", code);
|
|
64337
|
-
hooks?.onExit?.(code);
|
|
64338
|
-
if (code === 0) return resolve();
|
|
64339
|
-
else return reject(/* @__PURE__ */ new Error(`Command exited with non-zero code: ${code}`));
|
|
64340
|
-
});
|
|
64341
|
-
subprocess.on("disconnect", () => {
|
|
64342
|
-
console.log("disconnect");
|
|
64343
|
-
hooks?.onExit?.(0);
|
|
64344
|
-
return resolve();
|
|
64345
|
-
});
|
|
64346
|
-
subprocess.on("exit", (code) => {
|
|
64347
|
-
console.log("exit", code);
|
|
64348
|
-
hooks?.onExit?.(code);
|
|
64349
|
-
if (code === 0) return resolve();
|
|
64350
|
-
else return reject(/* @__PURE__ */ new Error(`Command exited with non-zero code: ${code}`));
|
|
64351
|
-
});
|
|
64352
|
-
});
|
|
64353
|
-
};
|
|
64354
|
-
const runWithLiveLogsPTY = async (command, args, execaOptions, log, hooks, abortSignal) => {
|
|
64355
|
-
return new Promise((resolve, reject) => {
|
|
64356
|
-
console.log("command (execa-pty-fallback): ", command, args.join(" "));
|
|
64357
|
-
const subprocess = (0, execa.execa)(command, args, {
|
|
64358
|
-
...execaOptions,
|
|
64359
|
-
stdout: "pipe",
|
|
64360
|
-
stderr: "pipe",
|
|
64361
|
-
stdin: "pipe",
|
|
64362
|
-
env: {
|
|
64363
|
-
...process.env,
|
|
64364
|
-
...execaOptions.env,
|
|
64365
|
-
TERM: "xterm-256color",
|
|
64366
|
-
FORCE_STDERR_LOGGING: "1"
|
|
64367
|
-
},
|
|
64368
|
-
cancelSignal: abortSignal
|
|
64369
|
-
});
|
|
64370
|
-
hooks?.onCreated?.(subprocess);
|
|
64371
|
-
subprocess.stdout?.on("data", (data) => {
|
|
64372
|
-
hooks?.onStdout?.(data.toString(), subprocess);
|
|
64373
|
-
});
|
|
64374
|
-
subprocess.stderr?.on("data", (data) => {
|
|
64375
|
-
hooks?.onStderr?.(data.toString(), subprocess);
|
|
64376
|
-
});
|
|
64377
|
-
subprocess.on("error", (error) => {
|
|
64378
|
-
console.log("error", error);
|
|
64379
|
-
return reject(error);
|
|
64380
|
-
});
|
|
64381
|
-
subprocess.on("exit", (code) => {
|
|
64382
|
-
console.log("exit", code);
|
|
64383
|
-
hooks?.onExit?.(code || 0);
|
|
64384
|
-
if (code === 0) return resolve();
|
|
64385
|
-
else return reject(new ExternalCommandError(`Command exited with non-zero code: ${code}`, code || 1));
|
|
64386
|
-
});
|
|
64387
|
-
});
|
|
64388
|
-
};
|
|
64389
|
-
/**
|
|
64390
|
-
* Downloads a file from a given URL to a specified local path with progress tracking.
|
|
64391
|
-
*
|
|
64392
|
-
* @param url - The URL of the file to download.
|
|
64393
|
-
* @param localPath - The local file path to save the downloaded file.
|
|
64394
|
-
* @returns A promise that resolves when the file is downloaded.
|
|
64395
|
-
*/
|
|
64396
|
-
const downloadFile = async (url, localPath, hooks, abortSignal) => {
|
|
64397
|
-
const response = await fetch(url, { signal: abortSignal });
|
|
64398
|
-
if (!response.ok) throw new Error(`Failed to fetch file: ${response.statusText}`);
|
|
64399
|
-
const contentLength = response.headers.get("content-length");
|
|
64400
|
-
if (!contentLength) throw new Error("Content-Length header is missing");
|
|
64401
|
-
const totalSize = parseInt(contentLength, 10);
|
|
64402
|
-
let downloadedSize = 0;
|
|
64403
|
-
const fileStream = (0, node_fs.createWriteStream)(localPath);
|
|
64404
|
-
const progressStream = new TransformStream({ transform(chunk, controller) {
|
|
64405
|
-
downloadedSize += chunk.length;
|
|
64406
|
-
const progress = downloadedSize / totalSize * 100;
|
|
64407
|
-
if (hooks?.onProgress) hooks.onProgress({
|
|
64408
|
-
progress,
|
|
64409
|
-
downloadedSize
|
|
64410
|
-
});
|
|
64411
|
-
controller.enqueue(chunk);
|
|
64412
|
-
} });
|
|
64413
|
-
const readable = response.body?.pipeThrough(progressStream);
|
|
64414
|
-
if (!readable) throw new Error("Failed to create a readable stream");
|
|
64415
|
-
await (0, node_stream_promises.pipeline)(readable, fileStream);
|
|
64416
|
-
};
|
|
64417
|
-
/**
|
|
64418
|
-
* Installs an NPM package from the npm registry as a tarball if not already present.
|
|
64419
|
-
* @param thirdpartyDir The directory where third-party tools are stored.
|
|
64420
|
-
* @param name The name of the package (e.g., 'pnpm' or '@poki/cli').
|
|
64421
|
-
* @param version The version of the package.
|
|
64422
|
-
* @param options (Optional) configuration for dependency installation.
|
|
64423
|
-
* @returns A Promise that resolves to the path of the extracted package (the 'package' subfolder).
|
|
64424
|
-
*/
|
|
64425
|
-
const ensureNPMPackage = async (thirdpartyDir, name, version, options) => {
|
|
64426
|
-
const packageDir = (0, node_path.join)(thirdpartyDir, name, version);
|
|
64427
|
-
const finalPath = (0, node_path.join)(packageDir, "package");
|
|
64428
|
-
if (await fileExists(finalPath)) return finalPath;
|
|
64429
|
-
console.log(`NPM package ${name}@${version} not found at ${finalPath}, installing...`);
|
|
64430
|
-
console.log(`Extracting ${name}@${version} to ${finalPath}...`);
|
|
64431
|
-
await (0, node_fs_promises.mkdir)(packageDir, { recursive: true });
|
|
64432
|
-
await pacote.default.extract(`${name}@${version}`, finalPath);
|
|
64433
|
-
if (options?.installDeps && options.pnpmPath) {
|
|
64434
|
-
console.log(`Installing dependencies for ${name}@${version} using pnpm at ${options.pnpmPath}...`);
|
|
64435
|
-
await (0, execa.execa)(options.nodePath || process.execPath, [
|
|
64436
|
-
options.pnpmPath,
|
|
64437
|
-
"install",
|
|
64438
|
-
"--prod"
|
|
64439
|
-
], {
|
|
64440
|
-
cwd: finalPath,
|
|
64441
|
-
stdio: "inherit"
|
|
64442
|
-
});
|
|
64443
|
-
}
|
|
64444
|
-
return finalPath;
|
|
64445
|
-
};
|
|
64446
64307
|
//#endregion
|
|
64447
64308
|
//#region src/fs-utils.ts
|
|
64448
64309
|
const ensure = async (filesPath, defaultContent = "{}") => {
|
|
@@ -64471,19 +64332,11 @@ const generateTempFolder = async (base) => {
|
|
|
64471
64332
|
async function extractTarGz(archivePath, destinationDir) {
|
|
64472
64333
|
console.log(`Extracting ${archivePath} to ${destinationDir}...`);
|
|
64473
64334
|
await (0, node_fs_promises.mkdir)(destinationDir, { recursive: true });
|
|
64474
|
-
|
|
64475
|
-
|
|
64476
|
-
|
|
64477
|
-
const extractStream = tar.default.extract({ cwd: destinationDir });
|
|
64478
|
-
readStream.on("error", reject);
|
|
64479
|
-
gunzipStream.on("error", reject);
|
|
64480
|
-
extractStream.on("error", reject);
|
|
64481
|
-
extractStream.on("close", () => {
|
|
64482
|
-
console.log("Extraction finished.");
|
|
64483
|
-
resolve();
|
|
64484
|
-
});
|
|
64485
|
-
readStream.pipe(gunzipStream).pipe(extractStream);
|
|
64335
|
+
await tar.default.x({
|
|
64336
|
+
file: archivePath,
|
|
64337
|
+
cwd: destinationDir
|
|
64486
64338
|
});
|
|
64339
|
+
console.log("Extraction finished.");
|
|
64487
64340
|
}
|
|
64488
64341
|
/**
|
|
64489
64342
|
* Extracts a .zip archive.
|
|
@@ -64543,6 +64396,16 @@ const zipFolder = async (from, to, log) => {
|
|
|
64543
64396
|
});
|
|
64544
64397
|
};
|
|
64545
64398
|
//#endregion
|
|
64399
|
+
//#region src/custom-errors.ts
|
|
64400
|
+
var ExternalCommandError = class ExternalCommandError extends Error {
|
|
64401
|
+
code;
|
|
64402
|
+
constructor(message, code) {
|
|
64403
|
+
super(message);
|
|
64404
|
+
this.code = code;
|
|
64405
|
+
Object.setPrototypeOf(this, ExternalCommandError.prototype);
|
|
64406
|
+
}
|
|
64407
|
+
};
|
|
64408
|
+
//#endregion
|
|
64546
64409
|
//#region src/node-utils.ts
|
|
64547
64410
|
const fileExists$1 = async (path) => {
|
|
64548
64411
|
try {
|
|
@@ -64584,6 +64447,7 @@ exports.BenefitNotFoundError = BenefitNotFoundError;
|
|
|
64584
64447
|
exports.EditorParamValidatorV3 = EditorParamValidatorV3;
|
|
64585
64448
|
exports.ExternalCommandError = ExternalCommandError;
|
|
64586
64449
|
exports.OriginValidator = OriginValidator;
|
|
64450
|
+
exports.PipelabContext = _pipelab_core_node.PipelabContext;
|
|
64587
64451
|
exports.RELEASE_SYNC = src_default;
|
|
64588
64452
|
exports.SaveLocationExternalValidator = SaveLocationExternalValidator;
|
|
64589
64453
|
exports.SaveLocationInternalValidator = SaveLocationInternalValidator;
|
|
@@ -64642,7 +64506,12 @@ Object.defineProperty(exports, "de_DE", {
|
|
|
64642
64506
|
exports.defaultAppSettings = defaultAppSettings;
|
|
64643
64507
|
exports.defaultFileRepo = defaultFileRepo;
|
|
64644
64508
|
exports.detectRuntime = detectRuntime;
|
|
64645
|
-
exports
|
|
64509
|
+
Object.defineProperty(exports, "downloadFile", {
|
|
64510
|
+
enumerable: true,
|
|
64511
|
+
get: function() {
|
|
64512
|
+
return _pipelab_core_node.downloadFile;
|
|
64513
|
+
}
|
|
64514
|
+
});
|
|
64646
64515
|
Object.defineProperty(exports, "en_US", {
|
|
64647
64516
|
enumerable: true,
|
|
64648
64517
|
get: function() {
|
|
@@ -64650,7 +64519,6 @@ Object.defineProperty(exports, "en_US", {
|
|
|
64650
64519
|
}
|
|
64651
64520
|
});
|
|
64652
64521
|
exports.ensure = ensure;
|
|
64653
|
-
exports.ensureNPMPackage = ensureNPMPackage;
|
|
64654
64522
|
Object.defineProperty(exports, "es_ES", {
|
|
64655
64523
|
enumerable: true,
|
|
64656
64524
|
get: function() {
|
|
@@ -64659,6 +64527,30 @@ Object.defineProperty(exports, "es_ES", {
|
|
|
64659
64527
|
});
|
|
64660
64528
|
exports.extractTarGz = extractTarGz;
|
|
64661
64529
|
exports.extractZip = extractZip;
|
|
64530
|
+
Object.defineProperty(exports, "fetchPackage", {
|
|
64531
|
+
enumerable: true,
|
|
64532
|
+
get: function() {
|
|
64533
|
+
return _pipelab_core_node.fetchPackage;
|
|
64534
|
+
}
|
|
64535
|
+
});
|
|
64536
|
+
Object.defineProperty(exports, "fetchPipelabAsset", {
|
|
64537
|
+
enumerable: true,
|
|
64538
|
+
get: function() {
|
|
64539
|
+
return _pipelab_core_node.fetchPipelabAsset;
|
|
64540
|
+
}
|
|
64541
|
+
});
|
|
64542
|
+
Object.defineProperty(exports, "fetchPipelabCli", {
|
|
64543
|
+
enumerable: true,
|
|
64544
|
+
get: function() {
|
|
64545
|
+
return _pipelab_core_node.fetchPipelabCli;
|
|
64546
|
+
}
|
|
64547
|
+
});
|
|
64548
|
+
Object.defineProperty(exports, "fetchPipelabPlugin", {
|
|
64549
|
+
enumerable: true,
|
|
64550
|
+
get: function() {
|
|
64551
|
+
return _pipelab_core_node.fetchPipelabPlugin;
|
|
64552
|
+
}
|
|
64553
|
+
});
|
|
64662
64554
|
exports.fileExists = fileExists;
|
|
64663
64555
|
exports.fileRepoMigrations = fileRepoMigrations;
|
|
64664
64556
|
exports.fmt = fmt;
|
|
@@ -64687,8 +64579,18 @@ Object.defineProperty(exports, "pt_BR", {
|
|
|
64687
64579
|
return pt_BR_default;
|
|
64688
64580
|
}
|
|
64689
64581
|
});
|
|
64690
|
-
exports
|
|
64691
|
-
|
|
64582
|
+
Object.defineProperty(exports, "runPnpm", {
|
|
64583
|
+
enumerable: true,
|
|
64584
|
+
get: function() {
|
|
64585
|
+
return _pipelab_core_node.runPnpm;
|
|
64586
|
+
}
|
|
64587
|
+
});
|
|
64588
|
+
Object.defineProperty(exports, "runWithLiveLogs", {
|
|
64589
|
+
enumerable: true,
|
|
64590
|
+
get: function() {
|
|
64591
|
+
return _pipelab_core_node.runWithLiveLogs;
|
|
64592
|
+
}
|
|
64593
|
+
});
|
|
64692
64594
|
exports.savedFileMigrator = savedFileMigrator;
|
|
64693
64595
|
Object.defineProperty(exports, "schema", {
|
|
64694
64596
|
enumerable: true,
|