Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twilio-chat

Package Overview
Dependencies
Maintainers
2
Versions
367
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twilio-chat - npm Package Compare versions

Comparing version 0.12.0-rc9-build.308 to 0.13.0-dev-build.329

browser/channel.js

175

gulpfile.js
'use strict';
const babelify = require('babelify');
const babel = require('babel-core/register');
const babel = require('gulp-babel');
const browserify = require('browserify');

@@ -11,3 +11,2 @@ const buffer = require('vinyl-buffer');

const derequire = require('gulp-derequire');
const eslint = require('gulp-eslint');
const exit = require('gulp-exit');

@@ -27,2 +26,4 @@ const gulp = require('gulp');

const path = require('path');
const typescript = require('gulp-typescript');
const tslint = require("gulp-tslint");

@@ -32,26 +33,32 @@ const pkg = require('./package');

var tests = {
const tests = {
lint: {
files: [
'src/**/*.js',
'gulpfile.js',
'!test/unit/**/*.js'
'src/**/*.ts',
'!test/unit/**/*.ts'
]
},
integration: {
files: 'test/integration/**/*.js',
index: 'test/integration/index.js'
files: 'test/integration/**/*.ts',
index: 'test/integration/index.ts'
},
unit: {
files: 'test/unit/**/*.js',
index: 'test/unit/index.js'
files: 'test/unit/**/*.ts',
index: 'test/unit/index.ts'
}
};
var product = {
const product = {
source: {
dir: 'src',
name: pkg.name + '.js',
lib: 'src/**/*.js'
name: pkg.name + '.ts',
lib: 'src/**/*.ts'
},
compiled: {
dir: 'lib',
lib: 'lib/**/*.js'
},
browser: {
dir: 'browser'
},
packaged: {

@@ -62,6 +69,2 @@ dir: 'dist',

},
bundled: {
dir: 'build',
name: pkg.name + '-bundle.js'
},
license: 'LICENSE'

@@ -79,10 +82,10 @@ };

files: [
'./src/client.js',
'./src/channel.js',
'./src/member.js',
'./src/message.js',
'./src/userinfo.js',
'./src/paginator.js',
'./src/sessionerror.js',
'./src/channeldescriptor.js'
'./lib/client.js',
'./lib/channel.js',
'./lib/member.js',
'./lib/message.js',
'./lib/userinfo.js',
'./lib/paginator.js',
'./lib/sessionerror.js',
'./lib/channeldescriptor.js'
],

@@ -94,46 +97,14 @@ publicConstructors: ['Client'],

gulp.task('default', function(done) {
runSequence(
'clean',
'lint',
'unit-test',
'build',
'package',
'doc',
done
);
});
gulp.task('doc', function(done) {
runSequence('generate-jsdoc', 'prettify-jsdoc', done);
});
gulp.task('build', function(done) {
runSequence('bundle', 'license', done);
});
gulp.task('package', function(done) {
runSequence('minify', done);
});
gulp.task('clean', function() {
return del([
product.packaged.dir + '/' + product.packaged.name,
product.packaged.dir + '/' + product.packaged.minified,
docs.dir,
coverage.unit.dir,
coverage.integration.dir,
product.bundled.dir + '/' + product.bundled.name
]);
});
gulp.task('lint', function() {
return gulp.src(tests.lint.files)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
.pipe(tslint({
formatter: "prose"
}))
.pipe(tslint.report({
summarizeFailureOutput: true
}))
});
gulp.task('istanbul-setup', function() {
return gulp.src([product.source.lib])
gulp.task('istanbul-setup', ['build-node'], function() {
return gulp.src([product.source.lib]) // we can use compiled here, but is it a good idea?
.pipe(istanbul({

@@ -146,6 +117,6 @@ instrumenter: isparta.Instrumenter,

gulp.task('integration-test', ['istanbul-setup'], function() {
gulp.task('integration-test', /* ['istanbul-setup'],*/ function() {
return gulp.src(tests.integration.index, { read: false })
.pipe(mocha({
compilers: { js: babel },
compilers: 'ts:ts-node/register',
reporter: 'spec',

@@ -162,15 +133,13 @@ timeout: 10000,

gulp.task('unit-test', ['istanbul-setup'], function() {
gulp.task('unit-test', /*['istanbul-setup'],*/ function() {
return gulp.src(tests.unit.index, { read: false })
.pipe(mocha({
compilers: { js: babel },
reporter: 'spec'
reporter: 'spec',
compilers: 'ts:ts-node/register'
}))
.pipe(istanbul.writeReports({
dir: coverage.unit.dir,
dir: coverage.dir,
reporters: ['cobertura', 'lcov', 'text'],
reportOpts: { dir: coverage.unit.dir }
reportOpts: { dir: coverage.dir }
}));
// TODO Enforce a coverage of at least 90% (or X%) percents
//.pipe(istanbul.enforceThresholds({ thresholds: { global: 90 } }));
});

@@ -185,20 +154,13 @@

gulp.task('bundle', function(done) {
browserify({ debug: false, standalone: 'Twilio.Chat.Client', entries: ['./src/index.js'] })
gulp.task('bundle', ['build-node'], function() {
let licenseContents = fs.readFileSync(product.license);
return browserify({ debug: false, standalone: 'Twilio.Chat', entries: ['./lib/client.js'] })
.transform(babelify, {
global: true,
ignore: /\/node_modules\/(?!twilio-transport|twilio-notifications|twilsock\/)/
}) // takes rest of settingcs from .babelrc
})
.bundle()
.pipe(source(product.bundled.name))
.pipe(source(product.packaged.name))
.pipe(buffer())
.pipe(derequire())
.pipe(gulp.dest(product.bundled.dir))
.once('error', exit)
.once('end', done);
});
gulp.task('license', function() {
var licenseContents = fs.readFileSync(product.license);
return gulp.src(product.bundled.dir + '/' + product.bundled.name)
.pipe(insert.prepend(

@@ -209,9 +171,7 @@ '/* ' + pkg.name + '.js ' + pkg.version + '\n'

))
.pipe(rename(product.packaged.name))
.pipe(gulp.dest(product.packaged.dir));
});
gulp.task('minify', function() {
return gulp.src(product.packaged.dir + '/' + product.packaged.name)
gulp.task('minify', ['bundle'], function() {
return gulp.src(path.join(product.packaged.dir, product.packaged.name))
.pipe(uglify({

@@ -293,1 +253,36 @@ output: { ascii_only: true }, // eslint-disable-line camelcase

});
gulp.task('doc', function(done) {
runSequence('generate-jsdoc', 'prettify-jsdoc', done);
});
gulp.task('build-node', ['lint'], function() {
const project = typescript.createProject('tsconfig.json');
return project.src().pipe(project()).pipe(gulp.dest('lib'));
});
gulp.task('build-browser', ['build-node'], function() {
return gulp.src(product.compiled.lib)
.pipe(babel())
.pipe(gulp.dest(product.browser.dir));
});
gulp.task('clean', function() {
return del([
product.compiled.dir,
product.browser.dir,
product.packaged.dir,
]);
});
gulp.task('package', ['build-node', 'bundle', 'minify']);
gulp.task('build', ['build-node', 'build-browser', 'package']);
gulp.task('default', function() {
runSequence(
'clean',
'build',
'doc'
);
});
{
"name": "twilio-chat",
"version": "0.12.0-rc9-build.308",
"description": "A library for Twilio IP messaging",
"version": "0.13.0-dev-build.329",
"description": "Twilio Chat service client library",
"main": "lib/index.js",
"browser": "browser/index.js",
"types": "./lib/client.d.ts",
"author": "Twilio",

@@ -15,11 +17,17 @@ "license": "MIT",

"rfc6902": "^1.3.0",
"twilio-ems-client": "^0.1.5",
"twilio-notifications": "^0.3.0",
"twilio-sync": "^0.4.2",
"twilio-ems-client": "^0.2.0",
"twilio-notifications": "^0.4.0",
"twilio-sync": "^0.5.0-dev.4",
"twilio-transport": "^0.1.1",
"twilsock": "^0.2.2",
"twilsock": "^0.3.0",
"uuid": "^3.0.1"
},
"devDependencies": {
"async": "^2.1.4",
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"@types/node": "^7.0.5",
"@types/sinon": "^1.16.35",
"@types/sinon-as-promised": "^4.0.5",
"@types/sinon-chai": "^2.7.27",
"async": "^2.1.5",
"async-test-tools": "^1.0.6",

@@ -30,7 +38,7 @@ "babel-eslint": "^7.1.1",

"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-runtime": "^6.22.0",
"babel-runtime": "^6.23.0",
"babelify": "^7.3.0",
"browserify": "^14.0.0",
"browserify": "^14.1.0",
"browserify-replace": "^0.9.0",

@@ -44,2 +52,3 @@ "chai": "^3.5.0",

"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-derequire": "^2.1.0",

@@ -50,6 +59,8 @@ "gulp-eslint": "^3.0.1",

"gulp-istanbul": "^1.1.1",
"gulp-mocha": "^3.0.1",
"gulp-mocha": "^4.0.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-tap": "^0.1.3",
"gulp-tslint": "^7.1.0",
"gulp-typescript": "^3.1.5",
"gulp-uglify": "^2.0.1",

@@ -60,3 +71,3 @@ "ink-docstrap": "^1.3.0",

"jsdoc-strip-async-await": "^0.1.0",
"karma": "^1.4.1",
"karma": "^1.5.0",
"karma-browserify": "^5.1.1",

@@ -68,3 +79,3 @@ "karma-browserstack-launcher": "^1.2.0",

"loglevel-message-prefix": "^2.0.1",
"mocha.parallel": "^0.14.0",
"mocha.parallel": "^0.15.0",
"proxyquire": "^1.7.11",

@@ -75,3 +86,6 @@ "run-sequence": "^1.2.2",

"sinon-chai": "^2.8.0",
"ts-node": "^2.1.0",
"tslint": "^4.4.2",
"twilio": "^2.11.1",
"typescript": "^2.1.6",
"vinyl-buffer": "^1.0.0",

@@ -78,0 +92,0 @@ "vinyl-source-stream": "^1.1.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc