-
Notifications
You must be signed in to change notification settings - Fork 39
feat: add atlas-create-free-cluster atlas-inspect-cluster tools #29
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
Conversation
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Looks good, just a few minor notes.
package.json
Outdated
"generate:download": "curl -Lo ./scripts/spec.json https://github.com/mongodb/openapi/raw/refs/heads/main/openapi/v2/openapi-2025-03-12.json", | ||
"generate:filter": "tsx ./scripts/filter.ts > ./scripts/filteredSpec.json < ./scripts/spec.json", | ||
"generate:bundle": "redocly bundle --ext json --remove-unused-components ./scripts/filteredSpec.json --output ./scripts/bundledSpec.json", | ||
"generate:openapi": "openapi-typescript ./scripts/bundledSpec.json --root-types-no-schema-prefix --root-types --output ./src/common/atlas/openapi.d.ts", | ||
"generate:clear": "rm -rf ./scripts/bundledSpec.json ./scripts/filteredSpec.json ./scripts/spec.json", |
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.
Super nit, but these seem to be very dependent on the order of execution, so not sure if it's that useful to have them as separate scripts - it doesn't seem like they'd be really useful on their own.
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 only reason they are separated is that it was challenging to implement in one go, we could move it to bash but it also felt a bit weird to do so
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.
replaced with a bash
@@ -24,24 +24,35 @@ | |||
"build": "npm run build:clean && npm run build:compile && npm run build:addshebang && npm run build:chmod", | |||
"inspect": "npm run build && mcp-inspector -- dist/index.js", | |||
"prettier": "prettier", | |||
"check": "npm run check:lint && npm run check:format", | |||
"check": "npm run build && npm run check:lint && npm run check:format", |
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.
@nirinchev I'm adding build here, I've seen some weird bug where the source was not compiling but the styles were passing 🤷♂️
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.
Yeah, sounds good. I was thinking of adding a build step on CI anyway, but that's also fine. Our project builds fairly quickly still, so I'm not really worried about the extra couple of seconds it adds.
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.
nit: can be a follow-up PR- we should update our readme with the right commands to run
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.
right now npm run check
should check everything
package.json
Outdated
"generate:download": "curl -Lo ./scripts/spec.json https://github.com/mongodb/openapi/raw/refs/heads/main/openapi/v2/openapi-2025-03-12.json", | ||
"generate:filter": "tsx ./scripts/filter.ts > ./scripts/filteredSpec.json < ./scripts/spec.json", | ||
"generate:bundle": "redocly bundle --ext json --remove-unused-components ./scripts/filteredSpec.json --output ./scripts/bundledSpec.json", | ||
"generate:openapi": "openapi-typescript ./scripts/bundledSpec.json --root-types-no-schema-prefix --root-types --output ./src/common/atlas/openapi.d.ts", |
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.
nit: can create an issue if it requires more changes - can we have per-path or per operationID files?
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 think the tool supports it
atlas-create-free-cluster
toolatlas-inspect-cluster
toolauth
tool toatlas-auth
toollistClusters
tool toatlas-list-clusters
toollistProjects
tool toatlas-list-projects
toolnpm run generate
to auto generate required API types from openapi spec