[NPMCLI-71] LESS and SASS: Identify best practices Created: 17/Jan/17  Updated: 27/Feb/17  Resolved: 22/Feb/17

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Robert Kowalski Assignee: Robert Kowalski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to NPMCLI-79 Light Project support Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Epic Link: CLI: Resource handling
Sprint: Basel 84
Story Points: 8

 Description   

What are the best practices for compiled assets like LESS or SASS?

npm has certain hooks, e.g. the pre-publishing hook, which is a nice way to compile things like SASS or LESS to CSS for your frontend package before publishing.

Identify and document/communicate best practices for developers for the two ways to create and manage light modules: maven to light module / npm to light module.



 Comments   
Comment by Robert Kowalski [ 19/Jan/17 ]

needs discussions and then probably a re-estimate

Comment by Robert Kowalski [ 26/Jan/17 ]

Dont want to feature creep. This came to my mind: We should also take a look at documentation.

Something the Node community doesn't have a convention for is documentation. Everyone is cooking their own. Many use Markdown which is rendered to html on github and/or a dedicated github (web) page (github-pages).

The Python community has solved that in an interesting way. Every Python module uses Sphinx, the de-facto doc tool for Python. This way every documentation looks and feels pretty much the same, which has certain advantages. I think it also encourages developers to provide documentation, which is something the JS community can learn from. Right now, I have to check the sourcecode of a JS project as they are completely underdocumented or have no docs at all.

Comment by Robert Kowalski [ 17/Feb/17 ]

Regarding docs: Topher worked on best practices for READMEs / docs

Comment by Robert Kowalski [ 17/Feb/17 ]

Taking https://jira.magnolia-cms.com/browse/NPMCLI-79?focusedCommentId=139184&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-139184 into account.

There are two cases: I want to consume a light-module or I want to develop a light-module

Consuming:
A light-module should be published production ready to the npm registry. LESS SASS and other pre-preprocessorstyles should be compiled before a publish, with a prepublish hook in the npm scripts section. LESS and SASS are compiled to CSS in webresources/

Hack on a light-module:
There is no silver bullet for compiling that we could recommend because of the fast churn rates in frontend tech right now. As long as a light-module on github contains everything what is needed for a build in its dev-dependencies, this is fine. A convention on `npm run build` as compile step is useful.

Comment by Christopher Zimmermann [ 21/Feb/17 ]

Document here: https://wiki.magnolia-cms.com/display/PMTEAM/Conclusions+on+light+module+on+npm+topics

Generated at Mon Feb 12 04:46:14 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.