Move to webpack + AoT compilation

This commit is contained in:
Roman Hotsiy 2016-08-28 21:46:10 +03:00
parent 3aa586cced
commit a65ecfa442
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
65 changed files with 917 additions and 1582 deletions

10
.gitignore vendored
View File

@ -20,11 +20,17 @@ npm-debug.log*
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
#jspm
jspm_packages
# compiled css
lib/**/*.css
# files produced by ngc
lib/**/*.ngfactory.ts
lib/**/*.css.shim.ts
# other
/dist
/demo/build
.tmp
/coverage
.ghpages-tmp
stats.json

View File

@ -25,12 +25,11 @@ addons:
cache:
directories:
- node_modules
- jspm_packages
before_install:
- travis_retry npm install jspm
- jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN
before_script:
- npm run jspm-install
- npm run e2e-server > /dev/null & # kill e2e server
- sleep 3 # give server time to start
after_script:
- kill %1 # kill e2e server
before_deploy:
- npm run build-dist
deploy:

9
build/helpers.js Normal file
View File

@ -0,0 +1,9 @@
const path = require('path');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [__dirname, '..'].concat(args));
}
module.exports = {
root: root
}

View File

@ -1,15 +1,9 @@
var path = require('path');
var paths = {
source: 'lib/**/*.ts',
html: 'lib/**/*.html',
scss: 'lib/**/*.scss',
sourceEntryPoint: 'lib/index.js',
outputName: 'redoc',
outputName: 'redoc.min.js',
output: 'dist/',
tmp: '.tmp/',
demo: 'demo/**/*',
tests: '{lib,tests}/**/*.spec.ts',
releases: 'demo/releases/'
}

View File

@ -1,165 +0,0 @@
var gulp = require('gulp');
var runSequence = require('run-sequence');
var Builder = require('systemjs-builder');
var inlineNg2Template = require('gulp-inline-ng2-template');
var path = require('path');
var sourcemaps = require('gulp-sourcemaps');
var paths = require('../paths');
var fs= require('fs');
var concat = require('gulp-concat');
var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var rename = require('gulp-rename');
var argv = require('yargs').argv;
var gulpIf = require('gulp-if');
var sassCopm = require('node-sass');
var ts = require('typescript');
gulp.task('build', function (callback) {
if (argv.skipRebuild) {
console.log('>>> Rebuild skipped')
return callback();
}
return runSequence(
'clean',
'transpile',
'bundle',
'concatDeps',
'copyDebug',
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
cp(paths.redocBuilt + '.js', paths.redocBuilt + '.min.js');
}
});
gulp.task('tsc', function() {
exec('tsc -v');
exec('tsc -p ./tsconfig.json');
});
gulp.task('inlineTemplates', ['sass'], function() {
return gulp.src('.tmp/**/*.js', { base: './tmp' })
.pipe(replace(/'(.*?)\.css'/g, '\'$1.scss\''))
.pipe(inlineNg2Template({
base: './',
useRelativePaths: true,
styleProcessor: compileSass,
customFilePath: function(ext, file) {
var cwd = process.cwd();
var relative = path.relative(cwd, file);
relative = relative.substring('5');
return path.join(cwd, relative);
}
}))
.pipe(gulp.dest(paths.tmp));
});
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');
cb(null, sassCopm.renderSync({data: file}).css);
}
var JS_DEPS = argv.prod ? [
'lib/utils/browser-update.js',
'node_modules/zone.js/dist/zone.min.js',
'node_modules/reflect-metadata/Reflect.js',
'node_modules/babel-polyfill/dist/polyfill.min.js'
]: [
'lib/utils/browser-update.js',
'node_modules/zone.js/dist/zone.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/reflect-metadata/Reflect.js',
'node_modules/babel-polyfill/dist/polyfill.js'
];
var outputFileName = paths.redocBuilt + (argv.prod ? '.min.js' : '.js');
gulp.task('sass', function () {
return gulp.src(paths.scss, { base: './' })
.pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(gulp.dest(paths.tmp));
});
// concatenate angular2 deps
gulp.task('concatDeps', ['concatPrism'], function() {
return gulp.src(JS_DEPS.concat([path.join(paths.tmp, 'prismjs-bundle.js'), outputFileName]))
.pipe(gulpIf(!argv.prod, sourcemaps.init({loadMaps: true})))
.pipe(concat(outputFileName))
.pipe(gulpIf(!argv.prod, sourcemaps.write('.')))
.pipe(gulp.dest('.'))
});
gulp.task('bundle', ['injectVersionFile'], function bundle(done) {
mkdir('-p', 'dist');
cp('lib/index.js', path.join(paths.tmp, paths.sourceEntryPoint));
var builder = new Builder('./', 'system.config.js');
builder
.buildStatic(path.join(paths.tmp, paths.sourceEntryPoint),
outputFileName,
{ format:'umd', sourceMaps: !argv.prod, lowResSourceMaps: true, minify: argv.prod, mangle: false, globalName: 'Redoc' }
)
.then(() => {
// wait some time to allow flush
setTimeout(() => done(), 500);
})
.catch(err => done(err));
});
gulp.task('concatPrism', function() {
require('../../system.config.js');
var prismFolder = System.normalizeSync('prismjs').substring(8);
prismFolder = prismFolder.substring(0, prismFolder.length -3);
var prismFiles = [
'prism.js',
'components/prism-actionscript.js',
'components/prism-c.js',
'components/prism-cpp.js',
'components/prism-csharp.js',
'components/prism-php.js',
'components/prism-coffeescript.js',
'components/prism-go.js',
'components/prism-haskell.js',
'components/prism-java.js',
'components/prism-lua.js',
'components/prism-matlab.js',
'components/prism-perl.js',
'components/prism-python.js',
'components/prism-r.js',
'components/prism-ruby.js',
'components/prism-bash.js',
'components/prism-swift.js',
'components/prism-objectivec.js',
'components/prism-scala.js'
].map(file => path.join(prismFolder, file));
return gulp.src(prismFiles)
.pipe(concat(path.join(paths.tmp, 'prismjs-bundle.js')))
.pipe(gulp.dest('.'));
});
// needs inlineTemplates run before to create .tmp/lib folder
gulp.task('injectVersionFile', function() {
var version = require('../../package.json').version;
var exportStatement = `export var redocVersion = "${version}"`;
fs.writeFileSync(path.join(paths.tmp, 'lib/version.js'), exportStatement);
})

View File

@ -1,9 +0,0 @@
var gulp = require('gulp');
var paths = require('../paths');
var del = require('del');
var vinylPaths = require('vinyl-paths');
gulp.task('clean', function () {
return gulp.src([paths.output, paths.tmp])
.pipe(vinylPaths(del));
});

View File

@ -1,34 +0,0 @@
var gulp = require('gulp');
var gp = require('gulp-protractor');
var browserSync = require('browser-sync').create('bs-e2e');
gulp.task('test-server', function (done) {
browserSync.init({
open: false,
notify: false,
port: 3000,
ghostMode: false,
server: {
baseDir: './tests/e2e',
routes: {
'/dist': './dist',
'/swagger.yml': './demo/swagger.yml'
},
}
}, done);
});
gulp.task('e2e', ['build', 'test-server'], function(done) {
gulp.src(['tests/e2e/**/*.js'], { read:false })
.pipe(gp.protractor({
configFile: './protractor.conf.js'
})).on('error', function(e) {
browserSync.exit();
throw e;
done();
}).on('end', function() {
browserSync.exit();
done();
});
});

View File

@ -1,15 +0,0 @@
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var paths = require('../paths');
gulp.task('lint', function () {
return gulp.src([paths.source, paths.tests])
.pipe(tslint({
rulesDirectory: 'node_modules/codelyzer'
}))
.pipe(tslint.report(require('tslint-stylish'), {
emitError: true,
sort: true,
bell: true
}));
});

View File

@ -1,17 +0,0 @@
var gulp = require('gulp');
var browserSync = require('browser-sync').create('bs');
gulp.task('serve', ['watch'], function (done) {
browserSync.init({
open: false,
notify: false,
port: 9000,
server: {
baseDir: './demo',
routes: {
'/dist': './dist'
},
},
reloadDelay: 500
}, done);
});

View File

@ -1,52 +0,0 @@
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',
'injectVersionFile',
cb
);
})
/**
* Run test once and exit
*/
gulp.task('test', ['prepare-test'], function (done) {
new Server({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true
}, karmaDone).start();
function karmaDone (exitCode) {
remapCoverage(done, exitCode);
}
});
function remapCoverage(done, statusCode) {
console.log('Remapping coverage to TypeScript format...');
gulp.src('coverage/**/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'lcovonly': 'coverage/lcov.info',
'text-summary': 'coverage/text-summary.txt',
'html': 'coverage'
}
}))
.on('finish', function () {
console.log('Remapping done!');
console.log(cat('coverage/text-summary.txt').stdout);
console.log('Test Done with exit code: ' + statusCode);
if (process.env.TRAVIS) {
console.log('uploading to coveralls')
var out = cat('coverage/lcov.info').exec('coveralls');
if (out.code !== 0) {
console.warn('Failed upload to coveralls');
}
}
done(statusCode);
});
};

View File

@ -1,14 +0,0 @@
var gulp = require('gulp');
var paths = require('../paths');
var browserSync = require('browser-sync').get('bs');
function changed(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
}
gulp.task('watch', ['build'], function () {
gulp.watch([ paths.source ], [ 'build', browserSync.reload ]).on('change', changed);
gulp.watch([ paths.html ], [ 'build', browserSync.reload]).on('change', changed);
gulp.watch([ paths.scss ], [ 'build', browserSync.reload]).on('change', changed);
gulp.watch([ paths.demo ], [ '', browserSync.reload ]).on('change', changed);
});

98
build/webpack.dev.js Normal file
View File

@ -0,0 +1,98 @@
const webpack = require('webpack');
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
const root = require('./helpers').root;
const VERSION = JSON.stringify(require('../package.json').version);
// TODO Refactor common parts of config
module.exports = {
context: root(),
devtool: 'cheap-module-source-map',
debug: false,
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'],
root: root('lib'),
descriptionFiles: ['package.json'],
modules: [
'node_modules',
root('lib')
],
alias: {
'./lib/bootstrap': root('lib/bootstrap.dev'),
http: 'stream-http',
https: 'stream-http'
}
},
externals: {
"jquery": "jQuery"
},
node: {
fs: "empty"
},
entry: {
'redoc': './lib/index.ts',
'vendor': './lib/vendor.ts',
'polyfills': './lib/polyfills.ts'
},
devServer: {
outputPath: root('dist'),
watchOptions: {
poll: true
},
port: 9000,
hot: true,
stats: {
modules: false,
cached: false,
chunk: false
}
},
output: {
path: root('dist'),
filename: '[name].js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js'
},
module: {
loaders: [{
test: /\.ts$/,
loaders: [
'awesome-typescript-loader',
'angular2-template-loader'
],
exclude: [/\.(spec|e2e)\.ts$/]
},{
test: /lib\/.*\.css$/,
loaders: ['raw-loader'],
exclude: [/redoc-initial-styles\.css$/]
},{
test: /\.css$/,
loaders: ['style', 'css?-import'],
exclude: [/lib\/(?!.*redoc-initial-styles).*\.css$/]
},{
test: /\.html$/,
loader: 'raw-loader'
}]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'polyfills'],
minChunks: Infinity
}),
new webpack.DefinePlugin({
'IS_PRODUCTION': false,
'LIB_VERSION': VERSION
}),
new ForkCheckerPlugin()
],
}

82
build/webpack.prod.js Normal file
View File

@ -0,0 +1,82 @@
const webpack = require('webpack');
const VERSION = JSON.stringify(require('../package.json').version);
const root = require('./helpers').root;
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
context: root(),
debug: false,
devtool: 'cheap-module-source-map',
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'],
root: root('lib'),
descriptionFiles: ['package.json'],
modules: [
'node_modules',
root('lib')
],
alias: {
http: 'stream-http',
https: 'stream-http'
}
},
externals: {
"jquery": "jQuery"
},
node: {
fs: "empty"
},
entry: {
'redoc': ['./lib/polyfills.ts', './lib/vendor.ts', './lib/index.ts']
},
output: {
path: root('dist'),
filename: '[name].min.js',
sourceMapFilename: '[name].min.map',
library: 'Redoc',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
// preLoaders: [{
// test: /\.js$/,
// loader: 'source-map'
// // },
loaders: [{
test: /\.ts$/,
loader: 'awesome-typescript-loader',
exclude: /(node_modules)/
}, {
test: /\.css$/,
loaders: ['style', 'css?-import']
}]
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true
},
mangle: { screw_ie8 : true },
output: {
comments: false
},
sourceMap: false
}),
new webpack.DefinePlugin({
'IS_PRODUCTION': true,
'LIB_VERSION': VERSION
})
],
}

100
build/webpack.test.js Normal file
View File

@ -0,0 +1,100 @@
const webpack = require('webpack');
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
const root = require('./helpers').root;
const VERSION = JSON.stringify(require('../package.json').version);
module.exports = {
//context: root(),
devtool: 'inline-source-map',
debug: true,
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'],
root: root('lib'),
descriptionFiles: ['package.json'],
modules: [
'node_modules',
root('lib'),
],
alias: {
'./lib/bootstrap': root('lib/bootstrap.dev'),
http: 'stream-http',
https: 'stream-http'
}
},
externals: {
"jquery": "jQuery"
},
node: {
fs: "empty"
},
output: {
path: root('dist'),
filename: '[name].js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js'
},
module: {
loaders: [ {
test: /\.ts$/,
loaders: [
'awesome-typescript-loader'
],
query: {
"sourceMap": false,
"inlineSourceMap": true,
"removeComments": true,
"module": "commonjs"
}
}, {
test: /\.ts$/,
loaders: [
'angular2-template-loader'
],
exclude: [/\.(spec|e2e)\.ts$/]
},{
test: /lib\/.*\.css$/,
loaders: ['raw-loader'],
exclude: [/redoc-initial-styles\.css$/]
},{
test: /\.css$/,
loaders: ['style', 'css?-import'],
exclude: [/lib\/(?!.*redoc-initial-styles).*\.css$/]
},{
test: /\.html$/,
loader: 'raw-loader'
}],
postLoaders: [
/**
* Instruments JS files with Istanbul for subsequent code coverage reporting.
* Instrument only testing sources.
*
* See: https://github.com/deepsweet/istanbul-instrumenter-loader
*/
{
test: /\.(js|ts)$/, loader: 'istanbul-instrumenter-loader',
include: root('lib'),
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/
]
}
]
},
plugins: [
new webpack.DefinePlugin({
'IS_PRODUCTION': false,
'LIB_VERSION': VERSION
}),
new ForkCheckerPlugin()
],
}

View File

@ -25,7 +25,10 @@
<redoc scroll-y-offset="body > nav" spec-url='swagger.yaml'></redoc>
<script src="main.js"> </script>
<script src="https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js"> </script>
<script src="/webpack-dev-server.js"></script>
<script src="/polyfills.js"></script>
<script src="/vendor.js"></script>
<script src="/redoc.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

View File

@ -71,5 +71,4 @@
});
});
});
//window.redocDebugMode = true;
})();

View File

@ -1,75 +1,47 @@
module.exports = function (config) {
config.set({
frameworks: ['phantomjs-shim', 'jspm', 'jasmine', 'sinon', 'should'],
preprocessors: {
'.tmp/lib/**/!(*spec).js': ['babel', 'coverage']
},
babelPreprocessor: {
options: {
sourceMap: 'inline',
"optional": [
"runtime",
"optimisation.modules.system",
"es7.decorators",
"es7.classProperties"
]
},
sourceFileName: function(file) {
return file.originalPath;
}
},
const testWebpackConfig = require('./build/webpack.test.js');
const travis = process.env.TRAVIS;
coverageReporter: {
instrumenters: { isparta : require('isparta') },
instrumenter: {
'.tmp/lib/**/!(*spec).js': 'isparta'
},
dir: 'coverage/',
reporters: [
{type: 'html'},
{type: 'lcov'},
{type: 'json'}
]
},
client: {
chai: {
truncateThreshold: 0
}
},
//load angular dependencies and browser polyfills
files: [
'node_modules/zone.js/dist/zone.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/proxy.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/babel-polyfill/dist/polyfill.js',
'./node_modules/reflect-metadata/Reflect.js',
'.tmp/prismjs-bundle.js'
],
config.set({
frameworks: ['phantomjs-shim', 'jasmine', 'sinon', 'should'],
preprocessors: {
'./tests/spec-bundle.js': ['coverage', 'webpack', 'sourcemap']
},
jspm: {
config: 'system.config.js',
loadFiles: ['.tmp/tests/setup.js', '.tmp/tests/helpers.js', '.tmp/lib/**/*.js',
'.tmp/tests/unit/*.js'],
serveFiles: ['tests/schemas/**/*.json','tests/schemas/**/*.yml', 'lib/**/*.html',
'.tmp/*js', '.tmp/lib/**/*.css']
},
coverageReporter: {
dir: 'coverage/',
reporters: [
{type: 'html'},
{type: 'lcov'},
{type: 'json'},
{type: 'text-summary'}
]
},
webpack: testWebpackConfig,
client: {
chai: {
truncateThreshold: 0
}
},
files: [
{ pattern: './tests/spec-bundle.js', watched: false },
{ pattern: 'tests/schemas/**/*.json', included: false },
{ pattern: 'tests/schemas/**/*.yml', included: false },
{ pattern: 'lib/**/*.html', included: false },
{ pattern: 'lib/**/*.css', included: false }
],
proxies: {
'/.tmp/': '/base/.tmp/',
'/tests/schemas': '/base/tests/schemas',
'/lib/components/redoc/redoc-initial-styles.scss': '/base/.tmp/lib/components/Redoc/redoc-initial-styles.scss',
'/lib/version.json': '/base/.tmp/lib/version.json',
'/lib/': '/base/lib/',
'/jspm_packages/': '/base/jspm_packages/',
'/node_modules/': '/base/node_modules/'
},
reporters: ['mocha', 'coverage'],
proxies: {
'/tests/schemas': '/base/tests/schemas',
'/lib/': '/base/lib/',
'/node_modules/': '/base/node_modules/'
},
colors: true,
singleRun: true,
reporters: travis ? ['mocha', 'coverage', 'coveralls'] : ['mocha', 'coverage'],
browsers: ['PhantomJS'],
browsers: ['PhantomJS'],
browserNoActivityTimeout: 60000
});
browserNoActivityTimeout: 60000
});
}

6
lib/bootstrap.dev.ts Normal file
View File

@ -0,0 +1,6 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { RedocModule } from './redoc.module';
export function bootstrapRedoc() {
return platformBrowserDynamic().bootstrapModule(RedocModule);
}

6
lib/bootstrap.ts Normal file
View File

@ -0,0 +1,6 @@
import { platformBrowser } from '@angular/platform-browser';
import { RedocModuleNgFactory } from './redoc.module.ngfactory';
export function bootstrapRedoc() {
return platformBrowser().bootstrapModuleFactory(RedocModuleNgFactory);
}

View File

@ -6,7 +6,7 @@
</p>
<p>
<!-- TODO: create separate components for contact and license ? -->
<span *ngIf="info.contact"> Contact:
<span *ngIf="info?.contact"> Contact:
<a *ngIf="info.contact.url" href="{{info.contact.url}}">
{{info.contact.name || info.contact.url}}</a>
<a *ngIf="info.contact.email" href="mailto:{{info.contact.email}}">

View File

@ -1,5 +1,5 @@
'use strict';
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { SpecManager, BaseComponent } from '../base';
import { OptionsService, MenuService } from '../../services/index';
@ -9,8 +9,8 @@ import { OptionsService, MenuService } from '../../services/index';
templateUrl: './api-info.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ApiInfo extends BaseComponent {
info: any;
export class ApiInfo extends BaseComponent implements OnInit {
info: any = {};
specUrl: String;
constructor(specMgr:SpecManager, private optionsService:OptionsService, private menuServ: MenuService) {
super(specMgr);
@ -23,4 +23,8 @@ export class ApiInfo extends BaseComponent {
this.info.version = 'v' + this.info.version;
}
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,5 +1,5 @@
'use strict';
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
@Component({
@ -8,7 +8,7 @@ import { BaseComponent, SpecManager } from '../base';
templateUrl: './api-logo.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ApiLogo extends BaseComponent {
export class ApiLogo extends BaseComponent implements OnInit {
logo:any = {};
constructor(specMgr:SpecManager) {
@ -21,4 +21,8 @@ export class ApiLogo extends BaseComponent {
this.logo.imgUrl = logoInfo.url;
this.logo.bgColor = logoInfo.backgroundColor || 'transparent';
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,6 +1,6 @@
'use strict';
import { Component, Input, Renderer, ElementRef } from '@angular/core';
import { Component, Input, Renderer, ElementRef, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import { SchemaNormalizer, SchemaHelper } from '../../services/index';
@ -10,7 +10,7 @@ import { SchemaNormalizer, SchemaHelper } from '../../services/index';
templateUrl: './json-schema.html',
styleUrls: ['./json-schema.css']
})
export class JsonSchema extends BaseComponent {
export class JsonSchema extends BaseComponent implements OnInit {
@Input() pointer: string;
@Input() final: boolean = false;
@Input() nestOdd: boolean;
@ -104,4 +104,8 @@ export class JsonSchema extends BaseComponent {
trackByIdx(index: number, item: any): number {
return index;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,5 +1,5 @@
'use strict';
import { Input, Component } from '@angular/core';
import { Input, Component, OnInit } from '@angular/core';
import JsonPointer from '../../utils/JsonPointer';
import { BaseComponent, SpecManager } from '../base';
import { SchemaHelper } from '../../services/schema-helper.service';
@ -9,7 +9,7 @@ import { SchemaHelper } from '../../services/schema-helper.service';
templateUrl: './method.html',
styleUrls: ['./method.css'],
})
export class Method extends BaseComponent {
export class Method extends BaseComponent implements OnInit {
@Input() pointer:string;
@Input() tag:string;
@ -46,4 +46,8 @@ export class Method extends BaseComponent {
let bodyParam = pathParams.find(param => param.in === 'body');
return bodyParam;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,5 +1,5 @@
'use strict';
import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import { SchemaHelper } from '../../services/index';
@ -8,7 +8,7 @@ import { SchemaHelper } from '../../services/index';
templateUrl: './methods-list.html',
styleUrls: ['./methods-list.css']
})
export class MethodsList extends BaseComponent {
export class MethodsList extends BaseComponent implements OnInit {
@Input() pointer:string;
tags:Array<any> = [];
@ -36,4 +36,8 @@ export class MethodsList extends BaseComponent {
trackByTagName(idx, el) {
return el.name;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,5 +1,5 @@
'use strict';
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { Component, Input, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import { SchemaHelper } from '../../services/schema-helper.service';
@ -14,7 +14,7 @@ function safePush(obj, prop, item) {
styleUrls: ['./params-list.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ParamsList extends BaseComponent {
export class ParamsList extends BaseComponent implements OnInit {
@Input() pointer:string;
params: Array<any>;
@ -73,4 +73,8 @@ export class ParamsList extends BaseComponent {
params.forEach((param) => safePush(res, param.in, param));
return res;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -2,16 +2,14 @@
import { ElementRef, ComponentRef, AfterViewInit, Component } from '@angular/core';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { BrowserDomAdapter as DOM } from '../../utils/browser-adapter';
import { BaseComponent } from '../base';
import detectScollParent from 'scrollparent';
import * as detectScollParent from 'scrollparent';
import { SpecManager } from '../../utils/SpecManager';
import { OptionsService, RedocEventsService } from '../../services/index';
var dom = new BrowserDomAdapter();
@Component({
selector: 'redoc',
templateUrl: './redoc.html',
@ -25,22 +23,22 @@ export class Redoc extends BaseComponent implements AfterViewInit {
private element: any;
static showLoadingAnimation() {
let elem = dom.query('redoc');
dom.addClass(elem, 'loading');
let elem = DOM.query('redoc');
DOM.addClass(elem, 'loading');
}
static hideLoadingAnimation() {
let redocEl = dom.query('redoc');
let redocEl = DOM.query('redoc');
if (!redocEl) return;
dom.addClass(redocEl, 'loading-remove');
DOM.addClass(redocEl, 'loading-remove');
setTimeout(() => {
dom.removeClass(redocEl, 'loading-remove');
dom.removeClass(redocEl, 'loading');
DOM.removeClass(redocEl, 'loading-remove');
DOM.removeClass(redocEl, 'loading');
}, 400);
}
static displayError(err) {
let redocEl = dom.query('redoc');
let redocEl = DOM.query('redoc');
if (!redocEl) return;
let heading = 'Oops... ReDoc failed to render this spec';
let details = err.message;
@ -56,7 +54,9 @@ export class Redoc extends BaseComponent implements AfterViewInit {
this.element = elementRef.nativeElement;
//parse options (top level component doesn't support inputs)
optionsMgr.parseOptions( this.element );
optionsMgr.options.$scrollParent = detectScollParent( this.element );
let scrollParent = detectScollParent( this.element );
if (scrollParent === DOM.defaultDoc().body) scrollParent = window;
optionsMgr.options.$scrollParent = scrollParent;
this.options = optionsMgr.options;
this.events = events;
}

View File

@ -1,7 +1,7 @@
'use strict';
import { Component, ViewChildren, QueryList, EventEmitter, Input,
ChangeDetectionStrategy } from '@angular/core';
ChangeDetectionStrategy, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import JsonPointer from '../../utils/JsonPointer';
@ -14,7 +14,7 @@ import { RedocEventsService } from '../../services/index';
styleUrls: ['./request-samples.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RequestSamples extends BaseComponent {
export class RequestSamples extends BaseComponent implements OnInit {
@Input() pointer:string;
@Input() schemaPointer:string;
@ViewChildren(Tabs) childQuery:QueryList<Tabs>;
@ -38,4 +38,8 @@ export class RequestSamples extends BaseComponent {
this.schemaPointer = JsonPointer.join(this.schemaPointer, 'schema');;
this.samples = this.componentSchema['x-code-samples'] || [];
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,6 +1,6 @@
'use strict';
import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import JsonPointer from '../../utils/JsonPointer';
import { statusCodeType } from '../../utils/helpers';
@ -16,7 +16,7 @@ function isNumeric(n) {
templateUrl: './responses-list.html',
styleUrls: ['./responses-list.css']
})
export class ResponsesList extends BaseComponent {
export class ResponsesList extends BaseComponent implements OnInit {
@Input() pointer:string;
responses: Array<any>;
@ -65,4 +65,8 @@ export class ResponsesList extends BaseComponent {
trackByCode(idx, el) {
return el.code;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,6 +1,6 @@
'use strict';
import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import JsonPointer from '../../utils/JsonPointer';
import { statusCodeType } from '../../utils/helpers';
@ -20,7 +20,7 @@ function hasExample(response) {
templateUrl: './responses-samples.html',
styleUrls: ['./responses-samples.css'],
})
export class ResponsesSamples extends BaseComponent {
export class ResponsesSamples extends BaseComponent implements OnInit {
@Input() pointer:string;
data: any;
@ -55,4 +55,8 @@ export class ResponsesSamples extends BaseComponent {
.filter(response => hasExample(response));
this.data.responses = responses;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,6 +1,6 @@
'use strict';
import { Component, ElementRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { Component, ElementRef, Input, ChangeDetectionStrategy, OnInit } from '@angular/core';
import * as OpenAPISampler from 'openapi-sampler';
@ -15,7 +15,7 @@ import { SchemaNormalizer } from '../../services/schema-normalizer.service';
styleUrls: ['./schema-sample.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SchemaSample extends BaseComponent {
export class SchemaSample extends BaseComponent implements OnInit {
@Input() pointer:string;
@Input() skipReadOnly:boolean;
@ -136,4 +136,8 @@ export class SchemaSample extends BaseComponent {
expanded.parentNode.classList.add('collapsed');
}
}
ngOnInit() {
this.preinit();
}
}

View File

@ -13,7 +13,7 @@ import { TestComponentBuilder } from '@angular/core/testing';
import { MethodsList, SideMenu } from '../index';
import { SpecManager } from '../../utils/SpecManager';;
import { SpecManager } from '../../utils/SpecManager';
let testOptions;

View File

@ -1,13 +1,12 @@
'use strict';
import { Component, ElementRef, ChangeDetectorRef } from '@angular/core';
import { Component, ElementRef, ChangeDetectorRef, OnInit } from '@angular/core';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { global } from '@angular/core/src/facade/lang';
import { trigger, state, animate, transition, style } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
import { ScrollService, Hash, MenuService, OptionsService } from '../../services/index';
import { BrowserDomAdapter as DOM } from '../../utils/browser-adapter';
import { MenuCategory } from '../../services/schema-helper.service';
@Component({
@ -26,7 +25,7 @@ import { MenuCategory } from '../../services/schema-helper.service';
])
],
})
export class SideMenu extends BaseComponent {
export class SideMenu extends BaseComponent implements OnInit {
activeCatCaption: string;
activeItemCaption: string;
categories: Array<MenuCategory>;
@ -37,7 +36,7 @@ export class SideMenu extends BaseComponent {
private $resourcesNav: any;
private $scrollParent: any;
constructor(specMgr:SpecManager, elementRef:ElementRef, private dom:BrowserDomAdapter,
constructor(specMgr:SpecManager, elementRef:ElementRef,
private scrollService:ScrollService, private menuService:MenuService, private hash:Hash,
optionsService:OptionsService, private detectorRef:ChangeDetectorRef) {
super(specMgr);
@ -56,6 +55,7 @@ export class SideMenu extends BaseComponent {
this.activeItemCaption = item && item.summary || '';
//safari doesn't update bindings if not run changeDetector manually :(
this.detectorRef.detectChanges();
}
@ -70,8 +70,8 @@ export class SideMenu extends BaseComponent {
init() {
this.categories = this.menuService.categories;
this.$mobileNav = this.dom.querySelector(this.$element, '.mobile-nav');
this.$resourcesNav = this.dom.querySelector(this.$element, '#resources-nav');
this.$mobileNav = DOM.querySelector(this.$element, '.mobile-nav');
this.$resourcesNav = DOM.querySelector(this.$element, '#resources-nav');
//decorate scrollYOffset to account mobile nav
this.scrollService.scrollYOffset = () => {
@ -85,18 +85,17 @@ export class SideMenu extends BaseComponent {
}
toggleMobileNav() {
let dom = this.dom;
let $overflowParent = (this.options.$scrollParent === global) ? dom.defaultDoc().body
let $overflowParent = (this.options.$scrollParent === global) ? DOM.defaultDoc().body
: this.$scrollParent;
if (dom.hasStyle(this.$resourcesNav, 'height')) {
dom.removeStyle(this.$resourcesNav, 'height');
dom.removeStyle($overflowParent, 'overflow-y');
if (DOM.hasStyle(this.$resourcesNav, 'height')) {
DOM.removeStyle(this.$resourcesNav, 'height');
DOM.removeStyle($overflowParent, 'overflow-y');
} else {
let viewportHeight = this.options.$scrollParent.innerHeight
|| this.options.$scrollParent.clientHeight;
let height = viewportHeight - this.$mobileNav.getBoundingClientRect().bottom;
dom.setStyle($overflowParent, 'overflow-y', 'hidden');
dom.setStyle(this.$resourcesNav, 'height', height + 'px');
DOM.setStyle($overflowParent, 'overflow-y', 'hidden');
DOM.setStyle(this.$resourcesNav, 'height', height + 'px');
}
}
@ -104,4 +103,8 @@ export class SideMenu extends BaseComponent {
this.scrollService.unbind();
this.hash.unbind();
}
ngOnInit() {
this.preinit();
}
}

View File

@ -1,6 +1,6 @@
'use strict';
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { SpecManager, BaseComponent } from '../base';
import { WarningsService, OptionsService } from '../../services/index';
@ -10,7 +10,7 @@ import { WarningsService, OptionsService } from '../../services/index';
templateUrl: './warnings.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class Warnings extends BaseComponent {
export class Warnings extends BaseComponent implements OnInit {
warnings: Array<string> = [];
shown: boolean = false;
suppressWarnings: boolean;
@ -30,4 +30,8 @@ export class Warnings extends BaseComponent {
close() {
this.shown = false;
}
ngOnInit() {
this.preinit();
}
}

View File

@ -37,6 +37,10 @@ export class BaseComponent implements OnInit, OnDestroy {
* onInit method is run by angular2 after all component inputs are resolved
*/
ngOnInit() {
this.preinit();
}
preinit() {
this.componentSchema = this.specMgr.byPointer(this.pointer || '');
this.init();
}

59
lib/index-dev.ts Normal file
View File

@ -0,0 +1,59 @@
'use strict';
import './components/Redoc/redoc-initial-styles.css';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { RedocModule } from './redoc.module';
import { Redoc } from './components/index';
import { SpecManager } from './utils/SpecManager';
import { BrowserDomAdapter as DOM } from './utils/browser-adapter';
import { disableDebugTools } from '@angular/platform-browser';
export const version = LIB_VERSION;
var moduleRef;
export function init(specUrl:string, options?) {
if (IS_PRODUCTION) {
disableDebugTools();
enableProdMode();
}
if (moduleRef) {
destroy();
}
//
// optionsService.options = options;
// optionsService.options.specUrl = optionsService.options.specUrl || specUrl;
Redoc.showLoadingAnimation();
return SpecManager.instance().load(specUrl)
.then(() => {
return platformBrowserDynamic().bootstrapModule(RedocModule);
})
.then(appRef => {
Redoc.hideLoadingAnimation();
moduleRef = appRef;
console.log('ReDoc initialized!');
}).catch(err => {
Redoc.hideLoadingAnimation();
Redoc.displayError(err);
throw err;
});
};
export function destroy() {
moduleRef.destroy();
};
function autoInit() {
const specUrlAttributeName = 'spec-url';
let redocEl = DOM.query('redoc');
if (!redocEl) return;
if (DOM.hasAttribute(redocEl, specUrlAttributeName)) {
let url = DOM.getAttribute(redocEl, specUrlAttributeName);
init(url);
}
};
autoInit();

View File

@ -1,30 +1,25 @@
'use strict';
import './components/Redoc/redoc-initial-styles.css!css';
import 'dropkickjs/build/css/dropkick.css!css';
import 'prismjs/themes/prism-dark.css!css';
import 'hint.css/hint.base.css!css';
//import { redocVersion } from './version.js';
import './components/Redoc/redoc-initial-styles.css';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { RedocModule } from './redoc.module';
import { Redoc } from './components/index';
//import { getOptions } from './redoc.module';
import { SpecManager } from './utils/SpecManager';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { BrowserDomAdapter as DOM } from './utils/browser-adapter';
import { disableDebugTools } from '@angular/platform-browser';
import { bootstrapRedoc } from './bootstrap';
var dom = new BrowserDomAdapter();
export const version = LIB_VERSION;
//Redoc.version = redocVersion;
var moduleRef;
export function init(specUrl:string, options?) {
// if (!optionsService.options.debugMode) {
// enableProdMode();
// }
//
// if (moduleRef) {
// destroy();
// }
if (IS_PRODUCTION) {
disableDebugTools();
enableProdMode();
}
if (moduleRef) {
destroy();
}
//
// optionsService.options = options;
// optionsService.options.specUrl = optionsService.options.specUrl || specUrl;
@ -32,7 +27,7 @@ export function init(specUrl:string, options?) {
Redoc.showLoadingAnimation();
return SpecManager.instance().load(specUrl)
.then(() => {
return platformBrowserDynamic().bootstrapModule(RedocModule);
return bootstrapRedoc();
})
.then(appRef => {
Redoc.hideLoadingAnimation();
@ -52,10 +47,10 @@ export function destroy() {
function autoInit() {
const specUrlAttributeName = 'spec-url';
let redocEl = dom.query('redoc');
let redocEl = DOM.query('redoc');
if (!redocEl) return;
if (dom.hasAttribute(redocEl, specUrlAttributeName)) {
let url = dom.getAttribute(redocEl, specUrlAttributeName);
if (DOM.hasAttribute(redocEl, specUrlAttributeName)) {
let url = DOM.getAttribute(redocEl, specUrlAttributeName);
init(url);
}
};

4
lib/polyfills.ts Normal file
View File

@ -0,0 +1,4 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'ts-helpers';
import 'zone.js/dist/zone';

View File

@ -1,5 +1,4 @@
import { NgModule, provide } from '@angular/core';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { Redoc, REDOC_DIRECTIVES } from './components/index';
@ -16,7 +15,6 @@ import { SpecManager } from './utils/SpecManager';
bootstrap: [ Redoc ],
providers: [
SpecManager,
BrowserDomAdapter,
RedocEventsService,
ScrollService,
Hash,

View File

@ -1,7 +1,5 @@
'use strict';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { RedocEventsService } from './events.service';
import { Hash } from './hash.service';
@ -10,7 +8,7 @@ describe('Hash Service', () => {
let hashService;
beforeEach(() => {
hashService = new Hash(new BrowserDomAdapter(), events);
hashService = new Hash(events);
});
afterEach(() => {

View File

@ -1,6 +1,6 @@
'use strict';
import { Injectable, EventEmitter, Output } from '@angular/core';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { BrowserDomAdapter as DOM } from '../utils/browser-adapter';
import { global } from '@angular/core/src/facade/lang';
import { RedocEventsService } from './events.service';
@ -9,18 +9,18 @@ import { RedocEventsService } from './events.service';
export class Hash {
@Output() changed = new EventEmitter();
private _cancel: any;
constructor(private dom:BrowserDomAdapter, private events:RedocEventsService) {
constructor(private events:RedocEventsService) {
this.bind();
events.bootstrapped.subscribe(() => this.changed.next(this.hash));
}
get hash() {
return this.dom.getLocation().hash;
return DOM.getLocation().hash;
}
bind() {
this._cancel = this.dom.onAndCancel(global, 'hashchange', (evt) => {
this._cancel = DOM.onAndCancel(global, 'hashchange', (evt) => {
this.changed.next(this.hash);
evt.preventDefault();
});

View File

@ -1,6 +1,5 @@
'use strict';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { OptionsService } from './options.service';
describe('Options Service', () => {
@ -19,7 +18,7 @@ describe('Options Service', () => {
});
beforeEach(() => {
optionsService = new OptionsService(new BrowserDomAdapter());
optionsService = new OptionsService();
});
it('should parse numeric scrollYOffset', () => {

View File

@ -1,12 +1,11 @@
'use strict';
import { Injectable } from '@angular/core';
import { isFunction, isString } from '@angular/core/src/facade/lang';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { BrowserDomAdapter as DOM } from '../utils/browser-adapter';
const defaults = {
scrollYOffset: 0,
disableLazySchemas: false,
debugMode: false//global && global.redocDebugMode
disableLazySchemas: false
};
const OPTION_NAMES = new Set(['scrollYOffset', 'disableLazySchemas', 'specUrl', 'suppressWarnings']);
@ -15,9 +14,8 @@ const OPTION_NAMES = new Set(['scrollYOffset', 'disableLazySchemas', 'specUrl',
export class OptionsService {
private _options: any;
constructor(private dom:BrowserDomAdapter) {
constructor() {
this._options = defaults;
this.dom = dom;
}
get options() {
@ -30,7 +28,7 @@ export class OptionsService {
parseOptions(el) {
let parsedOpts;
let attributesMap = this.dom.attributeMap(el);
let attributesMap = DOM.attributeMap(el);
parsedOpts = {};
Array.from(attributesMap.keys())
//camelCasify
@ -59,7 +57,7 @@ export class OptionsService {
// if selector or node function that returns bottom offset of this node
let el = this._options.scrollYOffset;
if (!(el instanceof Node)) {
el = this.dom.query(el);
el = DOM.query(el);
}
if (!el) {
this._options.scrollYOffset = () => 0;

View File

@ -3,7 +3,7 @@ import { JsonPointer } from '../utils/JsonPointer';
import { SpecManager } from '../utils/SpecManager';
import {methods as swaggerMethods, keywordTypes} from '../utils/swagger-defs';
import { WarningsService } from './warnings.service';
import slugify from 'slugify';
import * as slugify from 'slugify';
interface PropertyPreprocessOptions {
childFor: string;

View File

@ -1,6 +1,6 @@
'use strict';
import { Injectable, EventEmitter, Output } from '@angular/core';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { BrowserDomAdapter as DOM } from '../utils/browser-adapter';
import { OptionsService } from './options.service';
import { throttle } from '../utils/helpers';
@ -17,12 +17,11 @@ export class ScrollService {
@Output() scroll = new EventEmitter();
private prevOffsetY: number;
private _cancel:any;
constructor(private dom:BrowserDomAdapter, optionsService:OptionsService) {
constructor(optionsService:OptionsService) {
//events.bootstrapped.subscribe(() => this.hashScroll());
this.scrollYOffset = () => optionsService.options.scrollYOffset();
this.$scrollParent = optionsService.options.$scrollParent;
this.scroll = new EventEmitter();
this.dom = dom;
this.bind();
}
@ -61,7 +60,7 @@ export class ScrollService {
bind() {
this.prevOffsetY = this.scrollY();
this._cancel = this.dom.onAndCancel(this.$scrollParent, 'scroll',
this._cancel = DOM.onAndCancel(this.$scrollParent, 'scroll',
throttle((evt) => { this.scrollHandler(evt); }, 100, this));
}

View File

@ -1,7 +1,7 @@
'use strict';
import { Component, EventEmitter, ElementRef, Output, AfterContentInit } from '@angular/core';
import DropKick from 'dropkickjs';
import * as DropKick from 'dropkickjs';
@Component({
selector: 'drop-down',

View File

@ -1,7 +1,7 @@
'use strict';
import { Directive, ElementRef, Input, OnInit, OnDestroy } from '@angular/core';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { BrowserDomAdapter as DOM } from '../../../utils/browser-adapter';
@Directive({
selector: '[sticky-sidebar]'
@ -13,18 +13,18 @@ export class StickySidebar implements OnInit, OnDestroy {
@Input() scrollParent:any;
@Input() scrollYOffset:any;
constructor(elementRef:ElementRef, private dom:BrowserDomAdapter) {
constructor(elementRef:ElementRef) {
this.$element = elementRef.nativeElement;
// initial styling
this.dom.setStyle(this.$element, 'position', 'absolute');
this.dom.setStyle(this.$element, 'top', '0');
this.dom.setStyle(this.$element, 'bottom', '0');
this.dom.setStyle(this.$element, 'max-height', '100%');
DOM.setStyle(this.$element, 'position', 'absolute');
DOM.setStyle(this.$element, 'top', '0');
DOM.setStyle(this.$element, 'bottom', '0');
DOM.setStyle(this.$element, 'max-height', '100%');
}
bind() {
this.cancelScrollBinding = this.dom.onAndCancel(this.scrollParent, 'scroll', () => { this.updatePosition(); });
this.cancelScrollBinding = DOM.onAndCancel(this.scrollParent, 'scroll', () => { this.updatePosition(); });
this.updatePosition();
}
@ -41,13 +41,13 @@ export class StickySidebar implements OnInit, OnDestroy {
}
stick() {
this.dom.setStyle(this.$element, 'position', 'fixed');
this.dom.setStyle(this.$element, 'top', this.scrollYOffset() + 'px');
DOM.setStyle(this.$element, 'position', 'fixed');
DOM.setStyle(this.$element, 'top', this.scrollYOffset() + 'px');
}
unstick() {
this.dom.setStyle(this.$element, 'position', 'absolute');
this.dom.setStyle(this.$element, 'top', '0');
DOM.setStyle(this.$element, 'position', 'absolute');
DOM.setStyle(this.$element, 'top', '0');
}
get scrollY() {
@ -56,7 +56,7 @@ export class StickySidebar implements OnInit, OnDestroy {
ngOnInit() {
// FIXME use more reliable code
this.$redocEl = this.$element.offsetParent || this.dom.defaultDoc().body;
this.$redocEl = this.$element.offsetParent || DOM.defaultDoc().body;
this.bind();
}

View File

@ -1,5 +1,5 @@
'use strict';
import JsonPointerLib from 'json-pointer';
import * as JsonPointerLib from 'json-pointer';
const origParse = JsonPointerLib.parse;
/**

View File

@ -1,9 +1,9 @@
'use strict';
import JsonSchemaRefParser from 'json-schema-ref-parser';
import JsonPointer from './JsonPointer';
import * as JsonSchemaRefParser from 'json-schema-ref-parser';
import { JsonPointer } from './JsonPointer';
import { renderMd, safePush } from './helpers';
import slugify from 'slugify';
import * as slugify from 'slugify';
import { parse as urlParse } from 'url';
export class SpecManager {

View File

@ -0,0 +1,73 @@
export class BrowserDomAdapter {
static query(selector: string): any { return document.querySelector(selector); }
static querySelector(el: any /** TODO #9100 */, selector: string): HTMLElement {
return el.querySelector(selector);
}
static onAndCancel(
el: any /** TODO #9100 */, evt: any /** TODO #9100 */,
listener: any /** TODO #9100 */): Function {
el.addEventListener(evt, listener, false);
// Needed to follow Dart's subscription semantic, until fix of
// https://code.google.com/p/dart/issues/detail?id=17406
return () => { el.removeEventListener(evt, listener, false); };
}
static addClass(element: any /** TODO #9100 */, className: string) { element.classList.add(className); }
static removeClass(element: any /** TODO #9100 */, className: string) {
element.classList.remove(className);
}
static hasClass(element: any /** TODO #9100 */, className: string): boolean {
return element.classList.contains(className);
}
static attributeMap(element: any /** TODO #9100 */): Map<string, string> {
var res = new Map<string, string>();
var elAttrs = element.attributes;
for (var i = 0; i < elAttrs.length; i++) {
var attrib = elAttrs[i];
res.set(attrib.name, attrib.value);
}
return res;
}
static setStyle(element: any /** TODO #9100 */, styleName: string, styleValue: string) {
element.style[styleName] = styleValue;
}
static removeStyle(element: any /** TODO #9100 */, stylename: string) {
element.style[stylename] = null;
}
static getStyle(element: any /** TODO #9100 */, stylename: string): string {
return element.style[stylename];
}
static hasStyle(element: any /** TODO #9100 */, styleName: string, styleValue: string = null): boolean {
var value = this.getStyle(element, styleName) || '';
return styleValue ? value === styleValue : value.length > 0;
}
static hasAttribute(element: any /** TODO #9100 */, attribute: string): boolean {
return element.hasAttribute(attribute);
}
static getAttribute(element: any /** TODO #9100 */, attribute: string): string {
return element.getAttribute(attribute);
}
static setAttribute(element: any /** TODO #9100 */, name: string, value: string) {
element.setAttribute(name, value);
}
static removeAttribute(element: any /** TODO #9100 */, attribute: string) {
element.removeAttribute(attribute);
}
static getLocation(): Location { return window.location; }
static defaultDoc(): HTMLDocument { return document; }
}

103
lib/utils/helpers.js Normal file
View File

@ -0,0 +1,103 @@
'use strict';
var Remarkable = require('remarkable');
var md = new Remarkable({
html: true,
linkify: true,
breaks: false,
typographer: false,
highlight: function (str, lang) {
if (lang === 'json')
lang = 'js';
var grammar = Prism.languages[lang];
if (!grammar)
return str;
return Prism.highlight(str, grammar);
}
});
function renderMd(rawText, headersHandler) {
var _origRule;
if (headersHandler) {
_origRule = {
open: md.renderer.rules.heading_open,
close: md.renderer.rules.heading_close
};
md.renderer.rules.heading_open = function (tokens, idx) {
if (tokens[idx].hLevel !== 1) {
return _origRule.open(tokens, idx);
}
else {
return headersHandler.open(tokens, idx);
}
};
md.renderer.rules.heading_close = function (tokens, idx) {
if (tokens[idx].hLevel !== 1) {
return _origRule.close(tokens, idx);
}
else {
return headersHandler.close(tokens, idx);
}
};
}
var res = md.render(rawText);
if (headersHandler) {
md.renderer.rules.heading_open = _origRule.open;
md.renderer.rules.heading_close = _origRule.close;
}
return res;
}
exports.renderMd = renderMd;
function statusCodeType(statusCode) {
if (statusCode < 100 || statusCode > 599) {
throw new Error('invalid HTTP code');
}
var res = 'success';
if (statusCode >= 300 && statusCode < 400) {
res = 'redirect';
}
else if (statusCode >= 400) {
res = 'error';
}
else if (statusCode < 200) {
res = 'info';
}
return res;
}
exports.statusCodeType = statusCodeType;
function defaults(target, src) {
var props = Object.keys(src);
var index = -1, length = props.length;
while (++index < length) {
var key = props[index];
if (target[key] === undefined) {
target[key] = src[key];
}
}
return target;
}
exports.defaults = defaults;
function safePush(obj, prop, val) {
if (!obj[prop])
obj[prop] = [];
obj[prop].push(val);
}
exports.safePush = safePush;
function throttle(fn, threshhold, scope) {
threshhold = threshhold || 250;
var last, deferTimer;
return function () {
var context = scope || this;
var now = +new Date, args = arguments;
if (last && now < last + threshhold) {
clearTimeout(deferTimer);
deferTimer = setTimeout(function () {
last = now;
fn.apply(context, args);
}, threshhold);
}
else {
last = now;
fn.apply(context, args);
}
};
}
exports.throttle = throttle;

View File

@ -1,5 +1,5 @@
'use strict';
import Remarkable from 'remarkable';
import * as Remarkable from 'remarkable';
declare var Prism: any;
const md = new Remarkable({

31
lib/vendor.ts Normal file
View File

@ -0,0 +1,31 @@
import 'prismjs';
import 'prismjs/components/prism-actionscript.js';
import 'prismjs/components/prism-c.js';
import 'prismjs/components/prism-cpp.js';
import 'prismjs/components/prism-csharp.js';
import 'prismjs/components/prism-php.js';
import 'prismjs/components/prism-coffeescript.js';
import 'prismjs/components/prism-go.js';
import 'prismjs/components/prism-haskell.js';
import 'prismjs/components/prism-java.js';
import 'prismjs/components/prism-lua.js';
import 'prismjs/components/prism-matlab.js';
import 'prismjs/components/prism-perl.js';
import 'prismjs/components/prism-python.js';
import 'prismjs/components/prism-r.js';
import 'prismjs/components/prism-ruby.js';
import 'prismjs/components/prism-bash.js';
import 'prismjs/components/prism-swift.js';
import 'prismjs/components/prism-objectivec.js';
import 'prismjs/components/prism-scala.js';
import 'dropkickjs/build/css/dropkick.css';
import 'prismjs/themes/prism-dark.css';
import 'hint.css/hint.base.css';
import '@angular/common';
import '@angular/core';
import '@angular/platform-browser';
// RxJS
import 'rxjs/Rx';

View File

@ -7,7 +7,10 @@ declare module "slugify"
declare module "url"
declare module "json-pointer";
declare module "*!css" {
declare module "*.css" {
const content: string;
export default content;
}
declare var LIB_VERSION: any;
declare var IS_PRODUCTION: any;

View File

@ -8,15 +8,21 @@
},
"main": "dist/redoc.min.js",
"scripts": {
"test": "gulp lint && node ./build/run_tests.js",
"jspm-install": "jspm install",
"start": "gulp serve",
"build-dist": "gulp build --prod",
"test": "npm run unit && npm run e2e",
"branch-release": "git reset --hard && branch-release",
"unit": "gulp test",
"e2e": "gulp e2e --prod",
"lint": "tslint -e \"lib/**/*+(ngfactory|css.shim).ts\" \"lib/**/*.ts\"",
"unit": "karma start",
"e2e": "npm run build:prod && npm run e2e-copy && protractor",
"deploy": "node ./build/prepare_deploy.js && deploy-to-gh-pages --update demo",
"ngc": "ngc -p . && copy lib/* .compiled/lib"
"ngc": "ngc -p .",
"webpack:prod": "webpack --config build/webpack.prod.js --progress --profile --bail",
"build:sass": "node-sass -o lib lib",
"build:prod": "npm run build:sass && npm run ngc && npm run webpack:prod",
"build-dist": "npm run build:prod",
"stats": "webpack --config build/webpack.prod.js --json > stats.json",
"start": "webpack-dev-server --config build/webpack.dev.js --content-base demo",
"e2e-server": "http-server -p 3000 tests/e2e",
"e2e-copy": "cp dist/redoc.min.js tests/e2e/"
},
"keywords": [
"OpenAPI",
@ -30,70 +36,19 @@
],
"author": "Roman Hotsiy",
"license": "MIT",
"jspm": {
"configFile": "system.config.js",
"dependencies": {
"@angular/common": "npm:@angular/common@^2.0.0-rc.5",
"@angular/compiler": "npm:@angular/compiler@^2.0.0-rc.5",
"@angular/core": "npm:@angular/core@^2.0.0-rc.5",
"@angular/platform-browser": "npm:@angular/platform-browser@^2.0.0-rc.5",
"@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@^2.0.0-rc.5",
"dropkickjs": "npm:dropkickjs@^2.1.8",
"es6-shim": "github:es-shims/es6-shim@^0.33.6",
"hint.css": "npm:hint.css@^2.2.1",
"json": "github:systemjs/plugin-json@^0.1.0",
"json-pointer": "npm:json-pointer@^0.3.0",
"json-schema-ref-parser": "npm:json-schema-ref-parser@^3.1.2",
"openapi-sampler": "npm:openapi-sampler@^0.3.0",
"prismjs": "npm:prismjs@^1.3.0",
"remarkable": "npm:remarkable@^1.6.2",
"rxjs": "npm:rxjs@5.0.0-beta.6",
"scrollparent": "npm:scrollparent@^0.1.0",
"slugify": "npm:slugify@^0.1.1",
"stream-http": "npm:stream-http@^2.3.0",
"url": "github:jspm/nodelibs-url@^0.1.0",
"zone.js": "npm:zone.js@^0.6.14"
},
"devDependencies": {
"babel": "npm:babel-core@^5.8.34",
"babel-runtime": "npm:babel-runtime@^5.8.24",
"clean-css": "npm:clean-css@^3.4.17",
"core-js": "npm:core-js@^1.2.6",
"css": "github:systemjs/plugin-css@^0.1.18",
"systemjs/plugin-json": "github:systemjs/plugin-json@^0.1.0"
},
"overrides": {
"npm:dropkickjs@2.1.8": {
"format": "global"
},
"npm:json-schema-ref-parser@3.1.2": {
"map": {
"http": "stream-http",
"https": "stream-http"
}
},
"npm:openapi-sampler@0.3.0": {
"main": "src/openapi-sampler",
"format": "esm"
}
}
},
"devDependencies": {
"@angular/common": "^2.0.0-rc.5",
"@angular/compiler": "^2.0.0-rc.5",
"@angular/compiler-cli": "^0.5.0",
"@angular/core": "^2.0.0-rc.5",
"@angular/platform-browser": "^2.0.0-rc.5",
"@angular/platform-browser-dynamic": "^2.0.0-rc.5",
"@angular/platform-server": "^2.0.0-rc.5",
"@types/core-js": "^0.9.31",
"@types/jasmine": "^2.2.32",
"@types/requirejs": "^2.1.26",
"@types/should": "^8.1.28",
"babel-polyfill": "^6.3.14",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^2.2.1",
"branch-release": "^1.0.3",
"browser-sync": "^2.10.1",
"codelyzer": "0.0.23",
"chalk": "^1.1.3",
"codelyzer": "0.0.28",
"copy-webpack-plugin": "^3.0.1",
"coveralls": "^2.11.9",
"css-loader": "^0.24.0",
"del": "^2.2.0",
"deploy-to-gh-pages": "^1.1.2",
"gulp": "^3.9.1",
@ -105,34 +60,31 @@
"gulp-replace": "^0.5.4",
"gulp-sass": "^2.1.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-tslint": "^5.0.0",
"isparta": "^4.0.0",
"istanbul": "github:gotwarlost/istanbul#source-map",
"jasmine-core": "^2.4.1",
"jasmine-spec-reporter": "^2.4.0",
"json-pointer": "^0.5.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": "^1.0.1",
"karma-coverage": "github:douglasduteil/karma-coverage#next",
"karma-coveralls": "^1.1.2",
"karma-jasmine": "^1.0.2",
"karma-jspm": "^2.1.1",
"karma-mocha-reporter": "^2.0.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-phantomjs-shim": "^1.1.2",
"karma-regex-preprocessor": "github:makern/karma-regex-preprocessor",
"karma-should": "^1.0.0",
"karma-sinon": "^1.0.4",
"node-sass": "^3.7.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"node-sass": "^3.8.0",
"openapi-sampler": "^0.2.0",
"phantomjs-prebuilt": "^2.1.7",
"protractor": "^3.0.0",
"prismjs": "^1.5.1",
"protractor": "^3.3.0",
"raw-loader": "^0.5.1",
"reflect-metadata": "^0.1.2",
"remap-istanbul": "^0.6.4",
"remarkable": "^1.6.2",
"require-dir": "^0.3.0",
"rollup-plugin-commonjs": "^3.3.1",
"run-sequence": "^1.1.5",
"rxjs": "5.0.0-beta.6",
"scrollparent": "^1.0.0",
@ -140,12 +92,28 @@
"should": "^9.0.2",
"sinon": "^1.17.2",
"slugify": "^0.1.1",
"style-loader": "^0.13.1",
"systemjs-builder": "0.15.16",
"tslint": "^3.14.0",
"ts-helpers": "^1.1.1",
"tslint": "^3.15.0-dev.0",
"tslint-stylish": "^2.1.0-beta",
"typescript": "^2.0.0",
"vinyl-paths": "^2.0.0",
"yargs": "^4.7.1",
"zone.js": "^0.6.15"
"webpack": "^2.1.0-beta.21",
"yargs": "^4.7.1"
},
"dependencies": {
"@angular/common": "^2.0.0-rc.5",
"@angular/compiler": "^2.0.0-rc.5",
"@angular/compiler-cli": "^0.5.0",
"@angular/core": "^2.0.0-rc.5",
"@angular/platform-browser": "^2.0.0-rc.5",
"@angular/platform-browser-dynamic": "^2.0.0-rc.5",
"@angular/platform-server": "^2.0.0-rc.5",
"core-js": "^2.4.1",
"zone.js": "^0.6.15",
"hint.css": "^2.3.2",
"json-pointer": "^0.5.0",
"json-schema-ref-parser": "^3.1.2"
}
}

View File

@ -3,7 +3,7 @@ const loadJson = require('./tests/e2e/helpers').loadJson;
const travis = process.env.TRAVIS;
let config = {
specs: ['./tests/e2e/**/*.js'],
specs: ['./tests/e2e/**/*.e2e.js'],
baseUrl: 'http://localhost:3000',
framework: 'jasmine2',
onPrepare: function() {
@ -29,8 +29,8 @@ let config = {
print: function() {}
},
multiCapabilities: [
{ browserName: 'chrome' },
{ browserName: 'firefox' }
{ browserName: 'chrome' }
// { browserName: 'firefox' }
]
};

View File

@ -1,948 +0,0 @@
System.config({
baseURL: "/",
defaultJSExtensions: true,
transpiler: "babel",
babelOptions: {
"optional": [
"runtime",
"optimisation.modules.system",
"es7.decorators",
"es7.classProperties"
]
},
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
map: {
"@angular/common": "npm:@angular/common@2.0.0-rc.5",
"@angular/compiler": "npm:@angular/compiler@2.0.0-rc.5",
"@angular/core": "npm:@angular/core@2.0.0-rc.5",
"@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.5",
"@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@2.0.0-rc.5",
"babel": "npm:babel-core@5.8.34",
"babel-runtime": "npm:babel-runtime@5.8.34",
"clean-css": "npm:clean-css@3.4.17",
"core-js": "npm:core-js@1.2.6",
"css": "github:systemjs/plugin-css@0.1.18",
"dropkickjs": "npm:dropkickjs@2.1.8",
"es6-shim": "github:es-shims/es6-shim@0.33.6",
"hint.css": "npm:hint.css@2.2.1",
"json": "github:systemjs/plugin-json@0.1.2",
"json-formatter-js": "npm:json-formatter-js@0.2.0",
"json-pointer": "npm:json-pointer@0.3.0",
"json-schema-ref-parser": "npm:json-schema-ref-parser@3.1.2",
"openapi-sampler": "npm:openapi-sampler@0.3.0",
"prismjs": "npm:prismjs@1.3.0",
"remarkable": "npm:remarkable@1.6.2",
"rxjs": "npm:rxjs@5.0.0-beta.6",
"scrollparent": "npm:scrollparent@0.1.0",
"slugify": "npm:slugify@0.1.1",
"stream-http": "npm:stream-http@2.3.0",
"systemjs/plugin-json": "github:systemjs/plugin-json@0.1.2",
"url": "github:jspm/nodelibs-url@0.1.0",
"zone.js": "npm:zone.js@0.6.14",
"github:jspm/nodelibs-assert@0.1.0": {
"assert": "npm:assert@1.4.1"
},
"github:jspm/nodelibs-buffer@0.1.0": {
"buffer": "npm:buffer@3.6.0"
},
"github:jspm/nodelibs-constants@0.1.0": {
"constants-browserify": "npm:constants-browserify@0.0.1"
},
"github:jspm/nodelibs-crypto@0.1.0": {
"crypto-browserify": "npm:crypto-browserify@3.11.0"
},
"github:jspm/nodelibs-events@0.1.1": {
"events": "npm:events@1.0.2"
},
"github:jspm/nodelibs-http@1.7.1": {
"Base64": "npm:Base64@0.2.1",
"events": "github:jspm/nodelibs-events@0.1.1",
"inherits": "npm:inherits@2.0.1",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"url": "github:jspm/nodelibs-url@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"github:jspm/nodelibs-https@0.1.0": {
"https-browserify": "npm:https-browserify@0.0.0"
},
"github:jspm/nodelibs-net@0.1.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"http": "github:jspm/nodelibs-http@1.7.1",
"net": "github:jspm/nodelibs-net@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"timers": "github:jspm/nodelibs-timers@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"github:jspm/nodelibs-os@0.1.0": {
"os-browserify": "npm:os-browserify@0.1.2"
},
"github:jspm/nodelibs-path@0.1.0": {
"path-browserify": "npm:path-browserify@0.0.0"
},
"github:jspm/nodelibs-process@0.1.2": {
"process": "npm:process@0.11.8"
},
"github:jspm/nodelibs-punycode@0.1.0": {
"punycode": "npm:punycode@1.3.2"
},
"github:jspm/nodelibs-querystring@0.1.0": {
"querystring": "npm:querystring@0.2.0"
},
"github:jspm/nodelibs-stream@0.1.0": {
"stream-browserify": "npm:stream-browserify@1.0.0"
},
"github:jspm/nodelibs-string_decoder@0.1.0": {
"string_decoder": "npm:string_decoder@0.10.31"
},
"github:jspm/nodelibs-timers@0.1.0": {
"timers-browserify": "npm:timers-browserify@1.4.2"
},
"github:jspm/nodelibs-tty@0.1.0": {
"tty-browserify": "npm:tty-browserify@0.0.0"
},
"github:jspm/nodelibs-url@0.1.0": {
"url": "npm:url@0.10.3"
},
"github:jspm/nodelibs-util@0.1.0": {
"util": "npm:util@0.10.3"
},
"github:jspm/nodelibs-vm@0.1.0": {
"vm-browserify": "npm:vm-browserify@0.0.4"
},
"github:jspm/nodelibs-zlib@0.1.0": {
"browserify-zlib": "npm:browserify-zlib@0.1.4"
},
"npm:@angular/common@2.0.0-rc.5": {
"@angular/core": "npm:@angular/core@2.0.0-rc.5",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:@angular/compiler@2.0.0-rc.5": {
"@angular/core": "npm:@angular/core@2.0.0-rc.5",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:@angular/core@2.0.0-rc.5": {
"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.5": {
"@angular/common": "npm:@angular/common@2.0.0-rc.5",
"@angular/compiler": "npm:@angular/compiler@2.0.0-rc.5",
"@angular/core": "npm:@angular/core@2.0.0-rc.5",
"@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.5",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:@angular/platform-browser@2.0.0-rc.5": {
"@angular/common": "npm:@angular/common@2.0.0-rc.5",
"@angular/compiler": "npm:@angular/compiler@2.0.0-rc.5",
"@angular/core": "npm:@angular/core@2.0.0-rc.5",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:amdefine@1.0.0": {
"fs": "github:jspm/nodelibs-fs@0.1.2",
"module": "github:jspm/nodelibs-module@0.1.0",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:argparse@0.1.16": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"underscore": "npm:underscore@1.7.0",
"underscore.string": "npm:underscore.string@2.4.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:argparse@1.0.7": {
"fs": "github:jspm/nodelibs-fs@0.1.2",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"sprintf-js": "npm:sprintf-js@1.0.3",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:asn1.js@4.6.2": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"bn.js": "npm:bn.js@4.11.4",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"inherits": "npm:inherits@2.0.1",
"minimalistic-assert": "npm:minimalistic-assert@1.0.0",
"vm": "github:jspm/nodelibs-vm@0.1.0"
},
"npm:asn1@0.2.3": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"sys": "github:jspm/nodelibs-util@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:assert-plus@0.2.0": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:assert-plus@1.0.0": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:assert@1.4.1": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"util": "npm:util@0.10.3"
},
"npm:async@1.5.2": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:autolinker@0.15.3": {
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:aws-sign2@0.6.0": {
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"url": "github:jspm/nodelibs-url@0.1.0"
},
"npm:aws4@1.4.1": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"querystring": "github:jspm/nodelibs-querystring@0.1.0",
"url": "github:jspm/nodelibs-url@0.1.0"
},
"npm:babel-runtime@5.8.34": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:bl@1.1.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"readable-stream": "npm:readable-stream@2.0.6",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:bn.js@4.11.4": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
},
"npm:boom@2.10.1": {
"hoek": "npm:hoek@2.16.3",
"http": "github:jspm/nodelibs-http@1.7.1"
},
"npm:browserify-aes@1.0.6": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"buffer-xor": "npm:buffer-xor@1.0.3",
"cipher-base": "npm:cipher-base@1.0.2",
"create-hash": "npm:create-hash@1.1.2",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"inherits": "npm:inherits@2.0.1",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:browserify-cipher@1.0.0": {
"browserify-aes": "npm:browserify-aes@1.0.6",
"browserify-des": "npm:browserify-des@1.0.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"evp_bytestokey": "npm:evp_bytestokey@1.0.0"
},
"npm:browserify-des@1.0.0": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"cipher-base": "npm:cipher-base@1.0.2",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"des.js": "npm:des.js@1.0.0",
"inherits": "npm:inherits@2.0.1",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:browserify-rsa@4.0.1": {
"bn.js": "npm:bn.js@4.11.4",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"constants": "github:jspm/nodelibs-constants@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"randombytes": "npm:randombytes@2.0.3",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:browserify-sign@4.0.0": {
"bn.js": "npm:bn.js@4.11.4",
"browserify-rsa": "npm:browserify-rsa@4.0.1",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"create-hash": "npm:create-hash@1.1.2",
"create-hmac": "npm:create-hmac@1.1.4",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"elliptic": "npm:elliptic@6.3.1",
"inherits": "npm:inherits@2.0.1",
"parse-asn1": "npm:parse-asn1@5.0.0",
"stream": "github:jspm/nodelibs-stream@0.1.0"
},
"npm:browserify-zlib@0.1.4": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"pako": "npm:pako@0.2.8",
"process": "github:jspm/nodelibs-process@0.1.2",
"readable-stream": "npm:readable-stream@2.0.6",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:buffer-xor@1.0.3": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:buffer@3.6.0": {
"base64-js": "npm:base64-js@0.0.8",
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"ieee754": "npm:ieee754@1.1.6",
"isarray": "npm:isarray@1.0.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:builtin-status-codes@2.0.0": {
"fs": "github:jspm/nodelibs-fs@0.1.2",
"http": "github:jspm/nodelibs-http@1.7.1",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:call-me-maybe@1.0.1": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:caseless@0.11.0": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:chalk@1.1.3": {
"ansi-styles": "npm:ansi-styles@2.2.1",
"escape-string-regexp": "npm:escape-string-regexp@1.0.5",
"has-ansi": "npm:has-ansi@2.0.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"strip-ansi": "npm:strip-ansi@3.0.1",
"supports-color": "npm:supports-color@2.0.0"
},
"npm:cipher-base@1.0.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"inherits": "npm:inherits@2.0.1",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"string_decoder": "github:jspm/nodelibs-string_decoder@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:clean-css@3.4.17": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"commander": "npm:commander@2.8.1",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"http": "github:jspm/nodelibs-http@1.7.1",
"https": "github:jspm/nodelibs-https@0.1.0",
"os": "github:jspm/nodelibs-os@0.1.0",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"source-map": "npm:source-map@0.4.4",
"url": "github:jspm/nodelibs-url@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:combined-stream@1.0.5": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"delayed-stream": "npm:delayed-stream@1.0.0",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:commander@2.8.1": {
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
"events": "github:jspm/nodelibs-events@0.1.1",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"graceful-readlink": "npm:graceful-readlink@1.0.1",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:commander@2.9.0": {
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
"events": "github:jspm/nodelibs-events@0.1.1",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"graceful-readlink": "npm:graceful-readlink@1.0.1",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:constants-browserify@0.0.1": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:core-js@1.2.6": {
"fs": "github:jspm/nodelibs-fs@0.1.2",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:core-util-is@1.0.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
},
"npm:create-ecdh@4.0.0": {
"bn.js": "npm:bn.js@4.11.4",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"elliptic": "npm:elliptic@6.3.1"
},
"npm:create-hash@1.1.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"cipher-base": "npm:cipher-base@1.0.2",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"inherits": "npm:inherits@2.0.1",
"ripemd160": "npm:ripemd160@1.0.1",
"sha.js": "npm:sha.js@2.4.5"
},
"npm:create-hmac@1.1.4": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"create-hash": "npm:create-hash@1.1.2",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"inherits": "npm:inherits@2.0.1",
"stream": "github:jspm/nodelibs-stream@0.1.0"
},
"npm:cryptiles@2.0.5": {
"boom": "npm:boom@2.10.1",
"crypto": "github:jspm/nodelibs-crypto@0.1.0"
},
"npm:crypto-browserify@3.11.0": {
"browserify-cipher": "npm:browserify-cipher@1.0.0",
"browserify-sign": "npm:browserify-sign@4.0.0",
"create-ecdh": "npm:create-ecdh@4.0.0",
"create-hash": "npm:create-hash@1.1.2",
"create-hmac": "npm:create-hmac@1.1.4",
"diffie-hellman": "npm:diffie-hellman@5.0.2",
"inherits": "npm:inherits@2.0.1",
"pbkdf2": "npm:pbkdf2@3.0.4",
"public-encrypt": "npm:public-encrypt@4.0.0",
"randombytes": "npm:randombytes@2.0.3",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:dashdash@1.14.0": {
"assert-plus": "npm:assert-plus@1.0.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:debug@2.2.0": {
"ms": "npm:ms@0.7.1"
},
"npm:delayed-stream@1.0.0": {
"stream": "github:jspm/nodelibs-stream@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:des.js@1.0.0": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"inherits": "npm:inherits@2.0.1",
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
},
"npm:diffie-hellman@5.0.2": {
"bn.js": "npm:bn.js@4.11.4",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"miller-rabin": "npm:miller-rabin@4.0.0",
"randombytes": "npm:randombytes@2.0.3",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:dropkickjs@2.1.8": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:ecc-jsbn@0.1.1": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"jsbn": "npm:jsbn@0.1.0"
},
"npm:elliptic@6.3.1": {
"bn.js": "npm:bn.js@4.11.4",
"brorand": "npm:brorand@1.0.5",
"hash.js": "npm:hash.js@1.0.3",
"inherits": "npm:inherits@2.0.1",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:es6-promise@3.2.1": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:evp_bytestokey@1.0.0": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"create-hash": "npm:create-hash@1.1.2",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:extsprintf@1.0.2": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:forever-agent@0.6.1": {
"http": "github:jspm/nodelibs-http@1.7.1",
"https": "github:jspm/nodelibs-https@0.1.0",
"net": "github:jspm/nodelibs-net@0.1.2",
"tls": "github:jspm/nodelibs-tls@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:form-data@1.0.0-rc4": {
"async": "npm:async@1.5.2",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"combined-stream": "npm:combined-stream@1.0.5",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"http": "github:jspm/nodelibs-http@1.7.1",
"https": "github:jspm/nodelibs-https@0.1.0",
"mime-types": "npm:mime-types@2.1.11",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"url": "github:jspm/nodelibs-url@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:generate-function@2.0.0": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:generate-object-property@1.2.0": {
"is-property": "npm:is-property@1.0.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:getpass@0.1.6": {
"assert-plus": "npm:assert-plus@1.0.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"tty": "github:jspm/nodelibs-tty@0.1.0"
},
"npm:graceful-readlink@1.0.1": {
"fs": "github:jspm/nodelibs-fs@0.1.2"
},
"npm:har-validator@2.0.6": {
"chalk": "npm:chalk@1.1.3",
"commander": "npm:commander@2.9.0",
"is-my-json-valid": "npm:is-my-json-valid@2.13.1",
"pinkie-promise": "npm:pinkie-promise@2.0.1",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:has-ansi@2.0.0": {
"ansi-regex": "npm:ansi-regex@2.0.0"
},
"npm:hash.js@1.0.3": {
"inherits": "npm:inherits@2.0.1"
},
"npm:hawk@3.1.3": {
"boom": "npm:boom@2.10.1",
"cryptiles": "npm:cryptiles@2.0.5",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"hoek": "npm:hoek@2.16.3",
"process": "github:jspm/nodelibs-process@0.1.2",
"sntp": "npm:sntp@1.0.9",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"url": "github:jspm/nodelibs-url@0.1.0"
},
"npm:hoek@2.16.3": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:http-signature@1.1.1": {
"assert-plus": "npm:assert-plus@0.2.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"http": "github:jspm/nodelibs-http@1.7.1",
"jsprim": "npm:jsprim@1.2.2",
"sshpk": "npm:sshpk@1.8.3",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:https-browserify@0.0.0": {
"http": "github:jspm/nodelibs-http@1.7.1"
},
"npm:inherits@2.0.1": {
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:is-my-json-valid@2.13.1": {
"fs": "github:jspm/nodelibs-fs@0.1.2",
"generate-function": "npm:generate-function@2.0.0",
"generate-object-property": "npm:generate-object-property@1.2.0",
"jsonpointer": "npm:jsonpointer@2.0.0",
"path": "github:jspm/nodelibs-path@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"xtend": "npm:xtend@4.0.1"
},
"npm:is-typedarray@1.0.0": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:isarray@1.0.0": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:isstream@0.1.2": {
"events": "github:jspm/nodelibs-events@0.1.1",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:jodid25519@1.0.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"jsbn": "npm:jsbn@0.1.0"
},
"npm:js-yaml@3.6.1": {
"argparse": "npm:argparse@1.0.7",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"esprima": "npm:esprima@2.7.2",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:jsbn@0.1.0": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:json-formatter-js@0.2.0": {
"fs": "github:jspm/nodelibs-fs@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:json-pointer@0.3.0": {
"foreach": "npm:foreach@2.0.5"
},
"npm:json-schema-ref-parser@3.1.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"call-me-maybe": "npm:call-me-maybe@1.0.1",
"debug": "npm:debug@2.2.0",
"es6-promise": "npm:es6-promise@3.2.1",
"events": "github:jspm/nodelibs-events@0.1.1",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"js-yaml": "npm:js-yaml@3.6.1",
"ono": "npm:ono@2.2.1",
"process": "github:jspm/nodelibs-process@0.1.2",
"punycode": "github:jspm/nodelibs-punycode@0.1.0",
"querystring": "github:jspm/nodelibs-querystring@0.1.0",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"string_decoder": "github:jspm/nodelibs-string_decoder@0.1.0",
"url": "github:jspm/nodelibs-url@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0",
"z-schema": "npm:z-schema@3.17.0"
},
"npm:jsonpointer@2.0.0": {
"assert": "github:jspm/nodelibs-assert@0.1.0"
},
"npm:jsprim@1.2.2": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"extsprintf": "npm:extsprintf@1.0.2",
"json-schema": "npm:json-schema@0.2.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0",
"verror": "npm:verror@1.3.6"
},
"npm:lodash._basetostring@4.12.0": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:lodash._stringtopath@4.8.0": {
"lodash._basetostring": "npm:lodash._basetostring@4.12.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:lodash.get@4.3.0": {
"lodash._stringtopath": "npm:lodash._stringtopath@4.8.0"
},
"npm:miller-rabin@4.0.0": {
"bn.js": "npm:bn.js@4.11.4",
"brorand": "npm:brorand@1.0.5"
},
"npm:mime-db@1.23.0": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:mime-types@2.1.11": {
"mime-db": "npm:mime-db@1.23.0",
"path": "github:jspm/nodelibs-path@0.1.0"
},
"npm:node-uuid@1.4.7": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0"
},
"npm:oauth-sign@0.8.2": {
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"querystring": "github:jspm/nodelibs-querystring@0.1.0"
},
"npm:ono@2.2.1": {
"process": "github:jspm/nodelibs-process@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:os-browserify@0.1.2": {
"os": "github:jspm/nodelibs-os@0.1.0"
},
"npm:pako@0.2.8": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:parse-asn1@5.0.0": {
"asn1.js": "npm:asn1.js@4.6.2",
"browserify-aes": "npm:browserify-aes@1.0.6",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"create-hash": "npm:create-hash@1.1.2",
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
"pbkdf2": "npm:pbkdf2@3.0.4",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:path-browserify@0.0.0": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:pbkdf2@3.0.4": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
"create-hmac": "npm:create-hmac@1.1.4",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:pinkie-promise@2.0.1": {
"pinkie": "npm:pinkie@2.0.4"
},
"npm:prismjs@1.3.0": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:process-nextick-args@1.0.6": {
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:process-nextick-args@1.0.7": {
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:process@0.11.5": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"vm": "github:jspm/nodelibs-vm@0.1.0"
},
"npm:process@0.11.8": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"vm": "github:jspm/nodelibs-vm@0.1.0"
},
"npm:public-encrypt@4.0.0": {
"bn.js": "npm:bn.js@4.11.4",
"browserify-rsa": "npm:browserify-rsa@4.0.1",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"create-hash": "npm:create-hash@1.1.2",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"parse-asn1": "npm:parse-asn1@5.0.0",
"randombytes": "npm:randombytes@2.0.3"
},
"npm:punycode@1.3.2": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:randombytes@2.0.3": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:readable-stream@1.1.14": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"core-util-is": "npm:core-util-is@1.0.2",
"events": "github:jspm/nodelibs-events@0.1.1",
"inherits": "npm:inherits@2.0.1",
"isarray": "npm:isarray@0.0.1",
"process": "github:jspm/nodelibs-process@0.1.2",
"stream-browserify": "npm:stream-browserify@1.0.0",
"string_decoder": "npm:string_decoder@0.10.31"
},
"npm:readable-stream@2.0.6": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"core-util-is": "npm:core-util-is@1.0.2",
"events": "github:jspm/nodelibs-events@0.1.1",
"inherits": "npm:inherits@2.0.1",
"isarray": "npm:isarray@1.0.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"process-nextick-args": "npm:process-nextick-args@1.0.7",
"string_decoder": "npm:string_decoder@0.10.31",
"util-deprecate": "npm:util-deprecate@1.0.2"
},
"npm:readable-stream@2.1.2": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"core-util-is": "npm:core-util-is@1.0.2",
"events": "github:jspm/nodelibs-events@0.1.1",
"inherits": "npm:inherits@2.0.1",
"isarray": "npm:isarray@1.0.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"process-nextick-args": "npm:process-nextick-args@1.0.6",
"string_decoder": "npm:string_decoder@0.10.31",
"util-deprecate": "npm:util-deprecate@1.0.2"
},
"npm:remarkable@1.6.2": {
"argparse": "npm:argparse@0.1.16",
"autolinker": "npm:autolinker@0.15.3",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:request@2.72.0": {
"aws-sign2": "npm:aws-sign2@0.6.0",
"aws4": "npm:aws4@1.4.1",
"bl": "npm:bl@1.1.2",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"caseless": "npm:caseless@0.11.0",
"combined-stream": "npm:combined-stream@1.0.5",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"extend": "npm:extend@3.0.0",
"forever-agent": "npm:forever-agent@0.6.1",
"form-data": "npm:form-data@1.0.0-rc4",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"har-validator": "npm:har-validator@2.0.6",
"hawk": "npm:hawk@3.1.3",
"http": "github:jspm/nodelibs-http@1.7.1",
"http-signature": "npm:http-signature@1.1.1",
"https": "github:jspm/nodelibs-https@0.1.0",
"is-typedarray": "npm:is-typedarray@1.0.0",
"isstream": "npm:isstream@0.1.2",
"json-stringify-safe": "npm:json-stringify-safe@5.0.1",
"mime-types": "npm:mime-types@2.1.11",
"node-uuid": "npm:node-uuid@1.4.7",
"oauth-sign": "npm:oauth-sign@0.8.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"qs": "npm:qs@6.1.0",
"querystring": "github:jspm/nodelibs-querystring@0.1.0",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"stringstream": "npm:stringstream@0.0.5",
"tough-cookie": "npm:tough-cookie@2.2.2",
"tunnel-agent": "npm:tunnel-agent@0.4.3",
"url": "github:jspm/nodelibs-url@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0",
"zlib": "github:jspm/nodelibs-zlib@0.1.0"
},
"npm:ripemd160@1.0.1": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:rxjs@5.0.0-beta.6": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:sha.js@2.4.5": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"inherits": "npm:inherits@2.0.1",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:sntp@1.0.9": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"dgram": "github:jspm/nodelibs-dgram@0.1.0",
"dns": "github:jspm/nodelibs-dns@0.1.0",
"hoek": "npm:hoek@2.16.3",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:source-map@0.4.4": {
"amdefine": "npm:amdefine@1.0.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:sshpk@1.8.3": {
"asn1": "npm:asn1@0.2.3",
"assert-plus": "npm:assert-plus@1.0.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
"dashdash": "npm:dashdash@1.14.0",
"ecc-jsbn": "npm:ecc-jsbn@0.1.1",
"getpass": "npm:getpass@0.1.6",
"jodid25519": "npm:jodid25519@1.0.2",
"jsbn": "npm:jsbn@0.1.0",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"tweetnacl": "npm:tweetnacl@0.13.3",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:stream-browserify@1.0.0": {
"events": "github:jspm/nodelibs-events@0.1.1",
"inherits": "npm:inherits@2.0.1",
"readable-stream": "npm:readable-stream@1.1.14"
},
"npm:stream-http@2.3.0": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"builtin-status-codes": "npm:builtin-status-codes@2.0.0",
"inherits": "npm:inherits@2.0.1",
"process": "github:jspm/nodelibs-process@0.1.2",
"readable-stream": "npm:readable-stream@2.1.2",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"to-arraybuffer": "npm:to-arraybuffer@1.0.1",
"url": "github:jspm/nodelibs-url@0.1.0",
"xtend": "npm:xtend@4.0.1"
},
"npm:string_decoder@0.10.31": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
},
"npm:stringstream@0.0.5": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"stream": "github:jspm/nodelibs-stream@0.1.0",
"string_decoder": "github:jspm/nodelibs-string_decoder@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0",
"zlib": "github:jspm/nodelibs-zlib@0.1.0"
},
"npm:strip-ansi@3.0.1": {
"ansi-regex": "npm:ansi-regex@2.0.0"
},
"npm:supports-color@2.0.0": {
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:timers-browserify@1.4.2": {
"process": "npm:process@0.11.5"
},
"npm:to-arraybuffer@1.0.1": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:tough-cookie@2.2.2": {
"net": "github:jspm/nodelibs-net@0.1.2",
"punycode": "github:jspm/nodelibs-punycode@0.1.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"url": "github:jspm/nodelibs-url@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:tunnel-agent@0.4.3": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"events": "github:jspm/nodelibs-events@0.1.1",
"http": "github:jspm/nodelibs-http@1.7.1",
"https": "github:jspm/nodelibs-https@0.1.0",
"net": "github:jspm/nodelibs-net@0.1.2",
"process": "github:jspm/nodelibs-process@0.1.2",
"tls": "github:jspm/nodelibs-tls@0.1.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:url@0.10.3": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"punycode": "npm:punycode@1.3.2",
"querystring": "npm:querystring@0.2.0",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:util-deprecate@1.0.2": {
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:util@0.10.3": {
"inherits": "npm:inherits@2.0.1",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:verror@1.3.6": {
"assert": "github:jspm/nodelibs-assert@0.1.0",
"extsprintf": "npm:extsprintf@1.0.2",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"util": "github:jspm/nodelibs-util@0.1.0"
},
"npm:vm-browserify@0.0.4": {
"indexof": "npm:indexof@0.0.1"
},
"npm:xtend@4.0.1": {
"systemjs-json": "github:systemjs/plugin-json@0.1.2"
},
"npm:z-schema@3.17.0": {
"commander": "npm:commander@2.9.0",
"lodash.get": "npm:lodash.get@4.3.0",
"process": "github:jspm/nodelibs-process@0.1.2",
"request": "npm:request@2.72.0",
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
"validator": "npm:validator@5.4.0"
},
"npm:zone.js@0.6.12": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
},
"npm:zone.js@0.6.14": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2"
}
}
});

1
tests/e2e/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
redoc.min.js

View File

@ -10,11 +10,10 @@
</redoc>
<!-- ReDoc built file with all dependencies included -->
<script src="dist/redoc.min.js"> </script>
<script src="redoc.min.js"> </script>
<script>
window.redocError = null;
/* init redoc */
window.redocDebugMode = true;
var url = window.location.search.substr(5) || 'http://rebilly.github.io/SwaggerTemplateRepo/swagger.json';
Redoc.init(decodeURIComponent(url), {disableLazySchemas: true}).then(function() {}, function(err) {
window.redocError = err;

View File

@ -1,33 +0,0 @@
'use strict';
import {TestBed} from '@angular/core/testing';
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
import { OptionsService, RedocEventsService, MenuService,
ScrollService, Hash, WarningsService } from '../lib/services/index';
import { SpecManager } from '../lib/utils/SpecManager';
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
import { REDOC_PIPES } from '../lib/utils/pipes';
import { REDOC_COMMON_DIRECTIVES } from '../lib/shared/components/index';
import { REDOC_DIRECTIVES } from '../lib/components/index';
TestBed.initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
beforeEach( () => {
TestBed.configureTestingModule({
providers: [
BrowserDomAdapter,
SpecManager,
BrowserDomAdapter,
RedocEventsService,
ScrollService,
Hash,
MenuService,
WarningsService,
OptionsService
],
declarations: [REDOC_PIPES, REDOC_DIRECTIVES, REDOC_COMMON_DIRECTIVES]
});
});

66
tests/spec-bundle.js Normal file
View File

@ -0,0 +1,66 @@
'use strict';
Error.stackTraceLimit = Infinity;
require('core-js/es6');
require('core-js/es7/reflect');
// Typescript emit helpers polyfill
require('ts-helpers');
require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');
require('zone.js/dist/sync-test');
require('zone.js/dist/proxy');
require('zone.js/dist/jasmine-patch');
require('../lib/vendor');
var TestBed = require('@angular/core/testing').TestBed;
var BrowserDynamicTestingModule = require('@angular/platform-browser-dynamic/testing').BrowserDynamicTestingModule;
var platformBrowserDynamicTesting = require('@angular/platform-browser-dynamic/testing').platformBrowserDynamicTesting;
var services = require('../lib/services/index');
var SpecManager = require('../lib/utils/SpecManager').SpecManager;
var BrowserDomAdapter = require('@angular/platform-browser/src/browser/browser_adapter').BrowserDomAdapter;
var REDOC_PIPES = require('../lib/utils/pipes').REDOC_PIPES;
var REDOC_COMMON_DIRECTIVES = require('../lib/shared/components/index').REDOC_COMMON_DIRECTIVES;
var REDOC_DIRECTIVES = require('../lib/components/index').REDOC_DIRECTIVES;
TestBed.initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
beforeEach(function() {
TestBed.configureTestingModule({
providers: [
BrowserDomAdapter,
SpecManager,
BrowserDomAdapter,
services.RedocEventsService,
services.ScrollService,
services.Hash,
services.MenuService,
services.WarningsService,
services.OptionsService
],
declarations: [REDOC_PIPES, REDOC_DIRECTIVES, REDOC_COMMON_DIRECTIVES]
});
});
var testContext = require.context('..', true, /\.spec\.ts/);
/*
* get all the files, for each file, call the context function
* that will require( the file and load it up here. Context wil);
* loop and require those spec files here
*/
function requireAll(requireContext) {
return requireContext.keys().map(requireContext);
}
// requires and returns all modules that match
var modules = requireAll(testContext);

View File

@ -6,22 +6,25 @@
"target": "es5",
"noImplicitAny": false,
"sourceMap": true,
"outDir": ".tmp/",
"outDir": ".tmp/lib",
"pretty": true,
"moduleResolution": "node",
"types": [
"core-js",
"jasmine",
"should"
]
"should",
"requirejs"
],
"noEmitHelpers": true
},
"compileOnSave": false,
"exclude": [
"node_modules",
"jspm_packages",
".tmp",
"build",
"docs",
"*.spec.js",
"lib/index.js"
]
"node_modules",
".tmp"
],
"awesomeTypescriptLoaderOptions": {
"resolveGlobs": true,
"forkChecker": true
}
}