optolith-database-schema 0.15.2 → 0.15.3

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.
@@ -0,0 +1,3 @@
1
+ semi: false
2
+ arrowParens: avoid
3
+ printWidth: 100
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.15.3](https://github.com/elyukai/optolith-database-schema/compare/v0.15.2...v0.15.3) (2024-01-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * **cache:** add ancestor blood advantages list as cache ([8f06497](https://github.com/elyukai/optolith-database-schema/commit/8f0649704670264a10acd4985311345b8f80c45a))
11
+
5
12
  ### [0.15.2](https://github.com/elyukai/optolith-database-schema/compare/v0.15.1...v0.15.2) (2024-01-08)
6
13
 
7
14
 
@@ -0,0 +1,5 @@
1
+ import type { CacheConfig } from "../cacheConfig.js";
2
+ export type AncestorBloodAdvantagesCache = {
3
+ ids: number[];
4
+ };
5
+ export declare const config: CacheConfig<AncestorBloodAdvantagesCache>;
@@ -0,0 +1,18 @@
1
+ export const config = {
2
+ builder(database) {
3
+ return {
4
+ ids: database.advantages
5
+ .filter(([id, advantage]) => advantage.prerequisites?.some(p => {
6
+ switch (p.prerequisite.tag) {
7
+ case "Single":
8
+ return p.prerequisite.single.tag === "NoOtherAncestorBloodAdvantage";
9
+ case "Disjunction":
10
+ return p.prerequisite.disjunction.list.some(d => d.tag === "NoOtherAncestorBloodAdvantage");
11
+ case "Group":
12
+ return p.prerequisite.group.list.some(g => g.tag === "NoOtherAncestorBloodAdvantage");
13
+ }
14
+ }))
15
+ .map(([id]) => id),
16
+ };
17
+ },
18
+ };
@@ -39,6 +39,7 @@ export const config = {
39
39
  }
40
40
  }
41
41
  };
42
+ // prettier-ignore
42
43
  const entries = [
43
44
  [database.advancedCombatSpecialAbilities, n => ({ tag: "AdvancedCombatSpecialAbility", advanced_combat_special_ability: n })],
44
45
  [database.advancedKarmaSpecialAbilities, n => ({ tag: "AdvancedKarmaSpecialAbility", advanced_karma_special_ability: n })],
@@ -63,5 +64,5 @@ export const config = {
63
64
  });
64
65
  });
65
66
  return cache;
66
- }
67
+ },
67
68
  };
@@ -1,7 +1,10 @@
1
+ import * as AncestorBloodAdvantages from "../cache/ancestorBloodAdvantages.js";
1
2
  import * as NewApplicationsAndUses from "../cache/newApplicationsAndUses.js";
2
3
  export type CacheMap = {
4
+ ancestorBloodAdvantages: AncestorBloodAdvantages.AncestorBloodAdvantagesCache;
3
5
  newApplicationsAndUses: NewApplicationsAndUses.NewApplicationsAndUsesCache;
4
6
  };
5
7
  export declare const cacheMap: {
8
+ ancestorBloodAdvantages: import("../cacheConfig.js").CacheConfig<AncestorBloodAdvantages.AncestorBloodAdvantagesCache>;
6
9
  newApplicationsAndUses: import("../cacheConfig.js").CacheConfig<NewApplicationsAndUses.NewApplicationsAndUsesCache>;
7
10
  };
@@ -1,4 +1,6 @@
1
+ import * as AncestorBloodAdvantages from "../cache/ancestorBloodAdvantages.js";
1
2
  import * as NewApplicationsAndUses from "../cache/newApplicationsAndUses.js";
2
3
  export const cacheMap = {
3
- newApplicationsAndUses: NewApplicationsAndUses.config
4
+ ancestorBloodAdvantages: AncestorBloodAdvantages.config,
5
+ newApplicationsAndUses: NewApplicationsAndUses.config,
4
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optolith-database-schema",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
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",