Skip to content

Commit d8c5993

Browse files
committed
fix: handle comments in coalesce.json via coalesce-mcp
1 parent e312005 commit d8c5993

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 6.0.1
22
* `createAspNetCoreHmrPlugin` now displays NPM package mismatches with the standard vite overlay instead of a custom overlay.
3+
* `coalesce-mcp` now handles comments in `coalesce.json` files.
34

45
# 6.0.0
56

@@ -20,6 +21,7 @@
2021
- Added a set of Roslyn analyzers to help avoid common issues and suggest improvements. These analyzers are included and enabled by default.
2122
- All endpoints with bodies are now sent as JSON instead of form data, with the exception of endpoints that have file parameter(s) and no other non-scalar parameters.
2223
- Coalesce's Vite middleware (`UseViteDevelopmentServer`) now checks if your installed NPM packages match what's defined in package.json and package-lock.json, presenting an in-browser warning if they do not. This helps avoid forgetting to reinstall packages after pulling down changes in multi-developer projects.
24+
- Added MCP server (`coalesce-mcp`) to enable AI assistants to interact with Coalesce projects through code generation tools and template resources.
2325
- Const fields in C#, if annotated with `[Coalesce]`, are now emitted into generated TypeScript.
2426
- `System.Uri` is now supported as a type, mapping to a `string` in TypeScript.
2527
- Interfaces used as parameters in Coalesce-exposed methods are now automatically injected from services, without the need to specify `[InjectAttribute]`. This does not include known data-like interfaces including `IEnumerable`, `ICollection`, and `IFile`.
@@ -58,6 +60,11 @@
5860
- `c-select` multiple chips are no longer removable when the input is non-interactive.
5961
- `c-select` with custom tabindex no longer focuses the outer wrapper.
6062

63+
## Template
64+
- Added Aspire host project.
65+
- Added option for Hangfire.
66+
- Added option for other OAuth providers.
67+
6168
# 5.3.8
6269

6370
- Fix error in bulk saves where inheritance workaround added in 5.3.6 was not specific enough.

src/coalesce-mcp/src/tools/coalesce-generate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ async function runCoalesceGeneration(
1111
): Promise<{ output: string; exitCode: number }> {
1212
// Read and parse the coalesce.json file
1313
const configContent = await fs.readFile(configPath, "utf8");
14-
const config = JSON.parse(configContent);
14+
// Strip comments from JSON before parsing (supports // and /* */ style comments)
15+
const jsonWithoutComments = configContent
16+
.replace(/\/\*[\s\S]*?\*\//g, "") // Remove multi-line comments
17+
.replace(/\/\/.*/g, ""); // Remove single-line comments
18+
const config = JSON.parse(jsonWithoutComments);
1519

1620
// Get the web project configuration
1721
const webProject = config.webProject;

0 commit comments

Comments
 (0)