chore: establish YCode replication baseline and TODO

This commit is contained in:
xiaohan.yuan committed 2026-10-17 02:43:49 +08:00
commit 6dc59f89ba
1118 files changed
+196002

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import path from 'node:path'
import crypto from 'node:crypto'
const runtime = path.resolve('.tmp/rea-css-runtime')
const manifest = JSON.parse(await fs.readFile(path.join(runtime, 'css-repair-manifest.json'), 'utf8'))
const sha = bytes => crypto.createHash('sha256').update(bytes).digest('hex')
for (const file of manifest.files) {
assert.equal(sha(await fs.readFile(path.join(runtime, file.path))), file.modified_sha256, `Local repaired module changed: ${file.path}`)
if (file.original_sha256 !== null) {
assert.equal(sha(await fs.readFile(path.join(manifest.sourceRoot, file.path))), file.original_sha256, `Global REA module changed: ${file.path}`)
assert.equal(sha(await fs.readFile(path.join(runtime, 'css-repair-baseline', file.path))), file.original_sha256)
}
}
assert.equal(await fs.realpath(path.join(runtime, 'node_modules')), await fs.realpath(path.join(manifest.sourceRoot, 'node_modules')))
console.log(`REA local repair integrity passed: ${manifest.files.length} module digests; corresponding global files unchanged`)