conduithub 0.0.1 → 0.0.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.
@@ -1,53 +1,2 @@
1
- const levels = ["info", "success", "warn", "error", "debug"];
2
- function shouldPublishLog(currentLogLevel, logLevel) {
3
- return levels.indexOf(logLevel) <= levels.indexOf(currentLogLevel);
4
- }
5
- const colors = {
6
- reset: "\x1B[0m",
7
- bright: "\x1B[1m",
8
- dim: "\x1B[2m",
9
- fg: {
10
- red: "\x1B[31m",
11
- green: "\x1B[32m",
12
- yellow: "\x1B[33m",
13
- blue: "\x1B[34m",
14
- magenta: "\x1B[35m"}};
15
- const levelColors = {
16
- info: colors.fg.blue,
17
- success: colors.fg.green,
18
- warn: colors.fg.yellow,
19
- error: colors.fg.red,
20
- debug: colors.fg.magenta
21
- };
22
- const formatMessage = (level, message, name) => {
23
- const timestamp = (/* @__PURE__ */ new Date()).toISOString();
24
- return `${colors.dim}${timestamp}${colors.reset} ${levelColors[level]}${level.toUpperCase()}${colors.reset} ${colors.bright}[${name ?? "ConduiHub"}]:${colors.reset} ${message}`;
25
- };
26
- const createLogger = (options) => {
27
- const enabled = options?.disabled !== true;
28
- const logLevel = options?.level ?? "error";
29
- const name = options?.name ?? "ConduiHub";
30
- const LogFunc = (level, message, args = []) => {
31
- if (!enabled || !shouldPublishLog(logLevel, level)) {
32
- return;
33
- }
34
- const formattedMessage = formatMessage(level, message, name);
35
- if (!options || typeof options.log !== "function") {
36
- if (level === "error") {
37
- console.error(formattedMessage, ...args);
38
- } else if (level === "warn") {
39
- console.warn(formattedMessage, ...args);
40
- } else {
41
- console.log(formattedMessage, ...args);
42
- }
43
- return;
44
- }
45
- options.log(level === "success" ? "info" : level, message, ...args);
46
- };
47
- return Object.fromEntries(
48
- levels.map((level) => [level, (...[message, ...args]) => LogFunc(level, message, args)])
49
- );
50
- };
51
- const logger = createLogger();
52
-
53
- export { createLogger, levels, logger, shouldPublishLog };
1
+ export { c as createLogger, g as generateUuid, l as levels, a as logger, s as shouldPublishLog } from '../shared/conduithub.74V0wiLi.mjs';
2
+ import 'uuid';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduithub",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,6 +42,36 @@
42
42
  "types": "./dist/utils/index.d.cts",
43
43
  "default": "./dist/utils/index.cjs"
44
44
  }
45
+ },
46
+ "./core": {
47
+ "import": {
48
+ "types": "./dist/core/index.d.ts",
49
+ "default": "./dist/core/index.mjs"
50
+ },
51
+ "require": {
52
+ "types": "./dist/core/index.d.cts",
53
+ "default": "./dist/core/index.cjs"
54
+ }
55
+ },
56
+ "./event-bus": {
57
+ "import": {
58
+ "types": "./dist/core/event-bus/index.d.ts",
59
+ "default": "./dist/core/event-bus/index.mjs"
60
+ },
61
+ "require": {
62
+ "types": "./dist/core/event-bus/index.d.cts",
63
+ "default": "./dist/core/event-bus/index.cjs"
64
+ }
65
+ },
66
+ "./hook": {
67
+ "import": {
68
+ "types": "./dist/core/hook/index.d.ts",
69
+ "default": "./dist/core/hook/index.mjs"
70
+ },
71
+ "require": {
72
+ "types": "./dist/core/hook/index.d.cts",
73
+ "default": "./dist/core/hook/index.cjs"
74
+ }
45
75
  }
46
76
  },
47
77
  "typeVersion": {
@@ -58,16 +88,25 @@
58
88
  "dist"
59
89
  ],
60
90
  "devDependencies": {
91
+ "@types/uuid": "^10.0.0",
92
+ "@vitest/coverage-v8": "3.2.4",
61
93
  "concurrently": "^9.2.0",
94
+ "fs": "0.0.1-security",
95
+ "path": "^0.12.7",
62
96
  "unbuild": "^3.6.0",
63
97
  "vitest": "^3.2.4"
64
98
  },
99
+ "dependencies": {
100
+ "uuid": "^11.1.0",
101
+ "zod": "^4.0.14"
102
+ },
65
103
  "scripts": {
66
104
  "build": "unbuild --clean",
67
105
  "dev": "concurrently \"unbuild --watch\" \"npm run dev:types\"",
68
106
  "dev:types": "tsc --project tsconfig.declarations.json --watch",
69
107
  "build:types": "tsc --project tsconfig.declarations.json",
70
108
  "stub": "unbuild --stub",
71
- "test": "vitest"
109
+ "test": "vitest run --reporter verbose",
110
+ "typecheck": "tsc --noEmit"
72
111
  }
73
112
  }