@elek-io/core 0.6.0 → 0.8.0
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 +18 -10
- package/dist/browser/index.browser.d.ts +7678 -6871
- package/dist/browser/index.browser.js +337 -336
- package/dist/browser/index.browser.js.map +1 -1
- package/dist/node/index.node.d.ts +6910 -6936
- package/dist/node/index.node.js +367 -422
- package/dist/node/index.node.js.map +1 -1
- package/package.json +29 -29
package/README.md
CHANGED
|
@@ -2,26 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://codecov.io/gh/elek-io/core)
|
|
4
4
|
|
|
5
|
-
Handles core functionality of elek.io Projects like file IO and version control.
|
|
5
|
+
Handles core functionality of elek.io Projects like file IO and version control as well as providing schemas and types.
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
|-- src
|
|
9
9
|
| |-- error
|
|
10
10
|
| | Different classes extending Error.
|
|
11
|
+
| |-- schema
|
|
12
|
+
| | Zod schemas for validation and types.
|
|
11
13
|
| |-- service
|
|
12
14
|
| | Contains CRUD logic that does file-io as well as utility functions.
|
|
13
15
|
| | The methods are mostly used as endpoints
|
|
14
|
-
| | so their input is validated against
|
|
16
|
+
| | so their input is validated against our zod schemas.
|
|
15
17
|
| |-- test
|
|
16
|
-
| | Additional files only used for testing.
|
|
18
|
+
| | Additional files and utility functions only used for testing.
|
|
17
19
|
| |-- upgrade
|
|
18
20
|
| | Files containing logic to upgrade each Project to support a higher Core version.
|
|
19
21
|
| | This may include iterating over all Assets to add a new key / value
|
|
20
22
|
| | because the new Core version uses it to store additional information.
|
|
21
23
|
| |-- util
|
|
22
24
|
| | Utility functions like path generation.
|
|
23
|
-
| |-- index.ts
|
|
24
|
-
| | Exports
|
|
25
|
+
| |-- index.browser.ts
|
|
26
|
+
| | Exports all schemas and types as well as the ElekIoCore type
|
|
27
|
+
| | but does not export the ElekIoCore main class,
|
|
28
|
+
| | since it is not actually usable in a browser environment.
|
|
29
|
+
| |-- index.node.ts
|
|
30
|
+
| | Exports the ElekIoCore main class which makes the services endpoints accessible
|
|
31
|
+
| | as well as schemas and utility functions.
|
|
25
32
|
```
|
|
26
33
|
|
|
27
34
|
## The concept behind Projects, Collections, Entries, Values and Assets
|
|
@@ -29,6 +36,7 @@ Handles core functionality of elek.io Projects like file IO and version control.
|
|
|
29
36
|
```
|
|
30
37
|
|-- Project - e.g. "Website"
|
|
31
38
|
| |-- Collection - e.g. "Blog"
|
|
39
|
+
| | Contains Field definitions all Entries and Values of the Collection must follow.
|
|
32
40
|
| | |-- Entry - e.g "Post"
|
|
33
41
|
| | | |-- Value - e.g for a post's title: "Quarterly results 7% higher than expected"
|
|
34
42
|
| | | |-- Asset - a reference to a previously added Asset like image, PDF or ZIP
|
|
@@ -41,20 +49,20 @@ Are a container for Collections, Entries, Values and Assets. Think of a folder c
|
|
|
41
49
|
|
|
42
50
|
### Collections
|
|
43
51
|
|
|
44
|
-
Contains
|
|
45
|
-
e.g. for a Blog, it could have the following definition for each post / Entry:
|
|
52
|
+
Contains Field definitions (a schema) for possible Values each Entry can or has to have.
|
|
53
|
+
e.g. for a Blog, it could have the following Field definition for each post / Entry:
|
|
46
54
|
|
|
47
55
|
- an image that is displayed on top of the post (Asset reference)
|
|
48
56
|
- a title to catch users attention (Value)
|
|
49
57
|
- content that contains multiple headlines and paragraphs (Value)
|
|
50
58
|
- an author that wrote the post (Entry reference)
|
|
51
59
|
|
|
52
|
-
Each definition like the title, contains additional information for the input
|
|
53
|
-
e.g. the title would be a simple one line input
|
|
60
|
+
Each definition like the title, contains additional information for the input Field, that is used to modify it's Value.
|
|
61
|
+
e.g. the title would be a simple one line input Field, that has a maximum lenght of 150 characters and is required for each post. But the content is a markdown editor to easily add formatting. The image let's the user select a jpeg or png from disk. And the author is a reference to another Collection's Entry, so the user is able to choose one of them.
|
|
54
62
|
|
|
55
63
|
### Entries
|
|
56
64
|
|
|
57
|
-
Contains Values and references that follow the Collection's
|
|
65
|
+
Contains Values and references that follow the Collection's Field definitions. Why references and not the Assets or Entries themself? To make Values reusable for different Entries and even Collections - so when you update an Asset or Entry, it updates everywhere you've referenced it.
|
|
58
66
|
|
|
59
67
|
### Values
|
|
60
68
|
|