From 5679c279a534d472ab71d71a601594b5aac79f22 Mon Sep 17 00:00:00 2001 From: Gregory Pike Date: Mon, 23 Sep 2013 12:40:30 -0400 Subject: [PATCH 1/7] Changed license to MIT --- LICENSE | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/LICENSE b/LICENSE index 7b917a8..cd18384 100644 --- a/LICENSE +++ b/LICENSE @@ -1,14 +1,8 @@ Angular Local Storage Copyright 2013 Gregory Pike -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - http://www.apache.org/licenses/LICENSE-2.0 +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From 04801ee5d6e70ff948afffe6ac43c60aef7b5d62 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Mon, 23 Sep 2013 10:30:03 -0700 Subject: [PATCH 2/7] Add bower.json file --- bower.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 bower.json diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..950232e --- /dev/null +++ b/bower.json @@ -0,0 +1,23 @@ +{ + "name": "angular-local-storage", + "version": "0.0.1", + "homepage": "http://gregpike.net/demos/angular-local-storage/demo.html", + "authors": [ + "grevory " + ], + "description": "An Angular module that gives you access to the browsers local storage", + "main": "localStorageModule.js", + "keywords": [ + "AngularJS", + "Local", + "Storage" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} From 6b62d711eae3427015b77ffe66581670fa625f54 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Mon, 23 Sep 2013 11:47:56 -0700 Subject: [PATCH 3/7] add package.json file to manage dependencies --- package.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..296ef19 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "angular-local-storage", + "version": "0.0.1", + "description": "An Angular module that gives you access to the browsers local storage", + "main": "localStorageModule.js", + "scripts": { + "test": "" + }, + "repository": { + "type": "git", + "url": "https://github.com/grevory/angular-local-storage.git" + }, + "keywords": [ + "AngularJS", + "local", + "storage" + ], + "author": "grevory ", + "license": "MIT", + "bugs": { + "url": "https://github.com/grevory/angular-local-storage/issues" + } +} From 8e44da5b4b280702d7adfe981b2f6255b132df30 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Mon, 23 Sep 2013 11:52:48 -0700 Subject: [PATCH 4/7] move demos to their own folder to keep repo cleaner --- demo-app.js => demo/demo-app.js | 0 demo-style.css => demo/demo-style.css | 0 demo.html => demo/demo.html | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename demo-app.js => demo/demo-app.js (100%) rename demo-style.css => demo/demo-style.css (100%) rename demo.html => demo/demo.html (98%) diff --git a/demo-app.js b/demo/demo-app.js similarity index 100% rename from demo-app.js rename to demo/demo-app.js diff --git a/demo-style.css b/demo/demo-style.css similarity index 100% rename from demo-style.css rename to demo/demo-style.css diff --git a/demo.html b/demo/demo.html similarity index 98% rename from demo.html rename to demo/demo.html index a632809..15bf0b4 100644 --- a/demo.html +++ b/demo/demo.html @@ -131,7 +131,7 @@ var YourCtrl = function($scope, localStorageService, ...) { - + - \ No newline at end of file + From edacb757326d8f1c17f743ddfe0a13a46e58b5e7 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Mon, 23 Sep 2013 12:42:51 -0700 Subject: [PATCH 5/7] add git files to the repo --- .gitattributes | 1 + .gitignore | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c65e488 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +.tmp +.DS_Store +npm-debug.log + From 3a4436f5afc53d1db6cc8408ebd1959ad95ed179 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Mon, 23 Sep 2013 14:01:30 -0700 Subject: [PATCH 6/7] Add Grunt to automate testing and linting. Add Karma to run tests --- .bowerrc | 3 +++ .gitignore | 1 + Gruntfile.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++ bower.json | 6 +++++- package.json | 12 ++++++++++- test/.jshintrc | 35 ++++++++++++++++++++++++++++++ test/karma.conf.js | 49 ++++++++++++++++++++++++++++++++++++++++++ test/spec/test.js | 12 +++++++++++ 8 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 .bowerrc create mode 100644 Gruntfile.js create mode 100644 test/.jshintrc create mode 100644 test/karma.conf.js create mode 100644 test/spec/test.js diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..be32f74 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "test/lib/bower_components" +} diff --git a/.gitignore b/.gitignore index c65e488..89009c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules +bower_components .tmp .DS_Store npm-debug.log diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..887813e --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,53 @@ +module.exports = function(grunt) { + 'use strict'; + + // Load the grunt tasks + require('load-grunt-tasks')(grunt); + + // Time the grunt tasks + require('time-grunt')(grunt); + + grunt.initConfig({ + karma: { + options: { + autowatch: false, + browsers: [ + 'PhantomJS' + ], + configFile: 'test/karma.conf.js', + reporters: [ 'dots' ], + singleRun: true + }, + unit: {} + }, + jshint: { + grunt: { + src: [ 'Gruntfile.js' ], + options: { + node: true + } + }, + dev: { + src: [ 'localStorageModule.js' ], + options: { + jshintrc: '.jshintrc', + } + }, + test: { + src: [ 'test/spec/**/*.js' ], + options: { + jshintrc: 'test/.jshintrc', + } + } + } + }); + + grunt.registerTask('test', [ + 'karma' + ]); + + grunt.registerTask('default', [ + 'jshint', + 'test' + ]); +}; diff --git a/bower.json b/bower.json index 950232e..f2d8cef 100644 --- a/bower.json +++ b/bower.json @@ -19,5 +19,9 @@ "bower_components", "test", "tests" - ] + ], + "devDependencies": { + "angularjs": "*", + "angular-mocks": "~1.0.8" + } } diff --git a/package.json b/package.json index 296ef19..5453049 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "An Angular module that gives you access to the browsers local storage", "main": "localStorageModule.js", "scripts": { - "test": "" + "test": "grunt test" }, "repository": { "type": "git", @@ -19,5 +19,15 @@ "license": "MIT", "bugs": { "url": "https://github.com/grevory/angular-local-storage/issues" + }, + "dependencies": { + "grunt": "~0.4.1", + "grunt-cli": "~0.1.9" + }, + "devDependencies": { + "time-grunt": "~0.1.1", + "load-grunt-tasks": "~0.1.0", + "grunt-karma": "~0.6.2", + "grunt-contrib-jshint": "~0.6.4" } } diff --git a/test/.jshintrc b/test/.jshintrc new file mode 100644 index 0000000..aa37e7a --- /dev/null +++ b/test/.jshintrc @@ -0,0 +1,35 @@ +{ + "node": true, + "browser": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "regexp": true, + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "globals": { + "after": false, + "afterEach": false, + "angular": false, + "before": false, + "beforeEach": false, + "browser": false, + "describe": false, + "expect": false, + "inject": false, + "it": false, + "spyOn": false + } +} + diff --git a/test/karma.conf.js b/test/karma.conf.js new file mode 100644 index 0000000..a3e93a2 --- /dev/null +++ b/test/karma.conf.js @@ -0,0 +1,49 @@ +// Karma configuration +// http://karma-runner.github.io/0.10/config/configuration-file.html + +module.exports = function(config) { + 'use strict'; + + var bower = 'test/lib/bower_components/'; + + config.set({ + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + // base path, that will be used to resolve files and exclude + basePath: '../', + + // Start these browsers, currently available: + // - Chrome + // - ChromeCanary + // - Firefox + // - Opera + // - Safari (only Mac) + // - PhantomJS + // - IE (only Windows) + browsers: ['Chrome'], + + // list of files / patterns to load in the browser + files: [ + bower + 'angular/angular.js', + bower + 'angular-mocks/angular-mocks.js', + 'localStorageModule.js', + 'test/spec/**/*.js' + ], + + // testing framework to use (jasmine/mocha/qunit/...) + frameworks: ['jasmine'], + + // level of logging + // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG + logLevel: config.LOG_INFO, + + // web server port + port: 8080, + + // Continuous Integration mode + // if true, it capture browsers, run tests and exit + singleRun: false + }); +}; diff --git a/test/spec/test.js b/test/spec/test.js new file mode 100644 index 0000000..08cefc6 --- /dev/null +++ b/test/spec/test.js @@ -0,0 +1,12 @@ +describe('Module: LocalStorageModule', function() { + 'use strict'; + + // Load the Angular module + beforeEach(module('LocalStorageModule')); + + describe('constants', function() { + it('reads the constants', function() { + expect(true).toBe(true); + }); + }); +}); From 4079d517a07aa19447e0263aa3f0dc4342fbfdf1 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Tue, 24 Sep 2013 12:14:17 -0700 Subject: [PATCH 7/7] rename file to be more angular descriptive --- localStorageModule.js => angular-local-storage.js | 0 bower.json | 2 +- package.json | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename localStorageModule.js => angular-local-storage.js (100%) diff --git a/localStorageModule.js b/angular-local-storage.js similarity index 100% rename from localStorageModule.js rename to angular-local-storage.js diff --git a/bower.json b/bower.json index f2d8cef..7a1e055 100644 --- a/bower.json +++ b/bower.json @@ -6,7 +6,7 @@ "grevory " ], "description": "An Angular module that gives you access to the browsers local storage", - "main": "localStorageModule.js", + "main": "angular-local-storage.js", "keywords": [ "AngularJS", "Local", diff --git a/package.json b/package.json index 5453049..e065a85 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "angular-local-storage", "version": "0.0.1", "description": "An Angular module that gives you access to the browsers local storage", - "main": "localStorageModule.js", + "main": "angular-local-storage.js", "scripts": { "test": "grunt test" },