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
When debugging the simulated browser environment (e.g., `apps/console` in mock mode), strict adherence to the official toolchain is required.
167
+
168
+
🔧 Rule #1: Official MSW Integration
169
+
***Startup**: Use `@objectstack/plugin-msw` to initialize the mock API server. Do NOT write custom fetch interceptors or manual mock servers unless absolutely necessary.
170
+
***Configuration**: Ensure the `MSWPlugin` is configured with the correct `baseUrl` (e.g., `/api/v1`) to match the client's expectations.
171
+
172
+
📡 Rule #2: Client Data Fetching
173
+
***Data Access**: Always use `@objectstack/client` for data fetching. Do not use raw `fetch` or `axios` directly in components.
174
+
***Alignment**: Verify that the client's `baseUrl` matches the mock server's configuration.
175
+
176
+
🐛 Rule #3: Upstream Fixes First
177
+
***Principle**: If you encounter a bug or limitation in the official packages (`@objectstack/*`):
178
+
***Action 1**: Do NOT rely solely on local workarounds (monkey-patching) in the app.
179
+
***Action 2**: Prompt the user to modify the source code in the official packages (if available in the workspace) or report the issue.
180
+
***Reasoning**: We prioritize fixing the core engine over patching individual apps.
181
+
182
+
8. AI Workflow Instructions
166
183
🟢 On "Create New Component" (e.g., 'DataTable')
167
184
* Type Definition: Update @object-ui/types. Define DataTableSchema (columns, sorting, pagination).
168
185
* Shadcn Mapping: Look at shadcn/ui/table. Create DataTableRenderer in @object-ui/components.
0 commit comments