mirror of
https://github.com/unraid/api.git
synced 2026-01-06 08:39:54 -06:00
chore: fix local plugin builds & docs (#1851)
Raised by [MitchellThompkins](https://github.com/MitchellThompkins) in #1848 - Documents how to use Docker to build a local Connect plugin - Local Plugin flow will now build workspace packages before proceeding with plugin infra + build - Removes recommendation to run `pnpm build:watch` from root, as this race conditions and build cache issues. - Makes `pnpm dev` from root parallel, preventing servers from blocking each other. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated development workflow documentation to emphasize Docker-based plugin builds * Restructured development modes into three workflows: local Docker builds, direct deployment, and development servers * Updated build and deployment instructions * **Chores** * Modified dev script for parallel execution * Refactored build scripts with improved dependency handling <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
45
readme.md
45
readme.md
@@ -210,22 +210,34 @@ Once you have your key pair, add your public SSH key to your Unraid server:
|
||||
|
||||
### Development Modes
|
||||
|
||||
The project supports two development modes:
|
||||
#### Mode 1: Local Plugin Build (Docker)
|
||||
|
||||
#### Mode 1: Build Watcher with Local Plugin
|
||||
|
||||
This mode builds the plugin continuously and serves it locally for installation on your Unraid server:
|
||||
Build and test a full plugin locally using Docker:
|
||||
|
||||
```sh
|
||||
# From the root directory (api/)
|
||||
pnpm build:watch
|
||||
cd plugin
|
||||
pnpm run docker:build-and-run
|
||||
# Then inside the container:
|
||||
pnpm build
|
||||
```
|
||||
|
||||
This command will output a local plugin URL that you can install on your Unraid server by navigating to Plugins → Install Plugin. Be aware it will take a *while* to build the first time.
|
||||
This builds all dependencies (API, web), starts a Docker container, and serves the plugin at `http://YOUR_IP:5858/`. Install it on your Unraid server via Plugins → Install Plugin.
|
||||
|
||||
#### Mode 2: Development Servers
|
||||
#### Mode 2: Direct Deployment
|
||||
|
||||
For active development with hot-reload:
|
||||
Deploy individual packages directly to an Unraid server for faster iteration:
|
||||
|
||||
```sh
|
||||
# Deploy API changes
|
||||
cd api && pnpm unraid:deploy <SERVER_IP>
|
||||
|
||||
# Deploy web changes
|
||||
cd web && pnpm unraid:deploy <SERVER_IP>
|
||||
```
|
||||
|
||||
#### Mode 3: Development Servers
|
||||
|
||||
For active development with hot-reload (no Unraid server needed):
|
||||
|
||||
```sh
|
||||
# From the root directory - runs all dev servers concurrently
|
||||
@@ -238,22 +250,11 @@ Or run individual development servers:
|
||||
# API server (GraphQL backend at http://localhost:3001)
|
||||
cd api && pnpm dev
|
||||
|
||||
# Web interface (Nuxt frontend at http://localhost:3000)
|
||||
# Web interface (Nuxt frontend at http://localhost:3000)
|
||||
cd web && pnpm dev
|
||||
```
|
||||
|
||||
### Building the Full Plugin
|
||||
|
||||
To build the complete plugin package (.plg file):
|
||||
|
||||
```sh
|
||||
# From the root directory (api/)
|
||||
pnpm build:plugin
|
||||
|
||||
# The plugin will be created in plugin/dynamix.unraid.net.plg
|
||||
```
|
||||
|
||||
To deploy the plugin to your Unraid server:
|
||||
### Deploying to Unraid
|
||||
|
||||
```sh
|
||||
# Replace SERVER_IP with your Unraid server's IP address
|
||||
|
||||
Reference in New Issue
Block a user