create-vimp-game 0.1.14 → 0.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vimp-game",
3
- "version": "0.1.14",
3
+ "version": "0.2.0",
4
4
  "description": "Scaffolder for VIMP game plugins",
5
5
  "keywords": [
6
6
  "vimp",
@@ -1,4 +1,4 @@
1
1
  {
2
- "engine": "0.15.0",
3
- "core": "0.8.3"
2
+ "engine": "0.16.0",
3
+ "core": "0.8.4"
4
4
  }
@@ -12,6 +12,7 @@ import { rangeToPattern } from './lib/rangeToPattern.js';
12
12
  // asset steps: it hashes what they produced.
13
13
  // Run: node scripts/build-game-manifest.js (build:manifest)
14
14
 
15
+ const packageJsonPath = fileURLToPath(new URL('../package.json', import.meta.url));
15
16
  const distPath = fileURLToPath(new URL('../dist/', import.meta.url));
16
17
  const assetsPath = path.join(distPath, 'assets');
17
18
  const mapsPath = path.join(distPath, 'maps');
@@ -54,6 +55,13 @@ const version = createHash('sha256')
54
55
  .digest('hex')
55
56
  .slice(0, 16);
56
57
 
58
+ // The npm version of this package. `version` above is a bundle hash — useful
59
+ // to the engine, meaningless to a player; this is what the engine shows in
60
+ // the #auth footer.
61
+ const { version: packageVersion } = JSON.parse(
62
+ fs.readFileSync(packageJsonPath, 'utf8'),
63
+ );
64
+
57
65
  const mapNames = fs
58
66
  .readdirSync(mapsPath)
59
67
  .filter(name => name.endsWith('.json'))
@@ -155,6 +163,7 @@ const manifest = {
155
163
  id: '{{GAME_ID}}',
156
164
  engineApi: ENGINE_API_VERSION,
157
165
  version,
166
+ packageVersion,
158
167
  title: '{{GAME_TITLE}}',
159
168
  entries: {
160
169
  client: `/games/{{GAME_ID}}/${clientFile}`,