Pinpickle / tight

Bolt boilerplate generator
15 stars 0 forks source link

Investigate restructure of files #4

Closed Pinpickle closed 9 years ago

Pinpickle commented 9 years ago

@Boorj, when discussing a Yeoman generator for Bolt, brought up a custom implementation that differs from the default Bolt file structure. This sounds like a step in the right direction and, for sites like this (built with one theme, a custom local extension, for example) would help reduce file system cruft.

Here's what I'm thinking at the moment as a potential structure, I don't know how possible this is.

app:
 - config # Includes all ordinary config as well as theme config.yml
 - cache
 - db
extensions:
# Same as current extensions folder
extension:
 - Extension.php
 - TwigHelper.php # And any other extension stuff
assets:
 - scripts
 - styles
 - images
 - fonts # etc... same as theme assets
# -- Potentially under a custom web directory -- #
files:
# Same as current files folder
assets-dist:
# Compiled versions of assets and all that
extensions:
# Public facing extensions files if under a custom web directory
# -- End: Potentially under a custom web directory -- #
.editorconfig
.env
.gitignore
.htaccess
.composer.json
composer.lock
favicon.ico
gulpfile.js # Note: Only one gulpfile instead of two!
index.php # Will have to have custom bootstrapping to make this work
package.json
README.md

All of the relevant asset stuff (templates, assets), should also be able to serve backend content. If the bootstrapping logic gets too complex, it may make sense to move it to a Composer package so updating is easy.

Boorj commented 9 years ago

answered here

Boorj commented 9 years ago

as a comment for my directory structure, i think i will move file uploads folder out from web folder but only when i make post-upload functions. So when i upload 1.jpg to to root/files/, it makes a resized (fit to 900px×900px, for example) copy to root/web/files, probably it's being watermarked or cropped or has a color processing.. It let's you avoid original files being stolen or something — sometimes it could be important and don't make uploader resize (process) each photo manually.

p.s. Btw, the best way to reach me is to mention my nickname ( :man: Klaus) on bolt's IRC channel :rabbit2: .

Pinpickle commented 9 years ago

Thanks for your awesome writeup @Boorj! (commenting here as its more relevant). Looking at it, just changing the directory structure shouldn't be too much of a hassle. Going as far as you have, well, that is quite some configuration!

You may save some time not only with a generator, but also putting all of your re-usable functionality in a composer package/Bolt extension. That way, you can use a generator like this (which will do the simple stuff), and then you can add on the composer package for all of the extra goodies.

I'll keep in mind the tip about IRC if I come into the need for some advice. Which I probably will!

Boorj commented 9 years ago

you're welcome, Christian :) Actually i'm really interested in creation of a system that is like "one click install" that will put all files to its places and make all configurations. Or even probably one meta-config file, which creates a project with lots of my own tweaks. So i hoped yeoman could help me, since it's nodejs based and can easily operate with files.