[Feature] Add build.typegen_command support for non-JS Shopify Functions#6870
Open
davejcameron wants to merge 2 commits intomainfrom
Open
[Feature] Add build.typegen_command support for non-JS Shopify Functions#6870davejcameron wants to merge 2 commits intomainfrom
davejcameron wants to merge 2 commits intomainfrom
Conversation
Contributor
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Contributor
Coverage report
Test suite run success3783 tests passing in 1455 suites. Report generated by 🧪jest coverage report action from 5ccee3c |
58d6dfa to
acd9b69
Compare
shayarnett
approved these changes
Feb 19, 2026
d1d70cd to
9cf1e5d
Compare
9cf1e5d to
40c3b83
Compare
isaacroldan
reviewed
Feb 20, 2026
aswamy
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


WHY are these changes introduced?
Currently, typegen for Shopify Functions is hardcoded to run
npm exec -- graphql-code-generator --config package.json, which only works for JavaScript functions. For other languages (Rust, Zig, C), users must bundle their typegen step inside abuild.shscript alongside their actual build command. This makes it impossible to run typegen independently viashopify app function typegenfor non-JS functions.WHAT is this pull request doing?
Adds a
build.typegen_commandTOML field so users can specify a custom typegen command that runs both viashopify app function typegenand automatically before the build command.Example TOML:
Changes:
typegen_commandas an optional string field in the function extension schematypegenCommandgetter onExtensionInstancebuildGraphqlTypesto run custom command when set, falling back to the existing JS codegen flowtypegen_commandis configuredtypegenCLI command description to be language-agnosticHow to test your changes?
npx vitest run packages/app/src/cli/services/function/build.test.tsnpx vitest run packages/app/src/cli/services/build/extension.test.tsnpx vitest run packages/app/src/cli/models/extensions/specifications/function.test.tsTo test manually with a non-JS function:
typegen_command = "echo typegen running"under[build]in a function's TOMLshopify app function typegen— should execute the custom commandshopify app function build— should run typegen before the build commandMeasuring impact
How do we know this change was effective? Please choose one:
Checklist