@hexafy/core 1.0.0-rc.0 → 1.0.0-rc.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/README.md +63 -304
- package/package.json +3 -2
- package/dist/application.d.mts +0 -170
- package/dist/application.d.mts.map +0 -1
- package/dist/application.mjs +0 -146
- package/dist/application.mjs.map +0 -1
- package/dist/domain.d.mts +0 -500
- package/dist/domain.d.mts.map +0 -1
- package/dist/domain.mjs +0 -350
- package/dist/domain.mjs.map +0 -1
- package/dist/infrastructure.d.mts +0 -38
- package/dist/infrastructure.d.mts.map +0 -1
- package/dist/infrastructure.mjs +0 -98
- package/dist/infrastructure.mjs.map +0 -1
- package/dist/metrics.port-CfI8yKMA.d.mts +0 -114
- package/dist/metrics.port-CfI8yKMA.d.mts.map +0 -1
- package/dist/noop.metrics.adapter-MgMrk-sq.mjs +0 -53
- package/dist/noop.metrics.adapter-MgMrk-sq.mjs.map +0 -1
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// src/infrastructure/adapters/clock/system.clock.adapter.ts
|
|
2
|
-
const SystemClockAdapter = { now: () => Date.now() };
|
|
3
|
-
// src/infrastructure/adapters/identifier/system.identifier.adapter.ts
|
|
4
|
-
const SystemIdentifierAdapter = { generate: (clock) => {
|
|
5
|
-
return typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${clock.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
6
|
-
} };
|
|
7
|
-
// src/infrastructure/adapters/logging/console.logging.adapter.ts
|
|
8
|
-
/**
|
|
9
|
-
* Console-based logging adapter for development and debugging.
|
|
10
|
-
*
|
|
11
|
-
* Outputs structured log messages to the console with appropriate colors based
|
|
12
|
-
* on log level (info, debug, warn, error).
|
|
13
|
-
*
|
|
14
|
-
* @see {@link LoggingPort}
|
|
15
|
-
*/
|
|
16
|
-
const ConsoleLoggingAdapter = {
|
|
17
|
-
info(message, data) {
|
|
18
|
-
if (data === void 0 || data === null) console.log(message);
|
|
19
|
-
else console.log(message, data);
|
|
20
|
-
},
|
|
21
|
-
warn(message, data) {
|
|
22
|
-
if (data === void 0 || data === null) console.warn(message);
|
|
23
|
-
else console.warn(message, data);
|
|
24
|
-
},
|
|
25
|
-
error(message, data) {
|
|
26
|
-
if (data === void 0 || data === null) console.error(message);
|
|
27
|
-
else console.error(message, data);
|
|
28
|
-
},
|
|
29
|
-
debug(message, data) {
|
|
30
|
-
if (data === void 0 || data === null) console.debug(message);
|
|
31
|
-
else console.debug(message, data);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
// src/infrastructure/adapters/metrics/noop.metrics.adapter.ts
|
|
35
|
-
/**
|
|
36
|
-
* No-op metrics adapter implementing MetricsPort.
|
|
37
|
-
*
|
|
38
|
-
* Discards all metric data. Useful for:
|
|
39
|
-
*
|
|
40
|
-
* - Production environments with external metrics collection
|
|
41
|
-
* - Testing where metrics should not be recorded
|
|
42
|
-
* - Development without metrics instrumentation
|
|
43
|
-
*
|
|
44
|
-
* @see {@link MetricsPort}
|
|
45
|
-
*/
|
|
46
|
-
const NoOpMetricsAdapter = {
|
|
47
|
-
increment: () => {},
|
|
48
|
-
histogram: () => {},
|
|
49
|
-
gauge: () => {}
|
|
50
|
-
};
|
|
51
|
-
export { SystemClockAdapter as i, ConsoleLoggingAdapter as n, SystemIdentifierAdapter as r, NoOpMetricsAdapter as t };
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=noop.metrics.adapter-MgMrk-sq.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noop.metrics.adapter-MgMrk-sq.mjs","names":[],"sources":["../src/infrastructure/adapters/clock/system.clock.adapter.ts","../src/infrastructure/adapters/identifier/system.identifier.adapter.ts","../src/infrastructure/adapters/logging/console.logging.adapter.ts","../src/infrastructure/adapters/metrics/noop.metrics.adapter.ts"],"sourcesContent":["import type { ClockPort } from '../../../domain/ports';\n\nexport const SystemClockAdapter: ClockPort = {\n now: () => Date.now()\n};\n","import type { ClockPort, IdentifierPort } from '../../../domain/ports';\n\nexport const SystemIdentifierAdapter: IdentifierPort = {\n generate: (clock: ClockPort) => {\n return typeof crypto !== 'undefined' &&\n typeof crypto.randomUUID === 'function'\n ? crypto.randomUUID()\n : `${clock.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n }\n};\n","import type { LoggingPort } from '../../../domain/ports';\n\n/**\n * Console-based logging adapter for development and debugging.\n *\n * Outputs structured log messages to the console with appropriate colors based\n * on log level (info, debug, warn, error).\n *\n * @see {@link LoggingPort}\n */\nexport const ConsoleLoggingAdapter: LoggingPort = {\n info(message: string, data?: unknown): void {\n if (data === undefined || data === null) {\n console.log(message);\n } else {\n console.log(message, data);\n }\n },\n\n warn(message: string, data?: unknown): void {\n if (data === undefined || data === null) {\n console.warn(message);\n } else {\n console.warn(message, data);\n }\n },\n\n error(message: string, data?: unknown): void {\n if (data === undefined || data === null) {\n console.error(message);\n } else {\n console.error(message, data);\n }\n },\n\n debug(message: string, data?: unknown): void {\n if (data === undefined || data === null) {\n console.debug(message);\n } else {\n console.debug(message, data);\n }\n }\n};\n","import type { MetricsPort } from '../../../domain/ports';\n\n/**\n * No-op metrics adapter implementing MetricsPort.\n *\n * Discards all metric data. Useful for:\n *\n * - Production environments with external metrics collection\n * - Testing where metrics should not be recorded\n * - Development without metrics instrumentation\n *\n * @see {@link MetricsPort}\n */\nexport const NoOpMetricsAdapter: MetricsPort = {\n increment: () => {},\n histogram: () => {},\n gauge: () => {}\n};\n"],"mappings":";AAEA,MAAa,qBAAgC,EAC3C,WAAW,KAAK,IAAI,EACtB;;ACFA,MAAa,0BAA0C,EACrD,WAAW,UAAqB;CAC9B,OAAO,OAAO,WAAW,eACvB,OAAO,OAAO,eAAe,aAC3B,OAAO,WAAW,IAClB,GAAG,MAAM,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;AAC3E,EACF;;;;;;;;;;ACCA,MAAa,wBAAqC;CAChD,KAAK,SAAiB,MAAsB;EAC1C,IAAI,SAAS,KAAA,KAAa,SAAS,MACjC,QAAQ,IAAI,OAAO;OAEnB,QAAQ,IAAI,SAAS,IAAI;CAE7B;CAEA,KAAK,SAAiB,MAAsB;EAC1C,IAAI,SAAS,KAAA,KAAa,SAAS,MACjC,QAAQ,KAAK,OAAO;OAEpB,QAAQ,KAAK,SAAS,IAAI;CAE9B;CAEA,MAAM,SAAiB,MAAsB;EAC3C,IAAI,SAAS,KAAA,KAAa,SAAS,MACjC,QAAQ,MAAM,OAAO;OAErB,QAAQ,MAAM,SAAS,IAAI;CAE/B;CAEA,MAAM,SAAiB,MAAsB;EAC3C,IAAI,SAAS,KAAA,KAAa,SAAS,MACjC,QAAQ,MAAM,OAAO;OAErB,QAAQ,MAAM,SAAS,IAAI;CAE/B;AACF;;;;;;;;;;;;;AC7BA,MAAa,qBAAkC;CAC7C,iBAAiB,CAAC;CAClB,iBAAiB,CAAC;CAClB,aAAa,CAAC;AAChB"}
|