Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from OmegaRogue/pull-request-no-injection
Browse files Browse the repository at this point in the history
1.4.3
  • Loading branch information
theripper93 authored Oct 12, 2023
2 parents e0d7746 + ede8d70 commit 29b78e8
Show file tree
Hide file tree
Showing 13 changed files with 5,676 additions and 5,564 deletions.
122 changes: 69 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ on:
release:
types:
- created
env:
node_version: 18
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ env.node_version }}

- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -33,29 +35,19 @@ jobs:
run: yarn make --platform linux



- name: Upload Zip to Release
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out/make/deb/x64/vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb
asset_name: vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb
asset_content_type: application/zip

- name: Upload Zip to Release 2
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out/make/rpm/x64/vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm
asset_name: vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm
asset_content_type: application/zip
- name: Upload Zip to Release 3
uses: shogo82148/actions-upload-release-asset@v1
- name: Rename output files
run: |
mv out/make/deb/x64/vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb ./vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb
mv out/make/rpm/x64/vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm ./vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm
mv out/make/zip/linux/x64/vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip ./vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out/make/zip/linux/x64/vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip
asset_name: vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
name: linux-outputs
path: |
vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb
vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm
vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip
# - name: Upload to Flathub
# uses: flatpak/flatpak-github-actions/flat-manager@v4
Expand All @@ -73,7 +65,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ env.node_version }}

- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -86,28 +78,26 @@ jobs:
- name: Build for macOS
run: yarn make --platform darwin

- name: Upload Zip to Release
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out/make/zip/darwin/x64/vtt-desktop-client-darwin-x64-${{ github.event.release.tag_name }}.zip
asset_name: vtt-desktop-client-macos-x64-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
- name: Upload Zip to Release 2
uses: shogo82148/actions-upload-release-asset@v1
- name: Rename output files
run: |
mv out/make/zip/darwin/x64/vtt-desktop-client-darwin-x64-${{ github.event.release.tag_name }}.zip ./vtt-desktop-client-macos-x64-${{ github.event.release.tag_name }}.zip
mv out/make/vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg ./vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out/make/vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg
asset_name: vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg
asset_content_type: application/zip
name: macos-outputs
path: |
vtt-desktop-client-macos-x64-${{ github.event.release.tag_name }}.zip
vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg
build-windows:
runs-on: windows-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ env.node_version }}

- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -120,22 +110,48 @@ jobs:
- name: Build for Windows
run: yarn make --platform win32

- name: Zip Make Folder
- name: Rename output files
run: |
$outputPath = "$PWD\out\win64.zip"
Compress-Archive -Path "out\make\squirrel.windows\x64" -DestinationPath $outputPath
Move-Item -Path "out\make\squirrel.windows\x64\vtt-desktop-client-${{ github.event.release.tag_name }} Setup.exe" -Destination ".\vtt-desktop-client-windows-x64-${{ github.event.release.tag_name }}-setup.exe"
Move-Item -Path "out\make\zip\win32\x64\vtt-desktop-client-win32-x64-${{ github.event.release.tag_name }}.zip" -Destination ".\vtt-desktop-client-windows-x64-portable-${{ github.event.release.tag_name }}.zip"
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: windows-outputs
path: |
vtt-desktop-client-windows-x64-${{ github.event.release.tag_name }}-setup.exe
vtt-desktop-client-windows-x64-portable-${{ github.event.release.tag_name }}.zip
publish:
needs:
- build-linux
- build-macos
- build-windows
runs-on: ubuntu-latest
steps:
- name: Download linux production artifacts for publication
uses: actions/download-artifact@v2
with:
name: linux-outputs
path: linux-outputs

- name: Upload Zip to Release
uses: shogo82148/actions-upload-release-asset@v1
- name: Download windows production artifacts for publication
uses: actions/download-artifact@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out/make/squirrel.windows/x64/vtt-desktop-client-${{ github.event.release.tag_name }} Setup.exe
asset_name: vtt-desktop-client-windows-x64-${{ github.event.release.tag_name }}-setup.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload Zip to Release 2
uses: shogo82148/actions-upload-release-asset@v1
name: windows-outputs
path: windows-outputs

- name: Download macos production artifacts for publication
uses: actions/download-artifact@v2
with:
name: macos-outputs
path: macos-outputs

- name: Create release
id: create_version_release
uses: ncipollo/release-action@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: out\make\zip\win32\x64\vtt-desktop-client-win32-x64-${{ github.event.release.tag_name }}.zip
asset_name: vtt-desktop-client-windows-x64-portable-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
allowUpdates: true
name: ${{ github.event.release.name }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./linux-outputs/*, ./windows-outputs/*, ./macos-outputs/*"
body: ${{ github.event.release.body }}
1 change: 0 additions & 1 deletion .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# fvtt-player-client

wiki https://wiki.theripper93.com/free/vtt-desktop-client

## Getting data from `localStorage` to put into `config.json`

```js
JSON.stringify({
...JSON.parse(window.localStorage.getItem("appConfig") || "{}"),
games: JSON.parse(window.localStorage.getItem("gameList") || "[]")
})
```
7 changes: 7 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"games": [],
"background": "https://assets.adac.de/image/upload/ar_16:9,c_fill,f_auto,g_auto,q_auto:eco,w_2000/v1/ADAC-eV/KOR/Bilder/Archiv/PR/fuehrerschein-pruefung-theorie-2208_pmc0fd",
"backgroundColor": "#003049ff",
"textColor": "#eae2b7ff",
"accentColor": "#f77f00ff"
}
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
document.querySelector('.help').classList.toggle('hidden2');
}

function toggleExportConfig() {
document.querySelector('.config-export').classList.toggle('hidden2');
}

</script>
<div class="content">
<div class="button-controls">
<button onclick="toggleConfigureApp()"><i class="fa-solid fa-gear"></i></button>
<button onclick="toggleHelp()"><i class="fa-solid fa-question-circle"></i></button>
<button onclick="toggleExportConfig()"><i class="fa-solid fa-file-export"></i></button>
</div>

<div class="update-available hidden2">
Expand Down Expand Up @@ -97,6 +102,26 @@
<button id="save-app-config">Save</button>
</div>
</div>

<div class="config-export hidden2">
<h3>Put this in your <code>config.json</code> file to include it installation-wide:</h3>
<pre><code id="export-text"></code></pre>
<button onclick="copyText()">Copy</button>
<button onclick="toggleExportConfig()">Close</button>
<script>
const gamesList = JSON.parse(window.localStorage.getItem("gameList") || "[]");
const appConfig = JSON.parse(window.localStorage.getItem("appConfig") || "{}");
const config = {...appConfig, games: gamesList};
code = document.getElementById("export-text");
const text = JSON.stringify(config, null, 4);
txt = document.createTextNode(text);
code.appendChild(txt);

function copyText() {
navigator.clipboard.writeText(text);
}
</script>
</div>
</section>

<ul id="game-list">
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vtt-desktop-client",
"packageManager": "[email protected]",
"version": "1.3.10",
"version": "1.4.2",
"license": "MIT",
"description": "VTT Desktop Client",
"main": ".vite/build/main.js",
Expand Down Expand Up @@ -29,15 +29,15 @@
"@electron-forge/plugin-auto-unpack-natives": "^6.4.2",
"@electron-forge/plugin-local-electron": "^6.4.2",
"@electron-forge/plugin-vite": "^6.4.2",
"@types/node": "^20.6.2",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"electron": "25.8.1",
"@types/node": "^20.8.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"electron": "^25.9.1",
"electron-builder": "^24.6.4",
"eslint": "^8.49.0",
"eslint-plugin-import": "^2.25.0",
"ts-node": "^10.0.0",
"typescript": "~5.2.2"
"eslint": "^8.50.0",
"eslint-plugin-import": "^2.28.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"scripts": {
"start": "electron-forge start",
Expand Down
7 changes: 0 additions & 7 deletions public/config.json

This file was deleted.

Loading

0 comments on commit 29b78e8

Please sign in to comment.