Skip to content

Commit 437900f

Browse files
committed
feat(engine): add static VERSION/REVISION from package.json; test: add engine version assertion
1 parent 6ba45e7 commit 437900f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/core/engine.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ import { ECS } from './ecs.js';
77
import { EventBus } from './event-bus.js';
88
import { PluginManager } from './plugin-manager.js';
99
import { EVENTS } from './components.js';
10+
// Keep Engine.REVISION aligned with the package version
11+
// Bundlers (Vite/Webpack) and Vitest support JSON imports by default.
12+
import pkg from '../../package.json';
1013

1114
export class Engine {
15+
// Library identity/versioning
16+
static NAME = '@ar-js-org/ar.js-core';
17+
static VERSION = pkg?.version || '0.0.0-dev';
18+
// Back-compat friendly alias (similar to old Context.REVISION)
19+
static REVISION = Engine.VERSION;
20+
1221
constructor() {
1322
this.ecs = new ECS();
1423
this.eventBus = new EventBus();
@@ -172,4 +181,4 @@ export class Engine {
172181
// Clear event listeners
173182
this.eventBus.clear();
174183
}
175-
}
184+
}

0 commit comments

Comments
 (0)