@autofleet/super-express 2.2.0 → 2.2.1-beta-6c740761.2

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/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@autofleet/super-express",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-beta-6c740761.2",
4
4
  "description": "AF Express with built in boilerplate",
5
- "main": "src/index.js",
5
+ "main": "src/index.mjs",
6
+ "module": "src/index.mjs",
7
+ "types": "src/index.d.ts",
6
8
  "type": "module",
7
9
  "author": "Autofleet",
8
10
  "license": "MIT",
@@ -14,6 +16,7 @@
14
16
  },
15
17
  "scripts": {
16
18
  "test": "node --test test/index.test.js",
19
+ "build": "",
17
20
  "publish": "npm publish"
18
21
  },
19
22
  "repository": {
@@ -27,5 +30,17 @@
27
30
  "devDependencies": {
28
31
  "@types/express": "^4.17.21",
29
32
  "supertest": "^7.0.0"
33
+ },
34
+ "exports": {
35
+ ".": {
36
+ "import": {
37
+ "default": "./src/index.mjs",
38
+ "types": "./src/index.d.ts"
39
+ },
40
+ "require": {
41
+ "default": "./src/index.cjs",
42
+ "types": "./src/index.d.cts"
43
+ }
44
+ }
30
45
  }
31
46
  }
@@ -1,11 +1,10 @@
1
- import express from 'express';
2
- import morgan from 'morgan';
3
- import { aliveEndpoint } from '@autofleet/nitur';
4
- import zehut, { enableTracing } from '@autofleet/zehut';
1
+ const express = require('express');
2
+ const morgan = require('morgan');
3
+ const { aliveEndpoint } = require('@autofleet/nitur');
4
+ const { default: zehut, enableTracing } = require('@autofleet/zehut');
5
+ const defaultOptions = require('../config/default-options.json');
5
6
 
6
- import defaultOptions from '../config/default-options.json' assert { type: "json" };
7
-
8
- export default function (options = {}) {
7
+ module.exports = function superExpress(options = {}) {
9
8
  const app = express(options);
10
9
  const mergedOptions = Object.assign({}, defaultOptions, options);
11
10
  /** Formatting */
@@ -0,0 +1,10 @@
1
+ import type createSuperExpressApp from './index.d.ts';
2
+ import type { DefaultOptions as Options, SuperExpressApp as _SuperExpressApp } from './index.d.ts';
3
+
4
+ declare namespace createSuperExpressApp {
5
+ export type DefaultOptions = Options;
6
+ export type SuperExpressApp = _SuperExpressApp;
7
+
8
+ }
9
+
10
+ export = createSuperExpressApp;
package/src/index.d.ts CHANGED
@@ -53,7 +53,7 @@ type Server = Listen extends (port: any, cb: any) => infer R ? R : never;
53
53
  /**
54
54
  * Extends the express.Application interface to include nativeListen and the overridden listen method.
55
55
  */
56
- export interface SuperExpressApp extends express.Application {
56
+ export interface SuperExpressApp extends Omit<express.Application, 'listen'> {
57
57
  /**
58
58
  * Original express listen method.
59
59
  */
@@ -73,5 +73,5 @@ export interface SuperExpressApp extends express.Application {
73
73
  * @returns A SuperExpress application instance.
74
74
  */
75
75
  export default function createSuperExpressApp(
76
- options?: Partial<DefaultOptions & express.ApplicationOptions>
76
+ options?: Partial<DefaultOptions>
77
77
  ): SuperExpressApp;
package/src/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import { createRequire } from 'node:module';
2
+
3
+ const require = createRequire(import.meta.url);
4
+ const superExpress = require('./index.cjs');
5
+
6
+
7
+ export default superExpress;