remove Alpine and start fixing type errors

This commit is contained in:
Eli Ribble 2026-03-22 02:36:17 +00:00
parent 46edbbae74
commit ef552af054
No known key found for this signature in database
7 changed files with 5 additions and 6779 deletions

View file

@ -22,7 +22,10 @@
"scripts": {
"build": "node build.js",
"build:prod": "node build.js --minify",
"dev": "pnpm typecheck:watch & pnpm watch",
"generate-icons": "node generate-icons.js",
"typecheck": "tsc --noEmit",
"typecheck:watch": "tsc --noEmit --watch --preserveWatchOutput",
"watch": "node build.js --watch"
}
}

File diff suppressed because it is too large Load diff

3
ts/global.d.ts vendored
View file

@ -2,8 +2,7 @@ import * as bootstrap from "bootstrap";
declare global {
interface Window {
Alpine: any;
SSEManager: any;
SSEManager: SSEManagerType;
bootstrap: typeof bootstrap;
}
}

View file

@ -1,4 +1,3 @@
import Alpine from "./vendor/alpinejs-3.15.8.js";
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
@ -18,19 +17,14 @@ import "./gen/custom-icons.scss";
import * as bootstrap from "bootstrap";
window.bootstrap = bootstrap;
// Make Alpine available on window for inline Alpine
window.Alpine = Alpine;
// Make SSEManager available to all the JavaScript
window.SSEManager = SSEManager;
// Wait for DOM to be ready, then initialize Alpine
document.addEventListener("DOMContentLoaded", () => {
Alpine.start();
SSEManager.connect("/api/events");
//SetupSidebar();
});
document.addEventListener("alpine:init", () => {
document.addEventListener("init", () => {
const user = {
display_name: "",
initials: "",
@ -46,7 +40,6 @@ document.addEventListener("alpine:init", () => {
role: "",
username: "",
};
Alpine.store("user", user);
});
interface GreetingComponent {
message: string;

View file

@ -64,8 +64,6 @@ function setTooltipsForSidebar() {
async function updateUserState() {
const response = await fetch("/api/user/self");
const data = await response.json();
// Update properties instead of replacing the whole store which leverages Alpine's reactivity
const store_user = Alpine.store("user");
Object.keys(data).forEach((key) => {
store_user[key] = data[key];
});

View file

@ -1 +0,0 @@
Couldn't find the requested file /packages/alpinejs/types/index.d.ts in alpinejs.

File diff suppressed because it is too large Load diff