Repository navigation
Conversation
Stations now default to Wikidata's railway stations worldwide, fetched at build time from the Offware places dataset (CC0), instead of Trainline's European list. People who used the app before keep Trainline unless they switch in Settings, so their saved station ids stay valid. Landmarks come from the same dataset: the 10,000 best-known sights, UNESCO sites excluded.
The places repository becomes Offware's shared data repository, with one folder per dataset: stations/railways.json and places/landmarks.json.
Cities, regions, airports, UNESCO sites, Trainline stations, languages, country names, continents, sovereignty and moments are now built in offware-apps/data. scripts/fetch-data.mjs (pnpm data) fetches them at build time, taking a file only while its dataset carries the licence provenance names; otherwise the committed copy stays. The build scripts, their vendored sources and their dev dependencies leave Postcards, and the gazetteer checks against the vendored GeoNames day move with them.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: Postcards built its own reference data from scripts and vendored files: cities, regions, airports, UNESCO sites, European stations, countries and moments. Railway stations covered Europe only (Trainline), and landmarks were a small hand-seeded list.
After: every reference file comes from Offware's shared data (https://github.com/offware-apps/data), the one place all Offware apps read their data from. New users get railway stations worldwide from Wikidata by default, and landmarks are the 10,000 best-known sights. The other files are the same as before, now built there; only the Trainline stations are fresher. Trainline and None stay selectable in Settings.
People who used the app before and never picked a station source keep Trainline, so the station ids already saved in their visits keep matching.
How:
scripts/fetch-data.mjs(pnpm data) reads the shared data'scatalog.json, then fetches each file. A file is written only while its dataset still carries the licence the app's provenance names, and only when it has the expected shape and enough valid records. Otherwise the committed copy stays, so the app always builds and works offline. The build fails only if there is no worldwide stations file at all.The Pages and Android workflows run it before the build, and Pages also rebuilds weekly. The worldwide stations file is runtime-cached rather than precached. The build scripts that moved (
build-reference,build-railways,build-heritage-full,build-languages,build-sovereignty,build-city-admin1), their vendored sources and their dev dependencies are removed. The two gazetteer checks against the vendored GeoNames day move to the shared data with them. Provenance (Settings, PROVENANCE.md) and the wiki name the shared data. Spec:specs/022-shared-places/.Merge after offware-apps/data#2, and once https://offware-apps.github.io/data/v1/catalog.json is live: until then the worldwide stations step fails on purpose.
Checks: typecheck and all 702 unit tests pass locally. A run against a local build of offware-apps/data#2 wrote every file. Cities, regions, airports, UNESCO sites, continents and sovereignty came out byte-identical to the committed copies; the rest differ only in formatting or fresher Trainline rows.