Operation-Nation / sanity-plugin-schema-markup

MIT License
12 stars 6 forks source link

Simplify Integration by Providing a Standard Field or Document for Global Settings #10

Open mechtiis opened 5 months ago

mechtiis commented 5 months ago

Description

The current implementation of the package requires a globalSetting and socialLinks document to include schema markup functionality, which assumes that all users will have this document configured in a specific way. This can be limiting for users who might have different organizational structures or naming conventions in their projects.

This assumption can cause issues in applications where this specific document or field does not exist, as there is no built-in mechanism to handle missing configurations.

Issue

Users without a pre-existing globalSetting document encounter errors or unexpected behavior. The package lacks a fallback or guidance on setting up necessary configurations, which can be critical for new users or those integrating the package into existing projects.

Proposal

To simplify the integration process and enhance user experience, I propose that the package directly provides a predefined field or document specifically for schema markup settings. This approach would make it easier for users to understand and implement the required settings.

Alternatives

Improved Documentation Provide a detailed setup guide within the package documentation that explains how to create the globalSetting document, including the expected schema and necessary fields described above. Include examples and best practices for integrating this setup into different project environments.

Graceful Error Handling and Fallbacks Implement error handling that checks for the existence of the globalSetting document and necessary fields. If the document is missing, the package should provide clear, actionable error messages or log warnings, suggesting steps to resolve the configuration issue. Optionally, allow the package to use default values if the globalSetting document is not found, with clear documentation on how this affects functionality and how to override these defaults.

ericnation commented 4 months ago

Hi @mechtiis , thank you for creating this issue and bringing these short coming and limitations to our attention. I totally agree with your proposal. Sorry the delayed response on this. I accidentally didn't have notifications turned on for this repo 😅 Our developer Shuvo who owns this repo will be back from vacation next week and I'll have him review all these issues and address them. Thank you for your patience.

neutral-Stage commented 3 months ago

Thank you @mechtiis for this detailed issue. We are working on this issue and hope to release a major update soon.