Skip to content

Commit

Permalink
[Bug] Fix getSampleData util import (#1947)
Browse files Browse the repository at this point in the history
- import getSampleData from data-container-utils
- Add alias to webpack.confg.local
Signed-off-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
heshan0131 committed Aug 23, 2022
1 parent 4615c48 commit a98a015
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/demo-app/webpack.config.js
Expand Up @@ -74,7 +74,7 @@ const CONFIG = {
]
};

// This line enables bundling against src in this repo rather than installed deck.gl module
// This line enables bundling against src in this repo rather than installed kepler.gl module
module.exports = env => {
return env ? require('../webpack.config.local')(CONFIG, __dirname)(env) : CONFIG;
};
8 changes: 8 additions & 0 deletions examples/webpack.config.local.js
Expand Up @@ -64,6 +64,14 @@ function makeLocalDevConfig(env, EXAMPLE_DIR = LIB_DIR, externals = {}) {
const useLocalDeck = env.deck || env.hubble_src;
const useRepoDeck = env.deck_src;

// add kepler.gl submodule aliases
const workspaces = KeplerPackage.workspaces;
workspaces.forEach(workspace => {
// workspace = "./src/types", "./src/constants", etc
const moduleName = workspace.split('/').pop();
resolveAlias[`@kepler.gl/${moduleName}`] = join(SRC_DIR, `${moduleName}/src`);
});

// resolve deck.gl from local dir
if (useLocalDeck || useRepoDeck) {
// Load deck.gl from root node_modules
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -58,7 +58,7 @@
"start:web": "yarn install-and-start -- website start",
"start:https": "yarn install-and-start -- examples/demo-app start-local-https",
"start:e2e": "yarn install-and-start -- examples/demo-app start-local-e2e",
"build": "rm -fr dist && babel src/{actions,components,middleware,reducers,templates,cloud-providers,connect,localization,schemas,tasks} --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
"build": "rm -fr dist && babel src/{actions,components,middleware,reducers,cloud-providers,connect,localization,schemas,tasks} --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
"build:umd": "webpack --config ./webpack/umd.js --progress --env.prod",
"build:types": "tsc --project tsconfig.production.json",
"analyze": "yarn analyze:bundle",
Expand Down Expand Up @@ -359,4 +359,4 @@
"node": "12.22.12",
"yarn": "1.22.19"
}
}
}
3 changes: 2 additions & 1 deletion src/layers/src/base-layer.ts
Expand Up @@ -66,7 +66,8 @@ import {
} from '@kepler.gl/types';
import KeplerTable, {Datasets, GpuFilter} from 'reducers/table-utils/kepler-table';
import {DataContainerInterface} from 'reducers/table-utils/data-container-interface';
import {getLatLngBounds, getSampleData, isPlainObject, notNullorUndefined} from '@kepler.gl/utils';
import {getSampleData} from 'reducers/table-utils/data-container-utils';
import {getLatLngBounds, isPlainObject, notNullorUndefined} from '@kepler.gl/utils';

export type LayerColumn = {value: string | null; fieldIdx: number; optional?: boolean};

Expand Down

0 comments on commit a98a015

Please sign in to comment.