From f5216d0f610494f6f9885ae214a6799fa997dd52 Mon Sep 17 00:00:00 2001 From: "alxjrvs@gmail.com" Date: Wed, 4 Dec 2024 01:56:23 -0500 Subject: [PATCH] WIP --- src/faces/customFacesD.ts | 2 +- src/faces/types.ts | 2 +- ...customFacesNotationToCustomFacesRollConfig.ts | 2 +- src/faces/validateCustomFacesNotation.ts | 3 +-- src/tower/__tests__/roll.test.ts | 2 +- src/tower/__tests__/utils/applyModifiers.test.ts | 2 +- .../utils/argumentToRollParameters.test.ts | 2 +- src/tower/guards.ts | 2 +- src/tower/types.ts | 2 +- src/tower/utils/argumentToRollConfig.ts | 2 +- src/tower/utils/argumentToRollParameters.ts | 2 +- tsconfig.json | 16 +++++++++++----- 12 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/faces/customFacesD.ts b/src/faces/customFacesD.ts index 2e05332f..6cee986c 100644 --- a/src/faces/customFacesD.ts +++ b/src/faces/customFacesD.ts @@ -1,6 +1,6 @@ import { resultToFaces } from './utils/resultToFaces' import { CustomFacesRollConfig } from './types' -import { D } from '~src/dice/D' +import { D } from '~dice' export class CustomFacesD { public sides: number diff --git a/src/faces/types.ts b/src/faces/types.ts index 39b2bc2b..bcaee96d 100644 --- a/src/faces/types.ts +++ b/src/faces/types.ts @@ -1,5 +1,5 @@ import { RollConfig } from '~src/types' -import { NotationValidationResult } from '~src/notation/types' +import { NotationValidationResult } from '~notation' import { RollArgument } from '~src/tower/types' import { CustomFacesD } from './customFacesD' diff --git a/src/faces/utils/customFacesNotationToCustomFacesRollConfig.ts b/src/faces/utils/customFacesNotationToCustomFacesRollConfig.ts index 10e602a3..346c3ee5 100644 --- a/src/faces/utils/customFacesNotationToCustomFacesRollConfig.ts +++ b/src/faces/utils/customFacesNotationToCustomFacesRollConfig.ts @@ -1,4 +1,4 @@ -import { isDiceNotation } from '~src/notation/guards' +import { isDiceNotation } from '~notation' import { DiceNotation } from '~src/types' import { argumentToRollConfig } from '~src/tower/utils/argumentToRollConfig' import { customCoreNotationPattern } from '../patterns' diff --git a/src/faces/validateCustomFacesNotation.ts b/src/faces/validateCustomFacesNotation.ts index 6da9612c..43914e32 100644 --- a/src/faces/validateCustomFacesNotation.ts +++ b/src/faces/validateCustomFacesNotation.ts @@ -1,10 +1,9 @@ -import { NotationValidationResult } from '~src/notation/types' import { isCustomFacesDiceNotation } from './guards' import { CustomFacesNotationValidationResult } from './types' import { customConfigToCustomFacesNotation } from './utils/customFacesConfigToCustomFacesNotation' import { customFacesConfigToDescriptions } from './utils/customFacesConfigToDescription' import { customFacesNotationToCustomFacesRollConfig } from './utils/customFacesNotationToCustomFacesRollConfig' -import { validateNotation } from '~src/notation/validateNotation' +import { validateNotation, NotationValidationResult } from '~notation' export function validateCustomFacesNotation( arg: string diff --git a/src/tower/__tests__/roll.test.ts b/src/tower/__tests__/roll.test.ts index 6eadc96e..c3184379 100644 --- a/src/tower/__tests__/roll.test.ts +++ b/src/tower/__tests__/roll.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'bun:test' import { roll } from '../roll' -import { D } from '~src/dice/D' +import { D } from '~dice' const loops = 9999 diff --git a/src/tower/__tests__/utils/applyModifiers.test.ts b/src/tower/__tests__/utils/applyModifiers.test.ts index 984506fe..4a33b885 100644 --- a/src/tower/__tests__/utils/applyModifiers.test.ts +++ b/src/tower/__tests__/utils/applyModifiers.test.ts @@ -1,6 +1,6 @@ import { describe, expect, spyOn, test } from 'bun:test' import { Modifiers } from '~src/types' -import { D } from '~src/dice/D' +import { D } from '~dice' import { RollParameters } from '~src/tower/types' import { applyModifiers, diff --git a/src/tower/__tests__/utils/argumentToRollParameters.test.ts b/src/tower/__tests__/utils/argumentToRollParameters.test.ts index 87d20eb1..893bc7e5 100644 --- a/src/tower/__tests__/utils/argumentToRollParameters.test.ts +++ b/src/tower/__tests__/utils/argumentToRollParameters.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'bun:test' -import { D } from '~src/dice/D' +import { D } from '~dice' import { DiceNotation } from '~src/types' import { argumentToRollParameters } from '~src/tower/utils/argumentToRollParameters' diff --git a/src/tower/guards.ts b/src/tower/guards.ts index f74216be..97835434 100644 --- a/src/tower/guards.ts +++ b/src/tower/guards.ts @@ -1,4 +1,4 @@ -import { D } from '~src/dice/D' +import { D } from '~dice' import { RollConfigArgument } from './types' export function isD(arg: unknown): arg is D { diff --git a/src/tower/types.ts b/src/tower/types.ts index 48f0c967..323acae9 100644 --- a/src/tower/types.ts +++ b/src/tower/types.ts @@ -1,5 +1,5 @@ import { RollConfig } from '~src/types' -import { D } from '~src/dice/D' +import { D } from '~dice' import { DiceNotation } from '~src/types' export interface RollConfigArgument extends Partial { diff --git a/src/tower/utils/argumentToRollConfig.ts b/src/tower/utils/argumentToRollConfig.ts index 36a2f057..d17d0f79 100644 --- a/src/tower/utils/argumentToRollConfig.ts +++ b/src/tower/utils/argumentToRollConfig.ts @@ -1,7 +1,7 @@ import { RollConfig } from '~src/types' import { isRollConfigArgument, isD } from '../guards' import { RollArgument } from '../types' -import { isDiceNotation } from '~src/notation/guards' +import { isDiceNotation } from '~notation' import { notationToRollConfig } from '~src/utils/notationToRollConfig' export function argumentToRollConfig(argument: RollArgument): RollConfig { diff --git a/src/tower/utils/argumentToRollParameters.ts b/src/tower/utils/argumentToRollParameters.ts index 9dd1dbdc..4e665017 100644 --- a/src/tower/utils/argumentToRollParameters.ts +++ b/src/tower/utils/argumentToRollParameters.ts @@ -1,4 +1,4 @@ -import { D } from '~src/dice/D' +import { D } from '~dice' import { isD } from '../guards' import { RollArgument, RollParameters } from '../types' import { argumentToRollConfig } from './argumentToRollConfig' diff --git a/tsconfig.json b/tsconfig.json index 245dc7b5..021806ca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,20 @@ { "compilerOptions": { "paths": { - "~models": [ - "./src/models/index.ts" - ], "~patterns": [ "./src/patterns.ts" ], - "~guards": [ - "./src/guards.ts" + "~tower": [ + "./src/tower/index.ts" + ], + "~dice": [ + "./src/dice/index.ts" + ], + "~faces": [ + "./src/faces/index.ts" + ], + "~notation": [ + "./src/notation/index.ts" ], "~src/*": [ "./src/*"