Skip to content

Commit ef55140

Browse files
authored
First CI workflow (#3)
* the initial version * updated jasmine adapter to newer version * upgrade to angular 0.9.10 and update the code with angular API changes * upgrade to angular 0.9-10 * move jsTestDriver.conf into config/ directory * upgrading angular to 0.9.12 thought-implanter * angular 0.9.12 $hover service fix * angular 0.9.12 leftover .scope call fix * default to utf8 charset * jstd 1.3.1+ and jasmine-jstd-adapter upgrade * improving the test-server.sh console output * switching scripts/test.sh from sh to bash * updating angular to 0.9.13 curdling-stare * upgrading angular to 0.9.14 key-maker * removing display:none + ng:show from index.html the best practice is not to use angular markup in index.html so the hide/show thing is not needed. instead of <div>{{foo}}</div> use <div ng:bind="foo"></div> in index.html. In other templates it is totally fine to use markup. * fix typo in controllers.js placeholder code * upgrading to angular 0.9.15 lethal-stutter * add index.html to the seed layout docs * Added windows .bat equivalents to .sh scripts for running tests * improving the windows bat scripts * update readme with windows info * making the windows script crlf delimited * angular 0.9.16 weather-control * Add jstd-scenario-adapter so we can run e2e tests with JsTD Added basic configuration, so all you need to run e2e tests: 1/ start web server in project root >> ./scripts/web-server.js 2/ start JsTD server >> ./scripts/e2e-test-server.sh 3/ capture some browser navigate to http://localhost:9877/capture 4/ run the tests >> ./scripts/e2e-test.sh * Update scripts for running tests - change forward slash into back slash in Win scripts - split params to new lines - remove $tests option as it makes no sense now * Missing semi-colons * upgrade to angular 0.9.17 vegetable-reanimation * upgrade to angular 0.9.18 jiggling-armfat * upgrade to angular 0.9.19 canine-psychokinesis * Fixed two small typos in scripts/web-server.js. * upgrade to AngularJS 0.10.0 chicken-hands * upgrade to AnuglarJS 0.10.6 bubblewrap-cape * upgrade to 0.10.6 final * remove extra ng:app from async template * add inlined ng:cloak definition to the async template * Update angular to 1.0.0-rc1 * Update jasmine to 1.1.0 * Update seed app * Fix broken references to widgets and make template IE friendly * upgrade seed to 1.0.0rc2 silence-absorption * upgrade to 1.0.0rc3 barefoot-telepathy * upgrade to angular 1.0.0rc4 insomnia-induction * upgrade to angular 1.0.0rc5 reality-distortion * upgrade to AngularJS 1.0.0rc6 runny-nose * various fixes * update the jasmine-jstd-adapter with fixes * Fix extraneous " in doctype tag. Changed ng:autotest to ng-autotest * upgrade to AngularJS 1.0.0rc7 rc-generation * upgrade to AngularJS 1.0.0rc8 blooming-touch * upgrade to AngularJS 1.0.0rc eggplant-teleportation * fix typo in sample e2e test * upgrade to AngularJS 1.0.0rc10 tesseract-giftwrapping * upgrade to AngularJS 1.0.0rc11 promise-resolution * migrate code to 1.0.0rc11 * upgrade to AngularJS 1.0.0rc12 * upgrading AngularJS to 1.0 * upgrade angular to 1.0.1 * upgrade to AngularJS 1.0.2 * add link to CDN to index.html * switch over to using Testacular for E2E tests * switch over to using Testacular for running unit tests * improve wildcards in testacular configs * pass arguments through test.sh and e2e-test.sh * add junit reporter to testacular configs * Update windows scripts to use Testacular * sync README with code * Added global flag to path replace function in handleRequest to allow more than one space (aka %20) in the name * Update to node 0.8 : "sys" is now called "util". Simple text and replace and it works on node 0.8. * Update README.md file * add 'svg' MIME type to web-server * remove obsolete test-server scripts * upgrade to AngularJS 1.0.3 bouncy-thunder * add missing ng-cloak directive * upgrade to angular 1.0.4 * update angular to 1.0.5 * Added link to clickstart * upgrade to angular 1.0.6 universal-irreversibility * shift to karma from testacular * fixed capitalisation of Karma and links corrected * update CDN link index.html to 1.0.6 * travis-ci config for unit and e2e tests * Made runner.html to use utf-8 charset * Moved global controllers to module * Switch to one global .gitignore * Remove dev tools specific files from .gitignore There are infinite dev tools with infinite kinds of files they generate. Instead of putting every possible entry to the project's .gitignore file, a user should create her own global .gitignore with entries specific to the tools used by her. * correct "logs/*" entry in .gitignore * "testacular" -> "karma" in travis config * upgrade to angular 1.0.7 monochromatic-rainbow * upgrade angular-loader to v1.0.7 * update CDN link in index.html to 1.0.7 * Jasmine needs to be listed as a framework karma conf is now exported functions how embarrassing - now it really should work need ng-scenario for e2e tests need karma-junit-reporter trying without jasmine trying some other plugins adding jasmine in I will stab someone ng-scenario is probably needed trying adding karma-ng-scenario need a package.json to specify dev deps normalise quotes * add license file * upgrade to angular 1.2.0-rc.2 barehand-atomsplitting * add ngRoute module to app.js * load angular-route.js in index.html * upgrade to angular 1.2.0-rc.3 ferocious-twitch * fix(package.json): Fixed spelling and versions in package.json * gitignore: Added node_modules to ignore * feat(e2e): Used local karma to run e2e tests * fix(unit): Changed unit test to use local karma * fix(karma): Excluded minified files from unit test * fix(package): Added repository to package.json * fix(karma): Fixed inadvertently-removed asterisk match * fix(e2e): Change app loading path in e2e test * fix(karma): Removed loader file from unit config * fix(scenario): Made path ci-friendly * update(angular): bump angular to 1.2.0 * fix(karma): excluded angular-scenario * update(angular): bump angular to 1.2.2 * update(angular): bump angular to 1.2.3 * bump angular to 1.2.4 * update(angular): bump angular to 1.2.5 * update(angular): bump to 1.2.6 * update(angular): bump to 1.2.7 * chore(build): update angular using a directory * chore(build): refactor update angular and run tests * update(angular): bump to 1.2.8 * update(angular): bump to 1.2.9 * update(angular): bump to 1.2.10 * update(angular): bump to 1.2.11 * chore(testing): update end to end tests to Protractor * update(angular): bump to 1.2.12 * update(angular): bump to 1.2.13 * update(angular): bump to 1.2.14 * fix(readme): correct typo * fix(readme): remove angular-scenario.js from readme * update(angular): bump to 1.3.0-beta.1 * update(angular): bump to 1.3.0-build.51+sha.e888dde * update(angular): bump to 1.3.0-beta.2+ * update(angular): bump to 1.3.0-beta.2 * update(angular): bump to 1.3.0-beta.3 * update(angular): bump to 1.2.15 * chore(dependencies): remove inline dependencies (use npm & bower instead) It is inefficient to store the angular libraries inside this repository. Moreover it is a pain to have to update them every time a new version of Angular is released. This commit changes the project to use bower to install the angular dependencies. In addition, simplify the structure of the project, all the support scripts have either been replaced with well-defined npm modules (e.g http-server) or have been moved to the package.json `script` property. This means that we can now do all the management of the project with three simple commands: * `npm start` - start the development web server to host the application * `npm test` - start the Karma test runner * `npm run-script protractor` - start the Protractor end-to-end test runner A nice feature of these scripts is that they run `npm install` first, thus ensuring that the necessary npm dependencies are in place. Also there is a `postinstall` script which runs `bower install` to ensure the angular library dependencies are in place and updates the index-async.html with the `angular-loader.min.js` content via the following sed script: ``` sed '/@@NG_LOADER@@/{ s/@@NG_LOADER@@//g r bower_components/angular-loader/angular-loader.min.js }' app/index-async.html.template > app/index-async.html ``` * chore(npm-scripts): ensure they work on Windows * chore(update-index-async): update async code in place * chore(package.json): remove postupdate hook We would want more control over when bower updates are run. * docs(README.md): update instructions to match scripts * chore(package.json): watch test files by default * docs(README): npm test watches files for changes * docs(LICENSE): update copyright year to 2014 Closes #155 * chore(travis): use more recent version of node * style(controllers): consistent use of dots The second controller led with a period while the first did not. Moving the period in front of the first controller creates consistency and more explicitly conveys the chaining behavior. Closes #138 * chore(travis): run http-server in the background * test(controllers): use $controller to get hold of a controller for testing Closes #75 * chore(travis): install the webdriver for protractor * style(filters): add missing semicolon * chore(jshint): add jshint config file * chore(package): add extra scripts to make life even smoother * chore(lib): remove lib folder It is not being used anymore - angular-mocks should be installed by bower. Closes #181 * docs(README): add info about prerequisites * fix(package.json): bind web server only to localhost It's better to bind to localhost only during development, since it improves security. It also avoids a pesky warning under Mac OS. Closes #165 * feat(index): use html5-boilerplate HTML, modernizr and styles Closes #1 * feat(myApp.controllers): add $scope param to clarify annotation Closes #154 * chore(karma): add junit-reporter We need to list karma-junit-reporter as a plugin and include it as a node module dependency before we can use it to output junit format. Closes #178 * chore(bower): fix angular-mocks dependency * test(controllers): provide $scope when instantiating controllers * chore(bower): move bower_components under the app folder This will help web servers who are not happy to serve up files outside the "root" folder of the application. Closes #183 Closes #182 * fix(index): remove invalid path references A few invalid paths which were referenced in index.html were removed. These paths became invalid due to commit daf71f2 which moved where the bower_components directory is placed. Closes #184 * fix(index-async): correct the path to bower_components * docs(README): fix typos Closes #190 * chore(travis): node js version should between quotes node js version should between quotation marks based on http://docs.travis-ci.com/user/languages/javascript-with-nodejs/ Closes #213 * refact(*): refactor app layout to conform to best practices * refact(*): update overall application architecture to match best practices * refact(*): further architectural improvements * chore(package.json): update to protractor 1.1.1 * docs(README): fix link to Jasmine Closes #209 * docs(README): fix grammar and ambiguous sentence Closes #223 * docs(scenarios): fix link to protractor docs Closes #206 * chore(package.json): remove local HTTP server's cache-control header Disable the local HTTP server's cache-control header, to fix the problem where the browser wouldn't reload templateUrl-based directive templates. Fixes #193 Closes #194 * chore(package.json): fix path to angular-load.min.js.map in "update-index-async" command This fixes the 404 not found when it tries to retrieve this map file and can't because the path is wrong. Note that you won't see that error if you have JavaScript source maps turned off. Closes #197 * docs(README): fix typo Closes #229 * refact(index.html): remove self closing slash for link tag. You don't need it when doctype is HTML5 and also the others above already don't have one. Closes #232 * docs(README): add alternative git clone method Closes #239 * chore(bower.son): update angular dep to 1.3.x, html5-boilerplate * chore(package.json): update karma, add karma plugins dep * chore(bower.json): Update angular dependency to ~1.4.0 * chore(protractor): update to use protractor v2.1.0 * chore(*): update dependencies and configuration files Closes #341 * chore(*): serve from the `app/` directory Closes #341 * chore(*): use `!` as hash-prefix Closes #341 * fix(index-async): fix inlining of `angular-loader` into `index-async.html` Previously, `angular-loader` was never inlined into `index-async.html`, because running `sed` with a multiline RegExp fails to match anything, since `sed` matches per line. Using the `fs` module directly, solves the issues. (Now, we no longer depend on `shelljs`.) Closes #309 * fix(index-async): properly inline text containing `$$` When using `'...'.replace(regex, replacement)`, any instances of `$$` inside `replacement` will be converted to `$` (see [mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter). Thus, for example `$$minErr` and `$$moduleName` are converted to `$minErr` and `$moduleName`. This commit fixes it, by first using `'...'.split(regex).join(replacement)` instead. Fixes #283 Closes #286 * docs(README): update for consistenty ("End to End" --> "end-to-end") This test refers to general end-to-end tests. Closes #235 * docs(LICENSE): update copyright year to 2016 Closes #269 * fix(index-async): correct html5-boilerplate paths Paths to html5-boilerplate resource were configured incorrectly. These paths are corrected. Closes #356 * chore(travis): switch to Chrome, Node.js 4.5.x and Ubuntu "trusty" Closes #360 * docs(README.md): mention JDK dependency for Protractor Fixes #222 Closes #312 * docs(README.md): add links for Selenium and JDK * refactor(app.css): simplify rules for styling menu item seperator Closes #367 * docs(README.md): fix typo (Stadalone --> Standalone) * chore(package): update to Protractor 4.x This also fixes some issues on linux (e.g. angular/angular-phonecat#377). Closes #378 * 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`. * 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 * docs(README.md): highlight the JDK dependency in the "Depedencies" section * docs(README.md): minor typo/wording/style improvements Closes #384 * rename foldar app to client * add detials to wercker faile * Fixed bower_components, added basic compilation flow to npm scripts * Some new scripts to compile the app * Updated wercker yml * Updated bower steps in wercker yml * Fixed indentation in wercker yaml * Added wercker status to README
1 parent c18a133 commit ef55140

File tree

706 files changed

+325513
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

706 files changed

+325513
-10
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "client/bower_components"
3+
}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
logs/*
2+
!.gitkeep
3+
node_modules/
4+
npm-debug.log
5+
tmp
6+
.DS_Store
7+
.idea

.jshintrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"strict": "global",
3+
"globals": {
4+
// Angular
5+
"angular": false,
6+
7+
// Angular mocks
8+
"module": false,
9+
"inject": false,
10+
11+
// Jasmine
12+
"jasmine": false,
13+
"describe": false,
14+
"beforeEach": false,
15+
"afterEach": false,
16+
"it": false,
17+
"expect": false,
18+
19+
// Protractor
20+
"browser": false,
21+
"element": false,
22+
"by": false
23+
}
24+
}

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
sudo: required
2+
dist: trusty
3+
4+
language: node_js
5+
node_js:
6+
- '4.5'
7+
8+
install:
9+
- export DISPLAY=:99.0
10+
- sh -e /etc/init.d/xvfb start
11+
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
12+
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
13+
- sudo apt-get update -q
14+
- sudo apt-get install -q google-chrome-stable
15+
16+
before_script:
17+
- npm install
18+
19+
script:
20+
- npm run test-single-run
21+
- (npm start > /dev/null &) && (npm run protractor)

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
3+
Copyright (c) 2010-2016 Google, Inc. http://angularjs.org
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
22+

README.md

Lines changed: 288 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,302 @@
1+
[![wercker status](https://app.wercker.com/status/28d30a7502dfe52c4b1610aef1c34a5f/s/master "wercker status")](https://app.wercker.com/project/byKey/28d30a7502dfe52c4b1610aef1c34a5f)
2+
13
# Generala
24

35
For information about the project please head to [the wiki](https://github.com/HackYourFuture/generala/wiki)
46

5-
# Workflow
7+
Based on `angular-seed` — the seed for AngularJS apps
8+
9+
This project is an application skeleton for a typical [AngularJS][angularjs] web app. You can use it
10+
to quickly bootstrap your angular webapp projects and dev environment for these projects.
11+
12+
The seed contains a sample AngularJS application and is preconfigured to install the Angular
13+
framework and a bunch of development and testing tools for instant web development gratification.
14+
15+
The seed app doesn't do much, just shows how to wire two controllers and views together.
16+
17+
18+
## Getting Started
19+
20+
To get you started you can simply clone the `angular-seed` repository and install the dependencies:
21+
22+
### Prerequisites
23+
24+
You need git to clone the `angular-seed` repository. You can get git from [here][git].
25+
26+
We also use a number of Node.js tools to initialize and test `angular-seed`. You must have Node.js
27+
and its package manager (npm) installed. You can get them from [here][node].
28+
29+
### Clone `angular-seed`
30+
31+
Clone the `angular-seed` repository using git:
32+
33+
```
34+
git clone https://github.com/angular/angular-seed.git
35+
cd angular-seed
36+
```
37+
38+
If you just want to start a new project without the `angular-seed` commit history then you can do:
39+
40+
```
41+
git clone --depth=1 https://github.com/angular/angular-seed.git <your-project-name>
42+
```
43+
44+
The `depth=1` tells git to only pull down one commit worth of historical data.
45+
46+
### Install Dependencies
47+
48+
We have two kinds of dependencies in this project: tools and Angular framework code. The tools help
49+
us manage and test the application.
50+
51+
* We get the tools we depend upon via `npm`, the [Node package manager][npm].
52+
* We get the Angular code via `bower`, a [client-side code package manager][bower].
53+
* In order to run the end-to-end tests, you will also need to have the
54+
[Java Development Kit (JDK)][jdk] installed on your machine. Check out the section on
55+
[end-to-end testing](#e2e-testing) for more info.
56+
57+
We have preconfigured `npm` to automatically run `bower` so we can simply do:
58+
59+
```
60+
npm install
61+
```
62+
63+
Behind the scenes this will also call `bower install`. After that, you should find out that you have
64+
two new folders in your project.
65+
66+
* `node_modules` - contains the npm packages for the tools we need
67+
* `app/bower_components` - contains the Angular framework files
68+
69+
*Note that the `bower_components` folder would normally be installed in the root folder but
70+
`angular-seed` changes this location through the `.bowerrc` file. Putting it in the `app` folder
71+
makes it easier to serve the files by a web server.*
72+
73+
### Run the Application
74+
75+
We have preconfigured the project with a simple development web server. The simplest way to start
76+
this server is:
77+
78+
```
79+
npm start
80+
```
81+
82+
Now browse to the app at [`localhost:8000/index.html`][local-app-url].
83+
84+
85+
## Directory Layout
86+
87+
```
88+
app/ --> all of the source files for the application
89+
app.css --> default stylesheet
90+
components/ --> all app specific modules
91+
version/ --> version related components
92+
version.js --> version module declaration and basic "version" value service
93+
version_test.js --> "version" value service tests
94+
version-directive.js --> custom directive that returns the current app version
95+
version-directive_test.js --> version directive tests
96+
interpolate-filter.js --> custom interpolation filter
97+
interpolate-filter_test.js --> interpolate filter tests
98+
view1/ --> the view1 view template and logic
99+
view1.html --> the partial template
100+
view1.js --> the controller logic
101+
view1_test.js --> tests of the controller
102+
view2/ --> the view2 view template and logic
103+
view2.html --> the partial template
104+
view2.js --> the controller logic
105+
view2_test.js --> tests of the controller
106+
app.js --> main application module
107+
index.html --> app layout file (the main html template file of the app)
108+
index-async.html --> just like index.html, but loads js files asynchronously
109+
karma.conf.js --> config file for running unit tests with Karma
110+
e2e-tests/ --> end-to-end tests
111+
protractor-conf.js --> Protractor config file
112+
scenarios.js --> end-to-end scenarios to be run by Protractor
113+
```
114+
115+
116+
## Testing
117+
118+
There are two kinds of tests in the `angular-seed` application: Unit tests and end-to-end tests.
119+
120+
### Running Unit Tests
121+
122+
The `angular-seed` app comes preconfigured with unit tests. These are written in [Jasmine][jasmine],
123+
which we run with the [Karma][karma] test runner. We provide a Karma configuration file to run them.
124+
125+
* The configuration is found at `karma.conf.js`.
126+
* The unit tests are found next to the code they are testing and have an `_test.js` suffix (e.g.
127+
`view1_test.js`).
128+
129+
The easiest way to run the unit tests is to use the supplied npm script:
130+
131+
```
132+
npm test
133+
```
134+
135+
This script will start the Karma test runner to execute the unit tests. Moreover, Karma will start
136+
watching the source and test files for changes and then re-run the tests whenever any of them
137+
changes.
138+
This is the recommended strategy; if your unit tests are being run every time you save a file then
139+
you receive instant feedback on any changes that break the expected code functionality.
140+
141+
You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to
142+
check that a particular version of the code is operating as expected. The project contains a
143+
predefined script to do this:
144+
145+
```
146+
npm run test-single-run
147+
```
148+
149+
150+
<a name="e2e-testing"></a>
151+
### Running End-to-End Tests
152+
153+
The `angular-seed` app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests
154+
are run with the [Protractor][protractor] End-to-End test runner. It uses native events and has
155+
special features for Angular applications.
156+
157+
* The configuration is found at `e2e-tests/protractor-conf.js`.
158+
* The end-to-end tests are found in `e2e-tests/scenarios.js`.
159+
160+
Protractor simulates interaction with our web app and verifies that the application responds
161+
correctly. Therefore, our web server needs to be serving up the application, so that Protractor can
162+
interact with it.
163+
164+
**Before starting Protractor, open a separate terminal window and run:**
165+
166+
```
167+
npm start
168+
```
169+
170+
In addition, since Protractor is built upon WebDriver, we need to ensure that it is installed and
171+
up-to-date. The `angular-seed` project is configured to do this automatically before running the
172+
end-to-end tests, so you don't need to worry about it. If you want to manually update the WebDriver,
173+
you can run:
174+
175+
```
176+
npm run update-webdriver
177+
```
178+
179+
Once you have ensured that the development web server hosting our application is up and running, you
180+
can run the end-to-end tests using the supplied npm script:
181+
182+
```
183+
npm run protractor
184+
```
185+
186+
This script will execute the end-to-end tests against the application being hosted on the
187+
development server.
188+
189+
**Note:**
190+
Under the hood, Protractor uses the [Selenium Standalone Server][selenium], which in turn requires
191+
the [Java Development Kit (JDK)][jdk] to be installed on your local machine. Check this by running
192+
`java -version` from the command line.
193+
194+
If JDK is not already installed, you can download it [here][jdk-download].
195+
196+
197+
## Updating Angular
198+
199+
Since the Angular framework library code and tools are acquired through package managers (npm and
200+
bower) you can use these tools to easily update the dependencies. Simply run the preconfigured
201+
script:
202+
203+
```
204+
npm run update-deps
205+
```
206+
207+
This will call `npm update` and `bower update`, which in turn will find and install the latest
208+
versions that match the version ranges specified in the `package.json` and `bower.json` files
209+
respectively.
210+
211+
212+
## Loading Angular Asynchronously
213+
214+
The `angular-seed` project supports loading the framework and application scripts asynchronously.
215+
The special `index-async.html` is designed to support this style of loading. For it to work you must
216+
inject a piece of Angular JavaScript into the HTML page. The project has a predefined script to help
217+
do this:
218+
219+
```
220+
npm run update-index-async
221+
```
222+
223+
This will copy the contents of the `angular-loader.js` library file into the `index-async.html`
224+
page. You can run this every time you update the version of Angular that you are using.
225+
226+
227+
## Serving the Application Files
228+
229+
While Angular is client-side-only technology and it is possible to create Angular web apps that
230+
do not require a backend server at all, we recommend serving the project files using a local
231+
web server during development to avoid issues with security restrictions (sandbox) in browsers. The
232+
sandbox implementation varies between browsers, but quite often prevents things like cookies, XHR,
233+
etc to function properly when an HTML page is opened via the `file://` scheme instead of `http://`.
234+
235+
### Running the App during Development
236+
237+
The `angular-seed` project comes preconfigured with a local development web server. It is a Node.js
238+
tool called [http-server][http-server]. You can start this web server with `npm start`, but you may
239+
choose to install the tool globally:
240+
241+
```
242+
sudo npm install -g http-server
243+
```
244+
245+
Then you can start your own development web server to serve static files from a folder by running:
246+
247+
```
248+
http-server -a localhost -p 8000
249+
```
250+
251+
Alternatively, you can choose to configure your own web server, such as Apache or Nginx. Just
252+
configure your server to serve the files under the `app/` directory.
253+
254+
### Running the App in Production
255+
256+
This really depends on how complex your app is and the overall infrastructure of your system, but
257+
the general rule is that all you need in production are the files under the `app/` directory.
258+
Everything else should be omitted.
259+
260+
Angular apps are really just a bunch of static HTML, CSS and JavaScript files that need to be hosted
261+
somewhere they can be accessed by browsers.
262+
263+
If your Angular app is talking to the backend server via XHR or other means, you need to figure out
264+
what is the best way to host the static files to comply with the same origin policy if applicable.
265+
Usually this is done by hosting the files by the backend server or through reverse-proxying the
266+
backend server(s) and web server(s).
6267

7-
## Develop
8268

9-
### Build
269+
## Continuous Integration
10270

11-
...TBD...
271+
### Travis CI
12272

13-
### Test
273+
[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits to
274+
your repository and execute scripts such as building the app or running tests. The `angular-seed`
275+
project contains a Travis configuration file, `.travis.yml`, which will cause Travis to run your
276+
tests when you push to GitHub.
14277

15-
...TBD...
278+
You will need to enable the integration between Travis and GitHub. See the
279+
[Travis website][travis-docs] for instructions on how to do this.
16280

17-
### Deploy
18281

19-
...TBD...
282+
## Contact
20283

284+
For more information on AngularJS please check out [angularjs.org][angularjs].
21285

22-
## How to collaborate
23286

24-
...TBD...
287+
[angularjs]: https://angularjs.org/
288+
[bower]: http://bower.io/
289+
[git]: https://git-scm.com/
290+
[http-server]: https://github.com/indexzero/http-server
291+
[jasmine]: https://jasmine.github.io/
292+
[jdk]: https://wikipedia.org/wiki/Java_Development_Kit
293+
[jdk-download]: http://www.oracle.com/technetwork/java/javase/downloads
294+
[karma]: https://karma-runner.github.io/
295+
[local-app-url]: http://localhost:8000/index.html
296+
[node]: https://nodejs.org/
297+
[npm]: https://www.npmjs.org/
298+
[protractor]: http://www.protractortest.org/
299+
[selenium]: http://docs.seleniumhq.org/
300+
[travis]: https://travis-ci.org/
301+
[travis-docs]: https://docs.travis-ci.com/user/getting-started
302+
>>>>>>> origin/angularclient

0 commit comments

Comments
 (0)