@sudobility/sudojo_lib 0.0.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.
- package/dist/hooks/index.d.ts +27 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +27 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useDailyGame.d.ts +64 -0
- package/dist/hooks/useDailyGame.d.ts.map +1 -0
- package/dist/hooks/useDailyGame.js +120 -0
- package/dist/hooks/useDailyGame.js.map +1 -0
- package/dist/hooks/useGame.d.ts +104 -0
- package/dist/hooks/useGame.d.ts.map +1 -0
- package/dist/hooks/useGame.js +546 -0
- package/dist/hooks/useGame.js.map +1 -0
- package/dist/hooks/useGamePersistence.d.ts +63 -0
- package/dist/hooks/useGamePersistence.d.ts.map +1 -0
- package/dist/hooks/useGamePersistence.js +124 -0
- package/dist/hooks/useGamePersistence.js.map +1 -0
- package/dist/hooks/useGameTeaching.d.ts +89 -0
- package/dist/hooks/useGameTeaching.d.ts.map +1 -0
- package/dist/hooks/useGameTeaching.js +230 -0
- package/dist/hooks/useGameTeaching.js.map +1 -0
- package/dist/hooks/useGameTimer.d.ts +43 -0
- package/dist/hooks/useGameTimer.d.ts.map +1 -0
- package/dist/hooks/useGameTimer.js +68 -0
- package/dist/hooks/useGameTimer.js.map +1 -0
- package/dist/hooks/useHint.d.ts +105 -0
- package/dist/hooks/useHint.d.ts.map +1 -0
- package/dist/hooks/useHint.js +179 -0
- package/dist/hooks/useHint.js.map +1 -0
- package/dist/hooks/useLearning.d.ts +100 -0
- package/dist/hooks/useLearning.d.ts.map +1 -0
- package/dist/hooks/useLearning.js +127 -0
- package/dist/hooks/useLearning.js.map +1 -0
- package/dist/hooks/useLevelGame.d.ts +68 -0
- package/dist/hooks/useLevelGame.d.ts.map +1 -0
- package/dist/hooks/useLevelGame.js +128 -0
- package/dist/hooks/useLevelGame.js.map +1 -0
- package/dist/hooks/useLevels.d.ts +93 -0
- package/dist/hooks/useLevels.d.ts.map +1 -0
- package/dist/hooks/useLevels.js +98 -0
- package/dist/hooks/useLevels.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +26 -0
- package/dist/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/hooks/useLocalStorage.js +75 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useSudoku.d.ts +125 -0
- package/dist/hooks/useSudoku.d.ts.map +1 -0
- package/dist/hooks/useSudoku.js +655 -0
- package/dist/hooks/useSudoku.js.map +1 -0
- package/dist/hooks/useTechniques.d.ts +92 -0
- package/dist/hooks/useTechniques.d.ts.map +1 -0
- package/dist/hooks/useTechniques.js +108 -0
- package/dist/hooks/useTechniques.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +35 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/types/display.d.ts +142 -0
- package/dist/types/display.d.ts.map +1 -0
- package/dist/types/display.js +94 -0
- package/dist/types/display.js.map +1 -0
- package/dist/types/game.d.ts +201 -0
- package/dist/types/game.d.ts.map +1 -0
- package/dist/types/game.js +26 -0
- package/dist/types/game.js.map +1 -0
- package/dist/types/gamePersistence.d.ts +31 -0
- package/dist/types/gamePersistence.d.ts.map +1 -0
- package/dist/types/gamePersistence.js +15 -0
- package/dist/types/gamePersistence.js.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/progress.d.ts +43 -0
- package/dist/types/progress.d.ts.map +1 -0
- package/dist/types/progress.js +19 -0
- package/dist/types/progress.js.map +1 -0
- package/dist/types/settings.d.ts +19 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +12 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/subscription.d.ts +27 -0
- package/dist/types/subscription.d.ts.map +1 -0
- package/dist/types/subscription.js +8 -0
- package/dist/types/subscription.js.map +1 -0
- package/dist/types/sudoku.d.ts +147 -0
- package/dist/types/sudoku.d.ts.map +1 -0
- package/dist/types/sudoku.js +125 -0
- package/dist/types/sudoku.js.map +1 -0
- package/dist/utils/auth.d.ts +25 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +47 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/board.d.ts +116 -0
- package/dist/utils/board.d.ts.map +1 -0
- package/dist/utils/board.js +291 -0
- package/dist/utils/board.js.map +1 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +23 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/progress.d.ts +44 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +104 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/scramble.d.ts +35 -0
- package/dist/utils/scramble.d.ts.map +1 -0
- package/dist/utils/scramble.js +270 -0
- package/dist/utils/scramble.js.map +1 -0
- package/dist/utils/subscription.d.ts +82 -0
- package/dist/utils/subscription.d.ts.map +1 -0
- package/dist/utils/subscription.js +117 -0
- package/dist/utils/subscription.js.map +1 -0
- package/dist/utils/sudokuPresenter.d.ts +62 -0
- package/dist/utils/sudokuPresenter.d.ts.map +1 -0
- package/dist/utils/sudokuPresenter.js +403 -0
- package/dist/utils/sudokuPresenter.js.map +1 -0
- package/dist/utils/sudokuScrambler.d.ts +61 -0
- package/dist/utils/sudokuScrambler.d.ts.map +1 -0
- package/dist/utils/sudokuScrambler.js +223 -0
- package/dist/utils/sudokuScrambler.js.map +1 -0
- package/dist/utils/technique.d.ts +41 -0
- package/dist/utils/technique.d.ts.map +1 -0
- package/dist/utils/technique.js +106 -0
- package/dist/utils/technique.js.map +1 -0
- package/dist/utils/theme.d.ts +31 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +40 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/utils/time.d.ts +22 -0
- package/dist/utils/time.d.ts.map +1 -0
- package/dist/utils/time.js +41 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/validation.d.ts +107 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +248 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game validation utilities for checking mistakes, completion, and game state
|
|
3
|
+
*/
|
|
4
|
+
import { BOARD_SIZE, parseBoardString } from './board';
|
|
5
|
+
/**
|
|
6
|
+
* Checks if a cell value matches the solution
|
|
7
|
+
* @param board - GameBoard
|
|
8
|
+
* @param solution - 81-character solution string
|
|
9
|
+
* @param row - Row index
|
|
10
|
+
* @param col - Column index
|
|
11
|
+
* @returns true if the cell value matches the solution (or is empty)
|
|
12
|
+
*/
|
|
13
|
+
export function isCellCorrect(board, solution, row, col) {
|
|
14
|
+
const cell = board[row]?.[col];
|
|
15
|
+
if (!cell || cell.value === null) {
|
|
16
|
+
return true; // Empty cells are not incorrect
|
|
17
|
+
}
|
|
18
|
+
const solutionArray = parseBoardString(solution);
|
|
19
|
+
const correctValue = solutionArray[row]?.[col];
|
|
20
|
+
return cell.value === correctValue;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Checks if a specific value would be correct for a cell
|
|
24
|
+
* @param solution - 81-character solution string
|
|
25
|
+
* @param row - Row index
|
|
26
|
+
* @param col - Column index
|
|
27
|
+
* @param value - Value to check (1-9)
|
|
28
|
+
* @returns true if the value matches the solution
|
|
29
|
+
*/
|
|
30
|
+
export function isValueCorrect(solution, row, col, value) {
|
|
31
|
+
const solutionArray = parseBoardString(solution);
|
|
32
|
+
return solutionArray[row]?.[col] === value;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets all cells with incorrect values
|
|
36
|
+
* @param board - GameBoard
|
|
37
|
+
* @param solution - 81-character solution string
|
|
38
|
+
* @returns Array of {row, column} positions with incorrect values
|
|
39
|
+
*/
|
|
40
|
+
export function getIncorrectCells(board, solution) {
|
|
41
|
+
const solutionArray = parseBoardString(solution);
|
|
42
|
+
const incorrectCells = [];
|
|
43
|
+
for (let row = 0; row < BOARD_SIZE; row++) {
|
|
44
|
+
for (let col = 0; col < BOARD_SIZE; col++) {
|
|
45
|
+
const cell = board[row]?.[col];
|
|
46
|
+
if (cell && cell.value !== null && !cell.isClue) {
|
|
47
|
+
const correctValue = solutionArray[row]?.[col];
|
|
48
|
+
if (cell.value !== correctValue) {
|
|
49
|
+
incorrectCells.push({ row, column: col });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return incorrectCells;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Updates the error state of all cells based on the solution
|
|
58
|
+
* @param board - GameBoard to update
|
|
59
|
+
* @param solution - 81-character solution string
|
|
60
|
+
* @param showErrors - Whether to show errors
|
|
61
|
+
* @returns Updated GameBoard
|
|
62
|
+
*/
|
|
63
|
+
export function updateCellErrors(board, solution, showErrors) {
|
|
64
|
+
if (!showErrors) {
|
|
65
|
+
// Clear all errors
|
|
66
|
+
return board.map(row => row.map(cell => ({ ...cell, isError: false })));
|
|
67
|
+
}
|
|
68
|
+
const solutionArray = parseBoardString(solution);
|
|
69
|
+
return board.map((row, rowIndex) => row.map((cell, colIndex) => {
|
|
70
|
+
if (cell.value === null || cell.isClue) {
|
|
71
|
+
return { ...cell, isError: false };
|
|
72
|
+
}
|
|
73
|
+
const correctValue = solutionArray[rowIndex]?.[colIndex];
|
|
74
|
+
return {
|
|
75
|
+
...cell,
|
|
76
|
+
isError: cell.value !== correctValue,
|
|
77
|
+
};
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Checks if the game is complete (all cells filled correctly)
|
|
82
|
+
* @param board - GameBoard
|
|
83
|
+
* @param solution - 81-character solution string
|
|
84
|
+
* @returns true if all cells are filled with correct values
|
|
85
|
+
*/
|
|
86
|
+
export function isGameComplete(board, solution) {
|
|
87
|
+
const solutionArray = parseBoardString(solution);
|
|
88
|
+
for (let row = 0; row < BOARD_SIZE; row++) {
|
|
89
|
+
for (let col = 0; col < BOARD_SIZE; col++) {
|
|
90
|
+
const cell = board[row]?.[col];
|
|
91
|
+
const correctValue = solutionArray[row]?.[col];
|
|
92
|
+
if (!cell || cell.value === null || cell.value !== correctValue) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Checks if the board is fully filled (regardless of correctness)
|
|
101
|
+
* @param board - GameBoard
|
|
102
|
+
* @returns true if all cells have values
|
|
103
|
+
*/
|
|
104
|
+
export function isBoardFilled(board) {
|
|
105
|
+
for (let row = 0; row < BOARD_SIZE; row++) {
|
|
106
|
+
for (let col = 0; col < BOARD_SIZE; col++) {
|
|
107
|
+
if (board[row]?.[col]?.value === null) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Counts the number of mistakes in the current board
|
|
116
|
+
* @param board - GameBoard
|
|
117
|
+
* @param solution - 81-character solution string
|
|
118
|
+
* @returns Number of incorrect cells
|
|
119
|
+
*/
|
|
120
|
+
export function countMistakes(board, solution) {
|
|
121
|
+
return getIncorrectCells(board, solution).length;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Updates highlight state for all cells based on selected cell
|
|
125
|
+
* @param board - GameBoard
|
|
126
|
+
* @param selectedRow - Selected row (or null if nothing selected)
|
|
127
|
+
* @param selectedCol - Selected column (or null if nothing selected)
|
|
128
|
+
* @param highlightRelated - Whether to highlight related cells
|
|
129
|
+
* @param highlightSameValue - Whether to highlight cells with same value
|
|
130
|
+
* @returns Updated GameBoard
|
|
131
|
+
*/
|
|
132
|
+
export function updateCellHighlights(board, selectedRow, selectedCol, highlightRelated, highlightSameValue) {
|
|
133
|
+
const selectedValue = selectedRow !== null && selectedCol !== null
|
|
134
|
+
? board[selectedRow]?.[selectedCol]?.value
|
|
135
|
+
: null;
|
|
136
|
+
return board.map((row, rowIndex) => row.map((cell, colIndex) => {
|
|
137
|
+
const isSelected = rowIndex === selectedRow && colIndex === selectedCol;
|
|
138
|
+
let isHighlighted = false;
|
|
139
|
+
if (highlightRelated && selectedRow !== null && selectedCol !== null) {
|
|
140
|
+
// Same row
|
|
141
|
+
if (rowIndex === selectedRow)
|
|
142
|
+
isHighlighted = true;
|
|
143
|
+
// Same column
|
|
144
|
+
if (colIndex === selectedCol)
|
|
145
|
+
isHighlighted = true;
|
|
146
|
+
// Same block
|
|
147
|
+
const selectedBlockRow = Math.floor(selectedRow / 3);
|
|
148
|
+
const selectedBlockCol = Math.floor(selectedCol / 3);
|
|
149
|
+
const cellBlockRow = Math.floor(rowIndex / 3);
|
|
150
|
+
const cellBlockCol = Math.floor(colIndex / 3);
|
|
151
|
+
if (cellBlockRow === selectedBlockRow &&
|
|
152
|
+
cellBlockCol === selectedBlockCol) {
|
|
153
|
+
isHighlighted = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const isSameValue = highlightSameValue &&
|
|
157
|
+
selectedValue !== null &&
|
|
158
|
+
cell.value === selectedValue &&
|
|
159
|
+
!isSelected;
|
|
160
|
+
return {
|
|
161
|
+
...cell,
|
|
162
|
+
isSelected,
|
|
163
|
+
isHighlighted: isHighlighted && !isSelected,
|
|
164
|
+
isSameValue,
|
|
165
|
+
};
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Clears all highlights from the board
|
|
170
|
+
* @param board - GameBoard
|
|
171
|
+
* @returns Board with no highlights
|
|
172
|
+
*/
|
|
173
|
+
export function clearHighlights(board) {
|
|
174
|
+
return board.map(row => row.map(cell => ({
|
|
175
|
+
...cell,
|
|
176
|
+
isSelected: false,
|
|
177
|
+
isHighlighted: false,
|
|
178
|
+
isSameValue: false,
|
|
179
|
+
})));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Auto-removes pencilmarks from related cells when a value is placed
|
|
183
|
+
* @param board - GameBoard
|
|
184
|
+
* @param row - Row where value was placed
|
|
185
|
+
* @param col - Column where value was placed
|
|
186
|
+
* @param value - Value that was placed
|
|
187
|
+
* @returns Updated GameBoard with pencilmarks removed
|
|
188
|
+
*/
|
|
189
|
+
export function autoRemovePencilmarks(board, row, col, value) {
|
|
190
|
+
const blockStartRow = Math.floor(row / 3) * 3;
|
|
191
|
+
const blockStartCol = Math.floor(col / 3) * 3;
|
|
192
|
+
return board.map((r, rowIndex) => r.map((cell, colIndex) => {
|
|
193
|
+
// Check if this cell is in the same row, column, or block
|
|
194
|
+
const inSameRow = rowIndex === row;
|
|
195
|
+
const inSameCol = colIndex === col;
|
|
196
|
+
const inSameBlock = rowIndex >= blockStartRow &&
|
|
197
|
+
rowIndex < blockStartRow + 3 &&
|
|
198
|
+
colIndex >= blockStartCol &&
|
|
199
|
+
colIndex < blockStartCol + 3;
|
|
200
|
+
if (inSameRow || inSameCol || inSameBlock) {
|
|
201
|
+
const newPencilmarks = new Set(cell.pencilmarks);
|
|
202
|
+
newPencilmarks.delete(value);
|
|
203
|
+
return { ...cell, pencilmarks: newPencilmarks };
|
|
204
|
+
}
|
|
205
|
+
return cell;
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Gets the progress percentage (filled cells / total empty cells in original puzzle)
|
|
210
|
+
* @param board - GameBoard
|
|
211
|
+
* @returns Progress percentage (0-100)
|
|
212
|
+
*/
|
|
213
|
+
export function getProgressPercentage(board) {
|
|
214
|
+
let clueCount = 0;
|
|
215
|
+
let filledCount = 0;
|
|
216
|
+
for (let row = 0; row < BOARD_SIZE; row++) {
|
|
217
|
+
for (let col = 0; col < BOARD_SIZE; col++) {
|
|
218
|
+
const cell = board[row]?.[col];
|
|
219
|
+
if (cell) {
|
|
220
|
+
if (cell.isClue) {
|
|
221
|
+
clueCount++;
|
|
222
|
+
}
|
|
223
|
+
else if (cell.value !== null) {
|
|
224
|
+
filledCount++;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const totalEmptyCells = BOARD_SIZE * BOARD_SIZE - clueCount;
|
|
230
|
+
if (totalEmptyCells === 0)
|
|
231
|
+
return 100;
|
|
232
|
+
return Math.round((filledCount / totalEmptyCells) * 100);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Validates the entire game state
|
|
236
|
+
* @param state - GameState
|
|
237
|
+
* @returns Object with validation results
|
|
238
|
+
*/
|
|
239
|
+
export function validateGameState(state) {
|
|
240
|
+
return {
|
|
241
|
+
isComplete: isGameComplete(state.board, state.scrambledSolution),
|
|
242
|
+
isFilled: isBoardFilled(state.board),
|
|
243
|
+
mistakeCount: countMistakes(state.board, state.scrambledSolution),
|
|
244
|
+
progressPercentage: getProgressPercentage(state.board),
|
|
245
|
+
incorrectCells: getIncorrectCells(state.board, state.scrambledSolution),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAgB,EAChB,QAAgB,EAChB,GAAW,EACX,GAAW;IAEX,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CA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KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC;QACjE,kBAAkB,EAAE,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC;QACtD,cAAc,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC;KACxE,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sudobility/sudojo_lib",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Business logic library for Sudojo app",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**/*"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.build.json",
|
|
13
|
+
"build:watch": "tsc --watch",
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
16
|
+
"test": "vitest",
|
|
17
|
+
"test:run": "vitest run",
|
|
18
|
+
"test:coverage": "vitest run --coverage",
|
|
19
|
+
"test:coverage:watch": "vitest --coverage --watch",
|
|
20
|
+
"test:coverage:threshold": "vitest run --coverage --reporter=verbose",
|
|
21
|
+
"test:watch": "vitest --watch",
|
|
22
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
23
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
24
|
+
"format": "prettier --write src/**/*.ts",
|
|
25
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"typecheck:watch": "tsc --noEmit --watch",
|
|
28
|
+
"check-all": "npm run lint && npm run typecheck && npm run test:run",
|
|
29
|
+
"quick-check": "npm run lint && npm run typecheck",
|
|
30
|
+
"dev": "npm run build:watch"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"sudojo",
|
|
34
|
+
"typescript",
|
|
35
|
+
"library",
|
|
36
|
+
"dependency-injection"
|
|
37
|
+
],
|
|
38
|
+
"author": "Sudobility team",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@sudobility/di": "^1.5.5",
|
|
42
|
+
"@sudobility/sudojo_client": "^0.0.7",
|
|
43
|
+
"@sudobility/sudojo_types": "^1.1.2",
|
|
44
|
+
"@sudobility/types": "^1.9.31",
|
|
45
|
+
"@tanstack/react-query": "^5.90.11",
|
|
46
|
+
"@testing-library/react": "^16.3.0",
|
|
47
|
+
"@types/node": "^24.7.1",
|
|
48
|
+
"@types/react": "^19.2.2",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
50
|
+
"@typescript-eslint/parser": "^8.46.0",
|
|
51
|
+
"@vitest/coverage-v8": "^4.0.4",
|
|
52
|
+
"@vitest/ui": "^4.0.4",
|
|
53
|
+
"eslint": "^9.37.0",
|
|
54
|
+
"eslint-config-prettier": "^10.1.8",
|
|
55
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
56
|
+
"happy-dom": "^20.0.0",
|
|
57
|
+
"prettier": "^3.6.2",
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^19.2.3",
|
|
60
|
+
"typescript": "^5.9.3",
|
|
61
|
+
"vite": "^7.1.9",
|
|
62
|
+
"vitest": "^4.0.4"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@sudobility/di": "^1.5.5",
|
|
66
|
+
"@sudobility/sudojo_client": "^0.0.7",
|
|
67
|
+
"@sudobility/sudojo_types": "^1.1.2",
|
|
68
|
+
"@sudobility/types": "^1.9.31",
|
|
69
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
70
|
+
"react": ">=18.0.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=18.0.0",
|
|
74
|
+
"npm": ">=8.0.0"
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "restricted"
|
|
78
|
+
}
|
|
79
|
+
}
|