<commit_before>Package.describe({
  summary: 'Expressive, dynamic, robust CSS.'
});

var stylus = require('stylus');
var fs = require('fs');

Package.register_extension(
  'styl', function(bundle, source_path, serve_path, where) {
    serve_path = serve_path + '.css';

    var contents = fs.readFileSync(source_path);

    stylus(contents.toString('utf8'))
    .set('filename', source_path)
    .render(function(err, css) {
      if (err) {
        bundle.error('Stylus compiler error: ' + err.message);
        return;
      }
      bundle.add_resource({
        type: 'css',
        path: serve_path,
        data: new Buffer(css),
        where: where
      });
    });
  }
);

Package.on_test(function (api) {
  api.add_files(['stylus_tests.styl', 'stylus_tests.js'], 'client');
});<commit_msg>Adding support for Nib to the Stylus package<commit_after>Package.describe({
  summary: 'Expressive, dynamic, robust CSS.'
});

var stylus = require('stylus');
var nib = require('nib');
var fs = require('fs');

Package.register_extension(
  'styl', function(bundle, source_path, serve_path, where) {
    serve_path = serve_path + '.css';

    var contents = fs.readFileSync(source_path);

    stylus(contents.toString('utf8'))
    .use(nib())
    .set('filename', source_path)
    .render(function(err, css) {
      if (err) {
        bundle.error('Stylus compiler error: ' + err.message);
        return;
      }
      bundle.add_resource({
        type: 'css',
        path: serve_path,
        data: new Buffer(css),
        where: where
      });
    });
  }
);

Package.on_test(function (api) {
  api.add_files(['stylus_tests.styl', 'stylus_tests.js'], 'client');
});
{'fraction_non_alphanumeric': 0.16098144823459007, 'fraction_numerical': 0.0011968880909634949, 'mean_word_length': 3.1592039800995027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3972312', 'n_tokens_mistral': 566, 'n_tokens_neox': 555, 'n_words': 113}