Skip to content

Conversation

@saeedvaziry
Copy link
Member

closes #971

Copy link
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 pull request introduces Node.js website support using mise (a runtime version manager) to enable per-site Node.js version management. It replaces the legacy Node.js implementation that relied on system-wide installations with a more flexible approach that allows different sites to use different Node.js versions.

Key changes:

  • Implemented mise integration for runtime version management with installation and verification scripts
  • Created a new MiseNodeJS site type that supports configurable Node.js versions (16, 18, 20, 22) per site
  • Renamed the existing NodeJS site type to LegacyNodeJS to maintain backward compatibility

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/TestCase.php Added NodeJS service setup to test infrastructure
tests/Feature/SitesTest.php Added test cases for both MiseNodeJS and LegacyNodeJS site types with various configurations
resources/views/ssh/os/install-dependencies.blade.php Replaced Node.js installation with mise installation during server setup
resources/views/ssh/mise/install-runtime.blade.php Created script to install specific mise runtime versions
resources/views/ssh/mise/ensure-installed.blade.php Created script to verify/install mise on the server
app/SiteTypes/MiseSiteType.php Created abstract base class for mise-based site types with runtime management
app/SiteTypes/MiseNodeJS.php Implemented new Node.js site type using mise for version management
app/SiteTypes/LegacyNodeJS.php Renamed from NodeJS to LegacyNodeJS to support existing implementations
app/SSH/Mise/Mise.php Created mise SSH interaction class for runtime installation and verification
app/Providers/SiteTypeServiceProvider.php Updated site type registration to include both MiseNodeJS and LegacyNodeJS with appropriate forms
app/Providers/ServiceTypeServiceProvider.php Updated label to indicate legacy Node.js service
.easytree.json Added project configuration file (may be unintentional)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
$version = $this->runtimeVersion();

return 'mise exec '.$this->runtime().'@'.$version.' --';
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The runtimePrefix() method may construct an invalid command when runtimeVersion() returns null. This would result in "mise exec node@ --" which is malformed. Consider adding a null check or ensuring the version is always provided when this method is called.

Suggested change
return 'mise exec '.$this->runtime().'@'.$version.' --';
$command = 'mise exec '.$this->runtime();
if ($version) {
$command .= '@'.$version;
}
return $command.' --';

Copilot uses AI. Check for mistakes.
->select()
->label('Node.js Version')
->options(MiseNodeJS::NODE_VERSIONS)
->default('22'),
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The default version in the form is '22' but the default in the data() method is '20'. This inconsistency could lead to unexpected behavior. Consider aligning both defaults to the same version.

Suggested change
->default('22'),
->default('20'),

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +5
"scripts": [
"composer install",
"cp $PROJECT_PATH/.env .env"
]
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

This file appears to be unrelated to the PR's purpose of adding NodeJS website support using mise. The .easytree.json configuration seems to be a project setup file that was accidentally included in this pull request. Consider removing it if it's not intentionally part of this change.

Suggested change
"scripts": [
"composer install",
"cp $PROJECT_PATH/.env .env"
]

Copilot uses AI. Check for mistakes.
private function legacyNodeJS(): void
{
RegisterSiteType::make(LegacyNodeJS::id())
->label('NodeJS with NPM (Legacy)')
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

Inconsistent casing in labels: "Node.js" is used for the new MiseNodeJS type (line 140), but "NodeJS" is used for the LegacyNodeJS type (line 172). Consider using consistent casing such as "Node.js" for both to maintain naming consistency across the UI.

Suggested change
->label('NodeJS with NPM (Legacy)')
->label('Node.js with NPM (Legacy)')

Copilot uses AI. Check for mistakes.
@saeedvaziry saeedvaziry merged commit f85fedb into 4.x Jan 1, 2026
2 checks passed
@saeedvaziry saeedvaziry deleted the nodejs branch January 1, 2026 00:37
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