Skip to content

Add meteor.js packaging #55

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

Merged
merged 1 commit into from
Jan 26, 2015
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ I just wanted to give everyone an update due to the amount of views/pull request
This is a simple pluging that turns standard Bootstrap alerts into "Growl-like" notifications.


## Bower Officially Supported
I would like to thank [Błażej Krysiak](https://github.com/IjinPL) for doing this!
## Official support

### Bower
```
bower install bootstrap.growl
```
Thanks to [Błażej Krysiak](https://github.com/IjinPL)

### Meteor

```
bower install bootstrap.growl
meteor add mouse0270:bootstrap-growl
```
Thanks to [Simon Fridlund](https://github.com/zimme)

## Changelog
##### Version 2.0.1
Expand Down
23 changes: 23 additions & 0 deletions meteor/package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
var packageName = 'mouse0270:bootstrap-growl';
var where = 'client';

Package.describe({
git: 'https://github.com/mouse0270/bootstrap-growl',
name: packageName,
summary: 'Turns standard Bootstrap alerts into "Growl-like" notifications',
version: packageJson.version,
});

Package.onUse(function (api) {
api.versionsFrom('1.0');
api.use('jquery', where);
api.addFiles('bootstrap-growl.js', where);
});

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

api.addFiles('meteor/test.js', where);
});
25 changes: 25 additions & 0 deletions meteor/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Publish package on Meteor's Atmosphere.js

# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed
# script is totally safe; takes 2 minutes to read its source and check.
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }

# sanity check: make sure we're in the root directory of the checkout
DIR=$( cd "$( dirname "$0" )" && pwd )
cd $DIR/..

# Meteor expects package.js to be in the root directory of the checkout, so copy
# it there temporarily
cp meteor/package.js ./

# publish package, creating it if it's the first time we're publishing
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
PACKAGE_EXISTS=$(meteor search $PACKAGE_NAME 2>/dev/null | wc -l)

if [ $PACKAGE_EXISTS -gt 0 ]; then
meteor publish
else
meteor publish --create
fi

rm package.js
30 changes: 30 additions & 0 deletions meteor/runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Test Meteor package before publishing to Atmosphere.js

# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed
# script is totally safe; takes 2 minutes to read its source and check.
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }

# sanity check: make sure we're in the root directory of the checkout
DIR=$( cd "$( dirname "$0" )" && pwd )
cd $DIR/..

# Meteor expects package.js to be in the root directory of the checkout, so copy
# it there temporarily
cp meteor/package.js ./

# run tests and delete the temporary package.js even if Ctrl+C is pressed
int_trap() {
echo
echo "Tests interrupted."
}

trap int_trap INT

meteor test-packages ./

PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
rm -rf ".build.$PACKAGE_NAME"
rm -rf ".build.local-test:$PACKAGE_NAME"
rm versions.json 2>/dev/null

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

Tinytest.add('Instantiation', function(test) {
test.notEqual($.growl, undefined);
});