skygame-data 1.1.17 → 1.1.18

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Silverfeelin
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Silverfeelin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,204 +1,204 @@
1
- # SkyGame-Data
2
-
3
- [![npm](https://img.shields.io/npm/v/skygame-data)](https://www.npmjs.com/package/skygame-data)
4
-
5
- A fan-made data repository for Sky: Children of the Light. This project contains the raw data that fuels [SkyGame-Planner](https://github.com/Silverfeelin/SkyGame-Planner). The data has been separated to make it easier to consume in other projects. Do note that various bits of data are tightly coupled to the Sky Planner, such as links to image assets contained in that project.
6
-
7
- ## Package
8
-
9
- The data is published as an NPM package together with some useful scripts to parse the data.
10
-
11
- https://www.npmjs.com/package/skygame-data
12
-
13
- ### Versioning
14
-
15
- To make sure the format of data doesn't change unexpectedly, this project follows [Semantic Versioning](https://docs.npmjs.com/about-semantic-versioning).
16
-
17
- * **Major** versions are incremented when the structure of assets classified as "stable" changes.
18
- * **Minor** versions are incremented when backward-compatible changes are made to the data, or when assets classified as "unstable" are changed.
19
- * **Patch** versions are incremented when data is added or changed without any structural changes to the project.
20
-
21
- ### CDN
22
-
23
- Files from the package can be accessed directly through CDN options such as [unpkg](https://unpkg.com/). Version wildcards can be used.
24
- Below are some examples for the `everything.json` file.
25
-
26
- | Version | Link |
27
- |---------|------|
28
- | Latest | <https://unpkg.com/skygame-data@latest/assets/everything.json> |
29
- | Latest within major 1 | <https://unpkg.com/skygame-data@1.x.x/assets/everything.json> |
30
- | Latest within minor 1.0 | <https://unpkg.com/skygame-data@1.0.x/assets/everything.json> |
31
- | Version 1.0.0 | <https://unpkg.com/skygame-data@1.0.0/assets/everything.json> |
32
-
33
-
34
- ## Assets
35
-
36
- **Stable** (see [versioning](#versioning))
37
-
38
- ```
39
- realms, areas, winged-lights, map-shrines, constellations,
40
- seasons, events, event-instances, event-instance-spirits,
41
- spirits, spirit-trees, spirit-tree-tiers, nodes,
42
- traveling-spirits, returning-spirits,
43
- items, item-lists, shops, iaps
44
- ```
45
-
46
- **Unstable**
47
-
48
- ```
49
- candles
50
- ```
51
-
52
- ### Asset GUIDs
53
-
54
- The project uses [nanoids](https://github.com/ai/nanoid) of length 10 as GUIDs. When an entity is referenced, its GUID is used in place of the full JSON object. This mechanism can be compared to a foreign key in a database.
55
-
56
- **Example**
57
-
58
- In `/assets/event-instance-spirits.json`, you'll find various references to spirits:
59
-
60
- ```jsonc
61
- { "guid": "ACtiGG4_cq", "spirit": "TgUgZjfoMI", "tree": "EUQHt6adrz" }
62
- ```
63
-
64
- * `guid`: Unique GUID of this specific JSON object.
65
- * `spirit`: GUID reference to the spirit found in `/assets/spirits.json`.
66
- * `tree`: GUID reference to the spirit tree found in `/assets/spirit-trees.json`.
67
-
68
-
69
- ### Asset location
70
-
71
- In the `/src/assets` folder, the data is organized in folders to make it easier to manage within this repository.
72
- In the package, the contents of these folders are compiled into minified JSON files located at `/assets`.
73
-
74
- Data in these files is stored as a JSON object formatted `{ "items": [ ... ] }`.
75
-
76
- **Example**
77
- `/src/assets/events/**` --> `node_modules/skygame-data/assets/events.json`
78
- `/src/assets/events/**` --> <https://unpkg.com/skygame-data@latest/assets/events.json>
79
-
80
- **Everything**
81
- `/assets/everything.json` contains all data in a single file.
82
-
83
- Data in this file is stored as a JSON object formatted as below.
84
-
85
- ```jsonc
86
- {
87
- "realms": { "items": [ /*...*/ ] },
88
- "areas": { "items": [ /*...*/ ] },
89
- // ...
90
- }
91
- ```
92
-
93
- ## Item IDs
94
-
95
- > [!TIP]
96
- > It is recommended to use the GUIDs whenever possible.
97
-
98
- All items (`/assets/items.json`) have a unique numeric ID on top of the GUID. This number is used by the Sky Planner in various places, such as encoding a selection of items with Base36 to a fixed length of 3 characters to keep URLs shorter.
99
-
100
- **Example**
101
-
102
- ```
103
- https://sky-planner.com/item/unlock-calculator?items=00a00g
104
- 00a --> parseInt('00a', 36) --> ID 10 --> Pointing Candlemaker Hair
105
- 00g --> parseInt('00g', 36) --> ID 16 --> Pointing Candlemaker Outfit
106
- ```
107
-
108
- ## Dates
109
-
110
- Dates are stored in the format `YYYY-MM-DD`. Sky: Children of the Light uses the `America/Los_Angeles` timezone for the daily reset, so this timezone should be respected when calculating the actual time an event begins or ends.
111
-
112
- ## Diagram
113
-
114
- The following diagram illustrates which references exist between the data.
115
-
116
- References marked in **bold** are stored as GUID reference in the data. For one-to-many relations, an array of GUIDs is used. If no reference exists, the key is omitted from the data.
117
-
118
- Circular references are marked in *italic* and are created automatically when parsing the data using the included [Scripts](#scripts).
119
-
120
- ![Reference diagram](./diagrams/References.jpg)
121
-
122
- ## Scripts
123
-
124
- The project includes some utilities to parse the data into a Javascript object with resolved GUID references. Do note that this data can not be serialized normally due to the circular references in the data, as per the diagram.
125
-
126
- **SkyDataResolver**
127
-
128
- Helper class that can parse and resolve references using the `everything.json` file.
129
-
130
- Example:
131
- ```ts
132
- import { SkyDataResolver } from 'skygame-data';
133
-
134
- (async () => {
135
- const response = await fetch('https://unpkg.com/skygame-data@0.2.0/assets/everything.json');
136
- const data = await response.json();
137
- const resolved = await SkyDataResolver.resolve(data);
138
- console.log(resolved.seasons.items.length);
139
- })();
140
- ```
141
-
142
-
143
- **SkyDateHelper**
144
-
145
- Helper class that can parse date strings to Luxon DateTime objects based on the `America/Los_Angeles` timezone.
146
-
147
- Example:
148
- ```ts
149
- import { SkyDateHelper } from 'skygame-data';
150
-
151
- const date = SkyDateHelper.fromStringSky('2026-01-01');
152
- console.log(date.toISO()); // 2026-01-01T08:00:00.000Z
153
- ```
154
-
155
- **SpiritTreeHelper**
156
-
157
- Helper class that has some utilities for working with spirit trees.
158
-
159
- Example:
160
- ```ts
161
- import { SpiritTreeHelper } from 'skygame-data';
162
-
163
- const resolved; // See SkyDataResolver example.
164
- const spirit = resolved.spirits.items.find(s => s.name === 'Migrating Bellmaker')!;
165
- const nodes = SpiritTreeHelper.getNodes(spirit.tree!);
166
- console.log(nodes.length);
167
- ```
168
-
169
- **NodeHelper**
170
-
171
- Helper class that has some utilities for working with nodes.
172
-
173
- Example:
174
- ```ts
175
- import { NodeHelper } from 'skygame-data';
176
-
177
- const resolved; // See SkyDataResolver example.
178
- const item = resolved.items.items.find(i => i.name === 'Admiring Actor Outfit')!;
179
- const node = item.nodes!.at(0);
180
- const nodes = NodeHelper.trace(node);
181
- console.log(nodes.length);
182
- ```
183
-
184
- # Discord
185
-
186
- If you are or want to be actively involved with this project, feel free to join our Discord:
187
- http://discord.gg/qjumJY7MKD
188
-
189
- ## FAQ
190
-
191
- **The data isn't accurate, how can I help?**
192
-
193
- Since Sky: Children of Light is a live service game with frequent updates, keeping the data up to date and accurate is an ongoing effort.
194
-
195
- Simply opening [issues](https://github.com/Silverfeelin/SkyGame-Data/issues) or informing us on our [Discord](#discord) is a good way to help.
196
- Contributions through pull requests are welcome and very much appreciated.
197
-
198
- **Why JSON files?**
199
-
200
- The main goal of this project is to provide the data in an accessible and serverless format. This allows projects such as the Sky Planner to be hosted with static assets and not rely on a back-end for fetching data.
201
-
202
- ## License
203
-
204
- [MIT License](LICENSE)
1
+ # SkyGame-Data
2
+
3
+ [![npm](https://img.shields.io/npm/v/skygame-data)](https://www.npmjs.com/package/skygame-data)
4
+
5
+ A fan-made data repository for Sky: Children of the Light. This project contains the raw data that fuels [SkyGame-Planner](https://github.com/Silverfeelin/SkyGame-Planner). The data has been separated to make it easier to consume in other projects. Do note that various bits of data are tightly coupled to the Sky Planner, such as links to image assets contained in that project.
6
+
7
+ ## Package
8
+
9
+ The data is published as an NPM package together with some useful scripts to parse the data.
10
+
11
+ https://www.npmjs.com/package/skygame-data
12
+
13
+ ### Versioning
14
+
15
+ To make sure the format of data doesn't change unexpectedly, this project follows [Semantic Versioning](https://docs.npmjs.com/about-semantic-versioning).
16
+
17
+ * **Major** versions are incremented when the structure of assets classified as "stable" changes.
18
+ * **Minor** versions are incremented when backward-compatible changes are made to the data, or when assets classified as "unstable" are changed.
19
+ * **Patch** versions are incremented when data is added or changed without any structural changes to the project.
20
+
21
+ ### CDN
22
+
23
+ Files from the package can be accessed directly through CDN options such as [unpkg](https://unpkg.com/). Version wildcards can be used.
24
+ Below are some examples for the `everything.json` file.
25
+
26
+ | Version | Link |
27
+ |---------|------|
28
+ | Latest | <https://unpkg.com/skygame-data@latest/assets/everything.json> |
29
+ | Latest within major 1 | <https://unpkg.com/skygame-data@1.x.x/assets/everything.json> |
30
+ | Latest within minor 1.0 | <https://unpkg.com/skygame-data@1.0.x/assets/everything.json> |
31
+ | Version 1.0.0 | <https://unpkg.com/skygame-data@1.0.0/assets/everything.json> |
32
+
33
+
34
+ ## Assets
35
+
36
+ **Stable** (see [versioning](#versioning))
37
+
38
+ ```
39
+ realms, areas, winged-lights, map-shrines, constellations,
40
+ seasons, events, event-instances, event-instance-spirits,
41
+ spirits, spirit-trees, spirit-tree-tiers, nodes,
42
+ traveling-spirits, returning-spirits,
43
+ items, item-lists, shops, iaps
44
+ ```
45
+
46
+ **Unstable**
47
+
48
+ ```
49
+ candles
50
+ ```
51
+
52
+ ### Asset GUIDs
53
+
54
+ The project uses [nanoids](https://github.com/ai/nanoid) of length 10 as GUIDs. When an entity is referenced, its GUID is used in place of the full JSON object. This mechanism can be compared to a foreign key in a database.
55
+
56
+ **Example**
57
+
58
+ In `/assets/event-instance-spirits.json`, you'll find various references to spirits:
59
+
60
+ ```jsonc
61
+ { "guid": "ACtiGG4_cq", "spirit": "TgUgZjfoMI", "tree": "EUQHt6adrz" }
62
+ ```
63
+
64
+ * `guid`: Unique GUID of this specific JSON object.
65
+ * `spirit`: GUID reference to the spirit found in `/assets/spirits.json`.
66
+ * `tree`: GUID reference to the spirit tree found in `/assets/spirit-trees.json`.
67
+
68
+
69
+ ### Asset location
70
+
71
+ In the `/src/assets` folder, the data is organized in folders to make it easier to manage within this repository.
72
+ In the package, the contents of these folders are compiled into minified JSON files located at `/assets`.
73
+
74
+ Data in these files is stored as a JSON object formatted `{ "items": [ ... ] }`.
75
+
76
+ **Example**
77
+ `/src/assets/events/**` --> `node_modules/skygame-data/assets/events.json`
78
+ `/src/assets/events/**` --> <https://unpkg.com/skygame-data@latest/assets/events.json>
79
+
80
+ **Everything**
81
+ `/assets/everything.json` contains all data in a single file.
82
+
83
+ Data in this file is stored as a JSON object formatted as below.
84
+
85
+ ```jsonc
86
+ {
87
+ "realms": { "items": [ /*...*/ ] },
88
+ "areas": { "items": [ /*...*/ ] },
89
+ // ...
90
+ }
91
+ ```
92
+
93
+ ## Item IDs
94
+
95
+ > [!TIP]
96
+ > It is recommended to use the GUIDs whenever possible.
97
+
98
+ All items (`/assets/items.json`) have a unique numeric ID on top of the GUID. This number is used by the Sky Planner in various places, such as encoding a selection of items with Base36 to a fixed length of 3 characters to keep URLs shorter.
99
+
100
+ **Example**
101
+
102
+ ```
103
+ https://sky-planner.com/item/unlock-calculator?items=00a00g
104
+ 00a --> parseInt('00a', 36) --> ID 10 --> Pointing Candlemaker Hair
105
+ 00g --> parseInt('00g', 36) --> ID 16 --> Pointing Candlemaker Outfit
106
+ ```
107
+
108
+ ## Dates
109
+
110
+ Dates are stored in the format `YYYY-MM-DD`. Sky: Children of the Light uses the `America/Los_Angeles` timezone for the daily reset, so this timezone should be respected when calculating the actual time an event begins or ends.
111
+
112
+ ## Diagram
113
+
114
+ The following diagram illustrates which references exist between the data.
115
+
116
+ References marked in **bold** are stored as GUID reference in the data. For one-to-many relations, an array of GUIDs is used. If no reference exists, the key is omitted from the data.
117
+
118
+ Circular references are marked in *italic* and are created automatically when parsing the data using the included [Scripts](#scripts).
119
+
120
+ ![Reference diagram](./diagrams/References.jpg)
121
+
122
+ ## Scripts
123
+
124
+ The project includes some utilities to parse the data into a Javascript object with resolved GUID references. Do note that this data can not be serialized normally due to the circular references in the data, as per the diagram.
125
+
126
+ **SkyDataResolver**
127
+
128
+ Helper class that can parse and resolve references using the `everything.json` file.
129
+
130
+ Example:
131
+ ```ts
132
+ import { SkyDataResolver } from 'skygame-data';
133
+
134
+ (async () => {
135
+ const response = await fetch('https://unpkg.com/skygame-data@0.2.0/assets/everything.json');
136
+ const data = await response.json();
137
+ const resolved = await SkyDataResolver.resolve(data);
138
+ console.log(resolved.seasons.items.length);
139
+ })();
140
+ ```
141
+
142
+
143
+ **SkyDateHelper**
144
+
145
+ Helper class that can parse date strings to Luxon DateTime objects based on the `America/Los_Angeles` timezone.
146
+
147
+ Example:
148
+ ```ts
149
+ import { SkyDateHelper } from 'skygame-data';
150
+
151
+ const date = SkyDateHelper.fromStringSky('2026-01-01');
152
+ console.log(date.toISO()); // 2026-01-01T08:00:00.000Z
153
+ ```
154
+
155
+ **SpiritTreeHelper**
156
+
157
+ Helper class that has some utilities for working with spirit trees.
158
+
159
+ Example:
160
+ ```ts
161
+ import { SpiritTreeHelper } from 'skygame-data';
162
+
163
+ const resolved; // See SkyDataResolver example.
164
+ const spirit = resolved.spirits.items.find(s => s.name === 'Migrating Bellmaker')!;
165
+ const nodes = SpiritTreeHelper.getNodes(spirit.tree!);
166
+ console.log(nodes.length);
167
+ ```
168
+
169
+ **NodeHelper**
170
+
171
+ Helper class that has some utilities for working with nodes.
172
+
173
+ Example:
174
+ ```ts
175
+ import { NodeHelper } from 'skygame-data';
176
+
177
+ const resolved; // See SkyDataResolver example.
178
+ const item = resolved.items.items.find(i => i.name === 'Admiring Actor Outfit')!;
179
+ const node = item.nodes!.at(0);
180
+ const nodes = NodeHelper.trace(node);
181
+ console.log(nodes.length);
182
+ ```
183
+
184
+ # Discord
185
+
186
+ If you are or want to be actively involved with this project, feel free to join our Discord:
187
+ http://discord.gg/qjumJY7MKD
188
+
189
+ ## FAQ
190
+
191
+ **The data isn't accurate, how can I help?**
192
+
193
+ Since Sky: Children of Light is a live service game with frequent updates, keeping the data up to date and accurate is an ongoing effort.
194
+
195
+ Simply opening [issues](https://github.com/Silverfeelin/SkyGame-Data/issues) or informing us on our [Discord](#discord) is a good way to help.
196
+ Contributions through pull requests are welcome and very much appreciated.
197
+
198
+ **Why JSON files?**
199
+
200
+ The main goal of this project is to provide the data in an accessible and serverless format. This allows projects such as the Sky Planner to be hosted with static assets and not rely on a back-end for fetching data.
201
+
202
+ ## License
203
+
204
+ [MIT License](LICENSE)