Files
SGF/scripts/sgf-overview-final-http.mjs
2026-11-11 09:00:17 +02:00

3 lines
1.1 KiB
JavaScript

import fs from 'node:fs';import assert from 'node:assert/strict';import crypto from 'node:crypto';
const root=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json')).root+'/private/receipt-composition-cc50a276c10c',state=JSON.parse(fs.readFileSync(root+'/state.json')),manifest=JSON.parse(fs.readFileSync(state.app+'/public/build/manifest.json')),checks=[];for(const key of ['resources/js/app.jsx','resources/js/WorkspaceHome.jsx','resources/js/WorkshopOrderList.jsx']){const file=manifest[key].file,r=await fetch('http://127.0.0.1:8085/build/'+file),bytes=Buffer.from(await r.arrayBuffer());assert.equal(r.status,200);assert.equal(crypto.createHash('sha256').update(bytes).digest('hex'),crypto.createHash('sha256').update(fs.readFileSync(state.app+'/public/build/'+file)).digest('hex'));checks.push('final asset exact checksum '+key);}const file=root+'/overview-final-http-20261110.json';fs.writeFileSync(file,JSON.stringify({passed:true,checks,business_commands:0,browser_visual_review:false},null,2));console.log(JSON.stringify({passed:true,checks:checks.length,proof:file}));