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

Meteor Package support #17

Open
wants to merge 2 commits into
base: develop
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
27 changes: 27 additions & 0 deletions meteor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[![Build Status](https://travis-ci.org/MeteorPackaging/javascript-detect-element-resize?branch=master)](https://travis-ci.org/MeteorPackaging/javascript-detect-element-resize)

Packaging [javascript-detect-element-resize](https://github.com/sdecima/javascript-detect-element-resize) for [Meteor.js](http://meteor.com).


# Meteor

If you're new to Meteor, here's what the excitement is all about -
[watch the first two minutes](https://www.youtube.com/watch?v=fsi0aJ9yr2o); you'll be hooked by 1:28.

That screencast is from 2012. In the meantime, Meteor has become a mature JavaScript-everywhere web
development framework. Read more at [Why Meteor](http://www.meteorpedia.com/read/Why_Meteor).


# Issues

If you encounter an issue while using this package, please CC @gadicc when you file it in this repo.


# DONE

* Instantiation test


# TODO

* Tests ensuring correct event handling on template re-rendering
39 changes: 39 additions & 0 deletions meteor/package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// package metadata file for Meteor.js
'use strict';

// https://atmospherejs.com/sdecima/javascript-detect-element-resize
var packageName = 'sdecima:javascript-detect-element-resize';
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.

var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));

Package.describe({
name: packageName,
summary: 'Official. Efficient cross-browser, event-based, element resize detection',
version: packageJson.version,
git: 'https://github.com/sdecima/javascript-detect-element-resize'
});

Package.onUse(function (api) {
api.versionsFrom(['[email protected]', '[email protected]']);

/*
* The library doesn't require jQuery; in theory we should only run the jQuery code if
* jQuery is detected, but since jquery is a core Meteor package (for now), we always
* attach it
*/
api.use('jquery', 'client');

api.addFiles([
'detect-element-resize.js',
'jquery.resize.js'
], where
);
});

Package.onTest(function (api) {
api.use(packageName, where);
api.use('tinytest', where);

api.addFiles('meteor/test.js', where);
});
7 changes: 7 additions & 0 deletions meteor/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [[ `pwd` == *meteor ]] ; then cd .. ; fi
ln -s meteor/package.js package.js 2>/dev/null
meteor publish
rm -f .versions versions.json package.js

6 changes: 6 additions & 0 deletions meteor/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

Tinytest.add('javascript-detect-element-resize', function (test) {
test.instanceOf(addResizeListener, Function);
test.instanceOf(removeResizeListener, Function);
});