build(deps): migrate to @optolith/database-schema
This commit is contained in:
Generated
+13
-13
@@ -18,12 +18,12 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@optolith/database-schema": "^0.42.4",
|
||||
"@types/node": "^25.5.0",
|
||||
"commit-and-tag-version": "^12.7.1",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jsdoc": "^62.8.0",
|
||||
"globals": "^17.4.0",
|
||||
"optolith-database-schema": "^0.42.0",
|
||||
"prettier": "^3.8.1",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.9.3",
|
||||
@@ -862,6 +862,18 @@
|
||||
"integrity": "sha512-VMVn5k1WzpG99WblWOeuzwe4WOhVRhQr/KK8LL+p2IXSqIH/2rPyYOJjsW5rKcicEM2TiXKkx1kiJ3IUPz0DNQ==",
|
||||
"license": "MPL-2.0"
|
||||
},
|
||||
"node_modules/@optolith/database-schema": {
|
||||
"version": "0.42.4",
|
||||
"resolved": "https://registry.npmjs.org/@optolith/database-schema/-/database-schema-0.42.4.tgz",
|
||||
"integrity": "sha512-zpkvnCiXdCR9Y3fi8/iPERGyYWXH80TUIb5+eaT7Fi/U9AslFJvFZd1Bvd50TNlsbJNbXfsflgXrYQwuRcp95Q==",
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"@elyukai/utils": "^0.3.3",
|
||||
"tsondb": "^0.20.3",
|
||||
"yaml": "^2.8.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@optolith/helpers": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@optolith/helpers/-/helpers-0.2.2.tgz",
|
||||
@@ -3923,18 +3935,6 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/optolith-database-schema": {
|
||||
"version": "0.42.0",
|
||||
"resolved": "https://registry.npmjs.org/optolith-database-schema/-/optolith-database-schema-0.42.0.tgz",
|
||||
"integrity": "sha512-tRUyxhJg0Xv3Eqi5UAQXEEJLjqmFVXFq3G+u9bSAGzjrngqLbQW9JIJ3yncCDI9lCtWOA6JZibBP0XWBzog/HA==",
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"@elyukai/utils": "^0.3.3",
|
||||
"tsondb": "^0.20.3",
|
||||
"yaml": "^2.8.2"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||
|
||||
+1
-1
@@ -42,12 +42,12 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@optolith/database-schema": "^0.42.4",
|
||||
"@types/node": "^25.5.0",
|
||||
"commit-and-tag-version": "^12.7.1",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jsdoc": "^62.8.0",
|
||||
"globals": "^17.4.0",
|
||||
"optolith-database-schema": "^0.42.0",
|
||||
"prettier": "^3.8.1",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.9.3",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { isNotNullish } from "@elyukai/utils/nullable"
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import { schema } from "@optolith/database-schema"
|
||||
import { createCache, type IdMap as CacheIdMap } from "@optolith/database-schema/cache"
|
||||
import { deepEqual } from "@optolith/helpers/compare"
|
||||
import { MessageFormat } from "messageformat"
|
||||
import type { MessageValue } from "messageformat/functions"
|
||||
@@ -7,8 +9,6 @@ import { findPackageJSON } from "node:module"
|
||||
import { dirname, join } from "node:path"
|
||||
import { argv } from "node:process"
|
||||
import { parseArgs, styleText, type InspectColor, type ParseArgsOptionsConfig } from "node:util"
|
||||
import { schema } from "optolith-database-schema"
|
||||
import { createCache, type IdMap as CacheIdMap } from "optolith-database-schema/cache"
|
||||
import { TSONDB } from "tsondb"
|
||||
import { fromUniformCase } from "tsondb/schema/gen"
|
||||
import type { LocaleEnvironment } from "../lib/helpers/locale.js"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { isNotNullish } from "@elyukai/utils/nullable"
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import type { EntityMap } from "optolith-database-schema/gen"
|
||||
import type { EntityMap } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "./helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "./helpers/locale.js"
|
||||
import type {
|
||||
|
||||
@@ -3,12 +3,7 @@ import { count } from "@elyukai/utils/array/reductions"
|
||||
import { deepEqual } from "@elyukai/utils/equality"
|
||||
import { on } from "@elyukai/utils/function"
|
||||
import { isNotNullish } from "@elyukai/utils/nullable"
|
||||
import { numAsc } from "@optolith/helpers/compare"
|
||||
import { sign } from "@optolith/helpers/math"
|
||||
import { mapNullable, mapNullableDefault } from "@optolith/helpers/nullable"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { ResolvedSelectOption } from "optolith-database-schema/cache"
|
||||
import type { ResolvedSelectOption } from "@optolith/database-schema/cache"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
AdvancedSpecialAbility,
|
||||
@@ -40,7 +35,12 @@ import type {
|
||||
SelectOptions,
|
||||
SpecialRule,
|
||||
Volume,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { numAsc } from "@optolith/helpers/compare"
|
||||
import { sign } from "@optolith/helpers/math"
|
||||
import { mapNullable, mapNullableDefault } from "@optolith/helpers/nullable"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { Case, fromUniformCase } from "tsondb/schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetAllInstances, GetInstanceById } from "../helpers/getTypes.js"
|
||||
|
||||
@@ -20,7 +20,7 @@ import type {
|
||||
Rarity,
|
||||
Skill_ID,
|
||||
Weighted,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetAllChildInstancesForParent, GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { TranslationKeysWithoutParams } from "../helpers/translate.js"
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Dictionary } from "@elyukai/utils/dictionary"
|
||||
import { deepEqual } from "@elyukai/utils/equality"
|
||||
import { sign } from "@elyukai/utils/string/number"
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import type {
|
||||
AbilityAdjustment,
|
||||
ElectiveSpellworks,
|
||||
@@ -13,7 +12,8 @@ import type {
|
||||
RestrictedSpellworks,
|
||||
SpellworkAdjustment,
|
||||
SpellworkIdentifier,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type {
|
||||
GetAllChildInstancesForParent,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
AttributeTranslation,
|
||||
DerivedCharacteristicBase,
|
||||
DerivedCharacteristicTranslation,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { Translate, TranslateMap } from "../helpers/translate.js"
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
PublicationRefs,
|
||||
Reduceable,
|
||||
Resistance,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { LocaleMap, Translate, TranslateMap } from "../helpers/translate.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { mapNullable } from "@elyukai/utils/nullable"
|
||||
import { sign } from "@elyukai/utils/string/number"
|
||||
import type { ActivatableIdentifier, RatedIdentifier } from "optolith-database-schema/gen"
|
||||
import type { ActivatableIdentifier, RatedIdentifier } from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import { renderAlternativeNames, renderLaboratoryLevel } from "./partial/herbary.js"
|
||||
|
||||
@@ -5,7 +5,6 @@ import { compareNumber } from "@elyukai/utils/ordering"
|
||||
import { romanize } from "@elyukai/utils/roman"
|
||||
import { sign } from "@elyukai/utils/string/number"
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import type {
|
||||
AmmunitionishIdentifier,
|
||||
ArmorComplexity,
|
||||
@@ -52,7 +51,8 @@ import type {
|
||||
SecondaryArmorTranslation,
|
||||
StructurePoints,
|
||||
Weight,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { createEntityDescriptionCreator, type TaggedEntity } from "../creator.js"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { FormatNumber, LocaleCompare, LocaleJoin } from "../helpers/locale.js"
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
EquipmentIdentifier,
|
||||
EquipmentPackageItem,
|
||||
LocaleMeasurementAdjustments,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator, type TaggedEntity } from "../creator.js"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { Translate } from "../helpers/translate.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ActivatableIdentifier } from "optolith-database-schema/gen"
|
||||
import type { ActivatableIdentifier } from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetAllChildInstancesForParent, GetInstanceById } from "../helpers/getTypes.js"
|
||||
import { printInfluencePrerequisites } from "./partial/prerequisites/index.js"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type LiturgyTradition, type RatedIdentifier } from "@optolith/database-schema/gen"
|
||||
import type { Compare } from "@optolith/helpers/compare"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { type LiturgyTradition, type RatedIdentifier } from "optolith-database-schema/gen"
|
||||
import { Case } from "tsondb/schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetAllChildInstancesForParent, GetInstanceById } from "../helpers/getTypes.js"
|
||||
|
||||
@@ -3,14 +3,14 @@ import { ensureNonEmpty, isNotEmpty } from "@elyukai/utils/array/nonEmpty"
|
||||
import { deepEqual } from "@elyukai/utils/equality"
|
||||
import { identity, on } from "@elyukai/utils/function"
|
||||
import { isNotNullish } from "@elyukai/utils/nullable"
|
||||
import { mapObject } from "@optolith/helpers/object"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
ActivatableNameBuilderRules,
|
||||
RequirableSelectOptionIdentifier,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapObject } from "@optolith/helpers/object"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { LocaleMap, Translate, TranslateMap } from "../../helpers/translate.js"
|
||||
import type { GetResolvedSelectOptionById } from "./prerequisites/single/activatable.js"
|
||||
import { MISSING_VALUE } from "./unknown.js"
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { on } from "@elyukai/utils/function"
|
||||
import { unique } from "@optolith/helpers/array"
|
||||
import { deepEqual, numAsc } from "@optolith/helpers/compare"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
ResolvedSelectOption,
|
||||
ResolvedSelectOptionIdentifier,
|
||||
} from "optolith-database-schema/cache"
|
||||
} from "@optolith/database-schema/cache"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
AdventurePointsValue,
|
||||
SelectOptionsAdventurePointsValue,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { unique } from "@optolith/helpers/array"
|
||||
import { deepEqual, numAsc } from "@optolith/helpers/compare"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { GetAllInstances } from "../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../helpers/locale.js"
|
||||
import type { BaseActivatable, BaseActivatableTranslation } from "../activatable.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AnimalType_ID } from "optolith-database-schema/gen"
|
||||
import type { AnimalType_ID } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../helpers/getTypes.js"
|
||||
import type { LocaleCompare } from "../../helpers/locale.js"
|
||||
import type { Translate, TranslateMap } from "../../helpers/translate.js"
|
||||
@@ -21,9 +21,8 @@ export const renderAnimalTypesSection = (
|
||||
: animalTypes
|
||||
.map(
|
||||
animalTypeId =>
|
||||
translateMap(
|
||||
getInstanceById("AnimalType", animalTypeId)?.translations,
|
||||
)?.name ?? MISSING_VALUE,
|
||||
translateMap(getInstanceById("AnimalType", animalTypeId)?.translations)?.name ??
|
||||
MISSING_VALUE,
|
||||
)
|
||||
.toSorted(localeCompare)
|
||||
.join(", "),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { isNotEmpty } from "@elyukai/utils/array/nonEmpty"
|
||||
import { mapNullable } from "@elyukai/utils/nullable"
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import type { CommonnessRatedAdvantageDisadvantage } from "@optolith/database-schema/gen"
|
||||
import { ensureNonEmpty } from "@optolith/helpers/array"
|
||||
import type { CommonnessRatedAdvantageDisadvantage } from "optolith-database-schema/gen"
|
||||
import type { GetInstanceById } from "../../helpers/getTypes.js"
|
||||
import type { TranslateMap, TranslationKeysWithoutParams } from "../../helpers/translate.js"
|
||||
import type { RawDefinitionListEntityDescriptionSectionItem } from "../../index.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Dice } from "optolith-database-schema/gen"
|
||||
import type { Dice } from "@optolith/database-schema/gen"
|
||||
import type { Translate } from "../../helpers/translate.js"
|
||||
import { additionFormatter, subtractionFormatter } from "./mathOperation.js"
|
||||
|
||||
@@ -11,11 +11,7 @@ export const renderDice = (translate: Translate, dice: Dice) =>
|
||||
/**
|
||||
* Renders a dice expression with an additional flat modifier, like "2D6+3" or "2D6-1".
|
||||
*/
|
||||
export const renderDiceAndFlat = (
|
||||
translate: Translate,
|
||||
dice: Dice,
|
||||
flat: number | undefined,
|
||||
) =>
|
||||
export const renderDiceAndFlat = (translate: Translate, dice: Dice, flat: number | undefined) =>
|
||||
flat === undefined || flat === 0
|
||||
? renderDice(translate, dice)
|
||||
: flat > 0
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
ImprovementCost,
|
||||
RatedIdentifier,
|
||||
SkillWithEnhancementsIdentifier,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import type { RawEntityDescriptionSection } from "../../index.js"
|
||||
import { printEnhancementPrerequisites } from "./prerequisites/index.js"
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isNotEmpty } from "@elyukai/utils/array/nonEmpty"
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import type { AlternativeName, LaboratoryLevel, Resistance } from "optolith-database-schema/gen"
|
||||
import type { AlternativeName, LaboratoryLevel, Resistance } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../helpers/getTypes.js"
|
||||
import type { LocaleMap, Translate, TranslateMap } from "../../helpers/translate.js"
|
||||
import type { IdMap } from "../../index.js"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { mapNullableDefault } from "@elyukai/utils/nullable"
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import type { MapStyle, ResponsiveTextOptional } from "@optolith/database-schema/gen"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import type { MapStyle, ResponsiveTextOptional } from "optolith-database-schema/gen"
|
||||
import type { LocaleMap, Translate, TranslateMap } from "../../helpers/translate.js"
|
||||
import { type StdReader } from "./reader.js"
|
||||
import { getResponsiveTextOptional } from "./responsiveText.js"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { mapNullable } from "@elyukai/utils/nullable"
|
||||
import type { EntityMap } from "optolith-database-schema/gen"
|
||||
import type { EntityMap } from "@optolith/database-schema/gen"
|
||||
import { normalizedIdArgs, type IdArgsVariant } from "tsondb/schema/gen"
|
||||
import type { GetInstanceById } from "../../helpers/getTypes.js"
|
||||
import type { LocaleMap, TranslateMap } from "../../helpers/translate.js"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { MathOperation } from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { MathOperation } from "optolith-database-schema/gen"
|
||||
|
||||
type UnaryFormatter = (value: string | number) => string
|
||||
type BinaryFormatter = (left: string | number, right: string | number) => string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DisplayOption } from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { DisplayOption } from "optolith-database-schema/gen"
|
||||
import type { TranslateMap } from "../../../helpers/translate.js"
|
||||
import { MISSING_VALUE } from "../unknown.js"
|
||||
import type { PrerequisitePart } from "./part.js"
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { isNotEmpty } from "@elyukai/utils/array/nonEmpty"
|
||||
import { on } from "@elyukai/utils/function"
|
||||
import { mapNullable } from "@elyukai/utils/nullable"
|
||||
import { numAsc } from "@optolith/helpers/compare"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
AdvantageDisadvantagePrerequisites,
|
||||
@@ -30,7 +26,11 @@ import type {
|
||||
PublicationPrerequisites,
|
||||
RatedIdentifier,
|
||||
SpellworkPrerequisites,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { numAsc } from "@optolith/helpers/compare"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { GetAllChildInstancesForParent, GetInstanceById } from "../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../helpers/locale.js"
|
||||
import type { TranslateMap } from "../../../helpers/translate.js"
|
||||
|
||||
@@ -2,8 +2,8 @@ import { groupBy } from "@elyukai/utils/array/groups"
|
||||
import { deepEqual, equal } from "@elyukai/utils/equality"
|
||||
import { on } from "@elyukai/utils/function"
|
||||
import { compareNumber, reduceCompare, type Compare } from "@elyukai/utils/ordering"
|
||||
import type { ActivatableIdentifier, SentenceType } from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { ActivatableIdentifier, SentenceType } from "optolith-database-schema/gen"
|
||||
import { fromUniformCase } from "tsondb/schema/gen"
|
||||
import type { LocaleCompare } from "../../../helpers/locale.js"
|
||||
import type { Translate, TranslateMap } from "../../../helpers/translate.js"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
AdvantageDisadvantagePrerequisiteGroup,
|
||||
@@ -17,7 +16,8 @@ import type {
|
||||
PublicationPrerequisiteGroup,
|
||||
RatedIdentifier,
|
||||
SpellworkPrerequisiteGroup,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { GetAllChildInstancesForParent, GetInstanceById } from "../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../helpers/locale.js"
|
||||
import type { PrerequisitePart } from "./part.js"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type {
|
||||
ResolvedSelectOption,
|
||||
ResolvedSelectOptionIdentifier,
|
||||
} from "optolith-database-schema/cache"
|
||||
} from "@optolith/database-schema/cache"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
ActivatableNameBuilderRules,
|
||||
ActivatablePrerequisite,
|
||||
RequirableSelectOptionIdentifier,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import type { LocaleMap, Translate } from "../../../../helpers/translate.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { AnimistPowerPrerequisite } from "@optolith/database-schema/gen"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import type { AnimistPowerPrerequisite } from "optolith-database-schema/gen"
|
||||
import { type GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { printDisplayOption } from "../displayOption.js"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
BlessedTraditionPrerequisite,
|
||||
BlessedTraditionPrerequisiteRestriction,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { printDisplayOption } from "../displayOption.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CulturePrerequisite } from "optolith-database-schema/gen"
|
||||
import type { CulturePrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedNameFromSafeTranslation } from "../../markdown.js"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
EnhancementPrerequisite,
|
||||
SkillWithEnhancementsIdentifier,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import type { LocaleMap } from "../../../../helpers/translate.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { InfluencePrerequisite } from "optolith-database-schema/gen"
|
||||
import type { InfluencePrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { MISSING_VALUE } from "../../unknown.js"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
MagicalTraditionPrerequisite,
|
||||
MagicalTraditionPrerequisiteRestriction,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { printDisplayOption } from "../displayOption.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { PactPrerequisite } from "@optolith/database-schema/gen"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { romanize } from "@optolith/helpers/roman"
|
||||
import type { PactPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { MISSING_VALUE } from "../../unknown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PersonalityTraitPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { PersonalityTraitPrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedNameFromSafeTranslation } from "../../markdown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PrimaryAttributePrerequisite } from "optolith-database-schema/gen"
|
||||
import type { PrimaryAttributePrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { printDisplayOption } from "../displayOption.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ProfessionPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { ProfessionPrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetAllChildInstancesForParent } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedInstance } from "../../markdown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PublicationPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { PublicationPrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { printDisplayOption } from "../displayOption.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RacePrerequisite } from "optolith-database-schema/gen"
|
||||
import type { RacePrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedNameFromSafeTranslation } from "../../markdown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RatedPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { RatedPrerequisite } from "@optolith/database-schema/gen"
|
||||
import { type GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedCustomName } from "../../markdown.js"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
RatedMinimumNumberPrerequisite,
|
||||
RatedMinimumNumberPrerequisiteCombatTechniquesTargetGroup,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedName } from "../../markdown.js"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { RatedSumPrerequisite } from "@optolith/database-schema/gen"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import type { RatedSumPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedName } from "../../markdown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RulePrerequisite } from "optolith-database-schema/gen"
|
||||
import type { RulePrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { BinarySex, SexPrerequisite } from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { BinarySex, SexPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { Translate } from "../../../../helpers/translate.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
SexualCharacteristic,
|
||||
SexualCharacteristicPrerequisite,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { SocialStatusPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { SocialStatusPrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { printDisplayOption } from "../displayOption.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { StatePrerequisite } from "optolith-database-schema/gen"
|
||||
import type { StatePrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { GetInstanceById } from "../../../../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { attributedNameFromSafeTranslation } from "../../markdown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TextPrerequisite } from "optolith-database-schema/gen"
|
||||
import type { TextPrerequisite } from "@optolith/database-schema/gen"
|
||||
import type { LocaleEnvironment } from "../../../../helpers/locale.js"
|
||||
import { MISSING_VALUE } from "../../unknown.js"
|
||||
import type { PrerequisitePart } from "../part.js"
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { reduceWhile } from "@elyukai/utils/array/reductions"
|
||||
import { isNotNullish } from "@elyukai/utils/nullable"
|
||||
import type {
|
||||
Profession_ID,
|
||||
ProfessionPackage,
|
||||
} from "optolith-database-schema/gen"
|
||||
import type {
|
||||
GetAllChildInstancesForParent,
|
||||
GetAllInstances,
|
||||
} from "../../helpers/getTypes.js"
|
||||
import type { Profession_ID, ProfessionPackage } from "@optolith/database-schema/gen"
|
||||
import type { GetAllChildInstancesForParent, GetAllInstances } from "../../helpers/getTypes.js"
|
||||
import type { TranslateMap } from "../../helpers/translate.js"
|
||||
import type { IdMap } from "../../index.js"
|
||||
|
||||
@@ -37,8 +31,7 @@ export const getBaseProfessionPackageForCurriculum = (
|
||||
(_acc: { id: string; content: ProfessionPackage } | undefined, version) =>
|
||||
getChildInstancesForInstanceId("ProfessionPackage", version.id).find(
|
||||
professionPackage =>
|
||||
professionPackage.content.experience_level ===
|
||||
idMap.ExperienceLevel.Experienced,
|
||||
professionPackage.content.experience_level === idMap.ExperienceLevel.Experienced,
|
||||
),
|
||||
isNotNullish,
|
||||
undefined,
|
||||
@@ -54,6 +47,5 @@ export const getProfessionName = (
|
||||
professionId: Profession_ID,
|
||||
): string | undefined =>
|
||||
translateMap(
|
||||
getChildInstancesForInstanceId("ProfessionVersion", professionId)[0]
|
||||
?.content.translations,
|
||||
getChildInstancesForInstanceId("ProfessionVersion", professionId)[0]?.content.translations,
|
||||
)?.name.default
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
CastingTime,
|
||||
CastingTimeDuringLovemaking,
|
||||
@@ -12,7 +10,9 @@ import type {
|
||||
SkillModificationLevel_ID,
|
||||
SlowCastingTime,
|
||||
SlowSkillNonModifiableCastingTime,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { Case } from "../../../../helpers/enums.js"
|
||||
import { getInstanceByIdFnR, modifiableBySpeedR, type StdReader } from "../../reader.js"
|
||||
import { formatCombinedTimeSpanR, formatTimeSpanR } from "../../units/timeSpan.js"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { mapNullableDefault } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
CheckResultArithmetic,
|
||||
CheckResultBasedModifier,
|
||||
CheckResultValue,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapNullableDefault } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { divisionFormatter, multiplicationFormatter } from "../../mathOperation.js"
|
||||
import { translateR, type StdReader } from "../../reader.js"
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { identity } from "@elyukai/utils/function"
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
CheckResultBasedModifier,
|
||||
DurationUnitValue,
|
||||
@@ -19,7 +17,9 @@ import type {
|
||||
SkillModificationLevel_ID,
|
||||
SustainedCost,
|
||||
SustainedCostMap,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { type LocaleMap } from "../../../../helpers/translate.js"
|
||||
import { renderResponsiveMap } from "../../map.js"
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
CastingTimeDuringLovemaking,
|
||||
CheckResultBasedDuration,
|
||||
@@ -10,7 +8,9 @@ import type {
|
||||
MusicDuration,
|
||||
PermanentDuration,
|
||||
ResponsiveText,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { LocaleMap } from "../../../../helpers/translate.js"
|
||||
import {
|
||||
responsiveTextR,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActivatableSkillEffect } from "@optolith/database-schema/gen"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { ActivatableSkillEffect } from "optolith-database-schema/gen"
|
||||
import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js"
|
||||
import { translateFnR, type StdReader } from "../../reader.js"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import { diffWordsWithSpace } from "diff"
|
||||
import type {
|
||||
FastOneTimePerformanceParameters,
|
||||
FastSustainedPerformanceParameters,
|
||||
@@ -7,7 +6,8 @@ import type {
|
||||
ResponsiveTextOptional,
|
||||
SlowOneTimePerformanceParameters,
|
||||
SlowSustainedPerformanceParameters,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { diffWordsWithSpace } from "diff"
|
||||
import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js"
|
||||
import type { StdReader } from "../../reader.js"
|
||||
import { renderFastCastingTime, renderSlowCastingTime } from "./castingTime.js"
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
CheckResultBasedRange,
|
||||
FixedRange,
|
||||
@@ -8,7 +6,9 @@ import type {
|
||||
Range,
|
||||
RangeValue,
|
||||
SkillModificationLevel_ID,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import {
|
||||
getInstanceByIdFnR,
|
||||
modifiableBySpeedOptionalR,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
FastSkillModificationLevelConfig,
|
||||
SkillModificationLevel,
|
||||
SlowSkillModificationLevelConfig,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
|
||||
/**
|
||||
* The speed of an activatable skill.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
AffectedTargetCategories,
|
||||
SpecificAffectedTargetCategoryIdentifier,
|
||||
TargetCategory_ID,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js"
|
||||
import { getInstanceByIdFnR, translateMapR, translateR, type StdReader } from "../../reader.js"
|
||||
import { MISSING_VALUE } from "../../unknown.js"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ImprovementCost } from "optolith-database-schema/gen"
|
||||
import type { ImprovementCost } from "@optolith/database-schema/gen"
|
||||
import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../index.js"
|
||||
import { translateR, type StdReader } from "../reader.js"
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
SkillCheckPenalty as GeneralSkillCheckPenalty,
|
||||
MagicalRuneCombatTechniqueCheckPenalty,
|
||||
SkillCheck,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { type IdMap } from "../../../index.js"
|
||||
import {
|
||||
getInstanceByIdFnR,
|
||||
@@ -22,18 +22,14 @@ import { MISSING_VALUE } from "../unknown.js"
|
||||
*/
|
||||
export const renderSkillCheck = (
|
||||
check: SkillCheck,
|
||||
): StdReader<
|
||||
{ label: string; value: string },
|
||||
"t" | "tm" | "ibi",
|
||||
"Attribute"
|
||||
> =>
|
||||
): StdReader<{ label: string; value: string }, "t" | "tm" | "ibi", "Attribute"> =>
|
||||
Reader.asks(({ translate, translateMap, getInstanceById }) => ({
|
||||
label: translate("Check"),
|
||||
value: check
|
||||
.map(
|
||||
id =>
|
||||
translateMap(getInstanceById("Attribute", id)?.translations)
|
||||
?.abbreviation ?? MISSING_VALUE,
|
||||
translateMap(getInstanceById("Attribute", id)?.translations)?.abbreviation ??
|
||||
MISSING_VALUE,
|
||||
)
|
||||
.join("/"),
|
||||
}))
|
||||
@@ -84,13 +80,10 @@ const renderSkillCheckPenalty = (
|
||||
getToughnessTranslation().thenW(toughness =>
|
||||
responsiveThenR(
|
||||
() =>
|
||||
translateR(
|
||||
"{$first} or {$second}, depending on which value is higher",
|
||||
{
|
||||
first: spirit,
|
||||
second: toughness,
|
||||
},
|
||||
),
|
||||
translateR("{$first} or {$second}, depending on which value is higher", {
|
||||
first: spirit,
|
||||
second: toughness,
|
||||
}),
|
||||
() => Reader.of(`${spirit}/${toughness}`),
|
||||
),
|
||||
),
|
||||
@@ -125,11 +118,9 @@ export const renderSkillCheckWithPenalty = (
|
||||
: renderSkillCheck(check).thenW(checkText =>
|
||||
renderSkillCheckPenalty(idMap, checkPenalty)
|
||||
.then(penaltyText =>
|
||||
responsiveTranslateR(
|
||||
" (modified by {$modifier})",
|
||||
" (−{$modifier})",
|
||||
{ modifier: penaltyText },
|
||||
),
|
||||
responsiveTranslateR(" (modified by {$modifier})", " (−{$modifier})", {
|
||||
modifier: penaltyText,
|
||||
}),
|
||||
)
|
||||
.map(penaltyText => ({
|
||||
...checkText,
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
ResponsiveTextOptional,
|
||||
SkillModificationLevel,
|
||||
SlowSkillModificationLevelConfig,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import type { IdArgsVariant } from "tsondb/schema/gen"
|
||||
import type {
|
||||
GetAllChildInstancesForParent,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { identity } from "@elyukai/utils/function"
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type {
|
||||
ResponsiveText,
|
||||
ResponsiveTextOptional,
|
||||
ResponsiveTextReplace,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { type LocaleMap } from "../../helpers/translate.js"
|
||||
import { appendInParensIfNotEmpty } from "./rated/activatable/parensIf.js"
|
||||
import { responsiveTextOptionalR, responsiveTextR, translateMapR, type StdEnv } from "./reader.js"
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
PoisonSourceType,
|
||||
PoisonStart,
|
||||
RatedIdentifier,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { LocaleCompare, LocaleJoin } from "../helpers/locale.js"
|
||||
|
||||
@@ -53,7 +53,7 @@ import type {
|
||||
SkillSpecializationOptions,
|
||||
SkillWithEnhancementsIdentifier,
|
||||
VariantOptionAction,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { Case, fromUniformCase } from "tsondb/schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type {
|
||||
|
||||
@@ -13,7 +13,7 @@ import type {
|
||||
Culture_ID,
|
||||
RaceVariant,
|
||||
RaceVariantTranslation,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type {
|
||||
CountInstances,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ResolvedNewSkillApplication, ResolvedSkillUse } from "@optolith/database-schema/cache"
|
||||
import type { ActivatableIdentifier } from "@optolith/database-schema/gen"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { ResolvedNewSkillApplication, ResolvedSkillUse } from "optolith-database-schema/cache"
|
||||
import type { ActivatableIdentifier } from "optolith-database-schema/gen"
|
||||
import { fromUniformCase } from "tsondb/schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type {
|
||||
|
||||
@@ -4,9 +4,6 @@ import { Lazy } from "@elyukai/utils/lazy"
|
||||
import { compareNullish } from "@elyukai/utils/ordering"
|
||||
import { Reader } from "@elyukai/utils/reader"
|
||||
import { romanize } from "@elyukai/utils/roman"
|
||||
import { numAsc, type Compare } from "@optolith/helpers/compare"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import {
|
||||
type ActivatableIdentifier,
|
||||
type ActivatableSkillEffect,
|
||||
@@ -27,7 +24,10 @@ import {
|
||||
type RatedIdentifier,
|
||||
type SpellworkTraditions,
|
||||
type Tribe_ID,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import { numAsc, type Compare } from "@optolith/helpers/compare"
|
||||
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { Case } from "tsondb/schema/gen"
|
||||
import { createEntityDescriptionCreator } from "../creator.js"
|
||||
import type { GetAllChildInstancesForParent, GetInstanceById } from "../helpers/getTypes.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable jsdoc/require-jsdoc */
|
||||
|
||||
import type * as Database from "optolith-database-schema/gen"
|
||||
import type * as Database from "@optolith/database-schema/gen"
|
||||
import type { IdArgsVariant } from "tsondb/schema/gen"
|
||||
|
||||
export type GetInstanceById<in T extends Extract<keyof Database.EntityMap, string>> = <U extends T>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LocaleMeasurementAdjustments } from "@optolith/database-schema/gen"
|
||||
import type { Compare } from "@optolith/helpers/compare"
|
||||
import type { LocaleMeasurementAdjustments } from "optolith-database-schema/gen"
|
||||
import type { Format, Translate, TranslateMap } from "./translate.js"
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { assertExhaustive } from "@elyukai/utils/typeSafety"
|
||||
import type { Locale } from "optolith-database-schema/gen"
|
||||
import type { Locale } from "@optolith/database-schema/gen"
|
||||
import { ResponsiveTextSize } from "../entities/partial/responsiveText.js"
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
import type { TSONDBTypes } from "optolith-database-schema"
|
||||
import type { TSONDBTypes } from "@optolith/database-schema"
|
||||
import type {
|
||||
ResolvedNewSkillApplication,
|
||||
ResolvedSelectOption,
|
||||
ResolvedSkillUse,
|
||||
} from "optolith-database-schema/cache"
|
||||
} from "@optolith/database-schema/cache"
|
||||
import type {
|
||||
ActivatableIdentifier,
|
||||
Errata,
|
||||
PublicationRefs,
|
||||
Skill_ID,
|
||||
} from "optolith-database-schema/gen"
|
||||
} from "@optolith/database-schema/gen"
|
||||
import type { TSONDB } from "tsondb"
|
||||
import type { EntityDescriptionCreator } from "./creator.js"
|
||||
import { getActivatableEntityDescription } from "./entities/activatable.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { PublicationRefs } from "@optolith/database-schema/gen"
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { PublicationRefs } from "optolith-database-schema/gen"
|
||||
import type { GetInstanceById } from "../helpers/getTypes.js"
|
||||
import type { LocaleEnvironment } from "../helpers/locale.js"
|
||||
import { fromRawPageRange, normalizePageRanges, printPageRanges } from "./pageRange.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Page } from "@optolith/database-schema/gen"
|
||||
import type { Compare } from "@optolith/helpers/compare"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import type { Page } from "optolith-database-schema/gen"
|
||||
import type { Translate } from "../helpers/translate.js"
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Page, PageRange as RawPageRange } from "@optolith/database-schema/gen"
|
||||
import { range } from "@optolith/helpers/array"
|
||||
import type { Page, PageRange as RawPageRange } from "optolith-database-schema/gen"
|
||||
import type { Translate } from "../helpers/translate.js"
|
||||
import { comparePage, equalsPage, printPage, succ } from "./page.js"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { MathOperation } from "@optolith/database-schema/gen"
|
||||
import assert from "node:assert/strict"
|
||||
import { describe, it } from "node:test"
|
||||
import type { MathOperation } from "optolith-database-schema/gen"
|
||||
import { Case } from "tsondb/schema/gen"
|
||||
import { renderMathOperation } from "../../../src/entities/partial/mathOperation.js"
|
||||
|
||||
@@ -25,10 +25,10 @@ describe("renderMathOperation", () => {
|
||||
"Multiplication",
|
||||
[MathOperation<number>, MathOperation<number>]
|
||||
>("Multiplication", [
|
||||
Case<"Addition", [MathOperation<number>, MathOperation<number>]>(
|
||||
"Addition",
|
||||
[Case("Value", 1), Case("Value", 2)],
|
||||
),
|
||||
Case<"Addition", [MathOperation<number>, MathOperation<number>]>("Addition", [
|
||||
Case("Value", 1),
|
||||
Case("Value", 2),
|
||||
]),
|
||||
Case("Value", 3),
|
||||
])
|
||||
const result = renderMathOperation(operation, String)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Page } from "@optolith/database-schema/gen"
|
||||
import assert from "assert/strict"
|
||||
import { describe, it } from "node:test"
|
||||
import type { Page } from "optolith-database-schema/gen"
|
||||
import {
|
||||
fromRawPageRange,
|
||||
normalizePageRanges,
|
||||
|
||||
Reference in New Issue
Block a user