Skip to content

feat: add schema generation scripts and update dependencies #2662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rossnelson
Copy link
Collaborator

Description & motivation 💭

This PR introduces several updates and improvements to the project:

  • New Features:

    • Added new scripts for schema and type generation using Bun.
    • Introduced .tool-versions for managing Node.js and Bun versions.
  • Dependency Updates:

    • Updated dependencies in package.json and pnpm-lock.yaml.
    • Added new dependencies such as zod, json-schema-to-zod, and openapi-typescript.
  • Tooling Enhancements:

    • Updated .gitignore to include /tmp.
    • Modified scripts in package.json for better integration with Bun and schema generation.
  • Codebase Changes:

    • Modified several Svelte components for schema integration.
    • Added new schema-related files in src/lib/schemas.

Breaking Changes ⚠️

  • Updated dependencies and introduced new scripts that require Bun. Ensure Bun is installed and configured before running the project.

Design Considerations 🎨

  • The use of zod and json-schema-to-zod for schema validation and type generation ensures better type safety and developer experience.

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  1. Install Bun and ensure it is configured correctly.
  2. Run the new schema generation scripts using pnpm generate:schemas.
  3. Verify the integration of updated dependencies and schema-related changes.

Checklists

Draft Checklist

Merge Checklist

  • Ensure all tests pass.

Issue(s) closed

  • N/A

Docs

Any docs updates needed?

  • Update README to include instructions for installing and configuring Bun.
  • Document the new schema generation scripts.

@rossnelson rossnelson requested review from rossedfort and a team as code owners April 7, 2025 22:57
Copy link

vercel bot commented Apr 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2025 7:52pm

- Added new scripts for schema and type generation using Bun.
- Updated dependencies in `package.json` and `pnpm-lock.yaml`.
- Introduced `.tool-versions` for managing Node.js and Bun versions.
- Updated `.gitignore` to include `/tmp`.
- Modified several Svelte components for schema integration.
- Added new schema-related files in `src/lib/schemas`.

BREAKING CHANGE: Updated dependencies and introduced new scripts that
require Bun. Ensure Bun is installed and configured before running
the project.

TIP: use [`asdf`](https://asdf-vm.com/) to manage multiple runtime
versions
- Introduced `handleBunError` utility for standardized error handling.
- Updated schema generation scripts to use `handleBunError`.
- Enhanced error messages with actionable advice and resolution steps.
- Improved schema generation logic for better reliability.
- Updated dependencies in `package.json` and `pnpm-lock.yaml`.
Copy link
Contributor

@rossedfort rossedfort left a comment

Choose a reason for hiding this comment

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

This looks good to me although I don't have a ton of context on this project.

* feat(schemas): add generated schemas

* refactor(search-attributes): poc generated schema usage (#2645)

Also: Refactored the `fetchSearchAttributesForNamespace` function to enhance
readability and maintainability. Introduced helper functions for parsing
responses, mutating attributes, and handling errors.

Changes include:
- Replaced inline logic with `parsedResponse` and `mutateSearchAttributes`.
- Added `mapEntries` utility for transforming object entries.
- Updated types to align with the new schema-based approach.
- Removed redundant `ListSearchAttributesResponse` type.

This improves code clarity and aligns with schema validation practices.
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