Skip to content

Commit

Permalink
update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sxlwar committed Oct 25, 2018
1 parent eeebe24 commit e681ea0
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 149 deletions.
162 changes: 83 additions & 79 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 18 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@
"test:cov": "jest --coverage",
"test:e2e": "jest --config ./test/jest-e2e.json",
"webpack": "webpack --config webpack.config.js",
"webpack:server": "export NODE_ENV=development && webpack --config webpack.server.config.js --progress --colors",
"start:ssr": "export NODE_ENV=development && node dist/server",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors --mode production",
"start:ssr": "export NODE_ENV=production && node dist/server",
"start:ssr:prod": "export NODE_ENV=production && node dist/server"
},
"dependencies": {
"@angular/animations": "^6.0.3",
"@angular/animations": "^7.0.0",
"@angular/cdk": "^7.0.1",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/common": "^7.0.0",
"@angular/compiler": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/flex-layout": "^7.0.0-beta.19",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/forms": "^7.0.0",
"@angular/http": "^7.0.0",
"@angular/material": "^7.0.1",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@angular/platform-server": "^6.0.3",
"@angular/router": "^6.0.3",
"@angular/platform-browser": "^7.0.0",
"@angular/platform-browser-dynamic": "^7.0.0",
"@angular/platform-server": "^7.0.0",
"@angular/router": "^7.0.0",
"@nestjs/common": "^5.1.0",
"@nestjs/core": "^5.1.0",
"@nestjs/ng-universal": "^0.1.1",
Expand All @@ -45,18 +45,21 @@
"@nguniversal/module-map-ngfactory-loader": "^7.0.2",
"codemirror": "^5.40.2",
"config": "^2.0.1",
"core-js": "^2.5.4",
"dotenv": "^6.1.0",
"hammerjs": "^2.0.8",
"helmet": "^3.13.0",
"joi": "^14.0.0",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"mysql": "^2.16.0",
"ng2-file-upload": "^1.3.0",
"ngx-markdown": "^7.0.0",
"prismjs": "^1.15.0",
"qiniu": "^7.2.1",
"qiniu-js": "^2.5.1",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.2.2",
"rxjs": "^6.3.3",
"typeorm": "^0.2.7",
"typescript": "^3.0.1",
"uuid": "^3.3.2",
Expand All @@ -68,15 +71,15 @@
"@types/jest": "^23.3.1",
"@types/joi": "^13.6.1",
"@types/lodash": "^4.14.116",
"@types/node": "^10.7.1",
"@types/node": "^10.12.0",
"@types/supertest": "^2.0.5",
"jest": "^23.5.0",
"nodemon": "^1.18.3",
"prettier": "^1.14.2",
"rimraf": "^2.6.2",
"supertest": "^3.1.0",
"ts-jest": "^23.1.3",
"ts-loader": "^4.4.2",
"ts-loader": "^5.2.2",
"ts-node": "^7.0.1",
"tsconfig-paths": "^3.5.0",
"tslint": "5.11.0",
Expand Down
13 changes: 2 additions & 11 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import { Controller, Get, UseInterceptors } from '@nestjs/common';

import { AppService } from './app.service';
import { HomePageInterceptor, StaticFileInterceptor } from './interceptor/app.interceptor';
import { Controller } from '@nestjs/common';

@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
constructor() {}

@Get('/')
@UseInterceptors(HomePageInterceptor)
root() {}

// @Get('*.*')
// @UseInterceptors(StaticFileInterceptor)
// page() {}
}
11 changes: 6 additions & 5 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import { AngularUniversalModule, applyDomino } from '@nestjs/ng-universal';
import { join } from 'path';
import * as domino from 'domino';

const ssrPath = join(process.cwd(), 'dist');
const BROWSER_DIR = join(process.cwd(), 'dist/browser');

// applyDomino 这个方法上没有加navigator, 这里手动加上
(function patchWindow() {
// 这个方法上没有加navigator
const tpl = join(ssrPath, 'browser', 'index.html');
const tpl = join(BROWSER_DIR, 'index.html');
const win = domino.createWindow(tpl);

global['navigator'] = win.navigator;
Expand All @@ -36,8 +36,9 @@ const ssrPath = join(process.cwd(), 'dist');
AuthModule,
UploadModule,
AngularUniversalModule.forRoot({
viewsPath: join(ssrPath, 'browser'),
bundle: require(ssrPath + '/browser/main'),
viewsPath: BROWSER_DIR,
bundle: require('./../dist/server/main.js'),
extraProviders: [],
}),
],
controllers: [AppController],
Expand Down
36 changes: 0 additions & 36 deletions src/interceptor/app.interceptor.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { Global, Module } from '@nestjs/common';

import { ConfigService } from './config/config.service';

const ENV_PATH = process.cwd() + '/config/' + process.env.NODE_ENV + '.env';

@Global()
@Module({
providers: [
{
provide: ConfigService,
useValue: new ConfigService(`config/${process.env.NODE_ENV}.env`),
useValue: new ConfigService(ENV_PATH),
},
],
exports: [ConfigService],
Expand Down
5 changes: 3 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const path = require('path');
const nodeExternals = require('webpack-node-externals');

module.exports = {
entry: ['webpack/hot/poll?100', './src/main.ts'],
watch: true,
// entry: ['webpack/hot/poll?100', './src/main.ts'],
entry: './src/main.ts',
// watch: true,
target: 'node',
externals: [
nodeExternals({
Expand Down

0 comments on commit e681ea0

Please sign in to comment.