Permalink
Browse files

start using rollup

  • Loading branch information...
1 parent c9680ac commit 3d72835442462a5ffbf6e83168f40accd0f6d7f5 @jamuhl jamuhl committed Mar 9, 2016
View
@@ -1,3 +1,10 @@
{
- "stage": 0
+ "env": {
+ "development": {
+ "presets": [ "es2015", "stage-0" ]
+ },
+ "es": {
+ "presets": [ "es2015-rollup", "stage-0" ]
+ }
+ }
}
View
@@ -1,108 +1,19 @@
----
parser: babel-eslint
-
-ecmaFeatures:
- arrowFunctions: true
- blockBindings: true
- classes: true
- defaultParams: true
- destructuring: true
- forOf: true
- generators: false
- modules: true
- objectLiteralComputedProperties: true
- objectLiteralDuplicateProperties: false
- objectLiteralShorthandMethods: true
- objectLiteralShorthandProperties: true
- spread: true
- superInFunctions: true
- templateStrings: true
-
-env:
- browser: true
- node: true
- es6: true
-
-globals:
- __resourceQuery: false
- bootstrap: false
- describe: false
- describeSaga: false
- describeEvent: false
- describeCommand: false
- describeScene: false
- before: false
- it: false
- xit: false
- window : false
- beforeEach : false
- afterEach : false
- after : false
- before : false
- beforeEachChapter: false
- describeScenario: false
- describeChapter: false
- describeStep: false
- document : false
- window: false
- File : false
- FormData: false
- QCodeDecoder: false
- $: false
- L: false
- btoa: false
- escape: false
- angular: false
- jQuery: false
- ga: false
-
-settings:
- jsx: true
-
-ecmaFeatures:
- jsx: true
+extends: airbnb
rules:
+ max-len: [0, 100]
+ no-constant-condition: 0
+ arrow-body-style: [1, "as-needed"]
+ comma-dangle: [2, "never"]
+ padded-blocks: [0, "never"]
+ no-unused-vars: [2, {vars: all, args: none}]
+ react/prop-types:
+ - 0
+ - ignore: #coming from hoc
+ - location
+ - fields
+ - handleSubmit
- # ERRORS
- curly: [2, "multi-line"]
-
- # WARNINGS
- no-unused-vars: [1, {vars: all, args: none}]
- semi-spacing: 1
- no-empty: 1
- handle-callback-err: 1
- eqeqeq: 1
- quotes: [1, 'single']
- no-unused-expressions: 1
- no-throw-literal: 1
- semi: 1
- block-scoped-var: 1
- no-alert: 1
- no-console: 1
- new-cap: 1
- space-unary-ops: 1
-
- # DISABLED
- space-after-keywords: 0
- dot-notation: 0
- consistent-return: 0
- brace-style: 0
- no-multi-spaces: 0
- no-underscore-dangle: 0
- key-spacing: 0
- comma-spacing: 0
- no-shadow: 0
- no-mixed-requires: 0
- space-infix-ops: 0
- strict: 0
- camelcase: 0
- no-wrap-func: 0
- comma-dangle: 0
- no-extra-semi: 0
- no-use-before-define: [0, "nofunc"]
-
- # AUTOMATED BY EDITORCONFIG
- eol-last: 0
- no-trailing-spaces: 0
- indent: 0
+globals:
+ expect: false
View
@@ -16,3 +16,4 @@ npm-debug.log.*
node_modules
node_modules/**/*
coverage/**/*
+dist/**/*
View
Oops, something went wrong.
View
Oops, something went wrong.
View
@@ -1,11 +1,10 @@
{
"name": "i18next",
- "version": "2.2.0",
- "main": "./bin/index.js",
+ "main": "./i18next.min.js",
"dependencies": {},
"ignore": [
"test/",
- "lib/",
+ "dist/",
"src/",
"coverage/",
".babelrc",
View
@@ -1,193 +0,0 @@
-var gulp = require('gulp'),
- rename = require('gulp-rename'),
- babel = require('gulp-babel'),
- prompt = require('gulp-prompt'),
- git = require('gulp-git'),
- bump = require('gulp-bump'),
- filter = require('gulp-filter'),
- tag_version = require('gulp-tag-version'),
- shell = require('gulp-shell'),
- argv = require('yargs').argv,
- gulpif = require('gulp-if'),
- uglify = require('gulp-uglify'),
- sourcemaps = require('gulp-sourcemaps'),
- source = require('vinyl-source-stream'),
- buffer = require('vinyl-buffer'),
- browserify = require('browserify'),
- watchify = require('watchify'),
- babelify = require('babelify'),
- eslint = require('gulp-eslint'),
- Server = require('karma').Server;
-
-var pkg = require('./package.json');
-
-var entry = 'i18next.js',
- standaloneName = 'i18next',
- output = 'index.js';
-
-function compile(watch) {
- var bundler = browserify('./src/' + entry, { debug: argv.debug, standalone: standaloneName }).transform(babelify);
- if (watch) {
- bundle = watchify(bundler);
- }
-
- function rebundle() {
- return bundler.bundle()
- .on('error', function(err) { console.error(err); this.emit('end'); })
- .pipe(source(output))
- .pipe(buffer())
- .pipe(gulpif(!argv.debug, uglify()))
- .pipe(gulpif(argv.debug, sourcemaps.init({ loadMaps: true })))
- .pipe(gulpif(argv.debug, sourcemaps.write('./')))
- .pipe(gulp.dest('./bin'));
- }
-
- if (watch) {
- bundler.on('update', function() {
- console.log('-> bundling...');
- rebundle();
- });
- }
-
- return rebundle();
-}
-
-gulp.task('eslint', function () {
- return gulp.src(['src/**/*.js'])
- .pipe(eslint({
- useEslintrc: true
- }))
- .pipe(eslint.format())
- .pipe(eslint.failAfterError());
-});
-
-gulp.task('test', function (done) {
- new Server({
- configFile: __dirname + '/karma.conf.js',
- singleRun: true,
- reporters: [ 'spec', 'coverage' ],
- }, done).start();
-});
-
-gulp.task('test_forCI', function (done) {
- new Server({
- configFile: __dirname + '/karma.conf.js',
- singleRun: true,
- reporters: [ 'coverage', 'coveralls', 'spec' ],
- }, done).start();
-});
-
-gulp.task('test_compat_ci', function (done) {
- new Server({
- configFile: __dirname + '/karma.backward.conf.js',
- singleRun: true
- }, done).start();
-});
-
-gulp.task('test_compat', function (done) {
- new Server({
- configFile: __dirname + '/karma.backward.conf.js'
- }, done).start();
-});
-
-
-gulp.task('tdd', function (done) {
- new Server({
- configFile: __dirname + '/karma.conf.js'
- }, done).start();
-});
-
-gulp.task('babel', function () {
- return gulp.src('./src/**/*.js')
- .pipe(babel())
- .pipe(gulp.dest('./lib'));
-});
-
-gulp.task('rename', ['concat', 'babel'], function () {
- return gulp
- .src('./bin/index.js')
- .pipe(rename('./' + standaloneName + '.min.js'))
- .pipe(gulp.dest('./'));
-});
-
-function inc(version) {
- if (!version) return;
-
- var type, tag;
-
- if (version.indexOf('.') < 0) {
- if (version === 'major' || version === 'minor' || version === 'patch') {
- type = version;
- } else {
- tag = version;
-
- var parts = pkg.version.split('-');
- if (parts.length > 1) {
- var tagVersion = 0;
- var p = parts[1].split('.');
- if (p[0] === tag) tagVersion = parseInt(p[1], 10) + 1;
- version = parts[0] + '-' + tag + '.' + tagVersion;
- } else {
- version = pkg.version + '-' + tag + '.0';
- }
- }
- }
-
- function cb(obj) {
- var stream = new require('stream').Transform({objectMode: true});
- stream._transform = function(file, unused, callback) {
- obj();
- callback(null, file);
- };
- return stream;
- }
-
- // get all the files to bump version in
- return gulp.src(['./package.json', './bower.json'])
- // bump the version number in those files
- .pipe(type ? bump({type: type}) : bump({version: version}))
- // save it back to filesystem
- .pipe(gulp.dest('./'))
-
- // commit change
- .pipe(git.commit('bumps package version'))
-
- // read only one file to get the version number
- .pipe(filter('package.json'))
- // **tag it in the repository**
- .pipe(tag_version({prefix: ''}))
-
- // push tag
- .pipe(prompt.confirm({
- message: 'Push tag ' + version + ' to github?',
- default: false
- }))
- .pipe(cb(function() {
- git.push('origin','master', {args: ' --tags --force'}, function (err) {
- if (err) throw err;
- });
- }))
-
- // npm publish
- .pipe(prompt.confirm({
- message: 'publish ' + version + ' to npm?',
- default: false
- }))
- .pipe(shell([
- 'npm publish --tag ' + (tag ? tag : 'latest')
- ]));
-}
-
-function watch() {
- return compile(true);
-};
-
-gulp.task('concat', function() { return compile(); });
-gulp.task('watch', function() { return watch(); });
-gulp.task('bump', function() { return inc(argv.v); });
-
-gulp.task('default', ['watch']);
-gulp.task('build', ['concat', 'babel', 'rename']);
-gulp.task('publish', ['bump']);
-
-gulp.task('test_ci', ['test_forCI']);
Oops, something went wrong.

0 comments on commit 3d72835

Please sign in to comment.