-
Couldn't load subscription status.
- Fork 11
feat: improve local dev with install path #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
236e29e
feat: improve local dev with install path
elibosley 0698c92
chore: codeowners
elibosley e306b4b
chore: remove echo from the start line and use the script instead
elibosley 8103713
chore: cleanup deploy-dev scripts
elibosley 40cefcf
chore: remove tsx
elibosley 1cdd0bb
chore: fix build:watch
elibosley 2d3f149
fix: don't rm build dir
elibosley 17a5e0e
fix: nodemon delay
elibosley 4544447
chore: do not watch doinst.sh
elibosley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,20 @@ | ||
| @elibosley @pujitm @mdatelle @zackspear | ||
| # Default owners for everything in the repo | ||
| * @elibosley @pujitm @mdatelle @zackspear | ||
|
|
||
| # API specific files | ||
| /api/ @elibosley @pujitm @mdatelle | ||
|
|
||
| # Web frontend files | ||
| /web/ @elibosley @mdatelle @zackspear | ||
|
|
||
| # Plugin related files | ||
| /plugin/ @elibosley | ||
|
|
||
| # Unraid UI specific files | ||
| /unraid-ui/ @mdatelle @zackspear @pujitm | ||
|
|
||
| # GitHub workflows and configuration | ||
| /.github/ @elibosley | ||
|
|
||
| # Documentation | ||
| *.md @elibosley @pujitm @mdatelle @zackspear | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,217 @@ | ||
| # Unraid API Development Workflows | ||
|
|
||
| This document outlines the various workflow styles available for developing, building, and deploying the Unraid API monorepo. | ||
|
|
||
| ## Repository Structure | ||
|
|
||
| The Unraid API monorepo consists of several packages: | ||
|
|
||
| - `api`: The Unraid API backend | ||
| - `web`: The web frontend components | ||
| - `plugin`: The Unraid plugin | ||
| - `unraid-ui`: UI components library | ||
|
|
||
| ## Development Workflows | ||
|
|
||
| ### Local Development | ||
|
|
||
| To start all development servers in the monorepo: | ||
|
|
||
| ```bash | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| This command runs all development servers concurrently: | ||
|
|
||
| - API server: <http://localhost:3001> | ||
| - Web components: <http://localhost:4321> | ||
| - UI components: <http://localhost:5173> | ||
|
|
||
| ### Package-Specific Development | ||
|
|
||
| If you want to work on a specific package, you can run its development server individually: | ||
|
|
||
| #### API Development | ||
|
|
||
| ```bash | ||
| cd api | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| #### Web Development | ||
|
|
||
| ```bash | ||
| cd web | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| #### UI Component Development | ||
|
|
||
| ```bash | ||
| cd unraid-ui | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| ## Building Workflows | ||
|
|
||
| ### Building All Packages | ||
|
|
||
| To build all packages in the monorepo: | ||
|
|
||
| ```bash | ||
| pnpm build | ||
| ``` | ||
|
|
||
| ### Watch Mode Building | ||
|
|
||
| For continuous building during development: | ||
|
|
||
| ```bash | ||
| pnpm build:watch | ||
| ``` | ||
|
|
||
| This is useful when you want to see your changes reflected without manually rebuilding. This will also allow you to install a local plugin to test your changes. | ||
|
|
||
| ### Package-Specific Building | ||
|
|
||
| #### API Building | ||
|
|
||
| ```bash | ||
| cd api | ||
| pnpm build | ||
| ``` | ||
|
|
||
| #### Web Building | ||
|
|
||
| ```bash | ||
| cd web | ||
| pnpm build | ||
| ``` | ||
|
|
||
| #### Development Build for Web | ||
|
|
||
| ```bash | ||
| cd web | ||
| pnpm build:dev | ||
| ``` | ||
|
|
||
| ## Deployment Workflows | ||
|
|
||
| ### Deploying to Development Unraid Server | ||
|
|
||
| To deploy to a development Unraid server: | ||
|
|
||
| ```bash | ||
| pnpm unraid:deploy <SERVER_IP> | ||
| ``` | ||
|
|
||
| This command builds and deploys all components to the specified Unraid server. | ||
|
|
||
| ### Package-Specific Deployment | ||
|
|
||
| #### API Deployment | ||
|
|
||
| ```bash | ||
| cd api | ||
| pnpm unraid:deploy <SERVER_IP> | ||
| ``` | ||
|
|
||
| #### Web Deployment | ||
|
|
||
| ```bash | ||
| cd web | ||
| pnpm unraid:deploy <SERVER_IP> | ||
| ``` | ||
|
|
||
| #### Plugin Deployment | ||
|
|
||
| ```bash | ||
| cd plugin | ||
| pnpm unraid:deploy <SERVER_IP> | ||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| To run tests across all packages: | ||
|
|
||
| ```bash | ||
| pnpm test | ||
| ``` | ||
|
|
||
| ### Package-Specific Testing | ||
|
|
||
| ```bash | ||
| cd <package-directory> | ||
| pnpm test | ||
| ``` | ||
|
|
||
| ## Code Quality Workflows | ||
|
|
||
| ### Linting | ||
|
|
||
| To lint all packages: | ||
|
|
||
| ```bash | ||
| pnpm lint | ||
| ``` | ||
|
|
||
| To automatically fix linting issues: | ||
|
|
||
| ```bash | ||
| pnpm lint:fix | ||
| ``` | ||
|
|
||
| ### Type Checking | ||
|
|
||
| To run type checking across all packages: | ||
|
|
||
| ```bash | ||
| pnpm type-check | ||
| ``` | ||
|
|
||
| ## GraphQL Codegen Workflows | ||
|
|
||
| For packages that use GraphQL, you can generate types from your schema: | ||
|
|
||
| ```bash | ||
| cd <package-directory> | ||
| pnpm codegen | ||
| ``` | ||
|
|
||
| To watch for changes and regenerate types: | ||
|
|
||
| ```bash | ||
| cd <package-directory> | ||
| pnpm codegen:watch | ||
| ``` | ||
|
|
||
| ## Docker Workflows | ||
|
|
||
| The API package supports Docker-based development: | ||
|
|
||
| ```bash | ||
| cd api | ||
| pnpm container:build # Build the Docker container | ||
| pnpm container:start # Start the container | ||
| pnpm container:stop # Stop the container | ||
| pnpm container:enter # Enter the container shell | ||
| pnpm container:test # Run tests in the container | ||
| ``` | ||
|
|
||
| ## CLI Commands | ||
|
|
||
| When working with a deployed Unraid API, you can use the CLI: | ||
|
|
||
| ```bash | ||
| unraid-api --help | ||
| ``` | ||
|
|
||
| ## Recommended Workflow for New Developers | ||
|
|
||
| 1. Clone the repository: `git clone git@github.com:unraid/api.git` | ||
| 2. Set up the monorepo: `just setup` or `pnpm install` | ||
| 3. Start development servers: `pnpm dev` | ||
| 4. Make your changes | ||
| 5. Test your changes: `pnpm test` | ||
| 6. Deploy to a development server: `pnpm unraid:deploy <SERVER_IP>` | ||
| 7. Verify your changes on the Unraid server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.