Skip to content

[Feat] Optional install of Mise NPN/Bun with PHP/Laravel sites#1113

Merged
RichardAnderson merged 8 commits into
vitodeploy:4.xfrom
RichardAnderson:fix/npm-with-php
May 23, 2026
Merged

[Feat] Optional install of Mise NPN/Bun with PHP/Laravel sites#1113
RichardAnderson merged 8 commits into
vitodeploy:4.xfrom
RichardAnderson:fix/npm-with-php

Conversation

@RichardAnderson
Copy link
Copy Markdown
Member

This pull request introduces improved support for managing Node.js and Bun runtime versions for isolated users across site types, with a focus on consistency, validation, and safety. It adds new helper methods, validation logic, and UI options for runtime selection, and also enhances deployment environment handling and error reporting.

Copy link
Copy Markdown
Contributor

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 extends site provisioning and deployment to support optional installation and consistent reuse (“locking”) of mise-managed Node.js and Bun versions per isolated user, and improves command wrapping and error/log handling around deployments.

Changes:

  • Adds node_version / bun_version inputs for PHP/PHP-Blank/Laravel site types, persists them in type_data, and installs runtimes during site install when requested.
  • Introduces UsesMiseRuntime trait to centralize supported runtime versions and provide safer command wrapping (bash -c with escapeshellarg).
  • Injects site-type-specific deployment environment variables (notably PATH for mise shims) into deployment scripts and enhances deploy-key failure messaging/redaction.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Unit/MiseSiteTypeTest.php Updates assertions for new quoting behavior in wrapped commands.
tests/Unit/MiseBunSiteTypeTest.php Updates assertions for new quoting behavior in wrapped commands.
tests/Feature/SitesTest.php Adjusts site creation payloads to include node_version defaults and updates supported Node version expectations.
resources/js/types/isolated-user.d.ts Adds a shared TS type including locked node_version/bun_version per isolated user.
resources/js/pages/sites/components/isolated-user-select.tsx Uses shared IsolatedUserOption type instead of inline type.
resources/js/pages/sites/components/create-site.tsx Adds runtime selectors, “locked runtime” UX, and automatic lock/reset behavior when selecting isolated users.
public/api-docs/openapi/sites.yaml Documents node_version and bun_version request properties for site creation.
app/SSH/OS/OS.php Escapes alias/variable values for runScript-generated shell code and removes logging of raw script command.
app/SiteTypes/SiteType.php Adds deploymentEnvironment() to the SiteType contract.
app/SiteTypes/PHPSite.php Adds runtime validation/data defaults, installs Node/Bun via mise during install, and provides deployment PATH env when configured.
app/SiteTypes/PHPBlank.php Adds runtime validation/data defaults and installs Node/Bun via mise during install.
app/SiteTypes/MiseSiteType.php Refactors to use shared UsesMiseRuntime trait for runtime setup and command wrapping.
app/SiteTypes/MiseNodeJS.php Switches to centralized supported Node versions constant.
app/SiteTypes/MiseBun.php Switches to centralized supported Bun versions constant.
app/SiteTypes/Concerns/UsesMiseRuntime.php New shared trait for supported versions, shim PATH building, runtime install, and safer command wrapping.
app/SiteTypes/AbstractSiteType.php Adds default deploymentEnvironment() implementation returning empty env.
app/Providers/SiteTypeServiceProvider.php Exposes Node/Bun selectors for PHP/PHP-Blank/Laravel site types; updates supported version sources for mise site types.
app/Models/Site.php Adds helper to detect existing per-user runtime versions across sibling sites.
app/Jobs/Site/DeployJob.php Merges site-type deployment env (e.g., PATH) into deployment script environment.
app/Jobs/Site/CreateJob.php Improves deploy-key failure logging/UI summary with public-key redaction + truncation.
app/Actions/Site/GetIsolatedUsers.php Extends isolated-user listing to include detected locked Node/Bun versions.
app/Actions/Site/CreateSite.php Enforces runtime “locking” for existing isolated users and centralizes isolated-user regex.

Comment thread app/SSH/OS/OS.php
Comment thread app/SSH/OS/OS.php
Comment thread resources/js/pages/sites/components/create-site.tsx
Comment thread app/Actions/Site/GetIsolatedUsers.php Outdated
Comment thread app/Models/Site.php Outdated
@RichardAnderson RichardAnderson merged commit 698cf3d into vitodeploy:4.x May 23, 2026
3 checks passed
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.

3 participants