mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 19:54:44 -07:00
switch to yarn
This commit is contained in:
parent
6f6ef47954
commit
13f864b3b9
15 changed files with 8593 additions and 12619 deletions
19
.github/RELEASE.md
vendored
19
.github/RELEASE.md
vendored
|
|
@ -38,7 +38,7 @@ The workflow creates the following files:
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- The repository must have a `GITHUB_TOKEN` (automatically provided by GitHub)
|
- The repository must have a `GITHUB_TOKEN` (automatically provided by GitHub)
|
||||||
- Node.js 20 and npm for building
|
- Node.js 22 and Yarn for building
|
||||||
- All dependencies must be properly defined in `package.json`
|
- All dependencies must be properly defined in `package.json`
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
@ -46,20 +46,21 @@ The workflow creates the following files:
|
||||||
If the build fails:
|
If the build fails:
|
||||||
|
|
||||||
1. Check that all dependencies are installed correctly
|
1. Check that all dependencies are installed correctly
|
||||||
2. Ensure the build script works locally: `npm run build`
|
2. Ensure the build script works locally: `yarn build`
|
||||||
3. Check the workflow logs for specific error messages
|
3. Check the workflow logs for specific error messages
|
||||||
4. Verify that the version tag follows semantic versioning (e.g., `v1.0.0`)
|
4. Verify that the version tag follows semantic versioning (e.g., `v1.0.0`)
|
||||||
|
|
||||||
## Adding Icons
|
## Adding Icons
|
||||||
|
|
||||||
To add custom icons for your releases:
|
To customize the app icon:
|
||||||
|
|
||||||
1. Create an `assets` folder in the project root
|
1. Replace `assets/icon_512.png` with your custom 512x512 PNG icon
|
||||||
2. Add the following icon files:
|
2. Electron Builder automatically converts this single PNG to the appropriate format for each platform:
|
||||||
- `icon.icns` for macOS
|
- macOS: Converts to `.icns` format
|
||||||
- `icon.ico` for Windows
|
- Windows: Converts to `.ico` format
|
||||||
- `icon.png` for Linux
|
- Linux: Uses PNG directly
|
||||||
3. Update the `build` section in `package.json` to reference these icons
|
|
||||||
|
The icon is already configured in `package.json` under the `build.icon` property.
|
||||||
|
|
||||||
## Customizing the Release
|
## Customizing the Release
|
||||||
|
|
||||||
|
|
|
||||||
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
|
|
@ -14,23 +14,26 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Enable Corepack
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '22'
|
||||||
cache: 'npm'
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: yarn
|
||||||
|
|
||||||
- name: Run type check
|
- name: Run type check
|
||||||
run: npm run compile
|
run: yarn compile
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint
|
run: yarn lint
|
||||||
|
|
||||||
- name: Run spell check
|
- name: Run spell check
|
||||||
run: npm run spell-check
|
run: yarn spell-check
|
||||||
|
|
||||||
- name: Test build
|
- name: Test build
|
||||||
run: npm run build:electron
|
run: yarn build:electron
|
||||||
|
|
|
||||||
15
.github/workflows/release.yml
vendored
15
.github/workflows/release.yml
vendored
|
|
@ -23,23 +23,26 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Enable Corepack
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '22'
|
||||||
cache: 'npm'
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: yarn
|
||||||
|
|
||||||
- name: Run type check
|
- name: Run type check
|
||||||
run: npm run compile
|
run: yarn compile
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint
|
run: yarn lint
|
||||||
|
|
||||||
- name: Build Electron app
|
- name: Build Electron app
|
||||||
run: npm run build
|
run: yarn build
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -7,3 +7,7 @@ release/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
.VSCodeCounter/
|
.VSCodeCounter/
|
||||||
|
|
||||||
|
# Yarn
|
||||||
|
.yarn/
|
||||||
|
.pnp.*
|
||||||
2
.npmrc
Normal file
2
.npmrc
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Yarn configuration for Electron compatibility
|
||||||
|
nodeLinker: node-modules
|
||||||
12
.vscode/tasks.json
vendored
12
.vscode/tasks.json
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
{
|
{
|
||||||
"label": "Start Development Server",
|
"label": "Start Development Server",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run dev",
|
"command": "yarn dev",
|
||||||
"isBackground": true,
|
"isBackground": true,
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
{
|
{
|
||||||
"label": "Build for Production",
|
"label": "Build for Production",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run build",
|
"command": "yarn build",
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
{
|
{
|
||||||
"label": "Lint and Fix",
|
"label": "Lint and Fix",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run lint:fix",
|
"command": "yarn lint:fix",
|
||||||
"group": "test",
|
"group": "test",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
{
|
{
|
||||||
"label": "Type Check",
|
"label": "Type Check",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run compile",
|
"command": "yarn compile",
|
||||||
"group": "test",
|
"group": "test",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
{
|
{
|
||||||
"label": "Spell Check",
|
"label": "Spell Check",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run spell-check",
|
"command": "yarn spell-check",
|
||||||
"group": "test",
|
"group": "test",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
{
|
{
|
||||||
"label": "Check All (Lint + Type + Spell)",
|
"label": "Check All (Lint + Type + Spell)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run check-all",
|
"command": "yarn check-all",
|
||||||
"group": "test",
|
"group": "test",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|
|
||||||
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
nodeLinker: node-modules
|
||||||
19
README.md
19
README.md
|
|
@ -12,22 +12,27 @@ A koboldcpp manager.
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- Node.js 18+
|
- **[Volta](https://volta.sh/)** - JavaScript tool manager (installs correct Node.js + Yarn versions automatically)
|
||||||
- npm
|
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
1. Clone the repository
|
1. **Install Volta** (if not already installed):
|
||||||
2. Install dependencies:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
curl https://get.volta.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Start the development server:
|
2. Clone the repository
|
||||||
|
3. Install dependencies (Volta will auto-install the correct Node.js and Yarn versions):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
yarn
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Start the development server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Linux Wayland support
|
### Linux Wayland support
|
||||||
|
|
|
||||||
12533
package-lock.json
generated
12533
package-lock.json
generated
File diff suppressed because it is too large
Load diff
23
package.json
23
package.json
|
|
@ -5,13 +5,21 @@
|
||||||
"description": "A modern Electron shell for KoboldCpp",
|
"description": "A modern Electron shell for KoboldCpp",
|
||||||
"main": "out/main/index.js",
|
"main": "out/main/index.js",
|
||||||
"homepage": "./",
|
"homepage": "./",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.0.0",
|
||||||
|
"yarn": "^4.0.0"
|
||||||
|
},
|
||||||
|
"volta": {
|
||||||
|
"node": "22.18.0",
|
||||||
|
"yarn": "4.9.2"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
"build": "electron-vite build && electron-builder",
|
"build": "electron-vite build && electron-builder",
|
||||||
"build:analyze": "cross-env ANALYZE=true electron-vite build && npx open-cli dist/stats.html",
|
"build:analyze": "cross-env ANALYZE=true electron-vite build && yarn exec open-cli dist/stats.html",
|
||||||
"build:electron": "electron-vite build",
|
"build:electron": "electron-vite build",
|
||||||
"analyze": "npm run build:analyze",
|
"analyze": "yarn run build:analyze",
|
||||||
"analyze:server": "cross-env ANALYZE=server electron-vite build && npx open-cli dist/stats.html",
|
"analyze:server": "cross-env ANALYZE=server electron-vite build && yarn exec open-cli dist/stats.html",
|
||||||
"preview": "electron-vite preview",
|
"preview": "electron-vite preview",
|
||||||
"preb": "electron-vite build",
|
"preb": "electron-vite build",
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
|
|
@ -23,7 +31,7 @@
|
||||||
"compile": "tsc --noEmit",
|
"compile": "tsc --noEmit",
|
||||||
"spell-check": "cspell \"**/*.{ts,tsx,js,jsx,md,json}\" --no-progress",
|
"spell-check": "cspell \"**/*.{ts,tsx,js,jsx,md,json}\" --no-progress",
|
||||||
"spell-check:fix": "cspell \"**/*.{ts,tsx,js,jsx,md,json}\" --no-progress --show-suggestions",
|
"spell-check:fix": "cspell \"**/*.{ts,tsx,js,jsx,md,json}\" --no-progress --show-suggestions",
|
||||||
"check-all": "npm run lint && npm run compile && npm run spell-check",
|
"check-all": "yarn lint && yarn compile && yarn spell-check",
|
||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
|
@ -51,7 +59,6 @@
|
||||||
"@types/node": "^24.3.0",
|
"@types/node": "^24.3.0",
|
||||||
"@types/react": "^19.1.10",
|
"@types/react": "^19.1.10",
|
||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
"@types/systeminformation": "^3.54.1",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
||||||
"@typescript-eslint/parser": "^8.39.1",
|
"@typescript-eslint/parser": "^8.39.1",
|
||||||
"@vitejs/plugin-react": "^5.0.0",
|
"@vitejs/plugin-react": "^5.0.0",
|
||||||
|
|
@ -79,7 +86,8 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@mantine/core": "^8.2.4",
|
"@mantine/core": "^8.2.5",
|
||||||
|
"@mantine/hooks": "^8.2.5",
|
||||||
"lucide-react": "^0.539.0",
|
"lucide-react": "^0.539.0",
|
||||||
"react": "^19.1.1",
|
"react": "^19.1.1",
|
||||||
"react-dom": "^19.1.1",
|
"react-dom": "^19.1.1",
|
||||||
|
|
@ -157,5 +165,6 @@
|
||||||
"nsis": {
|
"nsis": {
|
||||||
"differentialPackage": true
|
"differentialPackage": true
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"packageManager": "yarn@4.9.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
src/App.tsx
19
src/App.tsx
|
|
@ -21,6 +21,7 @@ import { UpdateDialog } from '@/components/UpdateDialog';
|
||||||
import { SettingsModal } from '@/components/settings/SettingsModal';
|
import { SettingsModal } from '@/components/settings/SettingsModal';
|
||||||
import { ScreenTransition } from '@/components/ScreenTransition';
|
import { ScreenTransition } from '@/components/ScreenTransition';
|
||||||
import { StyledTooltip } from '@/components/StyledTooltip';
|
import { StyledTooltip } from '@/components/StyledTooltip';
|
||||||
|
import { getDisplayNameFromPath } from '@/utils/versionUtils';
|
||||||
import type { UpdateInfo, InstalledVersion } from '@/types';
|
import type { UpdateInfo, InstalledVersion } from '@/types';
|
||||||
|
|
||||||
type Screen = 'download' | 'launch' | 'interface';
|
type Screen = 'download' | 'launch' | 'interface';
|
||||||
|
|
@ -44,24 +45,6 @@ export const App = () => {
|
||||||
>([]);
|
>([]);
|
||||||
const { colorScheme } = useMantineColorScheme();
|
const { colorScheme } = useMantineColorScheme();
|
||||||
|
|
||||||
const getDisplayNameFromPath = (
|
|
||||||
installedVersion: InstalledVersion
|
|
||||||
): string => {
|
|
||||||
const pathParts = installedVersion.path.split(/[/\\]/);
|
|
||||||
const launcherIndex = pathParts.findIndex(
|
|
||||||
(part) =>
|
|
||||||
part === 'koboldcpp-launcher' ||
|
|
||||||
part === 'koboldcpp.exe' ||
|
|
||||||
part === 'koboldcpp'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (launcherIndex > 0) {
|
|
||||||
return pathParts[launcherIndex - 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return installedVersion.filename;
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const checkInstallation = async () => {
|
const checkInstallation = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import {
|
||||||
sortAssetsByRecommendation,
|
sortAssetsByRecommendation,
|
||||||
isAssetRecommended,
|
isAssetRecommended,
|
||||||
} from '@/utils/assets';
|
} from '@/utils/assets';
|
||||||
|
import { getDisplayNameFromPath } from '@/utils/versionUtils';
|
||||||
import { useKoboldVersions } from '@/hooks/useKoboldVersions';
|
import { useKoboldVersions } from '@/hooks/useKoboldVersions';
|
||||||
import type { InstalledVersion } from '@/types/electron';
|
import type { InstalledVersion } from '@/types/electron';
|
||||||
|
|
||||||
|
|
@ -97,24 +98,6 @@ export const VersionsTab = () => {
|
||||||
loadInstalledVersions();
|
loadInstalledVersions();
|
||||||
}, [loadInstalledVersions]);
|
}, [loadInstalledVersions]);
|
||||||
|
|
||||||
const getDisplayNameFromPath = (
|
|
||||||
installedVersion: InstalledVersion
|
|
||||||
): string => {
|
|
||||||
const pathParts = installedVersion.path.split(/[/\\]/);
|
|
||||||
const launcherIndex = pathParts.findIndex(
|
|
||||||
(part) =>
|
|
||||||
part === 'koboldcpp-launcher' ||
|
|
||||||
part === 'koboldcpp.exe' ||
|
|
||||||
part === 'koboldcpp'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (launcherIndex > 0) {
|
|
||||||
return pathParts[launcherIndex - 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return installedVersion.filename;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getAllVersions = (): VersionInfo[] => {
|
const getAllVersions = (): VersionInfo[] => {
|
||||||
const versions: VersionInfo[] = [];
|
const versions: VersionInfo[] = [];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -648,10 +648,8 @@ export class KoboldCppManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
const release = await response.json();
|
const release = await response.json();
|
||||||
const rocmAsset = release.assets?.find(
|
const rocmAsset = release.assets?.find((asset: GitHubAsset) =>
|
||||||
(asset: GitHubAsset) =>
|
asset.name.endsWith('rocm.exe')
|
||||||
asset.name.endsWith('rocm.exe') &&
|
|
||||||
!asset.name.includes('rocm_b2.exe')
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (rocmAsset) {
|
if (rocmAsset) {
|
||||||
|
|
@ -850,9 +848,7 @@ export class KoboldCppManager {
|
||||||
const pathParts = v.path.split(/[/\\]/);
|
const pathParts = v.path.split(/[/\\]/);
|
||||||
const launcherIndex = pathParts.findIndex(
|
const launcherIndex = pathParts.findIndex(
|
||||||
(part) =>
|
(part) =>
|
||||||
part === 'koboldcpp-launcher' ||
|
part === 'koboldcpp-launcher' || part === 'koboldcpp-launcher.exe'
|
||||||
part === 'koboldcpp.exe' ||
|
|
||||||
part === 'koboldcpp'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (launcherIndex > 0) {
|
if (launcherIndex > 0) {
|
||||||
|
|
|
||||||
16
src/utils/versionUtils.ts
Normal file
16
src/utils/versionUtils.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import type { InstalledVersion } from '@/types';
|
||||||
|
|
||||||
|
export const getDisplayNameFromPath = (
|
||||||
|
installedVersion: InstalledVersion
|
||||||
|
): string => {
|
||||||
|
const pathParts = installedVersion.path.split(/[/\\]/);
|
||||||
|
const launcherIndex = pathParts.findIndex(
|
||||||
|
(part) => part === 'koboldcpp-launcher' || part === 'koboldcpp-launcher.exe'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (launcherIndex > 0) {
|
||||||
|
return pathParts[launcherIndex - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return installedVersion.filename;
|
||||||
|
};
|
||||||
Loading…
Add table
Reference in a new issue