From 494f0b2b0f2a6344aea3dae90d5798c5f1e0bc96 Mon Sep 17 00:00:00 2001 From: notangelmario Date: Tue, 11 Oct 2022 18:13:09 +0300 Subject: [PATCH] Fixed build errors --- package.json | 4 ++-- src/lib/editor.ts | 1 - src/lib/file.ts | 12 ++++++------ tsconfig.json | 7 +++++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index fb008ca..41f47a9 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "name": "miniated", "private": true, "author": "Savin Angel-Mario (savin@fructo.land)", - "version": "1.1.0", + "version": "1.1.3", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", - "check": "tsc --noEmit --resolveJsonModule src/main.ts" + "check": "tsc --noEmit --resolveJsonModule -p ./tsconfig.json" }, "devDependencies": { "@types/marked": "^4.0.7", diff --git a/src/lib/editor.ts b/src/lib/editor.ts index 6f9df83..cb654be 100644 --- a/src/lib/editor.ts +++ b/src/lib/editor.ts @@ -1,6 +1,5 @@ import monaco from "./monaco"; import { onClose, onOpen, onSave, initDropFile, initLaunchWithFile, onCreate, startAutosave } from "./file"; -import { createNotice } from "./status"; import { Store } from "./store"; // Monaco editor doesn't have an API to change default keybindings diff --git a/src/lib/file.ts b/src/lib/file.ts index ab7f4e7..0896e23 100644 --- a/src/lib/file.ts +++ b/src/lib/file.ts @@ -119,7 +119,7 @@ export function getExtension(fname: string) { return fname.slice((Math.max(0, fname.lastIndexOf(".")) || Infinity) + 1); } -export function initDropFile(element: HTMLElement, editor: monaco.editor.IStandaloneCodeEditor, store: Store, fileAvailableContext: monaco.editor.IContextKey, disableAutosave: () => void) { +export function initDropFile(element: HTMLElement, editor: monaco.editor.IStandaloneCodeEditor, store: Store, fileAvailableContext: monaco.editor.IContextKey, _disableAutosave: () => void) { async function dropHandler(e: DragEvent) { console.log('File(s) dropped'); @@ -131,16 +131,16 @@ export function initDropFile(element: HTMLElement, editor: monaco.editor.IStanda const fileHandle = fileHandleRaw as FileSystemFileHandle; setEditorText(editor, fileHandle, store, fileAvailableContext); - disableAutosave = startAutosave(editor, fileHandle); + _disableAutosave = startAutosave(editor, fileHandle); } } element.addEventListener("drop", dropHandler, false); } -export function initLaunchWithFile(editor: monaco.editor.IStandaloneCodeEditor, store: Store, fileAvailableContext: monaco.editor.IContextKey, disableAutosave: () => void) { - //@ts-ignore - window.launchQueue.setConsumer((launchParams) => { +export function initLaunchWithFile(editor: monaco.editor.IStandaloneCodeEditor, store: Store, fileAvailableContext: monaco.editor.IContextKey, _disableAutosave: () => void) { + + (window as any).launchQueue.setConsumer((launchParams: any) => { // Nothing to do when the queue is empty. if (!launchParams.files.length) { return; @@ -149,7 +149,7 @@ export function initLaunchWithFile(editor: monaco.editor.IStandaloneCodeEditor, setEditorText(editor, fileHandle, store, fileAvailableContext) - disableAutosave = startAutosave(editor, fileHandle) + _disableAutosave = startAutosave(editor, fileHandle); }); } diff --git a/tsconfig.json b/tsconfig.json index b67510d..0948108 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,8 +16,11 @@ "noImplicitReturns": true, "skipLibCheck": true, "types": [ - "vite-plugin-pwa/client" + "vite-plugin-pwa/client", + "@types/marked", + "@types/wicg-file-system-access" ] }, - "include": ["src"] + "include": ["src"], + "exclude": ["node_modules"] } \ No newline at end of file