Skip to content

Commit 138aed3

Browse files
authored
feat: added management for network-policies, storage-objects with layout and screen size improvements (#54)
## Description This PR adds comprehensive network policy management functionality to the CLI, including: - New commands for network policy CRUD operations (list, create, get, delete) - Interactive UI components for creating and managing network policies - Generic ResourceDetailPage component to reduce code duplication - Reusable form components (FormField, FormSelect, FormTextInput, FormListManager, FormActionButton) - Integration with devbox creation to support network policy assignment - Updated @runloop/api-client to version 1.3.0 for network policy support ## Type of Change - [x] New feature (non-breaking change which adds functionality) - [x] Code refactoring ## Changes Made ### Commands - Added `rli network-policy list` - List all network policies with pagination - Added `rli network-policy get <id>` - Get network policy details - Added `rli network-policy create` - Interactive network policy creation - Added `rli network-policy delete <id>` - Delete a network policy - Updated `rli devbox create` to support `--network-policy` flag ### Components & Refactoring - Created `ResourceDetailPage` - Generic detail page component (reduces duplication) - Created `NetworkPolicyCreatePage` - Interactive form for creating policies - Created `ConfirmationPrompt` - Reusable confirmation dialog - Created form components package for consistent form UX - Refactored detail screens for blueprints, objects, and snapshots to use new generic components ### Services & Stores - Added `networkPolicyService` for API interactions - Added `networkPolicyStore` for state management - Updated services to use new API client features ### Dependencies - Updated `@runloop/api-client` from ^1.0.0 to 1.3.0 ## Testing - [x] I have tested locally - [x] All existing tests pass (192/192) - [x] Build passes without errors - [x] Linter passes (43 warnings related to TypeScript `any` in existing code) ## Review Feedback Addressed - Fixed code duplication: removed duplicate `formatTimeAgo` functions - Fixed unused variable warnings: prefixed unused parameters with underscore - Removed unused import: `updateNetworkPolicy` from NetworkPolicyDetailScreen - Reduced lint warnings from 52 to 43 ## Checklist - [x] My code follows the code style of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly (README.md) - [x] My changes generate no new warnings - [x] New and existing unit tests pass locally with my changes
1 parent b4c9ccb commit 138aed3

60 files changed

Lines changed: 7218 additions & 1240 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ rli object upload <path> # Upload a file as an object
130130
rli object delete <id> # Delete an object (irreversible)
131131
```
132132

133+
### Network-policy Commands (alias: `np`)
134+
135+
```bash
136+
rli network-policy list # List network policies
137+
rli network-policy get <id> # Get network policy details
138+
rli network-policy create # Create a new network policy
139+
rli network-policy delete <id> # Delete a network policy
140+
```
141+
133142
### Mcp Commands
134143

135144
```bash

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
},
6868
"dependencies": {
6969
"@modelcontextprotocol/sdk": "^1.19.1",
70-
"@runloop/api-client": "^1.0.0",
70+
"@runloop/api-client": "1.3.0",
7171
"@types/express": "^5.0.3",
7272
"chalk": "^5.3.0",
7373
"commander": "^14.0.1",

0 commit comments

Comments
 (0)