Skip to content

Commit 4a02d70

Browse files
committed
version 0.5
1 parent eea110d commit 4a02d70

39 files changed

+1429
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
12+
[*.md]
13+
max_line_length = 0
14+
trim_trailing_whitespace = false
15+
16+
# Indentation override
17+
#[lib/**.js]
18+
#[{package.json,.travis.yml}]
19+
#[**/**.js]

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
dist: trusty
2+
sudo: required
3+
language: node_js
4+
node_js:
5+
- "5"
6+
os:
7+
- linux
8+
env:
9+
global:
10+
- DBUS_SESSION_BUS_ADDRESS=/dev/null
11+
- DISPLAY=:99.0
12+
- CHROME_BIN=chromium-browser
13+
before_script:
14+
- sh -e /etc/init.d/xvfb start
15+
install:
16+
- npm install
17+
script:
18+
- npm run lint
19+
- npm run test-once
20+
- npm run e2e

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.check.workspaceVersion": false
3+
}

CHANGELOG.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
## Angular Documentation QuickStart Changelog
2+
Upgraders: for a fresh start, consider running these commands
3+
* `git clean -xdf`
4+
* `npm install`
5+
6+
<a name="0.2.21"></a>
7+
# 0.2.20 (2016-12-14)
8+
* Update to in-memory-web-api v.0.2.1
9+
10+
<a name="0.2.20"></a>
11+
# 0.2.20 (2016-12-07)
12+
* Update to Angular 2.3.0
13+
14+
<a name="0.2.19"></a>
15+
# 0.2.19 (2016-11-30)
16+
* remove upgrade mappings from `systemjs.config.js` PR #301
17+
18+
<a name="0.2.18"></a>
19+
# 0.2.18 (2016-11-30)
20+
* remove `exclude` clause from `tsconfig.json`; it was just confusing people
21+
* karma.config + karma-test-shim can handle multiple spec source paths (issue #294)
22+
* cosmetic `app.component.spec.ts` changes
23+
* cosmetic `karma.config.js` changes
24+
25+
<a name="0.2.17"></a>
26+
# 0.2.17 (2016-11-16)
27+
* Conform to updated QuickStart advice
28+
* removed docker everywhere (was nice but not necessary)
29+
* removed wallaby
30+
* shrink styles.css
31+
* refine tsconfig.json
32+
* `AppComponent` uses interpolation
33+
34+
<a name="0.2.16"></a>
35+
# 0.2.16 (2016-11-14)
36+
* Update to Angular 2.2.0
37+
38+
<a name="0.2.15"></a>
39+
# 0.2.15 (2016-10-29)
40+
* Revert to Jasmine 2.4.1 because bug in 2.5.x (see [jasmine issue #1231](https://github.com/jasmine/jasmine/issues/1231))
41+
42+
<a name="0.2.14"></a>
43+
# 0.2.14 (2016-10-29)
44+
* Remove bootstrap.css install
45+
* Angular v2.1.2
46+
47+
<a name="0.2.13"></a>
48+
# 0.2.13 (2016-10-20)
49+
* Protractor 4
50+
* Move from `typings` to `@types`. See `tsconfig.json` changes.
51+
* Angular v2.1.1
52+
53+
<a name="0.2.12"></a>
54+
# 0.2.12 (2016-10-06)
55+
* Angular v2.1.0
56+
57+
<a name="0.2.11"></a>
58+
# 0.2.11 (2016-10-06)
59+
* Angular v2.0.2
60+
* License is MIT
61+
* Current testing configuration
62+
* No code changes
63+
64+
<a name="0.2.10"></a>
65+
# 0.2.10 (2016-09-19)
66+
* All "Angular 2" references become just "Angular"
67+
* No code changes
68+
69+
<a name="0.2.9"></a>
70+
# 0.2.9 (2016-09-14)
71+
* Angular 2.0.0 version
72+
* Update to Typescript 2.0.2
73+
* Fix e2e test missing dir
74+
75+
<a name="0.2.8"></a>
76+
# 0.2.8 (2016-09-01)
77+
* remove @angular test libraries from system.js (now in shim)
78+
* update test related files
79+
* wallaby doesn't completely work. Researching.
80+
81+
<a name="0.2.7"></a>
82+
# 0.2.7 (2016-08-31)
83+
* Angular 2 RC6 version
84+
* Updated new forms, router, angular2-in-memory-web-api, karma, core-js, rxjs and zone.js packages
85+
* Removed router-deprecated package
86+
* Updated karma.conf.js and systemjs.config.js
87+
88+
<a name="0.2.6"></a>
89+
# 0.2.6 (2016-08-09)
90+
* Angular 2 RC5 version
91+
* Updated new forms, router and angular2-in-memory-web-api
92+
93+
<a name="0.2.5"></a>
94+
# 0.2.5 (2016-06-30)
95+
* Angular 2 RC4 version
96+
* Updated new forms and router
97+
98+
<a name="0.2.4"></a>
99+
# 0.2.4 (2016-06-21)
100+
* Angular 2 RC3 version
101+
* Add new forms and router
102+
* Add support for TS e2e tests
103+
104+
<a name="0.2.3"></a>
105+
# 0.2.3 (2016-06-15)
106+
* Angular 2 RC2 version
107+
108+
<a name="0.2.2"></a>
109+
# 0.2.2 (2016-05-21)
110+
* Update to Typings 1.x
111+
112+
<a name="0.2.1"></a>
113+
# 0.2.1 (2016-05-03)
114+
* Angular 2 RC01 version
115+
116+
<a name="0.2.0"></a>
117+
# 0.2.0 (2016-05-02)
118+
* Angular 2 RC0 version
119+
120+
<a name="0.1.17"></a>
121+
# 0.1.17 (2016-04-29)
122+
* update packages
123+
* Angular 2 beta 17
124+
* RxJS 5.0.0-beta.6
125+
* a2-in-memory-web-api 0.1.17
126+
127+
<a name="0.1.16"></a>
128+
# 0.1.16 (2016-04-26)
129+
* update packages
130+
* Angular 2 beta 16
131+
* a2-in-memory-web-api 0.1.6
132+
* protractor 3.3.0
133+
* typings 0.8.1
134+
* zone.js 0.6.12
135+
136+
* added favicon.ico
137+
138+
* testing
139+
- updated wallaby.js and karma.conf.js
140+
- updated app.component.spec.ts
141+
142+
143+
<a name="0.1.15"></a>
144+
# 0.1.15 (2016-04-13)
145+
* Add testing support
146+
* npm scripts
147+
* karma/jasmine
148+
* protractor
149+
150+
* update packages
151+
* Angular 2 beta 15
152+
* lite-server 2.2.0
153+
* systemjs 0.19.26
154+
* typescript 1.8.10
155+
* typings 0.7.12
156+
157+
* add run packages
158+
* a2-in-memory-web-api
159+
160+
* add testing dev-dependency packages
161+
* canonical-path: 0.0.2,
162+
* http-server: ^0.9.0,
163+
* jasmine-core: ~2.4.1,
164+
* karma: ^0.13.22,
165+
* karma-chrome-launcher: ^0.2.3,
166+
* karma-cli: ^0.1.2,
167+
* karma-htmlfile-reporter: ^0.2.2,
168+
* karma-jasmine: ^0.3.8,
169+
* protractor: ^3.2.2,
170+
* rimraf: ^2.5.2
171+
172+
<a name="0.1.14"></a>
173+
# 0.1.14 (2016-04-07)
174+
* update packages
175+
* Angular 2 beta 14
176+
* lite-server 2.2.0
177+
* typings 0.7.12
178+
179+
<a name="0.1.13"></a>
180+
# 0.1.13 (2016-03-31)
181+
* update packages
182+
* Angular 2 beta 13
183+
184+
<a name="0.1.12"></a>
185+
# 0.1.12 (2016-03-23)
186+
* update packages
187+
* Angular 2 beta 12
188+
* zones 0.6.6
189+
* remove es6-promise because no longer needed.
190+
191+
<a name="0.1.11"></a>
192+
# 0.1.11 (2016-03-18)
193+
* update packages
194+
* Angular 2 beta 11
195+
* zones 0.6.4
196+
* typescript 1.8.9
197+
* typings 0.7.9

README.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Angular QuickStart Source
2+
[![Build Status][travis-badge]][travis-badge-url]
3+
4+
This repository holds the TypeScript source code of the [angular.io quickstart](https://angular.io/docs/ts/latest/quickstart.html),
5+
the foundation for most of the documentation samples and potentially a good starting point for your application.
6+
7+
It's been extended with testing support so you can start writing tests immediately.
8+
9+
**This is not the perfect arrangement for your application. It is not designed for production.
10+
It exists primarily to get you started quickly with learning and prototyping in Angular**
11+
12+
We are unlikely to accept suggestions about how to grow this QuickStart into something it is not.
13+
Please keep that in mind before posting issues and PRs.
14+
15+
## Prerequisites
16+
17+
Node.js and npm are essential to Angular development.
18+
19+
<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="Installing Node.js and updating npm">
20+
Get it now</a> if it's not already installed on your machine.
21+
22+
**Verify that you are running at least node `v4.x.x` and npm `3.x.x`**
23+
by running `node -v` and `npm -v` in a terminal/console window.
24+
Older versions produce errors.
25+
26+
We recommend [nvm](https://github.com/creationix/nvm) for managing multiple versions of node and npm.
27+
28+
## Create a new project based on the QuickStart
29+
30+
Clone this repo into new project folder (e.g., `my-proj`).
31+
```bash
32+
git clone https://github.com/angular/quickstart my-proj
33+
cd my-proj
34+
```
35+
36+
We have no intention of updating the source on `angular/quickstart`.
37+
Discard everything "git-like" by deleting the `.git` folder.
38+
```bash
39+
rm -rf .git # non-Windows
40+
rd .git /S/Q # windows
41+
```
42+
43+
### Create a new git repo
44+
You could [start writing code](#start-development) now and throw it all away when you're done.
45+
If you'd rather preserve your work under source control, consider taking the following steps.
46+
47+
Initialize this project as a *local git repo* and make the first commit:
48+
```bash
49+
git init
50+
git add .
51+
git commit -m "Initial commit"
52+
```
53+
54+
Create a *remote repository* for this project on the service of your choice.
55+
56+
Grab its address (e.g. *`https://github.com/<my-org>/my-proj.git`*) and push the *local repo* to the *remote*.
57+
```bash
58+
git remote add origin <repo-address>
59+
git push -u origin master
60+
```
61+
## Install npm packages
62+
63+
> See npm and nvm version notes above
64+
65+
Install the npm packages described in the `package.json` and verify that it works:
66+
67+
```bash
68+
npm install
69+
npm start
70+
```
71+
72+
The `npm start` command first compiles the application,
73+
then simultaneously re-compiles and runs the `lite-server`.
74+
Both the compiler and the server watch for file changes.
75+
76+
Shut it down manually with `Ctrl-C`.
77+
78+
You're ready to write your application.
79+
80+
### npm scripts
81+
82+
We've captured many of the most useful commands in npm scripts defined in the `package.json`:
83+
84+
* `npm start` - runs the compiler and a server at the same time, both in "watch mode".
85+
* `npm run tsc` - runs the TypeScript compiler once.
86+
* `npm run tsc:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them.
87+
* `npm run lite` - runs the [lite-server](https://www.npmjs.com/package/lite-server), a light-weight, static file server, written and maintained by
88+
[John Papa](https://github.com/johnpapa) and
89+
[Christopher Martin](https://github.com/cgmartin)
90+
with excellent support for Angular apps that use routing.
91+
92+
Here are the test related scripts:
93+
* `npm test` - compiles, runs and watches the karma unit tests
94+
* `npm run e2e` - run protractor e2e tests, written in JavaScript (*e2e-spec.js)
95+
96+
## Testing
97+
98+
The QuickStart documentation doesn't discuss testing.
99+
This repo adds both karma/jasmine unit test and protractor end-to-end testing support.
100+
101+
These tools are configured for specific conventions described below.
102+
103+
*It is unwise and rarely possible to run the application, the unit tests, and the e2e tests at the same time.
104+
We recommend that you shut down one before starting another.*
105+
106+
### Unit Tests
107+
TypeScript unit-tests are usually in the `app` folder. Their filenames must end in `.spec`.
108+
109+
Look for the example `app/app.component.spec.ts`.
110+
Add more `.spec.ts` files as you wish; we configured karma to find them.
111+
112+
Run it with `npm test`
113+
114+
That command first compiles the application, then simultaneously re-compiles and runs the karma test-runner.
115+
Both the compiler and the karma watch for (different) file changes.
116+
117+
Shut it down manually with `Ctrl-C`.
118+
119+
Test-runner output appears in the terminal window.
120+
We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests.
121+
Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (`Ctrl-C`) and
122+
restart it. No worries; it's pretty quick.
123+
124+
### End-to-end (E2E) Tests
125+
126+
E2E tests are in the `e2e` directory, side by side with the `app` folder.
127+
Their filenames must end in `.e2e-spec.ts`.
128+
129+
Look for the example `e2e/app.e2e-spec.ts`.
130+
Add more `.e2e-spec.js` files as you wish (although one usually suffices for small projects);
131+
we configured protractor to find them.
132+
133+
Thereafter, run them with `npm run e2e`.
134+
135+
That command first compiles, then simultaneously starts the Http-Server at `localhost:8080`
136+
and launches protractor.
137+
138+
The pass/fail test results appear at the bottom of the terminal window.
139+
A custom reporter (see `protractor.config.js`) generates a `./_test-output/protractor-results.txt` file
140+
which is easier to read; this file is excluded from source control.
141+
142+
Shut it down manually with `Ctrl-C`.
143+
144+
[travis-badge]: https://travis-ci.org/angular/quickstart.svg?branch=master
145+
[travis-badge-url]: https://travis-ci.org/angular/quickstart

0 commit comments

Comments
 (0)