diff --git a/README.md b/README.md index 50352981ab..0052719a67 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,3 @@ Currently this contains the [Angular 2 Universal Starter](https://github.com/ang ## AoT and Prod - `npm run build:prod:ngc` to compile the ngfactory files and build prod - - - - diff --git a/nodemon.json b/nodemon.json index 97a836fbb5..7c50f34761 100644 --- a/nodemon.json +++ b/nodemon.json @@ -3,5 +3,5 @@ "dist", "src/index.html" ], - "ext" : "js ts json html" + "ext": "js ts json html" } diff --git a/src/__workaround.browser.ts b/src/__workaround.browser.ts index 026f505fa3..939d7a5883 100644 --- a/src/__workaround.browser.ts +++ b/src/__workaround.browser.ts @@ -8,14 +8,14 @@ let __compiler__ = require('@angular/compiler'); import { __platform_browser_private__ } from '@angular/platform-browser'; import { __core_private__ } from '@angular/core'; if (!__core_private__['ViewUtils']) { - __core_private__['ViewUtils'] = __core_private__['view_utils']; + __core_private__['ViewUtils'] = __core_private__['view_utils']; } if (__compiler__ && __compiler__.SelectorMatcher && __compiler__.CssSelector) { - (__compiler__).__compiler_private__ = { - SelectorMatcher: __compiler__.SelectorMatcher, - CssSelector: __compiler__.CssSelector - } + (__compiler__).__compiler_private__ = { + SelectorMatcher: __compiler__.SelectorMatcher, + CssSelector: __compiler__.CssSelector + } } diff --git a/src/__workaround.node.ts b/src/__workaround.node.ts index ed39c8d319..61e1f665de 100644 --- a/src/__workaround.node.ts +++ b/src/__workaround.node.ts @@ -9,25 +9,25 @@ import { __platform_browser_private__ } from '@angular/platform-browser'; import { __core_private__ } from '@angular/core'; let patch = false; if (!__core_private__['ViewUtils']) { - patch = true; - __core_private__['ViewUtils'] = __core_private__['view_utils']; + patch = true; + __core_private__['ViewUtils'] = __core_private__['view_utils']; } if (__compiler__ && __compiler__.SelectorMatcher && __compiler__.CssSelector) { - patch = true; - (__compiler__).__compiler_private__ = { - SelectorMatcher: __compiler__.SelectorMatcher, - CssSelector: __compiler__.CssSelector - } + patch = true; + (__compiler__).__compiler_private__ = { + SelectorMatcher: __compiler__.SelectorMatcher, + CssSelector: __compiler__.CssSelector + } } if (patch) { - var __universal__ = require('angular2-platform-node/__private_imports__'); - __universal__.ViewUtils = __core_private__['view_utils']; - __universal__.CssSelector = __universal__.CssSelector || __compiler__.CssSelector; - __universal__.SelectorMatcher = __universal__.SelectorMatcher || __compiler__.SelectorMatcher; + var __universal__ = require('angular2-platform-node/__private_imports__'); + __universal__.ViewUtils = __core_private__['view_utils']; + __universal__.CssSelector = __universal__.CssSelector || __compiler__.CssSelector; + __universal__.SelectorMatcher = __universal__.SelectorMatcher || __compiler__.SelectorMatcher; } // Fix Material Support diff --git a/src/angular2-meta.ts b/src/angular2-meta.ts index f961d9e4fe..dcce3c2cb5 100644 --- a/src/angular2-meta.ts +++ b/src/angular2-meta.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; // es6-modules are used here -import {DomAdapter, getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; +import { DomAdapter, getDOM } from '@angular/platform-browser/src/dom/dom_adapter'; /** * Represent meta element. @@ -69,7 +69,7 @@ export class Meta { * @param tags * @returns {HTMLMetaElement[]} */ - addTags(...tags: Array): HTMLMetaElement[] { + addTags(...tags: Array): HTMLMetaElement[] { const presentTags = this._flattenArray(tags); if (presentTags.length === 0) return []; return presentTags.map((tag: MetaDefinition) => this._addInternal(tag)); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 515d51c6b4..8defafd570 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -8,7 +8,7 @@ import { AppComponent } from './app.component'; @NgModule({ - declarations: [ AppComponent ], + declarations: [AppComponent], imports: [ SharedModule, HomeModule, diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 1f71493173..71d5be23ff 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -4,7 +4,7 @@ import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/ changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.Emulated, selector: 'ds-home', - styleUrls: [ './home.component.css' ], + styleUrls: ['./home.component.css'], templateUrl: './home.component.html' }) export class HomeComponent { diff --git a/src/app/shared/api.service.ts b/src/app/shared/api.service.ts index b2228729b7..5487bd5a36 100644 --- a/src/app/shared/api.service.ts +++ b/src/app/shared/api.service.ts @@ -11,9 +11,9 @@ export class ApiService { } - /** - * whatever domain/feature method name - */ + /** + * whatever domain/feature method name + */ get(url: string, options?: any) { return this._http.get(url, options) .map(res => res.json()) diff --git a/src/app/shared/cache.service.ts b/src/app/shared/cache.service.ts index 87780632e5..1268c90410 100644 --- a/src/app/shared/cache.service.ts +++ b/src/app/shared/cache.service.ts @@ -4,7 +4,7 @@ import { Inject, Injectable, isDevMode } from '@angular/core'; export class CacheService { static KEY = 'CacheService'; - constructor(@Inject('LRU') public _cache: Map) { + constructor( @Inject('LRU') public _cache: Map) { } diff --git a/src/app/shared/model/model.service.ts b/src/app/shared/model/model.service.ts index 7d44a2b223..251a31542f 100644 --- a/src/app/shared/model/model.service.ts +++ b/src/app/shared/model/model.service.ts @@ -23,14 +23,14 @@ export function hashCodeString(str: string): string { // domain/feature service @Injectable() export class ModelService { - // This is only one example of one Model depending on your domain + // This is only one example of one Model depending on your domain constructor(public _api: ApiService, public _cache: CacheService) { } - /** - * whatever domain/feature method name - */ + /** + * whatever domain/feature method name + */ get(url) { // you want to return the cache if there is a response in it. // This would cache the first response so if your API isn't idempotent diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index afea237f93..0000000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/backend/api.ts b/src/backend/api.ts index 3acf45b619..51dfc177c3 100644 --- a/src/backend/api.ts +++ b/src/backend/api.ts @@ -1,9 +1,9 @@ var util = require('util'); -var {Router} = require('express'); +var { Router } = require('express'); // Our API for demos only -import {fakeDataBase} from './db'; -import {fakeDemoRedisCache} from './cache'; +import { fakeDataBase } from './db'; +import { fakeDemoRedisCache } from './cache'; // you would use cookies/token etc var USER_ID = 'f9d98cf1-1b96-464e-8755-bcc2a5c09077'; // hardcoded as an example @@ -32,9 +32,9 @@ export function serverApi(req, res) { var COUNT = 4; var TODOS = [ { id: 0, value: 'finish example', created_at: new Date(), completed: false }, - { id: 1, value: 'add tests', created_at: new Date(), completed: false }, + { id: 1, value: 'add tests', created_at: new Date(), completed: false }, { id: 2, value: 'include development environment', created_at: new Date(), completed: false }, - { id: 3, value: 'include production environment', created_at: new Date(), completed: false } + { id: 3, value: 'include production environment', created_at: new Date(), completed: false } ]; export function createTodoApi() { @@ -51,7 +51,7 @@ export function createTodoApi() { }) .post(function(req, res) { - console.log('POST', util.inspect(req.body, {colors: true})); + console.log('POST', util.inspect(req.body, { colors: true })); var todo = req.body; if (todo) { TODOS.push({ @@ -81,12 +81,12 @@ export function createTodoApi() { router.route('/todos/:todo_id') .get(function(req, res) { - console.log('GET', util.inspect(req.todo, {colors: true})); + console.log('GET', util.inspect(req.todo, { colors: true })); res.json(req.todo); }) .put(function(req, res) { - console.log('PUT', util.inspect(req.body, {colors: true})); + console.log('PUT', util.inspect(req.body, { colors: true })); var index = TODOS.indexOf(req.todo); var todo = TODOS[index] = req.body; diff --git a/src/index.html b/src/index.html index fb963692d1..979a468fcb 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,6 @@ + DSpace @@ -10,6 +11,7 @@ + @@ -18,4 +20,5 @@ + diff --git a/src/server.aot.ts b/src/server.aot.ts index 8f81f7cfc3..c7e62a929c 100644 --- a/src/server.aot.ts +++ b/src/server.aot.ts @@ -55,11 +55,11 @@ app.set('json spaces', 2); app.use(cookieParser('Angular 2 Universal')); app.use(bodyParser.json()); -app.use(interceptor((req, res)=>({ +app.use(interceptor((req, res) => ({ // don't compress responses with this request header isInterceptable: () => (!req.headers['x-no-compression']), - intercept: ( body, send ) => { - const encodings = new Set(accepts(req).encodings()); + intercept: (body, send) => { + const encodings = new Set(accepts(req).encodings()); const bodyBuffer = new Buffer(body); // url specific key for response cache const key = '__response__' + req.originalUrl || req.url; @@ -71,12 +71,12 @@ app.use(interceptor((req, res)=>({ // brotli res.setHeader('Content-Encoding', 'br'); output = compressSync(bodyBuffer); - mcache.put(key, {output, encoding: 'br'}); + mcache.put(key, { output, encoding: 'br' }); } else if (encodings.has('gzip')) { // gzip res.setHeader('Content-Encoding', 'gzip'); output = gzipSync(bodyBuffer); - mcache.put(key, {output, encoding: 'gzip'}); + mcache.put(key, { output, encoding: 'gzip' }); } } else { const { output, encoding } = mcache.get(key); @@ -87,7 +87,7 @@ app.use(interceptor((req, res)=>({ } }))); -const accessLogStream = fs.createWriteStream(ROOT + '/morgan.log', {flags: 'a'}) +const accessLogStream = fs.createWriteStream(ROOT + '/morgan.log', { flags: 'a' }) app.use(morgan('common', { skip: (req, res) => res.statusCode < 400, @@ -100,8 +100,8 @@ function cacheControl(req, res, next) { next(); } // Serve static files -app.use('/assets', cacheControl, express.static(path.join(__dirname, 'assets'), {maxAge: 30})); -app.use(cacheControl, express.static(path.join(ROOT, 'dist/client'), {index: false})); +app.use('/assets', cacheControl, express.static(path.join(__dirname, 'assets'), { maxAge: 30 })); +app.use(cacheControl, express.static(path.join(ROOT, 'dist/client'), { index: false })); // ///////////////////////// @@ -120,7 +120,7 @@ function ngApp(req, res) { preboot: false, baseUrl: '/', requestUrl: req.originalUrl, - originUrl: `http://localhost:${ app.get('port') }` + originUrl: `http://localhost:${app.get('port')}` }); } diff --git a/src/server.ts b/src/server.ts index 351a82f768..f6393a391c 100644 --- a/src/server.ts +++ b/src/server.ts @@ -57,8 +57,8 @@ function cacheControl(req, res, next) { next(); } // Serve static files -app.use('/assets', cacheControl, express.static(path.join(__dirname, 'assets'), {maxAge: 30})); -app.use(cacheControl, express.static(path.join(ROOT, 'dist/client'), {index: false})); +app.use('/assets', cacheControl, express.static(path.join(__dirname, 'assets'), { maxAge: 30 })); +app.use(cacheControl, express.static(path.join(ROOT, 'dist/client'), { index: false })); // ///////////////////////// @@ -77,7 +77,7 @@ function ngApp(req, res) { preboot: false, baseUrl: '/', requestUrl: req.originalUrl, - originUrl: `http://localhost:${ app.get('port') }` + originUrl: `http://localhost:${app.get('port')}` }); } diff --git a/src/typings.d.ts b/src/typings.d.ts index dd39e59907..e3ce18864e 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -39,7 +39,7 @@ interface SystemJS { // Extra variables that live on Global that will be replaced by webpack DefinePlugin declare var ENV: string; declare var HMR: boolean; -declare var Zone: {current: any}; +declare var Zone: { current: any }; interface GlobalEnvironment { ENV; HMR; @@ -68,6 +68,6 @@ interface WebpackRequire { } // Extend typings -interface NodeRequire extends WebpackRequire {} -interface NodeModule extends WebpackModule {} -interface Global extends GlobalEnvironment {} +interface NodeRequire extends WebpackRequire { } +interface NodeModule extends WebpackModule { } +interface Global extends GlobalEnvironment { } diff --git a/tsconfig.aot.json b/tsconfig.aot.json index 99eb05bc49..468a6d392d 100644 --- a/tsconfig.aot.json +++ b/tsconfig.aot.json @@ -24,5 +24,7 @@ }, "compileOnSave": false, "buildOnSave": false, - "atom": { "rewriteTsconfig": false } + "atom": { + "rewriteTsconfig": false + } } diff --git a/tsconfig.json b/tsconfig.json index 38cb58017b..c10735a758 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,5 +23,7 @@ }, "compileOnSave": false, "buildOnSave": false, - "atom": { "rewriteTsconfig": false } + "atom": { + "rewriteTsconfig": false + } } diff --git a/tslint.json b/tslint.json index c84aa07ebb..6b00e6bcf5 100644 --- a/tslint.json +++ b/tslint.json @@ -6,13 +6,13 @@ "directive-selector": [ true, "attribute", - "dspace", + "ds", "camelCase" ], "component-selector": [ true, "element", - "dspace", + "ds", "kebab-case" ], "use-input-property-decorator": true, @@ -27,7 +27,7 @@ "pipe-naming": [ true, "camelCase", - "dspace" + "ds" ], "component-class-suffix": true, "directive-class-suffix": true, diff --git a/webpack.prod.config.ts b/webpack.prod.config.ts index a0f1b66304..7516b4da39 100644 --- a/webpack.prod.config.ts +++ b/webpack.prod.config.ts @@ -4,7 +4,7 @@ const clone = require('js.clone'); const webpackMerge = require('webpack-merge'); const V8LazyParseWebpackPlugin = require('v8-lazy-parse-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; -import webpackConfig, { root, includeClientPackages } from './webpack.config'; +import webpackConfig, { root, includeClientPackages } from './webpack.config'; // const CompressionPlugin = require('compression-webpack-plugin'); @@ -171,8 +171,8 @@ export const serverConfig = { export default [ // Client - webpackMerge(webpackConfig[0], clone(commonConfig), clientConfig, {plugins: webpackConfig[0].plugins.concat(commonPlugins, clientPlugins) }), + webpackMerge(webpackConfig[0], clone(commonConfig), clientConfig, { plugins: webpackConfig[0].plugins.concat(commonPlugins, clientPlugins) }), // Server - webpackMerge(webpackConfig[1], clone(commonConfig), serverConfig, {plugins: webpackConfig[1].plugins.concat(commonPlugins, serverPlugins) }) + webpackMerge(webpackConfig[1], clone(commonConfig), serverConfig, { plugins: webpackConfig[1].plugins.concat(commonPlugins, serverPlugins) }) ];