Skip to content

fix(url): support caddy localhost URLs in dev mode#1190

Merged
mengxi-ream merged 1 commit intomainfrom
fix/localhost-caddy-dev-url
Mar 21, 2026
Merged

fix(url): support caddy localhost URLs in dev mode#1190
mengxi-ream merged 1 commit intomainfrom
fix/localhost-caddy-dev-url

Conversation

@mengxi-ream
Copy link
Copy Markdown
Owner

@mengxi-ream mengxi-ream commented Mar 21, 2026

Type of Changes

  • ✨ New feature (feat)
  • πŸ› Bug fix (fix)
  • πŸ“ Documentation change (docs)
  • πŸ’„ UI/style change (style)
  • ♻️ Code refactoring (refactor)
  • ⚑ Performance improvement (perf)
  • βœ… Test related (test)
  • πŸ”§ Build or dependencies update (build)
  • πŸ”„ CI/CD related (ci)
  • 🌐 Internationalization (i18n)
  • 🧠 AI model related (ai)
  • πŸ”„ Revert a previous commit (revert)
  • πŸ“¦ Other changes that do not modify src or test files (chore)

Description

Related Issue

Closes #

How Has This Been Tested?

  • Added unit tests
  • Verified through manual testing

Screenshots

Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly if necessary
  • My code follows the code style of this project
  • My changes do not break existing functionality
  • If my code was generated by AI, I have proofread and improved it as necessary.

Additional Information


Summary by cubic

Enable dev support for Caddy-served HTTPS localhost. This lets the extension match and open the local site when using the Caddy reverse proxy.

Written for commit 1a59622. Summary will update on new commits.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

πŸ¦‹ Changeset detected

Latest commit: 1a59622

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@read-frog/extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 21, 2026
@mengxi-ream mengxi-ream merged commit f13e50e into main Mar 21, 2026
3 checks passed
@mengxi-ream mengxi-ream deleted the fix/localhost-caddy-dev-url branch March 21, 2026 20:28
@github-actions github-actions bot added the fix label Mar 21, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@dosubot
Copy link
Copy Markdown

dosubot bot commented Mar 21, 2026

Related Documentation

1 document(s) may need updating based on files changed in this PR:

Read Frog - Open Source Immersive Translate

Build and Development Environment Setup
View Suggested Changes
@@ -37,6 +37,7 @@
 - **Environment Variable:**
   - Set `WXT_USE_LOCAL_PACKAGES=true` in a `.env.local` file to enable local package resolution.
   - An example file `.env.local.example` is provided. Copy it to `.env.local` and adjust as needed.
+  - When `WXT_USE_LOCAL_PACKAGES=true` is set in development mode, the extension uses `WEBSITE_CADDY_DEV_URL` instead of `WEBSITE_PROD_URL` for the website URL. The development environment uses [Caddy](https://caddyserver.com/) to serve the website with HTTPS support on localhost.
 
 - **TypeScript Configuration:**
   - The root `tsconfig.json` now extends `tsconfig.local.json` if present.
@@ -46,6 +47,9 @@
 - **Vite/WXT Configuration:**
   - The `wxt.config.ts` file conditionally aliases `@read-frog/*` packages to local paths when `WXT_USE_LOCAL_PACKAGES` is set.
   - React and ReactDOM are always resolved as singletons from the root `node_modules` to avoid duplication.
+
+- **Localhost URL Support:**
+  - The extension supports both HTTP and HTTPS localhost URLs in development mode. The official site URL patterns include both `http://localhost/*` and `https://localhost/*`.
 
 - **.gitignore:**
   - `.gitignore` is updated to ignore `tsconfig.local.json` but allow example files to be tracked.

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?Β Β Join Discord

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a596225f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 9 to +10
export const WEBSITE_URL = (import.meta.env.DEV && import.meta.env.WXT_USE_LOCAL_PACKAGES === "true")
? WEBSITE_DEV_URL
? WEBSITE_CADDY_DEV_URL
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve non-Caddy dev URL for dev:local

WEBSITE_URL now switches every import.meta.env.DEV && WXT_USE_LOCAL_PACKAGES=true build to https://localhost:4433, but the standard dev:local script in package.json:13 only sets that env var and does not start or require Caddy. In the existing local-packages workflow where the site still runs on the plain dev server (http://localhost:8888), this change makes the extension send auth and RPC traffic to the wrong origin (src/utils/auth/auth-client.ts:37-45, src/utils/orpc/client.ts:9-12), so login, API calls, and docs/blog links stop working even though OFFICIAL_SITE_URL_PATTERNS still recognizes the HTTP localhost page. This needs a fallback or separate toggle for the Caddy-backed setup instead of replacing the old dev URL unconditionally.

Useful? React with πŸ‘Β / πŸ‘Ž.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant