@extk/expressive 0.5.4 → 0.5.5

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/README.md CHANGED
@@ -60,9 +60,13 @@ const swaggerDoc = swaggerBuilder()
60
60
  .withServers([{ url: 'http://localhost:3000' }])
61
61
  .get();
62
62
 
63
- // 3. Build the Express app with sensible defaults (helmet, morgan, swagger UI)
63
+ // 3. Build the Express app
64
64
  const app = expressiveServer()
65
- .withDefaults({ path: '/api-docs', doc: swaggerDoc });
65
+ .withHelmet()
66
+ .withQs()
67
+ .withMorgan()
68
+ .withSwagger({ path: '/api-docs', doc: swaggerDoc })
69
+ .get();
66
70
 
67
71
  // 4. Define routes — they auto-register in the OpenAPI spec
68
72
  const { router, addRoute } = expressiveRouter({
@@ -203,7 +207,10 @@ export const loginSchema = z.object({
203
207
  import z from 'zod';
204
208
 
205
209
  const app = expressiveServer()
206
- .withDefaults({
210
+ .withHelmet()
211
+ .withQs()
212
+ .withMorgan()
213
+ .withSwagger({
207
214
  doc: swaggerBuilder()
208
215
  .withInfo({ title: 'My API' })
209
216
  .withServers([{ url: 'http://localhost:3000/api' }])
@@ -211,7 +218,8 @@ const app = expressiveServer()
211
218
  .withSecuritySchemes({ auth: SWG.securitySchemes.BearerAuth() })
212
219
  .withDefaultSecurity([SWG.security('auth')])
213
220
  .get(),
214
- });
221
+ })
222
+ .get();
215
223
  ```
216
224
 
217
225
  **3. Reference them in routes with `SWG.jsonSchemaRef`:**
package/dist/index.d.mts CHANGED
@@ -175,7 +175,6 @@ declare class ServerBuilder {
175
175
  withMorgan(format?: string, // TODO: FormatFn
176
176
  options?: Parameters<typeof morgan>[1]): this;
177
177
  withSwagger(swagger: SwaggerOptions, ...handlers: ExpressHandler[]): this;
178
- withDefaults(swagger: SwaggerOptions): express__default.Express;
179
178
  }
180
179
 
181
180
  declare class ApiError extends Error {
package/dist/index.d.ts CHANGED
@@ -175,7 +175,6 @@ declare class ServerBuilder {
175
175
  withMorgan(format?: string, // TODO: FormatFn
176
176
  options?: Parameters<typeof morgan>[1]): this;
177
177
  withSwagger(swagger: SwaggerOptions, ...handlers: ExpressHandler[]): this;
178
- withDefaults(swagger: SwaggerOptions): express__default.Express;
179
178
  }
180
179
 
181
180
  declare class ApiError extends Error {
package/dist/index.js CHANGED
@@ -228,9 +228,6 @@ var ServerBuilder = class {
228
228
  }));
229
229
  return this;
230
230
  }
231
- withDefaults(swagger) {
232
- return this.withHelmet().withQs().withMorgan().withSwagger(swagger).get();
233
- }
234
231
  };
235
232
  function buildExpressive(container, swaggerDoc) {
236
233
  return {
package/dist/index.mjs CHANGED
@@ -167,9 +167,6 @@ var ServerBuilder = class {
167
167
  }));
168
168
  return this;
169
169
  }
170
- withDefaults(swagger) {
171
- return this.withHelmet().withQs().withMorgan().withSwagger(swagger).get();
172
- }
173
170
  };
174
171
  function buildExpressive(container, swaggerDoc) {
175
172
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extk/expressive",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"