MCPcopy
hub / github.com/plasma-umass/browsix / tsTask

Function tsTask

gulpfile.js:74–119  ·  view source on GitHub ↗
(subdir, options)

Source from the content-addressed store, hash-verified

72// - build w/ tsc
73// - dist w/ browserify
74function tsTask(subdir, options) {
75 options = options || {};
76 var noBuffer = options.noBuffer;
77 var noGlobal = options.noGlobal;
78 var buildDeps = options.buildDeps || [];
79 var otherSources = options.otherSources || [];
80 var sources = ['src/'+subdir+'/*.ts', 'src/'+subdir+'/**/*.ts'].concat(otherSources);
81
82 gulp.task('lint-'+subdir, function() {
83 return gulp.src(['src/'+subdir+'/*.ts', 'src/'+subdir+'/*/*.ts'])
84 .pipe(lint({
85 formatter: "verbose"
86 }))
87 .pipe(lint.report());
88 });
89
90 // run lint by default, but if lint is specified as 'false' skip it
91 if (!options.hasOwnProperty('lint') || options.lint)
92 buildDeps = buildDeps.concat(['lint-'+subdir]);
93
94 gulp.task('build-'+subdir, buildDeps, tsPipeline(sources, 'lib/'+subdir));
95
96 var globals = extend({}, globalVars);
97 if (noGlobal)
98 globals['global'] = function() { return ""; };
99 if (noBuffer) {
100 globals['buffer'] = function() { return ""; };
101 globals['Buffer'] = function() { return ""; };
102 }
103
104 gulp.task('dist-'+subdir, ['build-'+subdir], function() {
105 var b = browserify({
106 entries: ['./lib/'+subdir+'/'+subdir+'.js'],
107 builtins: builtins,
108 insertGlobalVars: globals,
109 });
110 b.exclude('webworker-threads');
111
112 return b.bundle()
113 .pipe(source('./lib/'+subdir+'/'+subdir+'.js'))
114 .pipe(buffer())
115 // .pipe(uglify())
116 .on('error', gutil.log)
117 .pipe(gulp.dest('./lib-dist/'));
118 });
119}
120
121gulp.task('copy-node-kernel', function() {
122 return gulp.src([

Callers 1

gulpfile.jsFile · 0.85

Calls 4

tsPipelineFunction · 0.85
pipeMethod · 0.80
onMethod · 0.65
lintFunction · 0.50

Tested by

no test coverage detected