Skip to content

Commit 42622ae

Browse files
committed
New thunderstore UI
- Update Electron to v31
1 parent ca35974 commit 42622ae

34 files changed

+1910
-1576
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ jobs:
1717
os: windows-latest
1818
platform: win
1919
- kind: mac
20-
os: macos-11
20+
os: macos-14
2121
platform: osx
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

2525
- name: Set up Node
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
2828
# The talk on the street says this might be a good version for building.
29-
node-version: 14.20.1
29+
node-version: 20.16.0
3030
cache: yarn
3131

3232
- name: Install Yarn dependencies
@@ -46,6 +46,11 @@ jobs:
4646
# DEBUG: electron-builder
4747
with:
4848
run: yarn build-${{ matrix.platform }} --publish=never
49+
- name: Upload Artifacts
50+
uses: actions/upload-artifact@v1
51+
with:
52+
name: r2modman-${{ matrix.platform }}
53+
path: dist
4954

5055
- if: steps.build.outputs.stderr != ''
5156
name: Log stderr

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/setup-node@v4
2525
with:
2626
# The talk on the street says this might be a good version for building.
27-
node-version: 14.20.1
27+
node-version: 20.16.0
2828
cache: yarn
2929

3030
- name: Install Yarn dependencies

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ jobs:
1717
os: windows-latest
1818
platform: win
1919
- kind: mac
20-
os: macos-11
20+
os: macos-14
2121
platform: osx
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

2525
- name: Set up Node
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
2828
# The talk on the street says this might be a good version for building.
29-
node-version: 14.20.1
29+
node-version: 20.16.0
3030
cache: yarn
3131

3232
- name: Install Yarn dependencies

package.json

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build-osx": "quasar build --mode electron -T mac",
1616
"publish": "quasar build --mode electron --publish always",
1717
"publish-win": "quasar build --mode electron -T win32 --publish always",
18-
"publish-linux": "quasar build --mode electron -T linux --publish always",
18+
"publish-linux": "quasar build --mode electron -T linux --publish always",
1919
"test:unit": "jest --updateSnapshot",
2020
"test:unit:ci": "jest --ci",
2121
"test:unit:coverage": "jest --coverage",
@@ -48,8 +48,9 @@
4848
"highlight.js": "^10.4.1",
4949
"lodash.debounce": "^4.0.8",
5050
"moment": "^2.29.1",
51+
"node-gyp": "^10.2.0",
5152
"node-ipc": "^9.1.1",
52-
"quasar": "^1.14.7",
53+
"quasar": "^1.22.10",
5354
"quill": "^1.3.7",
5455
"sanitize-filename": "^1.6.3",
5556
"serialize-javascript": "^3.1.0",
@@ -65,15 +66,17 @@
6566
"devDependencies": {
6667
"@babel/core": "^7.4.0",
6768
"@babel/preset-typescript": "^7.14.5",
68-
"@quasar/app": "^2.0.9",
69+
"@quasar/app": "^2.4.4",
6970
"@quasar/quasar-app-extension-testing": "^1.0.3",
7071
"@quasar/quasar-app-extension-testing-unit-jest": "^2.2.2",
7172
"@quasar/quasar-app-extension-typescript": "^1.0.2",
7273
"@types/adm-zip": "^0.4.34",
7374
"@types/async-lock": "^1.1.2",
7475
"@types/chai": "^4.2.11",
76+
"@types/electron": "^1.6.10",
7577
"@types/fs-extra": "^8.0.1",
7678
"@types/lodash.debounce": "^4.0.7",
79+
"@types/mocha": "^10.0.7",
7780
"@types/node": "^12.12.12",
7881
"@types/quill": "^2.0.3",
7982
"@types/sinon": "^10.0.2",
@@ -83,32 +86,29 @@
8386
"@typescript-eslint/parser": "^1.12.0",
8487
"@vue/eslint-config-airbnb": "^4.0.0",
8588
"@vue/test-utils": "^1.2.1",
86-
"babel-core": "^7.0.0-beta.3",
8789
"babel-eslint": "^10.0.1",
8890
"babel-jest": "^27.0.2",
8991
"chai": "^4.2.0",
9092
"devtron": "^1.4.0",
91-
"electron": "^11.1.1",
92-
"electron-builder": "22.10.5",
93+
"electron": "31.3.1",
94+
"electron-builder": "24.13.3",
9395
"electron-debug": "^3.0.1",
94-
"electron-devtools-installer": "^3.0.0",
95-
"electron-packager": "14.1.1",
96+
"electron-devtools-installer": "^3.2.0",
97+
"electron-packager": "17.1.2",
9698
"eslint": "^6.8.0",
9799
"eslint-config-prettier": "^6.0.0",
98100
"eslint-loader": "^2.1.1",
99101
"eslint-plugin-jest": "^24.1.0",
100102
"eslint-plugin-vue": "^5.0.0",
101-
"identity-obj-proxy": "^3.0.0",
102103
"majestic": "^1.2.24",
103-
"minimist": "^1.2.2",
104+
"minimist": "^1.2.8",
104105
"mocha": "^8.0.1",
105-
"mock-require": "^3.0.3",
106-
"node-sass": "^4.13.1",
106+
"sass": "^1.77.8",
107107
"sass-loader": "^10.2.1",
108108
"sinon": "^11.1.1",
109109
"ts-node": "^8.10.2",
110-
"typescript": "^4.5.5",
111-
"vue-jest": "^3.0.0",
110+
"typescript": "^5.5.4",
111+
"vue-jest": "^3.0.7",
112112
"wallaby-vue-compiler": "^1.0.3"
113113
},
114114
"browserslist": [
@@ -122,9 +122,13 @@
122122
"last 10 iOS versions",
123123
"last 5 Opera versions"
124124
],
125+
"resolutions": {
126+
"deasync": "0.1.30"
127+
},
125128
"engines": {
126129
"node": ">= 10.18.1",
127130
"npm": ">= 6.13.4",
128131
"yarn": ">= 1.21.1"
129-
}
132+
},
133+
"packageManager": "[email protected]"
130134
}

src-electron/main-process/electron-main.dev.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,6 @@ app.whenReady().then(() => {
1717

1818
// Install vuejs devtools
1919
installExtension(VUEJS_DEVTOOLS)
20-
.then(name => {
21-
console.log(`Added Extension: ${name}`)
22-
// get main window
23-
const win = BrowserWindow.getFocusedWindow()
24-
if (win) {
25-
win.webContents.on('did-frame-finish-load', () => {
26-
win.webContents.once('devtools-opened', () => {
27-
win.webContents.focus()
28-
})
29-
// open electron debug
30-
console.log('Opening dev tools')
31-
win.webContents.openDevTools()
32-
})
33-
}
34-
})
35-
.catch(err => {
36-
console.log('An error occurred: ', err)
37-
})
3820
}, 250)
3921
})
4022

src-electron/main-process/electron-main.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { app, BrowserWindow, ipcMain, nativeTheme, protocol } from 'electron';
1+
import { app, BrowserWindow, ipcMain, protocol } from 'electron';
22
import Listeners from './ipcListeners';
33
import Persist from './window-state-persist';
44
import path from 'path';
@@ -7,13 +7,6 @@ import * as fs from 'fs';
77

88
app.allowRendererProcessReuse = true;
99

10-
try {
11-
if (process.platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
12-
require('fs').unlinkSync(path.join(app.getPath('userData'), 'DevTools Extensions'));
13-
}
14-
} catch (_) {
15-
}
16-
1710
/**
1811
* Set `__statics` path to static files in production;
1912
* The reason we are setting it here is that the path needs to be evaluated at runtime
@@ -30,7 +23,6 @@ function createWindow() {
3023
/**
3124
* Initial window options
3225
*/
33-
3426
const windowSize = Persist.getSize(app, {
3527
defaultWidth: 1200,
3628
defaultHeight: 700
@@ -39,6 +31,8 @@ function createWindow() {
3931
mainWindow = new BrowserWindow({
4032
width: windowSize.width,
4133
height: windowSize.height,
34+
minWidth: 1200,
35+
minHeight: 700,
4236
useContentSize: true,
4337
webPreferences: {
4438
nodeIntegration: true,
@@ -47,7 +41,8 @@ function createWindow() {
4741
contextIsolation: false,
4842
},
4943
icon: path.join(__dirname, 'icon.png'),
50-
autoHideMenuBar: process.env.PROD
44+
autoHideMenuBar: process.env.PROD,
45+
frame: false
5146
});
5247

5348
if (windowSize.maximized) {

src-electron/main-process/ipcListeners.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ ipcMain.on('get-appData-directory', ()=>{
3434
browserWindow.webContents.send('receive-appData-directory', app.getPath('appData'));
3535
});
3636

37+
ipcMain.on('window-minimize', () => {
38+
browserWindow.minimize();
39+
})
40+
ipcMain.on('window-maximize', () => {
41+
if(browserWindow.isMaximized())
42+
browserWindow.unmaximize();
43+
else
44+
browserWindow.maximize();
45+
})
46+
ipcMain.on('window-close', () => {
47+
browserWindow.close();
48+
})
49+
3750
ipcMain.on('get-is-portable', ()=>{
3851
let isPortable = false;
3952
switch(process.platform){
@@ -68,4 +81,3 @@ ipcMain.on('show-open-dialog', (arg, fileOpts) => {
6881
browserWindow.webContents.send('receive-open-dialog', r);
6982
});
7083
});
71-

src/App.vue

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
<template>
22
<div>
3+
<div class="titlebar">
4+
<div class="titlebar_start">
5+
<p class="titlebar_title">{{ appName }}</p>
6+
<p class="titlebar_version">{{ appVersion }}</p>
7+
</div>
8+
<div class="titlebar_buttons">
9+
<div class="btn" @click="() => ipcRenderer.send('window-minimize')">
10+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8.47 8.47">
11+
<path
12+
d="M 0.71464503,4.235 H 7.7550979" stroke="currentColor" fill="currentColor" stroke-linecap="round" stroke-width="1.59"/>
13+
</svg>
14+
</div>
15+
<div class="btn" @click="() => ipcRenderer.send('window-maximize')">
16+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8.47 8.47">
17+
<path
18+
d="M 0.70215499,0.70215499 H 7.767847 V 7.7678511 H 0.70215499 Z" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.59" />
19+
</svg>
20+
</div>
21+
<div class="closebutton btn" @click="() => ipcRenderer.send('window-close')">
22+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8.47 8.47">
23+
<path d="m7.67.794-6.88 6.88m0-6.88 6.88 6.88" stroke="currentColor" fill="currentColor" stroke-linecap="round" stroke-width="1.59" />
24+
</svg>
25+
</div>
26+
</div>
27+
</div>
328
<router-view v-if="visible"/>
429
<ErrorModal />
530
</div>
@@ -53,7 +78,8 @@ import ErrorModal from './components/modals/ErrorModal.vue';
5378
}
5479
})
5580
export default class App extends mixins(UtilityMixin) {
56-
private visible: boolean = false;
81+
public visible: boolean = false;
82+
readonly ipcRenderer = ipcRenderer;
5783
5884
async created() {
5985
// Load settings using the default game before the actual game is selected.
@@ -123,5 +149,13 @@ export default class App extends mixins(UtilityMixin) {
123149
BindLoaderImpl.bind();
124150
}
125151
152+
get appName(): string {
153+
return ManagerInformation.APP_NAME;
154+
}
155+
156+
get appVersion(): string {
157+
return ManagerInformation.VERSION.toString();
158+
}
159+
126160
}
127161
</script>

src/components/buttons/DonateButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<Link :url="mod.getDonationLink()"
2+
<Link :url="mod?.getDonationLink()"
33
:target="'external'"
44
class="card-footer-item"
55
v-tooltip.left="{content: 'Donate to the mod author', distance: 0}">

src/components/config-components/ConfigEditLayout.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
hero-type="is-info"
77
/>
88
<br/>
9-
<div class="sticky-top sticky-top--buttons margin-right">
10-
<button class="button is-info margin-right margin-right--half-width" @click="save">Save</button>
9+
<div class="sticky-top sticky-top--buttons page-padding">
10+
<button class="button is-info margin-right--half-width" @click="save">Save</button>
1111
<button class="button is-danger" @click="cancel">Cancel</button>
1212
</div>
13-
<div v-if="configFile.getPath().toLowerCase().endsWith('.cfg')" class="margin-right non-selectable">
14-
<h3 class='subtitle is-3'>Sections</h3>
15-
<ul>
13+
<div v-if="configFile.getPath().toLowerCase().endsWith('.cfg')" class="non-selectable">
14+
<h3 class='subtitle is-3 page-padding'>Sections</h3>
15+
<ul class="page-padding">
1616
<li v-for="(value, key) in dumpedConfigVariables" :key="`${key}-${value.toString()}-tab`">
1717
<a :href="`#${key}`">{{ key }}</a>
1818
</li>
@@ -42,7 +42,7 @@
4242
<input
4343
type="range"
4444
class="slider is-fullwidth is-circle is-small"
45-
v-on:input="e => setConfigLineValue(line, e.target.value)"
45+
@input="setConfigLineValue(line, $event.target.value)"
4646
:value="parseFloat(line.value)"
4747
:min="line.getMinRange()"
4848
:max="line.getMaxRange()" />
@@ -83,11 +83,11 @@ import BepInExConfigUtils from '../../utils/BepInExConfigUtils';
8383
export default class ConfigEditLayout extends Vue {
8484
8585
@Prop({required: true})
86-
private configFile!: ConfigFile;
86+
readonly configFile!: ConfigFile;
8787
88-
private fileText: string = "";
88+
fileText: string = "";
8989
90-
private dumpedConfigVariables: { [section: string]: { [variable: string]: ConfigLine } } = {};
90+
dumpedConfigVariables: { [section: string]: { [variable: string]: ConfigLine } } = {};
9191
9292
async created() {
9393
const fs = FsProvider.instance;
@@ -150,15 +150,15 @@ import BepInExConfigUtils from '../../utils/BepInExConfigUtils';
150150
.trim();
151151
}
152152
153-
toggleEntryExpansion(key: string, variable: string) {
153+
toggleEntryExpansion(key: string | number, variable: string | number) {
154154
const oldLine = this.dumpedConfigVariables[key][variable];
155155
const newLine = new ConfigLine(oldLine.value, oldLine.comments, oldLine.allowedValues);
156156
newLine.commentsExpanded = !oldLine.commentsExpanded;
157157
this.dumpedConfigVariables[key][variable] = newLine;
158158
this.dumpedConfigVariables = JSON.parse(JSON.stringify(this.dumpedConfigVariables));
159159
}
160160
161-
setConfigLineValue(line: ConfigLine, value: number) {
161+
setConfigLineValue(line: ConfigLine, value: number | string) {
162162
line.value = value.toString();
163163
}
164164

0 commit comments

Comments
 (0)