chore: replace pnpm with bun across the project

This commit is contained in:
2026-02-26 13:41:13 -06:00
parent e9e3451c2d
commit f86ab35b32
7 changed files with 34 additions and 6336 deletions
+10 -10
View File
@@ -2,7 +2,7 @@
## Project Overview ## Project Overview
**ttscm-ui** is an Electron desktop application built with **SvelteKit**, TypeScript, and Vite. It connects to the Optima API for credential and company management. The app uses standard SvelteKit routing for single-page navigation and pnpm for package management with patches applied to SvelteKit. **ttscm-ui** is an Electron desktop application built with **SvelteKit**, TypeScript, and Vite. It connects to the Optima API for credential and company management. The app uses standard SvelteKit routing for single-page navigation and bun for package management with patches applied to SvelteKit.
## Architecture Layers ## Architecture Layers
@@ -76,31 +76,31 @@ Export as a named object, then import/aggregate in `src/lib/index.ts`.
### Installation & Setup ### Installation & Setup
```bash ```bash
pnpm install bun install
``` ```
Uses pnpm with SvelteKit patches (see `patches/` directory). Uses bun with SvelteKit patches (see `patches/` directory).
### Running in Development ### Running in Development
```bash ```bash
pnpm run start bun start
``` ```
Electron Forge + Vite handles dev server and hot module replacement (HMR). Dev tools open automatically. Main window loads `/login` first. Electron Forge + Vite handles dev server and hot module replacement (HMR). Dev tools open automatically. Main window loads `/login` first.
### Building & Packaging ### Building & Packaging
- **Build for production**: `pnpm run package` → outputs to `out/` directory - **Build for production**: `bun run package` → outputs to `out/` directory
- **Create distributable**: `pnpm run make` → creates installers (configure in `forge.config.ts`) - **Create distributable**: `bun run make` → creates installers (configure in `forge.config.ts`)
- **Check types & lint**: `pnpm run check` (runs svelte-kit sync + svelte-check) - **Check types & lint**: `bun run check` (runs svelte-kit sync + svelte-check)
### Testing ### Testing
#### Unit Tests (Vitest) #### Unit Tests (Vitest)
```bash ```bash
pnpm run test:unit bun run test:unit
``` ```
- Client tests: `src/**/*.svelte.{test,spec}.{js,ts}` (jsdom environment) - Client tests: `src/**/*.svelte.{test,spec}.{js,ts}` (jsdom environment)
@@ -110,7 +110,7 @@ pnpm run test:unit
#### E2E Tests (Playwright) #### E2E Tests (Playwright)
```bash ```bash
pnpm run test:e2e bun run test:e2e
``` ```
- Tests in `e2e/` directory - Tests in `e2e/` directory
@@ -119,7 +119,7 @@ pnpm run test:e2e
#### Run All Tests #### Run All Tests
```bash ```bash
pnpm run test bun run test
``` ```
Runs unit tests first, then e2e. Runs unit tests first, then e2e.
+8 -24
View File
@@ -39,22 +39,14 @@ jobs:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install pnpm - name: Install bun
uses: pnpm/action-setup@v4 uses: oven-sh/setup-bun@v2
with:
version: latest
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: bun install --frozen-lockfile
- name: Build macOS distributables - name: Build macOS distributables
run: pnpm run make:macos run: bun run make:macos
- name: Upload macOS artifacts to release - name: Upload macOS artifacts to release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
@@ -72,22 +64,14 @@ jobs:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install pnpm - name: Install bun
uses: pnpm/action-setup@v4 uses: oven-sh/setup-bun@v2
with:
version: latest
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: bun install --frozen-lockfile
- name: Build Windows distributables - name: Build Windows distributables
run: pnpm run make -- --platform win32 run: bun run make -- --platform win32
- name: Upload Windows artifacts to release - name: Upload Windows artifacts to release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
+1
View File
@@ -26,3 +26,4 @@ vite.config.ts.timestamp-*
out out
tailwindcss-*.log tailwindcss-*.log
pnpm-lock.yaml
+4 -5
View File
@@ -1,16 +1,15 @@
FROM node:22-alpine AS base FROM oven/bun:latest AS base
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app WORKDIR /app
# Install dependencies # Install dependencies
COPY package.json pnpm-lock.yaml ./ COPY package.json bun.lock ./
COPY patches ./patches COPY patches ./patches
RUN pnpm install --frozen-lockfile RUN bun install --frozen-lockfile
# Build the SvelteKit app with adapter-node # Build the SvelteKit app with adapter-node
COPY . . COPY . .
RUN pnpm run build:server RUN bun run build:server
# Production image # Production image
FROM node:22-alpine AS production FROM node:22-alpine AS production
+5 -5
View File
@@ -27,20 +27,20 @@ libraries like [Shadcn-Svelte](https://next.shadcn-svelte.com/).
## Getting Started ## Getting Started
> [!WARNING] > [!WARNING]
> This project uses [`pnpm`](https://pnpm.io/) and uses [patching](https://pnpm.io/cli/patch) to work > This project uses [`bun`](https://bun.sh/) and uses [patching](https://bun.sh/docs/install/patch) to work
> around some issues with SvelteKit. When this [PR](https://github.com/sveltejs/kit/pull/13812) merges, > around some issues with SvelteKit. When this [PR](https://github.com/sveltejs/kit/pull/13812) merges,
> you can remove the patching and use the latest version of SvelteKit. > you can remove the patching and use the latest version of SvelteKit.
Start by installing the dependencies: Start by installing the dependencies:
``` ```
pnpm install bun install
``` ```
**Development:** **Development:**
``` ```
pnpm run start bun start
``` ```
[Electron Forge](https://www.electronforge.io/) with the [Vite plugin](https://www.electronforge.io/plugins/vite) [Electron Forge](https://www.electronforge.io/) with the [Vite plugin](https://www.electronforge.io/plugins/vite)
@@ -50,7 +50,7 @@ will take care of running the development server and building the app for you. Y
**Production:** **Production:**
``` ```
pnpm run package bun run package
``` ```
This will build the app and you can find the output in the `out` directory. You can run the production This will build the app and you can find the output in the `out` directory. You can run the production
@@ -60,7 +60,7 @@ for distribution though.
To create a distributable installer, you can use: To create a distributable installer, you can use:
``` ```
pnpm run make bun run make
``` ```
This will create a distributable installer for your app. You can configure this in the `makers` section This will create a distributable installer for your app. You can configure this in the `makers` section
+3 -5
View File
@@ -15,7 +15,7 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "vitest", "test:unit": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e", "test": "bun run test:unit -- --run && bun run test:e2e",
"test:e2e": "playwright test", "test:e2e": "playwright test",
"start": "electron-forge start", "start": "electron-forge start",
"package": "electron-forge package", "package": "electron-forge package",
@@ -62,13 +62,11 @@
"electron-squirrel-startup": "^1.0.1", "electron-squirrel-startup": "^1.0.1",
"socket.io-client": "^4.8.3" "socket.io-client": "^4.8.3"
}, },
"pnpm": { "trustedDependencies": [
"onlyBuiltDependencies": [
"esbuild", "esbuild",
"electron", "electron",
"electron-winstaller" "electron-winstaller"
] ],
},
"patchedDependencies": { "patchedDependencies": {
"@sveltejs/kit": "patches/@sveltejs__kit.patch" "@sveltejs/kit": "patches/@sveltejs__kit.patch"
} }
-6284
View File
File diff suppressed because it is too large Load Diff