From bae1a38990e3696bf76bc547d6b39033a4adc543 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Tue, 15 Sep 2015 12:58:31 +0100 Subject: [PATCH 1/3] chore(npm): Add support for npm and commonjs --- .npmignore | 7 +++++++ README.md | 8 +++++++- index.js | 2 ++ package.json | 6 ++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .npmignore create mode 100644 index.js diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..ce9e8c7 --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +demo +src +test +bower.json +Gruntfile.js +karma-e2e.conf.js +karma.conf.js diff --git a/README.md b/README.md index b7584e9..9b4d9f6 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,16 @@ AngularJS directive for the [JustGage](http://justgage.com/) gauge. ## Installation +### Bower ```shell $ bower install angular-gage ``` +### NPM +```shell +$ npm install angular-gage +``` + ## Usage The directive tag is `justgage`, but you can also use it as an attribute or as a class name. `angular-gage` implements @@ -100,4 +106,4 @@ Francesco Pontillo () See the License for the specific language governing permissions and limitations under the License. -``` \ No newline at end of file +``` diff --git a/index.js b/index.js new file mode 100644 index 0000000..4bc7f8d --- /dev/null +++ b/index.js @@ -0,0 +1,2 @@ +require('./dist/angular-gage'); +module.exports = 'frapontillo.gage'; diff --git a/package.json b/package.json index 401339b..6641cac 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,12 @@ "name": "angular-gage", "version": "0.1.0", "dependencies": {}, + "peerDependencies": { + "angular": ">=1.3.0", + "raphael": "^2.1.4", + "justgage": "^1.1.0" + }, + "browser": "index.js", "devDependencies": { "grunt": "~0.4.1", "grunt-autoprefixer": "~0.4.0", From a3401ac13779bb929ea37367f1c6bc53656e2923 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Sat, 27 Feb 2016 18:30:06 +0000 Subject: [PATCH 2/3] test(commonjs): add a test for the commonjs module name --- karma.conf.js | 4 ++++ package.json | 16 +++++++++------- test/spec/justgageSpec.js | 11 +++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 test/spec/justgageSpec.js diff --git a/karma.conf.js b/karma.conf.js index dfe5bdb..7c59de7 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -19,6 +19,10 @@ module.exports = function(config) { 'test/spec/**/*.js' ], + preprocessors: { + 'test/spec/justgageSpec.js': ['webpack'] + }, + // list of files / patterns to exclude exclude: [], diff --git a/package.json b/package.json index 6641cac..99454e0 100644 --- a/package.json +++ b/package.json @@ -24,21 +24,23 @@ "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-watch": "~0.5.2", "grunt-google-cdn": "~0.2.0", + "grunt-karma": "^0.8.3", "grunt-newer": "~0.6.1", "grunt-ngmin": "~0.0.2", "grunt-rev": "~0.1.0", "grunt-svgmin": "~0.2.0", "grunt-usemin": "~2.0.0", "jshint-stylish": "~0.1.3", - "load-grunt-tasks": "~0.4.0", - "time-grunt": "~0.2.1", - "karma-ng-scenario": "^0.1.0", - "grunt-karma": "^0.8.3", - "karma": "^0.12.16", - "karma-ng-html2js-preprocessor": "^0.1.0", + "karma": "~0.13.21", + "karma-chrome-launcher": "^0.1.3", "karma-jasmine": "^0.1.5", + "karma-ng-html2js-preprocessor": "^0.1.0", + "karma-ng-scenario": "^0.1.0", "karma-phantomjs-launcher": "^0.1.4", - "karma-chrome-launcher": "^0.1.3" + "karma-webpack": "~1.7.0", + "load-grunt-tasks": "~0.4.0", + "time-grunt": "~0.2.1", + "webpack": "~1.12.14" }, "engines": { "node": ">=0.10.0" diff --git a/test/spec/justgageSpec.js b/test/spec/justgageSpec.js new file mode 100644 index 0000000..88a3d7e --- /dev/null +++ b/test/spec/justgageSpec.js @@ -0,0 +1,11 @@ +'use strict'; + +describe('Module: justgage', function () { + + it('should export the module name', function () { + + expect(require('./../../index')).toEqual('frapontillo.gage'); + + }); + +}); From 15faee2ffdd73774233debb4a0414f33b90a13de Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Wed, 2 Mar 2016 09:25:14 +0000 Subject: [PATCH 3/3] chore(dependencies): upgrade grunt-karma --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99454e0..cf0e158 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-watch": "~0.5.2", "grunt-google-cdn": "~0.2.0", - "grunt-karma": "^0.8.3", + "grunt-karma": "~0.12.1", "grunt-newer": "~0.6.1", "grunt-ngmin": "~0.0.2", "grunt-rev": "~0.1.0",