Skip to content

Commit 9919dce

Browse files
committed
gh actions try 2
1 parent 4778aed commit 9919dce

14 files changed

+4515
-127
lines changed

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: 'main'
6+
7+
jobs:
8+
build_site:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4.1.1
13+
14+
# If you're using pnpm, add this step then change the commands and cache key below to use `pnpm`
15+
# - name: Install pnpm
16+
# uses: pnpm/action-setup@v2
17+
# with:
18+
# version: 8
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v4.0.0
22+
with:
23+
node-version: 21
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: build
30+
env:
31+
BASE_PATH: '/${{ github.event.repository.name }}'
32+
run: |
33+
npm run build
34+
35+
- name: Upload Artifacts
36+
uses: actions/upload-pages-artifact@v2
37+
with:
38+
# this should match the `pages` option in your adapter-static options
39+
path: 'build/'
40+
41+
deploy:
42+
needs: build_site
43+
runs-on: ubuntu-latest
44+
45+
permissions:
46+
pages: write
47+
id-token: write
48+
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
53+
steps:
54+
- name: Deploy
55+
id: deployment
56+
uses: actions/deploy-pages@v2.0.4

.nojekyll

Whitespace-only changes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"format": "prettier --write .",
1313
"test:integration": "playwright test",
1414
"test:unit": "vitest",
15-
"deploy": "pnpm build && pnpx gh-pages -d build -t true"
15+
"deploy": "gh-pages -d build -t true"
1616
},
1717
"devDependencies": {
1818
"@fontsource/fira-mono": "^4.5.10",

postcss.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
2-
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
5-
},
6-
}
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {}
5+
}
6+
};

src/routes/+layout.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import Header from './Header.svelte';
33
import logo from '$lib/images/svelte-logo.svg';
44
import './styles.css';
5+
import { base } from '$app/paths';
56
</script>
67

78
<div class="app">
@@ -11,13 +12,13 @@
1112
<!-- Sidebar -->
1213
<nav class="bg-gray-900 w-20 justify-between flex flex-col">
1314
<div class="mt-10 mb-10">
14-
<a href="/">
15+
<a href="{base}/">
1516
<img src={logo} class="rounded-full w-10 h-10 mb-3 mx-auto" />
1617
</a>
1718
<div class="mt-10">
1819
<ul>
1920
<li class="mb-6">
20-
<a href="/flow">
21+
<a href="{base}/flow">
2122
<span>
2223
<svg
2324
class="fill-current h-5 w-5 text-gray-300 mx-auto hover:text-green-500"
@@ -33,7 +34,7 @@
3334
</a>
3435
</li>
3536
<li>
36-
<a href="/dashboard">
37+
<a href="{base}/dashboard">
3738
<span>
3839
<svg
3940
class="fill-current h-5 w-5 text-gray-300 mx-auto hover:text-green-500"

src/routes/+layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This can be false if you're using a fallback (i.e. SPA mode)
22
export const prerender = true;
3-
export const ssr = false;
3+
export const ssr = false;

src/routes/flow/MaplibreNode.svelte

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
<script lang="ts">
2-
import { Handle, Position, type NodeProps } from "@xyflow/svelte";
3-
import { MapLibre } from "svelte-maplibre";
4-
type $$Props = NodeProps;
5-
export let data: $$Props["data"];
2+
import { Handle, Position, type NodeProps } from '@xyflow/svelte';
3+
import { MapLibre } from 'svelte-maplibre';
4+
type $$Props = NodeProps;
5+
export let data: $$Props['data'];
66
</script>
77

88
<div class="px-4 py-2 shadow-md rounded-md bg-white border-2 border-stone-400">
9-
<MapLibre
10-
center={[0, 0]}
11-
zoom={3}
12-
class="map"
13-
standardControls
14-
style="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
15-
/>
16-
<Handle
17-
type="target"
18-
position={Position.Top}
19-
class="w-16 !bg-teal-500 rounded-none border-none"
20-
on:connect
21-
on:connectend
22-
on:connectstart
23-
/>
24-
<Handle
25-
type="source"
26-
position={Position.Bottom}
27-
class="w-16 !bg-teal-500 rounded-none border-none"
28-
on:connect
29-
on:connectend
30-
on:connectstart
31-
/>
9+
<MapLibre
10+
center={[0, 0]}
11+
zoom={3}
12+
class="map"
13+
standardControls
14+
style="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
15+
/>
16+
<Handle
17+
type="target"
18+
position={Position.Top}
19+
class="w-16 !bg-teal-500 rounded-none border-none"
20+
on:connect
21+
on:connectend
22+
on:connectstart
23+
/>
24+
<Handle
25+
type="source"
26+
position={Position.Bottom}
27+
class="w-16 !bg-teal-500 rounded-none border-none"
28+
on:connect
29+
on:connectend
30+
on:connectstart
31+
/>
3232
</div>
3333

3434
<style>
35-
:global(.map) {
36-
height: 500px;
37-
width: 500px;
38-
}
35+
:global(.map) {
36+
height: 500px;
37+
width: 500px;
38+
}
3939
</style>

src/routes/flow/SliderNode.svelte

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,29 @@
11
<script lang="ts">
2-
import { Handle, Position, type NodeProps } from "@xyflow/svelte";
3-
import NodeWrapper from "./NodeWrapper.svelte";
4-
import type { NodeData } from "./nodes-and-edges";
2+
import { Handle, Position, type NodeProps } from '@xyflow/svelte';
3+
import NodeWrapper from './NodeWrapper.svelte';
4+
import type { NodeData } from './nodes-and-edges';
55
6-
type $$Props = NodeProps;
7-
export let data: NodeData;
8-
const { label, flowState } = data;
6+
type $$Props = NodeProps;
7+
export let data: NodeData;
8+
const { label, flowState } = data;
99
10-
let value = $flowState.zoom;
11-
$: {
12-
$flowState.zoom = value;
13-
}
10+
let value = $flowState.zoom;
11+
$: {
12+
$flowState.zoom = value;
13+
}
1414
15-
const min = 0;
16-
const max = 40;
15+
const min = 0;
16+
const max = 40;
1717
</script>
1818

1919
<NodeWrapper {label}>
20-
<Handle
21-
type="source"
22-
position={Position.Right}
23-
on:connect
24-
on:connectend
25-
on:connectstart
26-
/>
27-
<input
28-
class="nodrag accent-[#ff4000]"
29-
style="direction: rtl;"
30-
type="range"
31-
{min}
32-
{max}
33-
bind:value
34-
/>
20+
<Handle type="source" position={Position.Right} on:connect on:connectend on:connectstart />
21+
<input
22+
class="nodrag accent-[#ff4000]"
23+
style="direction: rtl;"
24+
type="range"
25+
{min}
26+
{max}
27+
bind:value
28+
/>
3529
</NodeWrapper>

src/routes/flow/nodes-and-edges.ts

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,51 @@
11
import type { Node, Edge } from '@xyflow/svelte';
22
import { writable, type Writable } from 'svelte/store';
33
export type FlowState = {
4-
color: string;
5-
zoom: number;
6-
shape: string;
4+
color: string;
5+
zoom: number;
6+
shape: string;
77
};
88
export type NodeData = {
9-
flowState: Writable<FlowState>;
10-
label: string;
9+
flowState: Writable<FlowState>;
10+
label: string;
1111
};
1212

13-
1413
const flowState = writable<FlowState>({
15-
color: '#ff4000',
16-
zoom: 17,
17-
shape: 'cube'
14+
color: '#ff4000',
15+
zoom: 17,
16+
shape: 'cube'
1817
});
1918

2019
export const initialNodes: Node[] = [
21-
{
22-
id: '1',
23-
type: 'custom',
24-
data: { name: 'Jane Doe', job: 'CEO', emoji: '😎' },
25-
position: { x: 0, y: 200 },
26-
dragHandle: '.custom-drag-area',
27-
style: 'resize: both;', // Additional styles if needed
28-
29-
},
30-
{
31-
id: '2',
32-
type: 'sliderzoomnode',
33-
position: { x: 40, y: 50 },
34-
data: {
35-
flowState,
36-
label: 'zoom level'
37-
},
38-
class: 'w-[150px]'
39-
}
20+
{
21+
id: '1',
22+
type: 'custom',
23+
data: { name: 'Jane Doe', job: 'CEO', emoji: '😎' },
24+
position: { x: 0, y: 200 },
25+
dragHandle: '.custom-drag-area',
26+
style: 'resize: both;' // Additional styles if needed
27+
},
28+
{
29+
id: '2',
30+
type: 'sliderzoomnode',
31+
position: { x: 40, y: 50 },
32+
data: {
33+
flowState,
34+
label: 'zoom level'
35+
},
36+
class: 'w-[150px]'
37+
}
4038
];
4139

4240
export const initialEdges: Edge[] = [
43-
{
44-
id: 'e1-2',
45-
source: '2',
46-
target: '1'
47-
},
48-
{
49-
id: 'e1-3',
50-
source: '1',
51-
target: '3'
52-
}
53-
];
41+
{
42+
id: 'e1-2',
43+
source: '2',
44+
target: '1'
45+
},
46+
{
47+
id: 'e1-3',
48+
source: '1',
49+
target: '3'
50+
}
51+
];

svelte.config.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,10 @@ const config = {
1414
adapter: adapter({
1515
// default options are shown. On some platforms
1616
// these options are set automatically — see below
17-
pages: 'build',
18-
assets: 'build',
19-
fallback: undefined,
20-
precompress: false,
21-
strict: true
2217
}),
2318
paths: {
24-
25-
base: process.env.NODE_ENV === 'production' ? '/dashflow' : '',
26-
19+
base: process.argv.includes('dev') ? '' : process.env.BASE_PATH
2720
}
28-
29-
3021
}
3122
};
3223

tailwind.config.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/** @type {import('tailwindcss').Config} */
22
export default {
3-
content: ['./src/**/*.{html,js,svelte,ts}'],
4-
theme: {
5-
extend: {},
6-
},
7-
plugins: [],
8-
}
9-
3+
content: ['./src/**/*.{html,js,svelte,ts}'],
4+
theme: {
5+
extend: {}
6+
},
7+
plugins: []
8+
};

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { sveltekit } from '@sveltejs/kit/vite';
22
import { defineConfig } from 'vitest/config';
33

44
export default defineConfig({
5+
base: '/dashflow',
56
plugins: [sveltekit()],
67
test: {
78
include: ['src/**/*.{test,spec}.{js,ts}']

0 commit comments

Comments
 (0)