@raubjo/architect-core 0.1.0 → 0.1.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.
Files changed (67) hide show
  1. package/README.md +216 -0
  2. package/bun.lock +82 -1
  3. package/package.json +55 -6
  4. package/src/cache/cache.ts +2 -2
  5. package/src/cache/manager.ts +93 -83
  6. package/src/config/adapters/esm.ts +26 -0
  7. package/src/config/clone.ts +5 -5
  8. package/src/config/env.global.d.ts +2 -1
  9. package/src/config/env.ts +53 -55
  10. package/src/config/env_test.helpers.ts +58 -0
  11. package/src/config/repository.ts +180 -142
  12. package/src/container/adapters/builtin.ts +347 -0
  13. package/src/container/adapters/inversify.ts +123 -0
  14. package/src/container/contract.ts +58 -0
  15. package/src/container/runtime.ts +149 -0
  16. package/src/filesystem/adapters/local.ts +92 -83
  17. package/src/filesystem/adapters/local_test.helpers.ts +50 -0
  18. package/src/filesystem/filesystem.ts +11 -11
  19. package/src/foundation/application.ts +205 -175
  20. package/src/foundation/application_test.helpers.ts +31 -0
  21. package/src/index.ts +15 -6
  22. package/src/react.ts +2 -0
  23. package/src/renderers/adapters/react.tsx +35 -0
  24. package/src/renderers/adapters/solid.tsx +32 -0
  25. package/src/renderers/adapters/svelte.ts +70 -0
  26. package/src/renderers/adapters/vue.ts +28 -0
  27. package/src/renderers/contract.ts +15 -0
  28. package/src/runtimes/react.tsx +24 -12
  29. package/src/runtimes/solid.tsx +30 -0
  30. package/src/runtimes/svelte.ts +23 -0
  31. package/src/runtimes/vue.ts +20 -0
  32. package/src/solid.ts +2 -0
  33. package/src/storage/adapters/contract.ts +10 -0
  34. package/src/storage/adapters/indexed-db.ts +170 -156
  35. package/src/storage/adapters/local-storage.ts +34 -34
  36. package/src/storage/adapters/memory.ts +25 -25
  37. package/src/storage/manager.ts +65 -61
  38. package/src/storage/storage.ts +1 -8
  39. package/src/support/facades/cache.ts +40 -40
  40. package/src/support/facades/config.ts +78 -48
  41. package/src/support/facades/facade.ts +43 -28
  42. package/src/support/facades/storage.ts +41 -41
  43. package/src/support/service-provider.ts +11 -11
  44. package/src/support/str.ts +94 -90
  45. package/src/support/str_test.helpers.ts +26 -0
  46. package/src/svelte.ts +2 -0
  47. package/src/vue.ts +2 -0
  48. package/tsconfig.json +16 -0
  49. package/coverage/lcov.info +0 -1078
  50. package/src/config/app.ts +0 -5
  51. package/src/rendering/adapters/react.tsx +0 -27
  52. package/src/rendering/renderer.ts +0 -13
  53. package/src/support/providers/config-service-provider.ts +0 -19
  54. package/tests/application.test.ts +0 -236
  55. package/tests/cache-facade.test.ts +0 -45
  56. package/tests/cache.test.ts +0 -68
  57. package/tests/config-clone.test.ts +0 -31
  58. package/tests/config-env.test.ts +0 -88
  59. package/tests/config-facade.test.ts +0 -96
  60. package/tests/config-repository.test.ts +0 -124
  61. package/tests/facade-base.test.ts +0 -80
  62. package/tests/filesystem.test.ts +0 -81
  63. package/tests/runtime-react.test.tsx +0 -37
  64. package/tests/service-provider.test.ts +0 -23
  65. package/tests/storage-facade.test.ts +0 -46
  66. package/tests/storage.test.ts +0 -264
  67. package/tests/str.test.ts +0 -73
package/tests/str.test.ts DELETED
@@ -1,73 +0,0 @@
1
- import { afterEach, describe, expect, test } from "bun:test";
2
- import Str, { __strTesting, registerGlobalStr } from "../src/support/str";
3
-
4
- describe("Str helper", () => {
5
- const originalGlobalStr = (globalThis as { Str?: unknown }).Str;
6
-
7
- afterEach(() => {
8
- (globalThis as { Str?: unknown }).Str = originalGlobalStr;
9
- });
10
-
11
- test("changes string case and length", () => {
12
- expect(new (Str as unknown as { new (): object })()).toBeTruthy();
13
- expect(Str.lower("TeSt")).toBe("test");
14
- expect(Str.upper("TeSt")).toBe("TEST");
15
- expect(Str.length("abc")).toBe(3);
16
- });
17
-
18
- test("checks contains and boundaries", () => {
19
- expect(Str.contains("Hello World", "World")).toBe(true);
20
- expect(Str.contains("Hello World", "world")).toBe(false);
21
- expect(Str.contains("Hello World", "world", true)).toBe(true);
22
- expect(Str.contains("Hello World", ["x", "y"])).toBe(false);
23
-
24
- expect(Str.startsWith("framework", "frame")).toBe(true);
25
- expect(Str.startsWith("framework", ["zzz", "fra"])).toBe(true);
26
- expect(Str.startsWith("framework", "zzz")).toBe(false);
27
-
28
- expect(Str.endsWith("framework", "work")).toBe(true);
29
- expect(Str.endsWith("framework", ["abc", "work"])).toBe(true);
30
- expect(Str.endsWith("framework", "abc")).toBe(false);
31
- });
32
-
33
- test("replaces content", () => {
34
- expect(Str.replace("laravel", "ioc", "laravel-app")).toBe("ioc-app");
35
- expect(Str.replace(/-app$/, "", "laravel-app")).toBe("laravel");
36
- });
37
-
38
- test("converts string casing styles", () => {
39
- expect(Str.snake("HelloWorld")).toBe("hello_world");
40
- expect(Str.snake("hello-world", ".")).toBe("hello.world");
41
- expect(Str.kebab("HelloWorld")).toBe("hello-world");
42
- expect(Str.studly("hello_world-test")).toBe("HelloWorldTest");
43
- expect(Str.camel("hello_world-test")).toBe("helloWorldTest");
44
- expect(Str.camel("")).toBe("");
45
- });
46
-
47
- test("creates slugs", () => {
48
- expect(Str.slug("Héllo, Wörld!")).toBe("hello-world");
49
- expect(Str.slug("Héllo, Wörld!", "_")).toBe("hello_world");
50
- });
51
-
52
- test("registers global Str without overriding existing value", () => {
53
- (globalThis as { Str?: unknown }).Str = undefined;
54
- registerGlobalStr();
55
- expect((globalThis as { Str?: unknown }).Str).toBe(Str);
56
-
57
- const custom = class Custom {};
58
- (globalThis as { Str?: unknown }).Str = custom;
59
- registerGlobalStr();
60
- expect((globalThis as { Str?: unknown }).Str).toBe(custom);
61
- });
62
-
63
- test("exposes helper internals", () => {
64
- expect(__strTesting.splitWords("HelloWorld_test-value")).toEqual([
65
- "Hello",
66
- "World",
67
- "test",
68
- "value",
69
- ]);
70
- expect(__strTesting.splitWords("")).toEqual([]);
71
- expect(__strTesting.normalizeForSlug("Héllo Wörld")).toBe("hello-world");
72
- });
73
- });