How to use the handlebars/runtime.templates function in handlebars

To help you get started, we’ve selected a few handlebars examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sverweij / dependency-cruiser / src / cli / initConfig / config.js.template.js View on Github external
var Handlebars = require("handlebars/runtime");  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['config.js.template.hbs'] = template({"1":function(container,depth0,helpers,partials,data) {
    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression;

  return "    'extends': '"
    + alias4(((helper = (helper = helpers.preset || (depth0 != null ? depth0.preset : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"preset","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":26}}}) : helper)))
    + "',\n    /*\n       the '"
    + alias4(((helper = (helper = helpers.preset || (depth0 != null ? depth0.preset : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"preset","hash":{},"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":22}}}) : helper)))
    + "' preset\n       contains these rules:\n       no-circular            - flags all circular dependencies\n       no-orphans             - flags orphan modules (except typescript .d.ts files)\n       no-deprecated-core     - flags dependencies on deprecated node 'core' modules\n       no-deprecated-npm      - flags dependencies on deprecated npm modules\n       no-non-package-json    - flags (npm) dependencies that don't occur in package.json\n       not-to-unresolvable    - flags dependencies that can't be resolved\n       no-duplicate-dep-types - flags dependencies that occur more than once in package.json\n\n       If you need to, you can override these rules. E.g. to ignore the\n       no-duplicate-dep-types rule, you can set its severity to \"ignore\" by\n       adding this to the 'forbidden' section:\n       {\n            name: 'no-duplicate-dep-types',\n            severity: 'ignore'\n       }\n\n       Also, by default, the preset does not follow any external modules (things in\n       node_modules or in yarn's plug'n'play magic). If you want to have that\n       differently, just override it the options.doNotFollow key.\n     */\n    forbidden: [\n";
},"3":function(container,depth0,helpers,partials,data) {
    return "    forbidden: [\n        /* rules from the 'recommended' preset: */\n        {\n            name: 'no-circular',\n            severity: 'warn',\n            comment:\n                'This dependency is part of a circular relationship. You might want to revise ' +\n                'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',\n            from: {},\n            to: {\n                circular: true\n            }\n        },\n        {\n            name: 'no-orphans',\n            severity: 'info',\n            comment:\n                \"This is an orphan module - it's likely not used (anymore?). Either use it or remove it. If it's \" +\n                \"logical this module is an orphan (i.e. it's a config file), add an exception for it in your \" +\n                \"dependency-cruiser configuration.\",\n            from: {\n                orphan: true,\n                pathNot: '\\\\.d\\\\.ts$'\n            },\n            to: {}\n        },\n        {\n            name: 'no-deprecated-core',\n            comment:\n                'A module depends on a node core module that has been deprecated. Find an alternative - these are ' +\n                \"bound to exist - node doesn't deprecate lightly.\",\n            severity: 'warn',\n            from: {},\n            to: {\n                dependencyTypes: [\n                  'core'\n                ],\n                path: '^(punycode|domain|constants|sys|_linklist|_stream_wrap)$'\n            }\n        },\n        {\n            name: 'not-to-deprecated',\n            comment:\n                'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' +\n                'version of that module, or find an alternative. Deprecated modules are a security risk.',\n            severity: 'warn',\n            from: {},\n            to: {\n                dependencyTypes: [\n                  'deprecated'\n                ]\n            }\n        },\n        {\n            name: 'no-non-package-json',\n            severity: 'error',\n            comment:\n                \"This module depends on an npm package that isn't in the 'dependencies' section of your package.json. \" +\n                \"That's problematic as the package either (1) won't be available on live (2 - worse) will be \" +\n                \"available on live with an non-guaranteed version. Fix it by adding the package to the dependencies \" +\n                \"in your package.json.\",\n            from: {},\n            to: {\n                dependencyTypes: [\n                  'npm-no-pkg',\n                  'npm-unknown'\n                ]\n            }\n        },\n        {\n            name: 'not-to-unresolvable',\n            comment:\n                \"This module depends on a module that cannot be found ('resolved to disk'). If it's an npm \" +\n                'module: add it to your package.json. In all other cases you likely already know what to do.',\n            severity: 'error',\n            from: {},\n            to: {\n                couldNotResolve: true\n            }\n        },\n        {\n            name: 'no-duplicate-dep-types',\n            comment:\n                \"Likley this module depends on an external ('npm') package that occurs more than once \" +\n                \"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause \" +\n                \"maintenance problems later on.\",\n            severity: 'warn',\n            from: {},\n            to: {\n                moreThanOneDependencyType: true\n            }\n        },\n\n        /* rules you might want to tweak for your specific situation: */\n";
},"5":function(container,depth0,helpers,partials,data) {
    return "        , tsPreCompilationDeps: true\n";
},"7":function(container,depth0,helpers,partials,data) {
    return "        // , tsPreCompilationDeps: false\n";
},"9":function(container,depth0,helpers,partials,data) {
    var helper;
github sverweij / dependency-cruiser / src / cli / initConfig / config.json.template.js View on Github external
var Handlebars = require("handlebars/runtime");  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['config.json.template.hbs'] = template({"1":function(container,depth0,helpers,partials,data) {
    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression;

  return "    \"extends\": \""
    + alias4(((helper = (helper = helpers.preset || (depth0 != null ? depth0.preset : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"preset","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":26}}}) : helper)))
    + "\",\n    /*\n       the '"
    + alias4(((helper = (helper = helpers.preset || (depth0 != null ? depth0.preset : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"preset","hash":{},"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":22}}}) : helper)))
    + "' preset\n       contains these rules:\n       no-circular            - flags all circular dependencies\n       no-orphans             - flags orphan modules (except typescript .d.ts files)\n       no-deprecated-core     - flags dependencies on deprecated node 'core' modules\n       no-deprecated-npm      - flags dependencies on deprecated npm modules\n       no-non-package-json    - flags (npm) dependencies that don't occur in package.json\n       not-to-unresolvable    - flags dependencies that can't be resolved\n       no-duplicate-dep-types - flags dependencies that occur more than once in package.json\n\n       If you need to, you can override these rules. E.g. to ignore the\n       no-duplicate-dep-types rule, you can set its severity to \"ignore\" by\n       adding this to the 'forbidden' section:\n       {\n            name: 'no-duplicate-dep-types',\n            severity: 'ignore'\n       }\n\n       Also, by default, the preset does not follow any external modules (things in\n       node_modules or in yarn's plug'n'play magic). If you want to have that\n       differently, just override it the options.doNotFollow key.\n     */\n    \"forbidden\": [\n";
},"3":function(container,depth0,helpers,partials,data) {
    return "    \"forbidden\": [\n        /* rules from the 'recommended' preset: */\n        {\n            \"name\": \"no-circular\",\n            \"severity\": \"warn\",\n            \"comment\": \"This dependency is part of a circular relationship. You might want to revise your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) \",\n            \"from\": {},\n            \"to\": {\n                \"circular\": true\n            }\n        },\n        {\n            \"name\": \"no-orphans\",\n            \"severity\": \"info\",\n            \"comment\": \"This is an orphan module - it's likely not used (anymore?). Either use it or remove it. If it's logical this module is an orphan (i.e. it's a config file), add an exception for it in your dependency-cruiser configuration.\",\n            \"from\": {\n                \"orphan\": true,\n                \"pathNot\": \"\\\\.d\\\\.ts$\"\n            },\n            \"to\": {}\n        },\n        {\n            \"name\": \"no-deprecated-core\",\n            \"comment\": \"A module depends on a node core module that has been deprecated. Find an alternative - these are bound to exist - node doesn't deprecate lightly.\",\n            \"severity\": \"warn\",\n            \"from\": {},\n            \"to\": {\n                \"dependencyTypes\": [\n                    \"core\"\n                ],\n                \"path\": \"^(punycode|domain|constants|sys|_linklist|_stream_wrap)$\"\n            }\n        },\n        {\n            \"name\": \"no-deprecated-npm\",\n            \"comment\": \"This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later version of that module, or find an alternative. Deprecated modules are a security risk.\",\n            \"severity\": \"warn\",\n            \"from\": {},\n            \"to\": {\n                \"dependencyTypes\": [\n                    \"deprecated\"\n                ]\n            }\n        },\n        {\n            \"name\": \"no-non-package-json\",\n            \"severity\": \"error\",\n            \"comment\": \"This module depends on an npm package that isn't in the 'dependencies' section of your package.json. That's problematic as the package either (1) won't be available on live (2 - worse) will be available on live with an non-guaranteed version. Fix it by adding the package to the dependencies in your package.json.\",\n            \"from\": {},\n            \"to\": {\n                \"dependencyTypes\": [\n                    \"npm-no-pkg\",\n                    \"npm-unknown\"\n                ]\n            }\n        },\n        {\n            \"name\": \"not-to-unresolvable\",\n            \"comment\": \"This module depends on a module that cannot be found ('resolved to disk'). If it's an npm module: add it to your package.json. In all other cases you likely already know what to do.\",\n            \"severity\": \"error\",\n            \"from\": {},\n            \"to\": {\n                \"couldNotResolve\": true\n            }\n        },\n        {\n            \"name\": \"no-duplicate-dep-types\",\n            \"comment\": \"Likley this module depends on an external ('npm') package that occurs more than once in your package.json i.e. bot as a devDependencies and in dependencies. This will cause maintenance problems later on.\",\n            \"severity\": \"warn\",\n            \"from\": {},\n            \"to\": {\n                \"moreThanOneDependencyType\": true\n            }\n        },\n\n        /* rules you might want to tweak for your specific situation: */\n";
},"5":function(container,depth0,helpers,partials,data) {
    return "        , \"tsPreCompilationDeps\": true\n";
},"7":function(container,depth0,helpers,partials,data) {
    return "        // , \"tsPreCompilationDeps\": false\n";
},"9":function(container,depth0,helpers,partials,data) {
    var helper;
github sverweij / dependency-cruiser / src / report / csv / csv.template.js View on Github external
var Handlebars = require("handlebars/runtime");  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['csv.template.hbs'] = template({"1":function(container,depth0,helpers,partials,data) {
    var stack1, helper;

  return "\""
    + ((stack1 = ((helper = (helper = helpers.source || (depth0 != null ? depth0.source : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"source","hash":{},"data":data,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}}) : helper))) != null ? stack1 : "")
    + "\",";
},"3":function(container,depth0,helpers,partials,data) {
    var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", buffer = 
  "\""
    + ((stack1 = ((helper = (helper = helpers.source || (depth0 != null ? depth0.source : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"source","hash":{},"data":data,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":25}}}) : helper))) != null ? stack1 : "")
    + "\",";
  stack1 = ((helper = (helper = helpers.incidences || (depth0 != null ? depth0.incidences : depth0)) != null ? helper : alias2),(options={"name":"incidences","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":75}}}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
  if (!helpers.incidences) { stack1 = container.hooks.blockHelperMissing.call(depth0,stack1,options)}
  if (stack1 != null) { buffer += stack1; }
  return buffer + "\"\"\n";
},"4":function(container,depth0,helpers,partials,data) {
github sverweij / dependency-cruiser / src / cli / initConfig / createConfigFile.js View on Github external
function buildConfig(pInitOptions) {
  return Handlebars.templates["config.js.template.hbs"](pInitOptions);
}
github sverweij / dependency-cruiser / src / report / html / html.template.js View on Github external
var Handlebars = require("handlebars/runtime");  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['html.template.hbs'] = template({"1":function(container,depth0,helpers,partials,data) {
    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});

  return ""
    + container.escapeExpression(((helper = (helper = helpers.source || (depth0 != null ? depth0.source : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"source","hash":{},"data":data}) : helper)))
    + "";
},"2":function(container,depth0,helpers,partials,data) {
    return " class=\"cell-core-module\"";
},"4":function(container,depth0,helpers,partials,data) {
    var stack1;

  return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.couldNotResolve : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
},"5":function(container,depth0,helpers,partials,data) {
    return " class=\"cell-unresolvable-module\"";
github sverweij / dependency-cruiser / src / report / err-html / err-html.template.js View on Github external
var Handlebars = require("handlebars/runtime");  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['err-html.template.hbs'] = template({"1":function(container,depth0,helpers,partials,data) {
    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression;

  return "                \n                    "
    + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.unviolated : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data,"loc":{"start":{"line":150,"column":24},"end":{"line":150,"column":129}}})) != null ? stack1 : "")
    + "\n                    "
    + alias4(((helper = (helper = helpers.severity || (depth0 != null ? depth0.severity : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"severity","hash":{},"data":data,"loc":{"start":{"line":151,"column":86},"end":{"line":151,"column":98}}}) : helper)))
    + "\n                    <a class="\&quot;noiseless\&quot;" id="\&quot;&quot;">"
    + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":152,"column":74},"end":{"line":152,"column":82}}}) : helper)))
    + "</a>\n                    <strong>"</strong>
github sverweij / dependency-cruiser / src / report / err-html / index.js View on Github external
function report(pResults) {
  return Handlebars.templates["err-html.template.hbs"]({
    summary: {
      ...formatSummaryForReport(pResults.summary),
      agggregateViolations: aggregateViolations(
        pResults.summary.violations,
        pResults.summary.ruleSetUsed
      )
    }
  });
}
github sverweij / dependency-cruiser / src / report / html / html.template.js View on Github external
var Handlebars = require("handlebars/runtime");  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['html.template.hbs'] = template({"1":function(container,depth0,helpers,partials,data) {
    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});

  return ""
    + container.escapeExpression(((helper = (helper = helpers.source || (depth0 != null ? depth0.source : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"source","hash":{},"data":data,"loc":{"start":{"line":135,"column":162},"end":{"line":135,"column":172}}}) : helper)))
    + "";
},"2":function(container,depth0,helpers,partials,data) {
    return " class=\"cell-core-module\"";
},"4":function(container,depth0,helpers,partials,data) {
    var stack1;

  return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.couldNotResolve : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":135,"column":91},"end":{"line":135,"column":154}}})) != null ? stack1 : "");
},"5":function(container,depth0,helpers,partials,data) {
    return " class=\"cell-unresolvable-module\"";