Skip to content

Commit 422c1b3

Browse files
authored
fix: Avoid Monaco AMD bundle when importing @kepler.gl/duckdb (#3255)
* chore: Split duckdb module export endpoints Signed-off-by: Ilya Boyandin <ilyabo@gmail.com> * fixing stub script paths for the example app to run Signed-off-by: Ilya Boyandin <ilyabo@gmail.com> * Addressed Copilot suggestion Signed-off-by: Ilya Boyandin <ilyabo@gmail.com> --------- Signed-off-by: Ilya Boyandin <ilyabo@gmail.com>
1 parent ed0db73 commit 422c1b3

5 files changed

Lines changed: 36 additions & 12 deletions

File tree

examples/demo-app/src/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
import {panelBorderColor, theme} from '@kepler.gl/styles';
2222
import {ParsedConfig} from '@kepler.gl/types';
2323
import {getApplicationConfig} from '@kepler.gl/utils';
24-
import {SqlPanel} from '@kepler.gl/duckdb';
24+
import {SqlPanel} from '@kepler.gl/duckdb/components';
2525
import Banner from './components/banner';
2626
import Announcement, {FormLink} from './components/announcement';
2727
import {replaceLoadDataModal} from './factories/load-data-modal';

src/duckdb/package.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66
"license": "MIT",
77
"main": "dist/index.js",
88
"types": "dist/index.d.ts",
9+
"exports": {
10+
".": {
11+
"types": "./dist/index.d.ts",
12+
"import": "./dist/index.js",
13+
"require": "./dist/index.js"
14+
},
15+
"./components": {
16+
"types": "./dist/components/index.d.ts",
17+
"import": "./dist/components/index.js",
18+
"require": "./dist/components/index.js"
19+
},
20+
"./table": {
21+
"types": "./dist/table/index.d.ts",
22+
"import": "./dist/table/index.js",
23+
"require": "./dist/table/index.js"
24+
}
25+
},
926
"keywords": [
1027
"duckdb"
1128
],
@@ -18,7 +35,7 @@
1835
"build:umd": "NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack/umd.js --progress --env.prod",
1936
"build:types": "tsc --project ./tsconfig.production.json",
2037
"prepublishOnly": "babel-node ../../scripts/license-header/bin --license ../../FILE-HEADER && yarn build && yarn build:types",
21-
"stab": "mkdir -p dist && touch dist/index.js"
38+
"stab": "mkdir -p dist/components dist/table && echo \"export * from '../src';\" > dist/index.js && echo \"export * from '../../src/components';\" > dist/components/index.js && echo \"export * from '../../src/table';\" > dist/table/index.js"
2239
},
2340
"files": [
2441
"dist",
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
// SPDX-License-Identifier: MIT
22
// Copyright contributors to the kepler.gl project
33

4-
export * from './sql-panel';
4+
export {SqlPanel} from './sql-panel';
5+
export {SchemaPanel, SchemaPanelDropMessage} from './schema-panel';
6+
export {PreviewDataPanel} from './preview-data-panel';
7+
export {Tree, DatasetNode, ColumnNode} from './tree';
8+
export {default as MonacoEditor} from './monaco-editor';
9+
10+
export type {SchemaSuggestion} from './schema-panel';
11+
export type {PreviewDataPanelProps, QueryResult, DataTableStyle} from './preview-data-panel';
12+
export type {TreeNodeData, TreeNodeProps, TreeProps} from './tree';

src/duckdb/src/index.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
// Copyright contributors to the kepler.gl project
33

44
export {DuckDBWasmAdapter} from './adapters/duckdb-wasm-adapter';
5-
export {SqlPanel} from './components';
6-
import {keplerGlDuckDBPlugin} from './plugin';
7-
export {restoreGeoarrowMetadata, KeplerGlDuckDbTable} from './table/duckdb-table';
5+
export {keplerGlDuckDBPlugin, keplerGlDuckDBPlugin as default} from './plugin';
6+
export * from './table/duckdb-table';
87
export * from './table/duckdb-table-utils';
9-
export default keplerGlDuckDBPlugin;
10-
export {
11-
consolidateFieldTypes,
12-
extendFieldsWithDuckDBColumnType,
13-
fieldTypeToColumnType
14-
} from './processors/data-processor';
8+
export * from './processors/data-processor';

src/duckdb/src/table/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
// Copyright contributors to the kepler.gl project
3+
4+
export * from './duckdb-table-utils';
5+

0 commit comments

Comments
 (0)