diff --git a/generators/app/templates/infrastructure/src/servers/apollo.js b/generators/app/templates/infrastructure/src/servers/apollo.js index b4b8948..3d2df29 100644 --- a/generators/app/templates/infrastructure/src/servers/apollo.js +++ b/generators/app/templates/infrastructure/src/servers/apollo.js @@ -61,15 +61,15 @@ const startApolloServer = async (httpServer<% if(addSubscriptions) {%>, subscrip const app = new Koa(); app.use(loggingMiddleware) .use(errorHandlingMiddleware()) - .use(bodyParser()); - .use(correlationMiddleware()); - .use(cors({ credentials: true })); + .use(bodyParser()) + .use(correlationMiddleware()) + .use(cors({ credentials: true })) .use(ignore(jwtTokenValidation, jwtTokenUserIdentification<% if(withMultiTenancy) {%>, tenantIdentification()<%}%>).if(ctx => publicRoute(ctx))) <%_ if(addTracing){ _%> - tracingEnabled && app.use(tracingMiddleware()); + tracingEnabled && app.use(tracingMiddleware()) <%_}_%> <%_ if(dataLayer == "knex") {_%> - .use(contextDbInstance()); + .use(contextDbInstance()) <%_}_%> .use( koaMiddleware(apolloServer,{ diff --git a/generators/generator-transforms.js b/generators/generator-transforms.js index 5b76a56..ce3a929 100644 --- a/generators/generator-transforms.js +++ b/generators/generator-transforms.js @@ -1,5 +1,5 @@ const through = require('through2') -const prettier = require('prettier') +const { resolveConfig, format } = require('prettier') const defaultPrettierOptions = { printWidth: 125, @@ -13,7 +13,7 @@ const defaultPrettierOptions = { const prettierTransform = function (defaultOptions) { const transform = (file, encoding, callback) => { /* Resolve from the projects config */ - prettier.resolveConfig(file.relative).then(options => { + resolveConfig(file.relative).then(options => { const str = file.contents.toString('utf8') if (!options || Object.keys(options).length === 0) { options = defaultOptions @@ -21,7 +21,7 @@ const prettierTransform = function (defaultOptions) { // For better errors options.filepath = file.relative - const data = prettier.format(str, options) + const data = format(str, options) file.contents = Buffer.from(data) callback(null, file) })