@bgord/bun 1.10.18 → 1.10.20

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.
Files changed (34) hide show
  1. package/dist/environment-loader-encrypted.adapter.d.ts.map +1 -1
  2. package/dist/environment-loader-encrypted.adapter.js +2 -2
  3. package/dist/environment-loader-encrypted.adapter.js.map +1 -1
  4. package/dist/hash-content-noop.strategy.js +1 -1
  5. package/dist/hash-content-noop.strategy.js.map +1 -1
  6. package/dist/hash-file-noop.adapter.js +1 -1
  7. package/dist/hash-file-noop.adapter.js.map +1 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/remote-file-storage-noop.adapter.js +1 -1
  13. package/dist/remote-file-storage-noop.adapter.js.map +1 -1
  14. package/dist/secure-key-generator-noop.adapter.d.ts.map +1 -1
  15. package/dist/secure-key-generator-noop.adapter.js +1 -1
  16. package/dist/secure-key-generator-noop.adapter.js.map +1 -1
  17. package/dist/setup.service.d.ts.map +1 -1
  18. package/dist/setup.service.js +2 -0
  19. package/dist/setup.service.js.map +1 -1
  20. package/dist/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +7 -7
  22. package/readme.md +0 -1
  23. package/src/environment-loader-encrypted.adapter.ts +2 -2
  24. package/src/hash-content-noop.strategy.ts +1 -1
  25. package/src/hash-file-noop.adapter.ts +1 -1
  26. package/src/index.ts +0 -1
  27. package/src/remote-file-storage-noop.adapter.ts +1 -1
  28. package/src/secure-key-generator-noop.adapter.ts +1 -1
  29. package/src/setup.service.ts +2 -0
  30. package/dist/environment-file-parser.service.d.ts +0 -4
  31. package/dist/environment-file-parser.service.d.ts.map +0 -1
  32. package/dist/environment-file-parser.service.js +0 -26
  33. package/dist/environment-file-parser.service.js.map +0 -1
  34. package/src/environment-file-parser.service.ts +0 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/bun",
3
- "version": "1.10.18",
3
+ "version": "1.10.20",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -23,11 +23,11 @@
23
23
  "@biomejs/biome": "2.4.4",
24
24
  "@commitlint/cli": "20.4.2",
25
25
  "@commitlint/config-conventional": "20.4.2",
26
- "@stryker-mutator/core": "9.5.1",
26
+ "@stryker-mutator/core": "9.6.0",
27
27
  "@types/bun": "1.3.9",
28
28
  "@types/nodemailer": "7.0.11",
29
29
  "@types/yazl": "3.3.0",
30
- "better-auth": "1.4.19",
30
+ "better-auth": "1.5.0",
31
31
  "cspell": "9.7.0",
32
32
  "csv": "6.4.1",
33
33
  "knip": "5.85.0",
@@ -35,7 +35,7 @@
35
35
  "lockfile-lint": "5.0.0",
36
36
  "nodemailer": "8.0.1",
37
37
  "only-allow": "1.2.2",
38
- "resend": "6.9.2",
38
+ "resend": "6.9.3",
39
39
  "sharp": "0.34.5",
40
40
  "shellcheck": "4.1.0",
41
41
  "typescript": "5.9.3",
@@ -43,15 +43,15 @@
43
43
  "zod": "4.3.6"
44
44
  },
45
45
  "dependencies": {
46
- "@bgord/tools": "1.3.18",
46
+ "@bgord/tools": "1.3.19",
47
47
  "hono": "4.12.3",
48
48
  "node-cache": "5.1.2"
49
49
  },
50
50
  "peerDependencies": {
51
- "better-auth": "1.4.19",
51
+ "better-auth": "1.5.0",
52
52
  "csv": "6.4.1",
53
53
  "nodemailer": "8.0.1",
54
- "resend": "6.9.2",
54
+ "resend": "6.9.3",
55
55
  "sharp": "0.34.5",
56
56
  "yazl": "3.3.1",
57
57
  "zod": "4.3.6"
package/readme.md CHANGED
@@ -102,7 +102,6 @@ src/
102
102
  ├── encryption-key.vo.ts
103
103
  ├── encryption-noop.adapter.ts
104
104
  ├── encryption.port.ts
105
- ├── environment-file-parser.service.ts
106
105
  ├── environment-loader-encrypted.adapter.ts
107
106
  ├── environment-loader-noop.adapter.ts
108
107
  ├── environment-loader-process-safe.adapter.ts
@@ -1,8 +1,8 @@
1
+ import util from "node:util";
1
2
  import type * as tools from "@bgord/tools";
2
3
  import type * as z from "zod/v4";
3
4
  import type { NodeEnvironmentEnum } from "../src/node-env.vo";
4
5
  import type { EncryptionPort } from "./encryption.port";
5
- import { EnvironmentFileParser } from "./environment-file-parser.service";
6
6
  import type { EnvironmentLoaderPort, EnvironmentResultType } from "./environment-loader.port";
7
7
 
8
8
  type Dependencies = { Encryption: EncryptionPort };
@@ -22,7 +22,7 @@ export class EnvironmentLoaderEncryptedAdapter<Schema extends z.ZodObject<any>>
22
22
  async load(): Promise<Readonly<EnvironmentResultType<Schema>>> {
23
23
  const file = await this.deps.Encryption.view(this.config.path);
24
24
  const plaintext = new TextDecoder().decode(file);
25
- const env = EnvironmentFileParser.parse(plaintext);
25
+ const env = util.parseEnv(plaintext);
26
26
 
27
27
  return Object.freeze({ ...this.config.Schema.parse(env), type: this.config.type });
28
28
  }
@@ -3,6 +3,6 @@ import type { HashContentStrategy } from "./hash-content.strategy";
3
3
 
4
4
  export class HashContentNoopStrategy implements HashContentStrategy {
5
5
  async hash(_content: string): Promise<Hash> {
6
- return Hash.fromString("0000000000000000000000000000000000000000000000000000000000000000");
6
+ return Hash.fromString("0".repeat(64));
7
7
  }
8
8
  }
@@ -5,7 +5,7 @@ import type { HashFilePort, HashFileResult } from "./hash-file.port";
5
5
  export class HashFileNoopAdapter implements HashFilePort {
6
6
  async hash(_path: tools.FilePathAbsolute | tools.FilePathRelative): Promise<HashFileResult> {
7
7
  return {
8
- etag: Hash.fromString("0000000000000000000000000000000000000000000000000000000000000000"),
8
+ etag: Hash.fromString("0".repeat(64)),
9
9
  size: tools.Size.fromBytes(10),
10
10
  lastModified: tools.Timestamp.fromNumber(1000),
11
11
  mime: tools.Mimes.text.mime,
package/src/index.ts CHANGED
@@ -73,7 +73,6 @@ export * from "./encryption-aes-gcm.adapter";
73
73
  export * from "./encryption-key.vo";
74
74
  export * from "./encryption-key-value.vo";
75
75
  export * from "./encryption-noop.adapter";
76
- export * from "./environment-file-parser.service";
77
76
  export * from "./environment-loader.port";
78
77
  export * from "./environment-loader-encrypted.adapter";
79
78
  export * from "./environment-loader-noop.adapter";
@@ -29,7 +29,7 @@ export class RemoteFileStorageNoopAdapter implements RemoteFileStoragePort {
29
29
  });
30
30
 
31
31
  return {
32
- etag: Hash.fromString("0000000000000000000000000000000000000000000000000000000000000000"),
32
+ etag: Hash.fromString("0".repeat(64)),
33
33
  size: tools.Size.fromBytes(10),
34
34
  lastModified: this.deps.Clock.now(),
35
35
  mime: tools.Mimes.text.mime,
@@ -1,7 +1,7 @@
1
1
  import type { SecureKeyGeneratorPort } from "./secure-key-generator.port";
2
2
 
3
3
  export class SecureKeyGeneratorNoopAdapter implements SecureKeyGeneratorPort {
4
- constructor(private readonly value: Uint8Array = new TextEncoder().encode("noop")) {}
4
+ constructor(private readonly value: Uint8Array = new TextEncoder().encode("0".repeat(32))) {}
5
5
 
6
6
  generate(): Uint8Array {
7
7
  return this.value;
@@ -5,6 +5,7 @@ import { languageDetector } from "hono/language";
5
5
  import { requestId } from "hono/request-id";
6
6
  import { secureHeaders } from "hono/secure-headers";
7
7
  import { timing } from "hono/timing";
8
+ import { trimTrailingSlash } from "hono/trailing-slash";
8
9
  import { ApiVersion } from "./api-version.middleware";
9
10
  import type { BuildInfoRepositoryStrategy } from "./build-info-repository.strategy";
10
11
  import type { CacheResolverStrategy } from "./cache-resolver.strategy";
@@ -46,6 +47,7 @@ export class Setup {
46
47
 
47
48
  return [
48
49
  MaintenanceMode.build(config.maintenanceMode),
50
+ trimTrailingSlash({ alwaysRedirect: true }),
49
51
  requestId({
50
52
  limitLength: 36,
51
53
  headerName: "x-correlation-id",
@@ -1,4 +0,0 @@
1
- export declare class EnvironmentFileParser {
2
- static parse(content: string): Record<string, string>;
3
- }
4
- //# sourceMappingURL=environment-file-parser.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment-file-parser.service.d.ts","sourceRoot":"","sources":["../src/environment-file-parser.service.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;IAChC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CA8BtD"}
@@ -1,26 +0,0 @@
1
- export class EnvironmentFileParser {
2
- static parse(content) {
3
- const result = {};
4
- const lines = content.split(/\r?\n/);
5
- for (const line of lines) {
6
- // Stryker disable all
7
- const trimmed = line.trim();
8
- if (!trimmed)
9
- continue;
10
- if (trimmed.startsWith("#"))
11
- continue;
12
- // Stryker restore all
13
- const separatorIndex = trimmed.indexOf("=");
14
- if (separatorIndex === -1)
15
- continue;
16
- const key = trimmed.slice(0, separatorIndex).trim();
17
- let value = trimmed.slice(separatorIndex + 1).trim();
18
- if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
19
- value = value.slice(1, -1);
20
- }
21
- result[key] = value;
22
- }
23
- return result;
24
- }
25
- }
26
- //# sourceMappingURL=environment-file-parser.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment-file-parser.service.js","sourceRoot":"","sources":["../src/environment-file-parser.service.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,qBAAqB;IAChC,MAAM,CAAC,KAAK,CAAC,OAAe;QAC1B,MAAM,MAAM,GAA2B,EAAE,CAAC;QAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAErC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,sBAAsB;YACtB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAE5B,IAAI,CAAC,OAAO;gBAAE,SAAS;YACvB,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YACtC,sBAAsB;YAEtB,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAE5C,IAAI,cAAc,KAAK,CAAC,CAAC;gBAAE,SAAS;YAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;YAEpD,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAErD,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBACrG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7B,CAAC;YAED,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,32 +0,0 @@
1
- export class EnvironmentFileParser {
2
- static parse(content: string): Record<string, string> {
3
- const result: Record<string, string> = {};
4
-
5
- const lines = content.split(/\r?\n/);
6
-
7
- for (const line of lines) {
8
- // Stryker disable all
9
- const trimmed = line.trim();
10
-
11
- if (!trimmed) continue;
12
- if (trimmed.startsWith("#")) continue;
13
- // Stryker restore all
14
-
15
- const separatorIndex = trimmed.indexOf("=");
16
-
17
- if (separatorIndex === -1) continue;
18
-
19
- const key = trimmed.slice(0, separatorIndex).trim();
20
-
21
- let value = trimmed.slice(separatorIndex + 1).trim();
22
-
23
- if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
24
- value = value.slice(1, -1);
25
- }
26
-
27
- result[key] = value;
28
- }
29
-
30
- return result;
31
- }
32
- }