chore(deps): bump

- vite@6
- @bwip-js/browser
- svelte-i18n@4
- migrate from csvtojson to papaparse
This commit is contained in:
Philipp Dormann 2025-04-22 22:03:23 +02:00
parent a12c4f87d2
commit 244be471f0
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314
4 changed files with 799 additions and 293 deletions

View File

@ -14,12 +14,13 @@
"devDependencies": {
"@odit/license-exporter": "0.2.0",
"@sveltejs/vite-plugin-svelte": "2.1.1",
"@types/papaparse": "^5.3.15",
"auto-changelog": "2.5.0",
"prettier": "3.5.3",
"prettier-plugin-svelte": "3.3.3",
"release-it": "17.10.0",
"svelte-select": "3.17.0",
"vite": "4.3.3"
"vite": "6.3.2"
},
"release-it": {
"git": {
@ -39,20 +40,19 @@
}
},
"dependencies": {
"@bwip-js/browser": "^4.6.0",
"@fontsource/athiti": "^5.2.5",
"@odit/lfk-client-js": "1.2.4",
"@paralleldrive/cuid2": "2.2.2",
"@tailwindcss/vite": "^4.1.4",
"@tanstack/svelte-table": "8.9.1",
"bwip-js": "3.4.0",
"check-password-strength": "2.0.10",
"csvtojson": "2.0.10",
"html5-qrcode": "^2.3.8",
"localforage": "1.10.0",
"marked": "4.3.0",
"papaparse": "^5.5.2",
"svelte": "3.58.0",
"svelte-french-toast": "1.2.0",
"svelte-i18n": "3.6.0",
"svelte-i18n": "4.0.1",
"tailwindcss": "^4.1.4",
"tinro": "0.6.12",
"validator": "13.15.0",

1028
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<script>
import csv from "csvtojson";
import { parse } from "papaparse";
import { read as readXlsx, utils as xlsx_utils } from "xlsx";
import { _ } from "svelte-i18n";
import { clickOutside } from "../base/outsideclick";
@ -63,13 +63,14 @@
let recent_processed = true;
$: json_output = [];
$: {
if (json_output.length === 0) {
if (files) {
if (
files[0].type ===
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
) {
const reader = new FileReader();
reader.addEventListener("load", async (e) => {
reader.addEventListener("loadend", (e) => {
const data = new Uint8Array(e.target.result);
const out = readXlsx(data, { type: "array" });
json_output = xlsx_utils.sheet_to_json(
@ -79,16 +80,17 @@
reader.readAsArrayBuffer(files[0]);
} else {
const reader = new FileReader();
reader.addEventListener("load", async (e) => {
json_output = await csv({
delimiter: [";", ","],
trim: true,
}).fromString(e.target.result);
reader.addEventListener("loadend", (e) => {
json_output = parse(e.target.result, {
delimitersToGuess: [";", ","],
header: true,
}).data;
});
reader.readAsText(files[0]);
}
}
}
}
function importAction() {
if (recent_processed === true) {
toast.loading($_("runners-are-being-imported"));

View File

@ -1,7 +1,7 @@
<script>
import { _ } from "svelte-i18n";
import { tick } from "svelte";
import bwipjs from "bwip-js";
import { toCanvas } from "@bwip-js/browser";
import toast from "svelte-french-toast";
export let copy_modal_open;
@ -51,7 +51,7 @@
if (bcid == "code128") {
codeconfig.height = 10;
}
bwipjs.toCanvas(canvas, codeconfig);
toCanvas(canvas, codeconfig);
return canvas.toDataURL("image/png");
}
</script>