patternlab-php-core icon indicating copy to clipboard operation
patternlab-php-core copied to clipboard

"Default Path" for installing files

Open dmolsen opened this issue 9 years ago • 0 comments

PL installer should support a default path option in a package install. This way an author can develop small modules that can be included in other StarterKits but they don't have to worry about matching the target's filesystem exactly. If it does then great. Otherwise give them an out. It'd work like:

composer.json...
"extra": {
   "patternlab": {
       "defaultPath": "atoms/general",
       "patternDir": [
           { "*": "\\defaultPath" }
       ]
   }
}

The above would try to move everything in ./dist in the package and:

  1. use the user-defined patternDir and try to install in the given default path. In this case it's atoms/general. It would check numbering just in case. If that didn't work...
  2. try each directory in the default path as keywords and compare against a user-supplied mapping in ./config. If that didn't work...
  3. prompt the user to type in an install location

This feature should also support an array of path key/value pairs so multiple default paths could be set-up. The following install locations should support default paths:

  • publicDir,
  • sourceDir, and
  • dataDir.

dmolsen avatar May 17 '16 19:05 dmolsen