Compare commits

...
34 Commits
Author SHA1 Message Date
shockey 165c1d7fcb Merge pull request #3290 from shockey/v/3.0.17
v3.0.17
2017-06-23 21:30:00 -07:00
Kyle Shockey b1c6584112 Rebuild dist 2017-06-23 21:23:04 -07:00
Kyle Shockey f3c3c5c340 v3.0.17 2017-06-23 21:12:01 -07:00
shockey 90c3be0e24 Merge pull request #3285 from swagger-api/lock-client-version
Lock swagger-client dependency version
2017-06-23 15:04:00 -07:00
shockey 75521f64d9 Merge branch 'master' into lock-client-version 2017-06-23 01:04:57 -07:00
shockey d02dc6eebc Merge pull request #3276 from swagger-api/feature/misuse-of-findIndex
Fix a case of misusing findIndex.
2017-06-22 23:34:52 -07:00
shockey 841dcaf2fb Merge branch 'master' into feature/misuse-of-findIndex 2017-06-22 23:25:12 -07:00
shockey 4c2a6f452e Merge pull request #3287 from shockey/bug/3279-markdown-falsey-values
Don't render Markdown if input or sanitized input is empty
2017-06-22 22:20:18 -07:00
shockey 4fb43fc886 Merge branch 'master' into bug/3279-markdown-falsey-values 2017-06-22 22:15:33 -07:00
Kyle Shockey 2fb04c286b Add tests 2017-06-22 22:11:37 -07:00
Kyle Shockey 21100a0a8b Don't render Markdown if input or sanitized input is empty 2017-06-22 22:05:38 -07:00
shockey 40a8376a4f Merge branch 'master' into lock-client-version 2017-06-22 20:45:57 -07:00
shockey 064bebe222 Merge branch 'master' into feature/misuse-of-findIndex 2017-06-22 09:02:23 -07:00
shockey 7f01d05ed7 Merge pull request #3281 from swagger-api/ft/yaml-js-version-update
Update and pin yaml-js version
2017-06-22 08:51:11 -07:00
shockey b762a2f623 Update and pin yaml-js version 2017-06-22 08:41:59 -07:00
Josh Ponelat 2ffb44e052 build 2017-06-22 09:11:42 +02:00
Josh Ponelat ff16ecd99a Fix mis-use of findIndex ( these really must be tested ) 2017-06-22 09:01:41 +02:00
shockey 23c2682311 Merge pull request #3270 from swagger-api/feature/add-back-shallowEqualKeys
Add back shallowEqualKeys ( editor depends on it )
2017-06-21 09:48:47 -07:00
Josh Ponelat 538a5dbd0e build 2017-06-21 15:29:52 +02:00
Josh Ponelat 9549bf3c2b Add back shallowEqualKeys ( editor depends on it ) 2017-06-21 15:29:37 +02:00
Ron 4536ebaf3b Merge pull request #3213 from swagger-api/good-first-contribution-1
Add `Good first contribution` message
2017-06-20 14:24:46 -07:00
Ron 7e7444bc86 Merge branch 'master' into good-first-contribution-1 2017-06-20 14:20:42 -07:00
shockey 55e4a12502 Merge pull request #2959 from swagger-api/feature/remove-babel-polyfill
Replace babel-polyfill with transform-runtime
2017-06-20 11:30:59 -07:00
shockey ed08d9fb88 Merge branch 'master' into feature/remove-babel-polyfill 2017-06-20 11:15:48 -07:00
shockey c0a700346b Merge pull request #3264 from konqi/patch-1
don't use ES6 syntax in a dist package
2017-06-20 11:09:16 -07:00
Johann Wagner ab960e8c45 don't use ES6 syntax in a dist package
using ES6 syntax will cause trouble unless you transpile before use (which is something you should not be required to do in a dist package)
2017-06-20 18:45:30 +02:00
Josh Ponelat 13deee49f8 build 2017-06-19 18:56:45 +02:00
Josh Ponelat e831fba297 Merge branch 'master' into feature/remove-babel-polyfill 2017-06-19 18:49:37 +02:00
Josh Ponelat a536a00d35 fix lint 2017-06-19 18:46:49 +02:00
Josh Ponelat 9e6e660a93 Add polyfill for Promise ( only )
This is needed for whatwg-fetch + IE11.
An alternative is to include "node_modules/whatwg-fetch" in the
transform-runtime.
But my guess is that someone is likely going to add a lib that in turn
uses Promises, without adding it to the whitelist. This is safter.
2017-06-19 18:40:42 +02:00
Josh Ponelat 0e4d04650d Fixes for IE11, wrt to instance methods 2017-06-19 18:29:45 +02:00
Josh Ponelat 4a6716ffed Replace babel-polyfill with runtime transform 2017-06-15 16:36:33 +02:00
shockey 8ef7818f56 Add Good first contribution message 2017-06-08 22:58:40 -07:00
shockey 5b7673590a Lock swagger-client dependency version 2017-06-01 12:45:19 -07:00
21 changed files with 145 additions and 96 deletions
+1
View File
@@ -5,6 +5,7 @@
"stage-0"
],
"plugins": [
"transform-runtime",
[
"module-alias",
[
+3 -1
View File
@@ -6,6 +6,8 @@
**This is the new version of swagger-ui, 3.x. Want to learn more? Check out our [FAQ](http://swagger.io/new-ui-faq/).**
**👉🏼 Want to score an easy open-source contribution?** Check out our [Good first contribution](https://github.com/swagger-api/swagger-ui/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+first+contribution%22) label.
As a brand new version, written from the ground up, there are some known issues and unimplemented features. Check out the [Known Issues](#known-issues) section for more details.
This repo publishes to two different NPM packages:
@@ -20,7 +22,7 @@ The OpenAPI Specification has undergone 4 revisions since initial creation in 20
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | Status
------------------ | ------------ | -------------------------- | ----- | ------
3.0.16 | 2017-06-17 | 2.0 | [tag v3.0.16](https://github.com/swagger-api/swagger-ui/tree/v3.0.16) |
3.0.17 | 2017-06-23 | 2.0 | [tag v3.0.17](https://github.com/swagger-api/swagger-ui/tree/v3.0.17) |
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10) |
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5) |
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
+40 -43
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AA2TA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AAioJA;AA2iGA;AAs+FA;AA4kFA;AA6jFA;AAm9CA;AA6jDA;AAgrCA;AA+/EA;;;;;AAu3BA;AA0qJA;;;;;;;;;;;;;;AAwoFA;AA+lIA;AA2hJA;AAo2HA;AA8lGA;AAwiEA;AAo4DA;AAk7DA;AAyHA;;;;;;AA6iGA;AA07FA;;;;;AAi8CA;AAgsFA;AAs2CA;AAilCA;AA+7CA;AA85DA;AA4zCA;AAs5FA;;;;;;;;;AAqlCA;AA2zIA;AAu7FA;AAmrFA;AA20EA","sourceRoot":""}
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAitFA;;;;;;AAoIA;AAy2FA;AA8iCA;AA6lJA;AA8vIA;AA8iFA;AAi4GA;AA8jFA;AAu0FA;AA89CA;AAy9CA;AA+qCA;AAs0EA;;;;;AAw/CA;AA8zJA;;;;;;;;;;;;;;AAyoFA;AA+lIA;AA4oJA;AAqvHA;AAsvGA;AA2iEA;AAy5DA;AA65DA;AAAA;;;;;;AAk8GA;AA2nHA;;;;;AAkoDA;AAgsFA;AA6kDA;AAq3CA;AA4wFA;AAk3CA;AA8iFA;;;;;;;;;AA2qEA;AA2zIA;AAu7FA;AAmrFA;AAwiHA","sourceRoot":""}
+11 -10
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"swagger-ui-standalone-preset.js","sources":["webpack:///swagger-ui-standalone-preset.js"],"mappings":"AAAA;;;;;AA0SA;AAgyGA;AAuxFA;;;;;;AAocA;AAkvFA;AAu+CA;AAo+CA;AAgrCA;AAuyEA","sourceRoot":""}
{"version":3,"file":"swagger-ui-standalone-preset.js","sources":["webpack:///swagger-ui-standalone-preset.js"],"mappings":"AAAA;AA+uFA;;;;;AAyOA;AAo7GA;AAw0FA;;;;;;AAmZA;AAivFA;AAu+CA;AAo+CA;AAirCA;AAuyEA","sourceRoot":""}
+9 -9
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAizCA;AAoyHA;AAmyHA;AAukGA;AA+9BA;AA8jCA;AAyiCA;AAs5BA","sourceRoot":""}
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAylFA;;;;;;AAg5CA;AA2pHA;AA6qIA;AAi+FA;AAyvDA;AAmzCA;AA+xCA","sourceRoot":""}
+1 -1
View File
@@ -147,7 +147,7 @@ module.exports = function(options) {
extensions: ["", ".web.js", ".js", ".jsx", ".json", ".less"],
packageAlias: 'browser',
alias: {
base: "getbase/src/less/base"
base: "getbase/src/less/base",
}
},
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "3.0.16",
"version": "3.0.17",
"main": "dist/swagger-ui.js",
"repository": "git@github.com:swagger-api/swagger-ui.git",
"contributors": [
@@ -35,7 +35,6 @@
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package"
},
"dependencies": {
"babel-polyfill": "^6.23.0",
"base64-js": "^1.2.0",
"brace": "0.7.0",
"deep-extend": "0.4.1",
@@ -70,12 +69,12 @@
"sanitize-html": "^1.14.1",
"serialize-error": "2.0.0",
"shallowequal": "0.2.2",
"swagger-client": "~3.0.15",
"swagger-client": "3.0.16",
"url-parse": "^1.1.8",
"whatwg-fetch": "0.11.1",
"worker-loader": "^0.7.1",
"xml": "1.0.1",
"yaml-js": "^0.1.3"
"yaml-js": "0.2.0"
},
"devDependencies": {
"autoprefixer": "6.6.1",
@@ -83,6 +82,7 @@
"babel-eslint": "^7.1.1",
"babel-loader": "^6.3.2",
"babel-plugin-module-alias": "^1.6.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-es2015-ie": "^6.6.2",
"babel-preset-react": "^6.23.0",
@@ -132,7 +132,7 @@
"browserslist": [
"> 1%",
"last 2 versions",
"IE 10"
"IE 11"
],
"optionalDependencies": {
"webpack-dev-server": "1.14.0"
@@ -11,6 +11,12 @@ const sanitizeOptions = {
function Markdown({ source }) {
const sanitized = sanitize(source, sanitizeOptions)
// sometimes the sanitizer returns "undefined" as a string
if(!source || !sanitized || sanitized === "undefined") {
return null
}
return <Remarkable
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
source={sanitized}
+1
View File
@@ -117,6 +117,7 @@ module.exports = function SwaggerUI(opts) {
return downloadSpec()
}
return system
}
// Add presets
+1 -1
View File
@@ -41,7 +41,7 @@ export default {
[UPDATE_PARAM]: ( state, {payload} ) => {
let { path, paramName, value, isXml } = payload
return state.updateIn( [ "resolved", "paths", ...path, "parameters" ], fromJS([]), parameters => {
let index = parameters.findIndex( p => p.get( "name" ) === paramName )
const index = parameters.findIndex(p => p.get( "name" ) === paramName )
if (!(value instanceof win.File)) {
value = fromJSOrdered( value )
}
+8 -6
View File
@@ -1,9 +1,9 @@
import Im from "immutable"
import shallowEqual from "shallowequal"
import camelCase from "lodash/camelCase"
import upperFirst from "lodash/upperFirst"
import _memoize from "lodash/memoize"
import find from "lodash/find"
import some from "lodash/some"
import eq from "lodash/eq"
import { memoizedSampleFromSchema, memoizedCreateXMLExample } from "core/plugins/samples/fn"
@@ -418,11 +418,6 @@ export function pascalCaseFilename(filename) {
return pascalCase(filename.replace(/\.[^./]*$/, ""))
}
// Only compare a set of props
export function shallowEqualKeys(a,b, keys) {
return !!keys.find(key => !shallowEqual(a[key], b[key]))
}
// Check if ...
// - new props
// - If immutable, use .is()
@@ -593,3 +588,10 @@ export const filterConfigs = (configs, allowed) => {
return filteredConfigs
}
// Is this really required as a helper? Perhaps. TODO: expose the system of presets.apis in docs, so we know what is supported
export const shallowEqualKeys = (a,b, keys) => {
return !!find(keys, (key) => {
return eq(a[key], b[key])
})
}
+2
View File
@@ -0,0 +1,2 @@
// Promise global, Used ( at least ) by 'whatwg-fetch'. And required by IE 11
require("core-js/fn/promise")
+1 -1
View File
@@ -3,7 +3,7 @@
* @return {string} When run in NodeJS env, returns the absolute path to the current directory
* When run outside of NodeJS, will return an error message
*/
const getAbsoluteFSPath = () => {
const getAbsoluteFSPath = function () {
// detect whether we are running in a browser or nodejs
if (typeof module !== "undefined" && module.exports) {
return require("path").resolve(__dirname)
+37
View File
@@ -0,0 +1,37 @@
/* eslint-env mocha */
import React from "react"
import expect from "expect"
import { render } from "enzyme"
import Markdown from "components/providers/markdown"
describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
it("should return no text for `null` as source input", function(){
let props = {
source: null
}
let el = render(<Markdown {...props}/>)
expect(el.text()).toEqual("")
})
it("should return no text for `undefined` as source input", function(){
let props = {
source: undefined
}
let el = render(<Markdown {...props}/>)
expect(el.text()).toEqual("")
})
it("should return no text for empty string as source input", function(){
let props = {
source: ""
}
let el = render(<Markdown {...props}/>)
expect(el.text()).toEqual("")
})
})
+1 -1
View File
@@ -13,7 +13,7 @@ module.exports = require('./make-webpack-config.js')({
entry: {
'swagger-ui-bundle': [
'babel-polyfill',
'./src/polyfills',
'./src/core/index.js'
]
},
+1
View File
@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({
entry: {
'swagger-ui-standalone-preset': [
'./src/polyfills',
'./src/standalone/index.js'
]
},
+11 -12
View File
@@ -1,9 +1,8 @@
var path = require('path')
var fs = require('fs')
var node_modules = fs.readdirSync('node_modules').filter(function(x) { return x !== '.bin' })
const path = require("path")
const fs = require("fs")
const nodeModules = fs.readdirSync("node_modules").filter(function(x) { return x !== ".bin" })
module.exports = require('./make-webpack-config.js')({
module.exports = require("./make-webpack-config.js")({
_special: {
separateStylesheets: true,
minimize: true,
@@ -15,9 +14,9 @@ module.exports = require('./make-webpack-config.js')({
entry: {
"swagger-ui": [
'babel-polyfill',
'./src/style/main.scss',
'./src/core/index.js'
"./src/style/main.scss",
"./src/polyfills",
"./src/core/index.js"
]
},
@@ -25,11 +24,11 @@ module.exports = require('./make-webpack-config.js')({
// webpack injects some stuff into the resulting file,
// these libs need to be pulled in to keep that working.
var exceptionsForWebpack = ["ieee754", "base64-js"]
if(node_modules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
cb(null, 'commonjs ' + request)
return;
if(nodeModules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
cb(null, "commonjs " + request)
return
}
cb();
cb()
},
output: {
+3 -3
View File
@@ -10,12 +10,12 @@ module.exports = require("./make-webpack-config")({
devtool: "eval",
entry: {
'swagger-ui-bundle': [
'webpack/hot/dev-server',
'babel-polyfill',
'./src/core/index.js',
'./src/polyfills',
'./src/core/index.js'
],
'swagger-ui-standalone-preset': [
'webpack/hot/dev-server',
'./src/polyfills',
'./src/standalone/index.js',
]
},