@trackunit/iris-app 2.6.26-alpha-12adfed37e0.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## 2.7.0 (2026-09-17)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **iris-app:** SAGA-830 ship map setup guidance in generated workspaces ([c39be40f8e6](https://github.com/Trackunit/manager/commit/c39be40f8e6))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated iris-app-build-utilities to 2.4.56
|
|
10
|
+
- Updated iris-app-api to 2.6.4
|
|
11
|
+
- Updated react-vite-test-setup to 0.0.139
|
|
12
|
+
- Updated css-classname-utils to 0.0.47
|
|
13
|
+
- Updated react-graphql-tools to 1.17.36
|
|
14
|
+
- Updated shared-utils to 1.16.49
|
|
15
|
+
|
|
16
|
+
### ❤️ Thank You
|
|
17
|
+
|
|
18
|
+
- cameliaistrate
|
|
19
|
+
|
|
1
20
|
## 2.6.25 (2026-09-17)
|
|
2
21
|
|
|
3
22
|
### 🧱 Updated Dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"generators": "./generators.json",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"node": ">=24.x"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@trackunit/css-classname-utils": "0.0.47
|
|
13
|
+
"@trackunit/css-classname-utils": "0.0.47",
|
|
14
14
|
"@typescript-eslint/types": "8.58.1",
|
|
15
15
|
"@typescript-eslint/typescript-estree": "8.58.1",
|
|
16
16
|
"pacote": "^21.0.4",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@nx/react": "23.1.0",
|
|
27
27
|
"@npmcli/arborist": "^9.1.9",
|
|
28
28
|
"win-ca": "^3.5.1",
|
|
29
|
-
"@trackunit/iris-app-build-utilities": "2.4.56
|
|
30
|
-
"@trackunit/react-graphql-tools": "1.17.36
|
|
31
|
-
"@trackunit/shared-utils": "1.16.49
|
|
32
|
-
"@trackunit/iris-app-api": "2.6.4
|
|
29
|
+
"@trackunit/iris-app-build-utilities": "2.4.56",
|
|
30
|
+
"@trackunit/react-graphql-tools": "1.17.36",
|
|
31
|
+
"@trackunit/shared-utils": "1.16.49",
|
|
32
|
+
"@trackunit/iris-app-api": "2.6.4",
|
|
33
33
|
"tslib": "^2.6.2",
|
|
34
34
|
"@clack/prompts": "^1.0.0",
|
|
35
35
|
"@npm/types": "^1.0.2",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: set-up-react-map
|
|
3
|
+
description: >-
|
|
4
|
+
Builds a base map in a generated IrisX app with @trackunit/react-map and
|
|
5
|
+
Trackunit's public Google Maps or Mapbox adapter. Use when adding a greenfield
|
|
6
|
+
map or choosing and configuring a map provider. Not for legacy map migrations.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Set up react-map
|
|
10
|
+
|
|
11
|
+
Use `@trackunit/react-map` with one Trackunit adapter. Do not use `google.maps`, Mapbox JavaScript APIs, or adapter implementation dependencies directly in app code. Importing the required Mapbox stylesheet is the only `mapbox-gl` import allowed.
|
|
12
|
+
|
|
13
|
+
## Ensure a UI extension exists
|
|
14
|
+
|
|
15
|
+
An IrisX app needs a UI extension to render the map. If none exists, ask the user which extension point should contain it, then generate one:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx nx g @trackunit/iris-app:extend --name=<extension-name> --app=<app-name> --directory=<directory> --type=<extension-type>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Do not choose an extension point without user confirmation.
|
|
22
|
+
|
|
23
|
+
## Choose the provider
|
|
24
|
+
|
|
25
|
+
Before implementing, ask which adapter to use unless the request already names one:
|
|
26
|
+
|
|
27
|
+
- `@trackunit/react-map-adapter-google`: Google Maps is the provider currently used and supported by Trackunit. Use this by default when no preference is specified or the user asks for Trackunit's supported adapter.
|
|
28
|
+
- `@trackunit/react-map-adapter-mapbox`: use only when the user selects Mapbox. Trackunit does not have a Mapbox access token—that should be supplied by the user.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
Use the generated workspace's npm workflow. Install only the selected adapter.
|
|
33
|
+
|
|
34
|
+
Google:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @trackunit/react-map @trackunit/react-map-adapter-google
|
|
38
|
+
npm install --save-dev @types/google.maps
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Mapbox:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @trackunit/react-map @trackunit/react-map-adapter-mapbox
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then read the installed package READMEs for the current public API:
|
|
48
|
+
|
|
49
|
+
- [`@trackunit/react-map` README](../../../node_modules/@trackunit/react-map/README.md)
|
|
50
|
+
- [`@trackunit/react-map-adapter-google` README](../../../node_modules/@trackunit/react-map-adapter-google/README.md)
|
|
51
|
+
- [`@trackunit/react-map-adapter-mapbox` README](../../../node_modules/@trackunit/react-map-adapter-mapbox/README.md)
|
|
52
|
+
|
|
53
|
+
## Configure CSP
|
|
54
|
+
|
|
55
|
+
An empty `cspHeader` does not allow either provider by default. Spread the selected adapter's CSP contract in `iris-app-manifest.ts`.
|
|
56
|
+
|
|
57
|
+
Google:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import { googleMapCspDirectives } from "@trackunit/react-map-adapter-google";
|
|
61
|
+
|
|
62
|
+
const irisAppManifest = {
|
|
63
|
+
// Existing manifest fields
|
|
64
|
+
cspHeader: {
|
|
65
|
+
...googleMapCspDirectives(),
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Mapbox:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { mapboxMapCspDirectives } from "@trackunit/react-map-adapter-mapbox";
|
|
74
|
+
|
|
75
|
+
const irisAppManifest = {
|
|
76
|
+
// Existing manifest fields
|
|
77
|
+
cspHeader: {
|
|
78
|
+
...mapboxMapCspDirectives(),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If the manifest already declares the same directives, merge their arrays without removing adapter values. Custom Mapbox styles and tile sources may require additional origins. Stop and re-serve the app after changing its manifest.
|
|
84
|
+
|
|
85
|
+
## Render the base map
|
|
86
|
+
|
|
87
|
+
Ensure every map ancestor has a resolved height. Scaffold the selected adapter with an empty credential, then ask the user to provide it after the scaffold is ready. Do not introduce a credential-management dependency unless the user requests one; if they do, use a version compatible with the generated workspace.
|
|
88
|
+
|
|
89
|
+
Google:
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import { DefaultControls, useMap } from "@trackunit/react-map";
|
|
93
|
+
import { googleMapsAdapter } from "@trackunit/react-map-adapter-google";
|
|
94
|
+
|
|
95
|
+
const [Map, api] = useMap(googleMapsAdapter({ apiKey: "" }));
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Map aria-label="Map" className="h-full w-full">
|
|
99
|
+
<DefaultControls api={api} />
|
|
100
|
+
</Map>
|
|
101
|
+
);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Mapbox:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import "mapbox-gl/dist/mapbox-gl.css";
|
|
108
|
+
import { DefaultControls, useMap } from "@trackunit/react-map";
|
|
109
|
+
import { mapboxAdapter } from "@trackunit/react-map-adapter-mapbox";
|
|
110
|
+
|
|
111
|
+
const [Map, api] = useMap(mapboxAdapter({ accessToken: "" }));
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Map aria-label="Map" className="h-full w-full">
|
|
115
|
+
<DefaultControls api={api} />
|
|
116
|
+
</Map>
|
|
117
|
+
);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Import the Mapbox CSS once in the app entry when using Mapbox.
|
|
121
|
+
|
|
122
|
+
## Verify
|
|
123
|
+
|
|
124
|
+
1. Run `npx nx run <extension>:lint`, `test`, and `tsc-validate`.
|
|
125
|
+
2. Run `npx nx run <app>:build`.
|
|
126
|
+
3. Serve the app and enable **Use Local Apps** in Manager.
|
|
127
|
+
4. Verify tiles and provider attribution render on first load.
|
|
128
|
+
5. Check the browser console for CSP violations and credential errors.
|