Skip to content

Comments

Unify installation scripts#59

Merged
comzeradd merged 1 commit intomainfrom
nro-install
Dec 1, 2025
Merged

Unify installation scripts#59
comzeradd merged 1 commit intomainfrom
nro-install

Conversation

@comzeradd
Copy link
Member

@comzeradd comzeradd commented Nov 28, 2025

Summary

Our two installation scripts (install.js and nro-install.js) are 80% identical. That duplication makes maintenance harder, as several times in the past we had to duplicate a fix on both scripts.

  • This change unifies the scripts into one.
  • Adds a deprecation notice in the original nro:install command to inform the community about the change.
  • Clones the master-theme as a git repository even on nro installation, makes it easier to test fixes on another website.
  • With this change to install the environment for a specific website, you just need to pass it as an argument to the env:install command.

Testing

  • Test that bot installation option work as expected
    • Default content: npm run env:install
    • NRO: npm run env:install <nro-name>

@comzeradd comzeradd self-assigned this Nov 28, 2025
function wpenvCheck () {
const versionRequired = '9';
const versionRequired = '10';
const versionRunning = runWithOutput('npx wp-env --version').split('.')[0];
Copy link
Member Author

Choose a reason for hiding this comment

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

Bumped the check, because of d8a2c48

* Node version control
*/
console.log('Node version: ' + process.version);
nodeCheck();
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the check from here, as we already do it in the env:requirements command

@comzeradd comzeradd force-pushed the nro-install branch 2 times, most recently from d997dfe to 933f091 Compare November 28, 2025 10:53
nro:enable Enable installed NRO theme and database
nro:disable Switch back to default theme and database
nro:theme <?nro> Clone NRO theme in themes dir

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the enable/disable commands since they didn't work anyway. We don't create/import the planet4_dev database when running nro:install so the nro:disable command didn't work.

@comzeradd comzeradd marked this pull request as ready for review November 28, 2025 11:15
@GP-Dan-Tovbein
Copy link
Contributor

@comzeradd I'm on it! Running both installations

Copy link
Contributor

@GP-Dan-Tovbein GP-Dan-Tovbein left a comment

Choose a reason for hiding this comment

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

All good.

I've tested the p4 local env and Brasil's. The only inconvenient I had was related to a brasil's plugin but it's not related to this PR.

@comzeradd comzeradd merged commit 7011d41 into main Dec 1, 2025
5 checks passed
@comzeradd comzeradd deleted the nro-install branch December 1, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants