From 585b9cfb5679796536bdbd4619f92e88275312ab Mon Sep 17 00:00:00 2001 From: Khoa Tran Date: Mon, 10 Apr 2017 17:50:21 +1000 Subject: [PATCH 01/15] fix issue with loading https spec. See https://github.com/Rebilly/ReDoc/issues/243 --- build/webpack.common.js | 2 +- package.json | 1 + yarn.lock | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build/webpack.common.js b/build/webpack.common.js index 30e9a57d..da047652 100644 --- a/build/webpack.common.js +++ b/build/webpack.common.js @@ -23,7 +23,7 @@ module.exports = function (options) { extensions: ['.ts', '.js', '.json', '.css'], alias: { http: 'stream-http', - https: 'stream-http' + https: 'https-browserify' } }, diff --git a/package.json b/package.json index d0381e92..2ffe2e96 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "dropkickjs": "^2.1.10", "hint.css": "^2.3.2", "http-server": "^0.9.0", + "https-browserify": "^1.0.0", "istanbul-instrumenter-loader": "^2.0.0", "jasmine-core": "^2.4.1", "jasmine-spec-reporter": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index cff5c269..97a83a91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2369,6 +2369,10 @@ https-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + https-proxy-agent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6" From 303b49e9185082585c705e56dbb7dae17b09fbec Mon Sep 17 00:00:00 2001 From: Vincent Giersch Date: Mon, 17 Apr 2017 11:38:31 +0200 Subject: [PATCH 02/15] fix: ul missing css --- lib/components/Redoc/redoc.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/components/Redoc/redoc.scss b/lib/components/Redoc/redoc.scss index 415a7940..b6e0443d 100644 --- a/lib/components/Redoc/redoc.scss +++ b/lib/components/Redoc/redoc.scss @@ -240,6 +240,9 @@ footer { padding-left: 2em; margin: 0; margin-bottom: 1em; + font-family: $base-font, $base-font-family; + font-weight: $base-font-weight; + line-height: $base-line-height; } table { From 3f48357e39563778cd5888f4f2cd93159c214660 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sat, 1 Apr 2017 15:12:23 +0300 Subject: [PATCH 03/15] chore: module build + export services --- build/webpack.prod.js | 24 ++++++++++++------------ lib/redoc.module.ts | 16 ++++++++++++++-- package.json | 6 ++++-- tsconfig.json | 3 ++- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/build/webpack.prod.js b/build/webpack.prod.js index 1b517d66..e21d6735 100644 --- a/build/webpack.prod.js +++ b/build/webpack.prod.js @@ -49,18 +49,18 @@ const config = webpackMerge(commonConfig({ minimize: true, debug: false }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - screw_ie8: true, - negate_iife: false // for lazy v8 - }, - mangle: { screw_ie8 : true }, - output: { - comments: false - }, - sourceMap: true - }), + // new webpack.optimize.UglifyJsPlugin({ + // compress: { + // warnings: false, + // screw_ie8: true, + // negate_iife: false // for lazy v8 + // }, + // mangle: { screw_ie8 : true }, + // output: { + // comments: false + // }, + // sourceMap: true + // }), new webpack.BannerPlugin(BANNER) ] }) diff --git a/lib/redoc.module.ts b/lib/redoc.module.ts index b3081fc0..5e5a5dca 100644 --- a/lib/redoc.module.ts +++ b/lib/redoc.module.ts @@ -17,6 +17,7 @@ import { ComponentParser, ContentProjector, Marker, + SchemaHelper, SearchService, COMPONENT_PARSER_ALLOWED } from './services/'; @@ -39,9 +40,20 @@ import { SpecManager } from './utils/spec-manager'; { provide: ErrorHandler, useClass: CustomErrorHandler }, { provide: COMPONENT_PARSER_ALLOWED, useValue: { 'security-definitions': SecurityDefinitions} } ], - exports: [Redoc] + exports: [Redoc, REDOC_DIRECTIVES, REDOC_COMMON_DIRECTIVES, REDOC_PIPES] }) export class RedocModule { } -export { Redoc, SpecManager }; +export { Redoc, SpecManager, ScrollService, +Hash, +WarningsService, +OptionsService, +AppStateService, +ComponentParser, +ContentProjector, +MenuService, +SearchService, +SchemaHelper, +LazyTasksService, +Marker }; diff --git a/package.json b/package.json index 2ffe2e96..10c974b3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "node": ">=6.9", "npm": ">=3.0.0" }, - "main": "dist/redoc.min.js", + "main": "dist/redoc-module.js", "scripts": { "test": "npm run lint && node ./build/run_tests.js", "branch-release": "git reset --hard && branch-release", @@ -33,7 +33,9 @@ "webdriver": "webdriver-manager update", "serve:prod": "NODE_ENV=production npm start", "protractor": "protractor", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1" + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1", + "build:prod-module": "npm run build:sass && npm run ngc && npm run webpack:prod && IS_MODULE=true npm run webpack:prod", + "build:module": "npm run build:sass && npm run ngc && IS_MODULE=true npm run webpack:prod" }, "keywords": [ "OpenAPI", diff --git a/tsconfig.json b/tsconfig.json index 10461ce5..fbb918e7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,10 +13,11 @@ "should", "webpack" ], + "outDir": "dist", "lib": [ "DOM", "ES2016", "DOM.Iterable" ], - "noEmitHelpers": true + "noEmitHelpers": false }, "compileOnSave": false, "exclude": [ From 92eec250e637a19b6fe2e233a99ff912b7b7f323 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 18 Apr 2017 16:10:34 +0300 Subject: [PATCH 04/15] new: Add verbs badges (implements #61) --- .../EndpointLink/endpoint-link.scss | 36 ++++++++++++ lib/components/SideMenu/side-menu-items.html | 5 +- lib/components/SideMenu/side-menu-items.scss | 55 +++++++++++++++++++ lib/components/SideMenu/side-menu.ts | 11 ++-- 4 files changed, 99 insertions(+), 8 deletions(-) diff --git a/lib/components/EndpointLink/endpoint-link.scss b/lib/components/EndpointLink/endpoint-link.scss index 3bcbc510..9a70ba0a 100644 --- a/lib/components/EndpointLink/endpoint-link.scss +++ b/lib/components/EndpointLink/endpoint-link.scss @@ -110,3 +110,39 @@ transform: translateY(0%) scaleY(1); } } + +.http-verb { + color: white; + + &.get { + background-color: $get-color; + } + + &.post { + background-color: $post-color; + } + + &.put { + background-color: $put-color; + } + + &.options { + background-color: $options-color; + } + + &.patch { + background-color: $patch-color; + } + + &.delete { + background-color: $delete-color; + } + + &.basic { + background-color: $basic-color; + } + + &.link { + background-color: $link-color; + } +} diff --git a/lib/components/SideMenu/side-menu-items.html b/lib/components/SideMenu/side-menu-items.html index 0db93069..b9ab5340 100644 --- a/lib/components/SideMenu/side-menu-items.html +++ b/lib/components/SideMenu/side-menu-items.html @@ -1,6 +1,9 @@