<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 04:46:20 CET 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[NPMCLI-81] Identify best practice for files not used by magnolia</title>
                <link>https://jira.magnolia-cms.com/browse/NPMCLI-81</link>
                <project id="13983" key="NPMCLI">Magnolia CLI</project>
                    <description>&lt;p&gt;There are several instances of files that are related to a light module, that are not directly used by magnolia. Where should they be stored? How should these files be handled? &lt;/p&gt;

&lt;p&gt;While we must preserve the freedom for developers to handle the files however they want - we should provide a convention so that light modules can be easily shared, understood, and used.&lt;/p&gt;

&lt;p&gt;To keep in mind is both the case of companies developing a library of modules for in-house use, and in particular of developers sharing components in places like github and npm.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Some questions:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Should all the files be stored in the light module? Or should some of the files be stored in a separate location?&lt;/li&gt;
	&lt;li&gt;Where should tests be stored?&lt;/li&gt;
	&lt;li&gt;Where are examples stored?&lt;/li&gt;
	&lt;li&gt;Where are files to be processed - like less, sass, ES6, TS stored?&lt;/li&gt;
	&lt;li&gt;If all the files are in the light module - should something be done to remove them when using them in production - for security, tidiness, and to minimize resource consumption of the file watcher?&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="57570">NPMCLI-81</key>
            <summary>Identify best practice for files not used by magnolia</summary>
                <type id="3" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10898&amp;avatarType=issuetype">Task</type>
                                            <priority id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/neutral.gif">Neutral</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="rkowalski">Robert Kowalski</assignee>
                                    <reporter username="czimmermann">Christopher Zimmermann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Jan 2017 17:27:13 +0100</created>
                <updated>Tue, 21 Feb 2017 17:41:07 +0100</updated>
                            <resolved>Tue, 21 Feb 2017 17:33:16 +0100</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="138177" author="rkowalski" created="Thu, 26 Jan 2017 18:06:12 +0100"  >&lt;p&gt;First brain dump:&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;CompilingJS&quot;&gt;&lt;/a&gt;Compiling JS&lt;/h2&gt;

&lt;p&gt;For compiled JS files, e.g. with babel, its common practice to store them in a folder called `src` and compile them to a folder called `lib` with a pre-publish hook. Another approach, especially used by frontend libs is using the folder dist, especially if you have mixed content that is compiled (e.g. JS, CSS), see &lt;a href=&quot;https://github.com/JedWatson/react-select&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/JedWatson/react-select&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Hooks&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;A prepublish hook is called when you run `npm publish`, before npm creates and sents the tarball (i.e. the package). You basically add your compile commands them under `scripts` as `prepublish`. Its advised to run that step &lt;b&gt;before&lt;/b&gt; you publish and not as an installation hook. This way the downloaded &quot;artifact&quot; is always the same and can&apos;t differ depending on the configurations a local machine has.&lt;/p&gt;

&lt;p&gt;Real-world example: &lt;a href=&quot;https://github.com/apache/couchdb-nmo/blob/master/package.json#L7-L9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/apache/couchdb-nmo/blob/master/package.json#L7-L9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference: &lt;a href=&quot;https://docs.npmjs.com/misc/scripts&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.npmjs.com/misc/scripts&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Tests&quot;&gt;&lt;/a&gt;Tests&lt;/h2&gt;

&lt;p&gt;In the Node world tests usually go to the folder tests, thats why test-runner like `mocha` default to this directory.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Ignoring tests - the npm world&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;With npm they aren&apos;t ignored by default with some kind of magic, but people can use .gitignore and/or .npmignore files to exclude them from publishing. Some people do, some not, and sometimes people receive pull requests adding it to ignore-list. For some cases there are two sides which will never agree: Isaac always includes unit tests in published packages, whcih can be handy when you inspect the package in case of an error. Others argue that it takes space / bandwith. We have to keep in mind that those packages are run in another context and are not exposed on a webserver. &lt;/p&gt;

&lt;p&gt;For magnolia it definitely makes sense to ignore some files. If it is done by automatically we have to take care to communicate that in a prominent way, to avoid that users run into trouble, debug for hours and get mad. If not done automatically, the examples should always make use of the ignore-flag. In a publishing like process we could also print a warning if a test folder is found, but not added to a ignore-file&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Special case frontend libs&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;For Frontend libs people sometimes even check in the generated code into git, so people can just drag and drop the files out of the cloned repo (example from a popular lib: &lt;a href=&quot;https://github.com/JedWatson/react-select/tree/master/dist&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/JedWatson/react-select/tree/master/dist&lt;/a&gt;) &amp;#8211; they also have SASS that they compile to css btw&lt;/p&gt;</comment>
                            <comment id="138533" author="rkowalski" created="Fri, 3 Feb 2017 17:08:47 +0100"  >&lt;p&gt;&lt;a href=&quot;https://github.com/robertkowalski/mgnl-bobby&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/robertkowalski/mgnl-bobby&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/robertkowalski/mgnl-custom&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/robertkowalski/mgnl-custom&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;are leveraging the `.npmignore` and a prepublish hook to merge and compile the frontend JS.&lt;/p&gt;</comment>
                            <comment id="139005" author="rkowalski" created="Tue, 14 Feb 2017 13:13:46 +0100"  >&lt;p&gt;Can i configure Magnolia not to serve certain files? Is the list of currently ignored files (I think `.git` directories are ignored) hardcoded somewhere? ping &lt;a href=&quot;https://jira.magnolia-cms.com/secure/ViewProfile.jspa?name=fgrilli&quot; class=&quot;user-hover&quot; rel=&quot;fgrilli&quot;&gt;fgrilli&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="139024" author="fgrilli" created="Tue, 14 Feb 2017 14:26:34 +0100"  >&lt;p&gt;&lt;a href=&quot;https://jira.magnolia-cms.com/secure/ViewProfile.jspa?name=rkowalski&quot; class=&quot;user-hover&quot; rel=&quot;rkowalski&quot;&gt;rkowalski&lt;/a&gt; I think you&apos;re looking for this &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/MIME+type+mapping#MIMEtypemapping-RestrictingresponsestoconfiguredMIMEtypes&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://documentation.magnolia-cms.com/display/DOCS/MIME+type+mapping#MIMEtypemapping-RestrictingresponsestoconfiguredMIMEtypes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you&apos;re looking for files observed by Magnolia then in &lt;tt&gt;magnolia.properties&lt;/tt&gt; you can configure them with a regex&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
# Pattern to define which resources should be observed by ClasspathScanner
magnolia.resources.classpath.observation.pattern=.*\\.(ftl|yaml)$
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="139345" author="rkowalski" created="Tue, 21 Feb 2017 13:58:03 +0100"  >&lt;p&gt;&lt;b&gt;Should all the files be stored in the light module? Or should some of the files be stored in a separate location?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I started to put my dev-related sourcefiles into a folder called `_dev` (I stole this from &lt;a href=&quot;https://jira.magnolia-cms.com/secure/ViewProfile.jspa?name=czimmermann&quot; class=&quot;user-hover&quot; rel=&quot;czimmermann&quot;&gt;czimmermann&lt;/a&gt;). There are still files on the project level, like the .git folder and other project related files you don&apos;t want to share. The final light-module shouldn&apos;t contain them. One way to do that would be to set a folder called ``&lt;/p&gt;

&lt;p&gt;For LM shared via npm they should be filtered out before a publish with a .npmignore. Some are by default, but _dev and other files would be a nice addition.&lt;/p&gt;

&lt;p&gt;The both build-projects for Light-Mdoules &quot;furbie&quot; and &quot;super-furbie&quot; work whitelist based. Reason: the folder-structure for a Light-Module is in big parts always the same. With the many different frontent-tools and their config files its easier to maintain the whitelist containing the scaffolded folder-list by `mgnl create-light-module`.&lt;/p&gt;</comment>
                            <comment id="139352" author="rkowalski" created="Tue, 21 Feb 2017 14:44:20 +0100"  >&lt;p&gt;&lt;a href=&quot;https://jira.magnolia-cms.com/secure/ViewProfile.jspa?name=czimmermann&quot; class=&quot;user-hover&quot; rel=&quot;czimmermann&quot;&gt;czimmermann&lt;/a&gt; I think we can close this one as we worked out a good set of best practices in the last weeks. I put the ticket on tomorrows agenda&lt;/p&gt;</comment>
                            <comment id="139371" author="czimmermann" created="Tue, 21 Feb 2017 17:32:57 +0100"  >&lt;p&gt;Conclusion: We recommend &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Following established convention by putting all toolchain config files such as .babelrc etc at the root directory.&lt;/li&gt;
	&lt;li&gt;Putting other project related files in directory &apos;_dev&apos; - such as all src/resource files such as js, es6, ts, less, sass files and test scripts, and bootstraps for the tests, and sample content.&lt;/li&gt;
	&lt;li&gt;.npmignore file is used to specify files that are not included in npm package - and therefore will be present/cluttering packages/light modules retrieved from npm. (Users who want the source can get it from the linked source location if present ie github.&lt;/li&gt;
	&lt;li&gt;Note that the philosophy is to have package built before publishing on npm - so package is ready to use in Magnlla light-modules directory. (including any necessary declared npm package dependencies such as js project.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="139373" author="czimmermann" created="Tue, 21 Feb 2017 17:41:07 +0100"  >&lt;p&gt;Will be documented here: &lt;a href=&quot;https://wiki.magnolia-cms.com/display/PMTEAM/Conclusions+on+light+module+on+npm+topics&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://wiki.magnolia-cms.com/display/PMTEAM/Conclusions+on+light+module+on+npm+topics&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_14166" key="com.okapya.jira.checklist:checklist">
                        <customfieldname>Acceptance criteria</customfieldname>
                        <customfieldvalues>
                            
        <checklist>
        <![CDATA[
                            




                
                                    <div class="o-completion" style="display: flex; flex-shrink: 0;"><span  class="aui-lozenge aui-lozenge-complete" style="font-size: 12px; font-weight: normal; display: flex; flex-direction: row; align-items: center;" ><span style="padding-right: 4px; vertical-align: middle;"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="white"><path clip-rule="evenodd" d="m10.41037,3.42544l-7.86501,0c-0.72395,0 -1.31084,0.58688 -1.31084,1.31084l0,7.86508c0,0.7239 0.58689,1.3108 1.31084,1.3108l7.86501,0c0.724,0 1.3109,-0.5869 1.3109,-1.3108l0,-7.86508c0,-0.72396 -0.5869,-1.31084 -1.3109,-1.31084zm-7.86501,-0.65542c-1.08593,0 -1.96626,0.88032 -1.96626,1.96626l0,7.86508c0,1.0859 0.88033,1.9662 1.96626,1.9662l7.86501,0c1.086,0 1.9663,-0.8803 1.9663,-1.9662l0,-7.86508c0,-1.08594 -0.8803,-1.96626 -1.9663,-1.96626l-7.86501,0z" fill-rule="evenodd"/><path d="m5.09049,10.18526l-1.82767,-1.82766l-0.78479,0.78479l2.61246,2.61246l5.38758,-5.38754l-0.78483,-0.78479l-4.60275,4.60274z"/></svg></span><span>Empty</span></span></div>
                        ]]>
    </checklist>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>magnolia-cms.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 26 Jan 2017 18:06:12 +0100</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10246" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>NPMCLI-80</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>czimmermann</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 51 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>czimmermann</customfieldvalue>
            <customfieldvalue>fgrilli</customfieldvalue>
            <customfieldvalue>rkowalski</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i06rsy:r</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10245" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="431">Basel 84</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10242" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_14167" key="com.okapya.jira.checklist:checklist">
                        <customfieldname>Task DoR</customfieldname>
                        <customfieldvalues>
                            
        <checklist>
        <![CDATA[
                            




                
                                    <div class="o-completion" style="display: flex; flex-shrink: 0;"><span  class="aui-lozenge aui-lozenge-complete" style="font-size: 12px; font-weight: normal; display: flex; flex-direction: row; align-items: center;" ><span style="padding-right: 4px; vertical-align: middle;"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="white"><path clip-rule="evenodd" d="m10.41037,3.42544l-7.86501,0c-0.72395,0 -1.31084,0.58688 -1.31084,1.31084l0,7.86508c0,0.7239 0.58689,1.3108 1.31084,1.3108l7.86501,0c0.724,0 1.3109,-0.5869 1.3109,-1.3108l0,-7.86508c0,-0.72396 -0.5869,-1.31084 -1.3109,-1.31084zm-7.86501,-0.65542c-1.08593,0 -1.96626,0.88032 -1.96626,1.96626l0,7.86508c0,1.0859 0.88033,1.9662 1.96626,1.9662l7.86501,0c1.086,0 1.9663,-0.8803 1.9663,-1.9662l0,-7.86508c0,-1.08594 -0.8803,-1.96626 -1.9663,-1.96626l-7.86501,0z" fill-rule="evenodd"/><path d="m5.09049,10.18526l-1.82767,-1.82766l-0.78479,0.78479l2.61246,2.61246l5.38758,-5.38754l-0.78483,-0.78479l-4.60275,4.60274z"/></svg></span><span>Empty</span></span></div>
                        ]]>
    </checklist>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>