mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-24 09:33:44 +03:00
Merge branch 'master' into releases
This commit is contained in:
commit
a6e7f858d7
|
@ -5,28 +5,20 @@ require('shelljs/global');
|
|||
var paths = require('./paths');
|
||||
var path = require('path');
|
||||
|
||||
// copy old releases
|
||||
mkdir('-p', '.ghpages-tmp');
|
||||
cd('.ghpages-tmp');
|
||||
|
||||
// reset local changes before checkout
|
||||
exec('git reset --hard');
|
||||
exec('git fetch origin gh-pages:gh-pages');
|
||||
exec('git checkout gh-pages');
|
||||
cp('-R', '../releases/*', '.');
|
||||
exec('git checkout @{-1}');
|
||||
cd('..');
|
||||
set('-e');
|
||||
set('-v');
|
||||
|
||||
// build
|
||||
exec('npm run build-dist');
|
||||
cd('demo');
|
||||
mkdir('-p', 'dist');
|
||||
cp('-R', '../dist/*', './dist/');
|
||||
mkdir('-p', 'releases');
|
||||
cp('-R', '../.ghpages-tmp/*', './releases/');
|
||||
cd('..');
|
||||
|
||||
var version = 'v' + require(path.join(__dirname, '../package.json')).version + '/';
|
||||
var versionDir = path.join(paths.releases, version);
|
||||
var latestDir = path.join(paths.releases, 'latest/');
|
||||
mkdir('-p', versionDir)
|
||||
mkdir('-p', latestDir);
|
||||
cp(paths.redocBuilt + '.min.js', versionDir);
|
||||
cp(paths.redocBuilt + '.min.js', path.join(paths.releases, 'latest/'));
|
||||
cp(paths.redocBuilt + '.min.js', latestDir);
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
var gulp = require('gulp');
|
||||
var path = require('path');
|
||||
var paths = require('../paths');
|
||||
|
||||
gulp.task('copy-version', function() {
|
||||
var tag = 'v' + require(path.join(__dirname, '../../package.json')).version;
|
||||
gulp.src(paths.redocBuilt + '.min.js')
|
||||
.pipe(gulp.dest(path.join(paths.releases, tag)))
|
||||
.pipe(gulp.dest(path.join(paths.releases, 'latest')));
|
||||
});
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { ElementRef } from '@angular/core';
|
||||
|
||||
import SchemaSampler from 'json-schema-instantiator';
|
||||
import * as OpenAPISampler from 'openapi-sampler';
|
||||
|
||||
import { RedocComponent, BaseComponent, SchemaManager } from '../base';
|
||||
import { JsonFormatter } from '../../utils/JsonFormatterPipe';
|
||||
|
@ -36,7 +36,11 @@ export class SchemaSample extends BaseComponent {
|
|||
sample = base.examples['application/json'];
|
||||
} else {
|
||||
this.dereference(this.componentSchema);
|
||||
sample = SchemaSampler.instantiate(this.componentSchema);
|
||||
try {
|
||||
sample = OpenAPISampler.sample(this.componentSchema);
|
||||
} catch(e) {
|
||||
console.error('@@@@@@@@@@@@@@@@@@@' + e);
|
||||
}
|
||||
}
|
||||
|
||||
this.data.sample = sample;
|
||||
|
|
|
@ -65,6 +65,7 @@ pre {
|
|||
}
|
||||
|
||||
.redoc-json {
|
||||
overflow-x: auto;
|
||||
padding: 20px;
|
||||
border-radius: $border-radius*2;
|
||||
background-color: darken($black, 2%);
|
||||
|
|
12
package.json
12
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "redoc",
|
||||
"description": "Swagger-generated API Reference Documentation",
|
||||
"version": "0.12.0",
|
||||
"version": "0.13.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Rebilly/ReDoc"
|
||||
|
@ -15,7 +15,7 @@
|
|||
"branch-release": "git reset --hard && branch-release",
|
||||
"unit": "gulp test",
|
||||
"e2e": "gulp e2e --prod",
|
||||
"deploy": "node ./build/prepare_deploy.js && deploy-to-gh-pages demo"
|
||||
"deploy": "node ./build/prepare_deploy.js && deploy-to-gh-pages --update demo"
|
||||
},
|
||||
"keywords": [
|
||||
"OpenAPI",
|
||||
|
@ -43,9 +43,9 @@
|
|||
"json": "github:systemjs/plugin-json@^0.1.0",
|
||||
"json-formatter-js": "npm:json-formatter-js@^0.2.0",
|
||||
"json-pointer": "npm:json-pointer@^0.3.0",
|
||||
"json-schema-instantiator": "npm:json-schema-instantiator@^0.3.0",
|
||||
"json-schema-ref-parser": "npm:json-schema-ref-parser@^3.1.2",
|
||||
"marked": "npm:marked@^0.3.5",
|
||||
"openapi-sampler": "npm:openapi-sampler@^0.1.2",
|
||||
"prismjs": "npm:prismjs@^1.3.0",
|
||||
"rxjs": "npm:rxjs@5.0.0-beta.6",
|
||||
"scrollparent": "npm:scrollparent@^0.1.0",
|
||||
|
@ -63,6 +63,10 @@
|
|||
"overrides": {
|
||||
"github:Robdel12/DropKick@2.1.7": {
|
||||
"format": "global"
|
||||
},
|
||||
"npm:openapi-sampler@0.1.2": {
|
||||
"main": "src/openapi-sampler",
|
||||
"format": "esm"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -72,7 +76,7 @@
|
|||
"branch-release": "^0.3.2",
|
||||
"browser-sync": "^2.10.1",
|
||||
"del": "^2.2.0",
|
||||
"deploy-to-gh-pages": "^1.0.0",
|
||||
"deploy-to-gh-pages": "^1.1.2",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-concat": "^2.6.0",
|
||||
"gulp-eslint": "^1.1.1",
|
||||
|
|
|
@ -53,9 +53,9 @@ System.config({
|
|||
"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-instantiator": "npm:json-schema-instantiator@0.3.0",
|
||||
"json-schema-ref-parser": "npm:json-schema-ref-parser@3.1.2",
|
||||
"marked": "npm:marked@0.3.5",
|
||||
"openapi-sampler": "npm:openapi-sampler@0.1.2",
|
||||
"prismjs": "npm:prismjs@1.3.0",
|
||||
"rxjs": "npm:rxjs@5.0.0-beta.6",
|
||||
"scrollparent": "npm:scrollparent@0.1.0",
|
||||
|
|
Loading…
Reference in New Issue
Block a user