twilio-chat
Advanced tools
Comparing version 0.12.0-rc9-build.308 to 0.13.0-dev-build.329
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
4
4
1941267
62
39149
+ Addedansi-gray@0.1.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedansi-wrap@0.1.0(transitive)
+ Addedarray-differ@1.0.0(transitive)
+ Addedarray-uniq@1.0.3(transitive)
+ Addedasync-limiter@1.0.1(transitive)
+ Addedbeeper@1.1.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedclone-stats@0.0.1(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcuint@0.2.2(transitive)
+ Addeddargs@5.1.0(transitive)
+ Addeddateformat@2.2.0(transitive)
+ Addedduplexer2@0.0.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedfancy-log@1.3.3(transitive)
+ Addedglogg@1.0.2(transitive)
+ Addedgulp-install@1.1.0(transitive)
+ Addedgulp-util@3.0.8(transitive)
+ Addedgulplog@1.0.0(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-gulplog@0.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.11.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlodash._basecopy@3.0.1(transitive)
+ Addedlodash._basetostring@3.0.1(transitive)
+ Addedlodash._basevalues@3.0.0(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash._isiterateecall@3.0.9(transitive)
+ Addedlodash._reescape@3.0.0(transitive)
+ Addedlodash._reevaluate@3.0.0(transitive)
+ Addedlodash._reinterpolate@3.0.0(transitive)
+ Addedlodash._root@3.0.1(transitive)
+ Addedlodash.escape@3.2.0(transitive)
+ Addedlodash.groupby@4.6.0(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
+ Addedlodash.keys@3.1.2(transitive)
+ Addedlodash.restparam@3.6.1(transitive)
+ Addedlodash.template@3.6.2(transitive)
+ Addedlodash.templatesettings@3.1.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmultipipe@0.1.2(transitive)
+ Addedobject-assign@3.0.0(transitive)
+ Addedp-queue@1.2.0(transitive)
+ Addedparse-node-version@1.0.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@1.1.142.3.8(transitive)
+ Addedreplace-ext@0.0.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsparkles@1.0.1(transitive)
+ Addedstring_decoder@0.10.311.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedtime-stamp@1.1.0(transitive)
+ Addedtwilio-ems-client@0.2.6(transitive)
+ Addedtwilio-notifications@0.4.4(transitive)
+ Addedtwilio-sync@0.5.11(transitive)
+ Addedtwilsock@0.3.6(transitive)
+ Addedultron@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvinyl@0.5.3(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedws@3.3.3(transitive)
+ Addedxtend@4.0.2(transitive)
+ Addedxxhashjs@0.2.2(transitive)
- Removedoptions@0.0.6(transitive)
- Removedtwilio-ems-client@0.1.5(transitive)
- Removedtwilio-notifications@0.3.0(transitive)
- Removedtwilio-sync@0.4.2(transitive)
- Removedtwilsock@0.2.2(transitive)
- Removedultron@1.0.2(transitive)
- Removedws@1.1.5(transitive)
Updatedtwilio-ems-client@^0.2.0
Updatedtwilio-notifications@^0.4.0
Updatedtwilio-sync@^0.5.0-dev.4
Updatedtwilsock@^0.3.0