react-input-autosize
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -66,2 +66,14 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"react-input-autosize":[function(require,module,exports){ | ||
getInput: function() { | ||
return this.refs.input; | ||
}, | ||
focus: function() { | ||
this.refs.input.getDOMNode().focus(); | ||
}, | ||
select: function() { | ||
this.refs.input.getDOMNode().select(); | ||
}, | ||
render: function() { | ||
@@ -68,0 +80,0 @@ |
@@ -67,2 +67,14 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.AutosizeInput=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
getInput: function() { | ||
return this.refs.input; | ||
}, | ||
focus: function() { | ||
this.refs.input.getDOMNode().focus(); | ||
}, | ||
select: function() { | ||
this.refs.input.getDOMNode().select(); | ||
}, | ||
render: function() { | ||
@@ -69,0 +81,0 @@ |
119
gulpfile.js
@@ -6,5 +6,10 @@ var browserify = require('browserify'), | ||
gulp = require('gulp'), | ||
bump = require('gulp-bump'), | ||
connect = require('gulp-connect'), | ||
deploy = require("gulp-gh-pages"), | ||
git = require("gulp-git"), | ||
less = require('gulp-less'), | ||
rename = require('gulp-rename'), | ||
streamify = require('gulp-streamify'), | ||
uglify = require('gulp-uglify'), | ||
gutil = require('gulp-util'), | ||
@@ -21,16 +26,19 @@ merge = require('merge-stream'), | ||
var SRC_PATH = './src'; | ||
var DIST_PATH = './dist'; | ||
var SRC_PATH = 'src'; | ||
var DIST_PATH = 'dist'; | ||
var PACKAGE_NAME = require('./package.json').name; | ||
var PACKAGE_FILE = 'AutosizeInput.js'; | ||
var STANDALONE_NAME = 'AutosizeInput'; | ||
var PACKAGE_NAME = 'react-input-autosize'; | ||
var COMPONENT_NAME = 'AutosizeInput'; | ||
var DEPENDENCIES = ['react']; | ||
var EXAMPLE_DIST = './example/dist'; | ||
var EXAMPLE_APP = './example/src/app.js'; | ||
var EXAMPLE_LESS = './example/src/app.less'; | ||
var EXAMPLE_SRC_PATH = 'example/src'; | ||
var EXAMPLE_DIST_PATH = 'example/dist'; | ||
var EXAMPLE_APP = 'app.js'; | ||
var EXAMPLE_LESS = 'app.less'; | ||
var EXAMPLE_FILES = [ | ||
'./example/src/index.html', | ||
'./example/src/standalone.html' | ||
'index.html', | ||
'standalone.html' | ||
]; | ||
@@ -77,3 +85,3 @@ | ||
gulp.task('prepare:examples', function(done) { | ||
del([EXAMPLE_DIST], done); | ||
del([EXAMPLE_DIST_PATH], done); | ||
}); | ||
@@ -87,4 +95,4 @@ | ||
function buildExampleFiles() { | ||
return gulp.src(EXAMPLE_FILES) | ||
.pipe(gulp.dest(EXAMPLE_DIST)) | ||
return gulp.src(EXAMPLE_FILES.map(function(i) { return EXAMPLE_SRC_PATH + '/' + i })) | ||
.pipe(gulp.dest(EXAMPLE_DIST_PATH)) | ||
.pipe(connect.reload()); | ||
@@ -102,5 +110,5 @@ } | ||
function buildExampleCSS() { | ||
return gulp.src(EXAMPLE_LESS) | ||
return gulp.src(EXAMPLE_SRC_PATH + '/' + EXAMPLE_LESS) | ||
.pipe(less()) | ||
.pipe(gulp.dest(EXAMPLE_DIST)) | ||
.pipe(gulp.dest(EXAMPLE_DIST_PATH)) | ||
.pipe(connect.reload()); | ||
@@ -121,3 +129,3 @@ } | ||
var dest = EXAMPLE_DIST; | ||
var dest = EXAMPLE_DIST_PATH; | ||
@@ -131,5 +139,5 @@ var opts = dev ? watchify.args : {}; | ||
var common = browserify(opts), | ||
bundle = browserify(opts).require(SRC_PATH + '/' + PACKAGE_FILE, { expose: PACKAGE_NAME }), | ||
example = browserify(opts).exclude(PACKAGE_NAME).add(EXAMPLE_APP), | ||
standalone = browserify(SRC_PATH + '/' + PACKAGE_FILE, { standalone: STANDALONE_NAME }) | ||
bundle = browserify(opts).require('./' + SRC_PATH + '/' + PACKAGE_FILE, { expose: PACKAGE_NAME }), | ||
example = browserify(opts).exclude(PACKAGE_NAME).add('./' + EXAMPLE_SRC_PATH + '/' + EXAMPLE_APP), | ||
standalone = browserify('./' + SRC_PATH + '/' + PACKAGE_FILE, { standalone: COMPONENT_NAME }) | ||
.transform(reactify) | ||
@@ -182,4 +190,4 @@ .transform(shim); | ||
], function() { | ||
gulp.watch([EXAMPLE_FILES], ['dev:build:example:files']); | ||
gulp.watch([EXAMPLE_LESS], ['dev:build:example:css']); | ||
gulp.watch(EXAMPLE_FILES.map(function(i) { return EXAMPLE_SRC_PATH + '/' + i }), ['dev:build:example:files']); | ||
gulp.watch([EXAMPLE_SRC_PATH + './' + EXAMPLE_LESS], ['dev:build:example:css']); | ||
}); | ||
@@ -221,4 +229,4 @@ | ||
var standalone = browserify(SRC_PATH + '/' + PACKAGE_FILE, { | ||
standalone: STANDALONE_NAME | ||
var standalone = browserify('./' + SRC_PATH + '/' + PACKAGE_FILE, { | ||
standalone: COMPONENT_NAME | ||
}) | ||
@@ -232,3 +240,11 @@ .transform(reactify) | ||
return doBundle(standalone, PACKAGE_FILE, DIST_PATH); | ||
return standalone.bundle() | ||
.on('error', function(e) { | ||
gutil.log('Browserify Error', e); | ||
}) | ||
.pipe(source(PACKAGE_NAME + '.js')) | ||
.pipe(gulp.dest(DIST_PATH)) | ||
.pipe(rename(PACKAGE_NAME + '.min.js')) | ||
.pipe(streamify(uglify())) | ||
.pipe(gulp.dest(DIST_PATH)); | ||
@@ -244,7 +260,58 @@ }); | ||
/** | ||
* Deploy task | ||
* Version bump tasks | ||
*/ | ||
gulp.task('deploy', ['build:examples'], function() { | ||
return gulp.src(EXAMPLE_DIST + '/**/*').pipe(deploy()); | ||
function getBumpTask(type) { | ||
return function() { | ||
return gulp.src(['./package.json', './bower.json']) | ||
.pipe(bump({ type: type })) | ||
.pipe(gulp.dest('./')); | ||
}; | ||
} | ||
gulp.task('bump', getBumpTask('patch')); | ||
gulp.task('bump:minor', getBumpTask('minor')); | ||
gulp.task('bump:major', getBumpTask('major')); | ||
/** | ||
* Git tag task | ||
* (version *must* be bumped first) | ||
*/ | ||
gulp.task('publish:tag', function(done) { | ||
var pkg = require('./package.json'); | ||
var v = 'v' + pkg.version; | ||
var message = 'Release ' + v; | ||
git.tag(v, message, function (err) { | ||
if (err) throw err; | ||
git.push('origin', v, function (err) { | ||
if (err) throw err; | ||
done(); | ||
}); | ||
}); | ||
}); | ||
/** | ||
* npm publish task | ||
* * (version *must* be bumped first) | ||
*/ | ||
gulp.task('publish:npm', function(done) { | ||
require('child_process') | ||
.spawn('npm', ['publish'], { stdio: 'inherit' }) | ||
.on('close', done); | ||
}); | ||
/** | ||
* Deploy tasks | ||
*/ | ||
gulp.task('publish:examples', ['build:examples'], function() { | ||
return gulp.src(EXAMPLE_DIST_PATH + '/**/*').pipe(deploy()); | ||
}); | ||
gulp.task('release', ['publish:tag', 'publish:npm', 'publish:examples']); |
{ | ||
"name": "react-input-autosize", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Auto-resizing Input Component for React", | ||
"main": "dist/AutosizeInput.js", | ||
"main": "dist/react-input-autosize.js", | ||
"author": "Jed Watson", | ||
@@ -22,5 +22,10 @@ "license": "MIT", | ||
"gulp": "~3.8.10", | ||
"gulp-bump": "~0.1.11", | ||
"gulp-connect": "~2.2.0", | ||
"gulp-gh-pages": "~0.4.0", | ||
"gulp-git": "~0.5.4", | ||
"gulp-less": "~1.3.6", | ||
"gulp-rename": "~1.2.0", | ||
"gulp-streamify": "~0.0.5", | ||
"gulp-uglify": "~1.0.1", | ||
"gulp-util": "~3.0.1", | ||
@@ -27,0 +32,0 @@ "merge-stream": "~0.1.6", |
@@ -65,2 +65,14 @@ var React = require('react'); | ||
getInput: function() { | ||
return this.refs.input; | ||
}, | ||
focus: function() { | ||
this.refs.input.getDOMNode().focus(); | ||
}, | ||
select: function() { | ||
this.refs.input.getDOMNode().select(); | ||
}, | ||
render: function() { | ||
@@ -67,0 +79,0 @@ |
Sorry, the diff of this file is not supported yet
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
20
10
35093
17
718
4
2