Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test.cb('bundle an empty file', t => {
vfs
.src('test/fixtures/empty.js')
.pipe(bro())
.pipe(assert.length(1))
.pipe(
assert.first(d =>
t.true(d.contents.toString().length > 0 /* browserify runtime */)
)
)
.pipe(assert.end(t.end))
})
function zip_crx_files (mode, async_cb) {
console.log("zipping ", mode);
var src = "./releases/chrome-app/" + mode + "/**",
zip_file_name = mode + ".zip";
vfs.src( src )
// zip the folder
.pipe( zip(zip_file_name) )
.pipe( vfs.dest( "./releases/chrome-app/" ) )
.on( "end", async_cb );
}
// there should not be any opportunity for glitches as only
// one vinylFS stream is active at a time. Wrapping the
// vinylFS stream in a playbackStream would be safer, but
// would buffer all the resources into memory at once with
// no backpressure. We like our users and don't want to eat
// all their RAM, so we just have to be careful not to
// introduce a regression when modifying this code.
vinylFS.src('./resources/**', { base: '.' }),
buildDeviceResources(
projectConfig,
buildTargets[family],
onDiagnostic,
),
),
new pumpify.obj(
vinylFS.src(componentTargets.device.translationsGlob, {
base: '.',
}),
compileTranslations(projectConfig.defaultLanguage),
),
),
makeDeviceManifest({ projectConfig, buildId }),
zip(bundleFilename),
transformIf(
maxDeviceBundleSize !== undefined,
validateFileSizes({
onDiagnostic,
maxSizes: { [bundleFilename]: maxDeviceBundleSize },
}),
),
gulpSetProperty({
componentBundle: {
env.logger.debug(() => {
fs.writeFile(
'sassdoc-data.json',
JSON.stringify(data, null, 2) + '\n',
err => {
if (err) throw err
}
)
return 'Dumping data to `sassdoc-data.json`.'
})
})
let streams = [
vfs.src(env.src),
recurse(),
exclude(env.exclude || []),
converter({ from: 'sass', to: 'scss' }),
filter
]
let pipeline = () => {
return new Promise((resolve, reject) => {
pipe(...streams, err =>
err ? reject(err) : resolve())
.resume() // Drain.
})
}
try {
await pipeline()
function conventionalChangelog(done) {
clog({
preset: 'angular',
// repository: 'https://github.com/router5/router5',
// append: false
})
.pipe(source('CHANGELOG.md'))
.pipe(fs.dest(path.join(__dirname, '..')));
}
Assemble.prototype.watch = function(glob, options, fn) {
if (typeof options === 'function' || Array.isArray(options)) {
fn = options;
options = null;
}
// Tasks to watch
if (Array.isArray(fn)) {
return fs.watch(glob, options, function() {
this.start.apply(this, fn);
}.bind(this));
}
return fs.watch(glob, options, fn);
};
Gulp.prototype.watch = function (glob, opt, fn) {
if (typeof opt === 'function' || Array.isArray(opt)) {
fn = opt;
opt = null;
}
// array of tasks given
if (Array.isArray(fn)) {
return vfs.watch(glob, opt, function () {
this.start.apply(this, fn);
}.bind(this));
}
return vfs.watch(glob, opt, fn);
};
Assemble.prototype.watch = function(glob, options, fn) {
if (typeof options === 'function' || Array.isArray(options)) {
fn = options;
options = null;
}
// Tasks to watch
if (Array.isArray(fn)) {
return fs.watch(glob, options, function() {
this.start.apply(this, fn);
}.bind(this));
}
return fs.watch(glob, options, fn);
};
Assemble.prototype.watch = function(glob, options, fn) {
if (typeof options === 'function' || Array.isArray(options)) {
fn = options;
options = null;
}
// Tasks to watch
if (Array.isArray(fn)) {
return fs.watch(glob, options, function() {
this.start.apply(this, fn);
}.bind(this));
}
return fs.watch(glob, options, fn);
};
it("works with urlFormat", function(done) {
var expected = ["shane/kittie/post1.html", "shane/kittie/post2.html"];
var out = [];
fs.src([
"test/fixtures/_posts/**"
])
.pipe(crossbow.stream({
config: {
base: "test/fixtures",
urlFormat: {
"type:post": "/shane/kittie/:filename"
}
}
}))
.pipe(through.obj(function (file, enc, cb) {
out.push(file.relative);
cb();
}, function (cb) {
this.emit("end");
cb();