@optolith/database-schema 0.102.0 → 0.103.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/CHANGELOG.md +13 -0
- package/gen/types.d.ts +5 -0
- package/lib/main.d.ts +2 -0
- package/lib/main.js +2 -62
- package/lib/types/CombatTechnique.d.ts +5 -0
- package/lib/types/CombatTechnique.js +4 -0
- package/lib/types/equipment/item/_Weapon.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.103.0](https://github.com/Optolith/database-schema/compare/v0.102.1...v0.103.0) (2026-10-15)
|
|
6
|
+
|
|
7
|
+
### ⚠ BREAKING CHANGES
|
|
8
|
+
|
|
9
|
+
* close combat technique can validate presence of attack modifier
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* close combat technique can validate presence of attack modifier ([e9cef1b](https://github.com/Optolith/database-schema/commit/e9cef1b22987ef4137588e666125c914f402a4f1))
|
|
14
|
+
* prepare future migration stages ([7719ecc](https://github.com/Optolith/database-schema/commit/7719eccbcb188c7bb2f9fcb377c598605d8855cc))
|
|
15
|
+
|
|
16
|
+
## [0.102.1](https://github.com/Optolith/database-schema/compare/v0.102.0...v0.102.1) (2026-10-15)
|
|
17
|
+
|
|
5
18
|
## [0.102.0](https://github.com/Optolith/database-schema/compare/v0.101.0...v0.102.0) (2026-10-15)
|
|
6
19
|
|
|
7
20
|
### ⚠ BREAKING CHANGES
|
package/gen/types.d.ts
CHANGED
|
@@ -5371,6 +5371,11 @@ export interface CloseCombatTechniqueTranslation {
|
|
|
5371
5371
|
* Special rules for the combat technique that apply to all weapons in this category.
|
|
5372
5372
|
*/
|
|
5373
5373
|
export interface CloseCombatTechniqueSpecialRules {
|
|
5374
|
+
/**
|
|
5375
|
+
* Do weapons of this combat technique have an attack modifier?
|
|
5376
|
+
*/
|
|
5377
|
+
hasAttackModifier: WeaponCombatTechniqueValueRule
|
|
5378
|
+
|
|
5374
5379
|
/**
|
|
5375
5380
|
* Is parrying possible with this combat technique?
|
|
5376
5381
|
*/
|
package/lib/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MigrationStage } from "tsondb";
|
|
1
2
|
import { Schema } from "tsondb/schema";
|
|
2
3
|
import type { ChildEntityMap, EntityMap, EnumMap, SingletonEntityMap, TypeAliasMap } from "../gen/types.js";
|
|
3
4
|
declare module "tsondb/schema/gen" {
|
|
@@ -17,3 +18,4 @@ export interface TSONDBTypes {
|
|
|
17
18
|
typeAliasMap: TypeAliasMap;
|
|
18
19
|
}
|
|
19
20
|
export declare const schema: Schema<TSONDBTypes>;
|
|
21
|
+
export declare const migrationStages: MigrationStage<TSONDBTypes>[];
|
package/lib/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "tsondb/schema";
|
|
2
2
|
import * as Types from "./types/index.js";
|
|
3
|
-
export const schema = new Schema([
|
|
3
|
+
export const schema = new Schema((await import("../package.json", { with: { type: "json" } })).default.version, [
|
|
4
4
|
Types.AdvancedCombatSpecialAbility,
|
|
5
5
|
Types.AdvancedKarmaSpecialAbility,
|
|
6
6
|
Types.AdvancedMagicalSpecialAbility,
|
|
@@ -179,64 +179,4 @@ export const schema = new Schema([
|
|
|
179
179
|
Types.WorkingSupernaturalCreature,
|
|
180
180
|
Types.ZibiljaRitual,
|
|
181
181
|
], Types.Locale);
|
|
182
|
-
|
|
183
|
-
// * A dictionary of cache types and their associated location.
|
|
184
|
-
// */
|
|
185
|
-
// export type CachePaths = {
|
|
186
|
-
// [K in keyof CacheMap]: string
|
|
187
|
-
// }
|
|
188
|
-
// export type CacheOptions = {
|
|
189
|
-
// /**
|
|
190
|
-
// * Whether to pretty-print the JSON. Default is `false`.
|
|
191
|
-
// */
|
|
192
|
-
// pretty?: boolean
|
|
193
|
-
// }
|
|
194
|
-
// /**
|
|
195
|
-
// * Builds the cache and writes it to the specified paths in JSON format.
|
|
196
|
-
// * @param cachePaths The absolute paths to write each cache to.
|
|
197
|
-
// * @param validResults The data to build the cache from. Usually the result of
|
|
198
|
-
// * `getAllValidData`.
|
|
199
|
-
// * @param options Configuration options for building the cache.
|
|
200
|
-
// */
|
|
201
|
-
// export const buildCache = async (
|
|
202
|
-
// cachePaths: CachePaths,
|
|
203
|
-
// validResults: ValidResults,
|
|
204
|
-
// options: CacheOptions = {}
|
|
205
|
-
// ): Promise<void> => {
|
|
206
|
-
// const { pretty = false } = options
|
|
207
|
-
// const activatableSelectOptionsCache = cacheMap.activatableSelectOptions.builder(validResults)
|
|
208
|
-
// const ancestorBloodAdvantagesCache = cacheMap.ancestorBloodAdvantages.builder(validResults)
|
|
209
|
-
// const magicalAndBlessedAdvantagesAndDisadvantagesCache =
|
|
210
|
-
// cacheMap.magicalAndBlessedAdvantagesAndDisadvantages.builder(validResults)
|
|
211
|
-
// const newApplicationsAndUsesCache = cacheMap.newApplicationsAndUses.builder(
|
|
212
|
-
// validResults,
|
|
213
|
-
// activatableSelectOptionsCache
|
|
214
|
-
// )
|
|
215
|
-
// const cacheData: CacheMap = {
|
|
216
|
-
// activatableSelectOptions: activatableSelectOptionsCache,
|
|
217
|
-
// ancestorBloodAdvantages: ancestorBloodAdvantagesCache,
|
|
218
|
-
// magicalAndBlessedAdvantagesAndDisadvantages: magicalAndBlessedAdvantagesAndDisadvantagesCache,
|
|
219
|
-
// newApplicationsAndUses: newApplicationsAndUsesCache,
|
|
220
|
-
// }
|
|
221
|
-
// for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
|
|
222
|
-
// await mkdir(dirname(cachePath), { recursive: true })
|
|
223
|
-
// await writeFile(
|
|
224
|
-
// cachePath,
|
|
225
|
-
// JSON.stringify(cacheData[cacheName as keyof CachePaths], null, pretty ? 2 : undefined),
|
|
226
|
-
// "utf-8"
|
|
227
|
-
// )
|
|
228
|
-
// }
|
|
229
|
-
// }
|
|
230
|
-
// /**
|
|
231
|
-
// * Reads the cache from the specified paths in JSON format.
|
|
232
|
-
// * @param cachePaths The absolute paths to read each cache from.
|
|
233
|
-
// * @returns
|
|
234
|
-
// */
|
|
235
|
-
// export const getCache = async (cachePaths: CachePaths): Promise<CacheMap> => {
|
|
236
|
-
// const cache: Partial<CacheMap> = {}
|
|
237
|
-
// for (const [cacheName, cachePath] of Object.entries(cachePaths)) {
|
|
238
|
-
// const cacheData = JSON.parse(await readFile(cachePath, "utf-8"))
|
|
239
|
-
// cache[cacheName as keyof CacheMap] = cacheData
|
|
240
|
-
// }
|
|
241
|
-
// return cache as CacheMap
|
|
242
|
-
// }
|
|
182
|
+
export const migrationStages = [];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as DB from "tsondb/schema/dsl";
|
|
2
2
|
export declare const CloseCombatTechnique: DB.Entity<"CloseCombatTechnique", {
|
|
3
3
|
special: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"CloseCombatTechniqueSpecialRules", DB.Object<{
|
|
4
|
+
hasAttackModifier: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"WeaponCombatTechniqueValueRule", {
|
|
5
|
+
Required: DB.EnumCase<null>;
|
|
6
|
+
Optional: DB.EnumCase<null>;
|
|
7
|
+
Prohibited: DB.EnumCase<null>;
|
|
8
|
+
}, []>>, true>;
|
|
4
9
|
can_parry: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"WeaponCombatTechniqueValueRule", {
|
|
5
10
|
Required: DB.EnumCase<null>;
|
|
6
11
|
Optional: DB.EnumCase<null>;
|
|
@@ -69,6 +69,10 @@ const CloseCombatTechniqueSpecialRules = DB.TypeAlias(import.meta.url, {
|
|
|
69
69
|
name: "CloseCombatTechniqueSpecialRules",
|
|
70
70
|
comment: "Special rules for the combat technique that apply to all weapons in this category.",
|
|
71
71
|
type: () => DB.Object({
|
|
72
|
+
hasAttackModifier: DB.Required({
|
|
73
|
+
comment: "Do weapons of this combat technique have an attack modifier?",
|
|
74
|
+
type: DB.IncludeIdentifier(WeaponCombatTechniqueValueRule),
|
|
75
|
+
}),
|
|
72
76
|
can_parry: DB.Required({
|
|
73
77
|
comment: "Is parrying possible with this combat technique?",
|
|
74
78
|
type: DB.IncludeIdentifier(WeaponCombatTechniqueValueRule),
|
|
@@ -62,6 +62,7 @@ export const checkWeaponCombatTechniqueIntegrity = ({ instanceContent, getInstan
|
|
|
62
62
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- integrity has been checked, it must be present
|
|
63
63
|
const ct = getInstanceById("CloseCombatTechnique", ctId);
|
|
64
64
|
return [
|
|
65
|
+
checkPart(ct.special.hasAttackModifier, meleeUse.attackModifier, "an attack modifier", "close", ctId),
|
|
65
66
|
checkPart(ct.special.can_parry, meleeUse.parryModifier, "a parry modifier", "close", ctId),
|
|
66
67
|
checkPart(ct.special.has_damage_threshold, meleeUse.damage_threshold, "a damage threshold", "close", ctId),
|
|
67
68
|
checkPart(ct.special.has_length, meleeUse.length, "a length", "close", ctId),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optolith/database-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
4
4
|
"description": "Definitions and utilities for the flat-file database of Optolith, a character creation tool for the Pen and Paper RPG “The Dark Eye 5”, and its external integrations into other software.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tde",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"license": "MPL-2.0",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@elyukai/utils": "^0.3.6",
|
|
42
|
-
"tsondb": "^0.
|
|
42
|
+
"tsondb": "^0.22.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@elyukai/oxc-config": "^0.1.0",
|