Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade node-mapnik and use a less restrictive version pinning (and release a new version) #128

Open
n-peugnet opened this issue Oct 4, 2023 · 0 comments · May be fixed by #129
Open

Upgrade node-mapnik and use a less restrictive version pinning (and release a new version) #128

n-peugnet opened this issue Oct 4, 2023 · 0 comments · May be fixed by #129

Comments

@n-peugnet
Copy link

Please consider upgrading node-mapnik to at least 4.5 as it seems to use a lot more stable node extension API:

Starting from v4.5.0, node-mapnik module is published as "universal" binaries using node-addon-api All Node.js versions >= 10 are known to work, consult N-API documentation for more details: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_node_api_version_matrix

This will allow to use this package on current platforms easily. It tried to apply this simple patch and it allowed me to run npm install wich was completely failing previously because of my recent node version.

diff --git a/package.json b/package.json
index afd8ecb..3270132 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
   "dependencies": {
     "step": "~0.0.5",
     "generic-pool": "~2.4.0",
-    "mapnik": "~3.7.0",
+    "mapnik": "~4.5",
     "mime": "~1.3.4"
   },
   "devDependencies": {

I ran the test and all of them passed correctly, but I don't know how much of the library code is tested.

Tests results

$ npm run test

> @mapbox/[email protected] test
> mocha -R spec --timeout 10000



  Closing behavior 
    ✓ should close cleanly 1 (504ms)
    ✓ should close cleanly 2 (327ms)
    ✓ should throw with invalid usage (close before getTile) (301ms)
    ✓ should throw with invalid usage (close after getTile) (324ms)

  Handling Errors 
    ✓ invalid style (301ms)
    ✓ invalid font, strict (297ms)
    ✓ invalid font, non-strict (default) (296ms)
    ✓ missing data (295ms)
    ✓ bad style (292ms)
    ✓ invalid image format (311ms)
    ✓ invalid image format 2 (315ms)

  Render 
    getGrid() 
      ✓ validates (44ms)

  Grid Render Errors 
    ✓ invalid layer (304ms)

  Info 
    ✓ getInfo() (310ms)
    ✓ getInfo() with XML string (307ms)
    ✓ getInfo() with template (304ms)
    ✓ getInfo() with jpeg format defined (300ms)
    ✓ creates backend from string with correct internal boolean values 1
    ✓ creates backend from string with correct internal boolean values 2
    ✓ creates backend from object with correct internal boolean values

  locking cache
    ✓ cache works
    ✓ multiple requests get same response
    ✓ errors get propagated
    ✓ multiple error-ed requests get the same response
    ✓ derived keys get the same response
    ✓ .clear()
    ✓ .del()
    ✓ later requests get a cached response
    ✓ test cache with timeout=0

  metatile
    ✓ test metatile calculation at z=0
    ✓ test metatile calculation at z=1
    ✓ test metatile calculation at z=2

  Render 
    ✓ getTile() override format
    getTile() 
      ✓ validates (94ms)
    getTile() with XML string
      ✓ validates (92ms)

  .mapnik
    ✓ exposes the mapnik binding


  36 passing (6s)

@n-peugnet n-peugnet linked a pull request Oct 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant