chore: establish YCode replication baseline and TODO
This commit is contained in:
commit
6dc59f89ba
1118 files changed
+196002
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import fs from 'node:fs/promises'
|
||||
import { createHash } from 'node:crypto'
|
||||
import postcss from 'postcss'
|
||||
const file = '.tmp/rea-css-recovered/contexts-BkjwYSZT.css'
|
||||
const text = await fs.readFile(file, 'utf8')
|
||||
if (createHash('sha256').update(text).digest('hex') !== '50cbd673f7f35fc7f966bdddc6c9f5677fdfe944cb904888d214619fca259380') throw new Error('REA sidebar CSS identity changed')
|
||||
function select(node) {
|
||||
if (node.type === 'rule') {
|
||||
const selectors = node.selectors.filter(selector => /\.conversation-list(?:[ >:.#[\]-]|$)|\.conversation-list-(?:header|logo|brand|version|tabs|tab-|content|footer)|\.industry-template-switcher/.test(selector))
|
||||
return selectors.length ? node.clone({ selector: selectors.join(',') }) : null
|
||||
}
|
||||
if (node.type === 'atrule' && node.nodes) { const nodes = node.nodes.map(select).filter(Boolean); return nodes.length ? node.clone({ nodes }) : null }
|
||||
return null
|
||||
}
|
||||
const root = postcss.root({ nodes: postcss.parse(text).nodes.map(select).filter(Boolean) })
|
||||
await fs.writeFile('src/renderer/src/components/sidebar-shell-source.css', `/* Fixed REA CSS ev_377c8790468b3c67dad8577aabb327f98d3140659f0fffdbabfcff5a40cc9e94; contexts SHA 50cbd673f7f35fc7f966bdddc6c9f5677fdfe944cb904888d214619fca259380. */\n${root.toString()}\n`)
|
||||
console.log('Recovered sidebar shell including original media conditions')
|
||||
Reference in new issue
Block a user