@antha/engine 0.0.8 → 0.1.0

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.
@@ -1,7 +1,6 @@
1
- import { type AnyObject, type Branded, type MaybePromise, type PartialWithUndefined, type RequiredAndNotNull } from '@augment-vir/common';
1
+ import { type AnyObject, type Branded, type MaybePromise, type PartialWithUndefined, type RequiredAndNotNull, type RequireExactlyOne } from '@augment-vir/common';
2
2
  import { type HtmlInterpolation } from 'element-vir';
3
3
  import { Observable } from 'observavir';
4
- import { type RequireExactlyOne } from 'type-fest';
5
4
  import { type AnthaLogger } from './logger/antha-logger.js';
6
5
  /**
7
6
  * A string type used for mod instances. In reality these are just strings, but this branded type
@@ -174,7 +174,9 @@ export class AnthaEngine {
174
174
  await mod.cleanup?.({
175
175
  engine: this,
176
176
  hostElement: this.getEnsuredHostElement(),
177
- modInstanceId: getOrSetFromMap(this.modInstanceIdMap, mod, () => applyBrand(createId())),
177
+ modInstanceId: getOrSetFromMap(this.modInstanceIdMap, mod, () => {
178
+ return applyBrand(createId());
179
+ }),
178
180
  state: this.state,
179
181
  executeImmediately: mod.executeImmediately || false,
180
182
  frequency: mod.frequency || undefined,
@@ -236,7 +238,9 @@ export class AnthaEngine {
236
238
  }
237
239
  const rawResult = mod.execute({
238
240
  engine: this,
239
- modInstanceId: getOrSetFromMap(this.modInstanceIdMap, mod, () => applyBrand(createId())),
241
+ modInstanceId: getOrSetFromMap(this.modInstanceIdMap, mod, () => {
242
+ return applyBrand(createId());
243
+ }),
240
244
  currentTick: this.currentTick,
241
245
  state: this.state,
242
246
  ticksSinceLastExecute: this.currentTick - (lastExecution?.tick ?? 0),
@@ -292,6 +296,8 @@ export class AnthaEngine {
292
296
  const msSinceLastExecution = performance.now() - (lastExecution?.timeMs || 0);
293
297
  return msSinceLastExecution >= mod.frequency.durationMs;
294
298
  }
295
- return true;
299
+ else {
300
+ return true;
301
+ }
296
302
  }
297
303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/engine",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "description": "The Antha game engine (for the web).",
5
5
  "keywords": [
6
6
  "vir",
@@ -35,27 +35,26 @@
35
35
  "test:update": "npm test update"
36
36
  },
37
37
  "dependencies": {
38
- "@augment-vir/assert": "^31.73.1",
39
- "@augment-vir/common": "^31.73.1",
38
+ "@augment-vir/assert": "^32.2.2",
39
+ "@augment-vir/common": "^32.2.2",
40
40
  "@paralleldrive/cuid2": "^3.3.0",
41
- "date-vir": "^8.5.0",
42
- "observavir": "^2.3.2",
43
- "sentry-vir": "^4.4.0",
44
- "type-fest": "^5.7.0"
41
+ "date-vir": "^9.0.0",
42
+ "observavir": "^2.3.3",
43
+ "sentry-vir": "^4.5.1"
45
44
  },
46
45
  "devDependencies": {
47
- "@augment-vir/test": "^31.73.1",
48
- "@augment-vir/web": "^31.73.1",
49
- "@web/dev-server-esbuild": "^1.0.5",
50
- "@web/test-runner": "^0.20.2",
51
- "@web/test-runner-commands": "^0.9.0",
52
- "@web/test-runner-playwright": "^0.11.1",
53
- "@web/test-runner-visual-regression": "^0.10.0",
46
+ "@augment-vir/test": "^32.2.2",
47
+ "@augment-vir/web": "^32.2.2",
48
+ "@web/dev-server-esbuild": "^2.0.0",
49
+ "@web/test-runner": "^1.0.0",
50
+ "@web/test-runner-commands": "^1.0.1",
51
+ "@web/test-runner-playwright": "^1.0.0",
52
+ "@web/test-runner-visual-regression": "^1.0.1",
54
53
  "istanbul-smart-text-reporter": "^1.1.5",
55
- "markdown-code-example-inserter": "^3.0.5",
56
- "typedoc": "^0.28.19",
54
+ "markdown-code-example-inserter": "^3.0.6",
55
+ "typedoc": "^0.28.20",
57
56
  "typescript": "^6.0.3",
58
- "vite": "^8.0.16"
57
+ "vite": "^8.2.1"
59
58
  },
60
59
  "peerDependencies": {
61
60
  "element-vir": ">=26"