Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'matchdep' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
grunt.registerTask('build', function () {
var done = this.async();
var when = require('when');
var request = require('request');
var _ = require('lodash');
var deps = require('matchdep').filterPeer('grunt-contrib-*');
var baseurl = 'http://raw.github.com/gruntjs/'
// make http request for author file in a repo
var authorFile = function (dep) {
var deferred = when.defer();
var url = baseurl+dep+'/master/AUTHORS';
request.get({url: url}, function(err, res, body) {
if (res.statusCode != 200) {
grunt.fail.fatal('Failed to retrieve '+url);
} else {
deferred.resolve(body.split('\n'));
}
});
return deferred.promise
};
module.exports = function(grunt) {
'use strict';
var gruntfile = 'Gruntfile.js';
var sources = ['src/<%= pkg.name %>.js'];
md.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) 2013 Deux Huit Huit, Rik Lomas.\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> (<%= pkg.author.url %>);\n' +
'* License <%= pkg.license %> http://deuxhuithuit.mit-license.org */'
},
concat: {
options: {
process: true,
banner: '<%= meta.banner %>\n'
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist'
};
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.coffee'],
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist'
};
// try {
// yeomanConfig.app = require('./bower.json').appPath || yeomanConfig.app;
// } catch (e) {}
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
var pkg = grunt.file.readJSON('package.json');
var banner =
grunt.initConfig({
pkg: pkg,
banner: '/**'+
'* <%= pkg.description %>\n'+
'* @author <%= pkg.author %>\n'+
'* @version v<%= pkg.version %>\n'+
'* @link <%= pkg.repository.url %>\n' +
'* @license <%= pkg.license %>\n'+
'*/',
bump: {
options: {
files: ['package.json', 'bower.json'],
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var bastionConfig = {
src: 'app/assets/javascripts/bastion',
dist: 'dist'
};
try {
bastionConfig.src = require('./bower.json').appPath || bastionConfig.src;
} catch (e) {}
grunt.initConfig({
bastion: bastionConfig,
bower: {
update: {
options: {
options: {
lineNums: true
}
}
},
jshint: {
validate: {
src: ['src/**/*.js']
},
options: grunt.file.readJSON('.jshintrc')
},
});
// Load all grunt tasks in package.json
_.each(matchdep.filterAll('grunt-*'), function(pkgName){
grunt.loadNpmTasks(pkgName);
});
grunt.registerTask('test', ['clean:test', 'browserify', 'coffee:test', 'jasmine']);
grunt.registerTask('release', ['clean:dist', 'browserify', 'uglify']);
grunt.registerTask('default', ['jshint', 'test', 'release', 'docker']);
};
}
},
concurrent : {
options : {
logConcurrentOutput: true
},
watch : [
'watch',
'compass:watch'
]
}
});
require( 'matchdep' )
.filterAll( 'grunt-*', require( '../../package.json' ) )
.forEach( grunt.loadNpmTasks );
// grunt for distribution
grunt.registerTask( 'dist', [
'clean',
'copy',
'compass:clean',
'compass:dist'
]);
// grunt for development
grunt.registerTask( 'dev', [
'clean',
'copy',
module.exports = function(grunt) {
require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks);
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
grunt.initConfig({
webpack: {
options: webpackConfig,
build: {
plugins: webpackConfig.plugins.concat(
new webpack.DefinePlugin({
"process.env": {
// This has effect on the react lib size
"NODE_ENV": JSON.stringify("production")
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin()
)
}
},
options: {
stripBanners: true,
banner: '<%= banner %>',
// Allow for the original banner to be stripped
process: function(src, filepath) {
return filepath === 'currency.js' ? src.replace(/^\/\*!/, '/*') : src;
}
}
}
});
require('google-closure-compiler').grunt(grunt);
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('build', ['closure-compiler', 'concat', 'sync']);
grunt.registerTask('default', ['build']);
};