@kubb/core 2.0.0-alpha.9 → 2.0.0-beta.1
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/README.md +1 -1
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -11
- package/dist/index.d.ts +14 -11
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +9 -10
- package/src/FileManager.ts +7 -7
- package/src/PluginManager.ts +6 -22
- package/src/PromiseManager.ts +5 -1
- package/src/types.ts +2 -0
- package/src/utils/executeStrategies.ts +14 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
<h4>
|
|
21
|
-
<a href="https://codesandbox.io/s/github/kubb-project/kubb/tree/
|
|
21
|
+
<a href="https://codesandbox.io/s/github/kubb-project/kubb/tree/alpha/examples/typescript" target="_blank">View Demo</a>
|
|
22
22
|
<span> · </span>
|
|
23
23
|
<a href="https://kubb.dev/" target="_blank">Documentation</a>
|
|
24
24
|
<span> · </span>
|
package/dist/index.cjs
CHANGED
|
@@ -1237,6 +1237,9 @@ function hookFirst(promises, nullCheck = (state) => state !== null) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
return promise;
|
|
1239
1239
|
}
|
|
1240
|
+
function hookParallel(promises) {
|
|
1241
|
+
return Promise.allSettled(promises.filter(Boolean).map((promise) => promise()));
|
|
1242
|
+
}
|
|
1240
1243
|
|
|
1241
1244
|
// src/PromiseManager.ts
|
|
1242
1245
|
var _options2;
|
|
@@ -1253,6 +1256,9 @@ var PromiseManager = class {
|
|
|
1253
1256
|
if (strategy === "first") {
|
|
1254
1257
|
return hookFirst(promises, __privateGet(this, _options2).nullCheck);
|
|
1255
1258
|
}
|
|
1259
|
+
if (strategy === "parallel") {
|
|
1260
|
+
return hookParallel(promises);
|
|
1261
|
+
}
|
|
1256
1262
|
throw new Error(`${strategy} not implemented`);
|
|
1257
1263
|
}
|
|
1258
1264
|
};
|
|
@@ -1457,14 +1463,10 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1457
1463
|
hookName,
|
|
1458
1464
|
parameters
|
|
1459
1465
|
}) {
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
parallelPromises.push(promise);
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
const results = await Promise.allSettled(parallelPromises);
|
|
1466
|
+
const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
1467
|
+
return () => __privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
1468
|
+
});
|
|
1469
|
+
const results = await __privateGet(this, _promiseManager).run("parallel", promises);
|
|
1468
1470
|
results.forEach((result, index) => {
|
|
1469
1471
|
if (isPromiseRejectedResult(result)) {
|
|
1470
1472
|
const plugin = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|