Run function GraphQL typegen with the project package manager#7265
Draft
Run function GraphQL typegen with the project package manager#7265
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/node-package-manager.d.ts@@ -68,6 +68,10 @@ export declare function packageManagerFromUserAgent(env?: NodeJS.ProcessEnv): Pa
* @returns The dependency manager
*/
export declare function getPackageManager(fromDirectory: string): Promise<PackageManager>;
+export declare function packageManagerBinaryCommandForDirectory(directory: string, binary: string, ...args: string[]): Promise<{
+ command: string;
+ args: string[];
+}>;
interface InstallNPMDependenciesRecursivelyOptions {
/**
* The dependency manager to use to install the dependencies.
|
4 tasks
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.

What
Use the function project's package manager when running GraphQL type generation for JavaScript functions.
Why
buildGraphqlTypeswas hard-coded tonpm exec. That breaks function projects that use a different package manager, especially when the function lives inside a workspace and the lockfile is only present above the function directory.How
cli-kithelper that maps a directory to the right binary invocationgraphql-code-generatorfor JS functionsTesting
Create or use a JS function extension in a non-npm project and run
shopify app function build. GraphQL type generation should run through that project's package manager instead ofnpm exec.