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
// This file is automatically generated by Nx Console
6
+
7
+
You are in an nx workspace using Nx 21.3.11 and yarn as the package manager.
8
+
9
+
You have access to the Nx MCP server and the tools it provides. Use them. Follow these guidelines in order to best help the user:
10
+
11
+
# General Guidelines
12
+
- When answering questions, use the nx_workspace tool first to gain an understanding of the workspace architecture
13
+
- For questions around nx configuration, best practices or if you're unsure, use the nx_docs tool to get relevant, up-to-date docs!! Always use this instead of assuming things about nx configuration
14
+
- If the user needs help with an Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors
15
+
- To help answer questions about the workspace structure or simply help with demonstrating how tasks depend on each other, use the 'nx_visualize_graph' tool
16
+
17
+
# Generation Guidelines
18
+
If the user wants to generate something, use the following flow:
19
+
20
+
- learn about the nx workspace and any specifics the user needs by using the 'nx_workspace' tool and the 'nx_project_details' tool if applicable
21
+
- get the available generators using the 'nx_generators' tool
22
+
- decide which generator to use. If no generators seem relevant, check the 'nx_available_plugins' tool to see if the user could install a plugin to help them
23
+
- get generator details using the 'nx_generator_schema' tool
24
+
- you may use the 'nx_docs' tool to learn more about a specific generator or technology if you're unsure
25
+
- decide which options to provide in order to best complete the user's request. Don't make any assumptions and keep the options minimalistic
26
+
- open the generator UI using the 'nx_open_generate_ui' tool
27
+
- wait for the user to finish the generator
28
+
- read the generator log file using the 'nx_read_generator_log' tool
29
+
- use the information provided in the log file to answer the user's question or continue with what they were doing
30
+
31
+
# Running Tasks Guidelines
32
+
If the user wants help with tasks or commands (which include keywords like "test", "build", "lint", or other similar actions), use the following flow:
33
+
- Use the 'nx_current_running_tasks_details' tool to get the list of tasks (this can include tasks that were completed, stopped or failed).
34
+
- If there are any tasks, ask the user if they would like help with a specific task then use the 'nx_current_running_task_output' tool to get the terminal output for that task/command
35
+
- Use the terminal output from 'nx_current_running_task_output' to see what's wrong and help the user fix their problem. Use the appropriate tools if necessary
36
+
- If the user would like to rerun the task or command, always use `nx run <taskId>` to rerun in the terminal. This will ensure that the task will run in the nx context and will be run the same way it originally executed
37
+
- If the task was marked as "continuous" do not offer to rerun the task. This task is already running and the user can see the output in the terminal. You can use 'nx_current_running_task_output' to get the output of the task to verify the output.
Copy file name to clipboardExpand all lines: README.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,22 @@ yarn nx g service test-app --type=general
69
69
# Will create a project called @services/test-app in the services/ folder
70
70
```
71
71
72
+
Newly added service may not be detected by Nx immediately. You will need to update lockfile then reset Nx cache & stop its daemon and update Nx’s internal dependency graph and ensure your workspace is in sync.
73
+
74
+
```bash
75
+
# Update lockfile
76
+
yarn install
77
+
78
+
# Reset Nx cache and stop the daemon
79
+
yarn nx reset
80
+
81
+
# Update Nx's internal dependency graph and ensure workspace is in sync
82
+
yarn nx sync
83
+
84
+
# Alternatively, you can combine them into one line
85
+
yarn install && yarn nx reset && yarn nx sync
86
+
```
87
+
72
88
Import and instantiate the service in `ApplicationStage` inside `applications/core/bin/main.ts`:
73
89
74
90
```typescript
@@ -91,8 +107,6 @@ class ApplicationStage extends Stage {
91
107
}
92
108
```
93
109
94
-
Note: You will need to run `yarn install` and `yarn nx sync` before other projects will detect the new service
95
-
96
110
---
97
111
98
112
### 🧪 Testing the application
@@ -161,6 +175,7 @@ yarn nx g remove <service-name>
161
175
162
176
You may need to remove imports of the service from the application first.
163
177
You may need to remove references to the service in `nx.json` afterwards.
178
+
You may need to run `yarn install` to remove the service reference from the lock file.
0 commit comments