chore(open-api-explorer): fix engine defintion and swagger-ui imports

This commit is contained in:
Matthew Irish
2024-01-03 14:28:31 -06:00
parent 40c7f54469
commit 0453d199e5
5 changed files with 5 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ export default class App extends Application {
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
engines = {
openApiExplorer: {
'open-api-explorer': {
dependencies: {
services: ['auth', 'flash-messages', 'namespace', 'router', 'version'],
},

View File

@@ -114,6 +114,9 @@ module.exports = function (defaults) {
{
package: 'axe-core',
},
{
package: 'swagger-ui-dist',
},
],
packagerOptions: {
webpackConfig: {

View File

@@ -10,6 +10,7 @@ import { tracked } from '@glimmer/tracking';
import parseURL from 'core/utils/parse-url';
import config from 'open-api-explorer/config/environment';
import { guidFor } from '@ember/object/internals';
import SwaggerUIBundle from 'swagger-ui-dist/swagger-ui-bundle.js';
const { APP } = config;
@@ -84,8 +85,6 @@ export default class SwaggerUiComponent extends Component {
// using an action to bind the correct "this" context
@action async swaggerInit() {
const { default: SwaggerUIBundle } = await import('swagger-ui-dist/swagger-ui-bundle.js');
// trim any slashes on the filter value
const configSettings = this.CONFIG(SwaggerUIBundle, this);
SwaggerUIBundle(configSettings);
}

View File

@@ -13,9 +13,6 @@ const EngineAddon = require('ember-engines/lib/engine-addon');
module.exports = EngineAddon.extend({
name: 'open-api-explorer',
babel: {
plugins: [require.resolve('ember-auto-import/babel-plugin')],
},
included() {
this._super.included && this._super.included.apply(this, arguments);
// we want to lazy load the CSS deps, importing them here will result in them being added to the