CLI reference page (DOCU-755)

[DOCU-776] Test npm-cli installation instructions on Linux Created: 25/Jul/16  Updated: 03/Jul/17  Resolved: 26/Jul/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 5.5, 5.4.x

Type: Sub-task Priority: Neutral
Reporter: Christoph Meier Assignee: Martin Drápela
Resolution: Done Votes: 0
Labels: core
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Template:
Date of First Response:
Sprint: Docu Sprint 11

 Description   

Read (beginning of) https://documentation.magnolia-cms.com/display/DOCS/Magnolia+npm-cli and please follow the installation instructions until you have a running version of the Magnolia npm-cli tools
on Linux (just one one distribution )

mdrapela, please check whether you find differences in what i have written while i was using OS-X.
And also try out https://documentation.magnolia-cms.com/display/DOCS/Magnolia+npm-cli#Magnolianpm-cli-Bashautocompletion

Feel free just to edit contents - if required.
See as a mix of testing & review the sections Installation, Bash autocompletion.

Try out the commands help and create-light-module, but please do not edit the commands section of the page yet.



 Comments   
Comment by Martin Drápela [ 26/Jul/16 ]

The installation of node.js was unfortunately a little more complicated than straightforward so I include the commands that finally lead me to the expected "v4.4.7" output of the "node -v" command:

mkdir Downloads
cd Downloads
wget https://nodejs.org/dist/v4.4.7/node-v4.4.7-linux-x86.tar.xz
cd /usr/local
sudo tar --strip-components 1 -xf ~/Downloads/node-v4.4.7-linux-x86.tar.xz

The command

sudo npm install @magnolia/cli --registry=https://npm.magnolia-cms.com/repository/npm -g

produced the following output with one warning at the beginning:

npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/mgnl -> /usr/local/lib/node_modules/@magnolia/cli/bin/mgnl.js
@magnolia/cli@0.0.1-snapshot-72 /usr/local/lib/node_modules/@magnolia/cli
├── http@0.0.0
├── fs@0.0.2
├── progress@1.1.8
├── truncate-middle@1.0.4
├── adm-zip@0.4.7
├── json2yaml@1.1.0 (remedial@1.0.7)
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── yaml-js@0.1.3
├── jquery@2.2.4
├── chalk@1.1.3 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@2.0.0, strip-ansi@3.0.1, has-ansi@2.0.0)
├── replace@0.3.0 (colors@0.5.1, minimatch@0.2.14, nomnom@1.6.2)
├── fs-extra@0.30.0 (path-is-absolute@1.0.0, jsonfile@2.3.1, graceful-fs@4.1.4, klaw@1.3.0, rimraf@2.5.4)
├── @magnolia/magnolia-build@0.5.1-snapshot-34 (path@0.12.7, fs-extra@0.26.7)
├── async@2.0.1 (lodash@4.14.0)
└── request@2.74.0 (tunnel-agent@0.4.3, aws-sign2@0.6.0, forever-agent@0.6.1, oauth-sign@0.8.2, caseless@0.11.0, is-typedarray@1.0.0, stringstream@0.0.5, aws4@1.4.1, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.3.1, qs@6.2.1, node-uuid@1.4.7, combined-stream@1.0.5, form-data@1.0.0-rc4, mime-types@2.1.11, bl@1.1.2, hawk@3.1.3, har-validator@2.0.6, http-signature@1.1.1)

mgnl -h command produced the expected result.
mgnl -V command printed 0.0.1-snapshot-72.

As for the "source" line for autocompletion, I had to put it into .bashrc cause my bash didn't read it from .profile.

Comment by Christoph Meier [ 27/Jul/16 ]

mdrapela, i was changing the vislibility of your Linix specific comments.

The installation hints i have added to Appendix - not sure whether that's fine in the general, theoretical tech.-writing meaning of an Appendix. However - i have done it like this for the moment. I don't want to have a separate node installation section for every OS. But since your findings are helpful i wanted them to have available.

Comment by Martin Drápela [ 08/Aug/16 ]

The mgnl create-light-module <module-name> command will create the following tree structure for the <module-name>:

<module-name>
├── decorations
├── dialogs
│   ├── components
│   └── pages
├── i18n
│   └── <module-name>-messages_en.properties
├── templates
│   ├── components
│   └── pages
└── webresources
    ├── css
    └── js

The <module-name>-messages_en.properties file will contain a link to the https://documentation.magnolia-cms.com/display/DOCS/Internationalization page.

Next, if e.g. the mgnl create-page page1 is entered, the module tree will look like as follows:

<module-name>
├── decorations
├── dialogs
│   ├── components
│   └── pages
│       └── page1.yaml
├── i18n
│   └── <module-name>-messages_en.properties
├── templates
│   ├── components
│   └── pages
│       ├── page1.ftl
│       └── page1.yaml
└── webresources
    ├── css
    └── js
Generated at Mon Feb 12 01:12:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.