Skip to content

Commit c2532f3

Browse files
author
sternbach
committed
- removed typings
- upgraded to angularjs 1.6, typescript 2.2 and webpack 2 - added angular-ts-decorators - added tslint and .editorconfig
1 parent a2f0ec2 commit c2532f3

30 files changed

+550
-430
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{js,ts,json,css,html}]
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[Makefile]
18+
indent_style = tab

README.md

+7-22
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
# angularjs-typescript-webpack starter
22

3-
This project is an application skeleton for [AngularJS](http://angularjs.org/) 1.5 web app using new component syntax and typescript.
4-
5-
It uses two different bunling systems webpack and systemjs, use the appropriate branch.
6-
7-
Webpack branch has support for importing sass styles inline in the modules, for system js external stylesheets should be used, it has support for inline imports only with jspm.
3+
This project is an application skeleton for [AngularJS](http://angularjs.org/) 1.6+ web app using new component syntax, typescript 2 and webpack 2.
84

5+
Project uses [angular-ts-decorators](https://github.com/vsternbach/angular-ts-decorators) to mimic angular 2+ style development in angularjs environment with typescript and webpack.
96
## Getting Started
107

11-
To get you started you can simply clone the angularjs-typescript-webpack repository and install the dependencies:
12-
13-
### Prerequisites
14-
15-
You need git to clone the angularjs-typescript-webpack repository. You can get git from
16-
[http://git-scm.com/](http://git-scm.com/).
8+
To get you started you can simply clone the angularjs-typescript-webpack repository.
179

18-
We also use a number of node.js tools to initialize and test angular-seed. You must have node.js and
19-
its package manager (npm) installed. You can get them from [http://nodejs.org/](http://nodejs.org/).
20-
21-
Install these globally:
22-
23-
```
24-
npm install -g webpack webpack-dev-server typings
25-
```
10+
Some of the project dependencies are used just for example and can be removed if not needed.
2611

2712
### Clone angularjs-typescript-webpack
2813

@@ -40,9 +25,9 @@ npm install
4025

4126
```
4227
src/ --> all of the source files for the application
28+
assets/ --> static app assets
4329
components/ --> all app specific modules
4430
services/ --> all app common services
45-
assets/ --> all of the app static assets
4631
main.ts --> main application module
4732
index.html --> app layout file (the main html template file of the app)
4833
```
@@ -51,8 +36,8 @@ src/ --> all of the source files for the application
5136

5237
The angularjs-typescript-webpack project comes preconfigured with a local development webserver. It is a webpack-dev-server, that supports hot reload. You can start this webserver with `npm start`.
5338

54-
Now browse to the app at `http://localhost:8080/`.
39+
Now browse to the app at `http://localhost:3000/`.
5540

5641
### Building and running the App in Production
5742

58-
To build the application for production just run `npm bundle`, it creates dist directory that have the production optimized build.
43+
To build the application for production just run `npm build`, it creates dist directory that have the production optimized build.

package.json

+23-16
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
11
{
22
"name": "angularjs-typescript-webpack",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "1.0.0",
55
"description": "Angularjs-typescript-webpack starter project",
66
"repository": "https://github.com/vsternbach/angularjs-typescript-webpack",
77
"license": "MIT",
88
"devDependencies": {
9-
"awesome-typescript-loader": "^0.17.0",
9+
"@types/angular": "^1.6.7",
10+
"@types/angular-ui-router": "^1.1.36",
11+
"@types/jquery": "^2.0.40",
12+
"@types/node": "^7.0.8",
13+
"angular-ts-decorators": "0.0.23",
14+
"awesome-typescript-loader": "^3.1.2",
1015
"copyfiles": "^0.2.1",
16+
"cross-env": "^3.2.3",
1117
"css-loader": "^0.23.1",
12-
"node-sass": "^3.4.2",
18+
"html-loader": "^0.4.5",
19+
"ng-annotate-loader": "^0.2.0",
20+
"node-sass": "^4.5.0",
1321
"rimraf": "^2.5.2",
14-
"sass-loader": "^3.2.0",
15-
"style-loader": "^0.13.1",
16-
"typescript": "^1.8.10",
17-
"typings": "^1.0.4",
18-
"webpack": "^1.13.1",
19-
"webpack-dev-server": "^1.14.1"
22+
"sass-loader": "^6.0.3",
23+
"style-loader": "^0.13.2",
24+
"tslint": "^4.5.1",
25+
"typescript": "^2.2.1",
26+
"webpack": "^2.2.1",
27+
"webpack-dev-server": "^2.4.1"
2028
},
2129
"dependencies": {
22-
"angular": "^1.5.3",
23-
"angular-sanitize": "^1.5.3",
24-
"angular-ui-router": "^0.2.18",
30+
"angular": "^1.6.3",
31+
"angular-sanitize": "^1.6.3",
32+
"angular-ui-router": "^1.0.0-rc.1",
2533
"ng-tags-input": "^3.0.0"
2634
},
2735
"scripts": {
28-
"postinstall": "typings install",
2936
"prestart": "npm install",
30-
"start": "webpack-dev-server --hot --port 8081",
31-
"typings": "typings",
32-
"bundle": "rimraf dist & copyfiles -f src/index.html dist/ & copyfiles -f src/assets/* dist/assets & webpack -p ./dist/bundle.js"
37+
"start": "webpack-dev-server",
38+
"webpack-prod": "cross-env NODE_ENV=production webpack --env.prod=true",
39+
"build": "rimraf dist & copyfiles -f src/index.html dist/ & copyfiles -f src/assets/* dist/assets & npm run webpack-prod"
3340
}
3441
}

src/app.component.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Component } from 'angular-ts-decorators';
2+
3+
@Component({
4+
selector: 'app',
5+
template: `<comment-list></comment-list>`
6+
})
7+
export class AppComponent {}

src/app.config.ts

-18
This file was deleted.

src/app.routes.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {AppComponent} from "./components/app.component";
2-
import {IComponentState} from "./decorators";
1+
import { IComponentState } from './main';
2+
import { AppComponent } from './app.component';
33

44
export const routes: IComponentState[] = [
55
{ state: 'root', url: '/', component: AppComponent }
6-
];
6+
];

src/components/app.component.ts

-10
This file was deleted.

src/components/comment-list/comments.component.ts

-61
This file was deleted.

src/components/comment/comment.component.ts

-91
This file was deleted.

0 commit comments

Comments
 (0)