Files
JiboSDK/node_modules/jibo-gulp/lib/jibo-gulp.js

9 lines
16 KiB
JavaScript
Raw Normal View History

2026-03-22 03:21:45 +02:00
/**
* jibo-gulp - Standard extendable Gulp tasking for Jibo libraries
* @version v2.0.5
* Copyright (c) 2016, Jibo, Inc. All rights reserved.
* All use of the Jibo SDK is subject to the Jibo SDK End User License Agreement (EULA)
* distributed herewith. If you did not receive a copy of the EULA, you may view a
* copy at https://developers.jibo.com/license.
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s;s="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,s.jiboGulp=e()}}(function(){return function e(s,t,r){function i(o,u){if(!t[o]){if(!s[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(n)return n(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=t[o]={exports:{}};s[o][0].call(l.exports,function(e){var t=s[o][1][e];return i(t?t:e)},l,l.exports,e,s,t,r)}return t[o].exports}for(var n="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,s,t){"use strict";s.exports=[e("babel-preset-jibo"),e("babel-preset-react")]},{"babel-preset-jibo":void 0,"babel-preset-react":void 0}],2:[function(e,s,t){"use strict";s.exports=function(s,t,r){return t=Object.assign({dest:"lib",destDebugMaps:"maps",babel:e("./babel-presets")},t),function(){t.pipeline=t.pipeline||"babel";var e=s.src(t.src).pipe(r.cached("build-debug")).pipe(r.sourcemaps.init()).pipe(r.preprocess({context:{DEBUG:!0,RELEASE:!1}}));if("typescript"===t.pipeline){t.addsrc&&(e=e.pipe(r.addsrc.prepend(t.addsrc)));var i={target:"ES5",allowJs:!0,module:"commonjs",moduleResolution:"node"};t.dts&&(i.declaration=!0),e=e.pipe(r.typescript(i))}else e=e.pipe(r.babel({presets:t.babel})).on("error",function(e){console.error(e.toString()),this.emit("end")});var n=[e.pipe(r.sourcemaps.write(t.destDebugMaps)).pipe(s.dest(r.path.join(t.dest,t.destDebug)))];return t.dts&&n.push(e.dts.pipe(s.dest(r.path.join(t.dest,t.destDebug,t.dts)))),r.merge(n)}}},{"./babel-presets":1}],3:[function(e,s,t){"use strict";s.exports=function(s,t,r){return t=Object.assign({dest:"lib",babel:e("./babel-presets"),uglifyOptions:{},argv:{},typescript:{}},t),function(e){function i(s){var t=r.chalk.red,i=String(s.stack);i=i.substr(i.indexOf("\n")+1),console.error(t.bold(s)),console.error(t(i)),e()}var n=r.browserify({entries:t.argv.app||t.app,ignoreMissing:!0,detectGlobals:!1,insertGlobals:!1,bundleExternal:!1,standalone:t.name,debug:!1});"typescript"===t.pipeline&&n.plugin(r.tsify,{target:"ES5",allowJs:!0,module:"commonjs",moduleResolution:"node"});var o=t.releaseHeader||r.path.join(r.findRoot(__dirname),"licenses","license-code.txt");return n.transform(r.babelify.configure({presets:t.babel,sourceMaps:!1})).transform(r.preprocessify({DEBUG:!1,RELEASE:!0})).bundle().on("error",i).pipe(r.source(t.name+".js")).pipe(r.buffer()).pipe(r.derequire([{from:"module",to:"_modu_"},{from:"require",to:"_requi_"}])).pipe(r.uglify(t.uglifyOptions)).pipe(r.license(r,o)).pipe(s.dest(t.dest))}}},{"./babel-presets":1}],4:[function(e,s,t){"use strict";s.exports=function(e,s,t){return s=Object.assign({dest:"lib",destDebug:"debug"},s),function(e){var r=t.path.join(s.dest,s.name+".js"),i='module.exports = require("./'+s.destDebug+'");';t.fs.writeFile(r,i,e)}}},{}],5:[function(e,s,t){"use strict";s.exports=function(s,t){function r(){return e(s.path.join(process.cwd(),"package.json"))}return s.header(s.fs.readFileSync(t),{pkg:r(),year:(new Date).getFullYear()})}},{}],6:[function(e,s,t){"use strict";s.exports=function(e,s,t){e.task("build-debug",t.babelTask(e,s,t))}},{}],7:[function(e,s,t){"use strict";s.exports=function(e,s,t){e.task("build",t.browserifyTask(e,s,t))}},{}],8:[function(e,s,t){"use strict";s.exports=function(e,s,t){e.task("ci-coverage",function(){var r=s.dest+"/**/*.js";return e.src([r,"!"+s.tests]).pipe(t.istanbul({includeUntested:!0})).pipe(t.istanbul.hookRequire()).on("finish",function(){e.start("ci-report")}).on("error",function(e){console.error("\n\nTests Failed.\n\n"),console.error(e),process.exit(1)})})}},{}],9:[function(e,s,t){"use strict";s.exports=function(e,s,t){e.task("ci-report",function(){return e.src(s.tests,{read:!1}).pipe(t.mocha({reporter:"mocha-junit-reporter",reporterOptions:{mochaFile:"./tmp/test-results.xml"}})).on("error",function(){e.start("unit-tests")}).pipe(t.istanbul.writeReports({dir:"./tmp/coverage