diff --git a/build/tasks/build.js b/build/tasks/build.js index 73753fc3..b1985cad 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -23,8 +23,7 @@ gulp.task('build', function (callback) { } return runSequence( 'clean', - 'tsc', - 'inlineTemplates', + 'transpile', 'bundle', 'concatDeps', 'copyDebug', @@ -32,6 +31,14 @@ gulp.task('build', function (callback) { ); }); +gulp.task('transpile', function(cb) { + return runSequence( + 'tsc', + 'inlineTemplates', + cb + ); +}); + gulp.task('copyDebug', () => { if (!argv.prod) { // copy for be accessible from demo for debug @@ -41,8 +48,7 @@ gulp.task('copyDebug', () => { gulp.task('rebuild', function(done) { return runSequence( - 'tsc', - 'inlineTemplates', + 'transpile', 'bundle', 'concatDeps', 'copyDebug', @@ -99,14 +105,14 @@ gulp.task('inlineTemplates', ['sass'], function() { .pipe(gulp.dest(paths.tmp)); }); -function compileSass(ext, file) { - file = file.replace('../../shared/styles/variables', 'lib/shared/styles/variables'); - file = file.replace('json-schema-common', 'lib/components/JsonSchema/json-schema-common'); - file = file.replace('../../shared/styles/share-link', 'lib/shared/styles/share-link'); - file = file.replace('../JsonSchema/lib/components/JsonSchema/json-schema-common', 'lib/components/JsonSchema/json-schema-common'); - file = file.replace('../../styles/variables', 'lib/shared/styles/variables'); +function compileSass(ext, file, cb) { + file = file.replace('../../shared/styles/variables', 'lib/shared/styles/variables'); + file = file.replace('json-schema-common', 'lib/components/JsonSchema/json-schema-common'); + file = file.replace('../../shared/styles/share-link', 'lib/shared/styles/share-link'); + file = file.replace('../JsonSchema/lib/components/JsonSchema/json-schema-common', 'lib/components/JsonSchema/json-schema-common'); + file = file.replace('../../styles/variables', 'lib/shared/styles/variables'); - return sassCopm.renderSync({data: file}).css; + cb(null, sassCopm.renderSync({data: file}).css); } var JS_DEPS = argv.prod ? [ @@ -189,7 +195,7 @@ gulp.task('concatPrism', function() { }); // needs inlineTemplates run before to create .tmp/lib folder -gulp.task('injectVersionFile', ['inlineTemplates'], function() { +gulp.task('injectVersionFile', function() { var version = require('../../package.json').version; fs.writeFileSync(path.join(paths.tmp, 'lib/version.json'), JSON.stringify(version)); }) diff --git a/build/tasks/test.js b/build/tasks/test.js index 58270bb3..6542e51b 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -1,12 +1,20 @@ var gulp = require('gulp'); - +var runSequence = require('run-sequence'); var Server = require('karma').Server; var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul'); +gulp.task('prepare-test', function(cb) { + return runSequence( + 'clean', + 'transpile', + 'concatPrism', + cb + ); +}) /** * Run test once and exit */ -gulp.task('test', ['concatPrism', 'inlineTemplates', 'injectVersionFile'], function (done) { +gulp.task('test', ['prepare-test'], function (done) { new Server({ configFile: __dirname + '/../../karma.conf.js', singleRun: true diff --git a/lib/components/Redoc/redoc.ts b/lib/components/Redoc/redoc.ts index 76703e09..df856efb 100644 --- a/lib/components/Redoc/redoc.ts +++ b/lib/components/Redoc/redoc.ts @@ -2,9 +2,6 @@ import { provide, enableProdMode, ElementRef, ComponentRef, AfterViewInit } from '@angular/core'; -import {enableProdMode as compilerProd} from '@angular/compiler/src/facade/lang'; -import {enableProdMode as browserProd } from '@angular/platform-browser/src/facade/lang'; -import {CompilerConfig} from '@angular/compiler'; import { bootstrap } from '@angular/platform-browser-dynamic'; import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter'; import { RedocComponent, BaseComponent } from '../base'; @@ -63,8 +60,7 @@ export class Redoc extends BaseComponent implements AfterViewInit { optionsService.options = options; optionsService.options.specUrl = optionsService.options.specUrl || specUrl; var providers = [ - provide(OptionsService, {useValue: optionsService}), - provide(CompilerConfig, {useValue: new CompilerConfig({genDebugInfo: false, logBindingUpdate: false})}) + provide(OptionsService, {useValue: optionsService}) ]; if (Redoc.appRef) { @@ -75,8 +71,6 @@ export class Redoc extends BaseComponent implements AfterViewInit { .then(() => { if (!_modeLocked && !optionsService.options.debugMode) { enableProdMode(); - compilerProd(); - browserProd(); _modeLocked = true; } return bootstrap(Redoc, providers); diff --git a/package.json b/package.json index 34f355c7..8a5abc3a 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,16 @@ "configFile": "system.config.js", "dependencies": { "@angular/common": "npm:@angular/common@^2.0.0-rc.2", + "@angular/common@2.0.0-rc.3": "npm:@angular/common@2.0.0-rc.3", "@angular/compiler": "npm:@angular/compiler@^2.0.0-rc.2", + "@angular/compiler@2.0.0-rc.3": "npm:@angular/compiler@2.0.0-rc.3", "@angular/core": "npm:@angular/core@^2.0.0-rc.2", + "@angular/core@2.0.0-rc.3": "npm:@angular/core@2.0.0-rc.3", "@angular/platform-browser": "npm:@angular/platform-browser@^2.0.0-rc.2", "@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@^2.0.0-rc.2", + "@angular/platform-browser-dynamic@2.0.0-rc.3": "npm:@angular/platform-browser-dynamic@2.0.0-rc.3", + "@angular/platform-browser@2.0.0-rc.3": "npm:@angular/platform-browser@2.0.0-rc.3", + "@angular/platform-server@2.0.0-rc.3": "npm:@angular/platform-server@2.0.0-rc.3", "dropkickjs": "npm:dropkickjs@^2.1.8", "es6-shim": "github:es-shims/es6-shim@^0.33.6", "hint.css": "npm:hint.css@^2.2.1", @@ -76,13 +82,12 @@ } }, "devDependencies": { - "@angular/common": "^2.0.0-rc.2", - "@angular/compiler": "^2.0.0-rc.2", + "@angular/common": "^2.0.0-rc.3", + "@angular/compiler": "^2.0.0-rc.3", "@angular/core": "^2.0.0-rc.2", - "@angular/platform-browser": "^2.0.0-rc.2", - "@angular/platform-browser-dynamic": "^2.0.0-rc.2", - "@angular/platform-server": "^2.0.0-rc.2", - "babel-eslint": "^4.1.6", + "@angular/platform-browser": "^2.0.0-rc.3", + "@angular/platform-browser-dynamic": "^2.0.0-rc.3", + "@angular/platform-server": "^2.0.0-rc.3", "babel-polyfill": "^6.3.14", "branch-release": "^1.0.3", "browser-sync": "^2.10.1", @@ -92,9 +97,8 @@ "deploy-to-gh-pages": "^1.1.2", "gulp": "^3.9.1", "gulp-concat": "^2.6.0", - "gulp-eslint": "^1.1.1", "gulp-if": "^2.0.1", - "gulp-inline-ng2-template": "^1.1.5", + "gulp-inline-ng2-template": "^2.0.4", "gulp-protractor": "^2.1.0", "gulp-rename": "^1.2.2", "gulp-replace": "^0.5.4", @@ -106,14 +110,13 @@ "jasmine-core": "^2.4.1", "jasmine-spec-reporter": "^2.4.0", "json-pointer": "^0.5.0", - "json-schema-instantiator": "^0.3.0", "json-schema-ref-parser": "^3.1.2", "jspm": "^0.16.36", "karma": "^0.13.15", "karma-babel-preprocessor": "^5.2.2", - "karma-chrome-launcher": "^0.2.2", + "karma-chrome-launcher": "^1.0.1", "karma-coverage": "github:douglasduteil/karma-coverage#next", - "karma-jasmine": "^0.3.6", + "karma-jasmine": "^1.0.2", "karma-jspm": "^2.1.1", "karma-mocha-reporter": "^2.0.0", "karma-phantomjs-launcher": "^1.0.0", @@ -129,12 +132,11 @@ "remap-istanbul": "^0.6.4", "remarkable": "^1.6.2", "require-dir": "^0.3.0", - "rollup-plugin-commonjs": "^2.2.1", "run-sequence": "^1.1.5", "rxjs": "5.0.0-beta.6", "scrollparent": "^1.0.0", "shelljs": "^0.7.0", - "should": "^8.0.2", + "should": "^9.0.2", "sinon": "^1.17.2", "systemjs-builder": "^0.15.16", "tslint": "^3.11.0", diff --git a/system.config.js b/system.config.js index 0a670a43..671df661 100644 --- a/system.config.js +++ b/system.config.js @@ -16,11 +16,17 @@ System.config({ }, map: { - "@angular/common": "npm:@angular/common@2.0.0-rc.2", - "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.2", - "@angular/core": "npm:@angular/core@2.0.0-rc.2", - "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.2", - "@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@2.0.0-rc.2", + "@angular/common": "npm:@angular/common@2.0.0-rc.3", + "@angular/common@2.0.0-rc.3": "npm:@angular/common@2.0.0-rc.3", + "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3", + "@angular/compiler@2.0.0-rc.3": "npm:@angular/compiler@2.0.0-rc.3", + "@angular/core": "npm:@angular/core@2.0.0-rc.3", + "@angular/core@2.0.0-rc.3": "npm:@angular/core@2.0.0-rc.3", + "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.3", + "@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@2.0.0-rc.3", + "@angular/platform-browser-dynamic@2.0.0-rc.3": "npm:@angular/platform-browser-dynamic@2.0.0-rc.3", + "@angular/platform-browser@2.0.0-rc.3": "npm:@angular/platform-browser@2.0.0-rc.3", + "@angular/platform-server@2.0.0-rc.3": "npm:@angular/platform-server@2.0.0-rc.3", "babel": "npm:babel-core@5.8.34", "babel-runtime": "npm:babel-runtime@5.8.34", "clean-css": "npm:clean-css@3.4.17", @@ -116,32 +122,39 @@ System.config({ "github:jspm/nodelibs-zlib@0.1.0": { "browserify-zlib": "npm:browserify-zlib@0.1.4" }, - "npm:@angular/common@2.0.0-rc.2": { - "@angular/core": "npm:@angular/core@2.0.0-rc.2", + "npm:@angular/common@2.0.0-rc.3": { + "@angular/core": "npm:@angular/core@2.0.0-rc.3", "process": "github:jspm/nodelibs-process@0.1.2" }, - "npm:@angular/compiler@2.0.0-rc.2": { - "@angular/core": "npm:@angular/core@2.0.0-rc.2", + "npm:@angular/compiler@2.0.0-rc.3": { + "@angular/core": "npm:@angular/core@2.0.0-rc.3", "process": "github:jspm/nodelibs-process@0.1.2" }, - "npm:@angular/core@2.0.0-rc.2": { + "npm:@angular/core@2.0.0-rc.3": { "process": "github:jspm/nodelibs-process@0.1.2", "rxjs": "npm:rxjs@5.0.0-beta.6", "zone.js": "npm:zone.js@0.6.12" }, - "npm:@angular/platform-browser-dynamic@2.0.0-rc.2": { - "@angular/common": "npm:@angular/common@2.0.0-rc.2", - "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.2", - "@angular/core": "npm:@angular/core@2.0.0-rc.2", - "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.2", + "npm:@angular/platform-browser-dynamic@2.0.0-rc.3": { + "@angular/common": "npm:@angular/common@2.0.0-rc.3", + "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3", + "@angular/core": "npm:@angular/core@2.0.0-rc.3", + "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.3", "process": "github:jspm/nodelibs-process@0.1.2" }, - "npm:@angular/platform-browser@2.0.0-rc.2": { - "@angular/common": "npm:@angular/common@2.0.0-rc.2", - "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.2", - "@angular/core": "npm:@angular/core@2.0.0-rc.2", + "npm:@angular/platform-browser@2.0.0-rc.3": { + "@angular/common": "npm:@angular/common@2.0.0-rc.3", + "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3", + "@angular/core": "npm:@angular/core@2.0.0-rc.3", "process": "github:jspm/nodelibs-process@0.1.2" }, + "npm:@angular/platform-server@2.0.0-rc.3": { + "@angular/common": "npm:@angular/common@2.0.0-rc.3", + "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3", + "@angular/core": "npm:@angular/core@2.0.0-rc.3", + "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.3", + "parse5": "npm:parse5@1.3.2" + }, "npm:amdefine@1.0.0": { "fs": "github:jspm/nodelibs-fs@0.1.2", "module": "github:jspm/nodelibs-module@0.1.0", @@ -673,6 +686,9 @@ System.config({ "pbkdf2": "npm:pbkdf2@3.0.4", "systemjs-json": "github:systemjs/plugin-json@0.1.2" }, + "npm:parse5@1.3.2": { + "process": "github:jspm/nodelibs-process@0.1.2" + }, "npm:path-browserify@0.0.0": { "process": "github:jspm/nodelibs-process@0.1.2" }, diff --git a/tests/e2e/redoc.spec.js b/tests/e2e/redoc.spec.js index a34d27d6..6e45f812 100644 --- a/tests/e2e/redoc.spec.js +++ b/tests/e2e/redoc.spec.js @@ -1,5 +1,4 @@ 'use strict'; -console.log('here'); const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors; const scrollToEl = require('./helpers').scrollToEl; const fixFFTest = require('./helpers').fixFFTest;