ngbp / spell-webapp

An ngbp spell to manage web application development.
1 stars 3 forks source link

feat(paths): allow specifying the application root #1

Closed Merott closed 10 years ago

Merott commented 10 years ago

Set the paths.app_root variable to allow the user configure the directory where the main application resides. This allows keeping the application files separate from the build system, should the user wish to do that.

joshdmiller commented 10 years ago

Cool. I have no real objection to this.

One tiny challenge, though, that comes to mind is how to handle cleaning tasks. Grunt and Gulp cleaning tasks usually require the --force flag to allow deleting anything outside the current working directory so that one cannot accidentally delete the directory she's currently in. But I've received this question for the Grunt version of ngbp, too, so clearly it's something some people want to do.

Should we just trust people not to do something stupid? Or should we add the forcing functionality that Grunt has?

For what it's worth, right now, the warlock.json file is read from the current directory or any directory above it. But if one wanted to throw all configuration files into a subfolder, one need only do warlock -c subfolder/warlock.json and it will work correctly.

Merott commented 10 years ago

I think it would be sensible to require the --force flag if the application root resides outside of the current working directory - perhaps the user could explicitly remove this restriction through a config.

I personally never intend to keep the application directory outside of the build system, but I prefer to put the application in a subdirectory alongside warlock.json, like this:

my-warlock-app/
   |- application/
      |- src/
      |- vendor/
      |- ...
   |- node_modules/
   |- package.json
   |- warlock.json
Merott commented 10 years ago

Looks like I made this PR on the master branch by mistake. I'll submit a new PR on a clean branch.

Josh, is there anything you'd like to see change?

Merott commented 10 years ago

Opened a new PR on its own branch. This one's a mess. Closed.