create-vimp-game 0.3.6 → 0.3.7
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/package.json
CHANGED
|
@@ -153,7 +153,17 @@ if (hasNodeCore) {
|
|
|
153
153
|
|
|
154
154
|
const manifest = {
|
|
155
155
|
id: '{{GAME_ID}}',
|
|
156
|
+
// a generation stamp, not a gate: the engine no longer rejects a package
|
|
157
|
+
// whose engineApi is older than its own, so a game does not expire when the
|
|
158
|
+
// engine releases (docs/en/plugin-api.md)
|
|
156
159
|
engineApi: ENGINE_API_VERSION,
|
|
160
|
+
// engine capabilities the game cannot run without — names from
|
|
161
|
+
// `vimp-engine/lib/capabilities.js`, checked by contract rule B2. Empty is
|
|
162
|
+
// the normal state: a game that degrades gracefully (does not ask for the
|
|
163
|
+
// service, does not subscribe to the port) declares nothing. Add a name
|
|
164
|
+
// only when its absence makes the match unplayable — an engine too old to
|
|
165
|
+
// provide it then refuses the game instead of half-running it.
|
|
166
|
+
requires: [],
|
|
157
167
|
version,
|
|
158
168
|
title: '{{GAME_TITLE}}',
|
|
159
169
|
entries: {
|
|
@@ -10,6 +10,8 @@ import { isNodeCore, loadNodeCore, loadWebCore } from '../host/nodeCore.js';
|
|
|
10
10
|
// GameManifest.entries.client.
|
|
11
11
|
export default {
|
|
12
12
|
id: '{{GAME_ID}}',
|
|
13
|
+
// same generation stamp as the host half and the manifest: imported, never
|
|
14
|
+
// a literal, and not something the game ages out of (see src/host/index.js)
|
|
13
15
|
engineApi: ENGINE_API_VERSION,
|
|
14
16
|
|
|
15
17
|
// MUST return { core, memory }: `memory` is the WebAssembly memory the
|
|
@@ -21,7 +21,10 @@ import { isNodeCore, loadNodeCore, loadWebCore } from './nodeCore.js';
|
|
|
21
21
|
export default {
|
|
22
22
|
id: '{{GAME_ID}}',
|
|
23
23
|
// never a literal: a number written by hand agrees with the engine on the
|
|
24
|
-
// day it is typed and silently disagrees after the next release
|
|
24
|
+
// day it is typed and silently disagrees after the next release.
|
|
25
|
+
// It is a generation stamp, not a gate — the engine accepts a package whose
|
|
26
|
+
// engineApi is older than its own, so the game does not expire when the
|
|
27
|
+
// engine releases (docs/en/plugin-api.md)
|
|
25
28
|
engineApi: ENGINE_API_VERSION,
|
|
26
29
|
|
|
27
30
|
// wasmUrl comes from the manifest: init() loads by an explicit URL instead
|
|
@@ -14,9 +14,13 @@ describe('game config', () => {
|
|
|
14
14
|
expect(() => assertGameConfigShape(hostPlugin)).not.toThrow();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// rule B2: the two halves and the manifest must agree with EACH OTHER —
|
|
18
|
+
// a mismatch there is a stale bundle inside one package. Agreement with the
|
|
19
|
+
// installed engine is no longer required of a published game; here it holds
|
|
20
|
+
// because both halves import the value instead of writing a literal
|
|
21
|
+
it('stamps one generation on both halves', () => {
|
|
22
|
+
expect(hostPlugin.engineApi).toBe(clientPlugin.engineApi);
|
|
18
23
|
expect(hostPlugin.engineApi).toBe(ENGINE_API_VERSION);
|
|
19
|
-
expect(clientPlugin.engineApi).toBe(ENGINE_API_VERSION);
|
|
20
24
|
expect(hostPlugin.id).toBe(clientPlugin.id);
|
|
21
25
|
});
|
|
22
26
|
});
|