From c2046a0fc54cd9665f76377fd1cd9601ffcbc8ca Mon Sep 17 00:00:00 2001 From: zimme Date: Sat, 29 Nov 2014 02:09:44 +0100 Subject: [PATCH] Add meteor packaging --- .gitignore | 1 + README.md | 15 ++++++++++++--- meteor/package.js | 23 +++++++++++++++++++++++ meteor/publish.sh | 25 +++++++++++++++++++++++++ meteor/runtests.sh | 30 ++++++++++++++++++++++++++++++ meteor/test.js | 5 +++++ 6 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 meteor/package.js create mode 100755 meteor/publish.sh create mode 100755 meteor/runtests.sh create mode 100644 meteor/test.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..677a6fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.build* diff --git a/README.md b/README.md index 50e0436..9783fc0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/meteor/package.js b/meteor/package.js new file mode 100644 index 0000000..91e1c8b --- /dev/null +++ b/meteor/package.js @@ -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); +}); diff --git a/meteor/publish.sh b/meteor/publish.sh new file mode 100755 index 0000000..6e31877 --- /dev/null +++ b/meteor/publish.sh @@ -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 diff --git a/meteor/runtests.sh b/meteor/runtests.sh new file mode 100755 index 0000000..90ce53a --- /dev/null +++ b/meteor/runtests.sh @@ -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 diff --git a/meteor/test.js b/meteor/test.js new file mode 100644 index 0000000..eab99bf --- /dev/null +++ b/meteor/test.js @@ -0,0 +1,5 @@ +'use strict'; + +Tinytest.add('Instantiation', function(test) { + test.notEqual($.growl, undefined); +});