Fixed Tauri-Build (now using absolute paths again)

This commit is contained in:
Felix Kaspar 2024-08-12 22:49:00 +02:00
parent e806ee8015
commit c2bcda925a
8 changed files with 32 additions and 43 deletions

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
"preview": "vite preview", "preview (previously built files)": "vite preview",
"tauri-dev (currently broken)": "tauri dev", "tauri-dev (currently broken)": "tauri dev",
"tauri-build-debug": "tauri build --debug", "tauri-build-debug": "tauri build --debug",
"tauri-build": "tauri build" "tauri-build": "tauri build"

View File

@ -49,15 +49,6 @@ export default function App() {
})} })}
<Route path="*" element={<NoMatch />} /> <Route path="*" element={<NoMatch />} />
</Route> </Route>
<Route path="/convert" element={<Layout />}>
{/* <Route path="file-to-pdf" element={<ToPdf />} /> */}
<Route path="*" element={<NoMatch />} />
</Route>
<Route path="/page-operations" element={<Layout />}>
{/* <Route path="impose" element={<Impose />} /> */}
<Route path="*" element={<NoMatch />} />
</Route>
</Routes> </Routes>
</Suspense> </Suspense>
); );

View File

@ -1,4 +1,4 @@
import { useEffect, useRef, useState } from 'react'; import { useEffect, useState } from 'react';
import { getSchemaByName } from "@stirling-pdf/shared-operations/src/workflow/operatorAccessor"; import { getSchemaByName } from "@stirling-pdf/shared-operations/src/workflow/operatorAccessor";

View File

@ -1,30 +1,30 @@
import NavDropdown from "react-bootstrap/NavDropdown"; // import NavDropdown from "react-bootstrap/NavDropdown";
import { useTranslation } from "react-i18next"; // import { useTranslation } from "react-i18next";
import { BsGlobe2 } from "react-icons/bs"; // import { BsGlobe2 } from "react-icons/bs";
function generateSublist() { // function generateSublist() {
const { i18n } = useTranslation(); // const { i18n } = useTranslation();
const out: JSX.Element[] = []; // const out: JSX.Element[] = [];
const languages = i18n.options.resources; // const languages = i18n.options.resources;
for (const key in languages) { // for (const key in languages) {
const lang: any = languages[key].translation; // const lang: any = languages[key].translation;
const staticKey = key; // const staticKey = key;
out.push(( // out.push((
<NavDropdown.Item key={"language-"+key} className="nav-icon" onClick={()=>i18n.changeLanguage(staticKey)}> // <NavDropdown.Item key={"language-"+key} className="nav-icon" onClick={()=>i18n.changeLanguage(staticKey)}>
<span>{lang.language?.flag}</span> // <span>{lang.language?.flag}</span>
<span>{lang.language?.name}</span> // <span>{lang.language?.name}</span>
</NavDropdown.Item> // </NavDropdown.Item>
)); // ));
} // }
return <>{out}</>; // return <>{out}</>;
} // }
export default function LanguagePicker() { // export default function LanguagePicker() {
return ( // return (
<NavDropdown id="languages-dropdown" title={<><span className="nav-icon"><BsGlobe2/></span></>}> // <NavDropdown id="languages-dropdown" title={<><span className="nav-icon"><BsGlobe2/></span></>}>
{generateSublist()} // {generateSublist()}
</NavDropdown> // </NavDropdown>
); // );
} // }

View File

@ -1,5 +1,3 @@
import { Link } from "react-router-dom";
import { listOperatorNames } from "@stirling-pdf/shared-operations/src/workflow/operatorAccessor"; import { listOperatorNames } from "@stirling-pdf/shared-operations/src/workflow/operatorAccessor";
import { OperatorCard } from "../components/OperatorCard"; import { OperatorCard } from "../components/OperatorCard";

View File

@ -26,7 +26,7 @@ function Dynamic() {
}); });
}, [location]); }, [location]);
const inputRef = useRef<HTMLInputElement>(); const inputRef = useRef<HTMLInputElement>(null);
async function handleSubmit(e: BaseSyntheticEvent) { async function handleSubmit(e: BaseSyntheticEvent) {
const formData = new FormData(e.target); const formData = new FormData(e.target);

View File

@ -49,5 +49,5 @@ export default defineConfig(async () => ({
// 3. to make use of `TAURI_DEBUG` and other env variables // 3. to make use of `TAURI_DEBUG` and other env variables
// https://tauri.app/v1/api/config#buildconfig.beforedevcommand // https://tauri.app/v1/api/config#buildconfig.beforedevcommand
envPrefix: ["VITE_"], envPrefix: ["VITE_"],
base: '', base: '/', // relative paths sadly don't work with react router dom sub-dirs for some reason...
})); }));

View File

@ -1,6 +1,6 @@
import { PdfFile } from "../wrappers/PdfFile"; import { PdfFile } from "../wrappers/PdfFile";
import { Action } from "../../declarations/Action"; import { Action } from "../../declarations/Action";
import Joi, { StringRegexOptions } from "@stirling-tools/joi"; import Joi from "@stirling-tools/joi";
import { MaterialSymbolProps } from "react-material-symbols"; import { MaterialSymbolProps } from "react-material-symbols";