Skip to content

feat: add Portless HTTPS development URLs across all workspaces - #129

Merged
adelrodriguez merged 1 commit into
mainfrom
07-31-feat_add_portless_https_development_urls_across_all_workspaces
Aug 1, 2026
Merged

feat: add Portless HTTPS development URLs across all workspaces#129
adelrodriguez merged 1 commit into
mainfrom
07-31-feat_add_portless_https_development_urls_across_all_workspaces

Conversation

@adelrodriguez

Copy link
Copy Markdown
Collaborator

Portless (0.15.5) is added as a pinned root devDependency to provide stable HTTPS development URLs for every HTTP-serving workspace. Each workspace's dev script is replaced with portless, and the underlying framework command moves to dev:app. A package-local portless object in each package.json declares the workspace's route name and target script, following Portless's recommended Turborepo pattern.

The normalized npm scope owns the hostname suffix. With the default init scope, the App is reachable at https://init.localhost, the API at https://api.init.localhost, and all other workspaces at <workspace>.init.localhost. apps/app holds the bare project hostname; every other workspace is prefixed with its directory name. Portless assigns upstream ports dynamically, so hardcoded port numbers become PORT-aware fallbacks (Number(process.env.PORT ?? <default>)).

The Inngest dev server moves from Docker Compose into packages/workflows as a proper package workspace. inngest-cli@1.40.0 is added as a local devDependency, the dev and dev:app scripts follow the same Portless pattern as other workspaces, and the Docker inngest service is removed. The docker:up command gains --remove-orphans to clean up the now-removed service.

Environment templates for apps/api, apps/app, and apps/web are updated so BASE_URL, PUBLIC_BASE_URL, PUBLIC_SITE_URL, ALLOWED_API_ORIGINS, and AUTH_TRUSTED_ORIGINS reference the Portless HTTPS origins instead of localhost port URLs. Generator templates and the files-client default endpoint are updated to match.

scripts/template/portless.ts is introduced with updatePortlessProjectName and restorePortlessWorkspaces. renameProject in scripts/template/rename.ts now calls updatePortlessProjectName and replaces <scope>.localhost occurrences whenever a root project rename or scope change occurs; a workspace-only rename (where projectName is undefined) leaves project-wide Portless route names untouched. template add calls restorePortlessWorkspaces after copying a workspace so its route name reflects the current scope.

Documentation in getting-started.md and development.md replaces the static port table with the named HTTPS URL convention, explains first-run certificate trust, portless doctor, dynamic port assignment, and the PORTLESS=0 direct-port fallback. Infrastructure ports for Redis, the database, and Minio remain documented as fixed; the Inngest Docker port is removed.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f6406572-1580-4721-8c43-3e677d8cf4a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@adelrodriguez
adelrodriguez marked this pull request as ready for review August 1, 2026 02:10
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
init Ready Ready Preview Aug 1, 2026 2:43am

Request Review

adelrodriguez commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

@adelrodriguez
adelrodriguez force-pushed the 07-31-feat_add_portless_https_development_urls_across_all_workspaces branch from c8c1146 to d43c188 Compare August 1, 2026 02:11
@adelrodriguez
adelrodriguez force-pushed the 07-31-feat_add_portless_https_development_urls_across_all_workspaces branch from d43c188 to 2e158ae Compare August 1, 2026 02:14
@adelrodriguez
adelrodriguez force-pushed the 07-31-feat_implement_files_sdk_asset_lifecycle_with_owner_uploader_schema branch from c1f2b0d to b5a54c6 Compare August 1, 2026 02:14
@adelrodriguez

Copy link
Copy Markdown
Collaborator Author

@codex review

Base automatically changed from 07-31-feat_implement_files_sdk_asset_lifecycle_with_owner_uploader_schema to main August 1, 2026 02:27
@adelrodriguez
adelrodriguez force-pushed the 07-31-feat_add_portless_https_development_urls_across_all_workspaces branch from 2e158ae to a44c326 Compare August 1, 2026 02:28

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

Copy link
Copy Markdown

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: 2e158ae89c

ℹ️ 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 thread scripts/template/rename.ts Outdated
)

if (!projectName) return { changedFiles }
if (!projectName) return { changedFiles: [...changedFiles] }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Rewrite copied workspace hostnames before returning

When template add copies a workspace into an already-renamed scaffold, addWorkspaces calls renameProject without projectName, so this return skips the new .localhost replacement. restorePortlessWorkspaces only changes the package.json route name; files such as Desktop's tauri.conf.json, API environment defaults, and the Workflows command remain on *.init.localhost. For example, adding Desktop to a foo scaffold exposes desktop.foo.localhost while Tauri waits for desktop.init.localhost, preventing development startup.

Useful? React with 👍 / 👎.

])
const workspacePaths = workspaces
.flat()
.map((workspace) => relative(rootDir, workspace.directory))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Normalize workspace paths before deriving route names

On Windows, node:path.relative returns paths such as apps\app, but getWorkspaceRouteName compares against apps/app and splits only on /. Every project setup or root rename on Windows therefore writes names such as apps\app.foo instead of the bare foo route, and similarly malformed names for other workspaces; normalize to POSIX separators or derive the route from the workspace kind and name.

Useful? React with 👍 / 👎.

Comment thread docs/development.md Outdated
Comment on lines +58 to +59
and route health. Set `PORTLESS=0` when running a root or workspace `dev` command to
bypass the proxy and use each tool's documented fallback port.

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 Make the advertised direct-port mode self-consistent

When PORTLESS=0 actually bypasses the proxy, only the listening ports fall back: the supplied App/API environment defaults still use https://*.localhost, and packages/workflows still polls https://api.init.localhost/workflows. Consequently direct-mode App authentication and API origin checks target unavailable proxy origins, while Inngest cannot reach a concurrently bypassed API. The fallback needs matching direct URLs or the documentation must require explicit URL overrides rather than claiming the root or workspace command is sufficient.

Useful? React with 👍 / 👎.

@adelrodriguez
adelrodriguez force-pushed the 07-31-feat_add_portless_https_development_urls_across_all_workspaces branch from a44c326 to 03da37e Compare August 1, 2026 02:43
@adelrodriguez

Copy link
Copy Markdown
Collaborator Author

@codex review

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

Copy link
Copy Markdown

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: 03da37e9a9

ℹ️ 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 +12 to +14
env.PORTLESS_URL?.replace(new URL(env.BASE_URL).hostname, new URL(origin).hostname) ??
origin
).origin

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve legacy local origins when Portless is active

When an existing checkout retains the previous .env.local values (BASE_URL=http://localhost:3000 and ALLOWED_API_ORIGINS=http://localhost:3001), Portless supplies https://api.init.localhost here, but replacing localhost with the identical origin hostname leaves the API URL unchanged. allowedOrigins therefore becomes the API's own origin rather than https://init.localhost, causing CORS, Better Auth, and Files SDK requests from the App to be rejected after upgrading unless every developer manually recreates their environment file.

Useful? React with 👍 / 👎.

Comment on lines +44 to +47
for (const path of await replaceTextInFiles(
rootDir,
`${normalizedSourceScope}.localhost`,
`${normalizedScope}.localhost`

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 Keep project hostnames during workspace-only renames

When running bun template rename --workspace apps/api --scope bar in a project whose scope is foo, this unconditional replacement now rewrites the selected workspace's URLs from *.foo.localhost to *.bar.localhost, while the early return below deliberately leaves its Portless route name as api.foo. The API consequently advertises and trusts a hostname that Portless does not serve; hostname replacement should be limited to project renames or the template-copy restoration flow.

Useful? React with 👍 / 👎.

@adelrodriguez
adelrodriguez merged commit 2307bc4 into main Aug 1, 2026
11 checks passed
@adelrodriguez
adelrodriguez deleted the 07-31-feat_add_portless_https_development_urls_across_all_workspaces branch August 1, 2026 02:53
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.

1 participant