Skip to content

Commit

Permalink
chore: aot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Jul 22, 2017
1 parent c79a301 commit b9e714f
Show file tree
Hide file tree
Showing 11 changed files with 180 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ compiled
/coverage
.ghpages-tmp
stats.json
/package-lock.json
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ addons:
cache: yarn
before_install: if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
before_deploy:
- if [[ ! -z "$TRAVIS_TAG" ]]; then npm run build:prod; fi
- if [[ ! -z "$TRAVIS_TAG" ]]; then npm run build:all; fi
deploy:
- provider: npm
skip_cleanup: true
Expand Down
3 changes: 2 additions & 1 deletion lib/bootstrap.dev.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NgModuleRef } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';

export function bootstrapRedoc() {
export function bootstrapRedoc(): Promise<NgModuleRef<AppModule>> {
return platformBrowserDynamic().bootstrapModule(AppModule);
}
4 changes: 3 additions & 1 deletion lib/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { NgModuleRef } from '@angular/core';
import { platformBrowser } from '@angular/platform-browser';
import { AppModule } from './app.module';
import { AppModuleNgFactory } from '../compiled/lib/app.module.ngfactory';

export function bootstrapRedoc() {
export function bootstrapRedoc():Promise<NgModuleRef<AppModule>> {
return platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
}
12 changes: 6 additions & 6 deletions lib/components/JsonSchema/json-schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
<table class="params-wrap" [ngClass]="{'params-array': _isArray}">
<!-- <caption> {{_displayType}} </caption> -->
<ng-template ngFor [ngForOf]="properties" let-prop="$implicit" let-last="last" [ngForTrackBy]="trackByName">
<tr class="param" [ngClass]="{'last': last,
'discriminator': prop.isDiscriminator,
'complex': prop._pointer,
'additional': prop._additional,
'expanded': subSchema.open
}">
<tr class="param"
[class.last]="last"
[class.discriminator] = "prop.isDiscriminator"
[class.complex] = "prop._pointer"
[class.additional] = "prop._additional"
[class.expanded] = "subSchema.open">
<td class="param-name">
<span class="param-name-wrap" (click)="subSchema.toggle()">
<span class="param-name-content">
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Redoc/redoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getPreOptions() {
//changeDetection: ChangeDetectionStrategy.OnPush
})
export class Redoc extends BaseComponent implements OnInit {
static _preOptions: any;
static _preOptions: any = {};

error: any;
specLoaded: boolean;
Expand Down
9 changes: 3 additions & 6 deletions lib/services/warnings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';

@Injectable()
export class WarningsService {
private static _warnings: Array<string> = [];
private static _warningsObs = new BehaviorSubject<Array<string>>([]);
public static warnings = new BehaviorSubject<Array<string>>([]);

static get warnings() {
return WarningsService._warningsObs;
}
private static _warnings: Array<string> = [];

static hasWarnings() {
return !!WarningsService._warnings.length;
}

static warn(message:string) {
WarningsService._warnings.push(message);
WarningsService._warningsObs.next(WarningsService._warnings);
WarningsService.warnings.next(WarningsService._warnings);
console.warn(message);
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"start": "webpack-dev-server --config build/webpack.dev.js --content-base demo",
"start:prod": "NODE_ENV=production npm start",
"test": "npm run lint && node ./build/run_tests.js",
"lint": "tslint --type-check -e \"lib/**/*{ngfactory|css.shim}.ts\" lib/**/*.ts",
"lint": "tslint --type-check --project tsconfig.json -e \"lib/**/*{ngfactory|css.shim}.ts\" lib/**/*.ts",
"unit": "karma start",
"pree2e": "npm run build:prod && npm run e2e-copy",
"e2e": "run-p -r protractor e2e-server",
Expand Down Expand Up @@ -74,8 +74,8 @@
"conventional-changelog-cli": "^1.3.2",
"css-loader": "^0.28.1",
"deploy-to-gh-pages": "^1.3.3",
"http-server": "^0.10.0",
"exports-loader": "^0.6.4",
"http-server": "^0.10.0",
"istanbul-instrumenter-loader": "^2.0.0",
"jasmine-core": "^2.6.4",
"jasmine-spec-reporter": "^4.1.1",
Expand All @@ -93,6 +93,7 @@
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.4",
"node-sass": "^4.5.3",
"npm-run-all": "^4.0.2",
"phantomjs-prebuilt": "^2.1.14",
"protractor": "^5.1.1",
"raw-loader": "^0.5.1",
Expand Down Expand Up @@ -125,8 +126,8 @@
"rxjs": "^5.3.1"
},
"dependencies": {
"dropkickjs": "^2.1.10",
"core-js": "^2.4.1",
"dropkickjs": "^2.1.10",
"hint.css": "^2.3.2",
"https-browserify": "^1.0.0",
"json-pointer": "^0.6.0",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.aot.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noEmit": true,
"noEmitHelpers": true,
"outDir": "./dist",
"strictNullChecks": false,
"typeRoots": [ "./node_modules/@types" ],
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"no-eval": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-use-before-declare": false,
"one-line": [true,
"check-open-brace",
"check-catch",
Expand Down
Loading

0 comments on commit b9e714f

Please sign in to comment.