@hybrid-compute/core 0.0.4 → 0.0.6

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 CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
- "git": false,
3
- "github": false,
2
+ "git": {
3
+ "requireCleanWorkingDir": false,
4
+ "tagName": "@hybrid-compute/core@${version}",
5
+ "commitMessage": "chore: 🤖 ${name}@${version}"
6
+ },
7
+ "github": {
8
+ "release": true,
9
+ "tokenRef": "GH_TOKEN"
10
+ },
4
11
  "npm": {
5
12
  "publish": true,
6
13
  "skipChecks": true
7
14
  },
8
15
  "hooks": {
9
- "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
16
+ "after:release": "echo Successfully released ${name} v${version}."
10
17
  },
11
18
  "plugins": {
12
19
  "@release-it/conventional-changelog": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## [0.0.4](https://github.com/phun-ky/hybrid-compute/compare/0.0.3...0.0.4) (2025-06-01)
3
+ ## 0.0.6 (2025-06-01)
4
4
 
5
5
  ### Tasks
6
6
 
7
7
  * 🤖 Add deps ([0a08767](https://github.com/phun-ky/hybrid-compute/commit/0a08767abed76c91ea902363890bb8f99e44a1da))
8
8
  * 🤖 Adjustments before release ([ee23ac6](https://github.com/phun-ky/hybrid-compute/commit/ee23ac627f7d04c3c2b4fdf9b2dc1f826fa21593))
9
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))
10
11
  * 🤖 Manually set versions in dep ([8c5b4cc](https://github.com/phun-ky/hybrid-compute/commit/8c5b4cc44ea999dd4fa1a69f0268aebc86c16bba))
11
12
  * 🤖 More adjustments ([f9dfee8](https://github.com/phun-ky/hybrid-compute/commit/f9dfee8fb9eb2e1cb104fca9ea24903a69d16f26))
12
13
  * 🤖 New release fail ([ab181d6](https://github.com/phun-ky/hybrid-compute/commit/ab181d6d145c57c87ad1e2ca9d697d8244449134))
@@ -26,8 +27,14 @@
26
27
 
27
28
  ### Bug
28
29
 
30
+ * 🐛 Do not use repo.repository in template string ([65c4311](https://github.com/phun-ky/hybrid-compute/commit/65c4311b62312db753835d19aba96f4f0bd01889))
29
31
  * 🐛 Remove git/github from release pipeline for packages ([587d1b3](https://github.com/phun-ky/hybrid-compute/commit/587d1b39c131493a789b2c574ab28f1d62e40220))
30
- ## [0.0.3](https://github.com/phun-ky/hybrid-compute/compare/0.0.2...0.0.3) (2025-05-28)
32
+ * 🐛 Remove release from root ([5b281b7](https://github.com/phun-ky/hybrid-compute/commit/5b281b70b99823c787cc793b23648ecdd9696708))
33
+ * 🐛 Use correct versions ([afc4cfe](https://github.com/phun-ky/hybrid-compute/commit/afc4cfe98cd1736cbc6f02f9e20b47738c87c0f2))
34
+
35
+ ### Refactoring
36
+
37
+ * 💡 Add a guard to `runTask` for strategy ([e45691a](https://github.com/phun-ky/hybrid-compute/commit/e45691a492b2f1c39f63aa430d4575839302e317))
31
38
 
32
39
  ## [0.0.3](https://github.com/phun-ky/hybrid-compute/compare/0.0.1...0.0.3) (2025-06-01)
33
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybrid-compute/core",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
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) {