Templating: Need Support for additional file types

Created on 8 Feb 2017  路  7Comments  路  Source: dotnet/templating

We need support for these file types. Many will be setup the same as each other:

  • [x] **/.bowerrc
  • [ ] */.il
  • [x] */.js
  • [x] */.ts
  • [ ] */.less
  • [ ] */.sass
  • [x] */.vb
  • [x] */.vbhtml
  • [x] */.c
  • [x] */.cxx
  • [x] */.hxx
  • [ ] */.wxi
  • [ ] */.wxl
  • [ ] */.wxs
  • [x] */.*proj.user
  • [x] */.msbuild
  • [x] */.props
  • [x] */.targets
  • [ ] */.handlebars
  • [ ] */.hbs
  • [ ] */.vue
  • [x] **/app.config
  • [x] **/web.config
  • [x] */web..config
  • [x] **/packages.config
  • [x] */.nuspec
  • [x] */.xml
  • [ ] */.psess
  • [x] */.xslt
  • [x] */.xsd
  • [x] */.xaml
  • [x] */.resx
  • [x] */.vsixmanifest
  • [x] */.vsct
  • [x] */.jsx
  • [x] */.tsx
  • [x] */.sln
  • [ ] **/.gitignore
  • [x] */.sh
  • [x] */.haml
  • [x] */.json
  • [x] */.css.min
  • [x] */.css
  • [x] */.cshtml
  • [x] */.cs
  • [x] */.fs
  • [x] */.cpp
  • [x] */.h
  • [x] */.hpp
  • [x] */.*proj
  • [x] */.*htm
  • [x] */.*html
  • [x] */.jsp
  • [x] */.asp
  • [x] */.aspx
  • [x] */.bat
  • [x] */.cmd
  • [x] **/nginix.conf
  • [x] **/robots.txt
triaged

Most helpful comment

  • [ ] yaml
  • [ ] yml

All 7 comments

@mhutch anything you can think of that's missing from this list?

For iOS and Android I would add:

.storyboard
.axml
.plist
.xib
.strings

These are all really just XML.

HTML/XML

  • [ ] .j2
  • [ ] .nj
  • [ ] .njk
  • [ ] .njs
  • [ ] .nunj
  • [ ] .nunjs
  • [ ] .nunjucks
  • [ ] .smarty
  • [x] .svg
  • [ ] .tpl
  • [ ] .vue
  • [ ] .vash
  • [ ] .ejs
  • [ ] .erb
  • [ ] .liquid
  • [ ] .lava
  • [ ] .j2
  • [ ] .spark
  • [ ] .cfm
  • [ ] .cfml
  • [ ] .cfc
  • [ ] .wax
  • [x] .pubxml
  • [ ] .qwc
  • [x] .vdproj
  • [x] .targets
  • [ ] .imagemanifest
  • [x] .vsct
  • [ ] .tmlanguage

JavaScript

  • [x] .jsx
  • [x] .es
  • [x] .es6

JSON

  • [x] .jsonld
  • [x] .hjson
  • [x] .json5
  • [x] .bowerrc
  • [x] .npmrc
  • [x] .job
  • [x] .geojson
  • [x] .topojson
  • [x] .postcssrc
  • [x] .babelrc
  • [x] .csslintrc
  • [x] .eslintrc
  • [x] .jade-lintrc
  • [x] .pug-lintrc
  • [x] .jshintrc
  • [x] .stylelintrc
  • [x] .yarnrc
  • [ ] yaml
  • [ ] yml

We will discuss which of these file types fit our roadmap.

In order to support conditions in the places I required them, I had to add configuration for yml, Dockerfile, and nuget.config.

"SpecialCustomOperations": {
    "**/*.yml": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "if": [ "#-if" ],
            "else": [ "#-else" ],
            "elseif": [ "#-elseif" ],
            "endif": [ "#-endif" ],
            "trim": true,
            "wholeLine": true,
            "evaluator": "C++"
          }
        }
      ]
    },
    "**/Dockerfile": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "if": [ "#-if" ],
            "else": [ "#-else" ],
            "elseif": [ "#-elseif" ],
            "endif": [ "#-endif" ],
            "trim": true,
            "wholeLine": true,
            "evaluator": "C++"
          }
        }
      ]
    },
    "**/nuget.config": {
      "operations": [
        {
          "type": "conditional",
          "configuration":{
            "if": [ "<!--#if" ],
            "else": [ "<!--#else" ],
            "elseif": [ "<!--#elseif" ],
            "endif": [ "<!--#endif" ],
            "trim": true,
            "wholeLine": true,
            "evaluator": "C++"
          }
        }
      ]
    }
  }

I'd like to add:

  • *.md
  • .gitattributes
  • .editorconfig
  • *.cake

These are the configurations I'm using to add support for *.md, *.editorconfig, Dockerfile and *.yml. Crucially, these include support for uncommenting.

"**/*.md": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "actionableIf": [ "<!--#if" ],
            "actionableElse": [ "#else", "<!--#else" ],
            "actionableElseif": [ "#elseif", "<!--#elseif", "#elif", "<!--#elif" ],
            "endif": [ "#endif", "<!--#endif" ],
            "trim": "true",
            "wholeLine": "true",
            "actions": [ "fixPseudoNestedComments" ]
          }
        },
        {
          "type": "balancednesting",
          "configuration": {
            "id": "fixPseudoNestedComments",
            "startToken": "<!--",
            "realEndToken": "-->",
            "pseudoEndToken": "-- >",
            "resetFlag": "_TestResetFlag_"
          }
        }
      ]
    },
    "**/.editorconfig": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "if": [ "#if" ],
            "else": [ "#else" ],
            "elseif": [ "#elseif" ],
            "endif": [ "#endif" ],
            "actionableIf": [ "##if" ],
            "actionableElse": [ "##else" ],
            "actionableElseif": [ "##elseif" ],
            "actions": [ "uncomment", "reduceComment" ],
            "trim": "true",
            "wholeLine": "true",
            "evaluator": "C++"
          }
        },
        {
          "type": "replacement",
          "configuration": {
            "original": "#",
            "replacement": "",
            "id": "uncomment"
          }
        },
        {
          "type": "replacement",
          "configuration": {
            "original": "##",
            "replacement": "#",
            "id": "reduceComment"
          }
        }
      ]
    },
    "**/Dockerfile": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "if": [ "#if" ],
            "else": [ "#else" ],
            "elseif": [ "#elseif" ],
            "endif": [ "#endif" ],
            "actionableIf": [ "##if" ],
            "actionableElse": [ "##else" ],
            "actionableElseif": [ "##elseif" ],
            "actions": [ "uncomment", "reduceComment" ],
            "trim": "true",
            "wholeLine": "true",
            "evaluator": "C++"
          }
        },
        {
          "type": "replacement",
          "configuration": {
            "original": "#",
            "replacement": "",
            "id": "uncomment"
          }
        },
        {
          "type": "replacement",
          "configuration": {
            "original": "##",
            "replacement": "#",
            "id": "reduceComment"
          }
        }
      ]
    },
    "**/*.yml": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "if": [ "#if" ],
            "else": [ "#else" ],
            "elseif": [ "#elseif" ],
            "endif": [ "#endif" ],
            "actionableIf": [ "##if" ],
            "actionableElse": [ "##else" ],
            "actionableElseif": [ "##elseif" ],
            "actions": [ "uncomment", "reduceComment" ],
            "trim": "true",
            "wholeLine": "true",
            "evaluator": "C++"
          }
        },
        {
          "type": "replacement",
          "configuration": {
            "original": "#",
            "replacement": "",
            "id": "uncomment"
          }
        },
        {
          "type": "replacement",
          "configuration": {
            "original": "##",
            "replacement": "#",
            "id": "reduceComment"
          }
        }
      ]
    }
Was this page helpful?
0 / 5 - 0 ratings