Initial import of LogDarioSeq baseline
Establishes version control for the personal Logseq DB fork before starting the server-client architecture migration and domain features described in docs/agent-guide and the approved implementation plan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
41
scripts/lib/check-ios-web-fonts.mjs
Normal file
41
scripts/lib/check-ios-web-fonts.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
const unsupportedFontFilePattern = /\.(?:woff2|woff)$/
|
||||
const unsupportedCssFontPattern = /\.woff2?["')]|\bformat\(["']woff2?["']\)/
|
||||
|
||||
const walk = (dir) => {
|
||||
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
||||
return entries.flatMap((entry) => {
|
||||
const fullPath = path.join(dir, entry.name)
|
||||
return entry.isDirectory() ? walk(fullPath) : fullPath
|
||||
})
|
||||
}
|
||||
|
||||
const relativePath = (repoRoot, filePath) =>
|
||||
path.relative(repoRoot, filePath).split(path.sep).join('/')
|
||||
|
||||
export const existingAssetRoots = (assetRoots) =>
|
||||
assetRoots.filter((root) => fs.existsSync(root))
|
||||
|
||||
export const findUnsupportedIOSFontAssets = ({ repoRoot, assetRoots }) => {
|
||||
const roots = existingAssetRoots(assetRoots)
|
||||
const files = roots.flatMap(walk)
|
||||
|
||||
return {
|
||||
fontFiles: files
|
||||
.filter((filePath) => unsupportedFontFilePattern.test(filePath))
|
||||
.map((filePath) => relativePath(repoRoot, filePath))
|
||||
.sort(),
|
||||
cssFiles: files
|
||||
.filter((filePath) => filePath.endsWith('.css'))
|
||||
.flatMap((filePath) => {
|
||||
const css = fs.readFileSync(filePath, 'utf8')
|
||||
return unsupportedCssFontPattern.test(css)
|
||||
? [relativePath(repoRoot, filePath)]
|
||||
: []
|
||||
})
|
||||
.sort(),
|
||||
roots,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user