build(gen): migrate config schema building to generator
This commit is contained in:
@@ -1,131 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "Schema/Config/Config.l10n.schema.json",
|
||||
"$ref": "#/definitions/Config",
|
||||
"definitions": {
|
||||
"Config": {
|
||||
"title": "RawConfig",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"herolistSortOrder": {
|
||||
"enum": ["name", "datemodified", "dateModified"]
|
||||
},
|
||||
"herolistVisibilityFilter": {
|
||||
"enum": ["all", "own", "shared"]
|
||||
},
|
||||
"racesSortOrder": {
|
||||
"enum": ["name", "cost"]
|
||||
},
|
||||
"racesValueVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"culturesSortOrder": {
|
||||
"enum": ["name", "cost"]
|
||||
},
|
||||
"culturesVisibilityFilter": {
|
||||
"enum": ["all", "common"]
|
||||
},
|
||||
"culturesValueVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"professionsSortOrder": {
|
||||
"enum": ["name", "cost"]
|
||||
},
|
||||
"professionsVisibilityFilter": {
|
||||
"enum": ["all", "common"]
|
||||
},
|
||||
"professionsFromExpansionsVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"professionsGroupVisibilityFilter": {
|
||||
"enum": [0, 1, 2, 3]
|
||||
},
|
||||
"advantagesDisadvantagesCultureRatingVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"talentsSortOrder": {
|
||||
"enum": ["name", "group", "ic"]
|
||||
},
|
||||
"talentsCultureRatingVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"combatTechniquesSortOrder": {
|
||||
"enum": ["name", "group", "ic"]
|
||||
},
|
||||
"specialAbilitiesSortOrder": {
|
||||
"enum": ["name", "group", "groupname"]
|
||||
},
|
||||
"spellsSortOrder": {
|
||||
"enum": ["name", "group", "property", "ic"]
|
||||
},
|
||||
"spellsUnfamiliarVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"liturgiesSortOrder": {
|
||||
"enum": ["name", "group", "ic"]
|
||||
},
|
||||
"equipmentSortOrder": {
|
||||
"enum": ["name", "groupname", "where", "weight"]
|
||||
},
|
||||
"equipmentGroupVisibilityFilter": {
|
||||
"type": "integer"
|
||||
},
|
||||
"sheetCheckAttributeValueVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"sheetUseParchment": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"sheetZoomFactor": {
|
||||
"type": "number"
|
||||
},
|
||||
"enableActiveItemHints": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"locale": {
|
||||
"type": "string"
|
||||
},
|
||||
"fallbackLocale": {
|
||||
"type": "string"
|
||||
},
|
||||
"theme": {
|
||||
"enum": ["light", "dark"]
|
||||
},
|
||||
"enableEditingHeroAfterCreationPhase": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"meleeItemTemplatesCombatTechniqueFilter": {
|
||||
"type": "string"
|
||||
},
|
||||
"rangedItemTemplatesCombatTechniqueFilter": {
|
||||
"type": "string"
|
||||
},
|
||||
"enableAnimations": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"herolistSortOrder",
|
||||
"herolistVisibilityFilter",
|
||||
"racesSortOrder",
|
||||
"culturesSortOrder",
|
||||
"culturesVisibilityFilter",
|
||||
"professionsSortOrder",
|
||||
"professionsVisibilityFilter",
|
||||
"professionsGroupVisibilityFilter",
|
||||
"advantagesDisadvantagesCultureRatingVisibility",
|
||||
"talentsSortOrder",
|
||||
"talentsCultureRatingVisibility",
|
||||
"combatTechniquesSortOrder",
|
||||
"specialAbilitiesSortOrder",
|
||||
"spellsSortOrder",
|
||||
"spellsUnfamiliarVisibility",
|
||||
"liturgiesSortOrder",
|
||||
"equipmentSortOrder",
|
||||
"equipmentGroupVisibilityFilter",
|
||||
"enableActiveItemHints"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// @ts-check
|
||||
import { join } from "node:path"
|
||||
import { jsonSchema } from "optolith-tsjsonschemamd/renderers"
|
||||
|
||||
/** @type {import("optolith-tsjsonschemamd").GeneratorOptions} */
|
||||
export default {
|
||||
sourceDir: join("src", "shared", "schema"),
|
||||
outputs: [
|
||||
{
|
||||
targetDir: join("src", "assets", "schema"),
|
||||
renderer: jsonSchema({ spec: "Draft_07" }),
|
||||
}
|
||||
],
|
||||
clean: true,
|
||||
verbose: false
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft-07/schema",
|
||||
"$id": "/config.schema.json",
|
||||
"$ref": "#/definitions/Config",
|
||||
"definitions": {
|
||||
"Config": {
|
||||
"description": "The user-configurable app-wide settings.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"locale": {
|
||||
"type": "string"
|
||||
},
|
||||
"fallbackLocale": {
|
||||
"type": "string"
|
||||
},
|
||||
"herolistSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "datemodified"
|
||||
},
|
||||
{
|
||||
"const": "dateModified"
|
||||
}
|
||||
]
|
||||
},
|
||||
"herolistVisibilityFilter": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "all"
|
||||
},
|
||||
{
|
||||
"const": "own"
|
||||
},
|
||||
{
|
||||
"const": "shared"
|
||||
}
|
||||
]
|
||||
},
|
||||
"racesSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "cost"
|
||||
}
|
||||
]
|
||||
},
|
||||
"racesValueVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"culturesSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "cost"
|
||||
}
|
||||
]
|
||||
},
|
||||
"culturesVisibilityFilter": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "all"
|
||||
},
|
||||
{
|
||||
"const": "common"
|
||||
}
|
||||
]
|
||||
},
|
||||
"culturesValueVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"professionsSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "cost"
|
||||
}
|
||||
]
|
||||
},
|
||||
"professionsVisibilityFilter": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "all"
|
||||
},
|
||||
{
|
||||
"const": "common"
|
||||
}
|
||||
]
|
||||
},
|
||||
"professionsGroupVisibilityFilter": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": 0
|
||||
},
|
||||
{
|
||||
"const": 1
|
||||
},
|
||||
{
|
||||
"const": 2
|
||||
},
|
||||
{
|
||||
"const": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"professionsFromExpansionsVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"advantagesDisadvantagesCultureRatingVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"talentsSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "group"
|
||||
},
|
||||
{
|
||||
"const": "ic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"talentsCultureRatingVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"combatTechniquesSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "group"
|
||||
},
|
||||
{
|
||||
"const": "ic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"specialAbilitiesSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "group"
|
||||
},
|
||||
{
|
||||
"const": "groupname"
|
||||
}
|
||||
]
|
||||
},
|
||||
"spellsSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "group"
|
||||
},
|
||||
{
|
||||
"const": "property"
|
||||
},
|
||||
{
|
||||
"const": "ic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"spellsUnfamiliarVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"liturgiesSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "group"
|
||||
},
|
||||
{
|
||||
"const": "ic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"equipmentSortOrder": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "name"
|
||||
},
|
||||
{
|
||||
"const": "groupname"
|
||||
},
|
||||
{
|
||||
"const": "where"
|
||||
},
|
||||
{
|
||||
"const": "weight"
|
||||
}
|
||||
]
|
||||
},
|
||||
"equipmentGroupVisibilityFilter": {
|
||||
"type": "number"
|
||||
},
|
||||
"sheetCheckAttributeValueVisibility": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"sheetUseParchment": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"sheetZoomFactor": {
|
||||
"type": "number"
|
||||
},
|
||||
"enableActiveItemHints": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"theme": {
|
||||
"oneOf": [
|
||||
{
|
||||
"const": "light"
|
||||
},
|
||||
{
|
||||
"const": "dark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"enableEditingHeroAfterCreationPhase": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"meleeItemTemplatesCombatTechniqueFilter": {
|
||||
"type": "string"
|
||||
},
|
||||
"rangedItemTemplatesCombatTechniqueFilter": {
|
||||
"type": "string"
|
||||
},
|
||||
"enableAnimations": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"herolistSortOrder",
|
||||
"herolistVisibilityFilter",
|
||||
"racesSortOrder",
|
||||
"culturesSortOrder",
|
||||
"culturesVisibilityFilter",
|
||||
"professionsSortOrder",
|
||||
"professionsVisibilityFilter",
|
||||
"professionsGroupVisibilityFilter",
|
||||
"advantagesDisadvantagesCultureRatingVisibility",
|
||||
"talentsSortOrder",
|
||||
"talentsCultureRatingVisibility",
|
||||
"combatTechniquesSortOrder",
|
||||
"specialAbilitiesSortOrder",
|
||||
"spellsSortOrder",
|
||||
"spellsUnfamiliarVisibility",
|
||||
"liturgiesSortOrder",
|
||||
"equipmentSortOrder",
|
||||
"equipmentGroupVisibilityFilter",
|
||||
"enableActiveItemHints"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,13 @@
|
||||
export interface RawConfig {
|
||||
/**
|
||||
* @main Config
|
||||
*/
|
||||
|
||||
/**
|
||||
* The user-configurable app-wide settings.
|
||||
*/
|
||||
export type Config = {
|
||||
locale?: string
|
||||
fallbackLocale?: string
|
||||
herolistSortOrder: "name" | "datemodified" | "dateModified"
|
||||
herolistVisibilityFilter: "all" | "own" | "shared"
|
||||
racesSortOrder: "name" | "cost"
|
||||
@@ -24,8 +33,6 @@ export interface RawConfig {
|
||||
sheetUseParchment?: boolean
|
||||
sheetZoomFactor?: number
|
||||
enableActiveItemHints: boolean
|
||||
locale?: string
|
||||
fallbackLocale?: string
|
||||
theme?: "light" | "dark"
|
||||
enableEditingHeroAfterCreationPhase?: boolean
|
||||
meleeItemTemplatesCombatTechniqueFilter?: string
|
||||
Reference in New Issue
Block a user