From 324e83941647ad0fa243dce4255934d83e614fd9 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Wed, 19 Nov 2014 03:10:51 -0800 Subject: [PATCH] Add packaging for Meteor.js --- .gitignore | 1 + README.md | 2 +- meteor/package.js | 21 +++++++++++++++++++++ meteor/publish.sh | 16 ++++++++++++++++ meteor/runtests.sh | 16 ++++++++++++++++ meteor/test.js | 5 +++++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 meteor/package.js create mode 100644 meteor/publish.sh create mode 100644 meteor/runtests.sh create mode 100644 meteor/test.js diff --git a/.gitignore b/.gitignore index 5a540d3cf..8ec4b029b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ min/tests.js sauce_connect.log .sauce-labs.creds npm-debug.log +.build* diff --git a/README.md b/README.md index f5e021995..6f08e1bc8 100644 --- 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 index 000000000..637a85383 --- /dev/null +++ b/meteor/package.js @@ -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 index 000000000..749a1600b --- /dev/null +++ b/meteor/publish.sh @@ -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 index 000000000..133ad98da --- /dev/null +++ b/meteor/runtests.sh @@ -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 index 000000000..6553a6717 --- /dev/null +++ b/meteor/test.js @@ -0,0 +1,5 @@ +'use strict'; + +Tinytest.add('Moment.is', function (test) { + test.ok(moment.isMoment(moment()), 'simple moment object'); +}); -- 2.47.2