Compare commits
8 Commits
ebc7ebc229
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
8c2fbeae31
|
|||
|
89052635d5
|
|||
|
e52a210840
|
|||
|
8baf017171
|
|||
|
d3f6747116
|
|||
|
f08784598d
|
|||
|
9201cb6f23
|
|||
|
f9223c2852
|
@@ -7,62 +7,194 @@ when:
|
||||
- event: manual
|
||||
|
||||
steps:
|
||||
install:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@latest --activate
|
||||
- pnpm install --frozen-lockfile
|
||||
- name: install
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@latest --activate
|
||||
- pnpm install --frozen-lockfile
|
||||
|
||||
lint:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run lint
|
||||
depends_on:
|
||||
- install
|
||||
- name: lint
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run lint
|
||||
depends_on:
|
||||
- install
|
||||
|
||||
check:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run check
|
||||
depends_on:
|
||||
- lint
|
||||
- name: Send Lint Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Lint failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- lint
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
test:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run test:run
|
||||
depends_on:
|
||||
- check
|
||||
- name: check
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run check
|
||||
depends_on:
|
||||
- lint
|
||||
|
||||
build:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run build
|
||||
depends_on:
|
||||
- test
|
||||
- name: Send Svelte Check Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Svelte Check failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- check
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
build-full:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends ca-certificates libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 libnss3 libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2
|
||||
- rm -rf /var/lib/apt/lists/*
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run critical-css:install
|
||||
- pnpm run build:full
|
||||
depends_on:
|
||||
- build
|
||||
- name: Unit Tests
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run test:run
|
||||
depends_on:
|
||||
- check
|
||||
|
||||
e2e:
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm exec playwright install chromium --with-deps
|
||||
- pnpm run test:e2e
|
||||
depends_on:
|
||||
- build
|
||||
- name: Send Test Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Test failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Unit Tests
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
- name: build
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run build
|
||||
depends_on:
|
||||
- Unit Tests
|
||||
|
||||
- name: Send Build Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Build failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- build
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
- name: build-full
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends ca-certificates libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 libnss3 libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2
|
||||
- rm -rf /var/lib/apt/lists/*
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm run critical-css:install
|
||||
- pnpm run build:full
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
- name: Send Build Full Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Build Full failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- build-full
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
- name: E2E Tests
|
||||
image: node:22-bookworm-slim
|
||||
commands:
|
||||
- corepack enable && corepack prepare pnpm@latest --activate
|
||||
- pnpm exec playwright install chromium --with-deps
|
||||
- pnpm run test:e2e
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
- name: Send E2E Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] E2E failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- E2E Tests
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
- name: Send CI Pipeline Status Notification (success)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_tests_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] CI pipeline success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- install
|
||||
- lint
|
||||
- check
|
||||
- Unit Tests
|
||||
- build
|
||||
- build-full
|
||||
- E2E Tests
|
||||
when:
|
||||
- status: [success]
|
||||
|
||||
@@ -48,12 +48,16 @@ steps:
|
||||
- name: Send Docker Image Build Status Notification (success)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
DISCORD_WEBHOOK_URL:
|
||||
from_secret: discord_webhook_url
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Docker image build success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Docker image build success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Docker image build
|
||||
when:
|
||||
@@ -62,12 +66,16 @@ steps:
|
||||
- name: Send Docker Image Build Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
DISCORD_WEBHOOK_URL:
|
||||
from_secret: discord_webhook_url
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Docker image build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Docker image build failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Docker image build
|
||||
when:
|
||||
@@ -103,12 +111,16 @@ steps:
|
||||
- name: Send Push to Registry Status Notification (success)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
DISCORD_WEBHOOK_URL:
|
||||
from_secret: discord_webhook_url
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Push to registry success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Push to registry
|
||||
when:
|
||||
@@ -117,12 +129,16 @@ steps:
|
||||
- name: Send Push to Registry Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
DISCORD_WEBHOOK_URL:
|
||||
from_secret: discord_webhook_url
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Push to registry failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Push to registry
|
||||
when:
|
||||
@@ -151,12 +167,16 @@ steps:
|
||||
- name: Send Deploy Status Notification (success)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
DISCORD_WEBHOOK_URL:
|
||||
from_secret: discord_webhook_url
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Trigger Portainer stack redeploy
|
||||
when:
|
||||
@@ -165,12 +185,16 @@ steps:
|
||||
- name: Send Deploy Status Notification (failure)
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
DISCORD_WEBHOOK_URL:
|
||||
from_secret: discord_webhook_url
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||
depends_on:
|
||||
- Trigger Portainer stack redeploy
|
||||
when:
|
||||
|
||||
@@ -17,7 +17,7 @@ services:
|
||||
- 'traefik.http.routers.mifi-dev.rule=Host(`mifi.dev`) || Host(`www.mifi.dev`)'
|
||||
- 'traefik.http.routers.mifi-dev.entrypoints=websecure'
|
||||
- 'traefik.http.routers.mifi-dev.service=mifi-dev'
|
||||
- 'traefik.http.routers.mifi-dev.middlewares=security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||
- 'traefik.http.routers.mifi-dev.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||
- 'traefik.http.routers.mifi-dev.tls=true'
|
||||
- 'traefik.http.routers.mifi-dev.tls.certresolver=letsencrypt'
|
||||
- 'traefik.http.services.mifi-dev.loadbalancer.server.port=80'
|
||||
@@ -25,7 +25,7 @@ services:
|
||||
- 'traefik.http.routers.mifi-bio.rule=Host(`mifi.bio`) || Host(`www.mifi.bio`)'
|
||||
- 'traefik.http.routers.mifi-bio.entrypoints=websecure'
|
||||
- 'traefik.http.routers.mifi-bio.service=mifi-bio'
|
||||
- 'traefik.http.routers.mifi-bio.middlewares=security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||
- 'traefik.http.routers.mifi-bio.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||
- 'traefik.http.routers.mifi-bio.tls=true'
|
||||
- 'traefik.http.routers.mifi-bio.tls.certresolver=letsencrypt'
|
||||
- 'traefik.http.services.mifi-bio.loadbalancer.server.port=80'
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-describedby={link.description ? descriptionId : undefined}
|
||||
data-umami-event="contact panel item"
|
||||
data-umami-event-label={link.label}
|
||||
>
|
||||
{#if link.icon}
|
||||
<LinkIcon href={link.href} icon={link.icon} label={link.label} />
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
contactOpen = true;
|
||||
shareOpen = false;
|
||||
}}
|
||||
data-umami-event="header button"
|
||||
data-umami-event-label="contact"
|
||||
>
|
||||
<IconContact size={20} />
|
||||
</button>
|
||||
@@ -47,6 +49,8 @@
|
||||
shareOpen = true;
|
||||
contactOpen = false;
|
||||
}}
|
||||
data-umami-event="header button"
|
||||
data-umami-event-label="share"
|
||||
>
|
||||
<IconShare size={20} />
|
||||
</button>
|
||||
@@ -98,6 +102,8 @@
|
||||
contactOpen = true;
|
||||
shareOpen = false;
|
||||
}}
|
||||
data-umami-event="hero card button"
|
||||
data-umami-event-label="contact"
|
||||
>
|
||||
<IconContact size={20} />
|
||||
<span>Contact</span>
|
||||
@@ -111,6 +117,8 @@
|
||||
shareOpen = true;
|
||||
contactOpen = false;
|
||||
}}
|
||||
data-umami-event="hero card button"
|
||||
data-umami-event-label="share"
|
||||
>
|
||||
<IconShare size={20} />
|
||||
<span>Share</span>
|
||||
|
||||
@@ -5,7 +5,14 @@
|
||||
let { href, icon, label, description }: ProcessedLink = $props();
|
||||
</script>
|
||||
|
||||
<a {href} rel="noopener noreferrer" target="_blank" class="link">
|
||||
<a
|
||||
{href}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
class="link"
|
||||
data-umami-event={`link click`}
|
||||
data-umami-event-label={label}
|
||||
>
|
||||
<span class="icon" aria-hidden="true">
|
||||
<LinkIcon {href} {icon} {label} />
|
||||
</span>
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
aria-label="Close"
|
||||
bind:this={closeBtnEl}
|
||||
onclick={onclose}
|
||||
data-umami-event="panel button"
|
||||
data-umami-event-label="close"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
||||
@@ -57,7 +57,13 @@
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<button type="button" class="panel-btn" onclick={copyLink}>
|
||||
<button
|
||||
type="button"
|
||||
class="panel-btn"
|
||||
onclick={copyLink}
|
||||
data-umami-event="share panel item"
|
||||
data-umami-event-label="copy"
|
||||
>
|
||||
<IconCopy size={20} />
|
||||
{copied ? 'Copied!' : 'Copy link'}
|
||||
</button>
|
||||
@@ -67,12 +73,20 @@
|
||||
onclick={onclose}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
data-umami-event="share panel item"
|
||||
data-umami-event-label="email"
|
||||
>
|
||||
<IconEmail size={20} />
|
||||
Email link
|
||||
</a>
|
||||
{#if canShare}
|
||||
<button type="button" class="panel-btn" onclick={share}>
|
||||
<button
|
||||
type="button"
|
||||
class="panel-btn"
|
||||
onclick={share}
|
||||
data-umami-event="share panel item"
|
||||
data-umami-event-label="device share"
|
||||
>
|
||||
<IconShare size={20} />
|
||||
Share…
|
||||
</button>
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
aria-label="Close theme menu"
|
||||
tabindex="-1"
|
||||
onclick={() => (expanded = false)}
|
||||
data-umami-event="theme toggle button"
|
||||
data-umami-event-label="close"
|
||||
></button>
|
||||
{/if}
|
||||
|
||||
@@ -64,6 +66,8 @@
|
||||
aria-current={current === 'light' ? 'true' : undefined}
|
||||
title="Light"
|
||||
onclick={() => handleClick('light')}
|
||||
data-umami-event="theme toggle button"
|
||||
data-umami-event-label="light"
|
||||
>
|
||||
<Sun size={24} />
|
||||
</button>
|
||||
@@ -75,6 +79,8 @@
|
||||
aria-current={current === 'dark' ? 'true' : undefined}
|
||||
title="Dark"
|
||||
onclick={() => handleClick('dark')}
|
||||
data-umami-event="theme toggle button"
|
||||
data-umami-event-label="dark"
|
||||
>
|
||||
<Moon size={24} />
|
||||
</button>
|
||||
@@ -86,6 +92,8 @@
|
||||
aria-current={current === 'auto' ? 'true' : undefined}
|
||||
title="Auto (system)"
|
||||
onclick={() => handleClick('auto')}
|
||||
data-umami-event="theme toggle button"
|
||||
data-umami-event-label="auto"
|
||||
>
|
||||
<SunMoon size={24} />
|
||||
</button>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* App config: own-property hostnames for UTM attribution, variant hostnames, GA IDs.
|
||||
*/
|
||||
|
||||
import { ContentVariant } from './data/constants';
|
||||
|
||||
export const OWN_PROPERTY_HOSTS = [
|
||||
'mifi.ventures',
|
||||
'cal.mifi.ventures',
|
||||
@@ -9,20 +11,25 @@ export const OWN_PROPERTY_HOSTS = [
|
||||
'mifi.bio',
|
||||
] as const;
|
||||
|
||||
export const VARIANT_HOSTS: Record<'dev' | 'bio', string> = {
|
||||
dev: 'mifi.dev',
|
||||
bio: 'mifi.bio',
|
||||
export const VARIANT_HOSTS: Record<ContentVariant, string> = {
|
||||
[ContentVariant.DEV]: 'mifi.dev',
|
||||
[ContentVariant.BIO]: 'mifi.bio',
|
||||
};
|
||||
|
||||
export const GA_MEASUREMENT_IDS: Record<'dev' | 'bio', string> = {
|
||||
dev: 'G-P8V832WDM8',
|
||||
bio: 'G-885B0KYWZ1',
|
||||
export const GA_MEASUREMENT_IDS: Record<ContentVariant, string> = {
|
||||
[ContentVariant.DEV]: 'G-P8V832WDM8',
|
||||
[ContentVariant.BIO]: 'G-885B0KYWZ1',
|
||||
};
|
||||
|
||||
export const UMAMI_MEASUREMENT_IDS: Record<ContentVariant, string> = {
|
||||
[ContentVariant.DEV]: 'ac7e751b-4ce3-49f2-80e0-f430b292b72a',
|
||||
[ContentVariant.BIO]: 'cf44669d-10c1-4982-ad79-282aed4237e5',
|
||||
};
|
||||
|
||||
/** theme-color meta values per variant (match tokens-{variant}.css --color-bg) */
|
||||
export const THEME_COLORS: Record<'dev' | 'bio', { light: string; dark: string }> = {
|
||||
dev: { light: '#f5f4f8', dark: '#131118' }, // hsl(260 20% 98%) / hsl(260 18% 8%)
|
||||
bio: { light: '#f4f6f9', dark: '#111318' }, // hsl(220 22% 98%) / hsl(220 18% 8%)
|
||||
export const THEME_COLORS: Record<ContentVariant, { light: string; dark: string }> = {
|
||||
[ContentVariant.DEV]: { light: '#f5f4f8', dark: '#131118' }, // hsl(260 20% 98%) / hsl(260 18% 8%)
|
||||
[ContentVariant.BIO]: { light: '#f4f6f9', dark: '#111318' }, // hsl(220 22% 98%) / hsl(220 18% 8%)
|
||||
};
|
||||
|
||||
export const UTM_MEDIUM = 'link';
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import contentData from '$lib/data/links.json';
|
||||
import { VARIANT_HOSTS, GA_MEASUREMENT_IDS, THEME_COLORS } from '$lib/config';
|
||||
import {
|
||||
VARIANT_HOSTS,
|
||||
GA_MEASUREMENT_IDS,
|
||||
THEME_COLORS,
|
||||
UMAMI_MEASUREMENT_IDS,
|
||||
} from '$lib/config';
|
||||
import type { Site, ContentData, ProcessedLink } from '$lib/data/types';
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
import { ContentVariant, HeroLayout } from '$lib/data/constants';
|
||||
@@ -18,6 +23,7 @@ export type LayoutServerDataOut = {
|
||||
};
|
||||
variant: string;
|
||||
gaMeasurementId: string;
|
||||
umamiMeasurementId: string;
|
||||
/** theme-color meta values for current variant */
|
||||
themeColorLight: string;
|
||||
themeColorDark: string;
|
||||
@@ -67,6 +73,7 @@ export const load: LayoutServerLoad<LayoutServerDataOut> = (): LayoutServerDataO
|
||||
links: { sections },
|
||||
variant,
|
||||
gaMeasurementId: GA_MEASUREMENT_IDS[variant],
|
||||
umamiMeasurementId: UMAMI_MEASUREMENT_IDS[variant],
|
||||
themeColorLight: themeColors.light,
|
||||
themeColorDark: themeColors.dark,
|
||||
};
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
<!-- Google tag (gtag.js): ID passed via data-ga-id for CSP (no inline script) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={data.gaMeasurementId}"></script>
|
||||
<script defer src="/assets/js/ga-init.js" data-ga-id={data.gaMeasurementId}></script>
|
||||
<script
|
||||
defer
|
||||
src="https://analytics.mifi.holdings/script.js"
|
||||
data-website-id={data.umamiMeasurementId}
|
||||
></script>
|
||||
|
||||
<link rel="stylesheet" href="/assets/tokens-{data.variant}.css" />
|
||||
|
||||
@@ -94,3 +99,11 @@
|
||||
</header>
|
||||
{@render children()}
|
||||
<Footer />
|
||||
<img
|
||||
src="https://analytics.mifi.holdings/p/wQ9GYnLIg"
|
||||
alt=""
|
||||
width="1"
|
||||
height="1"
|
||||
role="presentation"
|
||||
loading="eager"
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import { load } from '../+layout.server';
|
||||
import { UMAMI_MEASUREMENT_IDS } from '$lib/config';
|
||||
import { ContentVariant } from '$lib/data/constants';
|
||||
import type { ContentData } from '$lib/data/types';
|
||||
|
||||
@@ -95,7 +96,9 @@ describe('+layout.server', () => {
|
||||
it('gaMeasurementId matches variant', () => {
|
||||
process.env.CONTENT_VARIANT = ContentVariant.DEV;
|
||||
expect(load().gaMeasurementId).toMatch(/^G-/);
|
||||
expect(load().umamiMeasurementId).toBe(UMAMI_MEASUREMENT_IDS[ContentVariant.DEV]);
|
||||
process.env.CONTENT_VARIANT = ContentVariant.BIO;
|
||||
expect(load().gaMeasurementId).toMatch(/^G-/);
|
||||
expect(load().umamiMeasurementId).toBe(UMAMI_MEASUREMENT_IDS[ContentVariant.BIO]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,9 +15,12 @@ describe('+layout (LayoutData)', () => {
|
||||
links: { sections: [] },
|
||||
variant: 'dev',
|
||||
gaMeasurementId: 'G-xxx',
|
||||
umamiMeasurementId: 'UM-xxx',
|
||||
};
|
||||
expect(mockData.site).toHaveProperty('title');
|
||||
expect(mockData.site).toHaveProperty('url');
|
||||
expect(mockData).toHaveProperty('umamiMeasurementId');
|
||||
expect(mockData).toHaveProperty('gaMeasurementId');
|
||||
expect(mockData).toHaveProperty('variant');
|
||||
expect(mockData.links).toHaveProperty('sections');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user