refactor: add src alias to @/

This commit is contained in:
2026-04-02 16:03:44 +08:00
parent f4649e0dac
commit 2581a8e0e6
19 changed files with 48 additions and 34 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import {entity, Entity} from "../utils/entity";
import {entity, Entity} from "@/utils/entity";
import {
Command,
CommandRegistry,
@@ -9,7 +9,7 @@ import {
createCommandRunnerContext,
parseCommandSchema,
registerCommand
} from "../utils/command";
} from "@/utils/command";
export interface IGameContext<TState extends Record<string, unknown> = {} > {
state: Entity<TState>;
+2 -2
View File
@@ -1,6 +1,6 @@
import {Entity} from "../utils/entity";
import {Entity} from "@/utils/entity";
import {Region} from "./region";
import {RNG} from "../utils/rng";
import {RNG} from "@/utils/rng";
export type Part = {
id: string;
+2 -2
View File
@@ -1,6 +1,6 @@
import {Entity} from "../utils/entity";
import {Entity} from "@/utils/entity";
import {Part} from "./part";
import {RNG} from "../utils/rng";
import {RNG} from "@/utils/rng";
export type Region = {
id: string;
+1 -4
View File
@@ -1,7 +1,4 @@
import {createGameCommandRegistry} from '../';
import type { Part } from '../';
import {Entity, entity} from "../";
import {Region} from "../";
import {createGameCommandRegistry, Part, Entity, entity, Region} from '@/index';
const BOARD_SIZE = 3;
const MAX_TURNS = BOARD_SIZE * BOARD_SIZE;
+1 -1
View File
@@ -3,7 +3,7 @@ import type {CommandResult, CommandRunner, CommandRunnerContext, PromptEvent} fr
import { parseCommand } from './command-parse';
import { applyCommandSchema } from './command-validate';
import { parseCommandSchema } from './schema-parse';
import {AsyncQueue} from "../async-queue";
import {AsyncQueue} from "@/utils/async-queue";
export type CommandRegistry<TContext> = Map<string, CommandRunner<TContext, unknown>>;