Skip to content

Commit

Permalink
fix(deps): Avoid conflict between with version constants (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy authored Oct 3, 2024
1 parent 364fe6e commit 02c1ecc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"node >= 18"
],
"scripts": {
"build": "microbundle --format cjs,modern --no-compress --define VERSION=$npm_package_version",
"build:watch": "microbundle watch --format cjs,modern --no-compress --define VERSION=$npm_package_version",
"build": "microbundle --format cjs,modern --no-compress --define __CARTO_API_CLIENT_VERSION=$npm_package_version",
"build:watch": "microbundle watch --format cjs,modern --no-compress --define __CARTO_API_CLIENT_VERSION=$npm_package_version",
"dev": "concurrently \"yarn build:watch\" \"vite --config examples/vite.config.ts --open\"",
"test": "vitest run --typecheck",
"test:watch": "vitest watch --typecheck",
Expand Down
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/** Current version of @carto/api-client. */
export const API_CLIENT_VERSION = __CARTO_API_CLIENT_VERSION;

/**
* Defines a comparator used when matching a column's values against given filter values.
*
Expand Down
6 changes: 6 additions & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Injected by microbundle. The `@deck.gl/core` checkVersion()
* function will detect globally-defined 'VERSION' variables, and is inlined
* in the client bundle, so the 'VERSION' name should be avoided.
*/
declare const __CARTO_API_CLIENT_VERSION: string;
1 change: 0 additions & 1 deletion src/models/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {getClient} from '../client.js';
import {
ApiVersion,
DEFAULT_GEO_COLUMN,
Expand Down

0 comments on commit 02c1ecc

Please sign in to comment.