enefel 2.15.2 → 2.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/2025/skillMigration.ts +1 -2
  2. package/avatarsSeason.ts +17 -0
  3. package/block.ts +1 -1
  4. package/calcul.ts +1 -1
  5. package/career.ts +1 -1
  6. package/color.ts +1 -1
  7. package/dice.ts +11 -0
  8. package/dist/2025/skillMigration.d.ts +2 -1
  9. package/dist/avatarsSeason.js +17 -0
  10. package/dist/block.d.ts +1 -1
  11. package/dist/calcul.d.ts +1 -1
  12. package/dist/career.d.ts +2 -1
  13. package/dist/color.d.ts +1 -1
  14. package/dist/dice.js +11 -0
  15. package/dist/game.d.ts +1 -1
  16. package/dist/improvement.d.ts +1 -1
  17. package/dist/index.d.ts +8 -5
  18. package/dist/index.js +5 -2
  19. package/dist/package-lock.json +2 -2
  20. package/dist/package.json +1 -8
  21. package/dist/pitch.d.ts +2 -2
  22. package/dist/right.d.ts +1 -1
  23. package/dist/skill.d.ts +1 -1
  24. package/dist/skillCoach.d.ts +2 -2
  25. package/dist/skills/hitAndRun.d.ts +2 -1
  26. package/dist/skills/sidestep.d.ts +1 -1
  27. package/dist/stadium.d.ts +1 -1
  28. package/dist/state.d.ts +1 -1
  29. package/dist/status.d.ts +1 -1
  30. package/dist/tsconfig.json +0 -1
  31. package/game.ts +1 -1
  32. package/improvement.ts +1 -1
  33. package/index.ts +15 -19
  34. package/npm-login.sh +0 -0
  35. package/package.json +1 -8
  36. package/pitch.ts +1 -1
  37. package/right.ts +1 -1
  38. package/skill.ts +1 -1
  39. package/skillCoach.ts +1 -1
  40. package/skills/hitAndRun.ts +2 -1
  41. package/skills/sidestep.ts +1 -1
  42. package/stadium.ts +1 -1
  43. package/state.ts +1 -1
  44. package/status.ts +1 -1
  45. package/tsconfig.json +0 -1
  46. package/dist/jest.config.d.ts +0 -0
  47. package/dist/jest.config.js +0 -11
  48. package/dist/teams/career_v2025.d.ts +0 -246
  49. package/dist/teams/career_v2025.js +0 -3512
@@ -150,6 +150,5 @@ export {
150
150
  formatSkillName,
151
151
  normalizeSkillKey,
152
152
  SKILL_DISPLAY_OVERRIDE,
153
- SkillBasic,
154
- SkillMigrationRow,
155
153
  };
154
+ export type { SkillBasic, SkillMigrationRow };
package/avatarsSeason.ts CHANGED
@@ -44,6 +44,23 @@ export const AVATAR_SEASON_LIST: SeasonAvatar[] = [
44
44
  { file: "11.png", season: 19, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
45
45
  { file: "12.png", season: 19, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
46
46
  { file: "13.png", season: 19, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
47
+ // Saison 20 — ajouter une ligne par fichier déposé dans
48
+ // client/public/tile/shop/avatar-season/s20/. Ne déclarer que les fichiers
49
+ // réellement présents : une entrée sans image affiche un visuel cassé en
50
+ // boutique et laisse acheter un avatar inexistant.
51
+ { file: "1.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
52
+ { file: "2.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
53
+ { file: "3.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
54
+ { file: "4.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
55
+ { file: "5.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
56
+ { file: "6.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
57
+ { file: "7.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
58
+ { file: "8.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
59
+ { file: "9.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
60
+ { file: "10.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
61
+ { file: "11.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
62
+ { file: "12.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
63
+ { file: "13.png", season: 20, rarity: AVATAR_RARITY.SEASONAL, portrait: true },
47
64
  ];
48
65
 
49
66
  /** Chemin complet utilisé pour afficher l'avatar d'un joueur (ex: <img src>) */
package/block.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PlayerWithSkill } from "types/models";
1
+ import { PlayerWithSkill } from "./types/models";
2
2
  import { hasSkill, SKILL_NAMES } from "./skill";
3
3
 
4
4
  function isFrenzyAvailable(player: PlayerWithSkill, defender: PlayerWithSkill) {
package/calcul.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Point } from "types/models";
1
+ import { Point } from "./types/models";
2
2
 
3
3
  export const distance = (p1: Point, p2: Point): number => {
4
4
  if (p1.x === null || p1.y === null || p2.x === null || p2.y === null) {
package/career.ts CHANGED
@@ -2211,7 +2211,6 @@ export {
2211
2211
  AVATAR,
2212
2212
  AVATAR_RARITY,
2213
2213
  CAREER_ID,
2214
- CAREER_ID_ALL,
2215
2214
  CAREER_IS_2025,
2216
2215
  CAREER_MIGRATION_2025,
2217
2216
  CAREER_VERSION,
@@ -2219,3 +2218,4 @@ export {
2219
2218
  getAvailableCareers,
2220
2219
  getCareers,
2221
2220
  };
2221
+ export type { CAREER_ID_ALL };
package/color.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game } from "types/models";
1
+ import { Game } from "./types/models";
2
2
 
3
3
  interface RGB {
4
4
  r: number;
package/dice.ts CHANGED
@@ -27,6 +27,17 @@ const DICE_LIST: DiceSkin[] = [
27
27
  season: 19,
28
28
  rarity: AVATAR_RARITY.SEASONAL,
29
29
  },
30
+ {
31
+ // Or sur pourpre profond. Contraste WCAG 9.4:1, contre 5.9:1 pour le
32
+ // blanc sur rouge des saisons 17 et 19 : les points restent lisibles même
33
+ // au format réduit du journal de match.
34
+ id: "s20-gold",
35
+ color: "#f5c542",
36
+ background: "#2d1b4e",
37
+ price: 30,
38
+ season: 20,
39
+ rarity: AVATAR_RARITY.SEASONAL,
40
+ },
30
41
  ];
31
42
 
32
43
  const getDiceById = (id: string | null | undefined): DiceSkin => {
@@ -28,4 +28,5 @@ declare const SKILL_DISPLAY_OVERRIDE: Record<string, string>;
28
28
  declare const normalizeSkillKey: (value: string) => string;
29
29
  declare const formatSkillName: (value: string) => string;
30
30
  declare const buildSkillMigrationRows: (existingSkills: Record<string, SKILL_TYPE>, nextSkills: SkillBasic[], legacyCareers: Record<string, CareerLite>, nextCareers: Record<string, CareerLite>) => SkillMigrationRow[];
31
- export { buildSkillMigrationRows, formatSkillName, normalizeSkillKey, SKILL_DISPLAY_OVERRIDE, SkillBasic, SkillMigrationRow, };
31
+ export { buildSkillMigrationRows, formatSkillName, normalizeSkillKey, SKILL_DISPLAY_OVERRIDE, };
32
+ export type { SkillBasic, SkillMigrationRow };
@@ -40,6 +40,23 @@ exports.AVATAR_SEASON_LIST = [
40
40
  { file: "11.png", season: 19, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
41
41
  { file: "12.png", season: 19, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
42
42
  { file: "13.png", season: 19, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
43
+ // Saison 20 — ajouter une ligne par fichier déposé dans
44
+ // client/public/tile/shop/avatar-season/s20/. Ne déclarer que les fichiers
45
+ // réellement présents : une entrée sans image affiche un visuel cassé en
46
+ // boutique et laisse acheter un avatar inexistant.
47
+ { file: "1.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
48
+ { file: "2.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
49
+ { file: "3.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
50
+ { file: "4.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
51
+ { file: "5.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
52
+ { file: "6.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
53
+ { file: "7.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
54
+ { file: "8.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
55
+ { file: "9.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
56
+ { file: "10.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
57
+ { file: "11.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
58
+ { file: "12.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
59
+ { file: "13.png", season: 20, rarity: career_1.AVATAR_RARITY.SEASONAL, portrait: true },
43
60
  ];
44
61
  /** Chemin complet utilisé pour afficher l'avatar d'un joueur (ex: <img src>) */
45
62
  function getSeasonAvatarPath(season) {
package/dist/block.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PlayerWithSkill } from "types/models";
1
+ import { PlayerWithSkill } from "./types/models";
2
2
  declare function isFrenzyAvailable(player: PlayerWithSkill, defender: PlayerWithSkill): boolean;
3
3
  declare const getOrderDice: (attacker: PlayerWithSkill, defender: PlayerWithSkill) => {
4
4
  value: number;
package/dist/calcul.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { Point } from "types/models";
1
+ import { Point } from "./types/models";
2
2
  export declare const distance: (p1: Point, p2: Point) => number;
3
3
  export declare const distanceSquares: (p1: Point, p2: Point, distance: number) => boolean;
package/dist/career.d.ts CHANGED
@@ -187,4 +187,5 @@ declare const getCareers: () => CareerMap;
187
187
  declare const getAvailableCareers: () => AvailableCareerMap;
188
188
  declare const CAREER_IS_2025: Record<CAREER_ID, boolean>;
189
189
  declare const CAREER_MIGRATION_2025: Record<CAREER_ID, boolean>;
190
- export { AVATAR, AVATAR_RARITY, CAREER_ID, CAREER_ID_ALL, CAREER_IS_2025, CAREER_MIGRATION_2025, CAREER_VERSION, RACE, getAvailableCareers, getCareers, };
190
+ export { AVATAR, AVATAR_RARITY, CAREER_ID, CAREER_IS_2025, CAREER_MIGRATION_2025, CAREER_VERSION, RACE, getAvailableCareers, getCareers, };
191
+ export type { CAREER_ID_ALL };
package/dist/color.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game } from "types/models";
1
+ import { Game } from "./types/models";
2
2
  declare const colorShade: (col: string | null | undefined, amt: number) => string;
3
3
  declare function isColorTooClose(a: string, b: string): boolean;
4
4
  declare function invertColor(hexTripletColor: string): string;
package/dist/dice.js CHANGED
@@ -20,6 +20,17 @@ const DICE_LIST = [
20
20
  season: 19,
21
21
  rarity: career_1.AVATAR_RARITY.SEASONAL,
22
22
  },
23
+ {
24
+ // Or sur pourpre profond. Contraste WCAG 9.4:1, contre 5.9:1 pour le
25
+ // blanc sur rouge des saisons 17 et 19 : les points restent lisibles même
26
+ // au format réduit du journal de match.
27
+ id: "s20-gold",
28
+ color: "#f5c542",
29
+ background: "#2d1b4e",
30
+ price: 30,
31
+ season: 20,
32
+ rarity: career_1.AVATAR_RARITY.SEASONAL,
33
+ },
23
34
  ];
24
35
  exports.DICE_LIST = DICE_LIST;
25
36
  const getDiceById = (id) => {
package/dist/game.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game } from "types/models";
1
+ import { Game } from "./types/models";
2
2
  declare const CLEAN_HISTORY_DAY = 30;
3
3
  declare enum GAME_TYPE {
4
4
  DIVISION = "division",
@@ -1,4 +1,4 @@
1
- import { Game } from "types/models";
1
+ import { Game } from "./types/models";
2
2
  declare enum SPP_TYPE {
3
3
  BONUS = "BONUS",
4
4
  INT = "INT",
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Player, PlayerWithSkill, Point, Team } from "types/models";
1
+ import { Game, Player, PlayerWithSkill, Point, Team } from "./types/models";
2
2
  import { METEO } from "./meteo";
3
3
  import { getAllAdjacentSquares } from "./position";
4
4
  import version from "./version";
@@ -217,7 +217,7 @@ declare enum TAKE_BALL_TYPE {
217
217
  declare const p: (x: number | string, y: number | string) => Point;
218
218
  declare function addSeconds(date: Date, days: number): Date;
219
219
  declare const isSquareValidToPushBack: (availableSquares: Point[], targetIndex: number, players: Record<string, PlayerWithSkill>, w: number, h: number, busy?: Point[]) => boolean;
220
- declare const getPlayerOnCell: (x: number | null, y: number | null, players: Record<string, PlayerWithSkill>) => false | PlayerWithSkill | undefined;
220
+ declare const getPlayerOnCell: (x: number | null, y: number | null, players: Record<string, PlayerWithSkill>) => PlayerWithSkill | null;
221
221
  declare const getHypnoticGazeMalus: (player: Player, target: Player, players: Record<string, Player>) => number;
222
222
  declare const getBlockAssistance: (attackerPlayer: PlayerWithSkill, defenderPlayer: PlayerWithSkill, players: PlayerWithSkill[], isAttacker?: boolean, isFoul?: boolean) => PlayerWithSkill[];
223
223
  declare const getDicesBlock: (attackerStrength: number, defenderStrength: number) => 2 | 1 | 3;
@@ -262,6 +262,9 @@ declare const swapArrayLocs: (arr: any[], index1: number, index2: number) => any
262
262
  declare const getInactiveDays: (isDev?: boolean) => 10 | 10000;
263
263
  declare const getMaxPlayers: (isDev?: boolean) => number;
264
264
  export { addSeconds, arrayMove, availableSquaresToPushBack, canBlock, canEndTurn, canFaceUp, canFoul, canMove, canPass, canPlayerIntercepts, canStandup, canThrowTeamMate, canTransmit, FORMATION_DEFAULT_NAME, GAME_HISTORY_INFO, GAME_HISTORY_TYPE, getAllAdjacentSquares, getAttackerStrength, getBestInterceptor, getBlockAssistance, getDefenderStrength, getDicesBlock, getHypnoticGazeMalus, getInactiveDays, getMaxPlayers, getMoralModifier, getPlayerOnCell, getTeamColor, getTeamMoral, getTeamMoralByPlayer, getTeamXP, getThrowingBonus, haveSameTeam, INACTIVE_DAYS, isCoach, isGameRunning, isOnField, isOnLine, isSamePlayer, isSetUp, allAdjacentSquaresToPushBack, isSquareValidToPushBack, LAST_SEASON_ALPHA, MAX_PLAYER_TEAM, MAX_PLAYER_USER, p, PLAYER_HISTORY_INFO, PLAYER_HISTORY_TYPE, PLAYER_STAT, POSTULATION_HOURS, swapArrayLocs, TAKE_BALL_TYPE, version, };
265
- export { SidestepMode, SidestepStrategy, SidestepPreference, } from "./skills/sidestep";
266
- export { HitAndRunMode, HitAndRunStrategy, HitAndRunPreference, } from "./skills/hitAndRun";
267
- export { SafePairOfHandsMode, SafePairOfHandsStrategy, SafePairOfHandsPreference, } from "./skills/safePairOfHands";
265
+ export { SidestepMode, SidestepStrategy } from "./skills/sidestep";
266
+ export type { SidestepPreference } from "./skills/sidestep";
267
+ export { HitAndRunMode, HitAndRunStrategy } from "./skills/hitAndRun";
268
+ export type { HitAndRunPreference } from "./skills/hitAndRun";
269
+ export { SafePairOfHandsMode, SafePairOfHandsStrategy } from "./skills/safePairOfHands";
270
+ export type { SafePairOfHandsPreference } from "./skills/safePairOfHands";
package/dist/index.js CHANGED
@@ -289,10 +289,13 @@ const isSquareValidToPushBack = (availableSquares, targetIndex, players, w, h, b
289
289
  };
290
290
  exports.isSquareValidToPushBack = isSquareValidToPushBack;
291
291
  const getPlayerOnCell = (x, y, players) => {
292
+ // Retour normalisé à `PlayerWithSkill | null` : la fonction renvoyait `false`
293
+ // quand les coordonnées manquaient et `undefined` quand personne n'était sur
294
+ // la case, ce qui contaminait les signatures des appelants.
292
295
  if (x === null || y === null) {
293
- return false;
296
+ return null;
294
297
  }
295
- return Object.values(players).find((player) => player.x === x && player.y === y && (0, status_1.hasStatusOnField)(player));
298
+ return (Object.values(players).find((player) => player.x === x && player.y === y && (0, status_1.hasStatusOnField)(player)) ?? null);
296
299
  };
297
300
  exports.getPlayerOnCell = getPlayerOnCell;
298
301
  const getHypnoticGazeMalus = (player, target, players) => {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.15.2",
3
+ "version": "2.15.4",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "enefel",
9
- "version": "2.15.2",
9
+ "version": "2.15.4",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "csv-parse": "^6.1.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.15.2",
3
+ "version": "2.15.4",
4
4
  "description": "Fantasy Football game engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,13 +8,6 @@
8
8
  ".": "./dist/index.js",
9
9
  "./*": "./dist/*.js"
10
10
  },
11
- "typesVersions": {
12
- "*": {
13
- "*": [
14
- "./dist/*"
15
- ]
16
- }
17
- },
18
11
  "scripts": {
19
12
  "build": "tsc",
20
13
  "watch": "tsc -w",
package/dist/pitch.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Player } from "types/models";
1
+ import { Game, Player } from "./types/models";
2
2
  declare enum TILES {
3
3
  TD1 = "b",
4
4
  CENTRE1 = "c",
@@ -21,7 +21,7 @@ declare function getTdTile(teamNumber: number): TILES.TD1 | TILES.TD2;
21
21
  declare function getCenterTile(teamNumber: number): TILES.CENTRE1 | TILES.CENTRE2;
22
22
  declare function getTile(game: Game, x: number, y: number): string;
23
23
  declare function getIndexFromXY(x: number, y: number, width: number): number;
24
- declare function getHalfStadium(side: 1 | 2, width: number): import("types/models").Point;
24
+ declare function getHalfStadium(side: 1 | 2, width: number): import("./types/models").Point;
25
25
  declare function getNumberPlayerZone(teamNumber: number, players: Player[], game: Game): {
26
26
  playerScrimmage: number;
27
27
  playerLateralA: number;
package/dist/right.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Player, PlayerWithSkill, Team } from "types/models";
1
+ import { Game, Player, PlayerWithSkill, Team } from "./types/models";
2
2
  declare function canJoinTeam(player: PlayerWithSkill, team: Team): boolean;
3
3
  declare function canCreateTeam(player: Player): boolean;
4
4
  declare function canQuitTeam(player: Player): boolean | "";
package/dist/skill.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Player, PlayerSkill, PlayerWithSkill } from "types/models";
1
+ import { Player, PlayerSkill, PlayerWithSkill } from "./types/models";
2
2
  declare const BIG_GUY_LIMIT = 1;
3
3
  declare const SKILL_INFO_ACTIVE = "active";
4
4
  declare const SKILL_INFO_INACTIVE = "inactive";
@@ -1,4 +1,4 @@
1
- import { PlayerWithSkill } from "types/models";
1
+ import { PlayerWithSkill } from "./types/models";
2
2
  declare enum SKILL_COACH_NAMES {
3
3
  SPONSOR = "sponsor",
4
4
  SPY = "spy",
@@ -12,6 +12,6 @@ declare const COACH_SKILLS: {
12
12
  threatening: SKILL_COACH_TYPE;
13
13
  };
14
14
  declare function shouldDisplayInfoInName(skillId: SKILL_COACH_NAMES): boolean;
15
- declare function getCoachSkill(player: PlayerWithSkill, skillId: SKILL_COACH_NAMES): false | import("types/models").CoachSkill | undefined;
15
+ declare function getCoachSkill(player: PlayerWithSkill, skillId: SKILL_COACH_NAMES): false | import("./types/models").CoachSkill | undefined;
16
16
  declare function hasAvailableCoachSkill(player: PlayerWithSkill, skillId: SKILL_COACH_NAMES): number | false;
17
17
  export { COACH_SKILLS, getCoachSkill, hasAvailableCoachSkill, shouldDisplayInfoInName, SKILL_COACH_NAMES, };
@@ -1,4 +1,5 @@
1
- export { SidestepStrategy as HitAndRunStrategy, CustomPriorities } from "./sidestep";
1
+ export { SidestepStrategy as HitAndRunStrategy } from "./sidestep";
2
+ export type { CustomPriorities } from "./sidestep";
2
3
  export declare enum HitAndRunMode {
3
4
  DISABLED = "DISABLED",
4
5
  ENABLED = "ENABLED"
@@ -1,4 +1,4 @@
1
- export { CustomPriorities } from "./safePairOfHands";
1
+ export type { CustomPriorities } from "./safePairOfHands";
2
2
  export declare enum SidestepMode {
3
3
  DISABLED = "DISABLED",
4
4
  AUTO = "AUTO"
package/dist/stadium.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Team } from "types/models";
1
+ import { Game, Team } from "./types/models";
2
2
  declare const INITIAL_REROLL = 2;
3
3
  declare const MIN_SCRIMMAGE = 3;
4
4
  declare const MAX_LATERAL = 2;
package/dist/state.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Team } from "types/models";
1
+ import { Team } from "./types/models";
2
2
  declare enum TEAM_STATE {
3
3
  ACTIVE = 0,
4
4
  EMPTY = 1,
package/dist/status.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Player } from "types/models";
1
+ import { Player } from "./types/models";
2
2
  export declare enum PLAYER_STATUS {
3
3
  STANDING = 0,
4
4
  KNOCKED_DOWN = 1,// Sur le dos
@@ -16,7 +16,6 @@
16
16
  "paths": {
17
17
  "status": ["./status"],
18
18
  "random": ["./random"],
19
- "types/models": ["./types/models"],
20
19
  "calcul": ["./calcul"],
21
20
  "time": ["./time"]
22
21
  }
package/game.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game } from "types/models";
1
+ import { Game } from "./types/models";
2
2
  import { d6 } from "./random";
3
3
  import { getTime, TYPE_TIMER } from "./time";
4
4
 
package/improvement.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game } from "types/models";
1
+ import { Game } from "./types/models";
2
2
 
3
3
  enum GAME_TYPE {
4
4
  FRIENDLY = "friendly",
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Player, PlayerWithSkill, Point, Team } from "types/models";
1
+ import { Game, Player, PlayerWithSkill, Point, Team } from "./types/models";
2
2
  import { distance } from "./calcul";
3
3
  import { GAME_STATUS } from "./game";
4
4
  import { ranges } from "./improvement";
@@ -307,11 +307,16 @@ const getPlayerOnCell = (
307
307
  y: number | null,
308
308
  players: Record<string, PlayerWithSkill>
309
309
  ) => {
310
+ // Retour normalisé à `PlayerWithSkill | null` : la fonction renvoyait `false`
311
+ // quand les coordonnées manquaient et `undefined` quand personne n'était sur
312
+ // la case, ce qui contaminait les signatures des appelants.
310
313
  if (x === null || y === null) {
311
- return false;
314
+ return null;
312
315
  }
313
- return Object.values(players).find(
314
- (player) => player.x === x && player.y === y && hasStatusOnField(player)
316
+ return (
317
+ Object.values(players).find(
318
+ (player) => player.x === x && player.y === y && hasStatusOnField(player)
319
+ ) ?? null
315
320
  );
316
321
  };
317
322
 
@@ -1107,20 +1112,11 @@ export {
1107
1112
  version,
1108
1113
  };
1109
1114
 
1110
- export {
1111
- SidestepMode,
1112
- SidestepStrategy,
1113
- SidestepPreference,
1114
- } from "./skills/sidestep";
1115
+ export { SidestepMode, SidestepStrategy } from "./skills/sidestep";
1116
+ export type { SidestepPreference } from "./skills/sidestep";
1115
1117
 
1116
- export {
1117
- HitAndRunMode,
1118
- HitAndRunStrategy,
1119
- HitAndRunPreference,
1120
- } from "./skills/hitAndRun";
1118
+ export { HitAndRunMode, HitAndRunStrategy } from "./skills/hitAndRun";
1119
+ export type { HitAndRunPreference } from "./skills/hitAndRun";
1121
1120
 
1122
- export {
1123
- SafePairOfHandsMode,
1124
- SafePairOfHandsStrategy,
1125
- SafePairOfHandsPreference,
1126
- } from "./skills/safePairOfHands";
1121
+ export { SafePairOfHandsMode, SafePairOfHandsStrategy } from "./skills/safePairOfHands";
1122
+ export type { SafePairOfHandsPreference } from "./skills/safePairOfHands";
package/npm-login.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.15.2",
3
+ "version": "2.15.4",
4
4
  "description": "Fantasy Football game engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,13 +8,6 @@
8
8
  ".": "./dist/index.js",
9
9
  "./*": "./dist/*.js"
10
10
  },
11
- "typesVersions": {
12
- "*": {
13
- "*": [
14
- "./dist/*"
15
- ]
16
- }
17
- },
18
11
  "scripts": {
19
12
  "build": "tsc",
20
13
  "watch": "tsc -w",
package/pitch.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Player } from "types/models";
1
+ import { Game, Player } from "./types/models";
2
2
  import { p } from "./index";
3
3
  import { hasStatusStanding } from "./status";
4
4
 
package/right.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Player, PlayerWithSkill, Team } from "types/models";
1
+ import { Game, Player, PlayerWithSkill, Team } from "./types/models";
2
2
  import { GAME_STATUS } from "./game";
3
3
  import { MAX_PLAYER_TEAM } from "./index";
4
4
  import { isPlaying } from "./player";
package/skill.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Player, PlayerSkill, PlayerWithSkill } from "types/models";
1
+ import { Player, PlayerSkill, PlayerWithSkill } from "./types/models";
2
2
  import { newSkills } from "./2025/newSkills";
3
3
  import { distanceSquares } from "./calcul";
4
4
  import { hasStatusOnField } from "./status";
package/skillCoach.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PlayerWithSkill } from "types/models";
1
+ import { PlayerWithSkill } from "./types/models";
2
2
 
3
3
  enum SKILL_COACH_NAMES {
4
4
  SPONSOR = "sponsor",
@@ -1,6 +1,7 @@
1
1
  // Hit and Run reuses the same strategies as Sidestep
2
2
  // The UI is a toggle + select in the block action dialog
3
- export { SidestepStrategy as HitAndRunStrategy, CustomPriorities } from "./sidestep";
3
+ export { SidestepStrategy as HitAndRunStrategy } from "./sidestep";
4
+ export type { CustomPriorities } from "./sidestep";
4
5
 
5
6
  export enum HitAndRunMode {
6
7
  DISABLED = "DISABLED",
@@ -1,5 +1,5 @@
1
1
  // Réutilisation de l'interface commune pour les priorités personnalisées
2
- export { CustomPriorities } from "./safePairOfHands";
2
+ export type { CustomPriorities } from "./safePairOfHands";
3
3
 
4
4
  export enum SidestepMode {
5
5
  DISABLED = "DISABLED",
package/stadium.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Game, Team } from "types/models";
1
+ import { Game, Team } from "./types/models";
2
2
  import { d6 } from "./random";
3
3
 
4
4
  const INITIAL_REROLL = 2;
package/state.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Team } from "types/models";
1
+ import { Team } from "./types/models";
2
2
  import { MIN_SCRIMMAGE } from "./stadium";
3
3
 
4
4
  enum TEAM_STATE {
package/status.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Player } from "types/models";
1
+ import { Player } from "./types/models";
2
2
 
3
3
  export enum PLAYER_STATUS {
4
4
  STANDING = 0,
package/tsconfig.json CHANGED
@@ -16,7 +16,6 @@
16
16
  "paths": {
17
17
  "status": ["./status"],
18
18
  "random": ["./random"],
19
- "types/models": ["./types/models"],
20
19
  "calcul": ["./calcul"],
21
20
  "time": ["./time"]
22
21
  }
File without changes
@@ -1,11 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- preset: "ts-jest",
4
- testEnvironment: "node",
5
- roots: ["<rootDir>/__tests__"],
6
- testMatch: ["**/*.test.ts"],
7
- transform: {
8
- "^.+\\.tsx?$": "ts-jest",
9
- },
10
- moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
11
- };