ps99-api 2.4.0 → 2.6.0
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/.github/workflows/release-on-main.yml +1 -2
- package/.idea/runConfigurations/test_changing.xml +1 -1
- package/debug_currency.json +57 -0
- package/debug_goals.json +271 -0
- package/dist/ps99-api.d.ts +2 -0
- package/dist/ps99-api.js +4 -1
- package/dist/ps99-api.js.map +1 -1
- package/dist/request-client/axios.js +6 -1
- package/dist/request-client/axios.js.map +1 -1
- package/dist/responses/collection/index.d.ts +1 -0
- package/dist/responses/collection/index.js +15 -0
- package/dist/responses/collection/index.js.map +1 -1
- package/dist/responses/collection/rarity.d.ts +1 -0
- package/example-web/react/package-lock.json +1504 -1470
- package/example-web/react2/package-lock.json +3089 -2766
- package/example-web/react2/package.json +6 -1
- package/example-web/react2/public/assets/gold_variant_icon.png +0 -0
- package/example-web/react2/public/assets/hot_cocoa_egg.png +0 -0
- package/example-web/react2/public/index.html +34 -31
- package/example-web/react2/src/App.tsx +15 -15
- package/example-web/react2/src/assets/guild_placeholder.png +0 -0
- package/example-web/react2/src/components/AchievementsComponent.tsx +74 -19
- package/example-web/react2/src/components/AutoSizer.tsx +49 -0
- package/example-web/react2/src/components/BoostsComponent.tsx +16 -5
- package/example-web/react2/src/components/BoothsComponent.tsx +22 -52
- package/example-web/react2/src/components/BoxesComponent.tsx +48 -16
- package/example-web/react2/src/components/BuffsComponent.tsx +82 -34
- package/example-web/react2/src/components/CharmsComponent.tsx +84 -24
- package/example-web/react2/src/components/CollectionConfigIndex.tsx +867 -33
- package/example-web/react2/src/components/CollectionsIndex.tsx +380 -27
- package/example-web/react2/src/components/CollectionsLayout.tsx +60 -0
- package/example-web/react2/src/components/CurrencyComponent.tsx +57 -39
- package/example-web/react2/src/components/DynamicCollectionConfigData.tsx +172 -15
- package/example-web/react2/src/components/EggsComponent.tsx +50 -12
- package/example-web/react2/src/components/EnchantsComponent.tsx +88 -42
- package/example-web/react2/src/components/FishingRodsComponent.tsx +36 -22
- package/example-web/react2/src/components/Footer.tsx +18 -8
- package/example-web/react2/src/components/FruitsComponent.tsx +40 -17
- package/example-web/react2/src/components/GenericFetchComponent.tsx +9 -1
- package/example-web/react2/src/components/GuildBattlesComponent.tsx +41 -34
- package/example-web/react2/src/components/Header.tsx +39 -52
- package/example-web/react2/src/components/HomePage.tsx +15 -17
- package/example-web/react2/src/components/HoverboardsComponent.tsx +23 -99
- package/example-web/react2/src/components/ImageComponent.tsx +255 -45
- package/example-web/react2/src/components/ItemCard.tsx +240 -0
- package/example-web/react2/src/components/LootboxesComponent.tsx +22 -7
- package/example-web/react2/src/components/MasteryComponent.tsx +165 -30
- package/example-web/react2/src/components/MerchantsComponent.tsx +41 -16
- package/example-web/react2/src/components/MiscItemsComponent.tsx +26 -31
- package/example-web/react2/src/components/PetsComponent.tsx +100 -61
- package/example-web/react2/src/components/PotionsComponent.tsx +121 -27
- package/example-web/react2/src/components/RandomEventsComponent.tsx +32 -23
- package/example-web/react2/src/components/RanksComponent.tsx +187 -62
- package/example-web/react2/src/components/RarityComponent.tsx +123 -5
- package/example-web/react2/src/components/ReactWindowMock.tsx +73 -0
- package/example-web/react2/src/components/RebirthsComponent.tsx +36 -19
- package/example-web/react2/src/components/SecretRoomsComponent.tsx +5 -4
- package/example-web/react2/src/components/SeedsComponent.tsx +41 -21
- package/example-web/react2/src/components/ShovelsComponent.tsx +21 -9
- package/example-web/react2/src/components/Sidebar.tsx +105 -0
- package/example-web/react2/src/components/SprinklersComponent.tsx +25 -10
- package/example-web/react2/src/components/Tooltip.tsx +36 -0
- package/example-web/react2/src/components/UltimatesComponent.tsx +28 -16
- package/example-web/react2/src/components/UpgradesComponent.tsx +97 -47
- package/example-web/react2/src/components/WateringCansComponent.tsx +20 -14
- package/example-web/react2/src/components/WorldsComponent.tsx +21 -11
- package/example-web/react2/src/components/XPPotionsComponent.tsx +28 -11
- package/example-web/react2/src/components/ZoneFlagsComponent.tsx +25 -14
- package/example-web/react2/src/components/ZonesComponent.tsx +43 -60
- package/example-web/react2/src/constants/collectionIcons.ts +29 -0
- package/example-web/react2/src/context/CollectionDataContext.tsx +62 -0
- package/example-web/react2/src/context/ScrollContext.tsx +35 -0
- package/example-web/react2/src/hooks/useCollapsibleHeader.ts +69 -0
- package/example-web/react2/src/hooks/useExpandableList.ts +38 -0
- package/example-web/react2/src/hooks/useItemResolution.ts +351 -0
- package/example-web/react2/src/index.css +257 -0
- package/example-web/react2/src/index.tsx +2 -1
- package/example-web/react2/src/utils/gigantix.ts +40 -0
- package/example-web/react2/temp_model.rbxm +0 -0
- package/example-web/react2/webpack.config.js +103 -47
- package/package.json +11 -11
- package/ranks.json +1 -0
- package/repro_collection_fetch.ts +33 -0
- package/repro_image_fetch.ts +50 -0
- package/src/__tests__/__snapshots__/ps99-api-changes.ts.snap +34841 -10439
- package/src/__tests__/__snapshots__/ps99-api-live.ts.snap +160667 -67217
- package/src/ps99-api.ts +9 -5
- package/src/request-client/axios.ts +6 -2
- package/src/responses/collection/index.ts +1 -0
- package/src/responses/collection/rarity.ts +1 -0
- package/tsconfig.json +1 -1
- package/example-web/react2/public/service-worker.js +0 -63
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/* Import a cute, rounded font */
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap');
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--bg-color: #e0f7fa;
|
|
6
|
+
--primary-color: #4fc3f7;
|
|
7
|
+
--secondary-color: #ff8a65;
|
|
8
|
+
--accent-color: #ffd54f;
|
|
9
|
+
--text-color: #37474f;
|
|
10
|
+
--card-bg: #ffffff;
|
|
11
|
+
--border-radius: 16px;
|
|
12
|
+
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
13
|
+
--border-width: 3px;
|
|
14
|
+
--border-color: #263238;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html,
|
|
18
|
+
body,
|
|
19
|
+
#root {
|
|
20
|
+
height: 100%;
|
|
21
|
+
margin: 0;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
/* Prevent body scroll, let apps handle it */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#root {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body {
|
|
32
|
+
margin: 0;
|
|
33
|
+
font-family: 'Fredoka', sans-serif;
|
|
34
|
+
background-color: var(--bg-color);
|
|
35
|
+
color: var(--text-color);
|
|
36
|
+
-webkit-font-smoothing: antialiased;
|
|
37
|
+
-moz-osx-font-smoothing: grayscale;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
h1,
|
|
41
|
+
h2,
|
|
42
|
+
h3,
|
|
43
|
+
h4,
|
|
44
|
+
h5,
|
|
45
|
+
h6 {
|
|
46
|
+
color: var(--text-color);
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
letter-spacing: 1px;
|
|
49
|
+
text-shadow: 2px 2px 0px white;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
a {
|
|
53
|
+
color: var(--primary-color);
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
a:hover {
|
|
59
|
+
text-decoration: underline;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Button Styles */
|
|
63
|
+
.game-button {
|
|
64
|
+
display: inline-block;
|
|
65
|
+
padding: 12px 24px;
|
|
66
|
+
background-color: var(--primary-color);
|
|
67
|
+
color: white;
|
|
68
|
+
font-size: 1.2rem;
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
border: var(--border-width) solid var(--border-color);
|
|
71
|
+
border-radius: var(--border-radius);
|
|
72
|
+
box-shadow: 4px 4px 0px var(--border-color);
|
|
73
|
+
transition: all 0.1s ease;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
text-transform: uppercase;
|
|
76
|
+
text-decoration: none !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.game-button:hover {
|
|
80
|
+
transform: translate(-2px, -2px);
|
|
81
|
+
box-shadow: 6px 6px 0px var(--border-color);
|
|
82
|
+
background-color: #29b6f6;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.game-button:active {
|
|
86
|
+
transform: translate(2px, 2px);
|
|
87
|
+
box-shadow: 0px 0px 0px var(--border-color);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.game-button.secondary {
|
|
91
|
+
background-color: var(--secondary-color);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.game-button.accent {
|
|
95
|
+
background-color: var(--accent-color);
|
|
96
|
+
color: var(--text-color);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Grids */
|
|
100
|
+
.item-grid {
|
|
101
|
+
display: grid;
|
|
102
|
+
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
|
103
|
+
gap: 16px;
|
|
104
|
+
padding: 20px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.collection-grid {
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
110
|
+
gap: 20px;
|
|
111
|
+
padding: 20px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Cards */
|
|
115
|
+
.game-card {
|
|
116
|
+
background: var(--card-bg);
|
|
117
|
+
border: var(--border-width) solid var(--border-color);
|
|
118
|
+
border-radius: var(--border-radius);
|
|
119
|
+
padding: 16px;
|
|
120
|
+
text-align: center;
|
|
121
|
+
box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
|
|
122
|
+
transition: transform 0.2s;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
position: relative;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.game-card:hover {
|
|
131
|
+
transform: translateY(-5px);
|
|
132
|
+
box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.15);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.game-card img {
|
|
136
|
+
max-width: 100%;
|
|
137
|
+
height: auto;
|
|
138
|
+
border-radius: 8px;
|
|
139
|
+
margin-bottom: 8px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Tooltips */
|
|
143
|
+
.tooltip-container {
|
|
144
|
+
position: relative;
|
|
145
|
+
display: inline-block;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.tooltip-popover {
|
|
149
|
+
position: absolute;
|
|
150
|
+
bottom: 120%;
|
|
151
|
+
left: 50%;
|
|
152
|
+
transform: translateX(-50%);
|
|
153
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
154
|
+
border: 2px solid var(--border-color);
|
|
155
|
+
border-radius: 8px;
|
|
156
|
+
padding: 10px;
|
|
157
|
+
min-width: 200px;
|
|
158
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
159
|
+
z-index: 1000;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
/* Prevent tooltip from blocking interaction */
|
|
162
|
+
font-size: 0.9rem;
|
|
163
|
+
line-height: 1.4;
|
|
164
|
+
text-align: left;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.tooltip-popover h4 {
|
|
168
|
+
margin: 0 0 5px 0;
|
|
169
|
+
font-size: 1rem;
|
|
170
|
+
color: var(--secondary-color);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
.badge {
|
|
175
|
+
background: #e0f2f1;
|
|
176
|
+
color: #00695c;
|
|
177
|
+
padding: 4px 8px;
|
|
178
|
+
border-radius: 12px;
|
|
179
|
+
font-size: 0.8em;
|
|
180
|
+
font-weight: bold;
|
|
181
|
+
border: 1px solid #b2dfdb;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* Animations */
|
|
185
|
+
@keyframes sheen {
|
|
186
|
+
0% {
|
|
187
|
+
transform: translateX(-100%) rotate(45deg);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
20%,
|
|
191
|
+
100% {
|
|
192
|
+
transform: translateX(100%) rotate(45deg);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.sheen-effect {
|
|
197
|
+
position: relative;
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.sheen-effect::after {
|
|
202
|
+
content: '';
|
|
203
|
+
position: absolute;
|
|
204
|
+
top: 0;
|
|
205
|
+
left: 0;
|
|
206
|
+
width: 100%;
|
|
207
|
+
height: 100%;
|
|
208
|
+
background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
|
|
209
|
+
transform: translateX(-100%);
|
|
210
|
+
animation: sheen 3s infinite;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@keyframes shine {
|
|
214
|
+
0% {
|
|
215
|
+
left: -100%;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
100% {
|
|
219
|
+
left: 100%;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Header & Footer */
|
|
224
|
+
.game-header {
|
|
225
|
+
padding: 1rem;
|
|
226
|
+
background-color: var(--primary-color);
|
|
227
|
+
border-bottom: var(--border-width) solid var(--border-color);
|
|
228
|
+
display: flex;
|
|
229
|
+
justify-content: space-between;
|
|
230
|
+
align-items: center;
|
|
231
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.game-header a {
|
|
235
|
+
color: white;
|
|
236
|
+
text-decoration: none;
|
|
237
|
+
text-shadow: 2px 2px 0px var(--border-color);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.game-header ol {
|
|
241
|
+
display: flex;
|
|
242
|
+
list-style: none;
|
|
243
|
+
padding: 0;
|
|
244
|
+
margin: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.game-header ol li {
|
|
248
|
+
margin: 0 0.5em;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.game-footer {
|
|
252
|
+
text-align: center;
|
|
253
|
+
padding: 1rem;
|
|
254
|
+
margin-top: 2rem;
|
|
255
|
+
background-color: var(--card-bg);
|
|
256
|
+
border-top: var(--border-width) solid var(--border-color);
|
|
257
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import "./index.css";
|
|
2
3
|
import { createRoot } from "react-dom/client";
|
|
3
4
|
import App from "./App";
|
|
4
5
|
import * as serviceWorkerRegistration from "./serviceWorkerRegistration";
|
|
@@ -8,4 +9,4 @@ const root = createRoot(container!);
|
|
|
8
9
|
root.render(<App />);
|
|
9
10
|
|
|
10
11
|
// Register the service worker
|
|
11
|
-
serviceWorkerRegistration.
|
|
12
|
+
serviceWorkerRegistration.unregister();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
export const GIGANTIX_SUFFIXES = [
|
|
3
|
+
"", "K", "M", "B", "T", "Qa", "Qi", "Sx", "Sp", "Oc", "No", "Dc",
|
|
4
|
+
"UD", "DD", "TD", "QaD", "QiD", "SxD", "SpD", "OcD", "NnD", "Vi",
|
|
5
|
+
"UVg", "DVg", "TVg", "QaVg", "QiVg", "SxVg", "SpVg", "OcVg", "NoVg", "Tg",
|
|
6
|
+
"QaG", "QiG", "SxG", "SpG", "OcG", "NoG", "Ce"
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export function formatGigantix(value: number | string, decimals = 2): string {
|
|
10
|
+
if (!value) return "0";
|
|
11
|
+
|
|
12
|
+
let num = typeof value === 'string' ? parseFloat(value) : value;
|
|
13
|
+
|
|
14
|
+
if (isNaN(num)) return "0";
|
|
15
|
+
if (num < 1000) {
|
|
16
|
+
// Round to decimals (default 2), remove trailing zeros
|
|
17
|
+
return parseFloat(num.toFixed(decimals)).toString();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Find the tier (power of 1000)
|
|
21
|
+
// log1000(num) = log10(num) / 3
|
|
22
|
+
const tier = Math.floor(Math.log10(num) / 3);
|
|
23
|
+
|
|
24
|
+
// Ensure we don't exceed our defined suffixes
|
|
25
|
+
if (tier >= GIGANTIX_SUFFIXES.length) {
|
|
26
|
+
return num.toExponential(decimals);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const suffix = GIGANTIX_SUFFIXES[tier];
|
|
30
|
+
const scale = Math.pow(10, tier * 3);
|
|
31
|
+
const scaled = num / scale;
|
|
32
|
+
|
|
33
|
+
// Format to desired decimals, removing trailing zeros if needed
|
|
34
|
+
let formatted = scaled.toFixed(decimals);
|
|
35
|
+
if (formatted.indexOf('.') !== -1) {
|
|
36
|
+
formatted = formatted.replace(/\.?0+$/, '');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return `${formatted}${suffix}`;
|
|
40
|
+
}
|
|
Binary file
|
|
@@ -1,59 +1,115 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
3
3
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
4
|
+
const WorkboxWebpackPlugin = require("workbox-webpack-plugin");
|
|
4
5
|
|
|
5
|
-
module.exports = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
module.exports = (env, argv) => {
|
|
7
|
+
const isProduction = argv.mode === "production";
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
entry: "./src/index.tsx",
|
|
11
|
+
devtool: isProduction ? "source-map" : "inline-source-map",
|
|
12
|
+
module: {
|
|
13
|
+
rules: [
|
|
14
|
+
{
|
|
15
|
+
test: /\.tsx?$/,
|
|
16
|
+
use: ["ts-loader"],
|
|
17
|
+
exclude: /node_modules/,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
test: /\.css$/i,
|
|
21
|
+
use: ["style-loader", "css-loader"], // Add style-loader here to properly handle CSS
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
|
25
|
+
type: "asset/resource",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
resolve: {
|
|
30
|
+
extensions: [".tsx", ".ts", ".js"],
|
|
31
|
+
alias: {
|
|
32
|
+
"ps99-api": path.resolve(__dirname, "../../src"),
|
|
18
33
|
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
resolve: {
|
|
22
|
-
extensions: [".tsx", ".ts", ".js"],
|
|
23
|
-
alias: {
|
|
24
|
-
"ps99-api": path.resolve(__dirname, "../../src"),
|
|
25
34
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
path: path.resolve(__dirname, "dist"),
|
|
30
|
-
publicPath: "/node-ps99-api/",
|
|
31
|
-
},
|
|
32
|
-
plugins: [
|
|
33
|
-
new HtmlWebpackPlugin({
|
|
34
|
-
template: path.join(__dirname, "public", "index.html"),
|
|
35
|
+
output: {
|
|
36
|
+
filename: "bundle.js",
|
|
37
|
+
path: path.resolve(__dirname, "dist"),
|
|
35
38
|
publicPath: "/node-ps99-api/",
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
},
|
|
40
|
+
plugins: [
|
|
41
|
+
new HtmlWebpackPlugin({
|
|
42
|
+
template: path.join(__dirname, "public", "index.html"),
|
|
43
|
+
publicPath: "/node-ps99-api/",
|
|
44
|
+
}),
|
|
45
|
+
new CopyWebpackPlugin({
|
|
46
|
+
patterns: [
|
|
47
|
+
{
|
|
48
|
+
from: path.resolve(__dirname, "public"),
|
|
49
|
+
to: path.resolve(__dirname, "dist"),
|
|
50
|
+
globOptions: {
|
|
51
|
+
ignore: ["**/index.html"], // Ignore index.html to avoid conflict
|
|
52
|
+
},
|
|
44
53
|
},
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
// Only generate Service Worker in production to avoid "called multiple times" warning in watch mode
|
|
57
|
+
...(isProduction
|
|
58
|
+
? [
|
|
59
|
+
new WorkboxWebpackPlugin.GenerateSW({
|
|
60
|
+
clientsClaim: true,
|
|
61
|
+
skipWaiting: true,
|
|
62
|
+
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
|
|
63
|
+
runtimeCaching: [
|
|
64
|
+
{
|
|
65
|
+
urlPattern: ({ url }) => url.pathname.includes("/api/"),
|
|
66
|
+
handler: "NetworkFirst",
|
|
67
|
+
options: {
|
|
68
|
+
cacheName: "api-cache",
|
|
69
|
+
networkTimeoutSeconds: 10,
|
|
70
|
+
expiration: {
|
|
71
|
+
maxEntries: 50,
|
|
72
|
+
maxAgeSeconds: 60 * 60, // 1 hour
|
|
73
|
+
},
|
|
74
|
+
cacheableResponse: {
|
|
75
|
+
statuses: [0, 200],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
urlPattern: ({ request }) => request.destination === "image",
|
|
81
|
+
handler: "CacheFirst",
|
|
82
|
+
options: {
|
|
83
|
+
cacheName: "images",
|
|
84
|
+
expiration: {
|
|
85
|
+
maxEntries: 100,
|
|
86
|
+
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
}),
|
|
92
|
+
]
|
|
93
|
+
: []),
|
|
94
|
+
],
|
|
95
|
+
devServer: {
|
|
96
|
+
static: {
|
|
97
|
+
directory: path.join(__dirname, "public"),
|
|
98
|
+
},
|
|
99
|
+
compress: true,
|
|
100
|
+
port: 9000,
|
|
101
|
+
historyApiFallback: {
|
|
102
|
+
index: "/node-ps99-api/index.html",
|
|
103
|
+
},
|
|
104
|
+
proxy: [
|
|
105
|
+
{
|
|
106
|
+
context: ["/api", "/image"],
|
|
107
|
+
target: "https://biggamesapi.io",
|
|
108
|
+
secure: false,
|
|
109
|
+
changeOrigin: true,
|
|
110
|
+
logLevel: "debug",
|
|
45
111
|
},
|
|
46
112
|
],
|
|
47
|
-
}),
|
|
48
|
-
],
|
|
49
|
-
devServer: {
|
|
50
|
-
static: {
|
|
51
|
-
directory: path.join(__dirname, "public"),
|
|
52
|
-
},
|
|
53
|
-
compress: true,
|
|
54
|
-
port: 9000,
|
|
55
|
-
historyApiFallback: {
|
|
56
|
-
index: "/node-ps99-api/index.html",
|
|
57
113
|
},
|
|
58
|
-
}
|
|
114
|
+
};
|
|
59
115
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ps99-api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Pet Simulator Public API wrapper written in Typescript.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@jest/globals": "^29.7.0",
|
|
25
25
|
"@semantic-release/git": "^10.0.1",
|
|
26
|
-
"@tsconfig/
|
|
27
|
-
"@types/jest": "^29.5.
|
|
28
|
-
"@types/node": "^
|
|
26
|
+
"@tsconfig/node22": "^22.0.5",
|
|
27
|
+
"@types/jest": "^29.5.14",
|
|
28
|
+
"@types/node": "^25.2.3",
|
|
29
29
|
"cz-conventional-changelog": "^3.3.0",
|
|
30
|
-
"dets": "^0.
|
|
31
|
-
"esbuild": "0.
|
|
30
|
+
"dets": "^0.17.0",
|
|
31
|
+
"esbuild": "^0.27.3",
|
|
32
32
|
"jest": "^29.7.0",
|
|
33
|
-
"prettier": "^3.
|
|
34
|
-
"semantic-release": "^
|
|
35
|
-
"ts-jest": "^29.
|
|
36
|
-
"typescript": "^5.
|
|
33
|
+
"prettier": "^3.8.1",
|
|
34
|
+
"semantic-release": "^25.0.3",
|
|
35
|
+
"ts-jest": "^29.4.6",
|
|
36
|
+
"typescript": "^5.9.3"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"axios": "^1.
|
|
39
|
+
"axios": "^1.13.5"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|