mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-19 04:40:32 -05:00
Merge pull request #595 from DRYTRIX/develop
fix(desktop): use modern Node for Vite builds
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
name: Build Desktop Apps
|
||||
|
||||
env:
|
||||
NODE_VERSION: '24'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
@@ -19,9 +22,9 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Generate desktop icons
|
||||
run: |
|
||||
@@ -52,9 +55,9 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Generate desktop icons
|
||||
run: |
|
||||
@@ -83,9 +86,9 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Generate desktop icons
|
||||
run: |
|
||||
|
||||
@@ -41,6 +41,7 @@ env:
|
||||
# - DOCKERHUB_TOKEN (recommended) or DOCKERHUB_PASSWORD
|
||||
DOCKERHUB_IMAGE: driesp/timetracker
|
||||
PYTHON_VERSION: '3.11'
|
||||
NODE_VERSION: '24'
|
||||
|
||||
jobs:
|
||||
# ============================================================================
|
||||
@@ -820,7 +821,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Generate desktop icons
|
||||
run: |
|
||||
@@ -857,7 +858,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Generate desktop icons
|
||||
run: |
|
||||
@@ -896,7 +897,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Generate desktop icons
|
||||
run: |
|
||||
|
||||
@@ -12,6 +12,8 @@ test('desktop package builds the React renderer with Vite', () => {
|
||||
assert.ok(pkg.dependencies['react-dom']);
|
||||
assert.ok(pkg.devDependencies.vite);
|
||||
assert.ok(pkg.devDependencies['@vitejs/plugin-react']);
|
||||
assert.ok(fs.existsSync(path.join(root, 'vite.config.mjs')));
|
||||
assert.ok(!fs.existsSync(path.join(root, 'vite.config.js')));
|
||||
assert.ok(pkg.build.files.includes('dist-renderer/**/*'));
|
||||
});
|
||||
|
||||
@@ -28,3 +30,13 @@ test('main process store IPC is limited to known desktop settings', () => {
|
||||
assert.match(mainSource, /theme_mode/);
|
||||
assert.match(mainSource, /auto_sync/);
|
||||
});
|
||||
|
||||
test('desktop GitHub workflows use a Vite-compatible Node version', () => {
|
||||
const workflowRoot = path.resolve(root, '..', '.github', 'workflows');
|
||||
const buildDesktop = fs.readFileSync(path.join(workflowRoot, 'build-desktop.yml'), 'utf8');
|
||||
const release = fs.readFileSync(path.join(workflowRoot, 'cd-release.yml'), 'utf8');
|
||||
for (const source of [buildDesktop, release]) {
|
||||
assert.match(source, /NODE_VERSION:\s+'24'/);
|
||||
assert.doesNotMatch(source, /node-version:\s+'18'/);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
const path = require('path');
|
||||
const { defineConfig } = require('vite');
|
||||
const react = require('@vitejs/plugin-react');
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
module.exports = defineConfig({
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export default defineConfig({
|
||||
root: path.resolve(__dirname, 'src/renderer-react'),
|
||||
base: './',
|
||||
plugins: [react()],
|
||||
Reference in New Issue
Block a user