-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
bazel: generate graphql operation interfaces, css module typings #45756
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff e8aae97...3efc8f8.
|
Codenotify: Notifying subscribers in OWNERS files for diff e8aae97...3efc8f8.
|
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 7405f24 and 749998a or learn more. Open explanation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should address a couple of CI failures before merging:
- Run prettier over
client/shared/dev/generateGraphQlOperations.js
- Fix the issues with the "Circular type definition of import alias" that blocks many CI jobs.
7405f24
to
7c2c845
Compare
noExport: false, | ||
enumValues: | ||
operation.interfaceNameForOperations === 'SharedGraphQlOperations' | ||
? undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was another thing that was different in one of the operations which we missed.
@kormide was there a reason for changing how this works other then removing duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes here were to reduce duplication to make it easier to generate one operations file at a time under Bazel. Is the problem the presence of the field which is undefined
rather than the field not existing as above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SharedGraphQlOperations
interface needs this set to undefined, where all the others have the same value (which was easy to miss when refactoring it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
async function main(args) { | ||
if (args.length !== 2) { | ||
throw new Error('Usage: <schemaName>') | ||
} | ||
|
||
const [interfaceNameForOperations, outputPath] = args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the error message here be different from the generateSchema
script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know the terminology enough to say. Did you have a preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry. Here's what I mean: in the generateSchema
script, the error message Usage: <schemaName>
makes sense because we expect one CLI argument — schemaName
. It would be nice to update the error message here to match the expected argument list. Does it make sense?
sourcegraph/client/shared/dev/generateSchema.js
Lines 53 to 60 in 25377f2
async function main(args) { | |
if (args.length !== 1) { | |
throw new Error('Usage: <schemaName>') | |
} | |
const schemaName = args[0] | |
await generateSchema(schemaName) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added <outputPath>
which I think is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
7c2c845
to
3efc8f8
Compare
This replaces #45682 . You can see the fixup commits there for the feedback in that PR.
Test plan
Existing tests