Skip to content

Commit

Permalink
Fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
alxjrvs committed Dec 4, 2024
1 parent 76c3ba0 commit 2368b73
Show file tree
Hide file tree
Showing 28 changed files with 29 additions and 46 deletions.
8 changes: 1 addition & 7 deletions build.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import dts from 'bun-plugin-dts'

const results = await Bun.build({
entrypoints: [
'./src/core/index.ts',
'./src/dice/index.ts',
'./src/faces/index.ts',
'./src/notation/index.ts',
'./src/tower/index.ts'
],
entrypoints: ['./src/index.ts'],
outdir: './dist',
splitting: true,
sourcemap: 'inline',
Expand Down
1 change: 0 additions & 1 deletion src/core/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/core/utils/rollDicePools.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/dice/D.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { coreRandom } from '~src/core/utils/coreRandom'
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'
import { coreRandom } from '~src/utils/coreRandom'

export class D {
constructor(public sides: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/faces/rollCustomFaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
CustomFacesDicePools
} from './types'
import { argumentToCustomFacesRollParameters } from './utils/argumentToCustomFacesRollParameters'
import { rollDicePools } from '~src/core/utils/rollDicePools'
import { rollDicePools } from '~src/utils/rollDicePools'

export function rollCustomFaces(
...args: CustomFacesRollArgument[]
Expand Down
2 changes: 1 addition & 1 deletion src/faces/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'
import { NotationValidationResult } from '~src/notation/types'
import { RollArgument } from '~src/tower/types'
import type { CustomFacesD } from './customFacesD'
Expand Down
4 changes: 2 additions & 2 deletions src/faces/utils/customFacesConfigToDescription.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatCoreDescriptions } from '~src/core/utils/configToDescription'
import type { CustomFacesRollConfig } from '../types'
import { formatCoreDescriptions } from '~src/utils/configToDescription'
import { CustomFacesRollConfig } from '../types'

export function customFacesConfigToDescriptions({
quantity,
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './types'
export * from './dice'
export * from './notation'
export * from './tower'
export * from './faces'
2 changes: 1 addition & 1 deletion src/notation/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'

export interface NotationValidationResult<V = boolean> {
valid: V
Expand Down
2 changes: 1 addition & 1 deletion src/notation/utils/configToNotation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
formatModifierNotation
} from './notationFormatters'
import type { DiceNotation } from '../../types'
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'

export function configToNotation(options: RollConfig): DiceNotation {
return `${formatCoreNotation(options)}${formatModifierNotation(options)}`
Expand Down
2 changes: 1 addition & 1 deletion src/notation/utils/configToNotation/notationFormatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RerollOptions,
UniqueOptions,
RollConfig
} from '~src/core/types'
} from '~src/types'
import { DiceNotation } from '~src/notation/types'

function capNotation(cap: GreaterLessOptions) {
Expand Down
2 changes: 1 addition & 1 deletion src/notation/utils/notationToRollConfig/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parseCoreNotation, parseModifiers } from './optionsParsers'
import { coreNotationPattern } from '../../patterns'
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'
import { DiceNotation } from '~src/notation/types'

export function notationToRollConfig(notationString: DiceNotation): RollConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/notation/utils/notationToRollConfig/optionsParsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Modifiers,
RequiredCoreDiceParameters,
RerollOptions
} from '~src/core/types'
} from '~src/types'
import {
dropHighestPattern,
dropLowestPattern,
Expand Down
2 changes: 1 addition & 1 deletion src/notation/validateNotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isDiceNotation } from './guards'
import { NotationValidationResult } from './types'
import { notationToRollConfig } from './utils/notationToRollConfig'
import { configToNotation } from './utils/configToNotation'
import { configToDescription } from '~src/core/utils/configToDescription'
import { configToDescription } from '~src/utils/configToDescription'

function validateNotation(arg: string): NotationValidationResult {
if (!isDiceNotation(arg)) {
Expand Down
2 changes: 1 addition & 1 deletion src/tower/__tests__/utils/applyModifiers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, spyOn, test } from 'bun:test'
import { Modifiers } from '~src/core/types'
import { Modifiers } from '~src/types'
import { D } from '~src/dice/D'
import { RollParameters } from '~src/tower/types'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/tower/roll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { v4 as uuid } from 'uuid'
import type { DicePools, RollArgument, RollResult } from './types'
import { applyModifiers, calculateTotal } from './utils/applyModifiers'
import { argumentToRollParameters } from './utils/argumentToRollParameters'
import { rollDicePools } from '~src/core/utils/rollDicePools'
import { rollDicePools } from '~src/utils/rollDicePools'

export function roll(...args: RollArgument[]): RollResult {
const dicePools = args.reduce(
Expand Down
2 changes: 1 addition & 1 deletion src/tower/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'
import { D } from '~src/dice/D'
import { DiceNotation } from '~src/notation/types'

Expand Down
2 changes: 1 addition & 1 deletion src/tower/utils/applyModifiers/modifierApplicators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ReplaceOptions,
RequiredCoreDiceParameters,
RerollOptions
} from '~src/core/types'
} from '~src/types'

export class InvalidUniqueError extends Error {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/tower/utils/argumentToRollConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RollConfig } from '~src/core/types'
import { RollConfig } from '~src/types'
import { isRollConfigArgument, isD } from '../guards'
import type { RollArgument } from '../types'
import { isDiceNotation } from '~src/notation/guards'
Expand Down
2 changes: 1 addition & 1 deletion src/tower/utils/argumentToRollParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isD } from '../guards'
import type { RollArgument, RollParameters } from '../types'
import { argumentToRollConfig } from './argumentToRollConfig'
import { configToNotation } from '~src/notation/utils/configToNotation'
import { configToDescription } from '~src/core/utils/configToDescription'
import { configToDescription } from '~src/utils/configToDescription'

export function argumentToRollParameters(
argument: RollArgument
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'bun:test'
import { configToDescription } from '~src/core/utils/configToDescription'
import { configToDescription } from '../configToDescription'

describe('configToDescription', () => {
test('returns an array strings matching the constraints', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'bun:test'
import { coreRandom } from '~src/core/utils/coreRandom'
import { coreRandom } from '../coreRandom'

describe('coreRandom', () => {
test('it returns an object between 1 and the provided number', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
import { rollDicePools } from '~src/core/utils/rollDicePools'
import { DicePoolLike } from '~src/core/types'
import { DicePoolLike } from '~src/types'
import { rollDicePools } from '../rollDicePools'

describe('rollDicePools', () => {
test('rolls the provided dice a number of times equal to the quantity', () => {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/utils/rollDicePools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DicePoolLike, DicePoolRollReturn } from '~src/core/types'
import { DicePoolLike, DicePoolRollReturn } from '~src/types'

export function rollDicePools<R>(
dicePools: DicePoolLike<R>
Expand Down

0 comments on commit 2368b73

Please sign in to comment.