question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Edit May 9th, 2021: This issue now represents the 1.0 roadmap!

There has been a lot of development since the first release of this lib and the next version of this lib has a lot coming. The project will now be divided up into different sub-packages:

  • @sanity-codegen/schema-codegen — code generation and extraction for sanity schemas
  • @sanity-codegen/groq-codegen — code generation and extraction or GROQ queries in code
  • @sanity-codegen/client — thin wrapper client that augments @sanity/client for GROQ codegen
  • @sanity-codegen/types — a separate, no-deps package for shared types
  • @sanity-codegen/cli — a new CLI powered by oclif
  • @sanity-codegen/jamstack-client — a specialized client intended for use in jamstack apps. Will include preview mode logic

Edit July 12th, 2021: See here 👉 https://github.com/ricokahler/sanity-codegen/issues/5#issuecomment-877925182

✨ Features

Here are a list of features that are slotted for 1.0:

Schema Codegen:

  • schema extractor — a new API for extracting sanity schemas from sanity studio setups (shims our a browser environment)
  • schema normalizer/validator (in-development) — a new API for taking in sanity schemas and normalizing them for easier use in schema codegen
  • refined schema codegen — a re-write of the schema codegen using the new normalizer.
  • support for additional types — See #6
  • support weak references — Some references are weak and thus when expanding them, they should be defined as T | null

GROQ Codegen:

  • GROQ to TS transform — a new API to transform GROQ ASTs into TS ASTs
  • GROQ plucker/extractor (but buggy) — a new API to parse typescript or javascript files for GROQ queries
  • GROQ codegen API — a new API that ties the above two APIs

Client wrapper:

  • client wrapper — a wrapper for existing sanity clients (e.g. @sanity/client, picosanity) that augment their APIs for use with GROQ codegen

Jamstack client:

Note: This client is the successor to the current client. You may not need this package if you plan on using sanity-codegen with just the client wrapper

  • Compatibility with the client wrapper
  • Refined preview mode

CLI:

  • Refined CLI with help commands (via oclif)
  • New GROQ codegen command
  • Watch modes

📅 Timelines

  1. Get this version feature-complete (the items above)
  2. Release a beta, focus on testing and iterating on the new APIs, gathering feedback
  3. Release an RC, focus on documentation (and a docs site)

👋 Help Wanted

If you’d like to beta test the new version of this lib, please reach out to me at ricokahler@me.com. I’d love to get this new version in your hands and gather feedback. Right the docs for the new version aren’t great so we’d need to connect to get you set up.

Warning the alpha is currently very rough!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:17
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
ricokahlercommented, Jul 12, 2021

I am planning on releasing a beta in a few weeks

So an update on this, I got overconfident on the previous approach and near the last 20%, it didn’t pan out 😅.

TL;DR I’m rewriting the GROQ code generator from the ground up. See #149

1reaction
paul-vdcommented, Dec 1, 2020

API codegen docs — currently the API usage is relatively undocumented

To simplify the documents setup you can maybe opt for something like nextra, It is a really simple setup, and it supports md, mdx out of the box.

I tested it today for a new project, and had some documents setup in a matter of minutes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Roadmap - Product Information, Latest Updates, and Reviews ...
Roadmap is a simple tool to get your team aligned on what's next. Visualise your plan with just drag and drop, add details,...
Read more >
Roadmap v.1.0 for Google Workspace - Sortd ‍
Radically transparent project & team management app. Summary.
Read more >
Satisfactory 1.0 Roadmap REVEALED! - YouTube
Satisfactory 1.0 Roadmap REVEALED! - Satisfactory Update 5 NewsTis Satisfactory trailer season! Satisfactory Update 5 is coming out this ...
Read more >
Deadfrenz Roadmap 1.0. P2E: | by Deadfellaz | Medium
This Roadmap is a guide, and as time moves on and we progress through the year, more opportunities arise, things may be added...
Read more >
Peglin - Updated Roadmap to 1.0! - Steam News
Hello everyone! Apologies for the lack of updates on what we've been working on behind the scenes, the team has been heads down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found