pelias / wof

WhosOnFirst tools
3 stars 2 forks source link

tooling for generating upstream PRs (including exportify) #20

Closed missinglink closed 4 years ago

missinglink commented 4 years ago

This PR contains a bunch of commands required to author this PR, these make generating patches to WOF πŸ’― times easier πŸŽ‰

Summary:

So the cool thing about all this is that it's now possible to write a through2 stream to update WOF records and then write them back to the repo ready for a PR!

It's even possible to import them to a SQLite db and use the rest of the collection to fix integrity issues and again write it back to the filesystem ready for a PR πŸ§™

Eg:

# clone repo (fa984290faaef47d83c795159558cf7ee5560ca4)
git clone https://github.com/whosonfirst-data/whosonfirst-data-admin-ca.git

# convert to sqlite db
wof git export whosonfirst-data-admin-ca \
  | wof sqlite import ca-fix.db

# fix hierarchies, print updated records to stdout, exportify them and write them back to the filesystem
wof sqlite fix --hierarchies --dryrun --cat ca-fix.db \
  | wof fs import -v --exportify whosonfirst-data-admin-ca/data
missinglink commented 4 years ago

cc/ @Joxit I think you're going to like this πŸ˜„

missinglink commented 4 years ago
npm publish
+ @whosonfirst/wof@0.27.0
Joxit commented 4 years ago

Yeah ! That's pretty cool ! In fact I already wrote something for exportify :sweat_smile: I can run the exportify on all files for a specific commit or all stagged files. I'm trying to rewrite the full exportify in rust but it's a pain... :sweat: