Pmtiles js v4 (#499)

* pmtiles js v4: remove pmtiles spec v2 compatibility [#287]
* restructure ts files into src
* add tsup for building ESM/CJS and making types work in ESM
* bump fflate dependency
* update CHANGELOG for js 4.0.0
This commit is contained in:
Brandon Liu
2024-11-26 11:56:41 +08:00
committed by GitHub
parent bbeda97ed4
commit e678dd5326
24 changed files with 2885 additions and 888 deletions

View File

@@ -1,45 +1,52 @@
{
"name": "pmtiles",
"version": "3.2.1",
"version": "4.0.0",
"description": "PMTiles archive decoder for browsers",
"type": "module",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"exports": {
"require":"./dist/index.cjs",
"default":"./dist/index.js"
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
}
},
"types": "./dist/index.d.ts",
"source": "index.ts",
"files": [
"dist",
"adapters.ts",
"index.ts",
"v2.ts"
"src"
],
"scripts": {
"build-iife": "esbuild index.ts --outfile=dist/pmtiles.js --target=es6 --global-name=pmtiles --bundle --format=iife",
"build-esm": "esbuild index.ts --outfile=dist/index.js --target=es6 --bundle --format=esm",
"build-cjs": "esbuild index.ts --outfile=dist/index.cjs --target=es6 --bundle --format=cjs",
"build-tsc": "tsc --declaration --emitDeclarationOnly --outdir dist",
"build": "npm run build-iife && npm run build-esm && npm run build-cjs && npm run build-tsc",
"build": "tsup",
"test": "tsx test/index.test.ts",
"tsc": "tsc --noEmit --watch",
"biome": "biome check adapters.ts index.ts v2.ts test --apply",
"biome-check": "biome check adapters.ts index.ts v2.ts test"
"biome": "biome check src test --apply",
"biome-check": "biome check src test"
},
"homepage": "https://github.com/protomaps/pmtiles",
"author": "Brandon Liu",
"license": "BSD-3-Clause",
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@types/leaflet": "^1.9.8",
"@types/node": "^20.0.0",
"esbuild": "^0.20.0",
"msw": "^2.5.0",
"tsup": "^8.3.5",
"tsx": "^4.7.0",
"typedoc": "^0.25.7",
"typescript": "^5.0.0"
},
"dependencies": {
"@types/leaflet": "^1.9.8",
"fflate": "^0.8.0"
"fflate": "^0.8.2"
}
}