diff --git a/README.md b/README.md index 19f1885..34ae1d5 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 8731eff..0206862 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 diff --git a/modules/core/tsconfig.json b/modules/core/tsconfig.json index 3673838..2b13df8 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 b6d0010..9420d3b 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 9c69bf1..b32a000 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 3673838..2b13df8 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 3673838..2b13df8 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 b6d0010..9420d3b 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 d57a67b..895a456 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 b6d0010..9420d3b 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 c2211b8..4856d12 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 b6d0010..9420d3b 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 3673838..2b13df8 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 c27bee2..82ad953 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 b231fe1..bbf8bb4 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/package.json b/package.json index c43ccc6..b5d5193 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.base.json b/tsconfig.base.json new file mode 100644 index 0000000..b491ccc --- /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 0000000..566c0bd --- /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 671f9cf..298a1c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,85 +1,5 @@ { - "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 - } - ] - }, + "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 0000000..9603ae3 --- /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*" + ] +}