[Blueprints] Type Blueprint v2 theme install failures - #3866
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Blueprint v2 declaration typing to allow theme install failure policies (skip-theme | throw) and adds type-level tests to validate correct/incorrect values.
Changes:
- Add
onError?: 'skip-theme' | 'throw'to the v2 theme schema type. - Add a type-level positive test for theme
onError: 'skip-theme'. - Add a type-level negative test ensuring plugin-only policies (e.g.
skip-plugin) are rejected for themes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/playground/blueprints/src/tests/v2/blueprint-v2-declaration.spec.ts | Adds type assertions covering valid/invalid theme onError values. |
| packages/playground/blueprints/src/lib/v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema.ts | Extends the theme schema typing with a theme-specific onError policy union. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+702
to
+707
| /** | ||
| * Sometimes it's fine when a theme fails to install. | ||
| * | ||
| * @default "throw" | ||
| */ | ||
| onError?: 'skip-theme' | 'throw'; |
Comment on lines
+143
to
+155
| it('accepts theme install failure handling', () => { | ||
| const blueprint = { | ||
| version: 2, | ||
| themes: [ | ||
| { | ||
| source: 'twentytwentyfour', | ||
| onError: 'skip-theme', | ||
| }, | ||
| ], | ||
| } satisfies BlueprintV2Declaration; | ||
|
|
||
| expect(blueprint.version).toBe(2); | ||
| }); |
Comment on lines
+702
to
+707
| /** | ||
| * Sometimes it's fine when a theme fails to install. | ||
| * | ||
| * @default "throw" | ||
| */ | ||
| onError?: 'skip-theme' | 'throw'; |
adamziel
added a commit
that referenced
this pull request
Jul 2, 2026
## What? Types the Blueprint v2 theme `ifAlreadyInstalled` policy as `overwrite | skip | error`. ## Why? Plugin installs already expose the collision policy in the v2 declaration type. Theme installs use the same policy shape, and typing it lets TypeScript consumers catch invalid values before a Blueprint reaches a runner. ## Scope This is type-only. It does not change the Blueprint v2 runner or theme install behavior. ## Stack Base: #3866 ## Testing - `npm run format:uncommitted` - `git diff --check` - `npm exec nx run playground-blueprints:typecheck` - `npm exec nx run playground-blueprints:lint` - `npm exec nx run playground-blueprints:test:vite -- --testFiles=packages/playground/blueprints/src/tests/v2/blueprint-v2-declaration.spec.ts`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Types the Blueprint v2 theme
onErrorpolicy asskip-theme | throw.Why?
The v2 schema already has the plugin install failure policy typed. Themes need the same declaration-level coverage so TypeScript consumers can express optional theme installs and reject plugin-only policies like
skip-plugin.Scope
This is type-only. It does not change the Blueprint v2 runner or theme install behavior.
Testing
npm run format:uncommittedgit diff --checknpm exec nx run playground-blueprints:typechecknpm exec nx run playground-blueprints:lintnpm exec nx run playground-blueprints:test:vite -- --testFiles=packages/playground/blueprints/src/tests/v2/blueprint-v2-declaration.spec.tsPart of #2592.