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

feat(codegen): add CLI to generate types given a codegen config #5982

Conversation

sgulseth
Copy link
Member

@sgulseth sgulseth commented Mar 12, 2024

Description

Adds a CLI command for generating types. This wraps up the interfaces appended in the previous PRs.

What to review

  • CLI setup
  • Tracing

Testing

No specific tests added her as it's mainly about wrapping up interfaces from the other PRs.

Notes for release

N/A - no notes needed

Copy link

vercel bot commented Mar 12, 2024

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

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Mar 19, 2024 3:17pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 3:17pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 3:17pm

Copy link
Contributor

github-actions bot commented Mar 12, 2024

No changes to documentation

@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from d0c1813 to 64e2e8d Compare March 12, 2024 14:29
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 0ed028b to e7cff51 Compare March 12, 2024 14:29
Copy link
Contributor

github-actions bot commented Mar 12, 2024

Component Testing Report Updated Mar 19, 2024 3:30 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 59s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 2s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 20s 9 0 0

@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 64e2e8d to 25bda14 Compare March 12, 2024 14:35
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from e7cff51 to 4b1feae Compare March 12, 2024 14:35
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 25bda14 to 40225b3 Compare March 12, 2024 18:14
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 4b1feae to 1d3f323 Compare March 12, 2024 18:14
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 40225b3 to 332270d Compare March 12, 2024 18:43
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 1d3f323 to 4d6e953 Compare March 12, 2024 18:43
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 332270d to 2073606 Compare March 12, 2024 19:32
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 4d6e953 to c33cbc7 Compare March 12, 2024 19:32
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 2073606 to 7447899 Compare March 12, 2024 19:33
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from c33cbc7 to 9fb7222 Compare March 12, 2024 19:33
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 7447899 to f111f34 Compare March 12, 2024 20:36
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 9fb7222 to e9db227 Compare March 12, 2024 20:36
Copy link
Contributor

@ricokahler ricokahler left a comment

Choose a reason for hiding this comment

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

Can you double check if the "workspace:*" dependency is needed?

@@ -202,6 +202,7 @@
"@sanity/block-tools": "3.34.0",
"@sanity/cli": "3.34.0",
"@sanity/client": "^6.15.5",
"@sanity/codegen": "workspace:*",
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we publish this package.json file so it may be better to match the latest version of this package. I think pnpm/lerna should link/version it automatically. I don't think workspace:* will resolve when publishing this to npm.

Copy link
Member

@bjoerge bjoerge Mar 18, 2024

Choose a reason for hiding this comment

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

I don't think workspace:* will resolve when publishing this to npm.

It will: https://pnpm.io/workspaces#publishing-workspace-packages (it should also be respected by lerna)

Ideally we should use the workspace protocol for all workspace packages.

resolver,
})

for await (const result of queries) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

packages/sanity/tsconfig.lib.json Outdated Show resolved Hide resolved
packages/sanity/tsconfig.json Show resolved Hide resolved
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from f92f7b4 to b648872 Compare March 18, 2024 21:46
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 4ce884e to 0a18f59 Compare March 18, 2024 21:46
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from b648872 to 92520dc Compare March 19, 2024 14:07
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 0a18f59 to 037d8b8 Compare March 19, 2024 14:08
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 92520dc to 4319333 Compare March 19, 2024 15:01
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 037d8b8 to f1da568 Compare March 19, 2024 15:01
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_typegen_methods_to_codegen_package branch from 4319333 to edb7f63 Compare March 19, 2024 15:05
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from f1da568 to 4d9d54c Compare March 19, 2024 15:05
Base automatically changed from 03-12-feat_codegen_add_typegen_methods_to_codegen_package to next March 19, 2024 15:11
@sgulseth sgulseth force-pushed the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch from 4d9d54c to f451330 Compare March 19, 2024 15:11
@sgulseth sgulseth added this pull request to the merge queue Mar 19, 2024
Merged via the queue into next with commit 3742b3f Mar 19, 2024
42 of 46 checks passed
@sgulseth sgulseth deleted the 03-12-feat_codegen_add_CLI_to_generate_types_given_a_codegen_config branch March 19, 2024 15:13
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.

None yet

4 participants