mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-28 05:57:19 +00:00
chore: bump dependencies and clear deprecated frontend APIs
Routine dependency refresh: telego 1.11.2, go-sqlite3 1.14.50, grpc 1.83.1,
miekg/dns 1.1.73, sing 0.8.14 and the usual indirect churn on the Go side;
react-query 5.102.2, i18next 26.4.0, react-hook-form 7.86.0, Storybook
10.5.10 and vite 8.2.2 on the frontend, which also lifts the private frontend
package to 1.0.0.
That left npm run lint:deprecated with five call sites. Zod 4 deprecates the
ZodTypeAny alias in favour of the bare z.ZodType constraint, and react-query
renamed queryClient.fetchQuery to queryClient.query ahead of removing the old
name in the next major — the two share an implementation, so the swap in the
settings test is behaviour-identical.
Also untracks internal/web/dist/.gitkeep. 1872659d dropped its gitignore
exception on the grounds that nothing under dist/ is ever meant to be
tracked, but the file was already in the index, so the rule never applied and
every frontend build that empties dist/ resurfaced it as a spurious deletion.
make dist-stub and every CI job recreate it on disk.
This commit is contained in:
@@ -8,7 +8,7 @@ const optionalClearedInt = (schema: z.ZodNumber) =>
|
||||
|
||||
// Same null-absorbing preprocess for fields that keep a schema default:
|
||||
// clearing the InputNumber refills the default instead of blocking the save.
|
||||
const clearedToDefault = <T extends z.ZodTypeAny>(schema: T) =>
|
||||
const clearedToDefault = <T extends z.ZodType>(schema: T) =>
|
||||
z.preprocess((v) => (v == null ? undefined : v), schema);
|
||||
|
||||
// An AmneziaWG client (multi-client model). Same key/address fields as
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('useAllSettings', () => {
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
|
||||
await queryClient.fetchQuery(defaultsQuery);
|
||||
await queryClient.query(defaultsQuery);
|
||||
const { result } = renderHook(() => useAllSettings(), { wrapper });
|
||||
|
||||
await waitFor(() => expect(result.current.fetched).toBe(true));
|
||||
@@ -37,7 +37,7 @@ describe('useAllSettings', () => {
|
||||
await result.current.saveAll();
|
||||
});
|
||||
|
||||
const defaults = await queryClient.fetchQuery(defaultsQuery);
|
||||
const defaults = await queryClient.query(defaultsQuery);
|
||||
expect(fetchDefaults).toHaveBeenCalledTimes(2);
|
||||
expect(defaults.subURI).toBe('https://example.com/my_custom_path/');
|
||||
});
|
||||
@@ -61,7 +61,7 @@ describe('useAllSettings', () => {
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
|
||||
await queryClient.fetchQuery(defaultsQuery);
|
||||
await queryClient.query(defaultsQuery);
|
||||
const { result } = renderHook(() => useAllSettings(), { wrapper });
|
||||
|
||||
await waitFor(() => expect(result.current.fetched).toBe(true));
|
||||
@@ -69,7 +69,7 @@ describe('useAllSettings', () => {
|
||||
await result.current.saveAll();
|
||||
});
|
||||
|
||||
const defaults = await queryClient.fetchQuery(defaultsQuery);
|
||||
const defaults = await queryClient.query(defaultsQuery);
|
||||
expect(fetchDefaults).toHaveBeenCalledOnce();
|
||||
expect(defaults.subURI).toBe('https://example.com/sub/');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user