Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
[chore] check for required env variables in demo-app and output a warning (#2977)
Igor Dykhta11350eecbf10
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0506c703c..6568e06c9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -263,7 +263,7 @@ Ref: http://keepachangelog.com/en/0.3.0/- 1f9757b8 [feat] Pass in custom transformRequest function (#2534)- b644f203 [Fix] layer popover mapIndex (#2535)- 4b3c950f [fix] Fix sample maps (#2529)-- 55fb2426 [chore]] Update COC to OpenJS (#2496)+- 55fb2426 [chore] Update COC to OpenJS (#2496)- 0959de6a [Feat]Support Zoom to layer in layer panel (#2516)- ac0d3575 [Chore] docs: Add GeoArrow to supported formats (#2503)- 084d807f [Chore] Bump path-parse from 1.0.6 to 1.0.7 (#1569)diff --git a/examples/demo-app/esbuild.config.mjs b/examples/demo-app/esbuild.config.mjsindex dc9e193b6..1ae1c6e92 100644--- a/examples/demo-app/esbuild.config.mjs+++ b/examples/demo-app/esbuild.config.mjs@@ -52,6 +52,31 @@ const getThirdPartyLibraryAliases = useKeplerNodeModules => {};};+// Env variables required for demo app+const requiredEnvVariables = [+ 'MapboxAccessToken',+ 'DropboxClientId',+ 'MapboxExportToken',+ 'CartoClientId',+ 'FoursquareClientId',+ 'FoursquareDomain',+ 'FoursquareAPIURL',+ 'FoursquareUserMapsURL'+];++/**+ * Check for all required env variables to be present+ */+const checkEnvVariables = () => {+ const missingVars = requiredEnvVariables.filter(key => !process.env[key]);++ if (missingVars.length > 0) {+ console.warn(`⚠️ Warning: Missing environment variables: ${missingVars.join(', ')}`);+ } else {+ console.log('✅ All required environment variables are set.');+ }+};+const NODE_ENV = JSON.stringify(process.env.NODE_ENV || 'production');const config = {platform: 'browser',@@ -240,6 +265,9 @@ function openURL(url) {.catch(e => {console.error(e);process.exit(1);+ })+ .then(() => {+ checkEnvVariables();});}@@ -258,6 +286,8 @@ function openURL(url) {}}).then(async ctx => {+ checkEnvVariables();+await ctx.watch();await ctx.serve({servedir: 'dist',