Skip to content

fix: improve node module installation fallback logic - Fix Issue #106#107

Merged
dermatz merged 1 commit intomainfrom
fix-NodeModuleDetection-MagentoStandardBuilder-#106
Jan 27, 2026
Merged

fix: improve node module installation fallback logic - Fix Issue #106#107
dermatz merged 1 commit intomainfrom
fix-NodeModuleDetection-MagentoStandardBuilder-#106

Conversation

@dermatz
Copy link
Copy Markdown
Member

@dermatz dermatz commented Jan 27, 2026

This pull request refactors how Node.js dependencies are managed and checked within the Magento theme builder, improving reliability and maintainability. The changes centralize node module management into a dedicated service, enhance the detection of out-of-sync dependencies, and simplify the builder logic by removing duplicate code.

Node modules management improvements:

  • Refactored node module installation logic out of the Builder class and into the NodePackageManager service, removing the private installNodeModulesIfMissing method and updating all relevant code paths to use the new service. [1] [2] [3]
  • Updated the constructor of the Builder class to inject the NodePackageManager dependency. [1] [2]

Dependency synchronization checks:

  • Improved the isNodeModulesInSync method in NodePackageManager to return false when package-lock.json is missing, ensuring that missing lock files are treated as out-of-sync.
  • Enhanced the installNodeModules method to attempt npm install as a fallback if npm ci fails, providing better resilience during installation.

Fix Issue #106

@dermatz dermatz enabled auto-merge (squash) January 27, 2026 11:29
@dermatz dermatz requested a review from Morgy93 January 27, 2026 11:40
@dermatz dermatz disabled auto-merge January 27, 2026 11:41
@dermatz dermatz merged commit c400732 into main Jan 27, 2026
12 checks passed
@dermatz dermatz deleted the fix-NodeModuleDetection-MagentoStandardBuilder-#106 branch January 27, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant