feat(monocle-backend,monocle-react,monocle-nextjs) Allow overriding of Monocle domain#33
Merged
jaredpiedt merged 3 commits intomainfrom May 20, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables overriding the Monocle domain across the backend and frontend packages, allowing users to specify a custom API domain if needed.
- Removed the canary release script and updated workspace configuration
- Added an optional domain property to Monocle React provider interfaces and updated its implementation
- Updated Monocle backend and Next.js client code to utilize a new domain/baseDomain configuration
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/canary.mjs | Removed canary release script |
| pnpm-workspace.yaml | Removed reference to the "zx" dependency |
| packages/monocle-react/src/types.ts | Added an optional "domain" property to MonocleProviderProps |
| packages/monocle-react/src/contexts/MonocleProvider.tsx | Updated to set a default domain and construct the script URL accordingly |
| packages/monocle-react/src/constants.ts | Introduced the DOMAIN constant |
| packages/monocle-nextjs/src/server/monocleClient.ts | Updated to pass the new DOMAIN value to the client |
| packages/monocle-nextjs/src/server/constants.ts | Updated constant to use environment variable for domain override |
| packages/monocle-nextjs/src/client-boundary/MonocleProvider.tsx | Propagated the domain property to the ReactMonocleProvider |
| packages/monocle-backend/src/types.ts | Updated configuration field name from baseUrl to baseDomain |
| packages/monocle-backend/src/monocleClient.ts | Updated to use baseDomain when constructing the URL for API requests |
| packages/monocle-backend/src/constants.ts | Replaced API_URL with BASE_DOMAIN |
| package.json | Modified the canary versioning command and updated dependencies |
| .changeset/hip-donkeys-jog.md | Updated changeset file to reflect domain overriding |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
scripts/canary.mjs:1
- The complete removal of the canary release script may impact existing CI/CD workflows. Please ensure that related pipelines and documentation are updated accordingly.
#!/usr/bin/env zx
pnpm-workspace.yaml:16
- The removal of the 'zx' dependency suggests that any related scripts need to be updated. Double-check that no scripts reference 'zx' to avoid runtime issues.
zx: 8.4.1
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.
…f Monocle domain
Description
Type of Change
Checklist
pnpm testand all tests passpnpm lintand there are no linting errors