Skip to content

Conversation

@michaeltlombardi
Copy link
Collaborator

PR Summary

Important

This change depends on #1304 - it will remain in draft until that change merges.

This change re-exports the dsc-lib-jsonschema crate as dsc_lib::schemas, replacing the prior module and direct references to dsc-lib-jsonschema for transformers and other crate functionality.

Now other crates can choose whether to depend on dsc-lib with all of the associated functionality, or dsc-lib-jsonschema if they only need the JSON Schema related functionality.

PR Context

Prior to this change, the dsc-lib crate used dsc-lib-jsonschema as a dependency. With the transition of the DscRepoSchema trait and the related types to the dsc-lib-jsonschema crate, it makes more sense to re-export the dependency from within the dsc-lib crate.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR re-exports the dsc-lib-jsonschema crate as dsc_lib::schemas, consolidating JSON Schema-related functionality and enabling more flexible dependency management. The change allows consumers to either depend on the full dsc-lib or just dsc-lib-jsonschema for schema-only needs.

Key changes:

  • Re-exported dsc-lib-jsonschema as a public module in dsc-lib instead of internal module implementation
  • Migrated schema types (DscRepoSchema, SchemaForm, SchemaUriPrefix, RecognizedSchemaVersion) to dsc-lib-jsonschema
  • Moved UnrecognizedSchemaUri error type to dsc-lib-jsonschema and implemented proper error delegation with #[from] attribute
  • Added build script infrastructure to dynamically generate RecognizedSchemaVersion enum from git tags

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/dsc-lib/src/lib.rs Re-exports dsc-lib-jsonschema as schemas module
lib/dsc-lib/src/schemas/mod.rs Removed 694-line module (functionality moved to dsc-lib-jsonschema)
lib/dsc-lib-jsonschema/src/lib.rs Added dsc_repo module export
lib/dsc-lib-jsonschema/src/dsc_repo/mod.rs Main module consolidating schema URI generation and management logic
lib/dsc-lib-jsonschema/src/dsc_repo/dsc_repo_schema.rs Defines DscRepoSchema trait and UnrecognizedSchemaUri error type
lib/dsc-lib-jsonschema/src/dsc_repo/schema_form.rs Defines SchemaForm enum for different schema publication forms
lib/dsc-lib-jsonschema/src/dsc_repo/schema_uri_prefix.rs Defines SchemaUriPrefix enum for schema URI prefixes
lib/dsc-lib-jsonschema/src/dsc_repo/recognized_schema_version.rs Includes generated code for RecognizedSchemaVersion enum
lib/dsc-lib-jsonschema/build.rs New build script that generates RecognizedSchemaVersion enum from version data
lib/dsc-lib-jsonschema/.versions.ps1 PowerShell script to query git tags and update version data
lib/dsc-lib-jsonschema/.versions.json Version data used for code generation
lib/dsc-lib-jsonschema/Cargo.toml Added thiserror dependency and build dependencies
lib/dsc-lib-jsonschema/locales/en-us.toml Added localization strings for UnrecognizedSchemaUri error
lib/dsc-lib-jsonschema/src/tests/dsc_repo.rs Migrated tests for dsc_repo module functionality
lib/dsc-lib/src/dscerror.rs Updated error handling to use #[from] for UnrecognizedSchemaUri
lib/dsc-lib/locales/en-us.toml Removed localization strings moved to dsc-lib-jsonschema
lib/dsc-lib/src/extensions/extension_manifest.rs Updated imports and method name (schema_metadataschema_property_metadata)
lib/dsc-lib/src/dscresources/resource_manifest.rs Updated imports and method name
lib/dsc-lib/src/configure/config_doc.rs Updated imports and method name
lib/dsc-lib/src/extensions/dscextension.rs Updated import path for idiomaticize_string_enum
lib/dsc-lib/src/dscresources/dscresource.rs Updated import path for idiomaticize_string_enum
lib/dsc-lib/src/discovery/command_discovery.rs Updated import path for idiomaticize_externally_tagged_enum
lib/dsc-lib/src/configure/config_result.rs Updated import path for idiomaticize_string_enum
lib/dsc-lib/src/configure/config_progress.rs Updated import path for idiomaticize_string_enum
tools/test_group_resource/src/main.rs Updated import path for DscRepoSchema
lib/dsc-lib-jsonschema/.clippy.toml Added "PowerShell" to valid identifiers
Cargo.lock Updated with new thiserror dependency for dsc-lib-jsonschema

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

@michaeltlombardi michaeltlombardi force-pushed the gh-538/main/re-export-dsc-lib-jsonschema branch from 6da04b2 to 93a3470 Compare December 4, 2025 21:01
Prior to this change, the `dsc-lib` crate used `dsc-lib-jsonschema` as
a dependency. With the transition of the `DscRepoSchema` trait and the
related types to the `dsc-lib-jsonschema` crate, it makes more sense to
re-export the dependency from within the `dsc-lib` crate.

This change re-exports the `dsc-lib-jsonschema` crate as
`dsc_lib::schemas`, replacing the prior module and direct references to
`dsc-lib-jsonschema` for transformers and other crate functionality.

Now other crates can choose whether to depend on `dsc-lib` with all of
the associated functionality, or `dsc-lib-jsonschema` if they only need
the JSON Schema related functionality.
@michaeltlombardi michaeltlombardi force-pushed the gh-538/main/re-export-dsc-lib-jsonschema branch from 93a3470 to fb4fb26 Compare December 5, 2025 14:52
@michaeltlombardi michaeltlombardi marked this pull request as ready for review December 5, 2025 15:00
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Dec 5, 2025
Merged via the queue into PowerShell:main with commit 9e5de33 Dec 5, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants