7 Commits

Author SHA1 Message Date
2d08da8923 chore(deps): update container images 2025-06-03 18:40:57 +02:00
be9c15d7b3 chore(deps): update cargo dependencies 2025-06-03 18:40:19 +02:00
391478b5a2 chore(deps): update tailwindcss & daisyui 2025-06-03 18:40:11 +02:00
d852e42f03 chore(deps): update frontend dependencies 2025-06-03 18:39:56 +02:00
Maurice
8b3c78cb84 Fixed language picker bug in viewer 2024-02-05 16:34:29 +01:00
Maurice
049a1b0125 Fix 2024-02-01 20:42:32 +01:00
f5aac579ff Merge pull request 'build: update containerfile' (#2) from Containerfile into dev
Reviewed-on: #2
2024-02-01 19:08:54 +00:00
13 changed files with 1686 additions and 1862 deletions

984
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,11 @@
FROM node:21-alpine3.19 AS frontend-builder FROM node:24-alpine3.22 AS frontend-builder
WORKDIR /build WORKDIR /build
RUN corepack enable RUN corepack enable
COPY pastabble-frontend/ . COPY pastabble-frontend/ .
RUN pnpm i && pnpm build RUN pnpm i && pnpm build
FROM rust:alpine3.19 AS builder FROM rust:alpine3.22 AS builder
WORKDIR /build WORKDIR /build
RUN apk add --no-cache musl-dev RUN apk add --no-cache musl-dev
@@ -18,7 +18,7 @@ RUN case "$(apk --print-arch)" in \
mv ./target/aarch64-unknown-linux-musl /release ;; \ mv ./target/aarch64-unknown-linux-musl /release ;; \
esac esac
FROM alpine:3.19 FROM alpine:3.22
WORKDIR /app WORKDIR /app
RUN mkdir wwwroot data && \ RUN mkdir wwwroot data && \

View File

@@ -1,4 +1,4 @@
segment_size: 524288 segment_size: 524288
use_compression: false use_compression: false
version: 0.34 version: 0.34
vQ<> vQ<>

Binary file not shown.

View File

@@ -10,20 +10,19 @@
"check": "svelte-check --tsconfig ./tsconfig.json" "check": "svelte-check --tsconfig ./tsconfig.json"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.1", "@sveltejs/vite-plugin-svelte": "^5.1.0",
"@tsconfig/svelte": "^5.0.2", "@tailwindcss/vite": "^4.1.8",
"autoprefixer": "^10.4.17", "@tsconfig/svelte": "^5.0.4",
"daisyui": "^4.6.1", "daisyui": "^5.0.43",
"postcss": "^8.4.33", "svelte": "^5.33.14",
"svelte": "^4.2.8", "svelte-check": "^4.2.1",
"svelte-check": "^3.6.2", "tailwindcss": "^4.1.8",
"tailwindcss": "^3.4.1", "tslib": "^2.8.1",
"tslib": "^2.6.2", "typescript": "^5.8.3",
"typescript": "^5.2.2", "vite": "^6.3.5"
"vite": "^5.0.8"
}, },
"dependencies": { "dependencies": {
"highlight.js": "^11.9.0", "highlight.js": "^11.11.1",
"svelte-spa-router": "^4.0.1" "svelte-spa-router": "^4.0.1"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +0,0 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@@ -1,3 +1,2 @@
@tailwind base; @import 'tailwindcss';
@tailwind components; @plugin "daisyui";
@tailwind utilities;

View File

@@ -6,23 +6,22 @@
export let language: string | undefined; export let language: string | undefined;
let displayCode: string | undefined; let displayCode: string | undefined;
let displayLanguage: string | undefined;
let showAlert = false; let showAlert = false;
let initial = true;
$: if(code) { $: if(code) {
highlight(); highlight();
initial = false;
} }
$: if(language) { $: if(language !== displayLanguage) {
if(initial || !code) {
highlight(); highlight();
} }
}
function highlight() { function highlight() {
if(language) { if(language) {
const res = hljs.highlight(language!, code!); const res = hljs.highlight(code!, {
language
});
if(!res.errorRaised) { if(!res.errorRaised) {
displayCode = res.value; displayCode = res.value;
} }
@@ -33,6 +32,7 @@
language = res.language; language = res.language;
} }
} }
displayLanguage = language;
} }
async function copy() { async function copy() {

View File

@@ -45,7 +45,10 @@
}); });
if(res.ok) { if(res.ok) {
const id = await res.text(); let id = await res.text();
if(id.includes('/')) {
id = id.substring(id.lastIndexOf('/') + 1);
}
push(`/${id}`); push(`/${id}`);
} }
} }
@@ -75,7 +78,10 @@
}); });
if(res.status === 200) { if(res.status === 200) {
const id = await res.text(); let id = await res.text();
if(id.includes('/')) {
id = id.substring(id.lastIndexOf('/') + 1);
}
createdUrl = `${location.origin}/to/${id}`; createdUrl = `${location.origin}/to/${id}`;
enteredUrl = ''; enteredUrl = '';
showAlert = true; showAlert = true;

View File

@@ -1,9 +1,8 @@
import './app.css' import './app.css'
import 'highlight.js/styles/github-dark.min.css'; import 'highlight.js/styles/github-dark.min.css';
import { mount } from 'svelte';
import App from './App.svelte' import App from './App.svelte'
const app = new App({ const app = mount(App, { target: document.getElementById("app") });
target: document.getElementById('app'),
})
export default app export default app

View File

@@ -4,6 +4,5 @@ export default {
theme: { theme: {
extend: {}, extend: {},
}, },
plugins: [require('daisyui')],
} }

View File

@@ -1,7 +1,8 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte' import { svelte } from '@sveltejs/vite-plugin-svelte'
import tailwindcss from '@tailwindcss/vite'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [svelte()] plugins: [svelte(), tailwindcss()],
}) })