Why should NodeJS be installed in the module folder?

1) Normally it should be outside docroot.

2) If it is placed in the module folder, it means that it will need to be reinstalled and re-configured each time the module is updated. It's going to be a problem with Composer.

NodeJS must be installed outside of docroot and manually set up. The configuration must correspond to that configured in the interface of the Private Message module (same operation as the Drupal Node.js integration module).

OR

NodeJS must be included directly with the module (during installation) and configured directly from the Private Message interface. I am not devellopeur and I do not know if it is possible.

OR

Private Message could only be installed with Composer (as is the case with Drupal Commerce) and requires a NodeJS dependency. I am not devellopeur and I do not know if it is possible.

Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Issue summary: View changes
zenimagine’s picture

Priority: Normal » Major
jaypan’s picture

Assigned: Unassigned » jaypan

  • Jaypan committed 8ac26c0 on 8.x-2.x
    Issue #2972506 by Jaypan: Setting up nodejs integration to be a composer...
zenimagine’s picture

Awesome you are back ;-)

Can you explain the changes? thank you

jaypan’s picture

I'm not done yet. I'll post more when I am finished.

zenimagine’s picture

ok thank you

jaypan’s picture

Status: Active » Fixed

I've had to do a major re-structure to get this all to work properly. I did the following:

1) Created a new composer library for the node-js backend for the library, and made that library available publicly as a composer library
2) Removed the Private Message Node.js module as a sub-module of the Private Message module
3) Created a new Drupal.org project for the Private Message Node.js module.
4) Created a new Drupal.org project called the Vendor Stream Wrapper module, which the Private Message Node.js module uses to resolve the path to a required file in the vendor directory.

Upgrading your system to handle the new structure may be a little difficult. I would suggest:

1) Run composer require drupal/private_message_nodejs.
2) Update the Private Message module. The Private Message module must be version 8.x-2.0-beta5 or greater.
3) Ensure that the Vendor Stream Wrapper module has been added to your file system.
4) Ensure that the [VENDOR FOLDER]/jaypan/private-message-nodejs folder exists
5) Navigate to [VENDOR FOLDER]/jaypan/private-message-nodejs, and run npm install
6) In the same folder, run node app.js and ensure it runs correctly.

zenimagine’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.