Skip to content

Commit

Permalink
Update project to Angular 2 final via angular-cli.
Browse files Browse the repository at this point in the history
  • Loading branch information
JimiC committed Nov 10, 2016
1 parent e1d057d commit 3388be3
Show file tree
Hide file tree
Showing 55 changed files with 1,262 additions and 592 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"port": 4200
}
38 changes: 34 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
node_modules
dist
app/services/dev-config.ts
api/config.json
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp

# dependencies
/node_modules
/bower_components

# IDEs and editors
/.idea
/.vscode
.project
.classpath
*.launch
.settings/

# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

#System Files
.DS_Store
Thumbs.db
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2016 Sam Mitchell Finnigan and contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
121 changes: 96 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# STOMP.js Angular 2 Demo App

> A demo application using [Angular 2](https://github.com/angular/angular)+
[Typescript](https://github.com/Microsoft/TypeScript), and [STOMP.js](https://github.com/jmesnil/stomp-websocket).
> A demo application using [Angular 2](https://github.com/angular/angular) in
[Typescript](https://github.com/Microsoft/TypeScript) and [STOMP.js](https://github.com/jmesnil/stomp-websocket),
> generated with [angular-cli](https://github.com/angular/angular-cli).
This demo app implements a more ng2-faithful way of connecting to a message
queue and subscribing to messages from a STOMP topic. Includes a Typescript
Expand Down Expand Up @@ -35,46 +36,91 @@ You will also need to edit the `app/api/config.json` configuration file to set
the correct connection parameters for your message broker. When you've done
this, you can run the application locally:

```
# Run the application locally:
```bash
# Run the application locally
npm start
```

Then [http://localhost:3000](http://localhost:3000) should open in your browser.
Then [http://localhost:4200](http://localhost:4200) should open in your browser.
The app will automatically reload if you change any of the source files.

> You can overrride the default port by changing it in the `.emebr-cli` file.

## Layout

The source is located under the `app` folder:

```
├── README.md * This readme
├── e2e * End To End testing folder
│ ├── app.e2e-spec.ts * App behaviour testings
│ ├── app.po.ts * App behavior definitions
│ └── tsconfig.json * Typescript transpiler options
├── api * Example API (static for demo)
│   └── config.json * Configuration file for STOMP
├── app * Source folder
│   ├── boot.ts * boot.ts for SystemJS bootstrap
├── src * Source folder
│ ├── api * Example API folder (static for demo)
│ │ └── config.json * Configuration file for STOMP
│ │
│ ├── app * Application folder
│ │ ├── components * Components folder
│ │ │ ├── rawdata * Data streaming component folder
│ │ │ ├── rawdata.component.css * Component css file
│ │ │ ├── rawdata.component.html * Component html file
│ │ │ ├── rawdata.component.spec.ts * Component testings
│ │ │ │ └── rawdata.component.ts * Example data streaming component
│ │ │ │
│ │ │ └── status * Status component folder
│ │ │ ├── status.component.css * Component css file
│ │ │ ├── status.component.html * Component html file
│ │ │ ├── status.component.spec.ts * Component testings
│ │ │ └── status.component.ts * STOMP Status component
│ │ │
│ │ ├── services * Services folder
│ │ │ ├── config * Config service folder
│ │ │ │ ├── config.service.spec.ts * Service testings
│ │ │ │ └── config.service.ts * Service which retrieves the configuration
│ │ │ │
│ │ │ └── stomp * STOMP service folder
│ │ │ ├── index.ts * Indexing file
│ │ │ ├── stomp.config.ts * Type definition for a STOMP configuration
│ │ │ ├── stomp.service.spec.ts * Service testing
│ │ │ └── stomp.service.ts * STOMP ng2 service definition
│ │ │
│ │ ├── app.component.css * Component css file
│ │ ├── app.component.html * Component html file
│ │ ├── app.component.spec.ts * Component testings
│ │ ├── app.component.ts * Top-level app-root component
│ │ ├── app.module.ts * App module definition
│ │ └── index.ts * Indexing file
│ │
│   ├── components
│   │   ├── app.component.ts * Top-level my-app component
│   │   └── rawdata.component.tsp * Example data streaming component
│ ├── assets * Assets folder
│ │ └── .gitkeep * Placeholder to include the folder to source control
│ │
│   ├── modules
│   │   └── stompjs.d.ts * STOMP.js Typescript interface exports
│ ├── environments * Environment settings folder
│ │ ├── environment.prod.ts * Production environment settings
│ │ └── environment.ts * Development environment settings
│ │
│   └── services
│   ├── config.service.ts * Service which retrieves /api/config.json
│   ├── config.ts * Type definition for a STOMP configuration
│   └── stomp.service.ts * STOMP ng2 service definition
│ ├── favicon.ico * App favorite icon
│ ├── index.html * The root page served to browser
│ ├── main.ts * App bootstrap
│ ├── polyfills.ts *
│ ├── styles.css * Main css file
│ ├── test.ts * Testings bootstrap
│ ├── tsconfig.json * Typescript transpiler options
│ └── typings.d.ts * Typescript typings definition file
├── index.html * App page served to browser
├── package.json * npm list of packages to install
└── tsconfig.json * Typescript transpiler options
├── .editorconfig * Editor configuration file
├── .gitignore * Git ignore file
├── README.md * This file
├── angular-cli.json * Angular CLI configuration file
├── karma.config.js * Karma configuration file
├── package.json * Package info and list of dependencies to install
├── protractor.config.js * Protractor configuration file
└── tslint.json * Typescript Linter configuration file
```

Two extra directories will be generated: `dist` for the compiled app, and
`node_modules`, for installed node packages.
> Two extra directories will be generated: `dist` for the compiled app, and
`node_modules`, for the installed node packages.


## Extending
Expand Down Expand Up @@ -119,3 +165,28 @@ an issue and let me know!
MIT Licence. Essentially: do what you like with it, but give credit if credit's
due, and it's not my fault if this code eats your product/machine/whatever.


## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Deploying to Github Pages

Run `ng github-pages:deploy` to deploy to Github Pages.

## Further help

To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
59 changes: 59 additions & 0 deletions angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"project": {
"version": "1.0.0-beta.19-3",
"name": "ng2-stompjs-demo"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"styles.css"
],
"scripts": [],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}
4 changes: 0 additions & 4 deletions app/boot.ts

This file was deleted.

13 changes: 0 additions & 13 deletions app/components/app.component.ts

This file was deleted.

Loading

0 comments on commit 3388be3

Please sign in to comment.