remove Alpine and start fixing type errors
This commit is contained in:
parent
46edbbae74
commit
ef552af054
7 changed files with 5 additions and 6779 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3018
static/js/alpine-3.15.8-min.js
vendored
3018
static/js/alpine-3.15.8-min.js
vendored
File diff suppressed because it is too large
Load diff
3
ts/global.d.ts
vendored
3
ts/global.d.ts
vendored
|
|
@ -2,8 +2,7 @@ import * as bootstrap from "bootstrap";
|
|||
|
||||
declare global {
|
||||
interface Window {
|
||||
Alpine: any;
|
||||
SSEManager: any;
|
||||
SSEManager: SSEManagerType;
|
||||
bootstrap: typeof bootstrap;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
});
|
||||
|
|
|
|||
1
ts/vendor/alpine-3.15.8.d.ts
vendored
1
ts/vendor/alpine-3.15.8.d.ts
vendored
|
|
@ -1 +0,0 @@
|
|||
Couldn't find the requested file /packages/alpinejs/types/index.d.ts in alpinejs.
|
||||
3748
ts/vendor/alpinejs-3.15.8.js
vendored
3748
ts/vendor/alpinejs-3.15.8.js
vendored
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue