@bgord/bun 1.4.25 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/bun",
3
- "version": "1.4.25",
3
+ "version": "1.5.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -29,22 +29,22 @@
29
29
  "@types/yazl": "3.3.0",
30
30
  "cspell": "9.4.0",
31
31
  "knip": "5.73.4",
32
- "lefthook": "2.0.11",
32
+ "lefthook": "2.0.12",
33
33
  "only-allow": "1.2.2",
34
34
  "sharp": "0.34.5",
35
35
  "shellcheck": "4.1.0",
36
36
  "typescript": "5.9.3",
37
- "zod": "4.1.13"
37
+ "zod": "4.2.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "@axiomhq/winston": "1.3.1",
41
- "@bgord/tools": "1.2.0",
41
+ "@bgord/tools": "1.2.1",
42
42
  "@hono/ua-blocker": "0.1.21",
43
43
  "better-auth": "1.4.7",
44
44
  "croner": "9.1.0",
45
45
  "csv": "6.4.1",
46
46
  "hcaptcha": "0.2.0",
47
- "hono": "4.11.0",
47
+ "hono": "4.11.1",
48
48
  "isomorphic-dompurify": "2.34.0",
49
49
  "lodash": "4.17.21",
50
50
  "marked": "17.0.1",
@@ -54,7 +54,7 @@
54
54
  "yazl": "3.3.1"
55
55
  },
56
56
  "peerDependencies": {
57
- "zod": "4.1.13",
57
+ "zod": "4.2.0",
58
58
  "sharp": "0.34.5"
59
59
  },
60
60
  "peerDependenciesMeta": {
package/readme.md CHANGED
@@ -71,7 +71,8 @@ src/
71
71
  ├── encryption-key.vo.ts
72
72
  ├── encryption-noop.adapter.ts
73
73
  ├── encryption.port.ts
74
- ├── environment-validator.service.ts
74
+ ├── environment-loader-process-env.adapter.ts
75
+ ├── environment-loader.port.ts
75
76
  ├── etag-extractor.middleware.ts
76
77
  ├── event-bus-like.types.ts
77
78
  ├── event-envelope.ts
@@ -0,0 +1,22 @@
1
+ import type { z } from "zod/v4";
2
+ import { NodeEnvironment, type NodeEnvironmentEnum } from "../src/node-env.vo";
3
+ import type { EnvironmentLoaderPort } from "./environment-loader.port";
4
+
5
+ export class EnvironmentLoaderProcessEnvAdapter<Schema extends z.ZodObject<any>>
6
+ implements EnvironmentLoaderPort<Schema>
7
+ {
8
+ private readonly type: NodeEnvironmentEnum;
9
+ private readonly schema: Schema;
10
+
11
+ constructor(
12
+ config: { type: typeof process.env.NODE_ENV; schema: Schema },
13
+ private env: NodeJS.ProcessEnv,
14
+ ) {
15
+ this.schema = config.schema;
16
+ this.type = NodeEnvironment.parse(config.type);
17
+ }
18
+
19
+ async load() {
20
+ return Object.freeze({ ...this.schema.parse(this.env), type: this.type });
21
+ }
22
+ }
@@ -0,0 +1,8 @@
1
+ import type { z } from "zod/v4";
2
+ import type { NodeEnvironmentEnum } from "../src/node-env.vo";
3
+
4
+ export type EnvironmentResultType<Schema> = z.infer<Schema> & { type: NodeEnvironmentEnum };
5
+
6
+ export interface EnvironmentLoaderPort<Schema extends z.ZodObject<any>> {
7
+ load(): Promise<Readonly<EnvironmentResultType<Schema>>>;
8
+ }
package/src/index.ts CHANGED
@@ -43,7 +43,8 @@ export * from "./encryption.port";
43
43
  export * from "./encryption-bun.adapter";
44
44
  export * from "./encryption-key.vo";
45
45
  export * from "./encryption-noop.adapter";
46
- export * from "./environment-validator.service";
46
+ export * from "./environment-loader.port";
47
+ export * from "./environment-loader-process-env.adapter";
47
48
  export * from "./etag-extractor.middleware";
48
49
  export * from "./event.types";
49
50
  export * from "./event-bus-like.types";
@@ -1,15 +0,0 @@
1
- import type { z } from "zod/v4";
2
- import { type NodeEnvironmentEnum } from "../src/node-env.vo";
3
- export type EnvironmentResultType<Schema> = z.infer<Schema> & {
4
- type: NodeEnvironmentEnum;
5
- };
6
- export declare class EnvironmentValidator<Schema extends z.ZodObject<any>> {
7
- private readonly type;
8
- private readonly schema;
9
- constructor(config: {
10
- type: string | undefined;
11
- schema: Schema;
12
- });
13
- load(env: NodeJS.ProcessEnv): EnvironmentResultType<Schema>;
14
- }
15
- //# sourceMappingURL=environment-validator.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment-validator.service.d.ts","sourceRoot":"","sources":["../src/environment-validator.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,MAAM,MAAM,qBAAqB,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAE5F,qBAAa,oBAAoB,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAKhE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,qBAAqB,CAAC,MAAM,CAAC;CAG5D"}
@@ -1,13 +0,0 @@
1
- import { NodeEnvironment } from "../src/node-env.vo";
2
- export class EnvironmentValidator {
3
- type;
4
- schema;
5
- constructor(config) {
6
- this.schema = config.schema;
7
- this.type = NodeEnvironment.parse(config.type);
8
- }
9
- load(env) {
10
- return { ...this.schema.parse(env), type: this.type };
11
- }
12
- }
13
- //# sourceMappingURL=environment-validator.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment-validator.service.js","sourceRoot":"","sources":["../src/environment-validator.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAI/E,MAAM,OAAO,oBAAoB;IACd,IAAI,CAAsB;IAC1B,MAAM,CAAS;IAEhC,YAAY,MAAoD;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,GAAsB;QACzB,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACxD,CAAC;CACF"}
@@ -1,18 +0,0 @@
1
- import type { z } from "zod/v4";
2
- import { NodeEnvironment, type NodeEnvironmentEnum } from "../src/node-env.vo";
3
-
4
- export type EnvironmentResultType<Schema> = z.infer<Schema> & { type: NodeEnvironmentEnum };
5
-
6
- export class EnvironmentValidator<Schema extends z.ZodObject<any>> {
7
- private readonly type: NodeEnvironmentEnum;
8
- private readonly schema: Schema;
9
-
10
- constructor(config: { type: string | undefined; schema: Schema }) {
11
- this.schema = config.schema;
12
- this.type = NodeEnvironment.parse(config.type);
13
- }
14
-
15
- load(env: NodeJS.ProcessEnv): EnvironmentResultType<Schema> {
16
- return { ...this.schema.parse(env), type: this.type };
17
- }
18
- }