material-design-for-wordpress
                                
                                 material-design-for-wordpress copied to clipboard
                                
                                    material-design-for-wordpress copied to clipboard
                            
                            
                            
                        Assets directory inconsistency
 Issue by dugajean
Wednesday Apr 29, 2020 at 20:27 GMT
Originally opened as https://github.com/xwp/material-design-wp-plugin/issues/203
In the assets/ directory we have the following directories:
- css
- js
- src
This doesn't make much sense, as src contains JS code which when compiled goes to the js folder. So now we have folder right under assets which include JS code.
This isn't the case for css. In this folder, we initially have all the compiled CSS and another inner src/ folder which contains the CSS we code in (assets/css/src).
This whole structure is quite messy and unintuitive to newcomers and should be changed into a more consistent structure.
Proposed solutions:
- Have a cssand ajsfolder right underassets; The compiled assets are right there under these folders, but there's also asrcfolder in each of these folders containing the actual source code. In short: replicate what CSS has to the JS side.
- Have a css, ajsfolder and adistfolder - right underassets; Thisdistfolder contains both compiled JS and CSS. Thecssandjsfolder hold their respective source files.
One of these two solutions guarantees consistency and reduces confusion at navigating theses project files.
Input welcome.
 Comment by davidlonjon
Thursday Apr 30, 2020 at 02:32 GMT
Hi @dugajean ,
I agree with you that this structure is confusing and I would prefer to go towards the second solution you highlighted which makes more sense to me and more align with what many other projects is/might do.
 Comment by technosailor
Tuesday Dec 15, 2020 at 19:49 GMT
I'd offer a third option that I think is even more intuitive to someone coming into the project.
Under assets, have dist and src. Under dist, js and css. These are compiled assets. Have the same directories under src. This is the source code under development.
assets/
  |-dist
    |-css
    |-js
  |-src
    |-css
    |-js
Thoughts?
 Comment by ravichdev
Thursday Jan 21, 2021 at 12:52 GMT
I like option 1 as that will also ensure we have assets/js/[DIST JS FILES] and assets/css/[DIST CSS FILES] in the plugin build file and the WP SVN repo.
PR #501 is open with option 1 changes.