Skip to content

feat(monocle-backend,monocle-react,monocle-nextjs) Allow overriding of Monocle domain#33

Merged
jaredpiedt merged 3 commits intomainfrom
jaredpiedt/configurable-domain
May 20, 2025
Merged

feat(monocle-backend,monocle-react,monocle-nextjs) Allow overriding of Monocle domain#33
jaredpiedt merged 3 commits intomainfrom
jaredpiedt/configurable-domain

Conversation

@jaredpiedt
Copy link
Copy Markdown
Collaborator

@jaredpiedt jaredpiedt commented May 20, 2025

…f Monocle domain

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe)

Checklist

  • I have run pnpm test and all tests pass
  • I have run pnpm lint and there are no linting errors

@jaredpiedt jaredpiedt self-assigned this May 20, 2025
@jaredpiedt jaredpiedt requested a review from Copilot May 20, 2025 21:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jaredpiedt jaredpiedt merged commit 9da3dcc into main May 20, 2025
2 checks passed
@jaredpiedt jaredpiedt deleted the jaredpiedt/configurable-domain branch May 20, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants