<commit_before>var fs = Npm.require('fs');
var stylus = Npm.require('stylus');
var nib = Npm.require('nib');
var jeet = Npm.require('jeet');
var path = Npm.require('path');
var Future = Npm.require('fibers/future');

Plugin.registerSourceHandler("styl", {archMatching: 'web'}, function (compileStep) {
  var source = compileStep.read().toString('utf8');
  var compiler = stylus(source)
    .use(nib())
    .use(jeet())
    .set('filename', compileStep.inputPath)
    .set('sourcemap', {comment: false})
    // Include needed to allow relative @imports in stylus files
    .include(path.dirname(compileStep._fullInputPath));

  compiler.render(function (err, css) {
    if (err) {
      compileStep.error({
        message: "Stylus compiler error: " + e.message
      });
    } else {
      var sourceMap = compiler.sourcemap;
      sourceMap.sourcesContent = [source];
      compileStep.addStylesheet({
        path: compileStep.inputPath + ".css",
        data: css,
        sourceMap: JSON.stringify(sourceMap)
      });
    }
  });
});

// Register import.styl files with the dependency watcher, without actually
// processing them. There is a similar rule in the less package.<commit_msg>Add a note about https://github.com/LearnBoost/stylus/issues/1677<commit_after>var fs = Npm.require('fs');
var stylus = Npm.require('stylus');
var nib = Npm.require('nib');
var jeet = Npm.require('jeet');
var path = Npm.require('path');
var Future = Npm.require('fibers/future');

Plugin.registerSourceHandler("styl", {archMatching: 'web'}, function (compileStep) {
  var source = compileStep.read().toString('utf8');
  var compiler = stylus(source)
    .use(nib())
    .use(jeet())
    .set('filename', compileStep.inputPath)
    .set('sourcemap', {comment: false})
    // Include needed to allow relative @imports in stylus files
    .include(path.dirname(compileStep._fullInputPath));

  compiler.render(function (err, css) {
    if (err) {
      compileStep.error({
        message: "Stylus compiler error: " + e.message
      });
    } else {
      // XXX We have to manually modify the source map object since stylus
      // compiler doesn't support the `sourcesContent` field yet
      // see https://github.com/LearnBoost/stylus/issues/1677
      var sourceMap = compiler.sourcemap;
      sourceMap.sourcesContent = [source];
      compileStep.addStylesheet({
        path: compileStep.inputPath + ".css",
        data: css,
        sourceMap: JSON.stringify(sourceMap)
      });
    }
  });
});

// Register import.styl files with the dependency watcher, without actually
// processing them. There is a similar rule in the less package.
{'fraction_non_alphanumeric': 0.14215314632297193, 'fraction_numerical': 0.0037907505686125853, 'mean_word_length': 3.3910149750415974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5415259', 'n_tokens_mistral': 819, 'n_tokens_neox': 796, 'n_words': 206}