]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add packaging for Meteor.js 2059/head
authorDan Dascalescu <ddascalescu+github@gmail.com>
Wed, 19 Nov 2014 11:10:51 +0000 (03:10 -0800)
committerDan Dascalescu <ddascalescu+github@gmail.com>
Wed, 19 Nov 2014 11:10:51 +0000 (03:10 -0800)
.gitignore
README.md
meteor/package.js [new file with mode: 0644]
meteor/publish.sh [new file with mode: 0644]
meteor/runtests.sh [new file with mode: 0644]
meteor/test.js [new file with mode: 0644]

index 5a540d3cf08abfc7ce4a4dce564f956af3b2fc7e..8ec4b029bcb8b11d30913a8891859321a8a3553c 100644 (file)
@@ -6,3 +6,4 @@ min/tests.js
 sauce_connect.log
 .sauce-labs.creds
 npm-debug.log
+.build*
index f5e021995045c4040ccb99b15b8d2fdbc38712c2..6f08e1bc8a90b1dc9cf262f2dd0f3585fc4deb9d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 [![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]
 
-A lightweight javascript date library for parsing, validating, manipulating, and formatting dates.
+A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.
 
 ## [Documentation](http://momentjs.com/docs/)
 
diff --git a/meteor/package.js b/meteor/package.js
new file mode 100644 (file)
index 0000000..637a853
--- /dev/null
@@ -0,0 +1,21 @@
+Package.describe({
+  name: 'moment:moment',
+  summary: 'Moment.js: parse, validate, manipulate, and display dates - official Meteor packaging',
+  version: '2.8.4',
+  git: 'https://github.com/moment/moment.git'
+});
+
+Package.onUse(function (api) {
+  api.versionsFrom('0.9.0');
+  api.addFiles([
+    'moment.js'
+  ], ['client', 'server']
+  );
+});
+
+Package.onTest(function (api) {
+  api.use('moment', ['client', 'server']);
+  api.use('tinytest', ['client', 'server']);
+
+  api.addFiles('meteor/test.js', ['client', 'server']);
+});
diff --git a/meteor/publish.sh b/meteor/publish.sh
new file mode 100644 (file)
index 0000000..749a160
--- /dev/null
@@ -0,0 +1,16 @@
+# Publish package on Meteor's Atmosphere.js
+
+# Make sure Meteor is installed, per https://www.meteor.com/install
+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 "${BASH_SOURCE[0]}" )" && pwd )
+cd DIR/..
+
+# move away the package.js for Dojo
+mv package.js package.dojo
+cp meteor/package.js ./
+
+# publish and restore the Dojo package.js
+meteor publish
+mv package.dojo package.js
diff --git a/meteor/runtests.sh b/meteor/runtests.sh
new file mode 100644 (file)
index 0000000..133ad98
--- /dev/null
@@ -0,0 +1,16 @@
+# Test Meteor package before publishing to Atmosphere.js
+
+# Make sure Meteor is installed, per https://www.meteor.com/install
+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 "${BASH_SOURCE[0]}" )" && pwd )
+cd DIR/..
+
+# move away the package.js for Dojo
+mv package.js package.dojo
+cp meteor/package.js ./
+
+# test and restore the Dojo package.js
+meteor test-packages ./
+mv package.dojo package.js
diff --git a/meteor/test.js b/meteor/test.js
new file mode 100644 (file)
index 0000000..6553a67
--- /dev/null
@@ -0,0 +1,5 @@
+'use strict';
+
+Tinytest.add('Moment.is', function (test) {
+  test.ok(moment.isMoment(moment()), 'simple moment object');
+});