SOBI-5087: Adding latest swagger-ui-dist

This commit is contained in:
Mario 2022-08-03 09:02:27 +02:00
parent 7bcdfa7350
commit f0148f2df3
No known key found for this signature in database
GPG Key ID: 599DE5BA56E66F82
4 changed files with 3706 additions and 26 deletions

View File

@ -17,7 +17,7 @@ const path = require('path');
const urlJoin = require('./lib/url-join');
const _defaults = require('lodash').defaults;
const createSwaggerObject = require('loopback-swagger').generateSwaggerSpec;
const SWAGGER_UI_ROOT = require('swagger-ui/index').dist;
const SWAGGER_UI_ROOT = require('swagger-ui-dist').absolutePath();
const STATIC_ROOT = path.join(__dirname, 'public');
module.exports = explorer;

3699
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,11 @@
},
"main": "index.js",
"scripts": {
"preinstall": "npx force-resolutions",
"lint": "eslint .",
"test": "mocha",
"posttest": "npm run lint"
},
"repository": {
"type": "git",
"url": "git://github.com/strongloop/loopback-component-explorer.git"
},
"keywords": [
"loopback",
"api",
@ -22,9 +19,6 @@
],
"author": "IBM Corp.",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/strongloop/loopback-component-explorer/issues"
},
"devDependencies": {
"chai": "^3.2.0",
"eslint": "^5.13.0",
@ -39,6 +33,10 @@
"lodash": "^4.17.11",
"loopback-swagger": "^5.0.0",
"strong-globalize": "^4.1.1",
"swagger-ui": "^2.2.5"
"swagger-ui-dist": "^4.13.2"
},
"resolutions": {
"minimist": "1.2.6",
"ejs": "3.1.8"
}
}

View File

@ -5,29 +5,12 @@
'use strict';
// NOTE(bajtos) It's important to run this check before we load the Explorer
// because require() may fail (e.g. with MODULE_NOT_FOUND error) and make
// it difficult to identify the actual problem
const uiVersion = require('../package.json').dependencies['swagger-ui'];
if (!uiVersion.startsWith('^2')) {
console.error(`
Upgrading from swagger-ui@2 to a newer major version (${uiVersion}) is difficult,
see https://github.com/strongloop/loopback-component-explorer/issues/254
If you are confident about this change and have manually verified API Explorer
functionality in the browser, including access-token based authentication,
then you can delete this check.
`);
process.exit(2);
}
const loopback = require('loopback');
const explorer = require('../');
const request = require('supertest');
const assert = require('assert');
const path = require('path');
const expect = require('chai').expect;
const urlJoin = require('../lib/url-join');
const os = require('os');
describe('explorer', function() {
describe('with default config', function() {