Choosing Shapefile in the Export GIS modal produced no file. shp-write@0.3.2 cannot run in this build, in three separate ways: its dbf dependency assigns an undeclared variable, which was fine in the browserify bundle it was written for but is a ReferenceError under the strict mode ES modules always use; its zip.js branches on process.browser, which does not exist in a browser; and its download.js delivers the archive by navigating to a data:application/zip URL, which Chromium blocks in the top frame. - src/shapefile-write.js writes .shp/.shx/.dbf/.prj/.cpg itself: geometries split by type into up to three layers, polygon rings re-wound clockwise as the format requires, DBF column types inferred per column, names sanitised to DBF's 10 characters and de-duplicated, UTF-8 declared via .cpg. - src/zip-store.js holds the STORED-ZIP writer that was inside analysis/xlsx.js, so both writers share it. Pure-ASCII archives are byte-for-byte as before. - shp-write, and with it dbf and JSZip 2.5.0, leave the dependency tree; the build no longer warns that node's "assert" was externalised. - Service Worker v26 for the new bundle. Verified in a browser: the Export GIS modal, driven through its own controls with Web Mercator features, produced area_analysis.zip holding both layers with WGS84 coordinates, file code 9994 and the right shape types. The archive reads back through the application's own shpjs importer with geometries, numeric, text and boolean attributes intact. The zonal-statistics .xlsx export, which now shares the zip writer, still opens and reads correctly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
37 lines
887 B
JSON
37 lines
887 B
JSON
{
|
|
"name": "lupmis2-pwa",
|
|
"version": "1.0.0",
|
|
"type": "module",
|
|
"description": "LUPMIS2 Field Data Collection PWA with offline SQLite and maps",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"preview": "vite preview"
|
|
},
|
|
"dependencies": {
|
|
"@popperjs/core": "^2.11.8",
|
|
"@turf/area": "^7.3.5",
|
|
"@turf/boolean-intersects": "^7.3.5",
|
|
"@turf/boolean-point-in-polygon": "^7.3.5",
|
|
"@turf/centroid": "^7.3.5",
|
|
"@turf/difference": "^7.3.5",
|
|
"@turf/helpers": "^7.3.5",
|
|
"@turf/intersect": "^7.3.5",
|
|
"@turf/union": "^7.3.5",
|
|
"bootstrap": "^5.3.3",
|
|
"bootstrap-icons": "^1.11.3",
|
|
"jspdf": "^4.2.1",
|
|
"jspdf-autotable": "^5.0.7",
|
|
"ol": "^10.3.0",
|
|
"ol-ext": "^4.0.24",
|
|
"shpjs": "^6.2.0",
|
|
"sqlocal": "^0.16.0"
|
|
},
|
|
"devDependencies": {
|
|
"vite": "^6.0.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
}
|
|
}
|