Skip to content

Commit 12586fa

Browse files
Document playwrightCliVersion strict SemVer validation
Document the playwrightCliVersion configuration setting and its strict SemVer 2.0 requirement, introduced in microsoft/aspire#18205. The Playwright CLI installer now validates that playwrightCliVersion contains a MAJOR.MINOR.PATCH version string before forwarding it to npm. Dist-tags (latest), ranges (>=1.0.0), and v-prefixed forms (v1.52.0) are all rejected with a descriptive error message. Add a 'Pin the Playwright CLI version' section to aspire-skills.mdx covering the configuration key, valid format, and the new error message users may see if their config value does not pass validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 643504f commit 12586fa

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/frontend/src/content/docs/get-started/aspire-skills.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,30 @@ Use `dotnet-inspect` only when an agent needs to inspect .NET code or packages o
256256

257257
The `playwright-cli` skill works best alongside the `aspire` skill. The agent will first use Aspire to discover the running app and the correct frontend endpoint, especially when multiple web resources exist. After it has the target URL, it can use the Playwright CLI to automate browser testing.
258258

259+
## Pin the Playwright CLI version
260+
261+
By default, `aspire agent init` resolves the Playwright CLI version from the npm registry according to the range bundled with your installed Aspire CLI. You can override this with an exact version by setting `playwrightCliVersion` in your `aspire.config.json`:
262+
263+
```json title="aspire.config.json"
264+
{
265+
"playwrightCliVersion": "1.52.0"
266+
}
267+
```
268+
269+
Or via the CLI:
270+
271+
```bash title="Aspire CLI"
272+
aspire config set playwrightCliVersion 1.52.0
273+
```
274+
275+
The value must be a valid [SemVer 2.0](https://semver.org/spec/v2.0.0.html) version in strict `MAJOR.MINOR.PATCH` form. Values that are not valid strict SemVer — such as dist-tags (`latest`), npm version ranges (`>=1.0.0`), or prefixed versions (`v1.52.0`) — are rejected with a clear error message:
276+
277+
```text title="Error"
278+
The value of configuration setting 'playwrightCliVersion' ('latest') is not a valid SemVer 2.0 version.
279+
```
280+
281+
Correct the value to an exact version such as `1.52.0` and re-run `aspire agent init`.
282+
259283
## Skill locations
260284

261285
Aspire installs each selected skill into the selected skill locations. For example, a standard location can contain every Aspire workflow skill and selected companion skills:

0 commit comments

Comments
 (0)