Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Art Lowel authored and Art Lowel committed Nov 30, 2016
0 parents commit a573556
Show file tree
Hide file tree
Showing 50 changed files with 2,161 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org

root = true

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

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/__build__
/__server_build__
/node_modules
/typings
/tsd_typings/
npm-debug.log

/dist/

.idea
*.ngfactory.ts
*.css.shim.ts

.DS_Store

webpack.records.json

/npm-debug.log.*

morgan.log
46 changes: 46 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/dist/server/index.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
},
{
"name": "Attach to Process",
"type": "node",
"request": "attach",
"processId": "${command.PickProcess}",
"port": 5858,
"sourceMaps": false,
"outDir": null
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.check.workspaceVersion": false
}
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

# dspace-angular
> A UI for DSpace based on Angular 2 Universal.
Currently this contains the [Angular 2 Universal Starter](https://github.com/angular/universal-starter) codebase with a few tweaks.

## Links
- [The working group page on the DuraSpace Wiki](https://wiki.duraspace.org/display/DSPACE/DSpace+7+UI+Working+Group)
- [The project board (waffle.io)](https://waffle.io/DSpace/dspace-angular)
- [The prototype](https://github.com/DSpace-Labs/angular2-ui-prototype)

## Requirements
- [Node.js](https://nodejs.org/)

## Installation
- `npm install`

## Serve
- `npm start` to build your client app and start a web server
- `npm run build` to prepare a distributable bundle

## Watch files
- `npm run watch` to build your client app and start a web server

## Development
- run `npm start` and `npm run watch` in two separate terminals to build your client app, start a web server, and allow file changes to update in realtime

## AoT and Prod
- `npm run build:prod:ngc` to compile the ngfactory files and build prod




12 changes: 12 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Angular 2 Universal Starter",
"description": "Angular 2 Universal starter kit by @AngularClass",
"repository": "https://github.com/angular/universal-starter",
"logo": "https://cloud.githubusercontent.com/assets/1016365/10639063/138338bc-7806-11e5-8057-d34c75f3cafc.png",
"env": {
"NPM_CONFIG_PRODUCTION": {
"description": "Install `webpack` and other development modules when deploying to allow full builds.",
"value": "false"
}
}
}
7 changes: 7 additions & 0 deletions empty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
NgProbeToken: {},
_createConditionalRootRenderer: function(rootRenderer, extraTokens, coreTokens) {
return rootRenderer;
},
__platform_browser_private__: {}
};
7 changes: 7 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"watch": [
"dist",
"src/index.html"
],
"ext" : "js ts json html"
}
98 changes: 98 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"name": "dspace-angular",
"version": "0.0.0",
"description": "Angular 2 Universal UI for DSpace",
"repository": {
"type": "git",
"url": "https://github.com/dspace/dspace-angular.git"
},
"scripts": {
"watch": "webpack --watch",
"watch:dev": "npm run server & npm run watch",
"clean:dist": "rimraf dist",
"clean:ngc": "rimraf **/*.ngfactory.ts **/*.css.shim.ts",
"prebuild": "npm run clean:dist",
"build": "webpack --progress",
"build:prod:ngc": "npm run clean:ngc && npm run ngc && npm run clean:dist && npm run build:prod",
"build:prod:ngc:json": "npm run clean:ngc && npm run ngc && npm run clean:dist && npm run build:prod:json",
"build:prod": "webpack --config webpack.prod.config.ts",
"build:prod:json": "webpack --config webpack.prod.config.ts --json | webpack-bundle-size-analyzer",
"ngc": "ngc -p tsconfig.aot.json",
"prestart": "npm run build",
"server": "nodemon dist/server/index.js",
"debug:server": "node-nightly --inspect --debug-brk dist/server/index.js",
"start": "npm run server",
"debug:start": "npm run build && npm run debug:server",
"predebug": "npm run build",
"debug:build": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js",
"debug:build:prod": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --config webpack.prod.config.ts",
"debug": "node --debug-brk dist/server/index.js"
},
"dependencies": {
"@angular/common": "~2.1.2",
"@angular/compiler": "~2.1.2",
"@angular/compiler-cli": "~2.1.2",
"@angular/core": "~2.1.2",
"@angular/forms": "~2.1.2",
"@angular/http": "~2.1.2",
"@angular/platform-browser": "~2.1.2",
"@angular/platform-browser-dynamic": "~2.1.2",
"@angular/platform-server": "~2.1.2",
"@angular/router": "~3.1.2",
"@angular/upgrade": "~2.1.2",
"@angularclass/bootloader": "~1.0.1",
"@angularclass/idle-preload": "~1.0.4",
"angular2-express-engine": "~2.1.0-rc.1",
"angular2-platform-node": "~2.1.0-rc.1",
"angular2-universal": "~2.1.0-rc.1",
"angular2-universal-polyfills": "~2.1.0-rc.1",
"body-parser": "^1.15.2",
"compression": "^1.6.2",
"express": "^4.14.0",
"js.clone": "0.0.3",
"methods": "~1.1.2",
"morgan": "^1.7.0",
"preboot": "~4.5.2",
"rxjs": "5.0.0-beta.12",
"webfontloader": "^1.6.26",
"zone.js": "~0.6.26"
},
"devDependencies": {
"@types/morgan": "^1.7.32",
"@types/body-parser": "0.0.29",
"@types/compression": "0.0.29",
"@types/cookie-parser": "^1.3.29",
"@types/express": "^4.0.32",
"@types/express-serve-static-core": "^4.0.33",
"@types/hammerjs": "^2.0.32",
"@types/memory-cache": "0.0.29",
"@types/mime": "0.0.28",
"@types/node": "^6.0.38",
"@types/serve-static": "^1.7.27",
"@types/webfontloader": "^1.6.27",
"@ngtools/webpack": "~1.1.7",
"accepts": "^1.3.3",
"angular2-template-loader": "^0.4.0",
"awesome-typescript-loader": "^2.2.4",
"cookie-parser": "^1.4.3",
"express-interceptor": "^1.2.0",
"iltorb": "^1.0.13",
"imports-loader": "^0.6.5",
"json-loader": "^0.5.4",
"memory-cache": "^0.1.6",
"nodemon": "^1.10.0",
"raw-loader": "^0.5.1",
"reflect-metadata": "0.1.8",
"rimraf": "^2.5.4",
"string-replace-loader": "^1.0.5",
"ts-helpers": "^1.1.2",
"ts-node": "^1.3.0",
"typescript": "2.0.2",
"v8-lazy-parse-webpack-plugin": "^0.3.0",
"webpack": "2.1.0-beta.27",
"webpack-bundle-analyzer": "1.4.1",
"webpack-dev-middleware": "^1.8.4",
"webpack-dev-server": "2.1.0-beta.11",
"webpack-merge": "~0.16.0"
}
}
13 changes: 13 additions & 0 deletions src/+app/+about/about-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { AboutComponent } from './about.component';

@NgModule({
imports: [
RouterModule.forChild([
{ path: 'about', component: AboutComponent }
])
]
})
export class AboutRoutingModule { }
14 changes: 14 additions & 0 deletions src/+app/+about/about.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component, Inject, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';

@Component({
changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated,
selector: 'about',
template: 'About component'
})
export class AboutComponent {
constructor(@Inject('req') req: any) {
// console.log('req', req)

}
}
16 changes: 16 additions & 0 deletions src/+app/+about/about.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';

import { SharedModule } from '../shared/shared.module';
import { AboutComponent } from './about.component';
import { AboutRoutingModule } from './about-routing.module';

@NgModule({
imports: [
SharedModule,
AboutRoutingModule
],
declarations: [
AboutComponent
]
})
export class AboutModule { }
13 changes: 13 additions & 0 deletions src/+app/+home/home-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { HomeComponent } from './home.component';

@NgModule({
imports: [
RouterModule.forChild([
{ path: 'home', component: HomeComponent }
])
]
})
export class HomeRoutingModule { }
8 changes: 8 additions & 0 deletions src/+app/+home/home.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blockquote {
border-left:5px #158126 solid;
background:#fff;
padding:20px 20px 20px 40px;
}
blockquote::before {
left: 1em;
}
6 changes: 6 additions & 0 deletions src/+app/+home/home.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="home">
Home component
<strong>Async data call return value:</strong>
<pre>{{ data | json }}</pre>
<blockquote>{{ data.data }}</blockquote>
</div>
27 changes: 27 additions & 0 deletions src/+app/+home/home.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';

import { ModelService } from '../shared/model/model.service';

@Component({
changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated,
selector: 'home',
styleUrls: [ './home.component.css' ],
templateUrl: './home.component.html'
})
export class HomeComponent {
data: any = {};
constructor(public model: ModelService) {

// we need the data synchronously for the client to set the server response
// we create another method so we have more control for testing
this.universalInit();
}

universalInit() {
this.model.get('/data.json').subscribe(data => {
this.data = data;
});
}

}
16 changes: 16 additions & 0 deletions src/+app/+home/home.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';

import { SharedModule } from '../shared/shared.module';
import { HomeComponent } from './home.component';
import { HomeRoutingModule } from './home-routing.module';

@NgModule({
imports: [
SharedModule,
HomeRoutingModule
],
declarations: [
HomeComponent
]
})
export class HomeModule { }
13 changes: 13 additions & 0 deletions src/+app/+lazy/lazy-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { LazyComponent } from './lazy.component';

@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: LazyComponent }
])
]
})
export class LazyRoutingModule { }
Loading

0 comments on commit a573556

Please sign in to comment.