<commit_before>import { parseHtml , handleTags } from 'meteor/mwc:synthesis-compiler';
const jade = Npm.require('jade');
Plugin.registerCompiler({
  extensions: ['jade'],
  archMatching: 'web',
  isTemplate: true
}, ()=>{
  return new PolymerCachingHtmlCompiler("synthesis-jade", parseHtml, handleTags);
});

const throwCompileError = TemplatingTools.throwCompileError;

class PolymerCachingHtmlCompiler extends CachingHtmlCompiler {

  getCacheKey(inputFile) {
    return [
      inputFile.getPackageName(),
      inputFile.getPathInPackage(),
      inputFile.getSourceHash()
    ];
  }

  compileOneFile(inputFile) {
    const contents = inputFile.getContentsAsString();
    let packagePrefix = '';

    if (inputFile.getPackageName()) {
      packagePrefix += '/packages/' + inputFile.getPackageName() + '/';
    }

    const inputPath = packagePrefix + inputFile.getPathInPackage();
    //files inside folders with names demo/test/docs are skipped.
    if(inputPath.match(/\/(demo|test|docs).*\//) && !process.env.FORCESYNTHESIS){
      return null;
    }
    try {
      const fn = jade.compile(contents);
      const parsedJade = fn();
      const tags = this.tagScannerFunc({
        sourceName: inputPath,
        contents: parsedJade
      });<commit_msg>extends & includes support for jade<commit_after>import { parseHtml , handleTags } from 'meteor/mwc:synthesis-compiler';
const jade = Npm.require('jade');
Plugin.registerCompiler({
  extensions: ['jade'],
  archMatching: 'web',
  isTemplate: true
}, ()=>{
  return new PolymerCachingHtmlCompiler("synthesis-jade", parseHtml, handleTags);
});

const throwCompileError = TemplatingTools.throwCompileError;

class PolymerCachingHtmlCompiler extends CachingHtmlCompiler {

  getCacheKey(inputFile) {
    return [
      inputFile.getPackageName(),
      inputFile.getPathInPackage(),
      inputFile.getSourceHash()
    ];
  }

  compileOneFile(inputFile) {
    const contents = inputFile.getContentsAsString();
    let packagePrefix = '';

    if (inputFile.getPackageName()) {
      packagePrefix += '/packages/' + inputFile.getPackageName() + '/';
    }

    const inputPath = packagePrefix + inputFile.getPathInPackage();
    //files inside folders with names demo/test/docs are skipped.
    if(inputPath.match(/\/(demo|test|docs).*\//) && !process.env.FORCESYNTHESIS){
      return null;
    }
    try {
      const fn = jade.compile(contents, {filename: inputFile.getPathInPackage()});
      const parsedJade = fn();
      const tags = this.tagScannerFunc({
        sourceName: inputPath,
        contents: parsedJade
      });
{'fraction_non_alphanumeric': 0.12885802469135801, 'fraction_numerical': 0.0, 'mean_word_length': 3.705989110707804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5097198', 'n_tokens_mistral': 792, 'n_tokens_neox': 761, 'n_words': 152}