Merge pull request #3004 from shockey/ft/3003-version-info

Add global variable that exposes UI version
This commit is contained in:
shockey
2017-04-28 10:46:27 -07:00
committed by GitHub
10 changed files with 65 additions and 49 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0dA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AA2pJA;AAk7FA;AA89FA;AAslFA;AAkjFA;AA48CA;AA+jDA;AAwrCA;AAm/EA;;;;;AAi1BA;AAy5JA;;;;;;;;;;;;;;AAgsDA;AA4mIA;AAytJA;AA0pHA;AAwnGA;AAoiEA;AAk4DA;AA80DA;AAgpBA;;;;;;AAwhFA;AAs1FA;;;;;AAy3CA;AA2qFA;AAw2CA;AAykCA;AAu/CA;AAklFA;AA61FA;;;;;;;;;AAu5CA;AA2zIA;AAk4DA;AAolDA","sourceRoot":""}
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA++FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAoeA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AA2pJA;AA86FA;AA89FA;AAslFA;AAkjFA;AA48CA;AA+jDA;AAwrCA;AAm/EA;;;;;AAi1BA;AA02JA;;;;;;;;;;;;;;AAuyEA;AA4mIA;AAquJA;AAwsHA;AA2mGA;AAiiEA;AAq4DA;AA+2DA;AA4lBA;;;;;;AA0kFA;AAs1FA;;;;;AAy3CA;AA2qFA;AAw2CA;AAwkCA;AAs/CA;AA4kFA;AAy1FA;;;;;;;;;AAm5CA;AA2zIA;AAk4DA;AAolDA","sourceRoot":""}

File diff suppressed because one or more lines are too long

2
dist/swagger-ui.css vendored

File diff suppressed because one or more lines are too long

8
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAkxCA;AAoyHA;AA4xHA;AAy4FA;AA2sCA;AAmgCA;AA0iCA;AA+3BA","sourceRoot":""}
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAsxCA;AAoyHA;AAuxHA;AAy4FA;AA2sCA;AAmgCA;AA0iCA;AA+3BA","sourceRoot":""}

View File

@@ -4,9 +4,13 @@ var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var deepExtend = require('deep-extend')
var autoprefixer = require('autoprefixer')
const {gitDescribeSync} = require('git-describe');
var loadersByExtension = require('./build-tools/loadersByExtension')
var pkg = require('./package.json')
const gitInfo = gitDescribeSync(__dirname)
module.exports = function(options) {
// Special options, that have logic in this file
@@ -59,8 +63,14 @@ module.exports = function(options) {
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: specialOptions.minimize ? JSON.stringify('production') : null,
WEBPACK_INLINE_STYLES: !Boolean(specialOptions.separateStylesheets)
WEBPACK_INLINE_STYLES: !Boolean(specialOptions.separateStylesheets)
},
'buildInfo': JSON.stringify({
PACKAGE_VERSION: (pkg.version),
GIT_COMMIT: gitInfo.hash,
GIT_DIRTY: gitInfo.dirty
})
}))
var cssLoader = 'css-loader!postcss-loader'

View File

@@ -95,6 +95,7 @@
"eslint-plugin-react": "^6.10.3",
"extract-text-webpack-plugin": "0.8.2",
"file-loader": "0.8.4",
"git-describe": "^4.0.1",
"html-webpack-plugin": "^2.28.0",
"imports-loader": "0.6.5",
"json-loader": "0.5.3",

View File

@@ -6,6 +6,12 @@ import * as AllPlugins from "core/plugins/all"
import { filterConfigs } from "plugins/configs"
import { parseSeach } from "core/utils"
// eslint-disable-next-line no-undef
const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION } = buildInfo
window.versions = window.versions || {}
window.versions.swaggerUi = `${PACKAGE_VERSION}/${GIT_COMMIT || "unknown"}${GIT_DIRTY ? "-dirty" : ""}`
module.exports = function SwaggerUI(opts) {
const defaults = {

View File

@@ -26,7 +26,6 @@ module.exports = require('./make-webpack-config.js')({
// 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) {
console.log(request)
cb(null, 'commonjs ' + request)
return;
}