@clunkyard/cli 2.1.0 → 2.1.2

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/README.md CHANGED
@@ -43,8 +43,8 @@ Python, Rust and .NET binding installation needs no Unix shell or GNU Make.
43
43
  JavaScript, TypeScript and the Vane/Cadence/Glyph Node routes use WebAssembly.
44
44
 
45
45
  `@2` receives compatible tooling updates. For an exact tool version, run
46
- `npx --yes @clunkyard/cli@2.1.0` or set
47
- `CLUNKYARD='npx --yes @clunkyard/cli@2.1.0'` with Make. Commit the npm lockfile
46
+ `npx --yes @clunkyard/cli@2.1.2` or set
47
+ `CLUNKYARD='npx --yes @clunkyard/cli@2.1.2'` with Make. Commit the npm lockfile
48
48
  for reproducible JavaScript/TypeScript dependencies. Match replays record the
49
49
  game rules and robot actions; local timings do not qualify hosted budgets.
50
50
 
package/catalogue.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "v": 1,
3
- "release": "v2.0.0-kit.3",
3
+ "release": "v2.0.0-kit.4",
4
4
  "sdkVersion": "2.0.0",
5
- "source": "a0ba86a696e761a3586a2485340b8943e7c498e9",
6
- "generatorSource": "a0ba86a696e761a3586a2485340b8943e7c498e9",
5
+ "source": "0b70a867d3aa9e497cc35c77d3e83f7bc32d8aa8",
6
+ "generatorSource": "331c7d1ed0910cd796ddcb99eca6674e8ef3f198",
7
7
  "engine": {
8
8
  "file": "clunkyard-engine-v2.0.0-kit.3.tar.gz",
9
9
  "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.3/clunkyard-engine-v2.0.0-kit.3.tar.gz",
@@ -2764,7 +2764,7 @@
2764
2764
  }
2765
2765
  },
2766
2766
  "cadence": {
2767
- "version": "v2.0.0-kit.2",
2767
+ "version": "v2.0.0-kit.4",
2768
2768
  "sdkVersion": "2.0.0",
2769
2769
  "language": "cadence",
2770
2770
  "portable": true,
@@ -2788,10 +2788,10 @@
2788
2788
  ],
2789
2789
  "requirements": {},
2790
2790
  "starter": {
2791
- "file": "starter-cadence-v2.0.0-kit.2.tar.gz",
2792
- "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.2/starter-cadence-v2.0.0-kit.2.tar.gz",
2793
- "bytes": 11879,
2794
- "sha256": "04caaa7a2f9708cb72a10c346020cb67c7b9e36e693665d8747330f497e41639",
2791
+ "file": "starter-cadence-v2.0.0-kit.4.tar.gz",
2792
+ "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.4/starter-cadence-v2.0.0-kit.4.tar.gz",
2793
+ "bytes": 5008,
2794
+ "sha256": "05f57fc5fd7dc44e195a75f9ef543caa1c0ade0cde1ae534361d690a13b61d6b",
2795
2795
  "expandedBytes": 1048576
2796
2796
  },
2797
2797
  "boilerplate": {
@@ -2801,7 +2801,10 @@
2801
2801
  "clunkyard-template.json": "20574b7c0257af409190a7285ef25d6392e3e2fdec5f19b98fdb6d6246baa12a",
2802
2802
  "Makefile": "e592144ef3560c9efc206b275b54e0eacfa048e447c5f5188eb587db3e3e3e5e",
2803
2803
  "package.json": "22787cf021d078334fe4b55eeaa67cb5c6fe7f09e9929c6fddbe2d4b7e9697e2",
2804
- "README.md": "4f0c4faa83288a221c4ae844c89940a49dbafbdd149a0dbbfc84b758d9158be2",
2804
+ "README.md": [
2805
+ "4f0c4faa83288a221c4ae844c89940a49dbafbdd149a0dbbfc84b758d9158be2",
2806
+ "28d93ffc6c52a67eacf9401d38173712be1377b87a779856c834b76e6123ffeb"
2807
+ ],
2805
2808
  ".gitignore": "217e0fb356990d296c3d031f78f013157da8897b2b19f8545e66ca9da4acb207",
2806
2809
  "Dockerfile": "326fc3aedb21c5e9b3578a3e56d02bba40fe02f0368aaaef0f2f2e6d60a4b01f",
2807
2810
  ".dockerignore": "42bec36c9d4ba42ddbeb8c715b6c0ce0cc5dd9711ef7fb8ed034f78d944da57c"
@@ -2874,9 +2877,25 @@
2874
2877
  "tools": [
2875
2878
  "node",
2876
2879
  "make",
2877
- "clang"
2880
+ "clang",
2881
+ "wasm-ld"
2878
2882
  ],
2879
- "requirements": {},
2883
+ "requirements": {
2884
+ "checks": [
2885
+ {
2886
+ "label": "Clang wasm32 backend",
2887
+ "command": "clang",
2888
+ "args": [
2889
+ "--print-targets"
2890
+ ],
2891
+ "hint": "Install Clang with the wasm32 backend and wasm-ld (clang and lld on Ubuntu).",
2892
+ "outputPattern": "\\bwasm32\\b"
2893
+ }
2894
+ ],
2895
+ "notes": [
2896
+ "Install Clang with the wasm32 backend and wasm-ld (the clang and lld packages on Ubuntu). No WASI sysroot is needed."
2897
+ ]
2898
+ },
2880
2899
  "starter": {
2881
2900
  "file": "starter-vane-wasm-v2.0.0-kit.2.tar.gz",
2882
2901
  "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.2/starter-vane-wasm-v2.0.0-kit.2.tar.gz",
@@ -2896,7 +2915,7 @@
2896
2915
  }
2897
2916
  },
2898
2917
  "cadence-wasm": {
2899
- "version": "v2.0.0-kit.2",
2918
+ "version": "v2.0.0-kit.4",
2900
2919
  "sdkVersion": "2.0.0",
2901
2920
  "language": "cadence-wasm",
2902
2921
  "portable": false,
@@ -2918,14 +2937,30 @@
2918
2937
  "tools": [
2919
2938
  "node",
2920
2939
  "make",
2921
- "clang"
2940
+ "clang",
2941
+ "wasm-ld"
2922
2942
  ],
2923
- "requirements": {},
2943
+ "requirements": {
2944
+ "checks": [
2945
+ {
2946
+ "label": "Clang wasm32 backend",
2947
+ "command": "clang",
2948
+ "args": [
2949
+ "--print-targets"
2950
+ ],
2951
+ "hint": "Install Clang with the wasm32 backend and wasm-ld (clang and lld on Ubuntu).",
2952
+ "outputPattern": "\\bwasm32\\b"
2953
+ }
2954
+ ],
2955
+ "notes": [
2956
+ "Install Clang with the wasm32 backend and wasm-ld (the clang and lld packages on Ubuntu). No WASI sysroot is needed."
2957
+ ]
2958
+ },
2924
2959
  "starter": {
2925
- "file": "starter-cadence-wasm-v2.0.0-kit.2.tar.gz",
2926
- "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.2/starter-cadence-wasm-v2.0.0-kit.2.tar.gz",
2927
- "bytes": 11352,
2928
- "sha256": "277fa15404cc496fbeed10a7bd2c7645652b0b0e3a5e8bf5dd0423460ef22c0c",
2960
+ "file": "starter-cadence-wasm-v2.0.0-kit.4.tar.gz",
2961
+ "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.4/starter-cadence-wasm-v2.0.0-kit.4.tar.gz",
2962
+ "bytes": 5075,
2963
+ "sha256": "d29837c2814f8c4704425e993aedc88d20d6569adb6f4c5837c6758cd16119e7",
2929
2964
  "expandedBytes": 1048576
2930
2965
  },
2931
2966
  "boilerplate": {
@@ -2935,7 +2970,10 @@
2935
2970
  "clunkyard-template.json": "57534aa1c8e39312569ab7c771fbe1d557b632545ccff0de0744bc3ea72ca61b",
2936
2971
  "Makefile": "e592144ef3560c9efc206b275b54e0eacfa048e447c5f5188eb587db3e3e3e5e",
2937
2972
  "package.json": "729e27022cdcd2bcaaab508e20d4df8e74cea64e0efbe92077786a4bdda11d40",
2938
- "README.md": "3daa50f3c62cfdb8fc8e5179f007c7887fbfab456074d359ce2d3e67ce22ebc2",
2973
+ "README.md": [
2974
+ "3daa50f3c62cfdb8fc8e5179f007c7887fbfab456074d359ce2d3e67ce22ebc2",
2975
+ "1b11eca38ddff77a6c4b044eee5e641f256bf36a65c5ceda771858bd02b73761"
2976
+ ],
2939
2977
  ".gitignore": "217e0fb356990d296c3d031f78f013157da8897b2b19f8545e66ca9da4acb207"
2940
2978
  }
2941
2979
  },
@@ -2962,9 +3000,25 @@
2962
3000
  "tools": [
2963
3001
  "node",
2964
3002
  "make",
2965
- "clang"
3003
+ "clang",
3004
+ "wasm-ld"
2966
3005
  ],
2967
- "requirements": {},
3006
+ "requirements": {
3007
+ "checks": [
3008
+ {
3009
+ "label": "Clang wasm32 backend",
3010
+ "command": "clang",
3011
+ "args": [
3012
+ "--print-targets"
3013
+ ],
3014
+ "hint": "Install Clang with the wasm32 backend and wasm-ld (clang and lld on Ubuntu).",
3015
+ "outputPattern": "\\bwasm32\\b"
3016
+ }
3017
+ ],
3018
+ "notes": [
3019
+ "Install Clang with the wasm32 backend and wasm-ld (the clang and lld packages on Ubuntu). No WASI sysroot is needed."
3020
+ ]
3021
+ },
2968
3022
  "starter": {
2969
3023
  "file": "starter-glyph-wasm-v2.0.0-kit.2.tar.gz",
2970
3024
  "url": "https://github.com/clunkyard/game-kit/releases/download/v2.0.0-kit.2/starter-glyph-wasm-v2.0.0-kit.2.tar.gz",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clunkyard/cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Shared local builds, matches and replays for Clunkyard robots",
5
5
  "license": "MIT",
6
6
  "engines": {
package/project.cjs CHANGED
@@ -6,7 +6,16 @@ const catalogue=require('./catalogue.json');
6
6
  const json=value=>JSON.stringify(value,null,2)+'\n';
7
7
  const hash=data=>crypto.createHash('sha256').update(data).digest('hex');
8
8
  const normalized=data=>data.toString('utf8').replace(/\r\n/g,'\n');
9
- const known=(data,expected)=>Boolean(expected)&&(hash(data)===expected||hash(normalized(data))===expected);
9
+ function managedHashes(expected) {
10
+ if(expected===undefined)return [];
11
+ const hashes=Array.isArray(expected)?expected:[expected];
12
+ if(!hashes.length||hashes.length>2||hashes.some(value=>typeof value!=='string'||!(/^[a-f0-9]{64}$/).test(value)))throw new Error('Invalid managed-file checksum catalogue.');
13
+ return hashes;
14
+ }
15
+ function known(data,expected) {
16
+ const hashes=managedHashes(expected);
17
+ return hashes.includes(hash(data))||hashes.includes(hash(normalized(data)));
18
+ }
10
19
  const nodeLanguage=language=>['javascript','typescript'].includes(language);
11
20
 
12
21
  function readManifest(directory) {
@@ -71,7 +80,7 @@ npx --yes @clunkyard/cli@2 match 77 3d zero-g
71
80
 
72
81
  Keep a baseline commit. Repeat several seeds and rulesets; compare contacts, battery, aim, shots, hits and eliminations in the replay. Local trials run programs as your user. Use hosted trials to measure arena budgets before a tournament.
73
82
 
74
- The CLI packages SDK ${catalogue.sdkVersion}/protocol 2 asset identities from the immutable [${catalogue.release} release](https://github.com/clunkyard/game-kit/releases/tag/${catalogue.release}). \`@2\` receives compatible tooling fixes without copying scripts into your robot repository. To reproduce an exact tool version, use \`npx --yes @clunkyard/cli@2.1.0\` or set \`CLUNKYARD='npx --yes @clunkyard/cli@2.1.0'\` with Make. SDK/engine caches are identified by their content hashes and remain reusable across CLI updates.
83
+ The CLI packages SDK ${catalogue.sdkVersion}/protocol 2 asset identities from the immutable [${catalogue.release} release](https://github.com/clunkyard/game-kit/releases/tag/${catalogue.release}). \`@2\` receives compatible tooling fixes without copying scripts into your robot repository. To reproduce an exact tool version, use \`npx --yes @clunkyard/cli@2.1.2\` or set \`CLUNKYARD='npx --yes @clunkyard/cli@2.1.2'\` with Make. SDK/engine caches are identified by their content hashes and remain reusable across CLI updates.
75
84
 
76
85
  ## Play online
77
86
 
@@ -85,6 +94,7 @@ You can also create your own GitHub repository from this template, connect it in
85
94
 
86
95
  function migrate(directory) {
87
96
  const root=path.resolve(directory),manifest=readManifest(root),row=catalogue.languages[manifest.language];
97
+ for(const expected of Object.values(row.boilerplate))managedHashes(expected);
88
98
  const files={'Makefile':makefile(),...(nodeLanguage(manifest.language)?nodeMetadata(manifest.language):{})};
89
99
  const retired=['clunkyard.cjs','clunkyard-archive.cjs','clunkyard.lock.json','clunkyard-template.json'];
90
100
  const remove=[...retired,...(!nodeLanguage(manifest.language)?['package.json']:[])];
@@ -108,7 +118,7 @@ function migrate(directory) {
108
118
  }
109
119
  const guide=path.join(root,'README.md'),oldGuide=fs.existsSync(guide)?fs.readFileSync(guide,'utf8'):null;
110
120
  const generated=readme(manifest.language,manifest.entry);
111
- if(oldGuide===null||known(oldGuide,row.boilerplate['README.md']))fs.writeFileSync(guide,generated);
121
+ if(oldGuide===null||oldGuide===generated||known(oldGuide,row.boilerplate['README.md']))fs.writeFileSync(guide,generated);
112
122
  else if(!oldGuide.includes('## Clunkyard CLI'))fs.appendFileSync(guide,'\n## Clunkyard CLI\n\nShared tooling is available through `npx --yes @clunkyard/cli@2 doctor`, `build`, `match` and `replay`. See [the local development guide](https://clunkyard.com/sdk/player-kit) for npm installation and private Git. SDK/engine asset identities are pinned in the CLI package.\n');
113
123
  const ignore=path.join(root,'.gitignore'),ignored=fs.existsSync(ignore)?fs.readFileSync(ignore,'utf8'):'';
114
124
  const additions=['.clunkyard/','replays/','build/','node_modules/'].filter(line=>!ignored.split(/\r?\n/).includes(line));
package/runtime.cjs CHANGED
@@ -71,7 +71,7 @@ function run(command, args, options={}) {
71
71
  }
72
72
  function environment() {
73
73
  const paths=[path.join(sdk,'lib'),process.env.LD_LIBRARY_PATH].filter(Boolean).join(path.delimiter);
74
- return {...process.env,CLUNKYARD_SDK:sdk,CLUNKYARD_PROJECT:root,CLUNKYARD_LIB:path.join(sdk,'lib',library),LD_LIBRARY_PATH:paths,
74
+ return {...process.env,CLUNKYARD_SDK:sdk,CLUNKYARD_PROJECT:root,CLUNKYARD_WASM_INCLUDE:path.join(engine,'sdk','wasm','abi4'),CLUNKYARD_LIB:path.join(sdk,'lib',library),LD_LIBRARY_PATH:paths,
75
75
  ...(process.platform==='darwin'?{DYLD_LIBRARY_PATH:[path.join(sdk,'lib'),process.env.DYLD_LIBRARY_PATH].filter(Boolean).join(path.delimiter)}:{}),
76
76
  ...(process.platform==='win32'?{PATH:[path.join(sdk,'lib'),process.env.PATH].filter(Boolean).join(path.delimiter),CC:cCompiler(false),CXX:cCompiler(true)}:{}),
77
77
  TMPDIR:path.join(cache,'tmp'),NODE_PATH:npmSDK?path.join(root,'node_modules'):path.join(sdk,'bindings','javascript'),
@@ -249,7 +249,7 @@ function doctor(){
249
249
  const result=spawnSync(command[0],[...command.slice(1),...check.args],{encoding:'utf8',env:environment(),timeout:10000});
250
250
  const output=String(result.stdout||'')+String(result.stderr||'');
251
251
  const version=check.versionPattern?Number(output.match(new RegExp(check.versionPattern))?.[1]):null;
252
- const ok=!result.error&&result.status===0&&(!check.minimum||version>=check.minimum);
252
+ const ok=!result.error&&result.status===0&&(!check.minimum||version>=check.minimum)&&(!check.outputPattern||new RegExp(check.outputPattern).test(output));
253
253
  console.log(`${ok?'ok':'missing'} ${check.label}${ok?'':': '+check.hint}`);if(!ok)missing++;
254
254
  }
255
255
  if(lock.language==='clojure'){try{console.log('ok Clojure runtime: '+clojureClasspath())}catch(error){console.log('missing '+error.message);missing++}}