Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made communication identical in both directions. Removed modeling. Removed classes. #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"presets": [ "es2015-rollup" ],
"plugins": ["transform-class-properties"]
"presets": [ "es2015" ],
"plugins": [
"transform-es2015-modules-umd",
[
"rename-umd-globals",
{
"postmate": "Postmate"
}
]
]
}
26 changes: 8 additions & 18 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@

const babel = require('rollup-plugin-babel');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const connect = require('connect');
const eslint = require('gulp-eslint');
const fs = require('fs');
const gulp = require('gulp');
const header = require('gulp-header');
const http = require('http');
const minify = require('uglify-js').minify;
const mochaPhantomJS = require('gulp-mocha-phantomjs');
const path = require('path');
const rollup = require('rollup-stream');
const serveStatic = require('serve-static');
const source = require('vinyl-source-stream');
const uglify = require('rollup-plugin-uglify');

var parentServer; // eslint-disable-line no-var
var childServer; // eslint-disable-line no-var
Expand All @@ -27,23 +25,15 @@ const banner = ['/**',
''].join('\n');

gulp.task('do-build', () =>
rollup({
entry: './src/postmate.js',
format: 'umd',
moduleName: 'Postmate',
plugins: [
babel({
exclude: 'node_modules/**',
}),
uglify({}, minify),
],
})
.pipe(source('postmate.min.js'))
gulp.src('./src/postmate.js')
.pipe(babel())
.pipe(uglify())
.pipe(header(banner, { pkg }))
.pipe(rename('postmate.min.js'))
.pipe(gulp.dest('./build'))
);

gulp.task('update-readme', () => {
gulp.task('update-readme', ['do-build'], () => {
const readme = path.join(__dirname, 'README.md');
const data = fs.readFileSync(readme, 'utf-8');
const distSize = fs.statSync(path.join(__dirname, 'build', 'postmate.min.js')).size;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can download the compiled javascript directly [here](/build/postmate.min.js)
* Child emits events that the parent can listen to.
* Parent can `call` functions within a `child`
* *Zero* dependencies. Provide your own polyfill or abstraction for the `Promise` API if needed.
* Lightweight, weighing in at ~ <span class="size">`5.2kb`</span>.
* Lightweight, weighing in at ~ <span class="size">`4.1kb`</span>.

## Installing
Postmate can be installed via NPM or Bower.
Expand Down
2 changes: 1 addition & 1 deletion build/postmate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,28 @@
"build"
],
"devDependencies": {
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-preset-es2015-rollup": "^1.1.1",
"babel-plugin-rename-umd-globals": "0.0.4",
"babel-plugin-transform-es2015-modules-umd": "^6.12.0",
"babel-preset-es2015": "^6.16.0",
"chai": "^3.5.0",
"connect": "^3.4.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.12.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-eslint": "^3.0.1",
"gulp-header": "^1.8.7",
"gulp-mocha-phantomjs": "^0.11.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^2.0.0",
"mocha": "^3.0.2",
"mocha-phantomjs": "^4.1.0",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-uglify": "^1.0.1",
"rollup-stream": "^1.11.0",
"rsvp": "^3.2.1",
"serve-static": "^1.11.1",
"uglify-js": "^2.7.0",
"vinyl-source-stream": "^1.1.0"
"serve-static": "^1.11.1"
},
"scripts": {
"test": "gulp test",
"build": "gulp build && gulp update-readme",
"build": "gulp build update-readme",
"build-watch": "gulp build-watch",
"lint": "gulp lint",
"postpublish": "git tag $npm_package_version && git push origin --tags"
Expand All @@ -52,5 +51,6 @@
"bugs": {
"url": "https://github.com/dollarshaveclub/postmate/issues"
},
"homepage": "https://github.com/dollarshaveclub/postmate"
"homepage": "https://github.com/dollarshaveclub/postmate",
"dependencies": {}
}
Loading