Skip to content

Commit daebb16

Browse files
committed
less weird
1 parent 95a41d0 commit daebb16

2 files changed

Lines changed: 76 additions & 168 deletions

File tree

.github/copilot-instructions.md

Lines changed: 26 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -4,193 +4,51 @@ Always follow these instructions first and fallback to additional search and con
44

55
## Project Overview
66

7-
Coalesce is a framework for rapid development of ASP.NET Core + Vue.js web applications. It generates DTOs, API controllers, and TypeScript from Entity Framework Core models.
7+
Coalesce is a framework for rapid development of ASP.NET Core + Vue.js web applications. It generates DTOs, API controllers, and TypeScript from Entity Framework Core models and other C# code.
88

99
## Prerequisites & Dependencies
1010

11-
**CRITICAL**: Install these exact versions and runtimes before working with the codebase:
11+
The required tools and dependencies are automatically installed via the GitHub Actions workflow at `.github/workflows/copilot-setup-steps.yml`.
1212

13-
- **.NET 9.0 SDK**: Required for building projects. Install via: `curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0 --install-dir ~/.dotnet`
14-
- **.NET 8.0 runtime and ASP.NET Core runtime**: Required for tests. Install via:
15-
```bash
16-
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0 --runtime dotnet --install-dir ~/.dotnet
17-
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0 --runtime aspnetcore --install-dir ~/.dotnet
18-
```
19-
- **Node.js v20+**: Tested with v20.19.4
20-
- **NPM v10+**: Tested with v10.8.2
21-
- **Add .NET to PATH**: `export PATH="$HOME/.dotnet:$PATH"`
13+
## Instructions
2214

23-
## Build & Development Workflow
15+
- Always update the documentation when making changes or adding features that will affect developers who use Coalesce.
16+
- Always add an entry to CHANGELOG.md when adding new features or fixing non-trivial bugs.
17+
- Avoid making breaking changes if not necessary. A less obvious example of a breaking change would be changing an existing CSS class name.
18+
- Consider adding or updating example files in `playground\Coalesce.Web.Vue3\src\examples` when making changes to coalesce-vue-vuetify.
2419

25-
**ALWAYS run these commands in order with the specified timeouts:**
26-
27-
### 1. Install Dependencies
28-
```bash
29-
# From repository root - NEVER run npm ci in subdirectories
30-
npm ci
31-
```
32-
- **Timing**: 2-3 minutes. NEVER CANCEL. Set timeout to 300+ seconds.
33-
- **Purpose**: Installs all NPM workspace dependencies
20+
## Validation Checklist
3421

35-
### 2. Restore .NET Packages
36-
```bash
37-
export PATH="$HOME/.dotnet:$PATH" # Always set PATH first
38-
dotnet restore
39-
```
40-
- **Timing**: 1-2 minutes. NEVER CANCEL. Set timeout to 180+ seconds.
41-
- **Purpose**: Restores NuGet packages for all projects
22+
After making changes, ALWAYS run this validation sequence:
4223

43-
### 3. Build Solution
44-
```bash
45-
export PATH="$HOME/.dotnet:$PATH"
46-
dotnet build --no-restore --configuration Release
47-
```
48-
- **Timing**: 45-60 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
49-
- **Purpose**: Builds all .NET projects
24+
1. **Build verification**:
25+
From the repo root:
5026

51-
### 4. Run Tests
5227
```bash
53-
export PATH="$HOME/.dotnet:$PATH"
54-
# Run .NET 9.0 tests (reliable)
55-
dotnet test --no-build --configuration Release --framework net9.0
28+
npm ci
29+
dotnet build
30+
cd src/coalesce-vue && npm run build
31+
cd ../coalesce-vue-vuetify3 && npm run build
5632
```
57-
- **Timing**: 35-40 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
58-
- **Results**: 704 tests should pass, 4 may be skipped
59-
- **Note**: .NET 8.0 tests may fail due to runtime dependencies
60-
61-
## Code Generation Workflow
6233

63-
Test code generation using the playground project:
34+
2. **Test verification**:
35+
From the repo root:
6436

6537
```bash
66-
cd playground/Coalesce.Web.Vue3
67-
export PATH="$HOME/.dotnet:$PATH"
68-
npm run coalesce
38+
dotnet test
39+
cd src/coalesce-vue && npm run test
40+
cd ../coalesce-vue-vuetify3 && npm run test
6941
```
70-
- **Timing**: 15-20 seconds. Set timeout to 60+ seconds.
71-
- **Purpose**: Generates TypeScript and API code from .NET models
72-
73-
## Frontend Build & Test
7442

75-
### Vue Package Testing
76-
```bash
77-
# Test core Vue package
78-
cd src/coalesce-vue
79-
npm run test
80-
```
81-
- **Timing**: 7-10 seconds. 568 tests should pass.
43+
3. **Template verification**:
44+
If you make changes to the template in the `templates` directory, validate the changes by running `TestLocal.ps1 -- "--FeatureOne --FeatureTwo"` where the FeatureOne, FeatureTwo parameters are replaced with each flag that might affect the changes you made. Run it multiple times if there are different combinations of feature flags that might interact in different ways. The flags are the variables checked by the `#if` in the template code.
8245

83-
```bash
84-
# Test Vuetify package
85-
cd src/coalesce-vue-vuetify3
86-
npm run test
87-
```
88-
- **Timing**: 15-20 seconds. 98 tests should pass.
46+
4. **Documentation verification**:
47+
If the documentation was updated:
8948

90-
### Playground Frontend Build
91-
```bash
92-
cd playground/Coalesce.Web.Vue3
93-
npm run build
94-
```
95-
- **Timing**: 5-10 seconds. Builds Vite frontend.
96-
97-
## Project Structure
98-
99-
- **`src/`**: Core Coalesce framework (.NET projects)
100-
- `IntelliTect.Coalesce/`: Main framework
101-
- `IntelliTect.Coalesce.CodeGeneration/`: Code generation engine
102-
- `IntelliTect.Coalesce.Vue/`: ASP.NET Core Vue integration
103-
- `coalesce-vue/`: Core Vue.js TypeScript package
104-
- `coalesce-vue-vuetify3/`: Vuetify 3 component library
105-
- `IntelliTect.Coalesce.DotnetTool/`: CLI tool for code generation
106-
107-
- **`playground/`**: Example application
108-
- `Coalesce.Domain/`: Entity Framework models
109-
- `Coalesce.Web.Vue3/`: Full-stack Vue 3 + ASP.NET Core app
110-
111-
- **`docs/`**: VitePress documentation website
112-
- **`templates/`**: Project templates for `dotnet new`
113-
114-
## Known Issues & Workarounds
115-
116-
### Documentation Build
11749
```bash
11850
cd docs
119-
npm run build # FAILS due to spelling errors in markdown files
120-
```
121-
- **Issue**: CSpell validation fails on technical terms
122-
- **Workaround**: Skip docs build for now
123-
124-
### ESLint (Playground)
125-
```bash
126-
cd playground/Coalesce.Web.Vue3
127-
npm run lint # FAILS due to old ESLint config format
128-
```
129-
- **Issue**: Uses legacy .eslintrc.js with new ESLint v9
130-
- **Workaround**: ESLint needs migration to flat config format
131-
132-
### Playground Application Runtime
133-
The playground application cannot run locally without configuration:
134-
- **Database**: Requires SQL Server LocalDB or SQLite configuration
135-
- **Azure OpenAI**: Requires Azure OpenAI endpoint configuration
136-
- **Workaround**: Use these environment variables for basic testing:
137-
```bash
138-
export ConnectionStrings__DefaultConnection="Data Source=app.db"
139-
export Azure__OpenAI__Deployment="dummy"
140-
export Azure__OpenAI__Endpoint="https://dummy.openai.azure.com/"
141-
export Azure__OpenAI__Key="dummy"
142-
```
143-
144-
## Validation Checklist
145-
146-
After making changes, ALWAYS run this validation sequence:
147-
148-
1. **Build verification**:
149-
```bash
150-
npm ci # 2-3 minutes, NEVER CANCEL
151-
export PATH="$HOME/.dotnet:$PATH"
152-
dotnet restore # 1-2 minutes, NEVER CANCEL
153-
dotnet build --no-restore --configuration Release # 45-60 seconds
154-
```
155-
156-
2. **Test verification**:
157-
```bash
158-
dotnet test --no-build --configuration Release --framework net9.0 # 35-40 seconds
159-
cd src/coalesce-vue && npm run test # 7-10 seconds
160-
cd ../coalesce-vue-vuetify3 && npm run test # 15-20 seconds
161-
```
162-
163-
3. **Code generation verification**:
164-
```bash
165-
cd playground/Coalesce.Web.Vue3
166-
npm run coalesce # 15-20 seconds
167-
npm run build # 5-10 seconds
168-
```
169-
170-
## Key Configuration Files
171-
172-
- **`coalesce-vue3.json`**: Code generation configuration for playground
173-
- **`package.json`** (root): NPM workspace configuration
174-
- **`Coalesce.sln`**: Main solution file with all projects
175-
- **`Directory.Packages.props`**: Centralized NuGet package versions
176-
177-
## Debugging Code Generation
178-
179-
To debug the CLI tool against playground:
180-
```bash
181-
cd src/IntelliTect.Coalesce.DotnetTool
182-
dotnet run --framework net8.0 -- ../../coalesce-vue3.json --debug
51+
npm run build
18352
```
18453

185-
## Common Commands Summary
186-
187-
| Task | Command | Timing | Critical Notes |
188-
|------|---------|---------|----------------|
189-
| Install deps | `npm ci` | 2-3 min | NEVER CANCEL, timeout 300s |
190-
| Restore .NET | `dotnet restore` | 1-2 min | NEVER CANCEL, timeout 180s |
191-
| Build | `dotnet build --no-restore --configuration Release` | 45-60s | timeout 120s |
192-
| Test | `dotnet test --no-build --configuration Release --framework net9.0` | 35-40s | 704 tests pass |
193-
| Generate | `npm run coalesce` | 15-20s | From playground dir |
194-
| Vue build | `npm run build` | 5-10s | From playground dir |
195-
196-
REMEMBER: Always set `export PATH="$HOME/.dotnet:$PATH"` before running .NET commands, and NEVER CANCEL long-running build operations.
54+
REMEMBER: NEVER CANCEL long-running build operations.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
contents: read
23+
24+
timeout-minutes: 30
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup dotnet
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: |
34+
8.0.x
35+
9.0.x
36+
37+
- name: Install JavaScript dependencies
38+
run: npm ci
39+
40+
- name: Restore .NET packages
41+
run: dotnet restore
42+
43+
- name: Build solution
44+
run: dotnet build --no-restore --configuration Release
45+
46+
- name: Build coalesce-vue-vuetify3
47+
working-directory: src/coalesce-vue-vuetify3
48+
run: |
49+
npm run build-local-deps
50+
npm run build

0 commit comments

Comments
 (0)