a-b-street / osm2lanes

A common library and set of test cases for transforming OSM tags to lane specifications
https://a-b-street.github.io/osm2lanes/
Apache License 2.0
34 stars 2 forks source link

Vendor Leaflet dependencies, to unbreak the local dev workflow. #254 #255

Closed dabreegster closed 2 years ago

dabreegster commented 2 years ago

See issue for details. I'd love to do something nicer, but for the moment, just manually downloading the 4 files we need and sticking them in this repo seems fine. I only tested locally, but I don't expect any problems with the github pages hosting workflow.

github-actions[bot] commented 2 years ago

Benchmark for 066ee9c

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | tests/224637155 | 5.6±0.01µs | 5.6±0.01µs | 0.00% | | tests/380103730 Japanese Expressway | 7.4±0.01µs | **7.3±0.33µs** | **-1.35%** | | tests/389654080 | 9.3±0.01µs | **9.2±0.05µs** | **-1.08%** | | tests/49207928 cycleway:BACKWARD=lane | 6.8±0.02µs | **6.7±0.03µs** | **-1.47%** | | tests/8591383 a bidirectional cycleway, oneway:bicycle | 7.7±0.01µs | **7.6±0.05µs** | **-1.30%** | | tests/bus:lanes=designated\| | 7.0±0.01µs | 7.0±0.01µs | 0.00% | | tests/busway=lane | 6.4±0.01µs | **6.3±0.01µs** | **-1.56%** | | tests/cycleway=lane | 6.4±0.01µs | 6.4±0.01µs | 0.00% | | tests/cycleway=opposite oneway=yes oneway:bicycle=no | **6.1±0.01µs** | 6.2±0.01µs | **+1.64%** | | tests/cycleway=opposite_track oneway=yes, deprecated | 7.2±0.01µs | **7.1±0.01µs** | **-1.39%** | | tests/sidewalk:right=yes | 5.7±0.01µs | 5.7±0.01µs | 0.00% | | tests/sidewalk=both | 5.9±0.01µs | 5.9±0.03µs | 0.00% |
dabreegster commented 2 years ago

Look for additional build tooling when there is a pain point or missing feature, I reckon.

In osm2streets, the vendoring process was a little more annoying, because there were a few small image files referenced by the JS or CSS. I missed them the first round and only discovered when I was running locally without internet. Is there a simple tool out there to grab all the final distribution files for an NPM package?

BudgieInWA commented 2 years ago

Is there a simple tool out there to grab all the final distribution files for an NPM package?

That sounds like just npm to me :D (or alternative yarn). It can be used to get the packages, then the whole node_modules directory can be added to source control (along with the package.json and yarn.lock).

ben@ben-xps:~/code/blah$ yarn add leaflet
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ leaflet@1.9.2
info All dependencies
└─ leaflet@1.9.2
Done in 0.90s.
ben@ben-xps:~/code/blah$ ls node_modules/leaflet/dist
images  leaflet.css  leaflet.js  leaflet.js.map  leaflet-src.esm.js  leaflet-src.esm.js.map  leaflet-src.js  leaflet-src.js.map