ts-commons
Advanced tools
Comparing version 0.0.21 to 0.0.22
var gulp = require("gulp"); | ||
var browserify = require("gulp-browserify"); | ||
var clean = require("gulp-clean"); | ||
var concat = require("gulp-concat"); | ||
var sourcemaps = require("gulp-sourcemaps"); | ||
var ts = require("gulp-typescript"); | ||
const sourcemaps = require("gulp-sourcemaps"); | ||
var tsProject = ts.createProject("tsconfig.json"); | ||
var uglify = require("gulp-uglify"); | ||
var merge = require('merge-stream'); | ||
gulp.task("default", ["compile"]); | ||
gulp.task('default', function () { | ||
var tsProject = ts.createProject('tsconfig.json'); | ||
var tsResult = gulp.src(['src/**/*.ts']) | ||
.pipe(sourcemaps.init()) | ||
.pipe(tsProject()); | ||
return merge(tsResult, tsResult.js) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('./dist/src')); | ||
}); | ||
gulp.task("clean", function() { | ||
return gulp.src(["./tmp/", "./dist/"], { read: false }).pipe(clean()); | ||
}); | ||
gulp.task("transpile-ts", ["clean"], function() { | ||
var tsproject = ts.createProject("./tsconfig.json"); | ||
return tsproject | ||
.src() | ||
.pipe(sourcemaps.init()) | ||
.pipe(tsproject()) | ||
.js.pipe(sourcemaps.write("./sourcemaps")) | ||
.pipe(gulp.dest("./tmp")); | ||
}); | ||
gulp.task("browserify-js", ["transpile-ts"], function() { | ||
return ( | ||
gulp | ||
.src("./tmp/index.js") | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(browserify()) | ||
// .pipe(uglify()) | ||
.pipe(concat("ts-commons.js")) | ||
.pipe(sourcemaps.write(".")) | ||
.pipe(gulp.dest("./dist")) | ||
); | ||
}); | ||
gulp.task("min-js", ["browserify-js"], function() { | ||
return gulp | ||
.src("./tmp/index.js") | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(browserify()) | ||
.pipe(uglify()) | ||
.pipe(concat("ts-commons.min.js")) | ||
.pipe(sourcemaps.write(".")) | ||
.pipe(gulp.dest("./dist")); | ||
}); | ||
gulp.task("compile", ["min-js"], function() { | ||
var tsProjectDts = ts.createProject("tsconfig.json"); | ||
var tsResult = gulp.src("src/**/*.ts").pipe(tsProjectDts()); | ||
tsResult.dts.pipe(concat("ts-commons.d.ts")).pipe(gulp.dest("dist")); | ||
}); |
{ | ||
"name": "ts-commons", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "common methods for typescript", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/ts-commons.js", | ||
"types": "dist/ts-commons.d.ts", | ||
"scripts": { | ||
@@ -11,3 +11,3 @@ "pretest": "npm run deletedist && tsc -p tsconfig.test.json", | ||
"posttest": "npm run removenyc && del-cli coverage", | ||
"prepublish": "npm run build", | ||
"prepublish": "gulp", | ||
"cover": "tsc -p tsconfig.test.json && istanbul cover ./node_modules/mocha/bin/_mocha dist/test/**/*.test.js --recursive", | ||
@@ -41,3 +41,6 @@ "coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && del-cli ./coverage", | ||
"gulp": "^3.9.1", | ||
"gulp-browserify": "^0.5.1", | ||
"gulp-clean": "^0.4.0", | ||
"gulp-cli": "^2.0.1", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-sourcemaps": "^2.6.4", | ||
@@ -44,0 +47,0 @@ "gulp-typescript": "^5.0.0-alpha.3", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30
1587
120598
34
2
4