Gates that read the poster wall's markup read the lifted PosterSection too: check:packet-variants (its card-deck and packet tapes) and check:poster-fetch-guard (no direct poster fetch)
This commit is contained in:
parent
2cab21c5a9
commit
3056db68a6
2 changed files with 4 additions and 2 deletions
|
|
@ -18,7 +18,9 @@ import { readFileSync } from 'node:fs'
|
|||
|
||||
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const read = (p) => readFileSync(resolve(ROOT, p), 'utf8')
|
||||
const WALL = read('library/components/poster/PosterWall.vue')
|
||||
// The wall's cards are drawn by PosterSection.vue (lifted out of PosterWall.vue, which provides it the shared state),
|
||||
// so the print-row markup this gate reads lives in BOTH files: read them as one wall.
|
||||
const WALL = read('library/components/poster/PosterWall.vue') + '\n' + read('library/components/poster/PosterSection.vue')
|
||||
const PRINTS = read('library/composables/usePosterPrints.js')
|
||||
const EN = JSON.parse(read('library/i18n/locales/en/buttons.json'))
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ check(await fetchPosterSource('x.html', async () => { throw new Error('offline')
|
|||
'a network error on the source is thrown as itself, not reported as "not found"')
|
||||
|
||||
// No caller fetches posters/ directly: every poster fetch goes through the helper.
|
||||
for (const rel of ['library/composables/usePosterPrints.js', 'library/components/poster/PosterWall.vue']) {
|
||||
for (const rel of ['library/composables/usePosterPrints.js', 'library/components/poster/PosterWall.vue', 'library/components/poster/PosterSection.vue', 'library/components/poster/PosterSectionView.vue']) {
|
||||
const src = readFileSync(join(REPO, rel), 'utf8')
|
||||
const direct = src.split('\n').filter((l) => /fetch\([^)]*posters\/[^)]*\.(webp|html)/.test(l) && !l.trim().startsWith('//'))
|
||||
check(direct.length === 0, `${rel} fetches a poster directly instead of through poster-fetch.js: ${direct.map((l) => l.trim()).join(' | ')}`)
|
||||
|
|
|
|||
Loading…
Reference in a new issue