From e7dccc4a8ca45b95e28c9263221cd7b54cc663b2 Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Mon, 29 Jan 2024 15:14:32 -0800 Subject: [PATCH 1/2] wip --- .ocularrc.js | 33 +-- babel.config.js | 26 -- examples/layer-browser/package.json | 1 + examples/layer-browser/src/data-samples.js | 30 +- modules/aggregation-layers/bundle.ts | 6 +- modules/aggregation-layers/package.json | 15 +- modules/aggregation-layers/tsconfig.json | 2 +- modules/arcgis/package.json | 12 +- modules/arcgis/tsconfig.json | 2 +- modules/carto/bundle.ts | 6 +- modules/carto/package.json | 15 +- modules/carto/src/api/fetch-map.ts | 2 +- modules/carto/src/api/query.ts | 2 +- modules/carto/src/index.ts | 8 +- .../src/sources/boundary-query-source.ts | 2 +- modules/carto/tsconfig.json | 2 +- modules/core/bundle/debug.ts | 12 +- modules/core/bundle/index.ts | 17 +- modules/core/package.json | 15 +- modules/core/src/index.ts | 6 +- .../src/lib/attribute/attribute-manager.ts | 2 +- modules/core/src/lib/composite-layer.ts | 2 +- modules/core/src/lib/deck-renderer.ts | 2 +- modules/core/src/lib/init.ts | 2 +- modules/core/src/lib/layer-manager.ts | 4 +- modules/core/src/lib/layer.ts | 2 +- modules/core/src/scripting/lumagl.ts | 51 +--- modules/core/src/types/layer-props.ts | 2 +- modules/core/tsconfig.json | 2 +- modules/extensions/bundle.ts | 6 +- modules/extensions/package.json | 15 +- modules/extensions/tsconfig.json | 2 +- modules/geo-layers/bundle.ts | 6 +- modules/geo-layers/package.json | 15 +- modules/geo-layers/src/index.ts | 10 +- .../src/mvt-layer/coordinate-transform.ts | 2 +- modules/geo-layers/src/mvt-layer/mvt-layer.ts | 4 +- .../src/terrain-layer/terrain-layer.ts | 4 +- .../geo-layers/src/tile-layer/tile-layer.ts | 6 +- modules/geo-layers/tsconfig.json | 2 +- modules/google-maps/package.json | 15 +- modules/google-maps/tsconfig.json | 2 +- modules/json/package.json | 15 +- .../src/helpers/parse-expression-string.ts | 3 +- modules/json/tsconfig.json | 2 +- modules/jupyter-widget/tsconfig.json | 2 +- modules/layers/bundle/index.ts | 6 +- modules/layers/package.json | 15 +- modules/layers/tsconfig.json | 2 +- modules/main/package.json | 15 +- modules/main/tsconfig.json | 2 +- modules/mapbox/package.json | 15 +- modules/mapbox/tsconfig.json | 2 +- modules/mesh-layers/bundle.ts | 6 +- modules/mesh-layers/package.json | 15 +- modules/mesh-layers/tsconfig.json | 2 +- modules/react/package.json | 14 +- modules/react/tsconfig.json | 2 +- modules/test-utils/package.json | 13 +- modules/test-utils/tsconfig.json | 2 +- modules/widgets/package.json | 15 +- modules/widgets/tsconfig.json | 7 +- package.json | 6 +- scripts/postinstall.sh | 11 - tsconfig.json | 1 + tsconfig.module.json | 15 +- yarn.lock | 263 +++--------------- 67 files changed, 341 insertions(+), 482 deletions(-) delete mode 100644 babel.config.js diff --git a/.ocularrc.js b/.ocularrc.js index f939dc218f0..59447b08376 100644 --- a/.ocularrc.js +++ b/.ocularrc.js @@ -1,7 +1,8 @@ -const {resolve, join} = require('path'); +/** @typedef {import('ocular-dev-tools').OcularConfig} OcularConfig */ +import {dirname, join} from 'path'; +import {fileURLToPath} from 'url'; -const packageRoot = resolve(__dirname); -const nodeModules = join(packageRoot, 'node_modules'); +const packageRoot = dirname(fileURLToPath(import.meta.url)); const lumaModules = join(packageRoot, '../luma.gl/modules'); const LUMA_ALIASES_LOCAL = { @@ -16,20 +17,25 @@ const LUMA_ALIASES_LOCAL = { const useLocalLuma = false; +/** @type {OcularConfig} */ const config = { lint: { paths: ['modules', 'test'] // paths: ['modules', 'test', 'examples', 'website'] }, + babel: false, + bundle: { globalName: 'deck', externals: ['h3-js'], - target: ['supports webgl', 'not dead'], + target: ['chrome110', 'firefox110', 'safari15'], format: 'umd', globals: { '@deck.gl/*': 'globalThis.deck', '@luma.gl/core': 'globalThis.luma', + '@luma.gl/engine': 'globalThis.luma', + '@luma.gl/webgl': 'globalThis.luma', '@loaders.gl/core': 'globalThis.loaders', 'h3-js': 'globalThis.h3 || {}' } @@ -43,23 +49,6 @@ const config = { 'deck.gl-test': join(packageRoot, './test') }, - // These packages are of type: 'module' and do not work in node tests when compiled to commonjs - // ts-node has experimental ESM support, but there's no reliable module aliasing - // See https://github.com/dividab/tsconfig-paths/issues/122 - nodeAliases: { - '@jupyter-widgets/base': `${packageRoot}/test/modules/jupyter-widget/dummy-jupyter-widgets-base.ts`, - '@mapbox/tiny-sdf': `${nodeModules}/@mapbox/tiny-sdf/index.cjs`, - 'd3-array': `${nodeModules}/d3-array/dist/d3-array.cjs`, - 'd3-color': `${nodeModules}/d3-color/dist/d3-color.cjs`, - 'd3-format': `${nodeModules}/d3-format/dist/d3-format.cjs`, - 'd3-interpolate': `${nodeModules}/d3-interpolate/dist/d3-interpolate.cjs`, - 'd3-scale': `${nodeModules}/d3-scale/dist/d3-scale.cjs`, - 'd3-time': `${nodeModules}/d3-time/dist/d3-time.cjs`, - 'd3-time-format': `${nodeModules}/d3-time-format/dist/d3-time-format.cjs`, - 'mapbox-gl': `${packageRoot}/test/modules/jupyter-widget/dummy-mapbox-gl.ts`, - 'react-map-gl/dist/esm/mapbox/mapbox': `${nodeModules}/react-map-gl/dist/es5/mapbox/mapbox.js` - }, - browserTest: { server: {wait: 5000} }, @@ -77,4 +66,4 @@ if (useLocalLuma) { Object.assign(config.aliases, LUMA_ALIASES_LOCAL); } -module.exports = config; +export default config; diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index fb503847908..00000000000 --- a/babel.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -const {getBabelConfig} = require('ocular-dev-tools/configuration'); - -module.exports = getBabelConfig({ - react: true, - overrides: { - plugins: [ - 'version-inline', - 'inline-webgl-constants', - [ - 'remove-glsl-comments', - { - patterns: ['**/*.glsl.js', '**/*.glsl.ts'] - } - ] - ], - overrides: [ - { - include: './modules/widgets/**/*.tsx', - // Parse preact-style JSX in @deck.gl/widgets. - presets: [['@babel/typescript', {jsxPragma: 'h'}]], - plugins: [['@babel/plugin-transform-react-jsx', {pragma: 'h'}]] - } - ] - } -}); diff --git a/examples/layer-browser/package.json b/examples/layer-browser/package.json index cacd7e5d94b..4ca95214ee9 100644 --- a/examples/layer-browser/package.json +++ b/examples/layer-browser/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "license": "MIT", + "type": "module", "scripts": { "start-local": "vite --config ../vite.config.local.mjs" }, diff --git a/examples/layer-browser/src/data-samples.js b/examples/layer-browser/src/data-samples.js index fe5feea6683..7e622ddeeac 100644 --- a/examples/layer-browser/src/data-samples.js +++ b/examples/layer-browser/src/data-samples.js @@ -1,23 +1,23 @@ import {Vector3} from '@math.gl/core'; /* load data samples for display */ -import allPoints from '../data/sf.bike.parking.json'; +import allPoints from '../data/sf.bike.parking.json' assert { type: 'json' }; import {pointGrid} from './utils'; import {pointsToWorldGrid} from './utils/grid-aggregator'; -import {default as meterTrajectorySmall} from '../data/meter-trajectory-small.json'; - -import {default as choropleths} from '../data/sf.zip.geo.json'; -export {default as geojson} from '../data/sample.geo.json'; -export {default as geojsonHole} from '../data/hole.geo.json'; -export {default as geojsonLarge} from '../data/canada.geo.json'; -export {default as hexagons} from '../data/hexagons.json'; -export {default as routes} from '../data/sfmta.routes.json'; -export {default as trips} from '../data/trips.json'; -export {default as SFTrips} from '../data/sf.trips'; -export {default as iconAtlas} from '../data/icon-atlas.json'; -export {default as quadkeys} from '../data/sf.quadkeys.json'; -export {default as s2cells} from '../data/sf.s2cells.json'; -export {default as geohashes} from '../data/sf.geohashes.json'; +import {default as meterTrajectorySmall} from '../data/meter-trajectory-small.json' assert { type: 'json' }; + +import {default as choropleths} from '../data/sf.zip.geo.json' assert { type: 'json' }; +export {default as geojson} from '../data/sample.geo.json' assert { type: 'json' }; +export {default as geojsonHole} from '../data/hole.geo.json' assert { type: 'json' }; +export {default as geojsonLarge} from '../data/canada.geo.json' assert { type: 'json' }; +export {default as hexagons} from '../data/hexagons.json' assert { type: 'json' }; +export {default as routes} from '../data/sfmta.routes.json' assert { type: 'json' }; +export {default as trips} from '../data/trips.json' assert { type: 'json' }; +export {default as SFTrips} from '../data/sf.trips.json' assert { type: 'json' }; +export {default as iconAtlas} from '../data/icon-atlas.json' assert { type: 'json' }; +export {default as quadkeys} from '../data/sf.quadkeys.json' assert { type: 'json' }; +export {default as s2cells} from '../data/sf.s2cells.json' assert { type: 'json' }; +export {default as geohashes} from '../data/sf.geohashes.json' assert { type: 'json' }; export {choropleths}; export const positionOrigin = [-122.42694203247012, 37.751537058389985]; diff --git a/modules/aggregation-layers/bundle.ts b/modules/aggregation-layers/bundle.ts index 0d69cdcf9a2..adfba29ab92 100644 --- a/modules/aggregation-layers/bundle.ts +++ b/modules/aggregation-layers/bundle.ts @@ -1,3 +1,7 @@ export * from '../layers/bundle/peer-dependency'; -export * from './src'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +/* eslint-disable import/no-extraneous-dependencies */ +export * from '@deck.gl/aggregation-layers'; diff --git a/modules/aggregation-layers/package.json b/modules/aggregation-layers/package.json index 4e8e456bbea..45216b41871 100644 --- a/modules/aggregation-layers/package.json +++ b/modules/aggregation-layers/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/aggregation-layers", "description": "deck.gl layers that aggregate the input data into alternative representations", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/aggregation-layers/tsconfig.json b/modules/aggregation-layers/tsconfig.json index f6581e50274..86561272477 100644 --- a/modules/aggregation-layers/tsconfig.json +++ b/modules/aggregation-layers/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"}, diff --git a/modules/arcgis/package.json b/modules/arcgis/package.json index 7ada7d7a079..539b4e43db4 100644 --- a/modules/arcgis/package.json +++ b/modules/arcgis/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/arcgis", "description": "Use deck.gl as a custom ArcGIS API for JavaScript layer", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,12 +17,17 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/arcgis/tsconfig.json b/modules/arcgis/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/arcgis/tsconfig.json +++ b/modules/arcgis/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/carto/bundle.ts b/modules/carto/bundle.ts index 6f649d0228b..fc001fb71e2 100644 --- a/modules/carto/bundle.ts +++ b/modules/carto/bundle.ts @@ -1,4 +1,8 @@ -import * as CartoUtils from './src'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +/* eslint-disable import/no-extraneous-dependencies */ +import * as CartoUtils from '@deck.gl/carto'; export * from '../layers/bundle/peer-dependency'; diff --git a/modules/carto/package.json b/modules/carto/package.json index 0136b193ade..0eab07dc259 100644 --- a/modules/carto/package.json +++ b/modules/carto/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/carto", "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -18,13 +19,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/carto/src/api/fetch-map.ts b/modules/carto/src/api/fetch-map.ts index 929eeae983f..ab0d080a5c7 100644 --- a/modules/carto/src/api/fetch-map.ts +++ b/modules/carto/src/api/fetch-map.ts @@ -16,7 +16,7 @@ import { vectorQuerySource, vectorTableSource, vectorTilesetSource -} from '../sources'; +} from '../sources/index'; import {parseMap} from './parse-map'; import {requestWithParameters} from './request-with-parameters'; import {assert} from '../utils'; diff --git a/modules/carto/src/api/query.ts b/modules/carto/src/api/query.ts index 4aa7eb580db..40015558d9b 100644 --- a/modules/carto/src/api/query.ts +++ b/modules/carto/src/api/query.ts @@ -1,4 +1,4 @@ -import {SOURCE_DEFAULTS} from '../sources'; +import {SOURCE_DEFAULTS} from '../sources/index'; import type {SourceOptions, QuerySourceOptions, QueryResult} from '../sources/types'; import {buildQueryUrl} from './endpoints'; import {requestWithParameters} from './request-with-parameters'; diff --git a/modules/carto/src/index.ts b/modules/carto/src/index.ts index 683c5037415..be92e0c2403 100644 --- a/modules/carto/src/index.ts +++ b/modules/carto/src/index.ts @@ -23,7 +23,7 @@ export {default as BASEMAP} from './basemap'; export {default as colorBins} from './style/color-bins-style'; export {default as colorCategories} from './style/color-categories-style'; export {default as colorContinuous} from './style/color-continuous-style'; -export {CartoAPIError, fetchMap, query} from './api'; +export {CartoAPIError, fetchMap, query} from './api/index'; export type { APIErrorContext, FetchMapOptions, @@ -32,7 +32,7 @@ export type { RequestType, QueryParameters, QueryOptions -} from './api'; +} from './api/index'; import { boundaryQuerySource, @@ -48,7 +48,7 @@ import { vectorTableSource, vectorTilesetSource, SOURCE_DEFAULTS -} from './sources'; +} from './sources/index'; const CARTO_SOURCES = { boundaryQuerySource, @@ -98,4 +98,4 @@ export type { VectorTilesetSourceOptions, GeojsonResult, JsonResult -} from './sources'; +} from './sources/index'; diff --git a/modules/carto/src/sources/boundary-query-source.ts b/modules/carto/src/sources/boundary-query-source.ts index 03bbff70d13..8f492d43301 100644 --- a/modules/carto/src/sources/boundary-query-source.ts +++ b/modules/carto/src/sources/boundary-query-source.ts @@ -1,4 +1,4 @@ -import {QueryParameters} from '../api'; +import {QueryParameters} from '../api/index'; import {baseSource} from './base-source'; import type {SourceOptions, TilejsonResult} from './types'; diff --git a/modules/carto/tsconfig.json b/modules/carto/tsconfig.json index 8df8e1bc4da..8d67a9736ab 100644 --- a/modules/carto/tsconfig.json +++ b/modules/carto/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"}, diff --git a/modules/core/bundle/debug.ts b/modules/core/bundle/debug.ts index a7952a7344f..43ca9fee2ce 100644 --- a/modules/core/bundle/debug.ts +++ b/modules/core/bundle/debug.ts @@ -1,11 +1,7 @@ -import {getLoggers} from '../src/debug/loggers'; +// @ts-nocheck +import {getLoggers} from '@deck.gl/core/debug/loggers'; -/* global deck */ -declare global { - const deck: any; -} - -const loggers = getLoggers(deck.log); -deck._registerLoggers(loggers); +const loggers = getLoggers(globalThis.deck.log); +globalThis.deck._registerLoggers(loggers); export {loggers}; diff --git a/modules/core/bundle/index.ts b/modules/core/bundle/index.ts index eed6da80204..39abf6671a5 100644 --- a/modules/core/bundle/index.ts +++ b/modules/core/bundle/index.ts @@ -1,6 +1,8 @@ -// We use `require` here because luma and deck core must be imported before `global` -import * as LumaGL from '../src/scripting/lumagl'; -import * as LoadersGL from '../src/scripting/loadersgl'; +// @ts-nocheck +// Luma and deck core must be imported before `global` +/* eslint-disable import/no-extraneous-dependencies */ +import * as LumaGL from '@deck.gl/core/scripting/lumagl'; +import * as LoadersGL from '@deck.gl/core/scripting/loadersgl'; globalThis.luma = globalThis.luma || {}; globalThis.loaders = globalThis.loaders || {}; @@ -8,7 +10,10 @@ globalThis.loaders = globalThis.loaders || {}; Object.assign(globalThis.luma, LumaGL); Object.assign(globalThis.loaders, LoadersGL); -export * from '../src'; -export {register as _registerLoggers} from '../src/debug'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +export * from '@deck.gl/core'; +export {register as _registerLoggers} from '@deck.gl/core/debug'; -export {default as DeckGL} from '../src/scripting/deckgl'; +export {default as DeckGL} from '@deck.gl/core/scripting/deckgl'; diff --git a/modules/core/package.json b/modules/core/package.json index cefd962b75d..48a05eec84f 100644 --- a/modules/core/package.json +++ b/modules/core/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/core", "description": "deck.gl core library", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "debug.min.js", "dist.min.js" ], diff --git a/modules/core/src/index.ts b/modules/core/src/index.ts index dd2a68eb9b2..891e7606ba0 100644 --- a/modules/core/src/index.ts +++ b/modules/core/src/index.ts @@ -23,7 +23,7 @@ export {VERSION} from './lib/init'; // Import shaderlib to make sure shader modules are initialized -export {getPipelineFactory, getShaderAssembler} from './shaderlib'; +export {getPipelineFactory, getShaderAssembler} from './shaderlib/index'; // Core Library export {COORDINATE_SYSTEM, OPERATION, UNIT} from './lib/constants'; @@ -59,7 +59,7 @@ export {default as OrthographicViewport} from './viewports/orthographic-viewport export {default as FirstPersonViewport} from './viewports/first-person-viewport'; // Shader modules -export {picking, project, project32, gouraudLighting, phongLighting, shadow} from './shaderlib'; +export {picking, project, project32, gouraudLighting, phongLighting, shadow} from './shaderlib/index'; export {default as View} from './views/view'; export {default as MapView} from './views/map-view'; @@ -132,7 +132,7 @@ export type {PickingInfo, GetPickingInfoParams} from './lib/picking/pick-info'; export type {ConstructorOf as _ConstructorOf} from './types/types'; export type {BinaryAttribute} from './lib/attribute/attribute'; export type {Effect, PreRenderOptions, PostRenderOptions} from './lib/effect'; -export type {PickingUniforms, ProjectUniforms} from './shaderlib'; +export type {PickingUniforms, ProjectUniforms} from './shaderlib/index'; export type {DefaultProps} from './lifecycle/prop-types'; export type {LayersPassRenderOptions} from './passes/layers-pass'; export type {Widget, WidgetPlacement} from './lib/widget-manager'; diff --git a/modules/core/src/lib/attribute/attribute-manager.ts b/modules/core/src/lib/attribute/attribute-manager.ts index 6b839077a0b..60d1bf13308 100644 --- a/modules/core/src/lib/attribute/attribute-manager.ts +++ b/modules/core/src/lib/attribute/attribute-manager.ts @@ -23,7 +23,7 @@ import Attribute, {AttributeOptions} from './attribute'; import log from '../../utils/log'; import memoize from '../../utils/memoize'; import {mergeBounds} from '../../utils/math-utils'; -import debug from '../../debug'; +import debug from '../../debug/index'; import {NumericArray} from '../../types/types'; import AttributeTransitionManager from './attribute-transition-manager'; diff --git a/modules/core/src/lib/composite-layer.ts b/modules/core/src/lib/composite-layer.ts index d9005790e28..7ff8db7fb41 100644 --- a/modules/core/src/lib/composite-layer.ts +++ b/modules/core/src/lib/composite-layer.ts @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import Layer, {UpdateParameters} from './layer'; -import debug from '../debug'; +import debug from '../debug/index'; import {flatten} from '../utils/flatten'; import type AttributeManager from './attribute/attribute-manager'; diff --git a/modules/core/src/lib/deck-renderer.ts b/modules/core/src/lib/deck-renderer.ts index a84cc4ecb8e..2ab0a7ec54b 100644 --- a/modules/core/src/lib/deck-renderer.ts +++ b/modules/core/src/lib/deck-renderer.ts @@ -1,6 +1,6 @@ import type {Device} from '@luma.gl/core'; import {Framebuffer} from '@luma.gl/core'; -import debug from '../debug'; +import debug from '../debug/index'; import DrawLayersPass from '../passes/draw-layers-pass'; import PickLayersPass from '../passes/pick-layers-pass'; diff --git a/modules/core/src/lib/init.ts b/modules/core/src/lib/init.ts index 5be4891ed2d..2ebb717291e 100644 --- a/modules/core/src/lib/init.ts +++ b/modules/core/src/lib/init.ts @@ -22,7 +22,7 @@ import {registerLoaders} from '@loaders.gl/core'; import {ImageLoader} from '@loaders.gl/images'; import log from '../utils/log'; -import {register} from '../debug'; +import {register} from '../debug/index'; import jsonLoader from '../utils/json-loader'; declare global { diff --git a/modules/core/src/lib/layer-manager.ts b/modules/core/src/lib/layer-manager.ts index 24f8fd7b37f..917b2f6a0e6 100644 --- a/modules/core/src/lib/layer-manager.ts +++ b/modules/core/src/lib/layer-manager.ts @@ -22,10 +22,10 @@ import type {Device, RenderPass} from '@luma.gl/core'; import {Timeline} from '@luma.gl/engine'; import type {PipelineFactory} from '@luma.gl/engine'; import {ShaderAssembler} from '@luma.gl/shadertools'; -import {getPipelineFactory, getShaderAssembler} from '../shaderlib'; +import {getPipelineFactory, getShaderAssembler} from '../shaderlib/index'; import {LIFECYCLE} from '../lifecycle/constants'; import log from '../utils/log'; -import debug from '../debug'; +import debug from '../debug/index'; import {flatten} from '../utils/flatten'; import {Stats} from '@probe.gl/stats'; import ResourceManager from './resource/resource-manager'; diff --git a/modules/core/src/lib/layer.ts b/modules/core/src/lib/layer.ts index 0ecd3219ee8..9a0c641ef59 100644 --- a/modules/core/src/lib/layer.ts +++ b/modules/core/src/lib/layer.ts @@ -29,7 +29,7 @@ import {diffProps, validateProps} from '../lifecycle/props'; import {LIFECYCLE, Lifecycle} from '../lifecycle/constants'; import {count} from '../utils/count'; import log from '../utils/log'; -import debug from '../debug'; +import debug from '../debug/index'; import assert from '../utils/assert'; import memoize from '../utils/memoize'; import {mergeShaders} from '../utils/shader'; diff --git a/modules/core/src/scripting/lumagl.ts b/modules/core/src/scripting/lumagl.ts index c92df621351..b3501274647 100644 --- a/modules/core/src/scripting/lumagl.ts +++ b/modules/core/src/scripting/lumagl.ts @@ -1,49 +1,8 @@ /** * Re-exported luma.gl API in the pre-built bundle - * Cherry-pick luma core exports that are relevant to deck + * TODO: Cherry-pick luma core exports that are relevant to deck */ -export { - // Core classes - Timeline, - // Geometries - Geometry, - ConeGeometry, - CubeGeometry, - CylinderGeometry, - IcoSphereGeometry, - PlaneGeometry, - SphereGeometry, - TruncatedConeGeometry -} from '@luma.gl/engine'; - -export {Model, BufferTransform, TextureTransform, PipelineFactory} from '@luma.gl/engine'; - -/* -export { - // Context utilities - instrumentGLContext, - isWebGL2, - FEATURES, - hasFeatures, - getGLParameters, - setGLParameters, - withGLParameters, - cssToDeviceRatio, - // Copy and blit - // These are needed by submodules and rely on using the same copy - // of Texture2D & Framebuffer - readPixelsToBuffer, - copyToTexture, - cloneTextureFrom, - // WebGL1 classes - Buffer, - Program, - Framebuffer, - Renderbuffer, - Texture2D, - TextureCube, - // WebGL2 classes - Texture3D, - TransformFeedback -} from '@luma.gl/webgl'; -*/ +export * from '@luma.gl/core'; +export * from '@luma.gl/engine'; +// @ts-ignore Module '@luma.gl/core' has already exported a member named 'AccessorObject' +export * from '@luma.gl/webgl'; diff --git a/modules/core/src/types/layer-props.ts b/modules/core/src/types/layer-props.ts index 359359c7a6b..5a8c82bda10 100644 --- a/modules/core/src/types/layer-props.ts +++ b/modules/core/src/types/layer-props.ts @@ -9,7 +9,7 @@ import type {MjolnirEvent} from 'mjolnir.js'; import type {Texture, TextureProps} from '@luma.gl/core'; import type {Buffer} from '@luma.gl/core'; import type {Loader} from '@loaders.gl/loader-utils'; -import type {LightingModuleSettings} from '../shaderlib'; +import type {LightingModuleSettings} from '../shaderlib/index'; export type LayerData = | Iterable diff --git a/modules/core/tsconfig.json b/modules/core/tsconfig.json index 0a9f4666e24..5ab893e6d77 100644 --- a/modules/core/tsconfig.json +++ b/modules/core/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ ] diff --git a/modules/extensions/bundle.ts b/modules/extensions/bundle.ts index d374999d9f1..99f3dd57507 100644 --- a/modules/extensions/bundle.ts +++ b/modules/extensions/bundle.ts @@ -1,3 +1,7 @@ export * from '../core/bundle/peer-dependency'; -export * from './src'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +/* eslint-disable import/no-extraneous-dependencies */ +export * from '@deck.gl/extensions'; diff --git a/modules/extensions/package.json b/modules/extensions/package.json index 6ce9361cb7f..5b07199e586 100644 --- a/modules/extensions/package.json +++ b/modules/extensions/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/extensions", "description": "Plug-and-play functionalities for deck.gl layers", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/extensions/tsconfig.json b/modules/extensions/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/extensions/tsconfig.json +++ b/modules/extensions/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/geo-layers/bundle.ts b/modules/geo-layers/bundle.ts index 0d69cdcf9a2..a4360923679 100644 --- a/modules/geo-layers/bundle.ts +++ b/modules/geo-layers/bundle.ts @@ -1,3 +1,7 @@ export * from '../layers/bundle/peer-dependency'; -export * from './src'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +/* eslint-disable import/no-extraneous-dependencies */ +export * from '@deck.gl/geo-layers'; diff --git a/modules/geo-layers/package.json b/modules/geo-layers/package.json index c5874a75b3e..56cf90db3c6 100644 --- a/modules/geo-layers/package.json +++ b/modules/geo-layers/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/geo-layers", "description": "deck.gl layers supporting geospatial use cases and GIS formats", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/geo-layers/src/index.ts b/modules/geo-layers/src/index.ts index 7e507a03243..83257efe268 100644 --- a/modules/geo-layers/src/index.ts +++ b/modules/geo-layers/src/index.ts @@ -50,9 +50,9 @@ export type {GeoCellLayerProps as _GeoCellLayerProps} from './geo-cell-layer/Geo // Tileset2D -export type {GeoBoundingBox, NonGeoBoundingBox} from './tileset-2d'; -export type {TileLoadProps as _TileLoadProps} from './tileset-2d'; +export type {GeoBoundingBox, NonGeoBoundingBox} from './tileset-2d/index'; +export type {TileLoadProps as _TileLoadProps} from './tileset-2d/index'; -export {getURLFromTemplate as _getURLFromTemplate} from './tileset-2d'; -export {Tileset2D as _Tileset2D} from './tileset-2d'; -export {Tile2DHeader as _Tile2DHeader} from './tileset-2d'; +export {getURLFromTemplate as _getURLFromTemplate} from './tileset-2d/index'; +export {Tileset2D as _Tileset2D} from './tileset-2d/index'; +export {Tile2DHeader as _Tile2DHeader} from './tileset-2d/index'; diff --git a/modules/geo-layers/src/mvt-layer/coordinate-transform.ts b/modules/geo-layers/src/mvt-layer/coordinate-transform.ts index 8309bbe4315..97140239c22 100644 --- a/modules/geo-layers/src/mvt-layer/coordinate-transform.ts +++ b/modules/geo-layers/src/mvt-layer/coordinate-transform.ts @@ -1,6 +1,6 @@ import {Viewport} from '@deck.gl/core'; import {lerp} from '@math.gl/core'; -import {GeoBoundingBox} from '../tileset-2d'; +import {GeoBoundingBox} from '../tileset-2d/index'; const availableTransformations = { Point, diff --git a/modules/geo-layers/src/mvt-layer/mvt-layer.ts b/modules/geo-layers/src/mvt-layer/mvt-layer.ts index cfffdd3f83c..7d7b5607597 100644 --- a/modules/geo-layers/src/mvt-layer/mvt-layer.ts +++ b/modules/geo-layers/src/mvt-layer/mvt-layer.ts @@ -25,7 +25,7 @@ import findIndexBinary from './find-index-binary'; import TileLayer, {TiledPickingInfo, TileLayerProps} from '../tile-layer/tile-layer'; -import type {Tileset2DProps, TileLoadProps, GeoBoundingBox} from '../tileset-2d'; +import type {Tileset2DProps, TileLoadProps, GeoBoundingBox} from '../tileset-2d/index'; import { urlType, Tileset2D, @@ -34,7 +34,7 @@ import { URLTemplate, isGeoBoundingBox, isURLTemplate -} from '../tileset-2d'; +} from '../tileset-2d/index'; const WORLD_SIZE = 512; diff --git a/modules/geo-layers/src/terrain-layer/terrain-layer.ts b/modules/geo-layers/src/terrain-layer/terrain-layer.ts index 18c3e766bbc..e56d08379dc 100644 --- a/modules/geo-layers/src/terrain-layer/terrain-layer.ts +++ b/modules/geo-layers/src/terrain-layer/terrain-layer.ts @@ -35,8 +35,8 @@ import {COORDINATE_SYSTEM} from '@deck.gl/core'; import type {MeshAttributes} from '@loaders.gl/schema'; import {TerrainWorkerLoader} from '@loaders.gl/terrain'; import TileLayer, {TileLayerProps} from '../tile-layer/tile-layer'; -import type {Bounds, GeoBoundingBox, TileBoundingBox, TileLoadProps, ZRange} from '../tileset-2d'; -import {Tile2DHeader, urlType, getURLFromTemplate, URLTemplate} from '../tileset-2d'; +import type {Bounds, GeoBoundingBox, TileBoundingBox, TileLoadProps, ZRange} from '../tileset-2d/index'; +import {Tile2DHeader, urlType, getURLFromTemplate, URLTemplate} from '../tileset-2d/index'; const DUMMY_DATA = [1]; diff --git a/modules/geo-layers/src/tile-layer/tile-layer.ts b/modules/geo-layers/src/tile-layer/tile-layer.ts index be67adf22e2..0a8f764cb2d 100644 --- a/modules/geo-layers/src/tile-layer/tile-layer.ts +++ b/modules/geo-layers/src/tile-layer/tile-layer.ts @@ -13,15 +13,15 @@ import { import {GeoJsonLayer} from '@deck.gl/layers'; import {LayersList} from '@deck.gl/core'; -import type {TileLoadProps, ZRange} from '../tileset-2d'; +import type {TileLoadProps, ZRange} from '../tileset-2d/index'; import { Tileset2D, Tile2DHeader, RefinementStrategy, STRATEGY_DEFAULT, Tileset2DProps -} from '../tileset-2d'; -import {urlType, URLTemplate, getURLFromTemplate} from '../tileset-2d'; +} from '../tileset-2d/index'; +import {urlType, URLTemplate, getURLFromTemplate} from '../tileset-2d/index'; const defaultProps: DefaultProps = { TilesetClass: Tileset2D, diff --git a/modules/geo-layers/tsconfig.json b/modules/geo-layers/tsconfig.json index 85b618fcb88..34f6066ba06 100644 --- a/modules/geo-layers/tsconfig.json +++ b/modules/geo-layers/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"}, diff --git a/modules/google-maps/package.json b/modules/google-maps/package.json index b9566ab1886..571f2faff03 100644 --- a/modules/google-maps/package.json +++ b/modules/google-maps/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/google-maps", "description": "Use deck.gl as a custom Google Maps overlay", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/google-maps/tsconfig.json b/modules/google-maps/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/google-maps/tsconfig.json +++ b/modules/google-maps/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/json/package.json b/modules/json/package.json index 395cb0d25d5..22fbaf79cf6 100644 --- a/modules/json/package.json +++ b/modules/json/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/json", "description": "JSON format rendering components for deck.gl", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/json/src/helpers/parse-expression-string.ts b/modules/json/src/helpers/parse-expression-string.ts index 184bcecbec3..f88ecef4c17 100644 --- a/modules/json/src/helpers/parse-expression-string.ts +++ b/modules/json/src/helpers/parse-expression-string.ts @@ -1,7 +1,8 @@ import {get} from '../utils/get'; // expression-eval: Small jsep based expression parser that supports array and object indexing -import {parse, eval as evaluate} from 'expression-eval'; +import * as expressionEval from 'expression-eval'; +const {parse, eval: evaluate} = expressionEval; const cachedExpressionMap = { '-': object => object diff --git a/modules/json/tsconfig.json b/modules/json/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/json/tsconfig.json +++ b/modules/json/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/jupyter-widget/tsconfig.json b/modules/jupyter-widget/tsconfig.json index 9f5039b800c..2daafba7d86 100644 --- a/modules/jupyter-widget/tsconfig.json +++ b/modules/jupyter-widget/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../aggregation-layers"}, diff --git a/modules/layers/bundle/index.ts b/modules/layers/bundle/index.ts index 9a67ab06a16..3424e1a3aad 100644 --- a/modules/layers/bundle/index.ts +++ b/modules/layers/bundle/index.ts @@ -1,3 +1,7 @@ export * from '../../core/bundle/peer-dependency'; -export * from '../src'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +/* eslint-disable import/no-extraneous-dependencies */ +export * from '@deck.gl/layers'; diff --git a/modules/layers/package.json b/modules/layers/package.json index 9192d4c4572..e9f8a3d1770 100644 --- a/modules/layers/package.json +++ b/modules/layers/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/layers", "description": "deck.gl core layers", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -15,13 +16,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/layers/tsconfig.json b/modules/layers/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/layers/tsconfig.json +++ b/modules/layers/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/main/package.json b/modules/main/package.json index 43edfbc32bd..0d497645cdc 100644 --- a/modules/main/package.json +++ b/modules/main/package.json @@ -2,6 +2,7 @@ "name": "deck.gl", "description": "A suite of 3D-enabled data visualization overlays, suitable for react-map-gl", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "keywords": [ "webgl", @@ -13,13 +14,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/main/tsconfig.json b/modules/main/tsconfig.json index e2f80eef82d..26f344c4d7b 100644 --- a/modules/main/tsconfig.json +++ b/modules/main/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../aggregation-layers"}, diff --git a/modules/mapbox/package.json b/modules/mapbox/package.json index 290b9fefb70..c1d42d922d8 100644 --- a/modules/mapbox/package.json +++ b/modules/mapbox/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/mapbox", "description": "Use deck.gl layers as custom mapbox-gl-js layers", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/mapbox/tsconfig.json b/modules/mapbox/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/mapbox/tsconfig.json +++ b/modules/mapbox/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/mesh-layers/bundle.ts b/modules/mesh-layers/bundle.ts index d374999d9f1..fdfa6c53332 100644 --- a/modules/mesh-layers/bundle.ts +++ b/modules/mesh-layers/bundle.ts @@ -1,3 +1,7 @@ export * from '../core/bundle/peer-dependency'; -export * from './src'; +// Import from package name instead of relative path +// This will be resolved to src or dist by esbuild depending on bundle settings +// dist has TS transformers applied +/* eslint-disable import/no-extraneous-dependencies */ +export * from '@deck.gl/mesh-layers'; diff --git a/modules/mesh-layers/package.json b/modules/mesh-layers/package.json index 0fa5350512b..4e214a57345 100644 --- a/modules/mesh-layers/package.json +++ b/modules/mesh-layers/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/mesh-layers", "description": "deck.gl layers that loads 3D meshes or scene graphs", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/mesh-layers/tsconfig.json b/modules/mesh-layers/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/mesh-layers/tsconfig.json +++ b/modules/mesh-layers/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/react/package.json b/modules/react/package.json index 765995fd064..258b68aeddc 100644 --- a/modules/react/package.json +++ b/modules/react/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/react", "description": "React Components for deck.gl", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,9 +17,16 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", diff --git a/modules/react/tsconfig.json b/modules/react/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/react/tsconfig.json +++ b/modules/react/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/test-utils/package.json b/modules/test-utils/package.json index 6bd8ab37f08..b952583f546 100644 --- a/modules/test-utils/package.json +++ b/modules/test-utils/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/test-utils", "description": "Test utilities for deck.gl layers", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,8 +17,16 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", diff --git a/modules/test-utils/tsconfig.json b/modules/test-utils/tsconfig.json index bba8aa1aa49..2a3fef31e6e 100644 --- a/modules/test-utils/tsconfig.json +++ b/modules/test-utils/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed" + "outDir": "dist" }, "references": [ {"path": "../core"} diff --git a/modules/widgets/package.json b/modules/widgets/package.json index 6eb91405aed..abd3883c945 100644 --- a/modules/widgets/package.json +++ b/modules/widgets/package.json @@ -2,6 +2,7 @@ "name": "@deck.gl/widgets", "description": "UI widgets for deck.gl", "license": "MIT", + "type": "module", "version": "9.0.0-beta.2", "publishConfig": { "access": "public" @@ -16,13 +17,19 @@ "type": "git", "url": "https://github.com/visgl/deck.gl.git" }, - "main": "dist/es5/index.js", - "module": "dist/esm/index.js", - "types": "typed/index.d.ts", + "types": "dist/index.d.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, "files": [ "dist", "src", - "typed", "dist.min.js" ], "sideEffects": false, diff --git a/modules/widgets/tsconfig.json b/modules/widgets/tsconfig.json index bc20ea93643..68570f857e3 100644 --- a/modules/widgets/tsconfig.json +++ b/modules/widgets/tsconfig.json @@ -5,10 +5,9 @@ "compilerOptions": { "composite": true, "rootDir": "src", - "outDir": "typed", - "jsx": "preserve", - "jsxFactory": "h", - "jsxFragmentFactory": "Fragment" + "outDir": "dist", + "jsx": "react-jsx", + "jsxImportSource": "preact" }, "references": [ {"path": "../core"} diff --git a/package.json b/package.json index 8d610a834f0..d787f67f3cb 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "description": "WebGL-powered visualization framework for large-scale datasets", "license": "MIT", "private": true, + "type": "module", "keywords": [ "webgl", "visualization", @@ -69,13 +70,10 @@ "@types/react": "^18.2.0", "abortcontroller-polyfill": "^1.5.0", "babel-loader": "^8.0.0", - "babel-plugin-inline-webgl-constants": "^1.0.3", - "babel-plugin-remove-glsl-comments": "^0.1.0", - "babel-preset-minify": "^0.5.0", "gl": "6.0.2", "glsl-transpiler": "^1.8.6", "jsdom": "^20.0.0", - "ocular-dev-tools": "2.0.0-alpha.20", + "ocular-dev-tools": "2.0.0-alpha.22", "pre-commit": "^1.2.2", "pre-push": "^0.1.1", "react": "^18.2.0", diff --git a/scripts/postinstall.sh b/scripts/postinstall.sh index 84e76fb4efa..95967f928cf 100755 --- a/scripts/postinstall.sh +++ b/scripts/postinstall.sh @@ -1,15 +1,4 @@ #!/bin/bash -# Add commonjs entry points to pure ESM modules. Needed by running node tests. -npx babel node_modules/@mapbox/tiny-sdf/index.js > node_modules/@mapbox/tiny-sdf/index.cjs - -cp node_modules/d3-array/dist/d3-array.js node_modules/d3-array/dist/d3-array.cjs -cp node_modules/d3-color/dist/d3-color.js node_modules/d3-color/dist/d3-color.cjs -cp node_modules/d3-format/dist/d3-format.js node_modules/d3-format/dist/d3-format.cjs -cp node_modules/d3-interpolate/dist/d3-interpolate.js node_modules/d3-interpolate/dist/d3-interpolate.cjs -cp node_modules/d3-scale/dist/d3-scale.js node_modules/d3-scale/dist/d3-scale.cjs -cp node_modules/d3-time/dist/d3-time.js node_modules/d3-time/dist/d3-time.cjs -cp node_modules/d3-time-format/dist/d3-time-format.js node_modules/d3-time-format/dist/d3-time-format.cjs - # hammerjs has a baked-in AMD template that breaks esbuild's module resolution. Disable AMD sed -i.bak 's/typeof define/undefined/' node_modules/hammerjs/hammer.js diff --git a/tsconfig.json b/tsconfig.json index 4a2207e1b7a..793b9e8744b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,7 @@ }, "compilerOptions": { "target": "es2022", + "module": "es2020", "jsx": "react", "strict": true, "noImplicitAny": false, diff --git a/tsconfig.module.json b/tsconfig.module.json index 0155320fcb7..ef37682d75c 100644 --- a/tsconfig.module.json +++ b/tsconfig.module.json @@ -3,15 +3,22 @@ "extends": "./tsconfig.json", "compilerOptions": { "build": true, - "target": "es2022", - "module": "commonjs", "esModuleInterop": true, "declaration": true, "declarationMap": true, "noEmit": false, - "emitDeclarationOnly": true, "useDefineForClassFields": false, // Uncomment to debug - // "listEmittedFiles": true + // "listEmittedFiles": true, + "plugins": [ + { + "transform": "ocular-dev-tools/ts-transform-version-inline" + }, + { + "transform": "ocular-dev-tools/ts-transform-append-extension", + "extensions": [".js", ".glsl.js"], + "after": true + } + ] } } diff --git a/yarn.lock b/yarn.lock index 20f9bce9409..1557eaf31af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2768,11 +2768,6 @@ resolved "https://registry.yarnpkg.com/@luma.gl/constants/-/constants-9.0.0-beta.1.tgz#cefe43279ab110d163aa6414057ff63bd15fc9b3" integrity sha512-iMDlB9nwym9a+x6uwAtSnL8iXpyYpSUDBH4+1znMi5UraKKy0zROtpVdDr1IrMT6NalbhVsSZDSOBu2yhpa8eA== -"@luma.gl/constants@^8.4.0": - version "8.4.0" - resolved "https://registry.yarnpkg.com/@luma.gl/constants/-/constants-8.4.0.tgz#07584e76fbb184f8b26d323b8d52e3a6c8815ce8" - integrity sha512-R4lW8nZ2Mon+62uOH6l1M7KlCMzxhr+J2cHuArK8KzvdUz/+oJU/GdII6AP9zvix3A0rpGRf5p0hpL2tnjzXGw== - "@luma.gl/core@9.0.0-beta.1": version "9.0.0-beta.1" resolved "https://registry.yarnpkg.com/@luma.gl/core/-/core-9.0.0-beta.1.tgz#b85e8ed716854caa2b0489f579517c63dcffa9fe" @@ -4259,41 +4254,6 @@ b4a@^1.6.4: resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.4.tgz#ef1c1422cae5ce6535ec191baeed7567443f36c9" integrity sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw== -babel-helper-evaluate-path@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" - integrity sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA== - -babel-helper-flip-expressions@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" - integrity sha1-NpZzahKKwYvCUlS19AoizrPB0/0= - -babel-helper-is-nodes-equiv@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" - integrity sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ= - -babel-helper-is-void-0@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" - integrity sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4= - -babel-helper-mark-eval-scopes@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" - integrity sha1-0kSjvvmESHJgP/tG4izorN9VFWI= - -babel-helper-remove-or-void@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" - integrity sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA= - -babel-helper-to-multiple-sequence-expressions@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" - integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== - babel-loader@8.2.2: version "8.2.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" @@ -4328,13 +4288,6 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-inline-webgl-constants@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/babel-plugin-inline-webgl-constants/-/babel-plugin-inline-webgl-constants-1.0.3.tgz#a6e6eef5fe5594a3371092c97c5ba6c8e2ae2b3a" - integrity sha512-zOR9vvd5XScQNmBbP7THPe4BTSB6TG480fKX8O/md97U21j4JwsDvdFGZYA7/mZxseKHlm+wdW07b2utydmu/A== - dependencies: - "@luma.gl/constants" "^8.4.0" - babel-plugin-istanbul@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" @@ -4346,82 +4299,6 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-minify-builtins@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" - integrity sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag== - -babel-plugin-minify-constant-folding@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e" - integrity sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ== - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-minify-dead-code-elimination@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz#1a0c68e44be30de4976ca69ffc535e08be13683f" - integrity sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-mark-eval-scopes "^0.4.3" - babel-helper-remove-or-void "^0.4.3" - lodash "^4.17.11" - -babel-plugin-minify-flip-comparisons@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" - integrity sha1-AMqHDLjxO0XAOLPB68DyJyk8llo= - dependencies: - babel-helper-is-void-0 "^0.4.3" - -babel-plugin-minify-guarded-expressions@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz#818960f64cc08aee9d6c75bec6da974c4d621135" - integrity sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-flip-expressions "^0.4.3" - -babel-plugin-minify-infinity@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" - integrity sha1-37h2obCKBldjhO8/kuZTumB7Oco= - -babel-plugin-minify-mangle-names@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz#bcddb507c91d2c99e138bd6b17a19c3c271e3fd3" - integrity sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw== - dependencies: - babel-helper-mark-eval-scopes "^0.4.3" - -babel-plugin-minify-numeric-literals@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" - integrity sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw= - -babel-plugin-minify-replace@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c" - integrity sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q== - -babel-plugin-minify-simplify@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz#f21613c8b95af3450a2ca71502fdbd91793c8d6a" - integrity sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-flip-expressions "^0.4.3" - babel-helper-is-nodes-equiv "^0.0.1" - babel-helper-to-multiple-sequence-expressions "^0.5.0" - -babel-plugin-minify-type-constructors@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" - integrity sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA= - dependencies: - babel-helper-is-void-0 "^0.4.3" - babel-plugin-polyfill-corejs2@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" @@ -4446,106 +4323,11 @@ babel-plugin-polyfill-regenerator@^0.2.2: dependencies: "@babel/helper-define-polyfill-provider" "^0.2.2" -babel-plugin-remove-glsl-comments@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-remove-glsl-comments/-/babel-plugin-remove-glsl-comments-0.1.0.tgz#97ab1d99a18f1a5943454ad6c57b67cde3e6df8e" - integrity sha512-+yuLcUG65OE2i/Pr5uwyV1f4yM1xo9l5MxZcxemhuhPsVuFWyPtEJ/hlHTTSsc+fS6gSTqXbPW+1J0Izx1HTRw== - dependencies: - minimatch "^3.0.0" - -babel-plugin-transform-inline-consecutive-adds@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" - integrity sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE= - -babel-plugin-transform-member-expression-literals@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" - integrity sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8= - -babel-plugin-transform-merge-sibling-variables@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" - integrity sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4= - -babel-plugin-transform-minify-booleans@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" - integrity sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg= - -babel-plugin-transform-property-literals@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" - integrity sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk= - dependencies: - esutils "^2.0.2" - -babel-plugin-transform-regexp-constructors@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" - integrity sha1-WLd3W2OvzzMyj66aX4j71PsLSWU= - -babel-plugin-transform-remove-console@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" - integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= - -babel-plugin-transform-remove-debugger@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" - integrity sha1-QrcnYxyXl44estGZp67IShgznvI= - -babel-plugin-transform-remove-undefined@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd" - integrity sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ== - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-transform-simplify-comparison-operators@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" - integrity sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk= - -babel-plugin-transform-undefined-to-void@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" - integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA= - babel-plugin-version-inline@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-version-inline/-/babel-plugin-version-inline-1.0.0.tgz#b99b6f925db4a4c6789eb08836e66d128dd5993f" integrity sha1-uZtvkl20pMZ4nrCINuZtEo3VmT8= -babel-preset-minify@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz#25f5d0bce36ec818be80338d0e594106e21eaa9f" - integrity sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg== - dependencies: - babel-plugin-minify-builtins "^0.5.0" - babel-plugin-minify-constant-folding "^0.5.0" - babel-plugin-minify-dead-code-elimination "^0.5.1" - babel-plugin-minify-flip-comparisons "^0.4.3" - babel-plugin-minify-guarded-expressions "^0.4.4" - babel-plugin-minify-infinity "^0.4.3" - babel-plugin-minify-mangle-names "^0.5.0" - babel-plugin-minify-numeric-literals "^0.4.3" - babel-plugin-minify-replace "^0.5.0" - babel-plugin-minify-simplify "^0.5.1" - babel-plugin-minify-type-constructors "^0.4.3" - babel-plugin-transform-inline-consecutive-adds "^0.4.3" - babel-plugin-transform-member-expression-literals "^6.9.4" - babel-plugin-transform-merge-sibling-variables "^6.9.4" - babel-plugin-transform-minify-booleans "^6.9.4" - babel-plugin-transform-property-literals "^6.9.4" - babel-plugin-transform-regexp-constructors "^0.4.3" - babel-plugin-transform-remove-console "^6.9.4" - babel-plugin-transform-remove-debugger "^6.9.4" - babel-plugin-transform-remove-undefined "^0.5.0" - babel-plugin-transform-simplify-comparison-operators "^6.9.4" - babel-plugin-transform-undefined-to-void "^6.9.4" - lodash "^4.17.11" - backbone@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/backbone/-/backbone-1.2.3.tgz#c22cfd07fc86ebbeae61d18929ed115e999d65b9" @@ -4954,7 +4736,7 @@ chalk@^2.0.0, chalk@^2.3.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.0.2: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -7480,6 +7262,15 @@ glob@~7.2.3: once "^1.3.0" path-is-absolute "^1.0.0" +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + global@~4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" @@ -7969,7 +7760,7 @@ ini@^1.3.2, ini@^1.3.4: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== -ini@~1.3.0: +ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== @@ -8972,7 +8763,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.2.1: +lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.2.1: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9381,7 +9172,7 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" -minimatch@^3.0.0, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -9423,6 +9214,11 @@ minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1. resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +minimist@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + minipass-collect@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" @@ -10109,10 +9905,10 @@ octokit-pagination-methods@^1.1.0: resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== -ocular-dev-tools@2.0.0-alpha.20: - version "2.0.0-alpha.20" - resolved "https://registry.yarnpkg.com/ocular-dev-tools/-/ocular-dev-tools-2.0.0-alpha.20.tgz#49834e7c18433b1afd5620438138524d7aad361a" - integrity sha512-JoEbE41G4WgU6iH+za+ub2qNZY9OP/NOgIVefQeq/W3zavXl/7Xcd2aTM6le+vVIaSmYdSO8WWnMR7TYOqTF6A== +ocular-dev-tools@2.0.0-alpha.22: + version "2.0.0-alpha.22" + resolved "https://registry.yarnpkg.com/ocular-dev-tools/-/ocular-dev-tools-2.0.0-alpha.22.tgz#a0b46c18c6085f93f9b3f115af60673bbba09717" + integrity sha512-nNP9ZbN7EuLm4MvcWiBvOocKv+BI/j/ZIFLkhNyuZvaoiyQrallQHzd4apD7cC0PjEFDUrAXnMz5PHkTnrEJtQ== dependencies: "@babel/cli" "^7.14.5" "@babel/core" "^7.14.5" @@ -10152,6 +9948,7 @@ ocular-dev-tools@2.0.0-alpha.20: tape "^4.11.0" tape-promise "^4.0.0" ts-node "~10.9.0" + ts-patch "^3.1.2" tsconfig-paths "^4.1.1" typescript "^5.2.2" url "^0.11.0" @@ -11437,7 +11234,7 @@ resolve@^1.14.2: is-core-module "^2.2.0" path-parse "^1.0.6" -resolve@^1.22.4: +resolve@^1.22.2, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -12731,6 +12528,18 @@ ts-node@~10.9.0: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +ts-patch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/ts-patch/-/ts-patch-3.1.2.tgz#9d4832eca34ed0b9eb1f8456cb00c941f50b442b" + integrity sha512-n58F5AqjUMdp9RAKq+E1YBkmONltPVbt1nN+wrmZXoYZek6QcvaTuqvKMhYhr5BxtC53kD/exxIPA1cP1RQxsA== + dependencies: + chalk "^4.1.2" + global-prefix "^3.0.0" + minimist "^1.2.8" + resolve "^1.22.2" + semver "^7.5.4" + strip-ansi "^6.0.1" + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" From 78bff65cecc2793fe4a9314d577ea40d56de95e2 Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Mon, 29 Jan 2024 16:05:18 -0800 Subject: [PATCH 2/2] fix lint --- .eslintrc.cjs | 3 ++- modules/core/src/index.ts | 9 ++++++++- modules/geo-layers/src/terrain-layer/terrain-layer.ts | 8 +++++++- tsconfig.build.json | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0bf6ef7735f..6942e63479b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -3,6 +3,7 @@ const {getESLintConfig} = require('ocular-dev-tools/configuration'); module.exports = getESLintConfig({ react: '18.0.0', overrides: { + parser: '', parserOptions: { project: ['./tsconfig.json'], ecmaVersion: 2020 @@ -41,7 +42,7 @@ module.exports = getESLintConfig({ overrides: [ { - files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'], + files: ['**/*.js', '**/*.ts', '**/*.tsx', '**/*.d.ts'], rules: { indent: 0, // For parquet module diff --git a/modules/core/src/index.ts b/modules/core/src/index.ts index 891e7606ba0..e145083d4ec 100644 --- a/modules/core/src/index.ts +++ b/modules/core/src/index.ts @@ -59,7 +59,14 @@ export {default as OrthographicViewport} from './viewports/orthographic-viewport export {default as FirstPersonViewport} from './viewports/first-person-viewport'; // Shader modules -export {picking, project, project32, gouraudLighting, phongLighting, shadow} from './shaderlib/index'; +export { + picking, + project, + project32, + gouraudLighting, + phongLighting, + shadow +} from './shaderlib/index'; export {default as View} from './views/view'; export {default as MapView} from './views/map-view'; diff --git a/modules/geo-layers/src/terrain-layer/terrain-layer.ts b/modules/geo-layers/src/terrain-layer/terrain-layer.ts index e56d08379dc..17606a377cd 100644 --- a/modules/geo-layers/src/terrain-layer/terrain-layer.ts +++ b/modules/geo-layers/src/terrain-layer/terrain-layer.ts @@ -35,7 +35,13 @@ import {COORDINATE_SYSTEM} from '@deck.gl/core'; import type {MeshAttributes} from '@loaders.gl/schema'; import {TerrainWorkerLoader} from '@loaders.gl/terrain'; import TileLayer, {TileLayerProps} from '../tile-layer/tile-layer'; -import type {Bounds, GeoBoundingBox, TileBoundingBox, TileLoadProps, ZRange} from '../tileset-2d/index'; +import type { + Bounds, + GeoBoundingBox, + TileBoundingBox, + TileLoadProps, + ZRange +} from '../tileset-2d/index'; import {Tile2DHeader, urlType, getURLFromTemplate, URLTemplate} from '../tileset-2d/index'; const DUMMY_DATA = [1]; diff --git a/tsconfig.build.json b/tsconfig.build.json index 289ba9a9d67..6447c56f2c9 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -13,7 +13,7 @@ {"path": "modules/extensions"}, {"path": "modules/geo-layers"}, {"path": "modules/google-maps"}, - // {"path": "modules/json"}, + {"path": "modules/json"}, // {"path": "modules/jupyter-widget"}, {"path": "modules/layers"}, {"path": "modules/main"},