DEV-159 - Getting issue details... STATUS
DEV-178 - Getting issue details... STATUS
The PoCof setup tools has become a new Magnolia project. Here are its coordinates
GIT: https://git.magnolia-cms.com/projects/BUILD/repos/npm-jumpstart/browse (master [jetty+Magnolia web app ] and tomcat-bundle branches)
Inspired by Tomáš's presentation at Lunch&Learn about Node.js and its package manager npmjs based module called CLI https://git.magnolia-cms.com/users/tgregovsky/repos/cli/browse.
Provide an npm package for front-end devs to get started fast and develop painlessly (hopefully) with Magnolia and light development.
- increased efficiency by automation of daily tasks (creation of page and component templates, assignment of components to pages, creation of dialogs associated with pages or components)
- reduce amount of possible spaces for errors (by generating common structures automatically, thus limiting possible errors to misspellings of component names or dialog fields added by user, but ensuring that structure is correct)
- lower entry barrier for becoming frontend developer using Magnolia (learning couple of commands to generate basic website structure vs. learning whole configuration structure for template definitions just to create first templates)
- additional, secondary benefit are
- further increases in effectivity of development due to reduced number of testing configuration cycles (due to lower number of errors)
- making learning advanced configuration simpler (by allowing frontend developers to inspect generated structures)
- ensuring better understanding of custom work within project teams (generated structures are always same no matter which developer generated them and encourage people to place additions at the same locations)
- whatever structures and placements for the resulting artifacts are generated by scripts need to be aligned with the structures generated by npm magnolia-build & distribution scripts
- scripts need to operate correctly also when one chooses to not use npm for distribution (for small and internal projects)
- Final version should be released with Magnolia 5.5 latest.
- Alpha version for the 2016 conference in Basel.
Scripts described below can be either installed as global and executed without need for
npm run prefix or just locally with it. In case of the local execution only, one need to have scripts defined in his
npm startto download and start Magnolia initially
As part of
magnolia.properties in downloaded and extracted instance are also adapted.
In case of existing installation of Magnolia it is possible to point scripts to it and start such existing installation (for users with custom locally-only available bundles).
Configuration of use of CE or EE instance of Magnolia is also possible by modification of
- creation of pages e.g.
- creation of components e.g.
- adding components availability to pages e.g.
add-component myImage available@sampleModule:pages/myHome@main
- adding autogenerated components to pages e.g.
add-component footer autogenerate@sampleModule:pages/myHome@footer
A custom command might allow users to download additional Magnolia modules as they come in need and place them automatically in
WEB-INF/lib(well resolving dependencies in that case could be tricky or we need to limit this to downloading bundles that have all dependencies already packed).
- include jumpstart part of the project
- do not use any other tools such as yeoman or gulp or others to avoid extra complexity
- Which bundle to use for jumpstart custom jetty or standard tomcat?
- Similarly to jumpstart, cli scripts need to be installed. Currently two proposals exist. Decision is needed for which way to go
- Naming & syntax of the tasks/operations/scripts for CLI part need to be confirmed
- Refactoring of the scripts (started by DEV-178, follow up tasks should be created as part of the ticket where identified and will be added at later point)
Experimenting with Node.js and npm
As I'm a newbie to Node.js I had first to get familiar with the new technology. The result of my trials and errors is the little module at
There are two flavours of the module on two different branches
- master: a module using Jetty + Magnolia community web app
- tomcat-bundle: a module using Magnolia's CE tomcat bundle
From the module's readme.txt
This is a PoC for a nodejs module (package) which installs and runs a Magnolia instance ready for light development. ... Run: - run "npm start". This will -- connect to Magnolia's public repository on Nexus and download Magnolia (see package.json) -- extract Magnolia -- change some magnolia.properties (again see package.json) -- start up Magnolia Custom commands: - Apart from the standard npm commands corresponding to the phases of a package lifecycle, e.g. install, start, etc. this module provides these additional commands -- start-magnolia, usage "npm run start-magnolia" -- stop-magnolia, usage "npm run stop-magnolia" -- restart-magnolia, usage "npm run restart-magnolia"