@pipelab/cli 2.0.0-beta.0 → 2.0.0-beta.10

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.
@@ -0,0 +1,2 @@
1
+ import { i as applyModuleEvalRuntimeOptions, n as QuickJSWASMModule, r as applyBaseRuntimeOptions, t as QuickJSModuleCallbacks } from "./chunk-JTKJZQYV-CYfgezxc.mjs";
2
+ export { QuickJSModuleCallbacks, QuickJSWASMModule, applyBaseRuntimeOptions, applyModuleEvalRuntimeOptions };
@@ -0,0 +1,105 @@
1
+ import { n as __esmMin } from "./chunk-M2dkpuaD.mjs";
2
+ //#region ../../node_modules/cacache/node_modules/p-map/index.js
3
+ async function pMap(iterable, mapper, { concurrency = Number.POSITIVE_INFINITY, stopOnError = true, signal } = {}) {
4
+ return new Promise((resolve_, reject_) => {
5
+ if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
6
+ if (typeof mapper !== "function") throw new TypeError("Mapper function is required");
7
+ if (!(Number.isSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
8
+ const result = [];
9
+ const errors = [];
10
+ const skippedIndexesMap = /* @__PURE__ */ new Map();
11
+ let isRejected = false;
12
+ let isResolved = false;
13
+ let isIterableDone = false;
14
+ let resolvingCount = 0;
15
+ let currentIndex = 0;
16
+ const iterator = iterable[Symbol.iterator] === void 0 ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
17
+ const signalListener = () => {
18
+ reject(signal.reason);
19
+ };
20
+ const cleanup = () => {
21
+ signal?.removeEventListener("abort", signalListener);
22
+ };
23
+ const resolve = (value) => {
24
+ resolve_(value);
25
+ cleanup();
26
+ };
27
+ const reject = (reason) => {
28
+ isRejected = true;
29
+ isResolved = true;
30
+ reject_(reason);
31
+ cleanup();
32
+ };
33
+ if (signal) {
34
+ if (signal.aborted) reject(signal.reason);
35
+ signal.addEventListener("abort", signalListener, { once: true });
36
+ }
37
+ const next = async () => {
38
+ if (isResolved) return;
39
+ const nextItem = await iterator.next();
40
+ const index = currentIndex;
41
+ currentIndex++;
42
+ if (nextItem.done) {
43
+ isIterableDone = true;
44
+ if (resolvingCount === 0 && !isResolved) {
45
+ if (!stopOnError && errors.length > 0) {
46
+ reject(new AggregateError(errors));
47
+ return;
48
+ }
49
+ isResolved = true;
50
+ if (skippedIndexesMap.size === 0) {
51
+ resolve(result);
52
+ return;
53
+ }
54
+ const pureResult = [];
55
+ for (const [index, value] of result.entries()) {
56
+ if (skippedIndexesMap.get(index) === pMapSkip) continue;
57
+ pureResult.push(value);
58
+ }
59
+ resolve(pureResult);
60
+ }
61
+ return;
62
+ }
63
+ resolvingCount++;
64
+ (async () => {
65
+ try {
66
+ const element = await nextItem.value;
67
+ if (isResolved) return;
68
+ const value = await mapper(element, index);
69
+ if (value === pMapSkip) skippedIndexesMap.set(index, value);
70
+ result[index] = value;
71
+ resolvingCount--;
72
+ await next();
73
+ } catch (error) {
74
+ if (stopOnError) reject(error);
75
+ else {
76
+ errors.push(error);
77
+ resolvingCount--;
78
+ try {
79
+ await next();
80
+ } catch (error) {
81
+ reject(error);
82
+ }
83
+ }
84
+ }
85
+ })();
86
+ };
87
+ (async () => {
88
+ for (let index = 0; index < concurrency; index++) {
89
+ try {
90
+ await next();
91
+ } catch (error) {
92
+ reject(error);
93
+ break;
94
+ }
95
+ if (isIterableDone || isRejected) break;
96
+ }
97
+ })();
98
+ });
99
+ }
100
+ var pMapSkip;
101
+ //#endregion
102
+ __esmMin((() => {
103
+ pMapSkip = Symbol("skip");
104
+ }))();
105
+ export { pMap as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipelab/cli",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.10",
4
4
  "description": "The command line interface for Pipelab",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "author": "CynToolkit",
@@ -0,0 +1,3 @@
1
+ import { g as usePlugins } from "./src-CksaCAal.mjs";
2
+ import "./dist-BC_B45iu.mjs";
3
+ export { usePlugins };