diff --git a/internal/build-packet-fixtures.mjs b/internal/build-packet-fixtures.mjs new file mode 100644 index 000000000..2bdbc150d --- /dev/null +++ b/internal/build-packet-fixtures.mjs @@ -0,0 +1,82 @@ +#!/usr/bin/env node +/** + * build-packet-fixtures — build every committed packet fixture, so check:packets-all has more + * than one SHAPE to evaluate. + * + * THE GAP THIS CLOSES. check:packets-all reported "every generated packet renders, in every locale + * present" and passed on 11 packets — all of them the SAME ZONE (laos) in 11 locales, against 28 + * poster zones. The suite proved one zone's layout eleven times. Generating all 28 x 11 is a + * network fetch per zone and ~100MB of artefacts, so the answer is not more zones: it is more + * SHAPES, chosen where the layout can actually break, built from committed records with no network. + * + * ★ THE SHAPES ARE THE PAGE BOUNDARY. packet-render.js:76 sets PER_PAGE = 20, and pagination is + * `for (start = 0; start < groups.length; start += PER_PAGE)`. laos has 95 groups and tibet 43 — + * both mid-range, both remainder cases, so the boundary itself had NEVER been rendered: + * - exactly 20 : one full page. An off-by-one here yields 2 list pages, the second empty. + * - 21 : two pages, the second holding a SINGLE card. + * - 1 : the minimum a zone can have. + * Each is derived by slicing the committed tibet fixture, so they are byte-deterministic and need + * no API. + * + * ⚠ EACH BUILD OVERWRITES THE PREVIOUS ONE, which is the reason this script exists rather than a + * line of shell. packet.mjs names its output for the ZONE, not the fixture, so four fixture builds + * against one zone leave one file — and check:packets-all would go on seeing a single shape while + * reporting success. Each output is renamed to its fixture's own name so all of them coexist and + * every one gets evaluated. + * + * Usage: node internal/build-packet-fixtures.mjs + */ +import { existsSync, renameSync, readdirSync } from 'node:fs' +import { resolve, dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import { spawnSync } from 'node:child_process' + +const HERE = dirname(fileURLToPath(import.meta.url)) +const REPO = process.env.DOXA_REPO || resolve(HERE, '..') +const FIXTURES = resolve(REPO, 'library/scripts/posters/fixtures') +const OUT = resolve(REPO, 'library/scripts/posters/out/packets') +// Every fixture is built against this zone: the records come from the fixture, and the zone only +// supplies page 1's map. Keeping it constant means a shape difference is the ONLY variable. +const ZONE = 'asia-china-tibet-autonomous-region' + +if (!existsSync(FIXTURES)) { + console.log(`PACKET-FIXTURES: SKIP — no fixtures directory at ${FIXTURES}`) + process.exit(0) +} + +const fixtures = readdirSync(FIXTURES).filter((f) => /^records-.*\.json$/.test(f)).sort() +if (!fixtures.length) { + console.log('PACKET-FIXTURES: SKIP — no records-*.json fixtures committed') + process.exit(0) +} + +console.log(`PACKET-FIXTURES: building ${fixtures.length} fixture(s)`) +const built = [] +const failed = [] + +for (const fx of fixtures) { + const name = fx.replace(/^records-/, '').replace(/\.json$/, '') + const res = spawnSync(process.execPath, [join(REPO, 'library/scripts/posters/packet.mjs')], { + cwd: REPO, + encoding: 'utf8', + env: { ...process.env, PACKET_RECORDS: join(FIXTURES, fx), ONLY: ZONE }, + }) + const produced = join(OUT, `${ZONE}.html`) + if (res.status !== 0 || !existsSync(produced)) { + failed.push(`${fx}: ${(res.stderr || res.stdout || '').trim().split('\n').slice(-1)[0] || 'no output'}`) + console.log(` ✗ ${fx}`) + continue + } + // Rename BEFORE the next build, or the next one overwrites it — see the warning above. + const dest = join(OUT, `fixture-${name}.html`) + renameSync(produced, dest) + built.push(`fixture-${name}.html`) + console.log(` ✓ ${fx} -> fixture-${name}.html`) +} + +if (failed.length) { + console.error(`\nPACKET-FIXTURES: FAIL — ${failed.length} fixture(s) did not build`) + for (const f of failed) console.error(' - ' + f) + process.exit(1) +} +console.log(`\nPACKET-FIXTURES: ${built.length} packet(s) built. Run check:packets-all to evaluate them.`) diff --git a/library/scripts/posters/fixtures/records-edge-21-groups.json b/library/scripts/posters/fixtures/records-edge-21-groups.json new file mode 100644 index 000000000..2debc1bf0 --- /dev/null +++ b/library/scripts/posters/fixtures/records-edge-21-groups.json @@ -0,0 +1,578 @@ +[ + { + "slug": "adi", + "name": "Adi", + "country_code": "CHN", + "population": "1400", + "religion": "E", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://flickr.com/photos/ramesh_lalwani/8169468855/", + "text": "Ramesh Lalwani - Flickr" + } + ], + "latitude": "29.24961200", + "longitude": "95.17182400", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion" + }, + { + "slug": "ainu-china", + "name": "Ainu", + "country_code": "CHN", + "population": "11000", + "religion": "MSN", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "38.93020500", + "longitude": "76.16959600", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Sunni" + }, + { + "slug": "alxa-mongols", + "name": "Alxa Mongols", + "country_code": "CHN", + "population": "35500", + "religion": "MSN", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "39.20798700", + "longitude": "101.67522000", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Sunni" + }, + { + "slug": "bogar-lhoba", + "name": "Bogar Lhoba", + "country_code": "CHN", + "population": "5300", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By bojum" + } + ], + "latitude": "28.74470000", + "longitude": "93.64580000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "bogol", + "name": "Bogol", + "country_code": "CHN", + "population": "1400", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "48.46892600", + "longitude": "124.48821300", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "boyu-tibetans", + "name": "Boyu Tibetans", + "country_code": "CHN", + "population": "5400", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "33.36236100", + "longitude": "104.58044400", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "bunan", + "name": "Bunan", + "country_code": "CHN", + "population": "2500", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "31.79607000", + "longitude": "78.90344000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "buryat", + "name": "Buryat", + "country_code": "CHN", + "population": "170000", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://commons.wikimedia.org/wiki/File:Me_and_a_Buryat.jpg", + "text": "Telaneo - Wikimedia" + } + ], + "latitude": "48.75926000", + "longitude": "117.78630000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "butuo-nosu", + "name": "Butuo Nosu", + "country_code": "CHN", + "population": "337000", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By Anonymous" + } + ], + "latitude": "27.60452900", + "longitude": "102.87518600", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "cona-monba", + "name": "Cona Monba", + "country_code": "CHN", + "population": "58500", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of Joshua Project by Anonymous" + } + ], + "latitude": "27.89404900", + "longitude": "92.20691400", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "darang-deng", + "name": "Darang Deng", + "country_code": "CHN", + "population": "12500", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "28.37980000", + "longitude": "97.02930000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "enger-yugur", + "name": "Enger Yugur", + "country_code": "CHN", + "population": "5500", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://flickr.com/photos/mke1963/154213183/", + "text": "Mark mke1963 - Flickr" + } + ], + "latitude": "37.98815000", + "longitude": "101.76214000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "ersu", + "name": "Ersu", + "country_code": "CHN", + "population": "48000", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "29.23558500", + "longitude": "102.35591600", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "geman-deng", + "name": "Geman Deng", + "country_code": "CHN", + "population": "16500", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "28.47324000", + "longitude": "97.04437000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "heishui", + "name": "Heishui", + "country_code": "CHN", + "population": "48500", + "religion": "BLA", + "has_photo": false, + "picture_credit": null, + "latitude": "32.19164300", + "longitude": "103.03860100", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "henan-mongols", + "name": "Henan Mongols", + "country_code": "CHN", + "population": "43000", + "religion": "BLA", + "has_photo": false, + "picture_credit": null, + "latitude": "34.73230000", + "longitude": "101.60860000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "keji", + "name": "Keji", + "country_code": "CHN", + "population": "2600", + "religion": "MSN", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.paulnoll.com/China/Minorities/China-Nationalities.html", + "text": "Paul Noll" + } + ], + "latitude": "29.65355100", + "longitude": "91.12095900", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Sunni" + }, + { + "slug": "kyrgyz", + "name": "Kyrgyz", + "country_code": "CHN", + "population": "195000", + "religion": "MOF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://commons.wikimedia.org/wiki/File:Kyrgyz_women_offering_butter_and_salt.jpg", + "text": "Theklan - Wikimedia" + } + ], + "latitude": "38.01774000", + "longitude": "76.09630000", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Folk" + }, + { + "slug": "luzu", + "name": "Luzu", + "country_code": "CHN", + "population": "1600", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "28.33754000", + "longitude": "101.35823900", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "manyak", + "name": "Manyak", + "country_code": "CHN", + "population": "3000", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "29.67090000", + "longitude": "101.59510000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "medog-monba", + "name": "Medog Monba", + "country_code": "CHN", + "population": "11000", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "29.46300000", + "longitude": "95.74060000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + } +] diff --git a/library/scripts/posters/fixtures/records-edge-exactly-20.json b/library/scripts/posters/fixtures/records-edge-exactly-20.json new file mode 100644 index 000000000..cf2c4fcac --- /dev/null +++ b/library/scripts/posters/fixtures/records-edge-exactly-20.json @@ -0,0 +1,548 @@ +[ + { + "slug": "adi", + "name": "Adi", + "country_code": "CHN", + "population": "1400", + "religion": "E", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://flickr.com/photos/ramesh_lalwani/8169468855/", + "text": "Ramesh Lalwani - Flickr" + } + ], + "latitude": "29.24961200", + "longitude": "95.17182400", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion" + }, + { + "slug": "ainu-china", + "name": "Ainu", + "country_code": "CHN", + "population": "11000", + "religion": "MSN", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "38.93020500", + "longitude": "76.16959600", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Sunni" + }, + { + "slug": "alxa-mongols", + "name": "Alxa Mongols", + "country_code": "CHN", + "population": "35500", + "religion": "MSN", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "39.20798700", + "longitude": "101.67522000", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Sunni" + }, + { + "slug": "bogar-lhoba", + "name": "Bogar Lhoba", + "country_code": "CHN", + "population": "5300", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By bojum" + } + ], + "latitude": "28.74470000", + "longitude": "93.64580000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "bogol", + "name": "Bogol", + "country_code": "CHN", + "population": "1400", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "48.46892600", + "longitude": "124.48821300", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "boyu-tibetans", + "name": "Boyu Tibetans", + "country_code": "CHN", + "population": "5400", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "33.36236100", + "longitude": "104.58044400", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "bunan", + "name": "Bunan", + "country_code": "CHN", + "population": "2500", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "31.79607000", + "longitude": "78.90344000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "buryat", + "name": "Buryat", + "country_code": "CHN", + "population": "170000", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://commons.wikimedia.org/wiki/File:Me_and_a_Buryat.jpg", + "text": "Telaneo - Wikimedia" + } + ], + "latitude": "48.75926000", + "longitude": "117.78630000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "butuo-nosu", + "name": "Butuo Nosu", + "country_code": "CHN", + "population": "337000", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By Anonymous" + } + ], + "latitude": "27.60452900", + "longitude": "102.87518600", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "cona-monba", + "name": "Cona Monba", + "country_code": "CHN", + "population": "58500", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of Joshua Project by Anonymous" + } + ], + "latitude": "27.89404900", + "longitude": "92.20691400", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "darang-deng", + "name": "Darang Deng", + "country_code": "CHN", + "population": "12500", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "28.37980000", + "longitude": "97.02930000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "enger-yugur", + "name": "Enger Yugur", + "country_code": "CHN", + "population": "5500", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://flickr.com/photos/mke1963/154213183/", + "text": "Mark mke1963 - Flickr" + } + ], + "latitude": "37.98815000", + "longitude": "101.76214000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "ersu", + "name": "Ersu", + "country_code": "CHN", + "population": "48000", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "29.23558500", + "longitude": "102.35591600", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "geman-deng", + "name": "Geman Deng", + "country_code": "CHN", + "population": "16500", + "religion": "ECF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "28.47324000", + "longitude": "97.04437000", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion - Chinese Folk Religion" + }, + { + "slug": "heishui", + "name": "Heishui", + "country_code": "CHN", + "population": "48500", + "religion": "BLA", + "has_photo": false, + "picture_credit": null, + "latitude": "32.19164300", + "longitude": "103.03860100", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "henan-mongols", + "name": "Henan Mongols", + "country_code": "CHN", + "population": "43000", + "religion": "BLA", + "has_photo": false, + "picture_credit": null, + "latitude": "34.73230000", + "longitude": "101.60860000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "keji", + "name": "Keji", + "country_code": "CHN", + "population": "2600", + "religion": "MSN", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.paulnoll.com/China/Minorities/China-Nationalities.html", + "text": "Paul Noll" + } + ], + "latitude": "29.65355100", + "longitude": "91.12095900", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Sunni" + }, + { + "slug": "kyrgyz", + "name": "Kyrgyz", + "country_code": "CHN", + "population": "195000", + "religion": "MOF", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://commons.wikimedia.org/wiki/File:Kyrgyz_women_offering_butter_and_salt.jpg", + "text": "Theklan - Wikimedia" + } + ], + "latitude": "38.01774000", + "longitude": "76.09630000", + "country_code_label": "People's Republic of China", + "religion_label": "Islam - Folk" + }, + { + "slug": "luzu", + "name": "Luzu", + "country_code": "CHN", + "population": "1600", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "28.33754000", + "longitude": "101.35823900", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + }, + { + "slug": "manyak", + "name": "Manyak", + "country_code": "CHN", + "population": "3000", + "religion": "BLA", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://www.asiaharvest.org", + "text": "Operation China, Asia Harvest" + } + ], + "latitude": "29.67090000", + "longitude": "101.59510000", + "country_code_label": "People's Republic of China", + "religion_label": "Buddhism - Tibetan" + } +] diff --git a/library/scripts/posters/fixtures/records-edge-one-group.json b/library/scripts/posters/fixtures/records-edge-one-group.json new file mode 100644 index 000000000..88bb0259a --- /dev/null +++ b/library/scripts/posters/fixtures/records-edge-one-group.json @@ -0,0 +1,32 @@ +[ + { + "slug": "adi", + "name": "Adi", + "country_code": "CHN", + "population": "1400", + "religion": "E", + "has_photo": false, + "picture_credit": [ + { + "link": null, + "text": "Photo courtesy of " + }, + { + "link": "https://www.joshuaproject.net", + "text": "Joshua Project" + }, + { + "link": null, + "text": ". By " + }, + { + "link": "https://flickr.com/photos/ramesh_lalwani/8169468855/", + "text": "Ramesh Lalwani - Flickr" + } + ], + "latitude": "29.24961200", + "longitude": "95.17182400", + "country_code_label": "People's Republic of China", + "religion_label": "Ethnoreligion" + } +] diff --git a/package.json b/package.json index 93061e749..343a0bf74 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "packets": "cd library/scripts/posters && VITE_API_BASE_URL=https://pray.doxa.life node packet.mjs # the prayer packets. READS out/posters/.html for page 1's map, which `bun run posters` writes — without it the packet still builds and page 1 is simply BLANK, so the script now warns per-zone AND in its summary. PACKET_LANG= for one language, ONLY= for one zone, NOPHOTOS=1 to skip the photo fetch.", "packet-fixture": "node internal/generate-packet-fixture.mjs # regenerate the committed records subset (smallest zone, image_url stripped) that lets CI build a packet at all — out/ is gitignored, so a clean checkout has neither the records cache nor any packet.", "check:packet-fixture": "node internal/generate-packet-fixture.mjs --check # the committed fixture must still match clusters.json and must never carry image_url (CI would fetch 43 photos from someone else's CDN).", - "packet:ci": "sh -c 'F=\"$PWD/library/scripts/posters/fixtures/records-tibet.json\"; PACKET_RECORDS=\"$F\" ONLY=asia-china-tibet-autonomous-region node library/scripts/posters/packet.mjs' # build ONE packet from the committed fixture, no network. This is what makes check:packets-all evaluate something in CI instead of SKIPping, as it had on every build.", + "packet:ci": "node internal/build-packet-fixtures.mjs # build EVERY committed fixture, no network, each renamed to its own output so they coexist. Was one fixture (tibet); packet.mjs names its output for the ZONE not the fixture, so sequential builds overwrote each other and check:packets-all saw a single SHAPE while reporting success. The fixtures are chosen at the PER_PAGE=20 page boundary — exactly 20, 21, and 1 group — because laos (95) and tibet (43) are both mid-range remainder cases and the boundary itself had never rendered.", "token": "node internal/write-token.mjs", "smoke": "node internal/smoke.mjs", "smoke:embeds": "node internal/embed-smoke.mjs",