-
Notifications
You must be signed in to change notification settings - Fork 5
(WIP) feat: upstream graphql codegen and query-builder #552
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
base: main
Are you sure you want to change the base?
Conversation
| #!/usr/bin/env node | ||
|
|
||
| // This is the CLI entry point that loads the built CLI module | ||
| import('../dist/cli/index.js').catch((err) => { |
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.
why reaching into dist?
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.
oh, while it looks weird at first, this is actually a common convention to use for binary executable, we are just creating a shim executable to point to that file. Example in the wild:
https://github.com/vitejs/vite/blob/main/packages/vite/bin/vite.js#L62
- Remove bin/graphql-codegen.js wrapper script that imported from ../dist/cli/index.js - Point bin directly to ./dist/cli/index.js (tsup already adds shebang via banner config) - Remove 'bin' from files array since bin folder is deleted This aligns with the pattern used by pgpm and cnc CLIs which don't have runtime code reaching into dist/ folder.
- Add publishConfig.directory = 'dist' so npm publishes from dist/ folder - Update bin to 'cli/index.js' (relative to published root, no dist/ prefix) - Update main/module/types to be relative to dist/ (no ./dist/ prefix) - Update all exports paths to be relative to dist/ - Remove files field (not needed with publishConfig.directory) This matches the exact pattern used by pgpm and cnc CLIs.
Summary
This PR upstreams changes from dashboard/admin package to extract and update graphql codegen and query-builder packages. The
@constructive-io/graphql-codegenpackage has been completely replaced with the new CLI-based GraphQL SDK generator.Key Changes
makagetotsupgraphql-codegenwith commands:init,generate,generate-orm@tanstack/react-query,reactgql-astworkspace packageUpdates Since Last Revision
publishConfig.directorypublishConfig.directory: "dist"so npm publishes from dist/ as package root./dist/cli/index.jstocli/index.js(relative to published dist/ root)./dist/prefix)filesfield (not needed with publishConfig.directory)Review & Testing Checklist for Human
This is a BREAKING CHANGE with significant risk. Please verify:
pnpm packin graphql/codegen to confirm the tarball structure is correct.packages/gql-asthas a properpackage.jsonand builds correctlynode dist/cli/index.js --helpand actual commands (init,generate,generate-orm)pnpm -C graphql/codegen buildand verifydist/cli/index.jshas shebang and is executable@tanstack/react-queryandreactpeer deps don't cause issues for existing consumersRecommended Test Plan
pnpm install && pnpm -C graphql/codegen buildnode graphql/codegen/dist/cli/index.js --helpcd graphql/codegen && pnpm pack- check tarball has correct structure with cli/index.js at rootNotes
Link to Devin run: https://app.devin.ai/sessions/6edd77d00d4a4bf9a7716555906394ec
Requested by: Dan Lynch (@pyramation)
Note
BREAKING: package replaced with new CLI-based GraphQL SDK
graphql-codegenwith commandsinit,generate,generate-orm; extensive newREADME.md,docs/DEVELOPMENT.md, and runnable examples underexamples/gql-ast; adds peer deps@tanstack/react-query,reactdistviapublishConfig.directory; adds bin entry and wrapperbin/graphql-codegen.jssrc/__tests__/codegen/*).gitignorefor build artifacts and generated outputsWritten by Cursor Bugbot for commit b57dda5. This will update automatically on new commits. Configure here.