diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index bb8c585..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build - -env: - SLN_PATH: factorio-achievements-fixer/ - -on: - workflow_dispatch: - push: - paths-ignore: - - "README.md" - - "LICENSE" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - - name: Install Application Dependencies - run: dotnet restore ${{ env.SLN_PATH }} - - - name: Build Application - run: dotnet publish ${{ env.SLN_PATH }} --no-restore - - - name: Get Version - id: get_version - run: | - VERSION=$(grep -oP '(?<=\[assembly: AssemblyVersion\(")[^"]+' ${{ env.SLN_PATH }}/AssemblyInfo.cs) - echo "result=$VERSION" >> $GITHUB_OUTPUT - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: factorio-achievements-fixer-${{ steps.get_version.outputs.result }} - if-no-files-found: error - path: ${{ env.SLN_PATH }}/bin/Release/net8.0-windows/win-x86/publish/factorio-achievements-fixer.exe diff --git a/.gitignore b/.gitignore index 7366976..4108b33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,24 @@ -.idea -bin/ -obj/ -/packages/ -riderModule.iml -/_ReSharper.Caches/ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..d4fef4e --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"] +} diff --git a/factorio-achievements-fixer.sln b/factorio-achievements-fixer.sln deleted file mode 100644 index 4b1b87b..0000000 --- a/factorio-achievements-fixer.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34728.123 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "factorio-achievements-fixer", "factorio-achievements-fixer\factorio-achievements-fixer.csproj", "{52CBAB79-17D2-4BBF-98B2-4A19864C7FAF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {52CBAB79-17D2-4BBF-98B2-4A19864C7FAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52CBAB79-17D2-4BBF-98B2-4A19864C7FAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52CBAB79-17D2-4BBF-98B2-4A19864C7FAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52CBAB79-17D2-4BBF-98B2-4A19864C7FAF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {970EF005-D589-4FEA-8466-86C65F557263} - EndGlobalSection -EndGlobal diff --git a/factorio-achievements-fixer/App.xaml b/factorio-achievements-fixer/App.xaml deleted file mode 100644 index 50e7915..0000000 --- a/factorio-achievements-fixer/App.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/factorio-achievements-fixer/App.xaml.cs b/factorio-achievements-fixer/App.xaml.cs deleted file mode 100644 index 1163219..0000000 --- a/factorio-achievements-fixer/App.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Configuration; -using System.Data; -using System.Windows; - -namespace factorio_achievements_fixer; - -/// -/// Interaction logic for App.xaml -/// -public partial class App : Application -{ -} \ No newline at end of file diff --git a/factorio-achievements-fixer/AssemblyInfo.cs b/factorio-achievements-fixer/AssemblyInfo.cs deleted file mode 100644 index 41fe54d..0000000 --- a/factorio-achievements-fixer/AssemblyInfo.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Reflection; -using System.Windows; - -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] -[assembly: AssemblyProduct("Factorio Achievements Fixer")] -[assembly: AssemblyCopyright("Ryan Walters © 2024")] -[assembly: AssemblyTitle("Factorio Achievements Fixer")] - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] \ No newline at end of file diff --git a/factorio-achievements-fixer/InitialWindow.xaml b/factorio-achievements-fixer/InitialWindow.xaml deleted file mode 100644 index b4f9fcb..0000000 --- a/factorio-achievements-fixer/InitialWindow.xaml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - + +

{greetMsg}

+ + ); +} + +export default App; diff --git a/src/assets/preact.svg b/src/assets/preact.svg new file mode 100644 index 0000000..c7fda77 --- /dev/null +++ b/src/assets/preact.svg @@ -0,0 +1 @@ + diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..99647f5 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,4 @@ +import { render } from "preact"; +import App from "./App"; + +render(, document.getElementById("root")!); diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..7d0ff9e --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..4ea355c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "jsxImportSource": "preact", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..165a9ba --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..63d31cc --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import preact from "@preact/preset-vite"; + +// @ts-expect-error process is a nodejs global +const host = process.env.TAURI_DEV_HOST; + +// https://vitejs.dev/config/ +export default defineConfig(async () => ({ + plugins: [preact()], + + // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` + // + // 1. prevent vite from obscuring rust errors + clearScreen: false, + // 2. tauri expects a fixed port, fail if that port is not available + server: { + port: 1420, + strictPort: true, + host: host || false, + hmr: host + ? { + protocol: "ws", + host, + port: 1421, + } + : undefined, + watch: { + // 3. tell vite to ignore watching `src-tauri` + ignored: ["**/src-tauri/**"], + }, + }, +}));