chore: update Dockerfile and CI configuration for Node 20, enhance pa…#112
Open
chore: update Dockerfile and CI configuration for Node 20, enhance pa…#112
Conversation
…ckage structure - Updated Dockerfile to use Node 20 for both build and runtime stages. - Modified GitHub Actions workflow to support testing across Node versions 20.x, 22.x, and 24.x. - Enhanced package.json to include new module exports and updated dependencies. - Introduced tsconfig.cjs.json for CommonJS builds and adjusted TypeScript configurations. - Added new scripts for CJS package JSON generation and updated test scripts for improved coverage. - Refactored source code structure, including the introduction of an API entry point and integration tests for ESM and CJS compatibility.
…ion tool in server Made-with: Cursor
Contributor
There was a problem hiding this comment.
1 issue found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="mcp-server/src/server.ts">
<violation number="1" location="mcp-server/src/server.ts:44">
P2: Fail fast when the API key is missing; logging and continuing starts a server that can’t successfully call the Currents API.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Updated integration test to always run for package consumers, removing the dual build check. - Reformatted action descriptions in the server registration to improve readability and maintain consistency across tools.
…ion test timeout - Changed action tools to directly use the zodSchema instead of its shape for schema definition. - Enhanced the integration test timeout for the packaged CLI to ensure reliability during execution.
…SM test - Updated the GitHub Actions workflow to clarify test coverage for workspace ESM/CJS and added a new test for npm pack and import behavior. - Introduced new integration tests for packaged CLI functionality, ensuring proper execution of the `bin` field and `npx` behavior. - Added a test for resolving the package name `@currents/mcp` using `package.json` exports after installation from a tarball. - Included a fixture to validate the ESM entry point and its functionality in a consumer project context.
…ntegration tests - Enhanced error logging in the main entry point to provide clearer guidance when the CURRENTS_API_KEY is not set. - Updated the server startup logic to throw an error if the CURRENTS_API_KEY is missing, improving robustness. - Added a default value for CURRENTS_API_KEY in the environment module to prevent empty strings. - Modified integration tests to include a mock environment variable for CURRENTS_API_KEY, ensuring proper test execution.
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.
…ckage structure
Summary by cubic
Move to a dual ESM/CJS build with a clean programmatic API, keep the CLI stdio entrypoint, and adopt Node 20 across Docker and CI. Adds clear failure handling when
CURRENTS_API_KEYis missing.New Features
startMcpServerentry point; CLI stdio stays insrc/index.ts, server/tool registration moves tosrc/server.ts;src/api.tsexposes programmatic exports; tools now use directzodschemas.npxvianpm pack, and published tarball resolution viaimport "@currents/mcp"; tests build first, increase CLI test timeout, and mockCURRENTS_API_KEYfor startup.CURRENTS_API_KEY(MISSING_CURRENTS_API_KEY_MESSAGE); CLI logs a short guidance message without a stack trace.@modelcontextprotocol/sdkto^1.28.0.Migration
enginesupdated).@currents/mcp@currents/mcp) or import(@currents/mcp)Written for commit da86eed. Summary will update on new commits.