@aeriajs/server 0.0.266 → 0.0.268

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/warmup.js CHANGED
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.warmup = void 0;
4
- const common_1 = require("@aeriajs/common");
4
+ const types_1 = require("@aeriajs/types");
5
5
  const core_1 = require("@aeriajs/core");
6
6
  const entrypoint_1 = require("@aeriajs/entrypoint");
7
+ const node_util_1 = require("node:util");
7
8
  const colorizedRoute = async (method, endpointUri, endpoint) => {
8
9
  const config = await (0, entrypoint_1.getConfig)();
9
- const color = method in common_1.METHOD_COLORS
10
- ? common_1.METHOD_COLORS[method]
11
- : common_1.AnsiColor.White;
12
- let rolesLine = '', hasContractLine = (0, common_1.escape)(common_1.AnsiColor.Yellow, 'x');
10
+ const color = method in types_1.METHOD_COLORS
11
+ ? types_1.METHOD_COLORS[method]
12
+ : 'white';
13
+ let rolesLine = '', hasContractLine = (0, node_util_1.styleText)(['yellow'], 'x');
13
14
  if (endpoint) {
14
15
  if ('roles' in endpoint) {
15
16
  const roles = await (async () => {
@@ -24,21 +25,21 @@ const colorizedRoute = async (method, endpointUri, endpoint) => {
24
25
  }
25
26
  return endpoint.roles;
26
27
  })();
27
- rolesLine = ` ${(0, common_1.escape)('[90m', `[${roles.join('|')}]`)}`;
28
+ rolesLine = ` ${(0, node_util_1.styleText)(['grey'], `[${roles.join('|')}]`)}`;
28
29
  }
29
30
  if ('response' in endpoint || endpoint.builtin) {
30
- hasContractLine = (0, common_1.escape)(common_1.AnsiColor.Green, '✓');
31
+ hasContractLine = (0, node_util_1.styleText)(['green'], '✓');
31
32
  }
32
33
  }
33
- let line = (0, common_1.escape)([
34
- '[1m',
34
+ let line = (0, node_util_1.styleText)([
35
+ 'bold',
35
36
  color,
36
37
  ], method) + '\t';
37
38
  line += hasContractLine;
38
- line += (0, common_1.escape)('[90m', ` ${config.baseUrl === '/'
39
+ line += (0, node_util_1.styleText)(['grey'], ` ${config.baseUrl === '/'
39
40
  ? ''
40
41
  : config.baseUrl}`);
41
- line += (0, common_1.escape)('[1m', endpointUri);
42
+ line += (0, node_util_1.styleText)(['bold'], endpointUri);
42
43
  line += rolesLine;
43
44
  return line;
44
45
  };
package/dist/warmup.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
- import { escape, AnsiColor, METHOD_COLORS } from "@aeriajs/common";
2
+ import { METHOD_COLORS } from "@aeriajs/types";
3
3
  import { getEndpoints } from "@aeriajs/core";
4
4
  import { getConfig, getAvailableRoles } from "@aeriajs/entrypoint";
5
+ import { styleText } from "node:util";
5
6
  const colorizedRoute = async (method, endpointUri, endpoint) => {
6
7
  const config = await getConfig();
7
- const color = method in METHOD_COLORS ? METHOD_COLORS[method] : AnsiColor.White;
8
- let rolesLine = "", hasContractLine = escape(AnsiColor.Yellow, "x");
8
+ const color = method in METHOD_COLORS ? METHOD_COLORS[method] : "white";
9
+ let rolesLine = "", hasContractLine = styleText(["yellow"], "x");
9
10
  if (endpoint) {
10
11
  if ("roles" in endpoint) {
11
12
  const roles = await (async () => {
@@ -23,19 +24,19 @@ const colorizedRoute = async (method, endpointUri, endpoint) => {
23
24
  }
24
25
  return endpoint.roles;
25
26
  })();
26
- rolesLine = ` ${escape("[90m", `[${roles.join("|")}]`)}`;
27
+ rolesLine = ` ${styleText(["grey"], `[${roles.join("|")}]`)}`;
27
28
  }
28
29
  if ("response" in endpoint || endpoint.builtin) {
29
- hasContractLine = escape(AnsiColor.Green, "\u2713");
30
+ hasContractLine = styleText(["green"], "\u2713");
30
31
  }
31
32
  }
32
- let line = escape([
33
- "[1m",
33
+ let line = styleText([
34
+ "bold",
34
35
  color
35
36
  ], method) + " ";
36
37
  line += hasContractLine;
37
- line += escape("[90m", ` ${config.baseUrl === "/" ? "" : config.baseUrl}`);
38
- line += escape("[1m", endpointUri);
38
+ line += styleText(["grey"], ` ${config.baseUrl === "/" ? "" : config.baseUrl}`);
39
+ line += styleText(["bold"], endpointUri);
39
40
  line += rolesLine;
40
41
  return line;
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/server",
3
- "version": "0.0.266",
3
+ "version": "0.0.268",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,14 +33,14 @@
33
33
  "mongodb": "^6.16.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@aeriajs/core": "^0.0.264",
37
- "@aeriajs/builtins": "^0.0.264",
38
- "@aeriajs/common": "^0.0.149",
39
- "@aeriajs/entrypoint": "^0.0.154",
40
- "@aeriajs/http": "^0.0.180",
41
- "@aeriajs/node-http": "^0.0.180",
42
- "@aeriajs/server": "^0.0.266",
43
- "@aeriajs/types": "^0.0.127",
36
+ "@aeriajs/core": "^0.0.266",
37
+ "@aeriajs/builtins": "^0.0.266",
38
+ "@aeriajs/common": "^0.0.151",
39
+ "@aeriajs/entrypoint": "^0.0.156",
40
+ "@aeriajs/http": "^0.0.182",
41
+ "@aeriajs/node-http": "^0.0.182",
42
+ "@aeriajs/server": "^0.0.268",
43
+ "@aeriajs/types": "^0.0.129",
44
44
  "mongodb": "^6.16.0"
45
45
  },
46
46
  "scripts": {