How to use the folio.Glossary function in folio

To help you get started, we’ve selected a few folio 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 noveogroup / backbone.iobind / example / routes / index.js View on Github external
require.resolve('backbone/backbone.js'),
  path.join(__dirname, '..', '..', 'dist', 'backbone.iosync.js'),
  path.join(__dirname, '..', '..', 'dist', 'backbone.iobind.js')
]);

// serve using express
exports.vendorjs = folio.serve(vendorJs);

/**
 * Template Javascript Package
 *
 * We are going to use pre-compiled
 * jade on the client-side.
 */

var templateJs = new folio.Glossary([
  require.resolve('jade/runtime.js'),
  path.join(__dirname, '..', 'views/templates/js/header.js'),
  path.join(__dirname, '..', 'views/templates/form.jade'),
  path.join(__dirname, '..', 'views/templates/item.jade')
], {
  compilers: {
    jade: function (name, source) {
      return 'template[\'' + name + '\'] = ' +
        jade.compileClient(source, {
          client: true,
          compileDebug: false
        }) + ';';
    }
  }
});
github noveogroup / backbone.iobind / example / routes / index.js View on Github external
exports.index = function(req, res){
  res.render('index', { title: 'Done.', layout: false });
};


/**
 * Vendor Javascript Package
 *
 * jquery
 * underscore
 * backbone
 * backbone.iosync
 * backbone.iobind
 */

var vendorJs = new folio.Glossary([
  //path.join(__dirname, '..', 'public', 'js', 'jquery.min.js'),
  require.resolve('jquery/dist/jquery.js'),
  require.resolve('underscore/underscore.js'),
  require.resolve('backbone/backbone.js'),
  path.join(__dirname, '..', '..', 'dist', 'backbone.iosync.js'),
  path.join(__dirname, '..', '..', 'dist', 'backbone.iobind.js')
]);

// serve using express
exports.vendorjs = folio.serve(vendorJs);

/**
 * Template Javascript Package
 *
 * We are going to use pre-compiled
 * jade on the client-side.
github chaijs / chai-null / support / compile.js View on Github external
});
};

// Go!
iteratePath(basepath);

/**
 * Package together all found files into a
 * folio.Glossary, defining a custom "compiler"
 * that will wrap our script with the needed commonjs
 *
 * @param {Array} files
 * @param {Object} folio glossary configuration
 */

var applicationJs = new folio.Glossary(appfiles, {
  compilers: {
    js: function (name, source, filename) {
      var title = filename.replace(basepath + '/', '').replace('.js', '')
        , buf = '\nrequire.register("' + title + '", function (module, exports, require) {\n';
      buf += source;
      buf += '\n}); // module ' + name;
      return buf;
    }
  }
});

/*!
 * Load up our prefix/suffix
 */

var prefix = fs.readFileSync(join(__dirname, 'browser', 'prefix.js'), 'utf8')
github qualiancy / drip / support / compile.js View on Github external
var drip = new folio.Glossary([
    path.join(__dirname, '..', 'lib', 'drip.js')
  ], {
    prefix: fs.readFileSync(path.join(__dirname, 'browser', 'prefix.js'), 'utf8'),
    suffix: fs.readFileSync(path.join(__dirname, 'browser', 'suffix.js'), 'utf8')
  });

drip.compile(function (err, source) {
  var copyright = fs.readFileSync(path.join(__dirname, 'browser', 'copyright.js'));
  fs.writeFileSync(path.join(__dirname, '..', 'drip.js'), copyright + '\n' + source);
  console.log('Build successful: ' + '\tdrip.js');
});

var drip_min = new folio.Glossary([
    path.join(__dirname, '..', 'lib', 'drip.js')
  ], {
    minify: true,
    prefix: fs.readFileSync(path.join(__dirname, 'browser', 'prefix.js'), 'utf8'),
    suffix: fs.readFileSync(path.join(__dirname, 'browser', 'suffix.js'), 'utf8')
  });

drip_min.compile(function (err, source) {
  var copyright = fs.readFileSync(path.join(__dirname, 'browser', 'copyright.js'));
  fs.writeFileSync(path.join(__dirname, '..', 'drip.min.js'), copyright + '\n' + source);
  console.log('Build successful: ' + '\tdrip.min.js');
});
github qualiancy / drip / support / compile.js View on Github external
var folio = require('folio')
  , path = require('path')
  , fs = require('fs');


var drip = new folio.Glossary([
    path.join(__dirname, '..', 'lib', 'drip.js')
  ], {
    prefix: fs.readFileSync(path.join(__dirname, 'browser', 'prefix.js'), 'utf8'),
    suffix: fs.readFileSync(path.join(__dirname, 'browser', 'suffix.js'), 'utf8')
  });

drip.compile(function (err, source) {
  var copyright = fs.readFileSync(path.join(__dirname, 'browser', 'copyright.js'));
  fs.writeFileSync(path.join(__dirname, '..', 'drip.js'), copyright + '\n' + source);
  console.log('Build successful: ' + '\tdrip.js');
});

var drip_min = new folio.Glossary([
    path.join(__dirname, '..', 'lib', 'drip.js')
  ], {
    minify: true,

folio

A customizable test framework to build your own test frameworks. Foundation for the [Playwright test runner](https://github.com/microsoft/playwright-test).

Apache-2.0
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis