Conversation
…dead hook - Extract shared GraphQL queries into src/queries.ts used by both commands/search.ts and sdk.ts - Read CLI version from npm_package_version instead of hardcoding 0.1.0 - Fix README CI badge to point to ci.yml instead of npm-publish.yml - Remove unused empty postAction hook in cli.ts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Original prompt from Ryan |
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
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.
Summary
Four small cleanup fixes identified during a codebase audit:
src/commands/search.tsandsrc/sdk.ts. Extracted into a new sharedsrc/queries.tsmodule that both files now import from.cli.tshad a hardcoded.version("0.1.0")whilepackage.jsonis at0.1.5. Now readsprocess.env.npm_package_version(set automatically by npm at runtime) with a"0.0.0"fallback.npm-publish.yml; updated to point toci.yml.postActionhook —program.hook("postAction", () => {})was a no-op.Review & Testing Checklist for Human
process.env.npm_package_versionworks for all invocation methods. This env var is set by npm when running vianpx opensea-cliornpm run, but will not be set if someone runsnode dist/cli.jsdirectly — they'd see version0.0.0. Confirm this tradeoff is acceptable, or if we should read version frompackage.jsonviacreateRequire/fs instead.postActionhook removal is safe. It was an empty callback, but occasionally empty Commander.js hooks serve a subtle purpose (e.g., ensuring async command completion). Verifyopensea --helpand a real command still work correctly after removal.src/queries.tsare identical to whatsdk.tspreviously had inline. Thesdk.tsversions used compressed single-line field selections whilecommands/search.tsused expanded formatting — both are functionally equivalent in GraphQL, but the shared version uses the expanded format.Suggested test plan: run
npx opensea-cli --versionandnpx opensea-cli search collections mfers --limit 1to verify version output and that search still works end-to-end.Notes
nodeinvocation).Link to Devin run: https://app.devin.ai/sessions/9848738941ed4994b46a79d50942a881
Requested by: @ryanio