Skip to content

[Blueprints] Type Blueprint v2 version constraints - #3870

Merged
adamziel merged 1 commit into
trunkfrom
type/blueprint-v2-version-constraints
Jul 2, 2026
Merged

[Blueprints] Type Blueprint v2 version constraints#3870
adamziel merged 1 commit into
trunkfrom
type/blueprint-v2-version-constraints

Conversation

@adamziel

@adamziel adamziel commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What?

Tightens the Blueprint v2 declaration types for wordpressVersion and phpVersion object constraints.

Why?

Top-level runtime labels like beta, trunk, nightly, and next are valid as direct version values, but constraint objects need comparable versions for min and max. This makes that distinction visible to TypeScript consumers.

Scope

Type-only. No runner behavior changes.

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

Part of #2592.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Tightens Blueprint v2 TypeScript declaration types so that wordpressVersion/phpVersion constraint objects (e.g. { min, max }) require comparable version strings, while still allowing runtime labels at the top-level version fields.

Changes:

  • Introduces specialized “comparable version” types for WordPress/PHP constraint object fields.
  • Updates the Blueprint v2 schema types to use the new constraint-specific version types.
  • Adds type-level tests covering valid constraints and expected type errors for non-comparable constraint values.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/playground/blueprints/src/tests/v2/blueprint-v2-declaration.spec.ts Adds compile-time coverage for constraint object acceptance/rejection via satisfies and @ts-expect-error.
packages/playground/blueprints/src/lib/v2/wep-1-blueprint-v2-schema/appendix-B-data-sources.ts Adds new constraint-focused version expression types to distinguish comparable versions from runtime labels.
packages/playground/blueprints/src/lib/v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema.ts Switches constraint object fields to use the new comparable-version types and expands WordPress constraint shape.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamziel
adamziel force-pushed the type/blueprint-v2-version-constraints branch from a45e658 to 6b9bcfb Compare July 2, 2026 19:59
@adamziel
adamziel merged commit 1fdceac into trunk Jul 2, 2026
52 of 53 checks passed
@adamziel
adamziel deleted the type/blueprint-v2-version-constraints branch July 2, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment