From da5982d37a143bff0f143f6da0c348b5bd884be8 Mon Sep 17 00:00:00 2001 From: Gil Hanan Date: Wed, 21 Sep 2016 13:36:56 +0300 Subject: [PATCH 01/17] refactor(app.css): simplify rules for styling menu item seperator Closes #367 --- app/app.css | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/app.css b/app/app.css index c92524070a..48e881d4ec 100644 --- a/app/app.css +++ b/app/app.css @@ -19,12 +19,7 @@ display: inline; } -.menu > li:before { +.menu > li + li:before { content: "|"; padding-right: 0.3em; } - -.menu > li:nth-child(1):before { - content: ""; - padding: 0; -} From 8f1fb89dac3de6810da7565bedab28ccad29abd8 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Mon, 3 Oct 2016 15:55:09 +0300 Subject: [PATCH 02/17] docs(README.md): fix typo (Stadalone --> Standalone) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21b73ef3c4..5ac193a343 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ This script will execute the end-to-end tests against the application being host development server. **Note:** -Under the hood, Protractor uses the [Selenium Stadalone Server][selenium], which in turn requires +Under the hood, Protractor uses the [Selenium Standalone Server][selenium], which in turn requires the [Java Development Kit (JDK)][jdk] to be installed on your local machine. Check this by running `java -version` from the command line. From 437e0bb3eb1f8fbb7a034ee38e51f474748f6ac7 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Tue, 18 Oct 2016 13:44:17 +0300 Subject: [PATCH 03/17] chore(package): update to Protractor 4.x This also fixes some issues on linux (e.g. angular/angular-phonecat#377). Closes #378 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 95cc9d56fc..48c7f62418 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "karma-firefox-launcher": "^0.1.7", "karma-jasmine": "^0.3.8", "karma-junit-reporter": "^0.4.1", - "protractor": "^3.2.2" + "protractor": "^4.0.9" }, "scripts": { "postinstall": "bower install", From bf7f2a30ea1ff9acb71f97d3cb530f43a239143d Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Mon, 21 Nov 2016 13:12:43 +0200 Subject: [PATCH 04/17] docs(README.md): remove outdated CloudBees integration The CloudBees URL doesn't seem to work any more. And the `CloudBees-community/angular-js-clickstart` (now moved to `CloudBees-attic`) relies on the patched `michaelneale/angular-seed`, which hasn't been updated for ~2.5 years and is more than 40 commits behind `angular/angular-seed`. --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 5ac193a343..40121f7719 100644 --- a/README.md +++ b/README.md @@ -278,15 +278,6 @@ tests when you push to GitHub. You will need to enable the integration between Travis and GitHub. See the Travis website for more instruction on how to do this. -### CloudBees - -CloudBees have provided a CI/deployment setup: - - - - -If you run this, you will get a cloned version of this repo to start working on in a private git repo, -along with a CI service (in Jenkins) hosted that will run unit and end to end tests in both Firefox and Chrome. ## Contact From e48f7f1763be3bdb738e8ae8a96449967f140d78 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Mon, 21 Nov 2016 13:25:21 +0200 Subject: [PATCH 05/17] feat(*): add npm script for updating bower dependencies as well Previously, is was suggested to run `bower update`, which would only work if `bower` was globally installed. Since a global `bower` installation should not be a prerequisite for the seed project, it is now possible to update bower dependencies via the new `update-deps` npm script. Fixes #383 --- README.md | 22 +++++++--------------- package.json | 3 +++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 40121f7719..4920cf3e7a 100644 --- a/README.md +++ b/README.md @@ -185,25 +185,17 @@ If JDK is not already installed, you can download it [here][jdk-download]. ## Updating Angular -Previously we recommended that you merge in changes to angular-seed into your own fork of the project. -Now that the angular framework library code and tools are acquired through package managers (npm and -bower) you can use these tools instead to update the dependencies. - -You can update the tool dependencies by running: - -``` -npm update -``` - -This will find the latest versions that match the version ranges specified in the `package.json` file. - -You can update the Angular dependencies by running: +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: ``` -bower update +npm run update-deps ``` -This will find the latest versions that match the version ranges specified in the `bower.json` file. +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. ## Loading Angular Asynchronously diff --git a/package.json b/package.json index 48c7f62418..13dc019a9c 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,9 @@ "scripts": { "postinstall": "bower install", + "update-deps": "npm update", + "postupdate-deps": "bower update", + "prestart": "npm install", "start": "http-server -a localhost -p 8000 -c-1 ./app", From 970dfae79a3de7f83af8d1410e13f41b94176e1e Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Mon, 21 Nov 2016 13:34:59 +0200 Subject: [PATCH 06/17] docs(README.md): highlight the JDK dependency in the "Depedencies" section --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4920cf3e7a..5092aad23e 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ 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]. +* 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: @@ -139,7 +142,8 @@ npm run test-single-run ``` -### End to end testing + +### Running End-to-End Tests The angular-seed app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests are run with the [Protractor][protractor] End-to-End test runner. It uses native events and has From 9ca17826290e8c7159eb1a2b93494a30ad083a43 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Mon, 21 Nov 2016 13:35:56 +0200 Subject: [PATCH 07/17] docs(README.md): minor typo/wording/style improvements Closes #384 --- README.md | 177 +++++++++++++++++++++++++++--------------------------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 5092aad23e..8d52ba48b7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# angular-seed — the seed for AngularJS apps +# `angular-seed` — the seed for AngularJS apps -This project is an application skeleton for a typical [AngularJS](http://angularjs.org/) web app. -You can use it to quickly bootstrap your angular webapp projects and dev environment for these -projects. +This project is an application skeleton for a typical [AngularJS][angularjs] web app. You can use it +to quickly bootstrap your angular webapp projects and dev environment for these projects. The seed contains a sample AngularJS application and is preconfigured to install the Angular framework and a bunch of development and testing tools for instant web development gratification. @@ -12,28 +11,27 @@ The seed app doesn't do much, just shows how to wire two controllers and views t ## Getting Started -To get you started you can simply clone the angular-seed repository and install the dependencies: +To get you started you can simply clone the `angular-seed` repository and install the dependencies: ### Prerequisites -You need git to clone the angular-seed repository. You can get git from -[http://git-scm.com/](http://git-scm.com/). +You need git to clone the `angular-seed` repository. You can get git from [here][git]. -We also use a number of node.js tools to initialize and test angular-seed. You must have node.js and -its package manager (npm) installed. You can get them from [http://nodejs.org/](http://nodejs.org/). +We also use a number of Node.js tools to initialize and test `angular-seed`. You must have Node.js +and its package manager (npm) installed. You can get them from [here][node]. -### Clone angular-seed +### Clone `angular-seed` -Clone the angular-seed repository using [git][git]: +Clone the `angular-seed` repository using git: ``` git clone https://github.com/angular/angular-seed.git cd angular-seed ``` -If you just want to start a new project without the angular-seed commit history then you can do: +If you just want to start a new project without the `angular-seed` commit history then you can do: -```bash +``` git clone --depth=1 https://github.com/angular/angular-seed.git ``` @@ -41,11 +39,11 @@ The `depth=1` tells git to only pull down one commit worth of historical data. ### Install Dependencies -We have two kinds of dependencies in this project: tools and angular framework code. The tools help +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 via `npm`, the [Node package manager][npm]. +* We get the Angular code via `bower`, a [client-side code package manager][bower]. * 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. @@ -56,27 +54,26 @@ We have preconfigured `npm` to automatically run `bower` so we can simply do: npm install ``` -Behind the scenes this will also call `bower install`. You should find that you have two new -folders in your project. +Behind the scenes this will also call `bower install`. After that, you should find out that you have +two new folders in your project. * `node_modules` - contains the npm packages for the tools we need -* `app/bower_components` - contains the angular framework files +* `app/bower_components` - contains the Angular framework files *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 webserver.* +`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.* ### Run the Application -We have preconfigured the project with a simple development web server. The simplest way to start +We have preconfigured the project with a simple development web server. The simplest way to start this server is: ``` npm start ``` -Now browse to the app at `http://localhost:8000/index.html`. - +Now browse to the app at [`localhost:8000/index.html`][local-app-url]. ## Directory Layout @@ -109,18 +106,19 @@ e2e-tests/ --> end-to-end tests scenarios.js --> end-to-end scenarios to be run by Protractor ``` + ## 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 -The angular-seed app comes preconfigured with unit tests. These are written in -[Jasmine][jasmine], which we run with the [Karma Test Runner][karma]. We provide a Karma -configuration file to run them. +The `angular-seed` app comes preconfigured with unit tests. These are written in [Jasmine][jasmine], +which we run with the [Karma][karma] test runner. We provide a Karma configuration file to run them. -* the configuration is found at `karma.conf.js` -* the unit tests are found next to the code they are testing and are named as `..._test.js`. +* The configuration is found at `karma.conf.js`. +* The unit tests are found next to the code they are testing and have an `_test.js` suffix (e.g. + `view1_test.js`). The easiest way to run the unit tests is to use the supplied npm script: @@ -128,13 +126,14 @@ The easiest way to run the unit tests is to use the supplied npm script: npm test ``` -This script will start the Karma test runner to execute the unit tests. Moreover, Karma will sit and -watch the source and test files for changes and then re-run the tests whenever any of them change. +This script will start the Karma test runner to execute the unit tests. Moreover, Karma will start +watching the source and test files for changes and then re-run the tests whenever any of them +changes. This is the recommended strategy; if your unit tests are being run every time you save a file then you receive instant feedback on any changes that break the expected code functionality. -You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to -check that a particular version of the code is operating as expected. The project contains a +You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to +check that a particular version of the code is operating as expected. The project contains a predefined script to do this: ``` @@ -145,32 +144,34 @@ npm run test-single-run ### Running End-to-End Tests -The angular-seed app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests -are run with the [Protractor][protractor] End-to-End test runner. It uses native events and has +The `angular-seed` app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests +are run with the [Protractor][protractor] End-to-End test runner. It uses native events and has special features for Angular applications. -* the configuration is found at `e2e-tests/protractor-conf.js` -* the end-to-end tests are found in `e2e-tests/scenarios.js` +* The configuration is found at `e2e-tests/protractor-conf.js`. +* The end-to-end tests are found in `e2e-tests/scenarios.js`. Protractor simulates interaction with our web app and verifies that the application responds -correctly. Therefore, our web server needs to be serving up the application, so that Protractor -can interact with it. +correctly. Therefore, our web server needs to be serving up the application, so that Protractor can +interact with it. + +**Before starting Protractor, open a separate terminal window and run:** ``` npm start ``` -In addition, since Protractor is built upon WebDriver we need to install this. The angular-seed -project comes with a predefined script to do this: +In addition, since Protractor is built upon WebDriver, we need to ensure that it is installed and +up-to-date. The `angular-seed` project is configured to do this automatically before running the +end-to-end tests, so you don't need to worry about it. If you want to manually update the WebDriver, +you can run: ``` npm run update-webdriver ``` -This will download and install the latest version of the stand-alone WebDriver tool. - -Once you have ensured that the development web server hosting our application is up and running -and WebDriver is updated, you can run the end-to-end tests using the supplied npm script: +Once you have ensured that the development web server hosting our application is up and running, you +can run the end-to-end tests using the supplied npm script: ``` npm run protractor @@ -180,8 +181,8 @@ This script will execute the end-to-end tests against the application being host development server. **Note:** -Under the hood, Protractor uses the [Selenium Standalone Server][selenium], which in turn requires -the [Java Development Kit (JDK)][jdk] to be installed on your local machine. Check this by running +Under the hood, Protractor uses the [Selenium Standalone Server][selenium], which in turn requires +the [Java Development Kit (JDK)][jdk] to be installed on your local machine. Check this by running `java -version` from the command line. If JDK is not already installed, you can download it [here][jdk-download]. @@ -204,91 +205,91 @@ respectively. ## Loading Angular Asynchronously -The angular-seed project supports loading the framework and application scripts asynchronously. The -special `index-async.html` is designed to support this style of loading. For it to work you must -inject a piece of Angular JavaScript into the HTML page. The project has a predefined script to help -do this. +The `angular-seed` project supports loading the framework and application scripts asynchronously. +The special `index-async.html` is designed to support this style of loading. For it to work you must +inject a piece of Angular JavaScript into the HTML page. The project has a predefined script to help +do this: ``` npm run update-index-async ``` -This will copy the contents of the `angular-loader.js` library file into the `index-async.html` page. -You can run this every time you update the version of Angular that you are using. +This will copy the contents of the `angular-loader.js` library file into the `index-async.html` +page. You can run this every time you update the version of Angular that you are using. ## Serving the Application Files -While angular is client-side-only technology and it's possible to create angular webapps that -don't require a backend server at all, we recommend serving the project files using a local -webserver during development to avoid issues with security restrictions (sandbox) in browsers. The -sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr, -etc to function properly when an html page is opened via `file://` scheme instead of `http://`. - +While Angular is client-side-only technology and it is possible to create Angular web apps that +do not require a backend server at all, we recommend serving the project files using a local +web server during development to avoid issues with security restrictions (sandbox) in browsers. The +sandbox implementation varies between browsers, but quite often prevents things like cookies, XHR, +etc to function properly when an HTML page is opened via the `file://` scheme instead of `http://`. ### Running the App during Development -The angular-seed project comes preconfigured with a local development webserver. It is a node.js -tool called [http-server][http-server]. You can start this webserver with `npm start` but you may choose to -install the tool globally: +The `angular-seed` project comes preconfigured with a local development web server. It is a Node.js +tool called [http-server][http-server]. You can start this web server with `npm start`, but you may +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 a folder by running: ``` http-server -a localhost -p 8000 ``` -Alternatively, you can choose to configure your own webserver, such as apache or nginx. Just +Alternatively, you can choose to configure your own web server, such as Apache or Nginx. Just configure your server to serve the files under the `app/` directory. - ### Running the App in Production This really depends on how complex your app is and the overall infrastructure of your system, but -the general rule is that all you need in production are all the files under the `app/` directory. +the general rule is that all you need in production are the files under the `app/` directory. Everything else should be omitted. -Angular apps are really just a bunch of static html, css and js files that just need to be hosted +Angular apps are really just a bunch of static HTML, CSS and JavaScript files that need to be hosted somewhere they can be accessed by browsers. -If your Angular app is talking to the backend server via xhr or other means, you need to figure -out what is the best way to host the static files to comply with the same origin policy if -applicable. Usually this is done by hosting the files by the backend server or through -reverse-proxying the backend server(s) and webserver(s). +If your Angular app is talking to the backend server via XHR or other means, you need to figure out +what is the best way to host the static files to comply with the same origin policy if applicable. +Usually this is done by hosting the files by the backend server or through reverse-proxying the +backend server(s) and web server(s). ## Continuous Integration ### Travis CI -[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits -to your repository and execute scripts such as building the app or running tests. The angular-seed +[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits to +your repository and execute scripts such as building the app or running tests. The `angular-seed` project contains a Travis configuration file, `.travis.yml`, which will cause Travis to run your tests when you push to GitHub. -You will need to enable the integration between Travis and GitHub. See the Travis website for more -instruction on how to do this. - +You will need to enable the integration between Travis and GitHub. See the +[Travis website][travis-docs] for instructions on how to do this. ## Contact -For more information on AngularJS please check out http://angularjs.org/ +For more information on AngularJS please check out [angularjs.org][angularjs]. + -[bower]: http://bower.io -[git]: http://git-scm.com/ -[http-server]: https://github.com/nodeapps/http-server -[jasmine]: https://jasmine.github.io -[jdk]: https://en.wikipedia.org/wiki/Java_Development_Kit -[jdk-download]: http://www.oracle.com/technetwork/java/javase/downloads/index.html -[karma]: https://karma-runner.github.io -[node]: https://nodejs.org +[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/ +[jdk]: https://wikipedia.org/wiki/Java_Development_Kit +[jdk-download]: http://www.oracle.com/technetwork/java/javase/downloads +[karma]: https://karma-runner.github.io/ +[local-app-url]: http://localhost:8000/index.html +[node]: https://nodejs.org/ [npm]: https://www.npmjs.org/ -[protractor]: https://github.com/angular/protractor +[protractor]: http://www.protractortest.org/ [selenium]: http://docs.seleniumhq.org/ [travis]: https://travis-ci.org/ +[travis-docs]: https://docs.travis-ci.com/user/getting-started From ad58b5d7272a4aab963b3d71ab56ca34dac549b2 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Thu, 25 Aug 2016 17:32:22 +0300 Subject: [PATCH 08/17] refactor(*): rename files and directories to bring in-line with modern best practices Partly addresses #334. --- README.md | 8 ++++---- app/app.js | 2 +- app/{components => core}/version/interpolate-filter.js | 0 .../version/interpolate-filter.spec.js} | 0 app/{components => core}/version/version-directive.js | 0 .../version/version-directive.spec.js} | 0 app/{components => core}/version/version.js | 0 .../version_test.js => core/version/version.spec.js} | 0 app/index-async.html | 6 +++--- app/index.html | 6 +++--- app/view1/{view1_test.js => view1.spec.js} | 0 app/view2/{view2_test.js => view2.spec.js} | 0 karma.conf.js | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename app/{components => core}/version/interpolate-filter.js (100%) rename app/{components/version/interpolate-filter_test.js => core/version/interpolate-filter.spec.js} (100%) rename app/{components => core}/version/version-directive.js (100%) rename app/{components/version/version-directive_test.js => core/version/version-directive.spec.js} (100%) rename app/{components => core}/version/version.js (100%) rename app/{components/version/version_test.js => core/version/version.spec.js} (100%) rename app/view1/{view1_test.js => view1.spec.js} (100%) rename app/view2/{view2_test.js => view2.spec.js} (100%) diff --git a/README.md b/README.md index 8d52ba48b7..4a3223acd0 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ Now browse to the app at [`localhost:8000/index.html`][local-app-url]. ## Directory Layout ``` -app/ --> all of the source files for the application +app/ --> all of the source files for the application app.css --> default stylesheet - components/ --> all app specific modules + core/ --> all app specific modules version/ --> version related components version.js --> version module declaration and basic "version" value service version_test.js --> "version" value service tests @@ -117,8 +117,8 @@ The `angular-seed` app comes preconfigured with unit tests. These are written in which we run with the [Karma][karma] test runner. We provide a Karma configuration file to run them. * The configuration is found at `karma.conf.js`. -* The unit tests are found next to the code they are testing and have an `_test.js` suffix (e.g. - `view1_test.js`). +* The unit tests are found next to the code they are testing and have a `.spec.js` suffix (e.g. + `view1.spec.js`). The easiest way to run the unit tests is to use the supplied npm script: diff --git a/app/app.js b/app/app.js index 6ea2401bcd..3a0ca2557e 100644 --- a/app/app.js +++ b/app/app.js @@ -1,6 +1,6 @@ 'use strict'; -// Declare app level module which depends on views, and components +// Declare app level module which depends on views, and core components angular.module('myApp', [ 'ngRoute', 'myApp.view1', diff --git a/app/components/version/interpolate-filter.js b/app/core/version/interpolate-filter.js similarity index 100% rename from app/components/version/interpolate-filter.js rename to app/core/version/interpolate-filter.js diff --git a/app/components/version/interpolate-filter_test.js b/app/core/version/interpolate-filter.spec.js similarity index 100% rename from app/components/version/interpolate-filter_test.js rename to app/core/version/interpolate-filter.spec.js diff --git a/app/components/version/version-directive.js b/app/core/version/version-directive.js similarity index 100% rename from app/components/version/version-directive.js rename to app/core/version/version-directive.js diff --git a/app/components/version/version-directive_test.js b/app/core/version/version-directive.spec.js similarity index 100% rename from app/components/version/version-directive_test.js rename to app/core/version/version-directive.spec.js diff --git a/app/components/version/version.js b/app/core/version/version.js similarity index 100% rename from app/components/version/version.js rename to app/core/version/version.js diff --git a/app/components/version/version_test.js b/app/core/version/version.spec.js similarity index 100% rename from app/components/version/version_test.js rename to app/core/version/version.spec.js diff --git a/app/index-async.html b/app/index-async.html index 281254ed11..ee903b7dcc 100644 --- a/app/index-async.html +++ b/app/index-async.html @@ -33,9 +33,9 @@ 'app.js', 'view1/view1.js', 'view2/view2.js', - 'components/version/version.js', - 'components/version/version-directive.js', - 'components/version/interpolate-filter.js' + 'core/version/version.js', + 'core/version/version-directive.js', + 'core/version/interpolate-filter.js' ], function() { // when all is done, execute bootstrap angular application angular.bootstrap(document, ['myApp']); diff --git a/app/index.html b/app/index.html index ec9da03650..91c0b55126 100644 --- a/app/index.html +++ b/app/index.html @@ -36,8 +36,8 @@ - - - + + + 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 09/17] 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 @@ - - + + - + +