v.0.0.1
kdz is a Node build tool I created for scaffolding out my projects.
Review the actual code in the heavily-commented kdz.js files as well as the JS files in config/...also heavily-commented.
kdz is not available as a downloadable npm module so if you want to install it, you will need to clone this repo to your machine first. Therefore, please note the following:
-
This tool has been tested on Unix-like systems only. Testing it on Windows machines is listed in the todo section.
-
There shouldn't be an npm tool or module called
kdzalready installed on your machine. So you should be able to install it with no issues but just to be sure, runwhich kdzin your terminal. If it doesn't say the file is installed somewhere, you're ok. If it does, PLEASE LET ME KNOW ASAP!! -
This tool downloads files from a pre-defined root link in
kdz.jsthat points to my GitHub repo. If you want to change that link, you would have to change thegithubRootvariable inconfig/dlFiles.js. -
I'm assuming that you have Node/npm installed on the machine to which you're downloading this tool. If not, please get Node & npm.
kdz uses a small set of commands and options to scaffold a basic web application based on the methods and tricks I commonly use for web development. It creates files & folders and also downloads specific files from this repo.
-
Open a terminal window and clone this repository somewhere on your local machine:
git clone https://github.com/kaidez/kdz.git -
Navigate to the repo in your terminal and install it...you may need to do this using
sudo:npm install -g
From here, run kdz app whenever you want from whatever folder you want.
Running kdz app scaffolds out a single-page-application (SPA) by performing the following steps:
- a
buildfolder is created withcssandjssubdirectories. - a
coffeefolder is created and includes amain.coffeefile. - a
css-buildfolder is created with animportssubdirectory. - and empty
image-minfolder is created (images that need to be minified go here) bower.json,.bowerrcandSTYLEGUIDE.mdfiles are downloaded from thesource-shared-filesdirectory.- SPA-like
Gruntfile.js,gulpfile.jsandpackage.jsonfiles are downloaded from thesource-spadirectory.
If the --test flag is attached to kdz app, a test-build folder is created, then a test scaffold is created in that folder. kdz dt is a quick way of deleting test-build.
Scaffolds out a WordPress-like project. It performs almost the same tasks as kdz app with the following differences:
- The
buildfolder and its subdirectories are not created. - The
Gruntfile.js,gulpfile.jsandpackage.jsonfiles that are downloaded are more geared toward WordPress development and downloaded fromsource-wordpress. - A
functions.phpfile is downloaded.
Downloads a .gitignore file from source-spa to the root folder. If the -w option is passed, .gitignore will be WordPress-specific and downloaded from the source-wordpress folder.
Downloads LESS files from source-spa to css-build and css-build/imports If the -w option is passed, the LESS files will be WordPress-specific and downloaded from the source-wordpress folder.
Downloads Sass files from source-spa to css-build and css-build/imports If the -w option is passed, the Sass files will be WordPress-specific and downloaded from the source-wordpress folder.
Creates a folder called test-build and creates a test scaffold. test-build is listed as "non-commitable" in .gitignore.
kdz uses an older version of the download module, which is used to download files from my GitHub repo. This is because it currently causes errors when used with the download-status module, which is displays a progress bar for an individual download....read more about this here. I'll watch for if/when this is fixed, then update it.
Type either kdz or kdz --help in your terminal. The following will be outputted:
Usage: kdz [options] [command]
Commands:
app scaffold a basic web application
dt delete "test-build" folder
Options:
-h, --help output usage information
-V, --version output the version number
-w, --wordpress create a WordPress project
-g, --gitignore download ".gitignore" file
-l, --less download LESS files in "css-build"
-s, --scss download Sass files in "css-build"
-t, --test do a test scaffold in "test-build"
kdz is still new so there are some things I'd still like/want to do:
- See how the promises can be made to work better.
- The folder-existence check isn't accurate...make it more accurate.
- Create specific commands for both the LESS and Sass downloads...don't make them work with just an option.
- Perform error handling when flags are passed improperly.
- See how templates can be used.
- Rewrite
kdz.jsin Coffeescript. - Test on Windows machines.
- See if pointing to GitHub files with the GitHub API is better than pointing to them directly.
- See if a reusable function can be created for tasks related to
fs.open(). - Add prompt functionality so things like
package.jsoncan be customized.
