Skip to content

Commit

Permalink
chore: lib bundle improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Sep 3, 2024
1 parent 977dd20 commit 829cb0a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,17 @@ jobs:
run: yarn install

- name: Build
run: yarn build
run: yarn build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
16 changes: 7 additions & 9 deletions index.html → docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:description" content="Show all cluster's points in one HTML element" />
<title>MapLibre GL Teritorio Cluster</title>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css">
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/maplibre-gl.css">
</head>

<body style="margin: 0; padding: 0;">
<div id="map" style="height: 100vh;"></div>

<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script type="module">
import { Map, NavigationControl, Marker } from "maplibre-gl"
import { TeritorioCluster } from './src'
import { buildCss, unfoldedClusterRenderCircle as unfoldedClusterRender } from './src/utils/helpers'
import { TeritorioCluster } from '../src'
import { buildCss, unfoldedClusterRenderCircle as unfoldedClusterRender } from '../src/utils/helpers'

const map = new Map({
const map = new maplibregl.Map({
hash: true,
container: "map",
style: 'https://api.maptiler.com/maps/openstreetmap/style.json?key=GIAfARJO9HDgKceZRlGv'
});

map.addControl(new NavigationControl());
map.addControl(new maplibregl.NavigationControl());

map.on('load', async () => {
let geojson = await fetch('https://maplibre.org/maplibre-gl-js/docs/assets/earthquakes.geojson', { method: 'GET' }).then(res => res.json())
Expand Down Expand Up @@ -89,7 +87,7 @@
})

const pinMarkerRender = (coords, offset) => {
return new Marker({
return new maplibregl.Marker({
scale: 1.3,
color: '#f44336',
anchor: 'bottom'
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"node": ">=10"
},
"scripts": {
"dev": "vite",
"dev": "vite serve docs",
"start": "tsdx watch",
"build": "tsdx build",
"prepare": "tsdx build"
},
"module": "dist/maplibre-gl-teritorio-cluster.esm.js",
"module": "./dist/maplibre-gl-teritorio-cluster.esm.js",
"devDependencies": {
"tsdx": "^0.14.1",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
"vite": "^5.4.0"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].1",
"dependencies": {
"maplibre-gl": "^4.0.0"
}
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import { TeritorioCluster } from "./teritorioCluster";

export { TeritorioCluster }
export { TeritorioCluster } from "./teritorio-cluster";
export { buildCss, unfoldedClusterRenderCircle } from "./utils/helpers";
File renamed without changes.

0 comments on commit 829cb0a

Please sign in to comment.