@hybrid-compute/core 0.0.3 → 0.0.5
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/.release-it.json +2 -5
- package/CHANGELOG.md +36 -0
- package/package.json +4 -1
- package/src/__tests__/core.spec.ts +12 -0
- package/src/index.ts +7 -0
package/.release-it.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"git": false,
|
|
3
|
-
"github":
|
|
4
|
-
"release": true,
|
|
5
|
-
"tokenRef": "GH_TOKEN"
|
|
6
|
-
},
|
|
3
|
+
"github": false,
|
|
7
4
|
"npm": {
|
|
8
5
|
"publish": true,
|
|
9
6
|
"skipChecks": true
|
|
10
7
|
},
|
|
11
8
|
"hooks": {
|
|
12
|
-
"after:release": "echo Successfully released ${name} v${version}
|
|
9
|
+
"after:release": "echo Successfully released ${name} v${version}."
|
|
13
10
|
},
|
|
14
11
|
"plugins": {
|
|
15
12
|
"@release-it/conventional-changelog": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.5](https://github.com/phun-ky/hybrid-compute/compare/0.0.3...0.0.5) (2025-06-01)
|
|
4
|
+
|
|
5
|
+
### Tasks
|
|
6
|
+
|
|
7
|
+
* 🤖 Add deps ([0a08767](https://github.com/phun-ky/hybrid-compute/commit/0a08767abed76c91ea902363890bb8f99e44a1da))
|
|
8
|
+
* 🤖 Adjustments before release ([ee23ac6](https://github.com/phun-ky/hybrid-compute/commit/ee23ac627f7d04c3c2b4fdf9b2dc1f826fa21593))
|
|
9
|
+
* 🤖 Failed build ([7d69f4f](https://github.com/phun-ky/hybrid-compute/commit/7d69f4f093b3e267ef0b6f944e85919d1f83073f))
|
|
10
|
+
* 🤖 Fine tune files to trigger workflow ([8f3cbad](https://github.com/phun-ky/hybrid-compute/commit/8f3cbad6c7106355540cbaa88593909267b9d123))
|
|
11
|
+
* 🤖 Manually set versions in dep ([8c5b4cc](https://github.com/phun-ky/hybrid-compute/commit/8c5b4cc44ea999dd4fa1a69f0268aebc86c16bba))
|
|
12
|
+
* 🤖 More adjustments ([f9dfee8](https://github.com/phun-ky/hybrid-compute/commit/f9dfee8fb9eb2e1cb104fca9ea24903a69d16f26))
|
|
13
|
+
* 🤖 New release fail ([ab181d6](https://github.com/phun-ky/hybrid-compute/commit/ab181d6d145c57c87ad1e2ca9d697d8244449134))
|
|
14
|
+
* 🤖 Preparing for first release, with setup ([13f8f03](https://github.com/phun-ky/hybrid-compute/commit/13f8f03def7941c79b3695d0ba2409c6f9ba0896))
|
|
15
|
+
* 🤖 Reinstall ([d127a02](https://github.com/phun-ky/hybrid-compute/commit/d127a0291a7e1527508b7bf05f6604b786d439a5))
|
|
16
|
+
* 🤖 Remove lerna ([f4ba79e](https://github.com/phun-ky/hybrid-compute/commit/f4ba79ed10bb66271859cdfb905b8e4a8979784e))
|
|
17
|
+
* 🤖 Testing ([72f1de0](https://github.com/phun-ky/hybrid-compute/commit/72f1de05382902108b53a6cf0d6ed7d319ec1ddd))
|
|
18
|
+
* 🤖 Update references, keywords and description + badges ([bc0b1ac](https://github.com/phun-ky/hybrid-compute/commit/bc0b1ac537bc9610ade89fc001132776d096fd55))
|
|
19
|
+
* 🤖 Update workflows ([7f9d6b5](https://github.com/phun-ky/hybrid-compute/commit/7f9d6b55f7180bb0179fc9159d7453395e2ca1af))
|
|
20
|
+
* preparing for release ([d07d107](https://github.com/phun-ky/hybrid-compute/commit/d07d10777a200a755965cef115106430805fe70b))
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
* ✏️ Add documentation ([81e6fa1](https://github.com/phun-ky/hybrid-compute/commit/81e6fa189a3fb974e89c03a846d030118fdedbe4))
|
|
25
|
+
* ✏️ Regenerate documentation ([487d54f](https://github.com/phun-ky/hybrid-compute/commit/487d54ffb40abc03315e04fd2e5c1434fc3e9b27))
|
|
26
|
+
* ✏️ Update documentation ([1039082](https://github.com/phun-ky/hybrid-compute/commit/10390822d4a087a7a26b7a25ce25cb9099dbce94))
|
|
27
|
+
|
|
28
|
+
### Bug
|
|
29
|
+
|
|
30
|
+
* 🐛 Do not use repo.repository in template string ([65c4311](https://github.com/phun-ky/hybrid-compute/commit/65c4311b62312db753835d19aba96f4f0bd01889))
|
|
31
|
+
* 🐛 Remove git/github from release pipeline for packages ([587d1b3](https://github.com/phun-ky/hybrid-compute/commit/587d1b39c131493a789b2c574ab28f1d62e40220))
|
|
32
|
+
* 🐛 Use correct versions ([afc4cfe](https://github.com/phun-ky/hybrid-compute/commit/afc4cfe98cd1736cbc6f02f9e20b47738c87c0f2))
|
|
33
|
+
|
|
34
|
+
### Refactoring
|
|
35
|
+
|
|
36
|
+
* 💡 Add a guard to `runTask` for strategy ([e45691a](https://github.com/phun-ky/hybrid-compute/commit/e45691a492b2f1c39f63aa430d4575839302e317))
|
|
37
|
+
## [0.0.3](https://github.com/phun-ky/hybrid-compute/compare/0.0.2...0.0.3) (2025-05-28)
|
|
38
|
+
|
|
3
39
|
## [0.0.3](https://github.com/phun-ky/hybrid-compute/compare/0.0.1...0.0.3) (2025-06-01)
|
|
4
40
|
|
|
5
41
|
### Tasks
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hybrid-compute/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Core orchestrator for dispatching compute tasks to local, threaded, or remote backends.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compute",
|
|
@@ -47,5 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@phun-ky/typeof": "^1.2.15"
|
|
50
53
|
}
|
|
51
54
|
}
|
|
@@ -3,6 +3,7 @@ import assert from 'node:assert';
|
|
|
3
3
|
import {
|
|
4
4
|
ComputeBackendInterface,
|
|
5
5
|
createHybridCompute,
|
|
6
|
+
ExecutionStrategyType,
|
|
6
7
|
HybridCompute
|
|
7
8
|
} from '..';
|
|
8
9
|
|
|
@@ -48,6 +49,17 @@ describe('HybridCompute', () => {
|
|
|
48
49
|
assert.strictEqual(result, mockOutput);
|
|
49
50
|
});
|
|
50
51
|
|
|
52
|
+
test('runs task with missing strategy, should default to auto', async () => {
|
|
53
|
+
const compute = new HybridCompute({ worker: createMockBackend() });
|
|
54
|
+
|
|
55
|
+
const result = await compute.runTask(
|
|
56
|
+
mockTaskName,
|
|
57
|
+
mockInput,
|
|
58
|
+
2 as unknown as ExecutionStrategyType
|
|
59
|
+
);
|
|
60
|
+
assert.strictEqual(result, mockOutput);
|
|
61
|
+
});
|
|
62
|
+
|
|
51
63
|
test('runs task using remote strategy', async () => {
|
|
52
64
|
const compute = new HybridCompute({ remote: createMockBackend() });
|
|
53
65
|
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
|
|
3
|
+
import { isNotString } from '@phun-ky/typeof';
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
ExecutionStrategyType,
|
|
5
7
|
HybridComputeOptionsInterface
|
|
@@ -65,6 +67,11 @@ export class HybridCompute {
|
|
|
65
67
|
input: Input,
|
|
66
68
|
strategy: ExecutionStrategyType = 'auto'
|
|
67
69
|
): Promise<Output> {
|
|
70
|
+
if (isNotString(strategy)) {
|
|
71
|
+
console.info("Wrong type passed for `strategy`, defaulting to 'auto'");
|
|
72
|
+
strategy = 'auto';
|
|
73
|
+
}
|
|
74
|
+
|
|
68
75
|
if (strategy === 'local' && this.backends.local) {
|
|
69
76
|
return this.backends.local.runTask(taskName, input);
|
|
70
77
|
} else if (strategy === 'worker' && this.backends.worker) {
|