Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

## 0.1

### 0.1.5

- feat: Update to deck.gl v9.1.8 (#77)
- feat: Update to `@carto/api-client` v0.4.9 (#77)
- chore(react): Begin adopting defaults for React Router v7 (#77)

### 0.1.4

- feat: Update to deck.gl version 9.1.0 (#66)
- feat: Update to deck.gl v9.1.0 (#66)

### 0.1.3

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.1.4",
"version": "0.1.5-alpha.0",
"packages": [
"packages/*"
],
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
"prepack": "yarn clean && yarn build"
},
"devDependencies": {
"@eslint/compat": "^1.2.6",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.20.0",
"@eslint/compat": "^1.2.7",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.23.0",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__eslintrc": "^2.1.2",
"@types/meow": "^6.0.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0",
"lerna": "^8.1.9",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"eslint-plugin-vue": "^9.33.0",
"globals": "^15.15.0",
"lerna": "^8.2.1",
"meow": "^13.2.0",
"prettier": "^3.4.2",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"typescript": "<5.6.0",
"typescript-eslint": "^8.24.0",
"vite": "^6.1.0"
"typescript-eslint": "^8.28.0",
"vite": "^6.2.4"
}
}
35 changes: 18 additions & 17 deletions packages/create-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-app-templates",
"author": "Don McCurdy <donmccurdy@carto.com>",
"license": "MIT",
"version": "0.1.4",
"version": "0.1.5-alpha.0",
"type": "module",
"bin": "./scripts/create.js",
"scripts": {
Expand All @@ -24,28 +24,29 @@
"@angular/platform-browser-dynamic": "^18.2.13",
"@angular/router": "^18.2.13",
"@auth0/auth0-angular": "^2.2.3",
"@carto/api-client": "^0.4.6",
"@carto/create-common": "^0.1.4",
"@deck.gl/aggregation-layers": "~9.1.0",
"@deck.gl/carto": "~9.1.0",
"@deck.gl/core": "~9.1.0",
"@deck.gl/extensions": "~9.1.0",
"@deck.gl/geo-layers": "~9.1.0",
"@deck.gl/json": "~9.1.0",
"@deck.gl/layers": "~9.1.0",
"@deck.gl/mesh-layers": "~9.1.0",
"@carto/api-client": "^0.4.9",
"@carto/create-common": "^0.1.5-alpha.0",
"@deck.gl/aggregation-layers": "~9.1.8",
"@deck.gl/carto": "~9.1.8",
"@deck.gl/core": "~9.1.8",
"@deck.gl/extensions": "~9.1.8",
"@deck.gl/geo-layers": "~9.1.8",
"@deck.gl/json": "~9.1.8",
"@deck.gl/layers": "~9.1.8",
"@deck.gl/mesh-layers": "~9.1.8",
"@loaders.gl/core": "^4.3.3",
"@luma.gl/core": "~9.1.1",
"@luma.gl/engine": "~9.1.1",
"@luma.gl/shadertools": "~9.1.1",
"@luma.gl/core": "~9.1.6",
"@luma.gl/engine": "~9.1.6",
"@luma.gl/shadertools": "~9.1.6",
"maplibre-gl": "^4.7.1",
"rxjs": "~7.8.1",
"meow": "^13.2.0",
"rxjs": "~7.8.2",
"tslib": "^2.8.1",
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.14",
"@angular/cli": "^18.2.14",
"@angular-devkit/build-angular": "^18.2.16",
"@angular/cli": "^18.2.16",
"@angular/compiler-cli": "^18.2.13",
"typescript": "<5.6.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
Filter,
FilterType,
WidgetSource,
WidgetSourceProps,
addFilter,
getFilter,
hasFilter,
Expand Down Expand Up @@ -79,7 +80,10 @@ import {
})
export class CategoryWidgetComponent {
/** Widget-compatible data source, from vectorTableSource, vectorQuerySource, etc. */
data = input.required<Promise<{ widgetSource: WidgetSource }>>();
data =
input.required<
Promise<{ widgetSource: WidgetSource<WidgetSourceProps> }>
>();
/** Column containing category names. */
column = input.required<string>();
/** Operation used to aggregate features in each category. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import {
numberFormatter,
WidgetStatus,
} from '../../../utils';
import { AggregationType, WidgetSource } from '@carto/api-client';
import {
AggregationType,
WidgetSource,
WidgetSourceProps,
} from '@carto/api-client';

/**
* Formula widget, displaying a prominent 'scorecard' number.
Expand All @@ -29,7 +33,10 @@ import { AggregationType, WidgetSource } from '@carto/api-client';
})
export class FormulaWidgetComponent {
/** Widget-compatible data source, from vectorTableSource, vectorQuerySource, etc. */
data = input.required<Promise<{ widgetSource: WidgetSource }>>();
data =
input.required<
Promise<{ widgetSource: WidgetSource<WidgetSourceProps> }>
>();
/** Column containing a value to be aggregated. */
column = input<string>();
/** Operation used to aggregate the specified column. */
Expand Down Expand Up @@ -64,7 +71,7 @@ export class FormulaWidgetComponent {
)
.then((response) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to type the response instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response type is known to be FormulaResponse, unfortunately we need the cast because the officially the response type can be null. I'm not sure it should be nullable so I have a TODO to try to change the type in the API client, rather than trying to do special null-handling in the template for now. :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Yeah, we should probably be more explicit with the response, otherwise casting it as a consumer feels a bit strange 👍

this.status.set('complete');
this.value.set(response.value);
this.value.set(response.value as number);
})
.catch(() => {
if (!abortController.signal.aborted) {
Expand Down
6 changes: 2 additions & 4 deletions packages/create-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@carto/create-common",
"packageManager": "yarn@4.2.2",
"author": "Don McCurdy <donmccurdy@carto.com>",
"version": "0.1.4",
"version": "0.1.5-alpha.0",
"license": "MIT",
"type": "module",
"sideEffects": false,
Expand Down Expand Up @@ -33,9 +33,7 @@
"scripts": {
"build": "microbundle --format cjs,modern --no-compress --target node --define VERSION=$npm_package_version",
"dev": "microbundle watch --format cjs,modern --no-compress --target node --define VERSION=$npm_package_version",
"dev:ssl": "yarn dev",
"prepack": "yarn build",
"prepublish": "yarn lint"
"dev:ssl": "yarn dev"
},
"dependencies": {
"glob": "^11.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const TEMPLATE_EXCLUDE_PATHS = [
];

/** List of dependencies in the template to be _removed_ from new projects. */
export const TEMPLATE_EXCLUDE_DEPS = ['@carto/create-common'];
export const TEMPLATE_EXCLUDE_DEPS = ['@carto/create-common', 'meow'];

/**
* List of package.json fields to clear from new projects.
Expand Down
39 changes: 20 additions & 19 deletions packages/create-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-app-templates",
"author": "Don McCurdy <donmccurdy@carto.com>",
"license": "MIT",
"version": "0.1.4",
"version": "0.1.5-alpha.0",
"type": "module",
"bin": "./scripts/create.js",
"scripts": {
Expand All @@ -15,35 +15,36 @@
},
"dependencies": {
"@auth0/auth0-react": "^2.3.0",
"@carto/api-client": "^0.4.6",
"@carto/create-common": "^0.1.4",
"@deck.gl/aggregation-layers": "~9.1.0",
"@deck.gl/carto": "~9.1.0",
"@deck.gl/core": "~9.1.0",
"@deck.gl/extensions": "~9.1.0",
"@deck.gl/geo-layers": "~9.1.0",
"@deck.gl/json": "~9.1.0",
"@deck.gl/layers": "~9.1.0",
"@deck.gl/mesh-layers": "~9.1.0",
"@deck.gl/react": "~9.1.0",
"@deck.gl/widgets": "~9.1.0",
"@carto/api-client": "^0.4.9",
"@carto/create-common": "^0.1.5-alpha.0",
"@deck.gl/aggregation-layers": "~9.1.8",
"@deck.gl/carto": "~9.1.8",
"@deck.gl/core": "~9.1.8",
"@deck.gl/extensions": "~9.1.8",
"@deck.gl/geo-layers": "~9.1.8",
"@deck.gl/json": "~9.1.8",
"@deck.gl/layers": "~9.1.8",
"@deck.gl/mesh-layers": "~9.1.8",
"@deck.gl/react": "~9.1.8",
"@deck.gl/widgets": "~9.1.8",
"@loaders.gl/core": "^4.3.3",
"@luma.gl/core": "~9.1.1",
"@luma.gl/engine": "~9.1.1",
"@luma.gl/shadertools": "~9.1.1",
"@luma.gl/core": "~9.1.6",
"@luma.gl/engine": "~9.1.6",
"@luma.gl/shadertools": "~9.1.6",
"maplibre-gl": "^4.7.1",
"meow": "^13.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-map-gl": "^7.1.9",
"react-router-dom": "^6.29.0"
"react-router-dom": "^6.30.0"
},
"devDependencies": {
"@types/react": "^18.3.18",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "<5.6.0",
"vite": "^6.1.0"
"vite": "^6.2.4"
},
"packageManager": "yarn@4.2.2",
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function App() {
scope: DEFAULT_APP_CONTEXT.oauth.scopes.join(' '),
}}
>
<RouterProvider router={router} />
<RouterProvider router={router} future={{ v7_startTransition: true }} />
</Auth0Provider>
</AppContext.Provider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
removeFilter,
getFilter,
hasFilter,
WidgetSourceProps,
} from '@carto/api-client';
import {
createSpatialFilter,
Expand All @@ -21,7 +22,7 @@ const { IN } = FilterType;

export interface CategoryWidgetProps {
/** Widget-compatible data source, from vectorTableSource, vectorQuerySource, etc. */
data: Promise<{ widgetSource: WidgetSource }>;
data: Promise<{ widgetSource: WidgetSource<WidgetSourceProps> }>;
/** Column containing category names. */
column: string;
/** Operation used to aggregate features in each category. */
Expand Down
10 changes: 7 additions & 3 deletions packages/create-react/src/components/widgets/FormulaWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { MapViewState } from '@deck.gl/core';
import { AggregationType, WidgetSource } from '@carto/api-client';
import {
AggregationType,
WidgetSource,
WidgetSourceProps,
} from '@carto/api-client';
import { useEffect, useState } from 'react';
import {
createSpatialFilter,
Expand All @@ -9,7 +13,7 @@ import {

export interface FormulaWidgetProps {
/** Widget-compatible data source, from vectorTableSource, vectorQuerySource, etc. */
data: Promise<{ widgetSource: WidgetSource }>;
data: Promise<{ widgetSource: WidgetSource<WidgetSourceProps> }>;
/** Column containing a value to be aggregated. */
column: string;
/** Operation used to aggregate the specified column. */
Expand Down Expand Up @@ -45,7 +49,7 @@ export function FormulaWidget({
}),
)
.then((response) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to type the response instead?

setValue(response.value);
setValue(response.value as number);
setStatus('complete');
})
.catch(() => {
Expand Down
4 changes: 3 additions & 1 deletion packages/create-react/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ export const routes: RouteObject[] = [
{ path: '*', element: <NotFoundView /> },
];

export const router = createBrowserRouter(routes);
export const router = createBrowserRouter(routes, {
future: { v7_relativeSplatPath: true },
});
37 changes: 19 additions & 18 deletions packages/create-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-app-templates",
"author": "Don McCurdy <donmccurdy@carto.com>",
"license": "MIT",
"version": "0.1.4",
"version": "0.1.5-alpha.0",
"type": "module",
"bin": "./scripts/create.js",
"scripts": {
Expand All @@ -15,31 +15,32 @@
},
"dependencies": {
"@auth0/auth0-vue": "^2.4.0",
"@carto/api-client": "^0.4.6",
"@carto/create-common": "^0.1.4",
"@deck.gl/aggregation-layers": "~9.1.0",
"@deck.gl/carto": "~9.1.0",
"@deck.gl/core": "~9.1.0",
"@deck.gl/extensions": "~9.1.0",
"@deck.gl/geo-layers": "~9.1.0",
"@deck.gl/json": "~9.1.0",
"@deck.gl/layers": "~9.1.0",
"@deck.gl/mesh-layers": "~9.1.0",
"@carto/api-client": "^0.4.9",
"@carto/create-common": "^0.1.5-alpha.0",
"@deck.gl/aggregation-layers": "~9.1.8",
"@deck.gl/carto": "~9.1.8",
"@deck.gl/core": "~9.1.8",
"@deck.gl/extensions": "~9.1.8",
"@deck.gl/geo-layers": "~9.1.8",
"@deck.gl/json": "~9.1.8",
"@deck.gl/layers": "~9.1.8",
"@deck.gl/mesh-layers": "~9.1.8",
"@loaders.gl/core": "^4.3.3",
"@luma.gl/core": "~9.1.1",
"@luma.gl/engine": "~9.1.1",
"@luma.gl/shadertools": "~9.1.1",
"@vueuse/core": "^12.5.0",
"@luma.gl/core": "~9.1.6",
"@luma.gl/engine": "~9.1.6",
"@luma.gl/shadertools": "~9.1.6",
"@vueuse/core": "^12.8.2",
"maplibre-gl": "^4.7.1",
"meow": "^13.2.0",
"vue": "^3.5.13",
"vue-router": "4.5.0"
},
"devDependencies": {
"@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue": "^5.2.3",
"typescript": "<5.6.0",
"vite": "^6.1.0",
"vue-tsc": "^2.2.0"
"vite": "^6.2.4",
"vue-tsc": "^2.2.8"
},
"packageManager": "yarn@4.2.2",
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77",
Expand Down
6 changes: 3 additions & 3 deletions packages/create-vue/src/components/views/PopulationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const MAP_STYLE =
'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json';

const INITIAL_VIEW_STATE: MapViewState = {
latitude: 37.0902,
longitude: -95.7129,
zoom: 3.5,
latitude: 31.8028,
longitude: -103.0078,
zoom: 2,
};

// TODO: Fetch domain/range from Widgets API?
Expand Down
Loading