@extk/expressive 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -207,7 +207,9 @@ function buildExpressive(container, swaggerDoc) {
207
207
  container.logger.info(message.trim());
208
208
  } } }
209
209
  ));
210
- app.use(configs.swagger.path, import_swagger_ui_express.default.serve, import_swagger_ui_express.default.setup(configs.swagger.doc));
210
+ app.use(configs.swagger.path, import_swagger_ui_express.default.serve, import_swagger_ui_express.default.setup(configs.swagger.doc, {
211
+ customSiteTitle: configs.swagger.doc.info?.title
212
+ }));
211
213
  return app;
212
214
  },
213
215
  expressiveRouter(configs) {
@@ -243,9 +245,10 @@ function buildExpressive(container, swaggerDoc) {
243
245
  } else {
244
246
  pathItem.parameters.push(...tryParsePathParameters(route));
245
247
  }
246
- swaggerDoc.paths[route] = {
247
- [context.method]: pathItem
248
- };
248
+ if (!swaggerDoc.paths[route]) {
249
+ swaggerDoc.paths[route] = {};
250
+ }
251
+ swaggerDoc.paths[route][context.method] = pathItem;
249
252
  return router;
250
253
  }
251
254
  };
package/dist/index.mjs CHANGED
@@ -142,7 +142,9 @@ function buildExpressive(container, swaggerDoc) {
142
142
  container.logger.info(message.trim());
143
143
  } } }
144
144
  ));
145
- app.use(configs.swagger.path, swaggerUi.serve, swaggerUi.setup(configs.swagger.doc));
145
+ app.use(configs.swagger.path, swaggerUi.serve, swaggerUi.setup(configs.swagger.doc, {
146
+ customSiteTitle: configs.swagger.doc.info?.title
147
+ }));
146
148
  return app;
147
149
  },
148
150
  expressiveRouter(configs) {
@@ -178,9 +180,10 @@ function buildExpressive(container, swaggerDoc) {
178
180
  } else {
179
181
  pathItem.parameters.push(...tryParsePathParameters(route));
180
182
  }
181
- swaggerDoc.paths[route] = {
182
- [context.method]: pathItem
183
- };
183
+ if (!swaggerDoc.paths[route]) {
184
+ swaggerDoc.paths[route] = {};
185
+ }
186
+ swaggerDoc.paths[route][context.method] = pathItem;
184
187
  return router;
185
188
  }
186
189
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extk/expressive",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,11 +20,13 @@
20
20
  },
21
21
  "scripts": {
22
22
  "build": "tsup",
23
+ "prepublishOnly": "npm run build",
23
24
  "test": "node --import=tsx --test 'test/**/*.test.ts'",
24
25
  "lint": "eslint ./"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@extk/eslint-config": "^0.2.0",
29
+ "@extk/tsconfig": "0.1.1",
28
30
  "@types/chance": "^1.1.7",
29
31
  "@types/express": "^5.0.1",
30
32
  "@types/morgan": "^1.9.9",