Refactor API and enhance Angular integration
- Removed `ciTargetName` from `nx.json`. - Updated `package.json` to include new dependencies: `@types/seedrandom`, `fast-check`, `happy-dom`, and `@nestjs/schedule`. - Modified `pnpm-lock.yaml` to reflect the addition of new packages and their versions. - Improved project documentation in `PROJECT_CONTEXT.md` to clarify the use of Zod schemas and Angular framework decisions. - Introduced new Angular components and patterns in the `.agents/skills/frontend-angular` directory, including examples and reference materials for Angular 21+ features.
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
"main": "./src/index.js",
|
||||
"types": "./src/index.d.ts",
|
||||
"dependencies": {
|
||||
"@nx/vite": "^22.7.1",
|
||||
"tslib": "^2.3.0",
|
||||
"vitest": "^4.0.8",
|
||||
"@nx/vite": "^22.7.1"
|
||||
"zod": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,3 +2,5 @@ export * from './lib/perk';
|
||||
export * from './lib/survivor';
|
||||
export * from './lib/mission';
|
||||
export * from './lib/encounter';
|
||||
export * from './lib/encounter-definition';
|
||||
export * from './lib/mission-state';
|
||||
|
||||
8
libs/api-interfaces/src/lib/encounter-definition.ts
Normal file
8
libs/api-interfaces/src/lib/encounter-definition.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const EncounterDefinitionSchema = z.object({
|
||||
key: z.string().min(1),
|
||||
baseProbability: z.number().min(0).max(1),
|
||||
tags: z.array(z.string()),
|
||||
});
|
||||
export type EncounterDefinition = z.infer<typeof EncounterDefinitionSchema>;
|
||||
23
libs/api-interfaces/src/lib/mission-state.ts
Normal file
23
libs/api-interfaces/src/lib/mission-state.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { z } from 'zod';
|
||||
import { EncounterResultSchema } from './encounter';
|
||||
import { MissionSchema } from './mission';
|
||||
import { SurvivorSchema } from './survivor';
|
||||
|
||||
export const MissionStateResponseSchema = z
|
||||
.object({
|
||||
mission: MissionSchema,
|
||||
survivors: z.array(SurvivorSchema),
|
||||
recentLog: z.array(EncounterResultSchema).max(20),
|
||||
})
|
||||
.nullable();
|
||||
export type MissionStateResponse = z.infer<typeof MissionStateResponseSchema>;
|
||||
|
||||
export const StartMissionRequestSchema = z.object({
|
||||
difficulty: z.number().int().min(1).max(3),
|
||||
});
|
||||
export type StartMissionRequest = z.infer<typeof StartMissionRequestSchema>;
|
||||
|
||||
export const ChoosePerkRequestSchema = z.object({
|
||||
perkKey: z.string().min(1),
|
||||
});
|
||||
export type ChoosePerkRequest = z.infer<typeof ChoosePerkRequestSchema>;
|
||||
Reference in New Issue
Block a user