# @todo add friendly task/static-task key lookup (will allow alternate key names to be used in bundle configs in a more friendly/extensible manner

# Path to bundle configurations
bundlesPath: ./gulpw-bundles

# Allowed bundle configuration formats
bundleConfigFormats:
  - .yaml
  - .js
  - .json

# Local user level config path
localConfigPath: ./.gulpw

# Local backup path for local config files
localConfigBackupPath: ./.gulpw/backups

# Path where user would store help files for their custom tasks (if necessary @see `tasks` section)
localHelpPath: null

# Wrangler help docs
helpPath: ./docs

staticTasks:
  "help":
    constructorLocation: ./src/static-tasks-adapters/HelpTaskAdapter

  "config":
    constructorLocation: ./src/static-tasks-adapters/ConfigTaskAdapter
    unconfigurableTasks:
      - copy
      - browserify
    notAllowedInnerKeys:
      - priority
      - constructorLocation
    fileName: 'gulpw-config'

  "deploy-config":
    constructorLocation: ./src/static-tasks-adapters/DeployConfigTaskAdapter
    fileName: 'deploy.yaml'

  "bundle":
    constructorLocation: ./src/static-tasks-adapters/BundleConfigTaskAdapter
    emptyBundleFile: ./configs/empty.bundle.template.yaml
    allowedTasks:
      - browserify
      - compass
      - copy
      - csslint
      - deploy
      - jasmine
      - jshint
      - mocha
      - requirejs
      - vulcan
      - watch

tasks:

  # task:
  #   localConstructor: constructor/path/to/your/task's/constructor.{extension-here}
  #   localHelpFile: null # If help instructions are extensive use this parameter
  #   help: ""            # If help instructions are minimal use this parameter
  #   priority: null      # The task's priority (recommended when running with '--async' flag
  #   dependencies:       # Dependencies that are needed by this 'task'  (@tentative Wrangler
  #                         looks up the dependencies and saves them if they are not already saved)
  #

  # Browserify Defaults
  browserify:
    constructorLocation: ./src/bundle-tasks-adapters/BrowserifyAdapter
    priority: 92

  # Build Task (Looks through {bundle-alias}.yaml file and runs
  # all tasks that are not in the `ignoredTasks` array in this config.
  build:
    constructorLocation: ./src/bundle-tasks-adapters/BuildAdapter
    priority: -98

    ignoredTasks:
      - clean
      - mocha
      - jasmine
      - deploy
      - jshint
      - csslint
      - watch

  clean:
    constructorLocation: ./src/bundle-tasks-adapters/CleanAdapter
    priority: 100
    allowedFileTypes:
      - js
      - css
      - html

  compass:
    constructorLocation: ./src/bundle-tasks-adapters/CompassAdapter
    priority: 98
    configrb: null # config.rb home
    canRunStatically: true
    
  copy:
    constructorLocation: ./src/bundle-tasks-adapters/CopyAdapter
    priority: 99
    
  csslint:
    priority: 97
    constructorLocation: ./src/bundle-tasks-adapters/CssLintAdapter
    csslintrc: null
    
  # Deploy Task
  deploy:
    constructorLocation: ./src/bundle-tasks-adapters/DeployAdapter
    priority: -100

    # Whether to deploy files using unix paths (useful if you're on Windows and need to deploy to a *nix type server)
    deployUsingUnixStylePaths: true

    # Options written by `gulpw deploy-config`
    developingDomain: null
    hostnamePrefixFolder: null
    hostnamePrefix: null
    hostname: null
    port: 22
    username: null
    password: null
    publickeyPassphrase: null
    privatekeyLocation: null

    # File types that are allowed for deployment
    allowedFileTypes:
      - js
      - css
      - html
      - json
      - yaml
      - jpg
      - png
      - gif
      - md
      - mkd

    # Hash of domains to develop for:
    domainsToDevelop: null

  eslint:
    constructorLocation: ./src/bundle-tasks-adapters/EsLintAdapter
    priority: 96
    options:
      useEslintrc: true
    failAfterError: false
    failOnError: false
    eslintrc: ./.eslintrc

  jasmine:
    constructorLocation: ./src/bundle-tasks-adapters/JasmineAdapter
    priority: 95
    files: null # testDir or array of files (test files)
    options: null
    
  jshint:
    constructorLocation: ./src/bundle-tasks-adapters/JsHintAdapter
    priority: 96
    jshintrc: ./.jshintrc
    ignoredFiles: null
    options:
      predef:
        - $
        - _
        - amplify
        - Backbone
        - browserify
        - define
        - jQuery
        - Modernizr
        - Mustache
        - Marionette
        - require
        - sjl
    
  minify:
    constructorLocation: ./src/bundle-tasks-adapters/MinifyAdapter
    priority: 91
    header: |
      /*! Company Name * http://www.company-website.com * Filename: <%= bundle.options.alias + '.' + fileExt %> * Version: <%= bundle.options.version %> * Created: (<%= (new Date()).getTime() %>) * Hashsum: <%= fileHashType %>:<%= bundle[fileExt + 'Hash'] %> */
    cssBuildPath: some/path/to/build/path
    htmlBuildPath: some/path/to/build/path
    jsBuildPath: some/path/to/build/path
    fileHashType: sha256
    createFileHashes: true
    prependFileHashToFileName: false
    appendFileHashToFileName: true
    noDomWrapperAndAppendedScript: false
    noDomWrapper: false
    allowedFileTypes:
      - js
      - html
      - css
    htmlTaskOptions:
      spare: true
      comments: true
    jsTaskOptions: {}

    # Copy paste key results:
    #copyPasteKeyResults: {keyName} [html,js,css, .etc]

    # Enables use of babel
    useBabel: false
    # @see for more gulp-babel options and usage examples: https://www.npmjs.com/package/gulp-babel
    # @see for babel options (try 'usage' or 'advanced' links for more about options).
    babelOptions: null

    useMinPreSuffix: false
    useVersionNumInFileName: false
    template:
      templatePartial: null
      compressWhitespace: true
      templateTypeKeys:
        - mustache
        - handlebars
        - ejs

      # Use the file path as they key
      useFilePathAsKey: true

      # Removes the file extension on the key
      removeFileExtensionsOnKeys: true

      # Sets the key to everything after this string (file extension part depends on `removeFileExtensionsOnKeys`)
      splitKeyAt: ./

  mocha:
    constructorLocation: ./src/bundle-tasks-adapters/MochaAdapter
    priority: 94
    files: null # testDir or array of files (test files)
    options: null
    
  # RequireJs Defaults
  requirejs:
    constructorLocation: ./src/bundle-tasks-adapters/RequireJsAdapter
    priority: 93
    
  # Watch Task Defaults
  watch:
    constructorLocation: ./src/bundle-tasks-adapters/WatchAdapter
    priority: -99

    # Tasks to ignore on the bundle level (watch creates it's own
    # collection of deploy tasks from the bundle(s) registered with it so deploy is ignored per bundle
    # and a new deploy task is created which contains all files to be deployed from all currently watched bundles)
    ignoredTasks:
      - clean
      - deploy

    # Tasks to run on file changes ** Note ** only tasks that match changed file types will be run
    tasks:
      - build
      - deploy

#  minifyjs:
#    constructorLocation: ./src/bundle-tasks-adapters/MinifyJsAdapter
#    priority: 99
#    alternateName: js
#    #files:
#
#    # Options go here or within bundle config
#    #options:
#    # @see https://www.npmjs.com/package/gulp-uglify
#    # @see https://www.npmjs.com/package/uglify-js
#
#  minifyhtml:
#    constructorLocation: ./src/bundle-tasks-adapters/MinifyHtmlAdapter
#    priority: 99
#    alternateName: html
#    #files:
#
#    # Options go here or within bundle config
#    options:
#      spare: true
#      comments: true
#
#  minifycss:
#    constructorLocation: ./src/bundle-tasks-adapters/MinifyCssAdapter
#    priority: 99
#    alternateName: css
#    #files:
#
#    # Options go here or within bundle config
#    #options:
#
#  minifyimage:
#    constructorLocation: ./src/bundle-tasks-adapters/ImageminAdapter
#    priority: 99
#    alternateName: images
#    #files
#
#    # Options go here or within bundle config
#    #options:
#
#  crisper:
#    constructorLocation: ./src/bundle-tasks-adapters/CrisperAdapter
#    priority: 98
#    #files
#
#    # Options go here or within bundle config
#    #options:
#
#  babel:
#    constructorLocation: ./src/bundle-tasks-adapters/BabelAdapter
#    priority: 97
#    #files:
#
#    # Options go here or within bundle config
#    #options:

  # Runs vulcanize and crisper on a file and alternately the file hash as a prefix or suffix
  # to the file's basename.
  vulcan:
    constructorLocation: ./src/bundle-tasks-adapters/VulcanTaskAdapter
    priority: 92

    # Files to vulcanize
    # files: // Populated from bundle.{json,js,yaml} file

    # Destination directory for resulting files
    # destDir: // Populated from bundle ""

    # Crisper options
    # @see for available options see: https://www.npmjs.com/package/crisper
    #crisperOptions:
      #jsFileName: # populated from bundle.  Optional.  Default `bundle.alias`
      #scriptInHead: false.  Puts script in head with 'defer' attribute.
      #onlySplit: false.  If false, omits script include of outputted javascript file

    # Vulcanize options (options for `gulp-vulcanize`)
    # @see for available options: https://github.com/Polymer/vulcanize#using-vulcanize-programmatically
    vulcanizeOptions:
      inlineScripts: true
      inlineCss: true

    # Remove generated 'html>head+body' elements and just keep the body's contents
    # @see for more options: https://www.npmjs.com/package/gulp-dom
    #noDomWrapper: false # Best used from bundle config level

  findandreplace:
    constructorLocation: ./src/bundle-tasks-adapters/FindAndReplaceAdapter.js
    priority: -98
    # 'gulp-replace' module options
    # @see for available options: https://www.npmjs.com/package/gulp-replace
    #options:

    # Files to find and replace on.  Array.
    #files:

    # Key value hash of things to search for (regex|string) and values (string) to replace them with.
    #findandreplace:

  copytoclipboard:
    alternateAlias: clipboard
    constructorLocation: ./src/bundle-tasks-adapters/CopyToClipboardTaskAdapter.js
    priority: -100
    # The following two attributes are optional but at least one must declared inorder to use this task:
    #file: {String} - Optional.
    #files: {String|Array} - Optional.
