@pipelab/plugin-core 1.0.1-beta.9 → 1.0.1-latest.29
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 +148 -0
- package/dist/index.cjs +78 -114
- package/dist/index.d.cts +39 -73
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +39 -73
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +35 -110
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -5
- package/src/pipelab.ts +62 -70
- package/src/utils.ts +17 -167
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,153 @@
|
|
|
1
1
|
# @pipelab/plugin-core
|
|
2
2
|
|
|
3
|
+
## 1.0.1-latest.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- sqd
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @pipelab/core-node@1.0.1-latest.33
|
|
10
|
+
|
|
11
|
+
## 1.0.1-beta.28
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- sd
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @pipelab/core-node@1.0.1-beta.32
|
|
18
|
+
|
|
19
|
+
## 1.0.1-beta.27
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- sd
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @pipelab/core-node@1.0.1-beta.31
|
|
26
|
+
|
|
27
|
+
## 1.0.1-beta.26
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- df
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @pipelab/core-node@1.0.1-beta.30
|
|
34
|
+
|
|
35
|
+
## 1.0.1-beta.25
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- sd
|
|
40
|
+
- Updated dependencies
|
|
41
|
+
- @pipelab/core-node@1.0.1-beta.29
|
|
42
|
+
|
|
43
|
+
## 1.0.1-beta.24
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- dfg
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
- @pipelab/core-node@1.0.1-beta.28
|
|
50
|
+
|
|
51
|
+
## 1.0.1-beta.23
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- sd
|
|
56
|
+
- Updated dependencies
|
|
57
|
+
- @pipelab/core-node@1.0.1-beta.27
|
|
58
|
+
|
|
59
|
+
## 1.0.1-beta.22
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- xwc
|
|
64
|
+
- Updated dependencies
|
|
65
|
+
- @pipelab/core-node@1.0.1-beta.26
|
|
66
|
+
|
|
67
|
+
## 1.0.1-beta.21
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- sdsd
|
|
72
|
+
- Updated dependencies
|
|
73
|
+
- @pipelab/core-node@1.0.1-beta.25
|
|
74
|
+
|
|
75
|
+
## 1.0.1-beta.20
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- gf
|
|
80
|
+
- Updated dependencies
|
|
81
|
+
- @pipelab/core-node@1.0.1-beta.24
|
|
82
|
+
|
|
83
|
+
## 1.0.1-beta.19
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- azs
|
|
88
|
+
- Updated dependencies
|
|
89
|
+
- @pipelab/core-node@1.0.1-beta.23
|
|
90
|
+
|
|
91
|
+
## 1.0.1-beta.18
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- sqqd
|
|
96
|
+
- Updated dependencies
|
|
97
|
+
- @pipelab/core-node@1.0.1-beta.22
|
|
98
|
+
|
|
99
|
+
## 1.0.1-beta.17
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- sd
|
|
104
|
+
- Updated dependencies
|
|
105
|
+
- @pipelab/core-node@1.0.1-beta.21
|
|
106
|
+
|
|
107
|
+
## 1.0.1-beta.16
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- sd
|
|
112
|
+
- Updated dependencies
|
|
113
|
+
- @pipelab/core-node@1.0.1-beta.20
|
|
114
|
+
|
|
115
|
+
## 1.0.1-beta.15
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- wdf
|
|
120
|
+
|
|
121
|
+
## 1.0.1-beta.14
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- sdf
|
|
126
|
+
|
|
127
|
+
## 1.0.1-beta.13
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- update
|
|
132
|
+
|
|
133
|
+
## 1.0.1-beta.12
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- sd
|
|
138
|
+
|
|
139
|
+
## 1.0.1-beta.11
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- rfg
|
|
144
|
+
|
|
145
|
+
## 1.0.1-beta.10
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- szd
|
|
150
|
+
|
|
3
151
|
## 1.0.1-beta.9
|
|
4
152
|
|
|
5
153
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -38,14 +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");
|
|
45
|
+
let node_fs = require("node:fs");
|
|
49
46
|
let tar = require("tar");
|
|
50
47
|
tar = __toESM(tar);
|
|
51
48
|
let yauzl = require("yauzl");
|
|
@@ -2356,8 +2353,6 @@ const AppSettingsValidatorV6 = object({
|
|
|
2356
2353
|
const AppSettingsValidatorV7 = object({
|
|
2357
2354
|
theme: union([literal("light"), literal("dark")]),
|
|
2358
2355
|
version: literal("7.0.0"),
|
|
2359
|
-
cacheFolder: string(),
|
|
2360
|
-
clearTemporaryFoldersOnPipelineEnd: boolean(),
|
|
2361
2356
|
locale: union([
|
|
2362
2357
|
literal("en-US"),
|
|
2363
2358
|
literal("fr-FR"),
|
|
@@ -2381,7 +2376,12 @@ const AppSettingsValidatorV7 = object({
|
|
|
2381
2376
|
id: string(),
|
|
2382
2377
|
name: string(),
|
|
2383
2378
|
url: string()
|
|
2384
|
-
}))
|
|
2379
|
+
})),
|
|
2380
|
+
buildHistory: object({ retentionPolicy: object({
|
|
2381
|
+
enabled: boolean(),
|
|
2382
|
+
maxEntries: number(),
|
|
2383
|
+
maxAge: number()
|
|
2384
|
+
}) })
|
|
2385
2385
|
});
|
|
2386
2386
|
const AppSettingsValidator = AppSettingsValidatorV7;
|
|
2387
2387
|
//#endregion
|
|
@@ -4089,8 +4089,6 @@ var en_US_default = {
|
|
|
4089
4089
|
"advanced": "Advanced",
|
|
4090
4090
|
"billing": "Billing"
|
|
4091
4091
|
},
|
|
4092
|
-
"clearTempFolders": "Automatically clean up temporary files",
|
|
4093
|
-
"clearTempFoldersDescription": "When enabled, all temporary files created during pipeline execution will be automatically deleted after the pipeline completes. This helps save disk space but you may need to copy artifacts yourself to preserve them.",
|
|
4094
4092
|
"pipeline-cache-folder": "Pipeline Cache Folder:",
|
|
4095
4093
|
"enter-or-browse-for-a-folder": "Enter or browse for a folder",
|
|
4096
4094
|
"browse": "Browse",
|
|
@@ -4106,7 +4104,20 @@ var en_US_default = {
|
|
|
4106
4104
|
"select-cache-folder": "Select Cache Folder",
|
|
4107
4105
|
"restart-dashboard-tour": "Restart Dashboard Tour",
|
|
4108
4106
|
"restart-editor-tour": "Restart Editor Tour",
|
|
4109
|
-
"tour-reset-success": "Tour has been reset. It will start the next time you visit the page."
|
|
4107
|
+
"tour-reset-success": "Tour has been reset. It will start the next time you visit the page.",
|
|
4108
|
+
"retentionPolicy": "Retention Policy",
|
|
4109
|
+
"retentionPolicyDescription": "Manage how long your build logs and history are kept.",
|
|
4110
|
+
"retentionEnabled": "Enable Retention Policy",
|
|
4111
|
+
"retentionMaxEntries": "Maximum Entries",
|
|
4112
|
+
"retentionMaxEntriesDescription": "Keep up to this number of entries per pipeline.",
|
|
4113
|
+
"retentionMaxAge": "Maximum Age (days)",
|
|
4114
|
+
"retentionMaxAgeDescription": "Keep entries for up to this many days.",
|
|
4115
|
+
"storage-pipelab": "Pipelab",
|
|
4116
|
+
"storage-other": "Other Apps",
|
|
4117
|
+
"storage-free": "Free Space",
|
|
4118
|
+
"disk-usage": "Disk Usage",
|
|
4119
|
+
"free": "Free",
|
|
4120
|
+
"other": "Other"
|
|
4110
4121
|
},
|
|
4111
4122
|
headers: {
|
|
4112
4123
|
"dashboard": "Dashboard",
|
|
@@ -64292,113 +64303,16 @@ const createPlugin = (plugin) => {
|
|
|
64292
64303
|
return plugin;
|
|
64293
64304
|
};
|
|
64294
64305
|
//#endregion
|
|
64295
|
-
//#region src/custom-errors.ts
|
|
64296
|
-
var ExternalCommandError = class ExternalCommandError extends Error {
|
|
64297
|
-
code;
|
|
64298
|
-
constructor(message, code) {
|
|
64299
|
-
super(message);
|
|
64300
|
-
this.code = code;
|
|
64301
|
-
Object.setPrototypeOf(this, ExternalCommandError.prototype);
|
|
64302
|
-
}
|
|
64303
|
-
};
|
|
64304
|
-
//#endregion
|
|
64305
64306
|
//#region src/utils.ts
|
|
64306
64307
|
const fileExists = async (path) => {
|
|
64307
64308
|
try {
|
|
64308
|
-
|
|
64309
|
+
const { access } = await import("node:fs/promises");
|
|
64310
|
+
await access(path);
|
|
64309
64311
|
return true;
|
|
64310
64312
|
} catch {
|
|
64311
64313
|
return false;
|
|
64312
64314
|
}
|
|
64313
64315
|
};
|
|
64314
|
-
const runWithLiveLogs = async (command, args, execaOptions, log, hooks, abortSignal) => {
|
|
64315
|
-
console.log("command: ", command, args.join(" "));
|
|
64316
|
-
const subprocess = (0, execa.execa)(command, args, {
|
|
64317
|
-
...execaOptions,
|
|
64318
|
-
stdout: "pipe",
|
|
64319
|
-
stderr: "pipe",
|
|
64320
|
-
stdin: "pipe",
|
|
64321
|
-
env: {
|
|
64322
|
-
...process.env,
|
|
64323
|
-
...execaOptions.env,
|
|
64324
|
-
TERM: "xterm-256color",
|
|
64325
|
-
FORCE_STDERR_LOGGING: "1"
|
|
64326
|
-
},
|
|
64327
|
-
cancelSignal: abortSignal
|
|
64328
|
-
});
|
|
64329
|
-
hooks?.onCreated?.(subprocess);
|
|
64330
|
-
subprocess.stdout?.on("data", (data) => {
|
|
64331
|
-
hooks?.onStdout?.(data.toString(), subprocess);
|
|
64332
|
-
});
|
|
64333
|
-
subprocess.stderr?.on("data", (data) => {
|
|
64334
|
-
hooks?.onStderr?.(data.toString(), subprocess);
|
|
64335
|
-
});
|
|
64336
|
-
try {
|
|
64337
|
-
const { exitCode } = await subprocess;
|
|
64338
|
-
hooks?.onExit?.(exitCode ?? 0);
|
|
64339
|
-
} catch (error) {
|
|
64340
|
-
const code = error.exitCode ?? 1;
|
|
64341
|
-
hooks?.onExit?.(code);
|
|
64342
|
-
throw new ExternalCommandError(error.message, code);
|
|
64343
|
-
}
|
|
64344
|
-
};
|
|
64345
|
-
/**
|
|
64346
|
-
* Downloads a file from a given URL to a specified local path with progress tracking.
|
|
64347
|
-
*
|
|
64348
|
-
* @param url - The URL of the file to download.
|
|
64349
|
-
* @param localPath - The local file path to save the downloaded file.
|
|
64350
|
-
* @returns A promise that resolves when the file is downloaded.
|
|
64351
|
-
*/
|
|
64352
|
-
const downloadFile = async (url, localPath, hooks, abortSignal) => {
|
|
64353
|
-
const response = await fetch(url, { signal: abortSignal });
|
|
64354
|
-
if (!response.ok) throw new Error(`Failed to fetch file: ${response.statusText}`);
|
|
64355
|
-
const contentLength = response.headers.get("content-length");
|
|
64356
|
-
if (!contentLength) throw new Error("Content-Length header is missing");
|
|
64357
|
-
const totalSize = parseInt(contentLength, 10);
|
|
64358
|
-
let downloadedSize = 0;
|
|
64359
|
-
const fileStream = (0, node_fs.createWriteStream)(localPath);
|
|
64360
|
-
const progressStream = new TransformStream({ transform(chunk, controller) {
|
|
64361
|
-
downloadedSize += chunk.length;
|
|
64362
|
-
const progress = downloadedSize / totalSize * 100;
|
|
64363
|
-
if (hooks?.onProgress) hooks.onProgress({
|
|
64364
|
-
progress,
|
|
64365
|
-
downloadedSize
|
|
64366
|
-
});
|
|
64367
|
-
controller.enqueue(chunk);
|
|
64368
|
-
} });
|
|
64369
|
-
const readable = response.body?.pipeThrough(progressStream);
|
|
64370
|
-
if (!readable) throw new Error("Failed to create a readable stream");
|
|
64371
|
-
await (0, node_stream_promises.pipeline)(readable, fileStream);
|
|
64372
|
-
};
|
|
64373
|
-
/**
|
|
64374
|
-
* Installs an NPM package from the npm registry as a tarball if not already present.
|
|
64375
|
-
* @param thirdpartyDir The directory where third-party tools are stored.
|
|
64376
|
-
* @param name The name of the package (e.g., 'pnpm' or '@poki/cli').
|
|
64377
|
-
* @param version The version of the package.
|
|
64378
|
-
* @param options (Optional) configuration for dependency installation.
|
|
64379
|
-
* @returns A Promise that resolves to the path of the extracted package (the 'package' subfolder).
|
|
64380
|
-
*/
|
|
64381
|
-
const ensureNPMPackage = async (thirdpartyDir, name, version, options) => {
|
|
64382
|
-
const packageDir = (0, node_path.join)(thirdpartyDir, name, version);
|
|
64383
|
-
const finalPath = (0, node_path.join)(packageDir, "package");
|
|
64384
|
-
if (await fileExists(finalPath)) return finalPath;
|
|
64385
|
-
console.log(`NPM package ${name}@${version} not found at ${finalPath}, installing...`);
|
|
64386
|
-
console.log(`Extracting ${name}@${version} to ${finalPath}...`);
|
|
64387
|
-
await (0, node_fs_promises.mkdir)(packageDir, { recursive: true });
|
|
64388
|
-
await pacote.default.extract(`${name}@${version}`, finalPath);
|
|
64389
|
-
if (options?.installDeps && options.pnpmPath) {
|
|
64390
|
-
console.log(`Installing dependencies for ${name}@${version} using pnpm at ${options.pnpmPath}...`);
|
|
64391
|
-
await (0, execa.execa)(options.nodePath || process.execPath, [
|
|
64392
|
-
options.pnpmPath,
|
|
64393
|
-
"install",
|
|
64394
|
-
"--prod"
|
|
64395
|
-
], {
|
|
64396
|
-
cwd: finalPath,
|
|
64397
|
-
stdio: "inherit"
|
|
64398
|
-
});
|
|
64399
|
-
}
|
|
64400
|
-
return finalPath;
|
|
64401
|
-
};
|
|
64402
64316
|
//#endregion
|
|
64403
64317
|
//#region src/fs-utils.ts
|
|
64404
64318
|
const ensure = async (filesPath, defaultContent = "{}") => {
|
|
@@ -64491,6 +64405,16 @@ const zipFolder = async (from, to, log) => {
|
|
|
64491
64405
|
});
|
|
64492
64406
|
};
|
|
64493
64407
|
//#endregion
|
|
64408
|
+
//#region src/custom-errors.ts
|
|
64409
|
+
var ExternalCommandError = class ExternalCommandError extends Error {
|
|
64410
|
+
code;
|
|
64411
|
+
constructor(message, code) {
|
|
64412
|
+
super(message);
|
|
64413
|
+
this.code = code;
|
|
64414
|
+
Object.setPrototypeOf(this, ExternalCommandError.prototype);
|
|
64415
|
+
}
|
|
64416
|
+
};
|
|
64417
|
+
//#endregion
|
|
64494
64418
|
//#region src/node-utils.ts
|
|
64495
64419
|
const fileExists$1 = async (path) => {
|
|
64496
64420
|
try {
|
|
@@ -64532,6 +64456,7 @@ exports.BenefitNotFoundError = BenefitNotFoundError;
|
|
|
64532
64456
|
exports.EditorParamValidatorV3 = EditorParamValidatorV3;
|
|
64533
64457
|
exports.ExternalCommandError = ExternalCommandError;
|
|
64534
64458
|
exports.OriginValidator = OriginValidator;
|
|
64459
|
+
exports.PipelabContext = _pipelab_core_node.PipelabContext;
|
|
64535
64460
|
exports.RELEASE_SYNC = src_default;
|
|
64536
64461
|
exports.SaveLocationExternalValidator = SaveLocationExternalValidator;
|
|
64537
64462
|
exports.SaveLocationInternalValidator = SaveLocationInternalValidator;
|
|
@@ -64590,7 +64515,12 @@ Object.defineProperty(exports, "de_DE", {
|
|
|
64590
64515
|
exports.defaultAppSettings = defaultAppSettings;
|
|
64591
64516
|
exports.defaultFileRepo = defaultFileRepo;
|
|
64592
64517
|
exports.detectRuntime = detectRuntime;
|
|
64593
|
-
exports
|
|
64518
|
+
Object.defineProperty(exports, "downloadFile", {
|
|
64519
|
+
enumerable: true,
|
|
64520
|
+
get: function() {
|
|
64521
|
+
return _pipelab_core_node.downloadFile;
|
|
64522
|
+
}
|
|
64523
|
+
});
|
|
64594
64524
|
Object.defineProperty(exports, "en_US", {
|
|
64595
64525
|
enumerable: true,
|
|
64596
64526
|
get: function() {
|
|
@@ -64598,7 +64528,6 @@ Object.defineProperty(exports, "en_US", {
|
|
|
64598
64528
|
}
|
|
64599
64529
|
});
|
|
64600
64530
|
exports.ensure = ensure;
|
|
64601
|
-
exports.ensureNPMPackage = ensureNPMPackage;
|
|
64602
64531
|
Object.defineProperty(exports, "es_ES", {
|
|
64603
64532
|
enumerable: true,
|
|
64604
64533
|
get: function() {
|
|
@@ -64607,6 +64536,30 @@ Object.defineProperty(exports, "es_ES", {
|
|
|
64607
64536
|
});
|
|
64608
64537
|
exports.extractTarGz = extractTarGz;
|
|
64609
64538
|
exports.extractZip = extractZip;
|
|
64539
|
+
Object.defineProperty(exports, "fetchPackage", {
|
|
64540
|
+
enumerable: true,
|
|
64541
|
+
get: function() {
|
|
64542
|
+
return _pipelab_core_node.fetchPackage;
|
|
64543
|
+
}
|
|
64544
|
+
});
|
|
64545
|
+
Object.defineProperty(exports, "fetchPipelabAsset", {
|
|
64546
|
+
enumerable: true,
|
|
64547
|
+
get: function() {
|
|
64548
|
+
return _pipelab_core_node.fetchPipelabAsset;
|
|
64549
|
+
}
|
|
64550
|
+
});
|
|
64551
|
+
Object.defineProperty(exports, "fetchPipelabCli", {
|
|
64552
|
+
enumerable: true,
|
|
64553
|
+
get: function() {
|
|
64554
|
+
return _pipelab_core_node.fetchPipelabCli;
|
|
64555
|
+
}
|
|
64556
|
+
});
|
|
64557
|
+
Object.defineProperty(exports, "fetchPipelabPlugin", {
|
|
64558
|
+
enumerable: true,
|
|
64559
|
+
get: function() {
|
|
64560
|
+
return _pipelab_core_node.fetchPipelabPlugin;
|
|
64561
|
+
}
|
|
64562
|
+
});
|
|
64610
64563
|
exports.fileExists = fileExists;
|
|
64611
64564
|
exports.fileRepoMigrations = fileRepoMigrations;
|
|
64612
64565
|
exports.fmt = fmt;
|
|
@@ -64635,7 +64588,18 @@ Object.defineProperty(exports, "pt_BR", {
|
|
|
64635
64588
|
return pt_BR_default;
|
|
64636
64589
|
}
|
|
64637
64590
|
});
|
|
64638
|
-
exports
|
|
64591
|
+
Object.defineProperty(exports, "runPnpm", {
|
|
64592
|
+
enumerable: true,
|
|
64593
|
+
get: function() {
|
|
64594
|
+
return _pipelab_core_node.runPnpm;
|
|
64595
|
+
}
|
|
64596
|
+
});
|
|
64597
|
+
Object.defineProperty(exports, "runWithLiveLogs", {
|
|
64598
|
+
enumerable: true,
|
|
64599
|
+
get: function() {
|
|
64600
|
+
return _pipelab_core_node.runWithLiveLogs;
|
|
64601
|
+
}
|
|
64602
|
+
});
|
|
64639
64603
|
exports.savedFileMigrator = savedFileMigrator;
|
|
64640
64604
|
Object.defineProperty(exports, "schema", {
|
|
64641
64605
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,73 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Options, Subprocess } from "execa";
|
|
1
|
+
import { ActionRunner, ActionRunnerData, ConditionRunner, DownloadHooks as Hooks, EventRunner, ExpressionRunner, LoopRunner, PipelabContext, Runner, RunnerCallbackFnArgument, downloadFile, fetchPackage, fetchPipelabAsset, fetchPipelabCli, fetchPipelabPlugin, runPnpm, runWithLiveLogs } from "@pipelab/core-node";
|
|
3
2
|
import { z as schema } from "zod";
|
|
4
3
|
|
|
5
4
|
//#region src/pipelab.d.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
id: string;
|
|
9
|
-
log: (...args: Parameters<(typeof console)["log"]>) => void;
|
|
10
|
-
};
|
|
11
|
-
type ActionRunnerData<ACTION extends Action> = {
|
|
5
|
+
declare const createActionRunner: <ACTION extends Action>(runner: (data: ActionRunnerData<ACTION>) => Promise<void>) => (data: ActionRunnerData<ACTION>) => Promise<void>;
|
|
6
|
+
declare const createConditionRunner: <CONDITION extends Condition>(runner: (data: {
|
|
12
7
|
log: typeof console.log;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
meta: ACTION["meta"];
|
|
8
|
+
inputs: ExtractInputsFromCondition<CONDITION>;
|
|
9
|
+
setMeta: (callback: (data: CONDITION["meta"]) => CONDITION["meta"]) => void;
|
|
10
|
+
meta: CONDITION["meta"];
|
|
17
11
|
cwd: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
cache: string;
|
|
21
|
-
pnpm: string;
|
|
22
|
-
node: string;
|
|
23
|
-
userData: string;
|
|
24
|
-
modules: string;
|
|
25
|
-
thirdparty: string;
|
|
26
|
-
};
|
|
27
|
-
api: {
|
|
28
|
-
fetchAsset: (packageName: string, version?: string) => Promise<string>;
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
browserWindow: BrowserWindow;
|
|
32
|
-
abortSignal: AbortSignal;
|
|
33
|
-
};
|
|
34
|
-
type ActionRunner<ACTION extends Action> = (data: ActionRunnerData<ACTION>) => Promise<void>;
|
|
35
|
-
declare const createActionRunner: <ACTION extends Action>(runner: ActionRunner<ACTION>) => ActionRunner<ACTION>;
|
|
36
|
-
type ConditionRunner<CONDITION extends Condition> = (data: {
|
|
12
|
+
context: PipelabContext;
|
|
13
|
+
}) => Promise<boolean>) => (data: {
|
|
37
14
|
log: typeof console.log;
|
|
38
15
|
inputs: ExtractInputsFromCondition<CONDITION>;
|
|
39
16
|
setMeta: (callback: (data: CONDITION["meta"]) => CONDITION["meta"]) => void;
|
|
40
17
|
meta: CONDITION["meta"];
|
|
41
18
|
cwd: string;
|
|
19
|
+
context: PipelabContext;
|
|
42
20
|
}) => Promise<boolean>;
|
|
43
|
-
declare const
|
|
44
|
-
|
|
21
|
+
declare const createLoopRunner: <LOOP extends Loop>(runner: (data: {
|
|
22
|
+
log: typeof console.log;
|
|
23
|
+
setOutput: SetOutputLoopFn<LOOP>;
|
|
24
|
+
inputs: ExtractInputsFromLoop<LOOP>;
|
|
25
|
+
setMeta: (callback: (data: LOOP["meta"]) => LOOP["meta"]) => void;
|
|
26
|
+
meta: LOOP["meta"];
|
|
27
|
+
cwd: string;
|
|
28
|
+
context: PipelabContext;
|
|
29
|
+
}) => Promise<"step" | "exit">) => (data: {
|
|
45
30
|
log: typeof console.log;
|
|
46
31
|
setOutput: SetOutputLoopFn<LOOP>;
|
|
47
32
|
inputs: ExtractInputsFromLoop<LOOP>;
|
|
48
33
|
setMeta: (callback: (data: LOOP["meta"]) => LOOP["meta"]) => void;
|
|
49
34
|
meta: LOOP["meta"];
|
|
50
35
|
cwd: string;
|
|
36
|
+
context: PipelabContext;
|
|
51
37
|
}) => Promise<"step" | "exit">;
|
|
52
|
-
declare const
|
|
53
|
-
|
|
38
|
+
declare const createExpressionRunner: <EXPRESSION extends Expression>(runner: (data: {
|
|
39
|
+
log: typeof console.log;
|
|
40
|
+
setOutput: SetOutputExpressionFn<EXPRESSION>;
|
|
41
|
+
inputs: ExtractInputsFromExpression<EXPRESSION>;
|
|
42
|
+
setMeta: (callback: (data: EXPRESSION["meta"]) => EXPRESSION["meta"]) => void;
|
|
43
|
+
meta: EXPRESSION["meta"];
|
|
44
|
+
cwd: string;
|
|
45
|
+
context: PipelabContext;
|
|
46
|
+
}) => Promise<string>) => (data: {
|
|
54
47
|
log: typeof console.log;
|
|
55
48
|
setOutput: SetOutputExpressionFn<EXPRESSION>;
|
|
56
49
|
inputs: ExtractInputsFromExpression<EXPRESSION>;
|
|
57
50
|
setMeta: (callback: (data: EXPRESSION["meta"]) => EXPRESSION["meta"]) => void;
|
|
58
51
|
meta: EXPRESSION["meta"];
|
|
59
52
|
cwd: string;
|
|
53
|
+
context: PipelabContext;
|
|
60
54
|
}) => Promise<string>;
|
|
61
|
-
declare const
|
|
62
|
-
|
|
55
|
+
declare const createEventRunner: <EVENT extends Event>(runner: (data: {
|
|
56
|
+
log: typeof console.log;
|
|
57
|
+
inputs: ExtractInputsFromEvent<EVENT>;
|
|
58
|
+
setMeta: (callback: (data: EVENT["meta"]) => EVENT["meta"]) => void;
|
|
59
|
+
meta: EVENT["meta"];
|
|
60
|
+
cwd: string;
|
|
61
|
+
context: PipelabContext;
|
|
62
|
+
}) => Promise<void>) => (data: {
|
|
63
63
|
log: typeof console.log;
|
|
64
64
|
inputs: ExtractInputsFromEvent<EVENT>;
|
|
65
65
|
setMeta: (callback: (data: EVENT["meta"]) => EVENT["meta"]) => void;
|
|
66
66
|
meta: EVENT["meta"];
|
|
67
67
|
cwd: string;
|
|
68
|
+
context: PipelabContext;
|
|
68
69
|
}) => Promise<void>;
|
|
69
|
-
declare const createEventRunner: <EVENT extends Event>(runner: EventRunner<EVENT>) => EventRunner<EVENT>;
|
|
70
|
-
type Runner = ActionRunner<any> | LoopRunner<any> | EventRunner<any> | ConditionRunner<any>;
|
|
71
70
|
declare const sleep: (duration: number) => Promise<unknown>;
|
|
72
71
|
//#endregion
|
|
73
72
|
//#region src/create-plugin.d.ts
|
|
@@ -79,39 +78,6 @@ declare const createPlugin: (plugin: Plugin) => Plugin;
|
|
|
79
78
|
//#endregion
|
|
80
79
|
//#region src/utils.d.ts
|
|
81
80
|
declare const fileExists: (path: string) => Promise<boolean>;
|
|
82
|
-
declare const runWithLiveLogs: (command: string, args: string[], execaOptions: Options, log: typeof console.log, hooks?: {
|
|
83
|
-
onStdout?: (data: string, subprocess: Subprocess) => void;
|
|
84
|
-
onStderr?: (data: string, subprocess: Subprocess) => void;
|
|
85
|
-
onExit?: (code: number) => void;
|
|
86
|
-
onCreated?: (subprocess: Subprocess) => void;
|
|
87
|
-
}, abortSignal?: AbortSignal) => Promise<void>;
|
|
88
|
-
interface Hooks {
|
|
89
|
-
onProgress?: (data: {
|
|
90
|
-
progress: number;
|
|
91
|
-
downloadedSize: number;
|
|
92
|
-
}) => void;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Downloads a file from a given URL to a specified local path with progress tracking.
|
|
96
|
-
*
|
|
97
|
-
* @param url - The URL of the file to download.
|
|
98
|
-
* @param localPath - The local file path to save the downloaded file.
|
|
99
|
-
* @returns A promise that resolves when the file is downloaded.
|
|
100
|
-
*/
|
|
101
|
-
declare const downloadFile: (url: string, localPath: string, hooks?: Hooks, abortSignal?: AbortSignal) => Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Installs an NPM package from the npm registry as a tarball if not already present.
|
|
104
|
-
* @param thirdpartyDir The directory where third-party tools are stored.
|
|
105
|
-
* @param name The name of the package (e.g., 'pnpm' or '@poki/cli').
|
|
106
|
-
* @param version The version of the package.
|
|
107
|
-
* @param options (Optional) configuration for dependency installation.
|
|
108
|
-
* @returns A Promise that resolves to the path of the extracted package (the 'package' subfolder).
|
|
109
|
-
*/
|
|
110
|
-
declare const ensureNPMPackage: (thirdpartyDir: string, name: string, version: string, options?: {
|
|
111
|
-
nodePath?: string;
|
|
112
|
-
pnpmPath?: string;
|
|
113
|
-
installDeps?: boolean;
|
|
114
|
-
}) => Promise<string>;
|
|
115
81
|
//#endregion
|
|
116
82
|
//#region src/fs-utils.d.ts
|
|
117
83
|
declare const ensure: (filesPath: string, defaultContent?: string) => Promise<void>;
|
|
@@ -151,5 +117,5 @@ declare const detectRuntime: (appFolder: string | undefined) => Promise<OutputRu
|
|
|
151
117
|
//#region src/index.d.ts
|
|
152
118
|
type NoData = { [index in string]?: unknown };
|
|
153
119
|
//#endregion
|
|
154
|
-
export { ActionRunner, ActionRunnerData, ConditionRunner, EventRunner, ExpressionRunner, ExternalCommandError, Hooks, LoopRunner, NoData, OutputRuntimes, Plugin, Runner, RunnerCallbackFnArgument, createActionRunner, createConditionRunner, createEventRunner, createExpressionRunner, createLoopRunner, createPlugin, detectRuntime, downloadFile, ensure,
|
|
120
|
+
export { type ActionRunner, type ActionRunnerData, type ConditionRunner, type EventRunner, type ExpressionRunner, ExternalCommandError, type Hooks, type LoopRunner, NoData, OutputRuntimes, PipelabContext, Plugin, type Runner, type RunnerCallbackFnArgument, createActionRunner, createConditionRunner, createEventRunner, createExpressionRunner, createLoopRunner, createPlugin, detectRuntime, downloadFile, ensure, extractTarGz, extractZip, fetchPackage, fetchPipelabAsset, fetchPipelabCli, fetchPipelabPlugin, fileExists, generateTempFolder, runPnpm, runWithLiveLogs, schema, sleep, zipFolder };
|
|
155
121
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/pipelab.ts","../src/create-plugin.ts","../src/utils.ts","../src/fs-utils.ts","../src/archive-utils.ts","../src/custom-errors.ts","../src/node-utils.ts","../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/pipelab.ts","../src/create-plugin.ts","../src/utils.ts","../src/fs-utils.ts","../src/archive-utils.ts","../src/custom-errors.ts","../src/node-utils.ts","../src/index.ts"],"mappings":";;;;cA0Ca,kBAAA,kBAAqC,MAAA,EAChD,MAAA,GAAS,IAAA,EAAM,gBAAA,CAAiB,MAAA,MAAY,OAAA,YAAa,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