Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof modernizrConfig.shouldParseFiles !== 'boolean') {
modernizrConfig.shouldParseFiles = true;
}
this.setOptions(modernizrConfig, environment);
/* By default, we want all the fixtures */
if (modernizrConfig && modernizrConfig.tree) {
this.currentFixturesTree = modernizrConfig.tree;
} else {
this.currentFixturesTree = 'tests/fixtures';
}
this.builder = new broccoli.Builder(this.parseTree());
return this.builder.build();
},
module.exports = function runEslint(path, _options) {
const options = _options || {};
const buildLog = [];
// default options
// eslint-disable-next-line global-require, newline-after-var
const formatter = require(options.format || 'eslint/lib/cli-engine/formatters/compact');
options.format = function spyFormatter(results) {
buildLog.push(formatter(results));
// prevent console spew
return '';
};
options.options = options.options || {};
const node = eslintValidationFilter.create(path, options);
const builder = new broccoli.Builder(node);
const promise = builder.build().then(() => ({
buildLog: buildLog.join('\n'),
outputPath: node.outputPath,
}));
pFinally(promise, () => builder.cleanup());
return promise;
};
// cwd into the Brocfile's dir so its deps are loaded correctly.
process.chdir(path.dirname(brocfile));
return require(brocfile);
}
if (typeof dest !== 'string') {
grunt.fatal('Target must be configured with a `dest` dir path.');
}
if (grunt.file.isDir(dest)) {
grunt.warn('Directory "' + dest + '" already exists.');
}
var tree = loadBrocfile(this.data.brocfile);
var builder = new broccoli.Builder(tree);
grunt.log.writeln('Broccoli building to "' + dest + '"');
builder.build().then(function (results) {
// Deal with differences in Broccoli versions.
var dir = typeof results === 'string' ? results : results.directory;
var buildTime = results.totalTime;
ncp(dir, dest, {dereference: true}, function (err) {
if (err) { throw err; }
if (buildTime) {
grunt.log.ok('built (' + Math.floor(buildTime / 1e6) + 'ms)');
} else {
grunt.log.ok('built');
it('creates a simple clone of index.html', function () {
appTree = new EmberAddon({
'ember-index': {
output: 'index.jsp'
}
}).toTree();
builder = new broccoli.Builder(appTree);
return builder.build()
.then(function (results) {
var indexHtml, indexJsp,
outputPath = results.directory,
indexJspPath = path.join(outputPath, 'index.jsp'),
indexHtmlPath = path.join(outputPath, 'index.html');
expect(fs.existsSync(indexJspPath)).to.be.equal(true);
indexJsp = fs.readFileSync(indexJspPath).toString();
indexHtml = fs.readFileSync(indexHtmlPath).toString();
dummyVar = expect(indexJsp).not.to.be.empty;
expect(indexHtml).to.be.equal(indexJsp);
});
it('should not throw an error when failBuild option is passed for correct files', function() {
var node = new TSLint('./tests/fixtures/lintedFiles', {
logError: function(message) {
loggerOutput.push(message);
},
failBuild: true
});
builder = new broccoli.Builder(node);
return builder.build().then(function() {
assert.equal(loggerOutput.length, 0);
}, function(error) {
});
});
});
it("accepts an array of globs as exclude parameter", function() {
var sourcePath = 'tests/fixtures/exclude';
var node = new AssetRev(sourcePath + '/input', {
extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map', 'ttf'],
exclude: ['assets/fonts/**/*'],
replaceExtensions: ['html', 'js', 'css']
});
builder = new broccoli.Builder(node);
return builder.build().then(function(graph) {
confirmOutput(graph.directory, sourcePath + '/output');
});
});
function setupCachingWriter(inputNodes, options, buildCallback) {
if (!buildCallback) buildCallback = function() { };
buildCount = 0;
cachingWriter = new CachingWriter(inputNodes, options);
cachingWriter.build = function() {
buildCount++;
return buildCallback.call(this);
};
builder = new broccoli.Builder(cachingWriter);
}
var optionsThatCanBeOverridden = ['enabled', 'kinds', 'extensions', 'groupBy', 'console'];
if (typeof(app.options.markers) !== 'undefined') {
forOwnFn(app.options.markers, function(value, key) {
if (optionsThatCanBeOverridden.indexOf(key) !== -1) {
optionsForLeasot[key] = value;
} else {
console.log('\n' + chalk.bgRed(key + ' is an unknown option for broccoli-leasot'));
}
});
}
console.log('\n');
new BroccoliBuilder(
new BroccoliLeasotFilter(
appFolder,
optionsForLeasot,
'app'
)
).build();
new BroccoliBuilder(
new BroccoliLeasotFilter(
testsFolder,
optionsForLeasot,
'tests'
)
).build()
}
function getBroccoliBuilder(outputDir) {
const brocfile = broccoli.loadBrocfile();
return new broccoli.Builder(brocfile({}), {
outputDir,
});
}
configureBroccoliBuilder() {
let buildFile = this.getBuildFile(),
tree = buildFile();
this.builder = new broccoli.Builder(tree);
}