Skip to content

Commit c2e3ad5

Browse files
authored
Merge branch 'main' into copilot/fix-569
2 parents 7e6f888 + 6af3eed commit c2e3ad5

File tree

75 files changed

+5966
-5373
lines changed

Some content is hidden

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

75 files changed

+5966
-5373
lines changed

.github/copilot-instructions.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Coalesce Framework Development Instructions
2+
3+
Always follow these instructions first and fallback to additional search and context gathering only when the information here is incomplete or found to be in error.
4+
5+
## Project Overview
6+
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.
8+
9+
## Prerequisites & Dependencies
10+
11+
The required tools and dependencies are automatically installed via the GitHub Actions workflow at `.github/workflows/copilot-setup-steps.yml`.
12+
13+
## Instructions
14+
15+
- Format PR titles with Semantic Commits. The work item number should follow the colon after the commit type like `feat: #12345 added ...`
16+
- Always update the documentation when making changes or adding features that will affect developers who use Coalesce.
17+
- Always add an entry to CHANGELOG.md when adding new features or fixing non-trivial bugs.
18+
- Avoid making breaking changes if not necessary. A less obvious example of a breaking change would be changing an existing CSS class name.
19+
- Consider adding or updating example files in `playground\Coalesce.Web.Vue3\src\examples` when making changes to coalesce-vue-vuetify.
20+
21+
## Validation Checklist
22+
23+
After making changes, ALWAYS run this validation sequence:
24+
25+
1. **Build verification**:
26+
From the repo root:
27+
28+
```bash
29+
npm ci
30+
dotnet build
31+
cd src/coalesce-vue && npm run build
32+
cd ../coalesce-vue-vuetify3 && npm run build
33+
```
34+
35+
2. **Test verification**:
36+
From the repo root:
37+
38+
```bash
39+
dotnet test
40+
cd src/coalesce-vue && npm run test
41+
cd ../coalesce-vue-vuetify3 && npm run test
42+
```
43+
44+
3. **Template verification**:
45+
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.
46+
47+
4. **Documentation verification**:
48+
If the documentation was updated, run `npm run build` in the docs folder. You can expect the link checks to fail - you do not have access to the internet to validate the links.
49+
50+
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

.github/workflows/part-build.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,38 @@ jobs:
139139
- run: npm ci
140140
working-directory: ${{ github.workspace }}
141141

142-
- run: npm run build
142+
- name: Build docs (without linkcheck)
143+
run: npm run build-only
143144

144145
- name: Upload Artifact
145146
uses: actions/upload-artifact@v4
146147
with:
147148
name: docs
148149
path: docs/.vitepress/dist/Coalesce
149150

151+
linkcheck-docs:
152+
runs-on: ubuntu-latest
153+
needs: build-docs
154+
defaults:
155+
run:
156+
shell: bash
157+
working-directory: docs
158+
159+
steps:
160+
- uses: actions/checkout@v4
161+
162+
- run: npm ci
163+
# working-directory: ${{ github.workspace }}
164+
165+
- name: Download built docs
166+
uses: actions/download-artifact@v4
167+
with:
168+
name: docs
169+
path: docs/.vitepress/dist/Coalesce
170+
171+
- name: Run linkcheck
172+
run: npm run linkcheck
173+
150174
validate-template:
151175
runs-on: ubuntu-latest
152176
name: "test template: ${{matrix.testCase}}"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
- `ListViewModel.$orderByToggle()` method added to cycle through ascending, descending, and no ordering for a field.
2323
- Custom methods now support descriptions via `DescriptionAttribute`. These are displayed in the admin pages.
2424
- Added `FileTypeAttribute` to control allowed file types for custom method file parameters.
25+
- Added `ClientCacheDurationSeconds` property to `ExecuteAttribute` to customize client-side cache duration for GET custom methods with `VaryByProperty`.
2526
- `c-admin-display`: Binary values now render as links that will download the value as a file, instead of only showing the length in bytes.
2627
- `c-datetime-picker`: Added prop `showTodayButton`
2728
- `c-input`: Added a `filter` prop for enum inputs to restrict the values available for selection.
2829
- `c-select`: When bound to a `ViewModel` or `ViewModelCollection`, selected items are converted to `ViewModel` instances before being emitted so that event handlers will receive the final object instance, rather than the intermediate plain model instance.
2930
- `c-select`: Now supports binding to a non-many-to-many collection navigation property. Selecting an item will populate the foreign key of the dependent item, and deselecting an item will clear the foreign key. This mechanism is only available when using c-select directly - it is not delegated by c-input.
3031
- `c-select`: The `create` prop now supports a `position` property to control whether the create item appears at the start ('start', default) or end ('end') of the dropdown list.
3132
- `c-select-many-to-many`: The `itemTitle` prop now receives the existing selected middle entity instance, if there is one.
33+
- `c-loader-status`: Added `show-success` prop and flag to display success messages when operations complete successfully.
3234

3335
## Fixes
3436
- Fix error in codegen when using JS reserved keywords or C# contextual keywords as parameter names.

docs/check-links.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let server;
2323
try {
2424
// Start static file server
2525
server = createServer((req, res) =>
26-
handler(req, res, { public: ".vitepress/dist" })
26+
handler(req, res, { public: ".vitepress/dist" }),
2727
);
2828

2929
await new Promise((resolve) => server.listen(8087, resolve));
@@ -32,7 +32,12 @@ try {
3232
await waitOn({ resources: ["http://localhost:8087"], timeout: 30000 });
3333

3434
// Run linkcheck
35-
await run("npm", ["run", "linkcheck"]);
35+
await run("linkcheck", [
36+
"localhost:8087/Coalesce",
37+
"-e",
38+
"--skip-file",
39+
"./.vitepress/linkcheck-skip-file.txt",
40+
]);
3641

3742
process.exit(0);
3843
} catch (err) {

docs/cspell.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
"language": "en",
44
"words": [
55
"appsettings",
6+
"ASPNETCORE",
67
"autosave",
78
"autosaving",
89
"Axios",
910
"bootstrap-datetimepicker",
1011
"Coalesce",
1112
"coalesceko",
1213
"coalescevue",
14+
"discoverability",
1315
"dontSerialize",
1416
"dtos",
1517
"EF",
@@ -18,11 +20,12 @@
1820
"instanceof",
1921
"IntelliTect",
2022
"mkdir",
23+
"msword",
2124
"nameof",
22-
"overridable",
23-
"discoverability",
2425
"netcoreapp",
2526
"netstandard",
27+
"officedocument",
28+
"openxmlformats",
2629
"overridable",
2730
"POCOs",
2831
"queryable",
@@ -31,6 +34,8 @@
3134
"readonly",
3235
"snapshotted",
3336
"Stampable",
37+
"swashbuckle",
38+
"Swashbuckle",
3439
"TPCT",
3540
"treeshaken",
3641
"typeof",
@@ -41,9 +46,9 @@
4146
"Vitest",
4247
"Vuetify",
4348
"webp",
44-
"wwwroot",
45-
"Swashbuckle",
46-
"swashbuckle"
49+
"westus",
50+
"wordprocessingml",
51+
"wwwroot"
4752
],
4853
"ignorePaths": [
4954
"node_modules"

docs/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"license": "Apache-2.0",
99
"scripts": {
1010
"dev": "vitepress dev",
11-
"linkcheck": "linkcheck localhost:8087/Coalesce -e --skip-file ./.vitepress/linkcheck-skip-file.txt",
12-
"build": "cspell \"**/*.md\" && vitepress build --outDir .vitepress/dist/Coalesce && node check-links.mjs"
11+
"build-only": "cspell \"**/*.md\" && vitepress build --outDir .vitepress/dist/Coalesce",
12+
"linkcheck": "node check-links.mjs",
13+
"build": "npm run build-only && npm run linkcheck"
1314
},
1415
"dependencies": {
1516
"shiki": "1.4.0"
@@ -18,6 +19,7 @@
1819
"gray-matter": "^4.0.3",
1920
"linkcheck-bin": "file:linkcheck-bin-3.0.0-1.fix-issue-56.tgz",
2021
"serve-handler": "^6.1.6",
21-
"vitepress": "2.0.0-alpha.5"
22+
"vitepress": "2.0.0-alpha.5",
23+
"wait-on": "^8.0.4"
2224
}
2325
}

docs/stacks/vue/coalesce-vue-vuetify/components/c-loader-status.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ Wrap a save/submit button:
4646
</c-loader-status>
4747
```
4848

49+
Show success alerts when operations complete successfully:
50+
``` vue-html
51+
<c-loader-status :loaders="person.$save" show-success>
52+
<button> Save </button>
53+
</c-loader-status>
54+
```
55+
4956
Hides the table before the first load has completed, or if loading the list encountered an error. Don't show the progress bar after we've already loaded the list for the first time (useful for loads that occur without user interaction, e.g. `setInterval`):
5057

5158
``` vue-html
@@ -119,13 +126,14 @@ no-error-content?: boolean;
119126
no-initial-content?: boolean;
120127
no-progress?: boolean;
121128
no-initial-progress?: boolean;
122-
no-secondary-progress?: boolean;" lang="ts" id="flags-props" />
129+
no-secondary-progress?: boolean;
130+
show-success?: boolean;" lang="ts" id="flags-props" />
123131

124132
Component level [flags](#flags) options that control behavior when the simple form of `loaders` (single instance or array) is used, as well as provide baseline defaults that can be overridden by the advanced form of `loaders` (object map) .
125133

126134
## Flags
127135

128-
The available flags are as follows, all of which default to `true`. In the object literal syntax for `loaders`, the `no-` prefix may be omitted to set the flag to `true`.
136+
The available flags are as follows, all of which default to `true` except for `show-success` which defaults to `false`. In the object literal syntax for `loaders`, the `no-` prefix may be omitted to set the flag to `true`.
129137

130138
| <div style="width:160px">Flag</div> | Description |
131139
| - | - |
@@ -135,6 +143,7 @@ The available flags are as follows, all of which default to `true`. In the objec
135143
| `no-progress` | Master toggle for whether the progress indicator is shown in any scenario. |
136144
| `no-initial-progress` | Controls whether the progress indicator is shown when an API Caller is loading for the very first time (i.e. when `caller.wasSuccessful === null`). |
137145
| `no-secondary-progress` | Controls whether the progress indicator is shown when an API Caller is loading any time after its first invocation (i.e. when `caller.wasSuccessful !== null`). |
146+
| `show-success` | Controls whether success alerts are shown when API calls complete successfully (i.e. when `caller.wasSuccessful === true`). |
138147

139148
## Slots
140149

docs/stacks/vue/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ If any of the options you chose above require external integrations, you'll need
7575
7676
### AppHost Project
7777
78-
The AppHost project is a [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview) dev-time orchestration project. It is recommended you set this as your startup project when developing, although this is not strictly required if your project only has SQL Server as its sole dependency. If you're not familiar with .NET Aspire, you're strongly encouraged to read through its [overview documentation](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview#dev-time-orchestration) and learn about the features of the [Aspire dashboard](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/explore).
78+
The AppHost project is a [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview) dev-time orchestration project. It is recommended you set this as your startup project when developing, although this is not strictly required if your project only has SQL Server as its sole dependency. If you're not familiar with .NET Aspire, you're strongly encouraged to read through its [overview documentation](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview) and learn about the features of the [Aspire dashboard](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/explore).
7979
8080
### Data Project
8181

docs/topics/audit-logging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public class AppDbContext : DbContext, IAuditLogDbContext<AuditLog>
117117

118118
### Exclusions & Formatting
119119

120-
Coalesce's audit logging is built on top of [Entity Framework Plus](https://entityframework-plus.net/ef-core-audit) and can be configured using all of its [configuration](https://entityframework-plus.net/ef-core-audit#scenarios), including [includes/excludes](https://entityframework-plus.net/ef-core-audit-exclude-include-entity) and [custom property formatting](https://entityframework-plus.net/ef-core-audit-format-value).
120+
Coalesce's audit logging uses Entity Framework's change tracking capabilities to automatically detect and record changes to your entities. It intercepts the `SaveChanges` operation to capture entity state changes and property modifications before they're committed to the database.
121121

122-
Coalesce will not use EF Plus's `AuditManager.DefaultConfiguration` global singleton instance. You must use Coalesce's configuration extensions which allow for more targeted configuration per context that does not rely on a global static singleton. For example:
122+
You can configure which entities and properties to include or exclude from auditing, as well as customize how property values are formatted in the audit logs. Coalesce's configuration extensions allow for targeted configuration per context without relying on global static singletons. For example:
123123

124124
``` c#
125125
public class AppDbContext : DbContext, IAuditLogDbContext<AuditLog>

0 commit comments

Comments
 (0)