Update and clean up deps

This commit is contained in:
Roman Hotsiy 2016-06-23 11:34:49 +03:00
parent 53b4f55876
commit 85d72d64e3
6 changed files with 79 additions and 54 deletions

View File

@ -23,8 +23,7 @@ gulp.task('build', function (callback) {
} }
return runSequence( return runSequence(
'clean', 'clean',
'tsc', 'transpile',
'inlineTemplates',
'bundle', 'bundle',
'concatDeps', 'concatDeps',
'copyDebug', 'copyDebug',
@ -32,6 +31,14 @@ gulp.task('build', function (callback) {
); );
}); });
gulp.task('transpile', function(cb) {
return runSequence(
'tsc',
'inlineTemplates',
cb
);
});
gulp.task('copyDebug', () => { gulp.task('copyDebug', () => {
if (!argv.prod) { if (!argv.prod) {
// copy for be accessible from demo for debug // copy for be accessible from demo for debug
@ -41,8 +48,7 @@ gulp.task('copyDebug', () => {
gulp.task('rebuild', function(done) { gulp.task('rebuild', function(done) {
return runSequence( return runSequence(
'tsc', 'transpile',
'inlineTemplates',
'bundle', 'bundle',
'concatDeps', 'concatDeps',
'copyDebug', 'copyDebug',
@ -99,14 +105,14 @@ gulp.task('inlineTemplates', ['sass'], function() {
.pipe(gulp.dest(paths.tmp)); .pipe(gulp.dest(paths.tmp));
}); });
function compileSass(ext, file) { function compileSass(ext, file, cb) {
file = file.replace('../../shared/styles/variables', 'lib/shared/styles/variables'); 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('json-schema-common', 'lib/components/JsonSchema/json-schema-common');
file = file.replace('../../shared/styles/share-link', 'lib/shared/styles/share-link'); 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('../JsonSchema/lib/components/JsonSchema/json-schema-common', 'lib/components/JsonSchema/json-schema-common');
file = file.replace('../../styles/variables', 'lib/shared/styles/variables'); 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 ? [ var JS_DEPS = argv.prod ? [
@ -189,7 +195,7 @@ gulp.task('concatPrism', function() {
}); });
// needs inlineTemplates run before to create .tmp/lib folder // needs inlineTemplates run before to create .tmp/lib folder
gulp.task('injectVersionFile', ['inlineTemplates'], function() { gulp.task('injectVersionFile', function() {
var version = require('../../package.json').version; var version = require('../../package.json').version;
fs.writeFileSync(path.join(paths.tmp, 'lib/version.json'), JSON.stringify(version)); fs.writeFileSync(path.join(paths.tmp, 'lib/version.json'), JSON.stringify(version));
}) })

View File

@ -1,12 +1,20 @@
var gulp = require('gulp'); var gulp = require('gulp');
var runSequence = require('run-sequence');
var Server = require('karma').Server; var Server = require('karma').Server;
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul'); var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
gulp.task('prepare-test', function(cb) {
return runSequence(
'clean',
'transpile',
'concatPrism',
cb
);
})
/** /**
* Run test once and exit * Run test once and exit
*/ */
gulp.task('test', ['concatPrism', 'inlineTemplates', 'injectVersionFile'], function (done) { gulp.task('test', ['prepare-test'], function (done) {
new Server({ new Server({
configFile: __dirname + '/../../karma.conf.js', configFile: __dirname + '/../../karma.conf.js',
singleRun: true singleRun: true

View File

@ -2,9 +2,6 @@
import { provide, enableProdMode, ElementRef, import { provide, enableProdMode, ElementRef,
ComponentRef, AfterViewInit } from '@angular/core'; 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 { bootstrap } from '@angular/platform-browser-dynamic';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter'; import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { RedocComponent, BaseComponent } from '../base'; import { RedocComponent, BaseComponent } from '../base';
@ -63,8 +60,7 @@ export class Redoc extends BaseComponent implements AfterViewInit {
optionsService.options = options; optionsService.options = options;
optionsService.options.specUrl = optionsService.options.specUrl || specUrl; optionsService.options.specUrl = optionsService.options.specUrl || specUrl;
var providers = [ var providers = [
provide(OptionsService, {useValue: optionsService}), provide(OptionsService, {useValue: optionsService})
provide(CompilerConfig, {useValue: new CompilerConfig({genDebugInfo: false, logBindingUpdate: false})})
]; ];
if (Redoc.appRef) { if (Redoc.appRef) {
@ -75,8 +71,6 @@ export class Redoc extends BaseComponent implements AfterViewInit {
.then(() => { .then(() => {
if (!_modeLocked && !optionsService.options.debugMode) { if (!_modeLocked && !optionsService.options.debugMode) {
enableProdMode(); enableProdMode();
compilerProd();
browserProd();
_modeLocked = true; _modeLocked = true;
} }
return bootstrap(Redoc, providers); return bootstrap(Redoc, providers);

View File

@ -33,10 +33,16 @@
"configFile": "system.config.js", "configFile": "system.config.js",
"dependencies": { "dependencies": {
"@angular/common": "npm:@angular/common@^2.0.0-rc.2", "@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": "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": "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": "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": "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", "dropkickjs": "npm:dropkickjs@^2.1.8",
"es6-shim": "github:es-shims/es6-shim@^0.33.6", "es6-shim": "github:es-shims/es6-shim@^0.33.6",
"hint.css": "npm:hint.css@^2.2.1", "hint.css": "npm:hint.css@^2.2.1",
@ -76,13 +82,12 @@
} }
}, },
"devDependencies": { "devDependencies": {
"@angular/common": "^2.0.0-rc.2", "@angular/common": "^2.0.0-rc.3",
"@angular/compiler": "^2.0.0-rc.2", "@angular/compiler": "^2.0.0-rc.3",
"@angular/core": "^2.0.0-rc.2", "@angular/core": "^2.0.0-rc.2",
"@angular/platform-browser": "^2.0.0-rc.2", "@angular/platform-browser": "^2.0.0-rc.3",
"@angular/platform-browser-dynamic": "^2.0.0-rc.2", "@angular/platform-browser-dynamic": "^2.0.0-rc.3",
"@angular/platform-server": "^2.0.0-rc.2", "@angular/platform-server": "^2.0.0-rc.3",
"babel-eslint": "^4.1.6",
"babel-polyfill": "^6.3.14", "babel-polyfill": "^6.3.14",
"branch-release": "^1.0.3", "branch-release": "^1.0.3",
"browser-sync": "^2.10.1", "browser-sync": "^2.10.1",
@ -92,9 +97,8 @@
"deploy-to-gh-pages": "^1.1.2", "deploy-to-gh-pages": "^1.1.2",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-concat": "^2.6.0", "gulp-concat": "^2.6.0",
"gulp-eslint": "^1.1.1",
"gulp-if": "^2.0.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-protractor": "^2.1.0",
"gulp-rename": "^1.2.2", "gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4", "gulp-replace": "^0.5.4",
@ -106,14 +110,13 @@
"jasmine-core": "^2.4.1", "jasmine-core": "^2.4.1",
"jasmine-spec-reporter": "^2.4.0", "jasmine-spec-reporter": "^2.4.0",
"json-pointer": "^0.5.0", "json-pointer": "^0.5.0",
"json-schema-instantiator": "^0.3.0",
"json-schema-ref-parser": "^3.1.2", "json-schema-ref-parser": "^3.1.2",
"jspm": "^0.16.36", "jspm": "^0.16.36",
"karma": "^0.13.15", "karma": "^0.13.15",
"karma-babel-preprocessor": "^5.2.2", "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-coverage": "github:douglasduteil/karma-coverage#next",
"karma-jasmine": "^0.3.6", "karma-jasmine": "^1.0.2",
"karma-jspm": "^2.1.1", "karma-jspm": "^2.1.1",
"karma-mocha-reporter": "^2.0.0", "karma-mocha-reporter": "^2.0.0",
"karma-phantomjs-launcher": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0",
@ -129,12 +132,11 @@
"remap-istanbul": "^0.6.4", "remap-istanbul": "^0.6.4",
"remarkable": "^1.6.2", "remarkable": "^1.6.2",
"require-dir": "^0.3.0", "require-dir": "^0.3.0",
"rollup-plugin-commonjs": "^2.2.1",
"run-sequence": "^1.1.5", "run-sequence": "^1.1.5",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.6",
"scrollparent": "^1.0.0", "scrollparent": "^1.0.0",
"shelljs": "^0.7.0", "shelljs": "^0.7.0",
"should": "^8.0.2", "should": "^9.0.2",
"sinon": "^1.17.2", "sinon": "^1.17.2",
"systemjs-builder": "^0.15.16", "systemjs-builder": "^0.15.16",
"tslint": "^3.11.0", "tslint": "^3.11.0",

View File

@ -16,11 +16,17 @@ System.config({
}, },
map: { map: {
"@angular/common": "npm:@angular/common@2.0.0-rc.2", "@angular/common": "npm:@angular/common@2.0.0-rc.3",
"@angular/compiler": "npm:@angular/compiler@2.0.0-rc.2", "@angular/common@2.0.0-rc.3": "npm:@angular/common@2.0.0-rc.3",
"@angular/core": "npm:@angular/core@2.0.0-rc.2", "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3",
"@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.2", "@angular/compiler@2.0.0-rc.3": "npm:@angular/compiler@2.0.0-rc.3",
"@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@2.0.0-rc.2", "@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": "npm:babel-core@5.8.34",
"babel-runtime": "npm:babel-runtime@5.8.34", "babel-runtime": "npm:babel-runtime@5.8.34",
"clean-css": "npm:clean-css@3.4.17", "clean-css": "npm:clean-css@3.4.17",
@ -116,32 +122,39 @@ System.config({
"github:jspm/nodelibs-zlib@0.1.0": { "github:jspm/nodelibs-zlib@0.1.0": {
"browserify-zlib": "npm:browserify-zlib@0.1.4" "browserify-zlib": "npm:browserify-zlib@0.1.4"
}, },
"npm:@angular/common@2.0.0-rc.2": { "npm:@angular/common@2.0.0-rc.3": {
"@angular/core": "npm:@angular/core@2.0.0-rc.2", "@angular/core": "npm:@angular/core@2.0.0-rc.3",
"process": "github:jspm/nodelibs-process@0.1.2" "process": "github:jspm/nodelibs-process@0.1.2"
}, },
"npm:@angular/compiler@2.0.0-rc.2": { "npm:@angular/compiler@2.0.0-rc.3": {
"@angular/core": "npm:@angular/core@2.0.0-rc.2", "@angular/core": "npm:@angular/core@2.0.0-rc.3",
"process": "github:jspm/nodelibs-process@0.1.2" "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", "process": "github:jspm/nodelibs-process@0.1.2",
"rxjs": "npm:rxjs@5.0.0-beta.6", "rxjs": "npm:rxjs@5.0.0-beta.6",
"zone.js": "npm:zone.js@0.6.12" "zone.js": "npm:zone.js@0.6.12"
}, },
"npm:@angular/platform-browser-dynamic@2.0.0-rc.2": { "npm:@angular/platform-browser-dynamic@2.0.0-rc.3": {
"@angular/common": "npm:@angular/common@2.0.0-rc.2", "@angular/common": "npm:@angular/common@2.0.0-rc.3",
"@angular/compiler": "npm:@angular/compiler@2.0.0-rc.2", "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3",
"@angular/core": "npm:@angular/core@2.0.0-rc.2", "@angular/core": "npm:@angular/core@2.0.0-rc.3",
"@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.2", "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.3",
"process": "github:jspm/nodelibs-process@0.1.2" "process": "github:jspm/nodelibs-process@0.1.2"
}, },
"npm:@angular/platform-browser@2.0.0-rc.2": { "npm:@angular/platform-browser@2.0.0-rc.3": {
"@angular/common": "npm:@angular/common@2.0.0-rc.2", "@angular/common": "npm:@angular/common@2.0.0-rc.3",
"@angular/compiler": "npm:@angular/compiler@2.0.0-rc.2", "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.3",
"@angular/core": "npm:@angular/core@2.0.0-rc.2", "@angular/core": "npm:@angular/core@2.0.0-rc.3",
"process": "github:jspm/nodelibs-process@0.1.2" "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": { "npm:amdefine@1.0.0": {
"fs": "github:jspm/nodelibs-fs@0.1.2", "fs": "github:jspm/nodelibs-fs@0.1.2",
"module": "github:jspm/nodelibs-module@0.1.0", "module": "github:jspm/nodelibs-module@0.1.0",
@ -673,6 +686,9 @@ System.config({
"pbkdf2": "npm:pbkdf2@3.0.4", "pbkdf2": "npm:pbkdf2@3.0.4",
"systemjs-json": "github:systemjs/plugin-json@0.1.2" "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": { "npm:path-browserify@0.0.0": {
"process": "github:jspm/nodelibs-process@0.1.2" "process": "github:jspm/nodelibs-process@0.1.2"
}, },

View File

@ -1,5 +1,4 @@
'use strict'; 'use strict';
console.log('here');
const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors; const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors;
const scrollToEl = require('./helpers').scrollToEl; const scrollToEl = require('./helpers').scrollToEl;
const fixFFTest = require('./helpers').fixFFTest; const fixFFTest = require('./helpers').fixFFTest;