Merge branch 'master' into bug/3279-markdown-falsey-values
This commit is contained in:
1
.babelrc
1
.babelrc
@@ -5,6 +5,7 @@
|
||||
"stage-0"
|
||||
],
|
||||
"plugins": [
|
||||
"transform-runtime",
|
||||
[
|
||||
"module-alias",
|
||||
[
|
||||
|
||||
@@ -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:
|
||||
|
||||
96
dist/swagger-ui-bundle.js
vendored
96
dist/swagger-ui-bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui-bundle.js.map
vendored
2
dist/swagger-ui-bundle.js.map
vendored
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;AAmqDA;AAorJA;AAiiCA;AAm1GA;AAiwHA;AAg9FA;AAm/EA;AAiuDA;AAq/CA;AAwkDA;AAk/CA;;;;;AA60EA;AA8zJA;;;;;;;;;;;;;;AAyoFA;AA+lIA;AA4oJA;AAqvHA;AAknGA;AA4iEA;AA43DA;AAgnDA;AA6eA;;;;;;AAsvGA;AA+1HA;AA0+DA;;;;;AAwiBA;AAgsFA;AA6kDA;AAq3CA;AA4wFA;AAk3CA;AA2iFA;;;;;;;;;AAwqEA;AA2zIA;AAu7FA;AAmrFA;AAi7EA;;;;;;AAiRA;AA+qHA;AAs7GA","sourceRoot":""}
|
||||
21
dist/swagger-ui-standalone-preset.js
vendored
21
dist/swagger-ui-standalone-preset.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui-standalone-preset.js.map
vendored
2
dist/swagger-ui-standalone-preset.js.map
vendored
@@ -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;AA+uFA;AAy+CA;AAo+CA;AAirCA;AAuyEA","sourceRoot":""}
|
||||
18
dist/swagger-ui.js
vendored
18
dist/swagger-ui.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui.js.map
vendored
2
dist/swagger-ui.js.map
vendored
@@ -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;AA8qIA;AAi+FA;AAyvDA;AAmzCA;AA+xCA","sourceRoot":""}
|
||||
@@ -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",
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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",
|
||||
@@ -75,7 +74,7 @@
|
||||
"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"
|
||||
|
||||
@@ -117,6 +117,7 @@ module.exports = function SwaggerUI(opts) {
|
||||
return downloadSpec()
|
||||
}
|
||||
|
||||
return system
|
||||
}
|
||||
|
||||
// Add presets
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { fromJS } from "immutable"
|
||||
import { fromJSOrdered, validateParam } from "core/utils"
|
||||
import win from "../../window"
|
||||
import findIndex from "lodash/findIndex"
|
||||
|
||||
import {
|
||||
UPDATE_SPEC,
|
||||
@@ -41,7 +42,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 = findIndex(parameters, p => p.get( "name" ) === paramName )
|
||||
if (!(value instanceof win.File)) {
|
||||
value = fromJSOrdered( value )
|
||||
}
|
||||
|
||||
@@ -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
src/polyfills.js
Normal file
2
src/polyfills.js
Normal file
@@ -0,0 +1,2 @@
|
||||
// Promise global, Used ( at least ) by 'whatwg-fetch'. And required by IE 11
|
||||
require("core-js/fn/promise")
|
||||
@@ -13,7 +13,7 @@ module.exports = require('./make-webpack-config.js')({
|
||||
|
||||
entry: {
|
||||
'swagger-ui-bundle': [
|
||||
'babel-polyfill',
|
||||
'./src/polyfills',
|
||||
'./src/core/index.js'
|
||||
]
|
||||
},
|
||||
|
||||
@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({
|
||||
|
||||
entry: {
|
||||
'swagger-ui-standalone-preset': [
|
||||
'./src/polyfills',
|
||||
'./src/standalone/index.js'
|
||||
]
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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',
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user