Skip to content

Commit 6fc6394

Browse files
committed
#242 feat: Enhance project.json schema support and VS Code integration
- Added `$schema` property injection in `nova init` for new projects, enabling VS Code IntelliSense and autocomplete. - Introduced authoritative `Schema-Project.json` for project.json validation. - Updated `Test-ProjectSchema` to validate against the new schema. - Removed obsolete `Schema-Build.json` and `Schema-Pester.json`. - Implemented `Export-NovaProjectJsonSchema` to copy the schema to the appropriate documentation directory. - Updated documentation to reflect schema changes and IntelliSense support. - Enhanced tests for schema validation and project.json writing functionality.
1 parent f770214 commit 6fc6394

18 files changed

Lines changed: 840 additions & 296 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
77

88
### Added
99

10+
- `project.json` now has a single authoritative JSON schema hosted at `https://www.novamoduletools.com/schema/v{major}/project.json`.
11+
- `Invoke-NovaBuild` exports the schema to `docs/schema/v{major}/project.json` during build, creating the directory when missing.
12+
- `nova init` injects `"$schema": "https://www.novamoduletools.com/schema/v{major}/project.json"` into every scaffolded project.
13+
- VS Code picks up the schema automatically to provide field validation, autocomplete, and hover descriptions while editing `project.json`.
14+
- The two partial internal schemas (`Schema-Build.json`, `Schema-Pester.json`) are removed; `Schema-Project.json` is the new single source.
15+
1016
### Changed
1117

1218
- `Get-NovaProjectInfo` now aligns its installed-version views with the existing CLI version contract.

RELEASE_NOTE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This file summarizes the release notes for NovaModuleTools. **UNRELEASED** chang
66

77
### Added
88

9+
- `nova init` now injects a `"$schema"` property into new projects pointing to the hosted versioned JSON schema, enabling VS Code IntelliSense, autocomplete, and hover descriptions while editing `project.json`.
10+
911
### Changed
1012

1113
- `Get-NovaProjectInfo` now matches the CLI version split on the PowerShell surface.

docs/project-json-reference.html

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,13 @@ <h2>How to read this file</h2>
109109
defaults
110110
to a single <code>.nupkg</code> written to <code>artifacts/packages/</code>.</p>
111111
</div>
112-
<div class="notice notice--warning">
113-
<strong>Important compatibility note.</strong>
114-
<p>The runtime and shipped examples currently use some manifest and Pester fields more broadly than
115-
the JSON schema files explicitly enumerate. In practice, the current product and examples use
112+
<div class="notice">
113+
<strong>Schema coverage.</strong>
114+
<p>The unified JSON schema covers all documented fields including
116115
<code>Manifest.ReleaseNotes</code>, <code>Manifest.LicenseUri</code>,
117-
<code>Manifest.IconUri</code>, and <code>Pester.TestResult.OutputFormat</code>. The reference
118-
below documents the live behavior that the product uses today and calls out those schema gaps
119-
where they matter.</p>
116+
<code>Manifest.IconUri</code>, and <code>Pester.TestResult.OutputFormat</code>. VS Code picks
117+
up the schema automatically when the <code>$schema</code> field is present in
118+
<code>project.json</code>.</p>
120119
</div>
121120
</section>
122121

@@ -204,6 +203,15 @@ <h2>Complete example</h2>
204203

205204
<section class="content-section" id="top-level">
206205
<h2>Top-level project settings</h2>
206+
<div class="notice">
207+
<strong>VS Code IntelliSense.</strong>
208+
<p>When <code>nova init</code> scaffolds a new project, it injects a <code>$schema</code> field
209+
that points to the versioned public schema at
210+
<code>https://www.novamoduletools.com/schema/v{major}/project.json</code>. VS Code picks this
211+
up automatically to provide field validation, autocomplete, and hover descriptions while you
212+
edit <code>project.json</code>. You can add the field manually to any existing project by
213+
inserting it as the first key in the file.</p>
214+
</div>
207215
<div class="table-scroll">
208216
<table>
209217
<thead>
@@ -215,6 +223,14 @@ <h2>Top-level project settings</h2>
215223
</tr>
216224
</thead>
217225
<tbody>
226+
<tr>
227+
<td><code>$schema</code></td>
228+
<td>Optional URI pointing to the versioned JSON schema for this file.</td>
229+
<td>Injected automatically by <code>nova init</code></td>
230+
<td>Enables VS Code IntelliSense, field validation, and hover descriptions while editing
231+
<code>project.json</code>.
232+
</td>
233+
</tr>
218234
<tr>
219235
<td><code>ProjectName</code></td>
220236
<td>Name of the module and the output folder under <code>dist/</code>.</td>

0 commit comments

Comments
 (0)