Skip to content

Commit c2046a0

Browse files
committed
Add meteor packaging
1 parent 52fc663 commit c2046a0

File tree

6 files changed

+96
-3
lines changed

6 files changed

+96
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.build*

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@ I just wanted to give everyone an update due to the amount of views/pull request
44
This is a simple pluging that turns standard Bootstrap alerts into "Growl-like" notifications.
55

66

7-
## Bower Officially Supported
8-
I would like to thank [Błażej Krysiak](https://github.com/IjinPL) for doing this!
7+
## Official support
8+
9+
### Bower
10+
```
11+
bower install bootstrap.growl
12+
```
13+
Thanks to [Błażej Krysiak](https://github.com/IjinPL)
14+
15+
### Meteor
16+
917
```
10-
bower install bootstrap.growl
18+
meteor add mouse0270:bootstrap-growl
1119
```
20+
Thanks to [Simon Fridlund](https://github.com/zimme)
1221

1322
## Changelog
1423
##### Version 2.0.1

meteor/package.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
2+
var packageName = 'mouse0270:bootstrap-growl';
3+
var where = 'client';
4+
5+
Package.describe({
6+
git: 'https://github.com/mouse0270/bootstrap-growl',
7+
name: packageName,
8+
summary: 'Turns standard Bootstrap alerts into "Growl-like" notifications',
9+
version: packageJson.version,
10+
});
11+
12+
Package.onUse(function (api) {
13+
api.versionsFrom('1.0');
14+
api.use('jquery', where);
15+
api.addFiles('bootstrap-growl.js', where);
16+
});
17+
18+
Package.onTest(function (api) {
19+
api.use(packageName, where);
20+
api.use('tinytest', where);
21+
22+
api.addFiles('meteor/test.js', where);
23+
});

meteor/publish.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Publish package on Meteor's Atmosphere.js
2+
3+
# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed
4+
# script is totally safe; takes 2 minutes to read its source and check.
5+
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
6+
7+
# sanity check: make sure we're in the root directory of the checkout
8+
DIR=$( cd "$( dirname "$0" )" && pwd )
9+
cd $DIR/..
10+
11+
# Meteor expects package.js to be in the root directory of the checkout, so copy
12+
# it there temporarily
13+
cp meteor/package.js ./
14+
15+
# publish package, creating it if it's the first time we're publishing
16+
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
17+
PACKAGE_EXISTS=$(meteor search $PACKAGE_NAME 2>/dev/null | wc -l)
18+
19+
if [ $PACKAGE_EXISTS -gt 0 ]; then
20+
meteor publish
21+
else
22+
meteor publish --create
23+
fi
24+
25+
rm package.js

meteor/runtests.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Test Meteor package before publishing to Atmosphere.js
2+
3+
# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed
4+
# script is totally safe; takes 2 minutes to read its source and check.
5+
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
6+
7+
# sanity check: make sure we're in the root directory of the checkout
8+
DIR=$( cd "$( dirname "$0" )" && pwd )
9+
cd $DIR/..
10+
11+
# Meteor expects package.js to be in the root directory of the checkout, so copy
12+
# it there temporarily
13+
cp meteor/package.js ./
14+
15+
# run tests and delete the temporary package.js even if Ctrl+C is pressed
16+
int_trap() {
17+
echo
18+
echo "Tests interrupted."
19+
}
20+
21+
trap int_trap INT
22+
23+
meteor test-packages ./
24+
25+
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
26+
rm -rf ".build.$PACKAGE_NAME"
27+
rm -rf ".build.local-test:$PACKAGE_NAME"
28+
rm versions.json 2>/dev/null
29+
30+
rm package.js

meteor/test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
Tinytest.add('Instantiation', function(test) {
4+
test.notEqual($.growl, undefined);
5+
});

0 commit comments

Comments
 (0)