From 1b7eb70461d032658cb6e8911e620267f9d3196d Mon Sep 17 00:00:00 2001 From: Ib Green Date: Sun, 5 Apr 2026 12:09:10 -0400 Subject: [PATCH 1/3] chore: Fix TypeScript 6 deprecations --- modules/core/tsconfig.json | 4 +- modules/culling/tsconfig.json | 4 +- modules/dggs-geohash/tsconfig.json | 4 +- modules/dggs-quadkey/tsconfig.json | 4 +- modules/dggs-s2/tsconfig.json | 4 +- modules/geoid/tsconfig.json | 4 +- modules/geospatial/tsconfig.json | 4 +- modules/main/tsconfig.json | 4 +- modules/polygon/tsconfig.json | 4 +- modules/proj4/tsconfig.json | 4 +- modules/sun/tsconfig.json | 4 +- modules/types/tsconfig.json | 4 +- modules/web-mercator/tsconfig.json | 4 +- tsconfig.base.json | 74 +++++++++++++++++++++++++++ tsconfig.build.json | 10 ++++ tsconfig.json | 82 +++--------------------------- 16 files changed, 118 insertions(+), 100 deletions(-) create mode 100644 tsconfig.base.json create mode 100644 tsconfig.build.json diff --git a/modules/core/tsconfig.json b/modules/core/tsconfig.json index 36738385..2b13df80 100644 --- a/modules/core/tsconfig.json +++ b/modules/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -10,4 +10,4 @@ "references": [ {"path": "../types"} ] -} \ No newline at end of file +} diff --git a/modules/culling/tsconfig.json b/modules/culling/tsconfig.json index b6d00108..9420d3be 100644 --- a/modules/culling/tsconfig.json +++ b/modules/culling/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -11,4 +11,4 @@ {"path": "../types"}, {"path": "../core"} ] -} \ No newline at end of file +} diff --git a/modules/dggs-geohash/tsconfig.json b/modules/dggs-geohash/tsconfig.json index 9c69bf17..b32a000d 100644 --- a/modules/dggs-geohash/tsconfig.json +++ b/modules/dggs-geohash/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -11,4 +11,4 @@ {"path": "../types"}, {"path": "../web-mercator"} ] -} \ No newline at end of file +} diff --git a/modules/dggs-quadkey/tsconfig.json b/modules/dggs-quadkey/tsconfig.json index 36738385..2b13df80 100644 --- a/modules/dggs-quadkey/tsconfig.json +++ b/modules/dggs-quadkey/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -10,4 +10,4 @@ "references": [ {"path": "../types"} ] -} \ No newline at end of file +} diff --git a/modules/dggs-s2/tsconfig.json b/modules/dggs-s2/tsconfig.json index 36738385..2b13df80 100644 --- a/modules/dggs-s2/tsconfig.json +++ b/modules/dggs-s2/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -10,4 +10,4 @@ "references": [ {"path": "../types"} ] -} \ No newline at end of file +} diff --git a/modules/geoid/tsconfig.json b/modules/geoid/tsconfig.json index b6d00108..9420d3be 100644 --- a/modules/geoid/tsconfig.json +++ b/modules/geoid/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -11,4 +11,4 @@ {"path": "../types"}, {"path": "../core"} ] -} \ No newline at end of file +} diff --git a/modules/geospatial/tsconfig.json b/modules/geospatial/tsconfig.json index d57a67bf..895a4563 100644 --- a/modules/geospatial/tsconfig.json +++ b/modules/geospatial/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -12,4 +12,4 @@ {"path": "../core"}, {"path": "../culling"} ] -} \ No newline at end of file +} diff --git a/modules/main/tsconfig.json b/modules/main/tsconfig.json index b6d00108..9420d3be 100644 --- a/modules/main/tsconfig.json +++ b/modules/main/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -11,4 +11,4 @@ {"path": "../types"}, {"path": "../core"} ] -} \ No newline at end of file +} diff --git a/modules/polygon/tsconfig.json b/modules/polygon/tsconfig.json index c2211b8d..4856d120 100644 --- a/modules/polygon/tsconfig.json +++ b/modules/polygon/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -10,4 +10,4 @@ "references": [ {"path": "../core"} ] -} \ No newline at end of file +} diff --git a/modules/proj4/tsconfig.json b/modules/proj4/tsconfig.json index b6d00108..9420d3be 100644 --- a/modules/proj4/tsconfig.json +++ b/modules/proj4/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -11,4 +11,4 @@ {"path": "../types"}, {"path": "../core"} ] -} \ No newline at end of file +} diff --git a/modules/sun/tsconfig.json b/modules/sun/tsconfig.json index 36738385..2b13df80 100644 --- a/modules/sun/tsconfig.json +++ b/modules/sun/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -10,4 +10,4 @@ "references": [ {"path": "../types"} ] -} \ No newline at end of file +} diff --git a/modules/types/tsconfig.json b/modules/types/tsconfig.json index c27bee26..82ad953c 100644 --- a/modules/types/tsconfig.json +++ b/modules/types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -8,4 +8,4 @@ "outDir": "dist" }, "references": [] -} \ No newline at end of file +} diff --git a/modules/web-mercator/tsconfig.json b/modules/web-mercator/tsconfig.json index b231fe1c..bbf8bb4b 100644 --- a/modules/web-mercator/tsconfig.json +++ b/modules/web-mercator/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { @@ -11,4 +11,4 @@ "references": [ {"path": "../types"} ] -} \ No newline at end of file +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..b491ccca --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,74 @@ +{ + "compilerOptions": { + "target": "es2020", + "allowJs": true, + "checkJs": false, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "rootDir": ".", + "useDefineForClassFields": false, + + // BEGIN TYPE CHECK SETTINGS + "skipLibCheck": true, + + "strict": false, + + "noImplicitAny": false, + "noImplicitThis": true, + "strictBindCallApply": true, + "strictFunctionTypes": true, + "useUnknownInCatchVariables": true, + // "strictNullChecks": true, + // "strictPropertyInitialization": true, + + // "exactOptionalPropertyTypes": true, - requires strictNullChecks + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + // END TYPE CHECK SETTINGS + + "paths": { + "@math.gl/core/*": ["./modules/core/src/*"], + "@math.gl/core/test/*": ["./modules/core/test/*"], + "@math.gl/culling/*": ["./modules/culling/src/*"], + "@math.gl/culling/test/*": ["./modules/culling/test/*"], + "@math.gl/dggs-pgeohash/*": ["./modules/dggs-pgeohash/src/*"], + "@math.gl/dggs-pgeohash/test/*": ["./modules/dggs-pgeohash/test/*"], + "@math.gl/dggs-s2/*": ["./modules/dggs-s2/src/*"], + "@math.gl/dggs-s2/test/*": ["./modules/dggs-s2/test/*"], + "@math.gl/dggs-quadkey/*": ["./modules/dggs-quadkey/src/*"], + "@math.gl/dggs-quadkey/test/*": ["./modules/dggs-quadkey/test/*"], + "@math.gl/geoid/*": ["./modules/geoid/src/*"], + "@math.gl/geoid/test/*": ["./modules/geoid/test/*"], + "@math.gl/geospatial/*": ["./modules/geospatial/src/*"], + "@math.gl/geospatial/test/*": ["./modules/geospatial/test/*"], + "@math.gl/polygon/*": ["./modules/polygon/src/*"], + "@math.gl/polygon/test/*": ["./modules/polygon/test/*"], + "@math.gl/proj4/*": ["./modules/proj4/src/*"], + "@math.gl/proj4/test/*": ["./modules/proj4/test/*"], + "@math.gl/sun/*": ["./modules/sun/src/*"], + "@math.gl/sun/test/*": ["./modules/sun/test/*"], + "@math.gl/types/*": ["./modules/types/src/*"], + "@math.gl/types/test/*": ["./modules/types/test/*"], + "@math.gl/web-mercator/*": ["./modules/web-mercator/src/*"], + "@math.gl/web-mercator/test/*": ["./modules/web-mercator/test/*"], + "test/*": ["./test/*"] + }, + "plugins": [ + { + "transform": "@vis.gl/ts-plugins/ts-transform-append-extension", + "extensions": [".js"], + "after": true + }, + { + "transform": "@vis.gl/ts-plugins/ts-transform-append-extension", + "extensions": [".js"], + "afterDeclarations": true + } + ] + } +} diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..566c0bd3 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + // Library builds target standard ESM output instead of Node-specific emit. + "module": "es2020", + // Bundler resolution avoids deprecated legacy node resolution while keeping + // package builds compatible with extensionless source imports. + "moduleResolution": "bundler" + } +} diff --git a/tsconfig.json b/tsconfig.json index 671f9cf4..36c48543 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,84 +1,18 @@ { + "extends": "./tsconfig.base.json", "ts-node": { // It is faster to skip typechecking. Remove if you want ts-node to do typechecking. "transpileOnly": true }, "compilerOptions": { - "target": "es2020", - "module": "es2020", - "allowJs": true, - "checkJs": false, - "moduleResolution": "node", - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "rootDir": ".", - "baseUrl": ".", - "ignoreDeprecations": "6.0", - "useDefineForClassFields": false, - - // BEGIN TYPE CHECK SETTINGS - "skipLibCheck": true, - - "strict": false, - - "noImplicitAny": false, // covered by strict - "noImplicitThis": true, // covered by strict - "strictBindCallApply": true, // covered by strict - "strictFunctionTypes": true, // covered by strict - "useUnknownInCatchVariables": true, // covered by strict - // "strictNullChecks": true, // covered by strict - // "strictPropertyInitialization": true, // covered by strict, requires strict null checks - - // "exactOptionalPropertyTypes": true, - requires strictNullChecks - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noPropertyAccessFromIndexSignature": true, - "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": false, - // END TYPE CHECK SETTINGS - - "paths": { - "@math.gl/core/*": ["modules/core/src/*"], - "@math.gl/core/test/*": ["modules/core/test/*"], - "@math.gl/culling/*": ["modules/culling/src/*"], - "@math.gl/culling/test/*": ["modules/culling/test/*"], - "@math.gl/dggs-pgeohash/*": ["modules/dggs-pgeohash/src/*"], - "@math.gl/dggs-pgeohash/test/*": ["modules/dggs-pgeohash/test/*"], - "@math.gl/dggs-s2/*": ["modules/dggs-s2/src/*"], - "@math.gl/dggs-s2/test/*": ["modules/dggs-s2/test/*"], - "@math.gl/dggs-quadkey/*": ["modules/dggs-quadkey/src/*"], - "@math.gl/dggs-quadkey/test/*": ["modules/dggs-quadkey/test/*"], - "@math.gl/geoid/*": ["modules/geoid/src/*"], - "@math.gl/geoid/test/*": ["modules/geoid/test/*"], - "@math.gl/geospatial/*": ["modules/geospatial/src/*"], - "@math.gl/geospatial/test/*": ["modules/geospatial/test/*"], - "@math.gl/polygon/*": ["modules/polygon/src/*"], - "@math.gl/polygon/test/*": ["modules/polygon/test/*"], - "@math.gl/proj4/*": ["modules/proj4/src/*"], - "@math.gl/proj4/test/*": ["modules/proj4/test/*"], - "@math.gl/sun/*": ["modules/sun/src/*"], - "@math.gl/sun/test/*": ["modules/sun/test/*"], - "@math.gl/types/*": ["modules/types/src/*"], - "@math.gl/types/test/*": ["modules/types/test/*"], - "@math.gl/web-mercator/*": ["modules/web-mercator/src/*"], - "@math.gl/web-mercator/test/*": ["modules/web-mercator/test/*"], - "test/*": ["test/*"] - }, - "plugins": [ - { - "transform": "@vis.gl/ts-plugins/ts-transform-append-extension", - "extensions": [".js"], - "after": true - }, - { - "transform": "@vis.gl/ts-plugins/ts-transform-append-extension", - "extensions": [".js"], - "afterDeclarations": true - } - ] + // Use Node 20 module semantics in repo-level tooling and tests so TypeScript + // understands modern package.json features such as "exports". + "module": "Node20", + // TypeScript does not currently expose a separate "node20" resolution mode. + // The Node-style resolver remains under the node16/nodenext family, and this + // is the stable choice for Node-oriented workflows in this repo. + "moduleResolution": "node16" }, "include":[ "modules/*/src", From b5df1d25a760b956c8eceded61ecc3d8dff9681a Mon Sep 17 00:00:00 2001 From: Ib Green Date: Sun, 5 Apr 2026 12:14:06 -0400 Subject: [PATCH 2/3] docs --- README.md | 23 ++++++++++++++++++----- docs/whats-new.md | 12 ++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 19f18854..34ae1d51 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,28 @@

- - version + + npm package version - - downloads + + MIT license + + + npm downloads + + + coverage - Coverage Status

math.gl | Docs

+

+ Documentation + · + What's New + · + API Reference +

+ # math.gl > This page is a brief summary only. Please refer to the extensive online [documentation](https://visgl.github.io/math.gl). diff --git a/docs/whats-new.md b/docs/whats-new.md index 8731eff1..0206862f 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -45,17 +45,13 @@ -## v5.0 (In planning) - -Release Date: TBD, maybe Q2, 2025. - -Goal: Stronger type guarantees for math classes via the new sized array types. - ## v4.2 (In development) -Release Date: TBD, maybe Q1, 2024. +Target Release Date: Q2, 2026. + +Highlights: -Goal: Minor functionality additions, as required. +- TypeScript 6 compatibility. ## v4.1 From de532570a9e3940cc13fd2e0e16484b604676a1e Mon Sep 17 00:00:00 2001 From: Ib Green Date: Sun, 5 Apr 2026 12:19:20 -0400 Subject: [PATCH 3/3] fixes --- package.json | 6 +++--- tsconfig.json | 16 +--------------- tsconfig.test-node.json | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 tsconfig.test-node.json diff --git a/package.json b/package.json index c43ccc62..b5d51937 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,13 @@ "scripts": { "bootstrap": "yarn && ocular-bootstrap && npm run build", "build": "ocular-clean && time ocular-build", - "cover": "ocular-test cover", + "cover": "TS_NODE_PROJECT=tsconfig.test-node.json ocular-test cover", "lint": "ocular-lint", "metrics": "ocular-metrics", "publish-beta": "ocular-publish version-only-beta", "publish-prod": "ocular-publish version-only-prod", - "test": "ocular-test", - "test-pre-commit": "ocular-lint && ocular-test node" + "test": "TS_NODE_PROJECT=tsconfig.test-node.json ocular-test", + "test-pre-commit": "ocular-lint && TS_NODE_PROJECT=tsconfig.test-node.json ocular-test node" }, "devDependencies": { "@probe.gl/bench": "^4.0.0", diff --git a/tsconfig.json b/tsconfig.json index 36c48543..298a1c20 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,5 @@ { - "extends": "./tsconfig.base.json", - "ts-node": { - // It is faster to skip typechecking. Remove if you want ts-node to do typechecking. - "transpileOnly": true - }, - - "compilerOptions": { - // Use Node 20 module semantics in repo-level tooling and tests so TypeScript - // understands modern package.json features such as "exports". - "module": "Node20", - // TypeScript does not currently expose a separate "node20" resolution mode. - // The Node-style resolver remains under the node16/nodenext family, and this - // is the stable choice for Node-oriented workflows in this repo. - "moduleResolution": "node16" - }, + "extends": "./tsconfig.build.json", "include":[ "modules/*/src", "modules/*/test" diff --git a/tsconfig.test-node.json b/tsconfig.test-node.json new file mode 100644 index 00000000..9603ae3e --- /dev/null +++ b/tsconfig.test-node.json @@ -0,0 +1,24 @@ +{ + "extends": "./tsconfig.base.json", + "ts-node": { + // It is faster to skip typechecking. Remove if you want ts-node to do typechecking. + "transpileOnly": true + }, + "compilerOptions": { + // Keep Node-oriented test execution on TypeScript's stable Node ESM mode. + // This is used only by the Node test runner, not by general source checking. + "module": "Node16", + "moduleResolution": "node16" + }, + "include": [ + "test", + "modules/*/src", + "modules/*/test" + ], + "exclude": [ + "test/apps/**/*", + "node_modules", + "**/dist/**/*", + "**/*bench*" + ] +}