diff --git a/src/index.ts b/src/index.ts index 1bc0511..7c3b226 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ // Core types export type { IGameContext } from './core/game'; -export { createGameContext } from './core/game'; +export { createGameContext, createGameCommandRegistry } from './core/game'; export type { Part } from './core/part'; export { flip, flipTo, roll } from './core/part'; @@ -21,7 +21,7 @@ export type { CommandRunner, CommandRunnerHandler, CommandRunnerContext, PromptE export { createCommandRegistry, registerCommand, unregisterCommand, hasCommand, getCommand, runCommand, runCommandParsed, createCommandRunnerContext, type CommandRegistry, type CommandRunnerContextExport } from './utils/command'; export type { Entity } from './utils/entity'; -export { createEntityCollection } from './utils/entity'; +export { createEntityCollection, entity } from './utils/entity'; export type { RNG } from './utils/rng'; export { createRNG, Mulberry32RNG } from './utils/rng'; diff --git a/src/samples/tic-tac-toe.ts b/src/samples/tic-tac-toe.ts index 2b4e722..928c8b8 100644 --- a/src/samples/tic-tac-toe.ts +++ b/src/samples/tic-tac-toe.ts @@ -1,7 +1,7 @@ -import {createGameCommandRegistry} from '../core/game'; -import type { Part } from '../core/part'; -import {Entity, entity} from "../utils/entity"; -import {Region} from "../core/region"; +import {createGameCommandRegistry} from '../'; +import type { Part } from '../'; +import {Entity, entity} from "../"; +import {Region} from "../"; const BOARD_SIZE = 3; const MAX_TURNS = BOARD_SIZE * BOARD_SIZE; diff --git a/src/utils/command/command-apply.ts b/src/utils/command/command-apply.ts index 20375c9..9b3e331 100644 --- a/src/utils/command/command-apply.ts +++ b/src/utils/command/command-apply.ts @@ -1,5 +1,5 @@ import { type ParseError } from 'inline-schema'; -import type { Command, CommandSchema } from './types.js'; +import type { Command, CommandSchema } from './types'; function validateCommandCore(command: Command, schema: CommandSchema): string[] { const errors: string[] = []; diff --git a/src/utils/command/command-parse.ts b/src/utils/command/command-parse.ts index df0cbfa..f81f2ae 100644 --- a/src/utils/command/command-parse.ts +++ b/src/utils/command/command-parse.ts @@ -1,5 +1,5 @@ -import type { Command, CommandSchema } from './types.js'; -import { applyCommandSchema } from './command-validate.js'; +import type { Command, CommandSchema } from './types'; +import { applyCommandSchema } from './command-validate'; export function parseCommand(input: string): Command; export function parseCommand(input: string, schema: CommandSchema): Command; diff --git a/src/utils/command/command-registry.ts b/src/utils/command/command-registry.ts index bc31a51..73cf615 100644 --- a/src/utils/command/command-registry.ts +++ b/src/utils/command/command-registry.ts @@ -1,8 +1,8 @@ -import type { Command, CommandSchema } from './types.js'; -import type {CommandResult, CommandRunner, CommandRunnerContext, PromptEvent} from './command-runner.js'; -import { parseCommand } from './command-parse.js'; -import { applyCommandSchema } from './command-validate.js'; -import { parseCommandSchema } from './schema-parse.js'; +import type { Command, CommandSchema } from './types'; +import type {CommandResult, CommandRunner, CommandRunnerContext, PromptEvent} from './command-runner'; +import { parseCommand } from './command-parse'; +import { applyCommandSchema } from './command-validate'; +import { parseCommandSchema } from './schema-parse'; import {AsyncQueue} from "../async-queue"; export type CommandRegistry = Map>; diff --git a/src/utils/command/command-runner.ts b/src/utils/command/command-runner.ts index 41a3fc7..3103beb 100644 --- a/src/utils/command/command-runner.ts +++ b/src/utils/command/command-runner.ts @@ -1,4 +1,4 @@ -import type { Command, CommandSchema } from './types.js'; +import type { Command, CommandSchema } from './types'; export type PromptEvent = { schema: CommandSchema; diff --git a/src/utils/command/command-validate.ts b/src/utils/command/command-validate.ts index 05b30b9..3a59cc3 100644 --- a/src/utils/command/command-validate.ts +++ b/src/utils/command/command-validate.ts @@ -1,7 +1,7 @@ -import type { Command, CommandSchema } from './types.js'; -import { parseCommand } from './command-parse.js'; -import { parseCommandSchema } from './schema-parse.js'; -import { applyCommandSchema as applyCommandSchemaCore } from './command-apply.js'; +import type { Command, CommandSchema } from './types'; +import { parseCommand } from './command-parse'; +import { parseCommandSchema } from './schema-parse'; +import { applyCommandSchema as applyCommandSchemaCore } from './command-apply'; export { applyCommandSchemaCore as applyCommandSchema }; diff --git a/src/utils/command/schema-parse.ts b/src/utils/command/schema-parse.ts index 7fdca3d..0cdfdca 100644 --- a/src/utils/command/schema-parse.ts +++ b/src/utils/command/schema-parse.ts @@ -1,5 +1,5 @@ import { defineSchema, type ParsedSchema } from 'inline-schema'; -import type { CommandSchema, CommandParamSchema, CommandOptionSchema, CommandFlagSchema, ParsedOptionResult } from './types.js'; +import type { CommandSchema, ParsedOptionResult } from './types'; export function parseCommandSchema(schemaStr: string, name?: string): CommandSchema { const schema: CommandSchema = {