Skip to content
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

groq-builder: support sanity typegen output #293

Merged
merged 18 commits into from
Aug 1, 2024
Merged

Conversation

scottrippey
Copy link
Member

@scottrippey scottrippey commented Jul 15, 2024

Description

Aligns groq-builder to work with the types generated by sanity typegen, by allowing for "reference symbols" to be optional.
This change is fully backwards compatible with previous versions of groq-builder and is still fully compatible with @sanity-typed types

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist: (Feel free to delete this section upon completion)

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run all builds, tests, and linting and all checks pass
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Jul 15, 2024

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

Name Status Preview Comments Updated (UTC)
groqd ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 5:48pm

Copy link

changeset-bot bot commented Jul 15, 2024

🦋 Changeset detected

Latest commit: 9b8087d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
groq-builder Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@scottrippey scottrippey merged commit 8278f62 into main Aug 1, 2024
4 checks passed
@scottrippey scottrippey deleted the sanity-typegen branch August 1, 2024 17:46
@github-actions github-actions bot mentioned this pull request Aug 1, 2024
scottrippey added a commit that referenced this pull request Aug 1, 2024
* docs: duplicated the `README.md` from the root to the package

* fix(sanity typegen): made generated types have optional reference symbols, to match sanity typegen

* fix(sanity typegen): added support for optional reference symbols

* fix(sanity typegen): changeset

* fix(sanity typegen): added "real" generated types

* fix(sanity typegen): added "real" generated types with --enforce-required-fields

* fix(sanity typegen): renamed old generated types

* fix(sanity typegen): updated all tests with new generated types

* fix(sanity typegen): updated changelog

* fix(docs): Hide details for "What is GROQ"

* fix(docs): added mention of "GroqD"

* fix(docs): allow easier configuration by manually filtering non-documents

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): minor wording improvements

* fix(docs): removed unused ExtractDocumentTypes

* fix(docs): improved jsdocs for `createGroqBuilder`

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
scottrippey added a commit that referenced this pull request Dec 18, 2024
* fix(docs): added sample dataset types

* fix(docs): refactored "playground" module to external file

* fix(docs): added error handling to `require` method

* fix(docs): improved TS config

* fix(arcade): support `groq-builder-playground`

* Docs: updated README (#291)

* docs: duplicated the `README.md` from the root to the package

* docs: changeset

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#292)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* groq-builder: support sanity typegen output (#293)

* docs: duplicated the `README.md` from the root to the package

* fix(sanity typegen): made generated types have optional reference symbols, to match sanity typegen

* fix(sanity typegen): added support for optional reference symbols

* fix(sanity typegen): changeset

* fix(sanity typegen): added "real" generated types

* fix(sanity typegen): added "real" generated types with --enforce-required-fields

* fix(sanity typegen): renamed old generated types

* fix(sanity typegen): updated all tests with new generated types

* fix(sanity typegen): updated changelog

* fix(docs): Hide details for "What is GROQ"

* fix(docs): added mention of "GroqD"

* fix(docs): allow easier configuration by manually filtering non-documents

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): minor wording improvements

* fix(docs): removed unused ExtractDocumentTypes

* fix(docs): improved jsdocs for `createGroqBuilder`

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#297)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(arcade): refactored `extraLibs` extraction

* fix(arcade): removed unused code

* fix(arcade): generate .d.ts files for all playground files

* fix(arcade): improved docs for gather-types

* fix(arcade): improved error handling

* fix(arcade): runQuery supports GroqBuilder

* chore(typescript): improved the way we define the SchemaConfig to simplify TS messaging

* chore(typescript): improved the way we define the SchemaConfig to simplify TS messaging

* chore(typescript): improved error messages for runQuery

* chore(typescript): update Monaco to latest

* chore(typescript): added type-fest to build

* fix(arcade): improved examples with `deref` and validation

* docs: updated introduction

* docs: added usage example

* chore(typescript): simplify config by passing all `schemaTypes`

* docs: removed unused script

* docs: added configuration docs

* docs: Improved configuration content

* docs: improved introduction examples

* docs: improved configuration

* feat(fragment): added `fragmentForType` method, and improved error reporting for fragments

* docs: minor jsdoc improvements

* docs: changed "intro" to "overview"

* docs: api: organized outline of doc

* docs: api: added docs for `filterByType`

* docs: api: added docs for `slice`

* docs: api: added docs for `project`

* docs: api: added docs for `raw/params/validate/nullable/deref`

* docs: api: added docs for `zod` and `transform`

* docs: api: improved generated types for zod

* docs: api: removed `q.nullToUndefined` helper, in favor of simply `q.default`

* docs: api: fixed tests from zod type refactor

* docs: api: include `zod.literal`

* docs: api: updated tests and samples to new `schemaTypes`

* docs: api: docs for Zod Extras

* docs: api: reorder docs

* docs: api: updated advanced links

* docs: api: reordered all docs

* docs: api: split API docs into multiple files

* docs: api: added `Query Parameters` docs

* docs: api: added `Validation` docs

* docs: api: reorganized the `raw` docs

* docs: fragments: documented "creating fragments"

* docs: fragments: documented "fragment usage"

* docs: projection: "ellipsis operator"

* docs: conditionals: improved `_type` typings

* docs: conditionals: added test for "overlapping conditionals"

* docs: conditionals: ensure vitest is testing! yikes

* docs: conditionals: "inline conditionals"

* docs: conditionals: added "select" docs

* docs: conditionals: added inline docs

* docs: removed obsolete `fragments` docs

* docs: updated "migration" docs

* docs: removed legacy docs

* docs: lint fix

* docs: do not commit generated .d.ts files

* docs: lint fix

* docs: update dependencies

* docs: dedupe dependencies

* docs: upgrade docusaurus

* docs: ignore TS warnings

* docs: ignore generated files

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
scottrippey added a commit that referenced this pull request Jan 3, 2025
* GroqD 1.0 - Docs (#302)

* fix(docs): added sample dataset types

* fix(docs): refactored "playground" module to external file

* fix(docs): added error handling to `require` method

* fix(docs): improved TS config

* fix(arcade): support `groq-builder-playground`

* Docs: updated README (#291)

* docs: duplicated the `README.md` from the root to the package

* docs: changeset

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#292)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* groq-builder: support sanity typegen output (#293)

* docs: duplicated the `README.md` from the root to the package

* fix(sanity typegen): made generated types have optional reference symbols, to match sanity typegen

* fix(sanity typegen): added support for optional reference symbols

* fix(sanity typegen): changeset

* fix(sanity typegen): added "real" generated types

* fix(sanity typegen): added "real" generated types with --enforce-required-fields

* fix(sanity typegen): renamed old generated types

* fix(sanity typegen): updated all tests with new generated types

* fix(sanity typegen): updated changelog

* fix(docs): Hide details for "What is GROQ"

* fix(docs): added mention of "GroqD"

* fix(docs): allow easier configuration by manually filtering non-documents

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): minor wording improvements

* fix(docs): removed unused ExtractDocumentTypes

* fix(docs): improved jsdocs for `createGroqBuilder`

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#297)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(arcade): refactored `extraLibs` extraction

* fix(arcade): removed unused code

* fix(arcade): generate .d.ts files for all playground files

* fix(arcade): improved docs for gather-types

* fix(arcade): improved error handling

* fix(arcade): runQuery supports GroqBuilder

* chore(typescript): improved the way we define the SchemaConfig to simplify TS messaging

* chore(typescript): improved the way we define the SchemaConfig to simplify TS messaging

* chore(typescript): improved error messages for runQuery

* chore(typescript): update Monaco to latest

* chore(typescript): added type-fest to build

* fix(arcade): improved examples with `deref` and validation

* docs: updated introduction

* docs: added usage example

* chore(typescript): simplify config by passing all `schemaTypes`

* docs: removed unused script

* docs: added configuration docs

* docs: Improved configuration content

* docs: improved introduction examples

* docs: improved configuration

* feat(fragment): added `fragmentForType` method, and improved error reporting for fragments

* docs: minor jsdoc improvements

* docs: changed "intro" to "overview"

* docs: api: organized outline of doc

* docs: api: added docs for `filterByType`

* docs: api: added docs for `slice`

* docs: api: added docs for `project`

* docs: api: added docs for `raw/params/validate/nullable/deref`

* docs: api: added docs for `zod` and `transform`

* docs: api: improved generated types for zod

* docs: api: removed `q.nullToUndefined` helper, in favor of simply `q.default`

* docs: api: fixed tests from zod type refactor

* docs: api: include `zod.literal`

* docs: api: updated tests and samples to new `schemaTypes`

* docs: api: docs for Zod Extras

* docs: api: reorder docs

* docs: api: updated advanced links

* docs: api: reordered all docs

* docs: api: split API docs into multiple files

* docs: api: added `Query Parameters` docs

* docs: api: added `Validation` docs

* docs: api: reorganized the `raw` docs

* docs: fragments: documented "creating fragments"

* docs: fragments: documented "fragment usage"

* docs: projection: "ellipsis operator"

* docs: conditionals: improved `_type` typings

* docs: conditionals: added test for "overlapping conditionals"

* docs: conditionals: ensure vitest is testing! yikes

* docs: conditionals: "inline conditionals"

* docs: conditionals: added "select" docs

* docs: conditionals: added inline docs

* docs: removed obsolete `fragments` docs

* docs: updated "migration" docs

* docs: removed legacy docs

* docs: lint fix

* docs: do not commit generated .d.ts files

* docs: lint fix

* docs: update dependencies

* docs: dedupe dependencies

* docs: upgrade docusaurus

* docs: ignore TS warnings

* docs: ignore generated files

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* GroqD 1.0 Prep - Updated Arcade Samples (#304)

* feat(errors): extracted projection validation helpers

* feat(errors): export `ValidationErrors` class

* feat(errors): ensure we handle arrays with `field` projections

* feat(errors): added jsdocs for ValidationErrors

* docs: updated playground examples to new syntax

* docs: updated playground to show error messages

* feat(errors): use explicit output types for better compatibility

* feat(errors): switch error `path` to array

* docs(playground): format paths correctly

* test(conditionals): added test for `isExhaustive`

* docs(arcade): pretty-print queries

* docs(arcade): updated conditional example

* node engine (#303)

* docs(arcade): improved todo-list data

* docs(arcade): added "TODO" samples to Arcade

* feat(validation): simplified public api

* docs(arcade): consolidated pathId logic

* test(conditional): fixed isExhaustive test

* docs: eslint ignore compiled files

* chore: added "checks" script

* feat: renamed default method to `createGroqBuilderLite`

* docs: updated broken links

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
Co-authored-by: Nathan Kluth <nlkluth@gmail.com>

* GroqD 1.0 RC - Build config (#306)

* build: release from RC branch

* build: added changeset

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* GroqD 1.0 RC - Build fixes (#307)

* build: release from RC branch

* build: added changeset

* build: ensure all workflows are using same `pnpm` version

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#308)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* build: added "deprecated" notice

* build: added "deprecated" notice

* Version Packages (#309)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* GroqD 1.0 RC - Renamed to `groqd`, bumped to `1.0` (#310)

* docs: updated README

* docs: updated NPM description

* build: renamed to `groqd` official!

* build: renamed to `groqd-legacy`

* rc: added changeset

* rc: renamed from `groq-builder` to `groqd-1`

* rc: renamed from `groqd` to `groqd-legacy`

* rc: updated build scripts

* rc: updated imports

* arcade: simplified arcade examples to match docs

* fix: added explicit return type for `makeSafeQueryRunner` for improved compatibility

* fix: improved error messages for unnecessary parameters

* arcade: use relative paths for imports

* fix: export all new types from makeSafeQueryRunner

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#311)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* build(groqd-legacy): do not publish groqd-legacy

* build: remove RC branch from release workflow

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Kluth <nlkluth@gmail.com>
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