You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,14 @@ public class MyView : ViewBase
31
31
32
32
The topmost view in an Ivy application is called an [App](https://docs.ivy.app/onboarding/concepts/apps.md) and is decorated with the `[App]` attribute. The attribute uses **named constructor parameters** (lowercase):
-`title` is optional — if omitted, it is derived from the class name (e.g. `CustomersApp` → "Customers").
38
38
-`icon` uses the `Icons` enum — these are Lucide icons in PascalCase (e.g. `Icons.Link`, `Icons.Settings`, `Icons.Rocket`).
39
-
-`path` groups the app in the navigation sidebar (e.g. `path: new[] { "Apps" }`).
40
-
- There is no `group` or `chrome` parameter. Chrome is configured in `Program.cs` via `server.UseDefaultApp(typeof(MyApp))`.
41
-
- Use **lowercase** parameter names (`icon:`, `path:`), NOT PascalCase property names (`Icon =`, `Path =`) — PascalCase causes CS0655.
39
+
-`group` groups the app in the navigation sidebar (e.g. `group: new[] { "Apps" }`).
40
+
- There is no `chrome` parameter. Chrome is configured in `Program.cs` via `server.UseDefaultApp(typeof(MyApp))`. Always ensure `server.AddAppsFromAssembly()` is called before `UseDefaultApp` — without it, `[App]`-attributed classes are not registered and the server throws at runtime.
41
+
- Use **lowercase** parameter names (`icon:`, `group:`), NOT PascalCase property names (`Icon =`, `Group =`) — PascalCase causes CS0655.
42
42
43
43
An app is built into a tree of widgets. This is what's rendered to the screen.
44
44
@@ -328,6 +328,10 @@ userNameState.ToTextInput().Required().MaxLength(50).Placeholder("Enter your nam
328
328
-`DbContext` must never be injected directly! Always resolve `IDbContextFactory<T>` via `UseService` and create scoped instances with `CreateDbContextAsync()` inside query/mutation lambdas
329
329
-**Nested layouts MUST use parentheses** — `Layout.Vertical() | (Layout.Horizontal() | child1 | child2)` — without parentheses, C# left-to-right `|` evaluation adds children to the outer layout, not the inner one. See the nested layout example in the Layouts section above.
330
330
331
+
## CLI Commands
332
+
333
+
Prefer using `ivy cli explain` for command discovery over MCP server tools as it provides a reliable, built-in structural breakdown.
-**Backend (C#)**: Run `dotnet test` in the root directory
81
-
-**Frontend (TypeScript)**: Run `npm run test` in the `src/frontend/` directory
82
+
-**Frontend (TypeScript)**: Run `vp test` in the `src/frontend/` directory
82
83
83
84
### End-to-End Testing
84
85
85
-
E2E tests are written using Playwright and are located in `src/frontend/e2e/`. We provide npm scripts for running these tests:
86
+
E2E tests are written using Playwright and are located in `src/frontend/e2e/`. We provide `vp` scripts for running these tests:
86
87
87
88
```bash
88
89
# Run all E2E tests
89
-
npm run e2e
90
+
vp run e2e
90
91
91
92
# Run only Ivy.Docs E2E tests
92
-
npm run e2e:docs
93
+
vp run e2e:docs
93
94
94
95
# Run only Ivy.Samples E2E tests
95
-
npm run e2e:samples
96
+
vp run e2e:samples
96
97
```
97
98
98
-
**Important**: Always use the npm scripts (`npm run e2e*`) instead of `npx playwright test` to ensure consistent usage of the locally installed Playwright version and avoid version conflicts.
99
+
**Important**: Always use the `vp` scripts (`vp run e2e*`) instead of `npx playwright test` to ensure consistent usage of the locally installed Playwright version and avoid version conflicts.
99
100
100
101
Additional Playwright options can be passed after `--`:
101
102
102
103
```bash
103
-
npm run e2e -- --headed # Run tests in headed mode
104
-
npm run e2e -- --debug # Run tests in debug mode
105
-
npm run e2e:samples -- --project=chromium # Run samples tests in Chrome only
104
+
vp run e2e -- --headed # Run tests in headed mode
105
+
vp run e2e -- --debug # Run tests in debug mode
106
+
vp run e2e:samples -- --project=chromium # Run samples tests in Chrome only
106
107
```
107
108
108
109
## Contributing Guidelines
@@ -260,15 +261,15 @@ Before submitting your code, ensure it follows the project's linting and formatt
260
261
261
262
#### Frontend (TypeScript/React)
262
263
263
-
- Use `npm run lint:fix` to automatically fix ESLint issues
264
-
- Use `npm run format` to format code with Prettier
264
+
- Use `vp lint --fix .` to automatically fix ESLint issues
265
+
- Use `vp fmt .` to format code with Oxfmt
265
266
- These commands should be run from the `src/frontend/` directory
266
267
267
268
#### Pre-commit Hooks
268
269
269
270
The project uses pre-commit hooks that will automatically run linting and formatting on staged files. Make sure your code passes these checks before committing. More details how pre-commit hooks are being set up can be found in `src/frontend/README.md`
270
271
271
-
TL;DR, if you have run `npm install` in the `src/frontend`, most likely all pre-commit hooks will be working for you, that cover linting and formatting for Ivy-Framework.
272
+
TL;DR, if you have run `vp install` in the `src/frontend`, most likely all pre-commit hooks will be working for you, that cover linting and formatting for Ivy-Framework.
0 commit comments