283 lines
5.8 KiB
Markdown
283 lines
5.8 KiB
Markdown
# 📦 FAZA 8: ELECTRON BUILD - IMPLEMENTACIJA
|
|
|
|
**Datum:** 12. December 2025
|
|
**Status:** 🔨 V TEKU
|
|
|
|
---
|
|
|
|
## ✅ **ŠTO JE ŽE NAREJENO:**
|
|
|
|
### **1. Package.json Konfiguracija** ✅ (delno)
|
|
**Datoteka:** `package.json`
|
|
|
|
**Že nastavljeno:**
|
|
- ✅ `name`: "novafarma"
|
|
- ✅ `version`: "2.5.0"
|
|
- ✅ `description`: "NovaFarma - 2.5D Isometric Survival Game"
|
|
- ✅ `main`: "main.js"
|
|
- ✅ `scripts.start`: "electron ."
|
|
- ✅ `scripts.build`: "electron-builder"
|
|
- ✅ `build.appId`: "com.novafarma.game"
|
|
- ✅ `build.win.target`: "nsis"
|
|
- ✅ `build.directories.output`: "dist"
|
|
|
|
**Manjka:**
|
|
- ❌ `electron-builder` v devDependencies
|
|
- ❌ Ikone (icon.ico, icon.png, icon.icns)
|
|
- ❌ Dodatna build konfiguracija
|
|
|
|
---
|
|
|
|
## 🔧 **POTREBNE SPREMEMBE:**
|
|
|
|
### **1. Dodaj electron-builder**
|
|
```bash
|
|
npm install --save-dev electron-builder
|
|
```
|
|
|
|
### **2. Posodobi package.json**
|
|
```json
|
|
{
|
|
"name": "novafarma",
|
|
"version": "2.5.0",
|
|
"description": "NovaFarma - 2.5D Isometric Survival Game",
|
|
"main": "main.js",
|
|
"author": "NovaFarma Team",
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"start": "electron .",
|
|
"build": "electron-builder",
|
|
"build:win": "electron-builder --win",
|
|
"build:mac": "electron-builder --mac",
|
|
"build:linux": "electron-builder --linux"
|
|
},
|
|
"build": {
|
|
"appId": "com.novafarma.game",
|
|
"productName": "NovaFarma",
|
|
"copyright": "Copyright © 2025 NovaFarma Team",
|
|
"win": {
|
|
"target": ["nsis", "portable"],
|
|
"icon": "build/icon.ico"
|
|
},
|
|
"mac": {
|
|
"target": "dmg",
|
|
"icon": "build/icon.icns",
|
|
"category": "public.app-category.games"
|
|
},
|
|
"linux": {
|
|
"target": ["AppImage", "deb"],
|
|
"icon": "build/icon.png",
|
|
"category": "Game"
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"createDesktopShortcut": true,
|
|
"createStartMenuShortcut": true,
|
|
"shortcutName": "NovaFarma"
|
|
},
|
|
"directories": {
|
|
"output": "dist",
|
|
"buildResources": "build"
|
|
},
|
|
"files": [
|
|
"**/*",
|
|
"!**/*.md",
|
|
"!.git",
|
|
"!dist",
|
|
"!node_modules/electron-builder"
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
### **3. Ustvari Ikone**
|
|
**Potrebne datoteke:**
|
|
- `build/icon.ico` - Windows (256x256)
|
|
- `build/icon.png` - Linux (512x512)
|
|
- `build/icon.icns` - macOS (1024x1024)
|
|
|
|
**Kako ustvariti:**
|
|
1. Ustvari 512x512 PNG sliko (logo igre)
|
|
2. Uporabi online converter:
|
|
- https://convertio.co/png-ico/ (za .ico)
|
|
- https://cloudconvert.com/png-to-icns (za .icns)
|
|
|
|
---
|
|
|
|
## 📝 **KORAKI ZA BUILD:**
|
|
|
|
### **Korak 1: Namesti electron-builder**
|
|
```bash
|
|
npm install --save-dev electron-builder
|
|
```
|
|
|
|
### **Korak 2: Ustvari build mapo**
|
|
```bash
|
|
mkdir build
|
|
```
|
|
|
|
### **Korak 3: Dodaj ikone**
|
|
```
|
|
build/
|
|
├── icon.ico (Windows)
|
|
├── icon.png (Linux)
|
|
└── icon.icns (macOS)
|
|
```
|
|
|
|
### **Korak 4: Build za Windows**
|
|
```bash
|
|
npm run build:win
|
|
```
|
|
|
|
**Rezultat:**
|
|
- `dist/NovaFarma Setup 2.5.0.exe` - Installer
|
|
- `dist/NovaFarma 2.5.0.exe` - Portable
|
|
|
|
### **Korak 5: Build za macOS** (samo na macOS)
|
|
```bash
|
|
npm run build:mac
|
|
```
|
|
|
|
### **Korak 6: Build za Linux**
|
|
```bash
|
|
npm run build:linux
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 **BUILD TARGETS:**
|
|
|
|
| Platform | Target | Output | Velikost |
|
|
|----------|--------|--------|----------|
|
|
| **Windows** | NSIS | Setup.exe | ~150 MB |
|
|
| **Windows** | Portable | .exe | ~150 MB |
|
|
| **macOS** | DMG | .dmg | ~150 MB |
|
|
| **Linux** | AppImage | .AppImage | ~150 MB |
|
|
| **Linux** | DEB | .deb | ~150 MB |
|
|
|
|
---
|
|
|
|
## 📦 **INSTALLER KONFIGURACIJA:**
|
|
|
|
### **NSIS (Windows Installer):**
|
|
- ✅ **One-click:** Ne (uporabnik izbere mapo)
|
|
- ✅ **Desktop Shortcut:** Da
|
|
- ✅ **Start Menu Shortcut:** Da
|
|
- ✅ **Uninstaller:** Avtomatsko
|
|
- ✅ **Custom Install Directory:** Da
|
|
|
|
### **DMG (macOS):**
|
|
- ✅ **Drag & Drop:** Da
|
|
- ✅ **Background Image:** Možno
|
|
- ✅ **Icon Size:** 80px
|
|
|
|
### **AppImage (Linux):**
|
|
- ✅ **Portable:** Da
|
|
- ✅ **No Installation:** Da
|
|
- ✅ **Desktop Integration:** Avtomatsko
|
|
|
|
---
|
|
|
|
## 🔍 **TESTIRANJE:**
|
|
|
|
### **1. Test Build Lokalno:**
|
|
```bash
|
|
# Build
|
|
npm run build:win
|
|
|
|
# Preveri dist mapo
|
|
dir dist
|
|
|
|
# Zaženi installer
|
|
dist\NovaFarma Setup 2.5.0.exe
|
|
```
|
|
|
|
### **2. Test Portable:**
|
|
```bash
|
|
# Zaženi portable verzijo
|
|
dist\NovaFarma 2.5.0.exe
|
|
```
|
|
|
|
### **3. Preveri Velikost:**
|
|
```bash
|
|
# Preveri velikost datotek
|
|
dir dist /s
|
|
```
|
|
|
|
---
|
|
|
|
## 📊 **METADATA:**
|
|
|
|
**Že nastavljeno v package.json:**
|
|
- ✅ **App Name:** NovaFarma
|
|
- ✅ **Version:** 2.5.0
|
|
- ✅ **Description:** 2.5D Isometric Survival Game
|
|
- ✅ **App ID:** com.novafarma.game
|
|
- ✅ **Author:** NovaFarma Team
|
|
- ✅ **License:** MIT
|
|
- ✅ **Copyright:** © 2025 NovaFarma Team
|
|
|
|
---
|
|
|
|
## 🚀 **NASLEDNJI KORAKI:**
|
|
|
|
1. **Namesti electron-builder:**
|
|
```bash
|
|
npm install --save-dev electron-builder
|
|
```
|
|
|
|
2. **Ustvari ikone:**
|
|
- Ustvari 512x512 PNG logo
|
|
- Konvertiraj v .ico, .png, .icns
|
|
- Shrani v `build/` mapo
|
|
|
|
3. **Posodobi package.json:**
|
|
- Dodaj build scripts
|
|
- Dodaj metadata
|
|
- Dodaj nsis konfiguracija
|
|
|
|
4. **Build:**
|
|
```bash
|
|
npm run build:win
|
|
```
|
|
|
|
5. **Test:**
|
|
- Zaženi installer
|
|
- Preveri ikone
|
|
- Preveri shortcuts
|
|
|
|
---
|
|
|
|
## 📁 **DATOTEKE:**
|
|
|
|
**Potrebne spremembe:**
|
|
- ✅ `package.json` - Posodobiti build config
|
|
- ✅ `build/icon.ico` - Ustvariti
|
|
- ✅ `build/icon.png` - Ustvariti
|
|
- ✅ `build/icon.icns` - Ustvariti
|
|
|
|
**Output:**
|
|
- `dist/NovaFarma Setup 2.5.0.exe` - Installer
|
|
- `dist/NovaFarma 2.5.0.exe` - Portable
|
|
|
|
---
|
|
|
|
## ⚠️ **OPOMBE:**
|
|
|
|
1. **electron-builder velikost:** ~50 MB (dev dependency)
|
|
2. **Build čas:** ~2-5 minut (odvisno od CPU)
|
|
3. **Disk space:** ~500 MB za build proces
|
|
4. **macOS build:** Potreben macOS sistem
|
|
5. **Code signing:** Opcijsko (za produkcijo)
|
|
|
|
---
|
|
|
|
**Status:** ⏳ **ČAKA NA IMPLEMENTACIJO**
|
|
**Čas:** ~15 minut (namestitev + konfiguracija + build)
|
|
|
|
**Vse je pripravljeno za build, potrebno je samo:**
|
|
1. Namestiti electron-builder
|
|
2. Ustvariti ikone
|
|
3. Zagnati build
|