@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.
- package/README.md +216 -0
- package/bun.lock +82 -1
- package/package.json +55 -6
- package/src/cache/cache.ts +2 -2
- package/src/cache/manager.ts +93 -83
- package/src/config/adapters/esm.ts +26 -0
- package/src/config/clone.ts +5 -5
- package/src/config/env.global.d.ts +2 -1
- package/src/config/env.ts +53 -55
- package/src/config/env_test.helpers.ts +58 -0
- package/src/config/repository.ts +180 -142
- package/src/container/adapters/builtin.ts +347 -0
- package/src/container/adapters/inversify.ts +123 -0
- package/src/container/contract.ts +58 -0
- package/src/container/runtime.ts +149 -0
- package/src/filesystem/adapters/local.ts +92 -83
- package/src/filesystem/adapters/local_test.helpers.ts +50 -0
- package/src/filesystem/filesystem.ts +11 -11
- package/src/foundation/application.ts +205 -175
- package/src/foundation/application_test.helpers.ts +31 -0
- package/src/index.ts +15 -6
- package/src/react.ts +2 -0
- package/src/renderers/adapters/react.tsx +35 -0
- package/src/renderers/adapters/solid.tsx +32 -0
- package/src/renderers/adapters/svelte.ts +70 -0
- package/src/renderers/adapters/vue.ts +28 -0
- package/src/renderers/contract.ts +15 -0
- package/src/runtimes/react.tsx +24 -12
- package/src/runtimes/solid.tsx +30 -0
- package/src/runtimes/svelte.ts +23 -0
- package/src/runtimes/vue.ts +20 -0
- package/src/solid.ts +2 -0
- package/src/storage/adapters/contract.ts +10 -0
- package/src/storage/adapters/indexed-db.ts +170 -156
- package/src/storage/adapters/local-storage.ts +34 -34
- package/src/storage/adapters/memory.ts +25 -25
- package/src/storage/manager.ts +65 -61
- package/src/storage/storage.ts +1 -8
- package/src/support/facades/cache.ts +40 -40
- package/src/support/facades/config.ts +78 -48
- package/src/support/facades/facade.ts +43 -28
- package/src/support/facades/storage.ts +41 -41
- package/src/support/service-provider.ts +11 -11
- package/src/support/str.ts +94 -90
- package/src/support/str_test.helpers.ts +26 -0
- package/src/svelte.ts +2 -0
- package/src/vue.ts +2 -0
- package/tsconfig.json +16 -0
- package/coverage/lcov.info +0 -1078
- package/src/config/app.ts +0 -5
- package/src/rendering/adapters/react.tsx +0 -27
- package/src/rendering/renderer.ts +0 -13
- package/src/support/providers/config-service-provider.ts +0 -19
- package/tests/application.test.ts +0 -236
- package/tests/cache-facade.test.ts +0 -45
- package/tests/cache.test.ts +0 -68
- package/tests/config-clone.test.ts +0 -31
- package/tests/config-env.test.ts +0 -88
- package/tests/config-facade.test.ts +0 -96
- package/tests/config-repository.test.ts +0 -124
- package/tests/facade-base.test.ts +0 -80
- package/tests/filesystem.test.ts +0 -81
- package/tests/runtime-react.test.tsx +0 -37
- package/tests/service-provider.test.ts +0 -23
- package/tests/storage-facade.test.ts +0 -46
- package/tests/storage.test.ts +0 -264
- 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
|
-
});
|