Skip to content

Commit e8ca5a9

Browse files
committed
refactor: migrate example files to sandbox structure and update imports
1 parent aea9d53 commit e8ca5a9

23 files changed

+77
-57
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ jobs:
2424
with:
2525
bun-version: latest
2626

27+
- name: ♻️ Cache Bun dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.bun
31+
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-bun-
34+
2735
- name: 📦 Install dependencies
28-
run: bun install
36+
run: bun install --frozen-lockfile
2937

3038
- name: 🧑 Configure Git user
3139
run: |

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": ["@tracktor/biome-config-react"],
33
"files": {
4-
"includes": ["src/**", "!example/dist"]
4+
"includes": ["src/**", "sandbox/**", "vite.config.sandbox.ts", "vite.config.ts", "!dist-sandbox", "!sandbox/dist", "!dist"]
55
}
66
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
}
1717
},
1818
"scripts": {
19-
"example": "vite --config vite.config.example.ts",
19+
"sandbox": "vite --config vite.config.sandbox.ts",
20+
"dev:sandbox": "vite --config vite.config.sandbox.ts",
21+
"build:sandbox": "vite build --config vite.config.sandbox.ts",
22+
"deploy:sandbox": "bun run build:sandbox && cp dist-sandbox/index.html dist-sandbox/404.html && gh-pages -d dist-sandbox",
2023
"build": "bunx tsc && bunx vite build",
2124
"lint": "bunx biome check --diagnostic-level=error . && bunx tsc --noEmit --incremental",
2225
"lint:fix": "bunx biome check . --write",
2326
"prepublishOnly": "bun run build",
2427
"preview": "bunx vite preview",
25-
"release": "bun run build && bun publish --access example/public",
28+
"release": "bun run build && bun publish --access public",
2629
"version": "bunx standard-version",
2730
"prepare": "husky",
2831
"test": "bun test --preload ./test/setup.ts",
29-
"test:watch": "bun test --watch --preload ./test/setup.ts",
30-
"dev:example": "vite --config vite.config.example.ts",
31-
"build:example": "vite build --config vite.config.example.ts",
32-
"deploy:example": "bun run build:example && cp dist-example/index.html dist-example/404.html && gh-pages -d dist-example"
32+
"test:watch": "bun test --watch --preload ./test/setup.ts"
3333
},
3434
"files": [
3535
"dist"

example/App.tsx renamed to sandbox/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { ThemeProvider } from "@tracktor/design-system";
2-
import FeaturesExample from "example/FeaturesExample.tsx";
3-
import IsochroneExample from "example/IsochroneExample.tsx";
4-
import LandingPage from "example/LandingPage.tsx";
5-
import MarkersExample from "example/MarkersExample";
6-
import NearestMarkerExample from "example/NearestMarkerExample.tsx";
7-
import RouteExample from "example/RoutesExample";
82
import { useState } from "react";
93
import { Route, Routes } from "react-router-dom";
4+
import FeaturesExample from "sandbox/examples/FeaturesExample";
5+
import IsochroneExample from "sandbox/examples/IsochroneExample";
6+
import MarkersExample from "sandbox/examples/MarkersExample";
7+
import NearestMarkerExample from "sandbox/examples/NearestMarkerExample";
8+
import RouteExample from "sandbox/examples/RoutesExample";
9+
import LandingPage from "sandbox/features/LandingPage";
1010
import MapProvider from "@/context/MapProvider";
1111

1212
const App = () => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Box, Button, MenuItem, Select, Stack, Typography } from "@tracktor/design-system";
2-
import Navbar from "example/Navbar";
32
import type { Feature, FeatureCollection, LineString, Point, Polygon } from "geojson";
43
import { useCallback, useMemo, useState } from "react";
5-
import MarkerMap from "@/features/MarkerMap/MarkerMap";
4+
import Navbar from "sandbox/features/Navbar";
5+
import MarkerMap from "@/features/MarkerMap/MarkerMap.tsx";
66

77
const randomCoordInFrance = () => [2 + (Math.random() - 0.5) * 6, 46 + (Math.random() - 0.5) * 6];
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Box, Button, MenuItem, Select, Stack, Switch, Typography } from "@tracktor/design-system";
2-
import Navbar from "example/Navbar.tsx";
32
import { useEffect, useMemo, useState } from "react";
43
import type { ProjectionSpecification } from "react-map-gl";
4+
import Navbar from "sandbox/features/Navbar";
55
import MarkerMap from "@/features/MarkerMap/MarkerMap";
66
import type { RoutingProfile } from "@/services/core/interface";
7-
import isPointInGeoJSON from "@/utils/isPointInGeoJSON"; // ✅ ta version maison
7+
import isPointInGeoJSON from "@/utils/isPointInGeoJSON";
88

99
const predefinedOrigins = [
1010
{ coords: [2.3522, 48.8566], id: "paris", name: "Paris" },
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import {
1515
TextField,
1616
Typography,
1717
} from "@tracktor/design-system";
18-
import Navbar from "example/Navbar.tsx";
1918
import { useMemo, useState } from "react";
2019
import type { ProjectionSpecification } from "react-map-gl";
21-
import { VariantMarker, variantMarkerColor } from "@/components/Markers/Markers.tsx";
22-
import MarkerMap from "@/features/MarkerMap/MarkerMap.tsx";
20+
import Navbar from "sandbox/features/Navbar";
21+
import { VariantMarker, variantMarkerColor } from "@/components/Markers/Markers";
22+
import MarkerMap from "@/features/MarkerMap/MarkerMap";
2323
import { MarkerProps } from "@/types/MarkerProps";
2424

2525
const MAX_MARKERS = 1000;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import {
1313
Switch,
1414
Typography,
1515
} from "@tracktor/design-system";
16-
import Navbar from "example/Navbar.tsx";
1716
import { useMemo, useState } from "react";
1817
import type { ProjectionSpecification } from "react-map-gl";
18+
import Navbar from "sandbox/features/Navbar";
1919
import MarkerMap from "@/features/MarkerMap/MarkerMap";
20-
import { Engine } from "@/types/MarkerMapProps.ts";
20+
import { Engine } from "@/types/MarkerMapProps";
2121

2222
const predefinedOrigins = [
2323
{ coords: [2.3522, 48.8566], id: "origin-paris", name: "Paris (origin)" },
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Box, Button, MenuItem, Select, Stack, Switch, Typography } from "@tracktor/design-system";
2-
import Navbar from "example/Navbar.tsx";
32
import { useMemo, useState } from "react";
43
import type { ProjectionSpecification } from "react-map-gl";
4+
import Navbar from "sandbox/features/Navbar";
55
import MarkerMap from "@/features/MarkerMap/MarkerMap";
66

77
const predefinedRoutes = [
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import {
1111
TableRow,
1212
Typography,
1313
} from "@tracktor/design-system";
14-
import FeaturesPreview from "example/public/assets/features-preview.png";
15-
import IsochronePreview from "example/public/assets/isochrone-preview.png";
16-
import MarkerPreview from "example/public/assets/markers-preview.png";
17-
import NearestPreview from "example/public/assets/nearest-preview.png";
18-
import RoutePreview from "example/public/assets/route-preview.png";
1914
import type { PrismTheme } from "prism-react-renderer";
2015
import { Highlight } from "prism-react-renderer";
2116
import { useNavigate } from "react-router-dom";
17+
import FeaturesPreview from "sandbox/public/assets/features-preview.png";
18+
import IsochronePreview from "sandbox/public/assets/isochrone-preview.png";
19+
import MarkerPreview from "sandbox/public/assets/markers-preview.png";
20+
import NearestPreview from "sandbox/public/assets/nearest-preview.png";
21+
import RoutePreview from "sandbox/public/assets/route-preview.png";
2222

2323
const dracula: PrismTheme = {
2424
plain: {

0 commit comments

Comments
 (0)