From 239b5157baa9cf2fd99b471ab53580d58aabea9d Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Sat, 21 May 2016 14:56:45 +0300 Subject: [PATCH 01/28] chore(*): update dependencies and configuration files Closes #341 --- .jshintrc | 23 +++++++++++++++++------ .travis.yml | 2 +- bower.json | 9 ++++----- e2e-tests/protractor.conf.js | 3 +++ karma.conf.js | 35 ++++++++++++++++++----------------- package.json | 22 +++++++++++----------- 6 files changed, 54 insertions(+), 40 deletions(-) diff --git a/.jshintrc b/.jshintrc index 6f00218e37..60f49fd369 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,13 +1,24 @@ { - "globalstrict": true, + "strict": "global", "globals": { + // Angular "angular": false, + + // Angular mocks + "module": false, + "inject": false, + + // Jasmine + "jasmine": false, "describe": false, - "it": false, - "expect": false, "beforeEach": false, "afterEach": false, - "module": false, - "inject": false + "it": false, + "expect": false, + + // Protractor + "browser": false, + "element": false, + "by": false } -} \ No newline at end of file +} diff --git a/.travis.yml b/.travis.yml index cce5c682a8..a549d113c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "0.10" + - '4.4' before_script: - export DISPLAY=:99.0 diff --git a/bower.json b/bower.json index 5234f47856..ffbbeccaca 100644 --- a/bower.json +++ b/bower.json @@ -6,10 +6,9 @@ "license": "MIT", "private": true, "dependencies": { - "angular": "~1.4.0", - "angular-route": "~1.4.0", - "angular-loader": "~1.4.0", - "angular-mocks": "~1.4.0", - "html5-boilerplate": "~5.2.0" + "angular": "~1.5.0", + "angular-route": "~1.5.0", + "angular-loader": "~1.5.0", + "angular-mocks": "~1.5.0" } } diff --git a/e2e-tests/protractor.conf.js b/e2e-tests/protractor.conf.js index b45a117aa5..00893f98ef 100644 --- a/e2e-tests/protractor.conf.js +++ b/e2e-tests/protractor.conf.js @@ -1,4 +1,6 @@ +//jshint strict: false exports.config = { + allScriptsTimeout: 11000, specs: [ @@ -16,4 +18,5 @@ exports.config = { jasmineNodeOpts: { defaultTimeoutInterval: 30000 } + }; diff --git a/karma.conf.js b/karma.conf.js index 44bb29f1ab..7271e9fef8 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,30 +1,31 @@ -module.exports = function(config){ +//jshint strict: false +module.exports = function(config) { config.set({ - basePath : './', + basePath: './app', - files : [ - 'app/bower_components/angular/angular.js', - 'app/bower_components/angular-route/angular-route.js', - 'app/bower_components/angular-mocks/angular-mocks.js', - 'app/components/**/*.js', - 'app/view*/**/*.js' + files: [ + 'bower_components/angular/angular.js', + 'bower_components/angular-route/angular-route.js', + 'bower_components/angular-mocks/angular-mocks.js', + 'components/**/*.js', + 'view*/**/*.js' ], - autoWatch : true, + autoWatch: true, frameworks: ['jasmine'], - browsers : ['Chrome'], + browsers: ['Chrome'], - plugins : [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-jasmine', - 'karma-junit-reporter' - ], + plugins: [ + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-jasmine', + 'karma-junit-reporter' + ], - junitReporter : { + junitReporter: { outputFile: 'test_out/unit.xml', suite: 'unit' } diff --git a/package.json b/package.json index d0edbc8b61..8d4ee1f79d 100644 --- a/package.json +++ b/package.json @@ -6,16 +6,16 @@ "repository": "https://github.com/angular/angular-seed", "license": "MIT", "devDependencies": { - "bower": "^1.3.1", - "http-server": "^0.6.1", - "jasmine-core": "^2.3.4", - "karma": "~0.12", - "karma-chrome-launcher": "^0.1.12", - "karma-firefox-launcher": "^0.1.6", - "karma-jasmine": "^0.3.5", - "karma-junit-reporter": "^0.2.2", - "protractor": "^2.1.0", - "shelljs": "^0.2.6" + "bower": "^1.7.7", + "http-server": "^0.9.0", + "jasmine-core": "^2.4.1", + "karma": "^0.13.22", + "karma-chrome-launcher": "^0.2.3", + "karma-firefox-launcher": "^0.1.7", + "karma-jasmine": "^0.3.8", + "karma-junit-reporter": "^0.4.1", + "protractor": "^3.2.2", + "shelljs": "^0.6.0" }, "scripts": { "postinstall": "bower install", @@ -25,7 +25,7 @@ "pretest": "npm install", "test": "karma start karma.conf.js", - "test-single-run": "karma start karma.conf.js --single-run", + "test-single-run": "karma start karma.conf.js --single-run", "preupdate-webdriver": "npm install", "update-webdriver": "webdriver-manager update", From aabd39b7d3d38fe27221dfefceb8a2b361f6da08 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Sun, 22 May 2016 00:14:04 +0300 Subject: [PATCH 02/28] chore(*): serve from the `app/` directory Closes #341 --- README.md | 2 +- e2e-tests/protractor.conf.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e7aece1083..c0deb480c9 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ this server is: npm start ``` -Now browse to the app at `http://localhost:8000/app/index.html`. +Now browse to the app at `http://localhost:8000/index.html`. diff --git a/e2e-tests/protractor.conf.js b/e2e-tests/protractor.conf.js index 00893f98ef..13c5cb6266 100644 --- a/e2e-tests/protractor.conf.js +++ b/e2e-tests/protractor.conf.js @@ -11,7 +11,7 @@ exports.config = { 'browserName': 'chrome' }, - baseUrl: 'http://localhost:8000/app/', + baseUrl: 'http://localhost:8000/', framework: 'jasmine', diff --git a/package.json b/package.json index 8d4ee1f79d..81b7aaf285 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "postinstall": "bower install", "prestart": "npm install", - "start": "http-server -a localhost -p 8000 -c-1", + "start": "http-server -a localhost -p 8000 -c-1 ./app", "pretest": "npm install", "test": "karma start karma.conf.js", From a0f087568ee7ad889ad9a717f99e71c255172aed Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Sun, 22 May 2016 00:29:15 +0300 Subject: [PATCH 03/28] chore(*): use `!` as hash-prefix Closes #341 --- app/app.js | 4 +++- app/index-async.html | 4 ++-- app/index.html | 4 ++-- bower.json | 3 ++- e2e-tests/scenarios.js | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/app.js b/app/app.js index 21eccdb8ea..6ea2401bcd 100644 --- a/app/app.js +++ b/app/app.js @@ -7,6 +7,8 @@ angular.module('myApp', [ 'myApp.view2', 'myApp.version' ]). -config(['$routeProvider', function($routeProvider) { +config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { + $locationProvider.hashPrefix('!'); + $routeProvider.otherwise({redirectTo: '/view1'}); }]); diff --git a/app/index-async.html b/app/index-async.html index a559b7168e..39a592fb57 100644 --- a/app/index-async.html +++ b/app/index-async.html @@ -46,8 +46,8 @@
diff --git a/app/index.html b/app/index.html index 3c4bb6b02e..ec9da03650 100644 --- a/app/index.html +++ b/app/index.html @@ -16,8 +16,8 @@ "end-to-end") This test refers to general end-to-end tests. Closes #235 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0deb480c9..9e59370c3c 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ e2e-tests/ --> end-to-end tests ## Testing -There are two kinds of tests in the angular-seed application: Unit tests and End to End tests. +There are two kinds of tests in the angular-seed application: Unit tests and end-to-end tests. ### Running Unit Tests From 18a925eb74efcbb34d0e05576234b5d5fb43b8d8 Mon Sep 17 00:00:00 2001 From: Alexander Belov Date: Fri, 1 May 2015 16:46:47 +0300 Subject: [PATCH 07/28] docs(LICENSE): update copyright year to 2016 Closes #269 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 9ced331955..b8de5aae83 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2010-2014 Google, Inc. http://angularjs.org +Copyright (c) 2010-2016 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 11d1b59d14cd87a7944f8cf0ca075c24a5cc9622 Mon Sep 17 00:00:00 2001 From: Stanislav Termosa Date: Tue, 16 Aug 2016 12:00:22 +0300 Subject: [PATCH 08/28] fix(index-async): correct html5-boilerplate paths Paths to html5-boilerplate resource were configured incorrectly. These paths are corrected. Closes #356 --- app/index-async.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/index-async.html b/app/index-async.html index 39a592fb57..281254ed11 100644 --- a/app/index-async.html +++ b/app/index-async.html @@ -2,14 +2,14 @@ - - + + - + - - - + + + diff --git a/app/view1/view1_test.js b/app/view1/view1.spec.js similarity index 100% rename from app/view1/view1_test.js rename to app/view1/view1.spec.js diff --git a/app/view2/view2_test.js b/app/view2/view2.spec.js similarity index 100% rename from app/view2/view2_test.js rename to app/view2/view2.spec.js diff --git a/karma.conf.js b/karma.conf.js index 7271e9fef8..eadf08bca3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -8,7 +8,7 @@ module.exports = function(config) { 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route.js', 'bower_components/angular-mocks/angular-mocks.js', - 'components/**/*.js', + 'core/**/*.js', 'view*/**/*.js' ], From 669efccf7f23a539e0a03fdc011f8619c5635820 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Wed, 7 Dec 2016 13:26:43 +0200 Subject: [PATCH 20/28] chore(*): switch from `bower` to `npm` for frontend dependencies Closes #385 Closes #389 --- .bowerrc | 3 --- .gitignore | 2 +- .travis.yml | 2 +- README.md | 30 +++++++++++++----------------- app/index-async.html | 10 +++++----- app/index.html | 10 +++++----- bower.json | 15 --------------- karma.conf.js | 6 +++--- package.json | 22 ++++++++++++---------- 9 files changed, 40 insertions(+), 60 deletions(-) delete mode 100644 .bowerrc delete mode 100644 bower.json diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index 8c58c8efc9..0000000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "app/bower_components" -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index b702acc68f..bcecdc7669 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ logs/* !.gitkeep node_modules/ -bower_components/ +app/lib/ tmp .DS_Store .idea \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 78680206f9..7cd8405390 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ dist: trusty language: node_js node_js: - - '4.5' + - 6 install: - export DISPLAY=:99.0 diff --git a/README.md b/README.md index 4a3223acd0..51d57ab8b0 100644 --- a/README.md +++ b/README.md @@ -42,27 +42,26 @@ The `depth=1` tells git to only pull down one commit worth of historical data. We have two kinds of dependencies in this project: tools and Angular framework code. The tools help us manage and test the application. -* We get the tools we depend upon via `npm`, the [Node package manager][npm]. -* We get the Angular code via `bower`, a [client-side code package manager][bower]. +* We get the tools we depend upon and the Angular code via `npm`, the [Node package manager][npm]. * In order to run the end-to-end tests, you will also need to have the [Java Development Kit (JDK)][jdk] installed on your machine. Check out the section on [end-to-end testing](#e2e-testing) for more info. -We have preconfigured `npm` to automatically run `bower` so we can simply do: +We have preconfigured `npm` to automatically copy the downloaded Angular files to `app/lib` so we +can simply do: ``` npm install ``` -Behind the scenes this will also call `bower install`. After that, you should find out that you have -two new folders in your project. +Behind the scenes this will also call `npm run copy-libs`, which copies the AngularJS files and other +front end dependencies. After that, you should find out that you have two new directories in your project. * `node_modules` - contains the npm packages for the tools we need -* `app/bower_components` - contains the Angular framework files +* `app/lib` - contains the Angular framework files and other front end dependencies -*Note that the `bower_components` folder would normally be installed in the root folder but -`angular-seed` changes this location through the `.bowerrc` file. Putting it in the `app` folder -makes it easier to serve the files by a web server.* +*Note copying the Angular files from `node_modules` to `app/lib` makes it easier to serve the files +by a web server.* ### Run the Application @@ -190,17 +189,15 @@ If JDK is not already installed, you can download it [here][jdk-download]. ## Updating Angular -Since the Angular framework library code and tools are acquired through package managers (npm and -bower) you can use these tools to easily update the dependencies. Simply run the preconfigured -script: +Since the AngularJS framework library code and tools are acquired through package managers (e.g. +npm) you can use these tools to easily update the dependencies. Simply run the preconfigured script: ``` npm run update-deps ``` -This will call `npm update` and `bower update`, which in turn will find and install the latest -versions that match the version ranges specified in the `package.json` and `bower.json` files -respectively. +This will call `npm update` and `npm run copy-libs`, which in turn will find and install the latest +versions that match the version ranges specified in the `package.json` file. ## Loading Angular Asynchronously @@ -236,7 +233,7 @@ choose to install the tool globally: sudo npm install -g http-server ``` -Then you can start your own development web server to serve static files from a folder by running: +Then you can start your own development web server to serve static files from any folder by running: ``` http-server -a localhost -p 8000 @@ -279,7 +276,6 @@ For more information on AngularJS please check out [angularjs.org][angularjs]. [angularjs]: https://angularjs.org/ -[bower]: http://bower.io/ [git]: https://git-scm.com/ [http-server]: https://github.com/indexzero/http-server [jasmine]: https://jasmine.github.io/ diff --git a/app/index-async.html b/app/index-async.html index ee903b7dcc..72e202ea78 100644 --- a/app/index-async.html +++ b/app/index-async.html @@ -2,14 +2,14 @@ - - + + - + +