akanjs 2.1.0 → 2.1.1-rc.1

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/README.ko.md CHANGED
@@ -41,7 +41,7 @@ bunx create-akan-workspace@latest
41
41
  CLI를 전역으로 설치해서 사용할 수도 있습니다.
42
42
 
43
43
  ```bash
44
- bun install -g akanjs --latest
44
+ bun install -g @akanjs/cli --latest
45
45
  akan create-workspace
46
46
  cd <workspace-name>
47
47
  akan start <app-name> --open
package/README.md CHANGED
@@ -40,7 +40,7 @@ bunx create-akan-workspace@latest
40
40
  Or install the CLI globally:
41
41
 
42
42
  ```bash
43
- bun install -g akanjs --latest
43
+ bun install -g @akanjs/cli --latest
44
44
  akan create-workspace
45
45
  cd <workspace-name>
46
46
  akan start <app-name> --open
@@ -33,7 +33,7 @@ export type PurifiedModel<T> = T extends Upload[]
33
33
  ? FileList
34
34
  : T extends (infer S)[]
35
35
  ? PurifiedModel<S>[]
36
- : T extends string | number | boolean | Dayjs
36
+ : T extends string | number | boolean | Dayjs | File
37
37
  ? T
38
38
  : T extends Map<infer K, infer V>
39
39
  ? Map<K, PurifiedModel<V>>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "2.1.0",
3
+ "version": "2.1.1-rc.1",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -457,7 +457,7 @@ export class WebSocketExecutionContext<Appended = unknown> {
457
457
  makeResponse(result: unknown, endpointInfo: EndpointInfo) {
458
458
  return serialize(endpointInfo.returns.returnRef, endpointInfo.returns.arrDepth, result, "object", {
459
459
  nullable: endpointInfo.returns.nullable,
460
- }) as unknown as Response;
460
+ }) as unknown as Response;
461
461
  }
462
462
  on(event: "disconnect" | "unsubscribe", handler: () => void) {
463
463
  if (event === "disconnect") this.onDisconnect.add(handler);
@@ -88,13 +88,13 @@ export const setupSignalTestTarget = async <Fetch = FetchProxy>(
88
88
  terminatingContext = undefined;
89
89
  const resolvedOptions = { ...configuredOptions, ...options };
90
90
  const env: BackendEnv = {
91
- repoName: process.env.AKAN_PUBLIC_REPO_NAME ?? "akansoft",
92
- serveDomain: process.env.AKAN_PUBLIC_SERVE_DOMAIN ?? "akamir.com",
91
+ repoName: process.env.AKAN_PUBLIC_REPO_NAME ?? "akanjs",
92
+ serveDomain: process.env.AKAN_PUBLIC_SERVE_DOMAIN ?? "akanjs.com",
93
93
  appName: name,
94
94
  environment: "testing",
95
95
  operationMode: "local",
96
- tunnelUsername: process.env.SSH_TUNNEL_USERNAME ?? "root",
97
- tunnelPassword: process.env.SSH_TUNNEL_PASSWORD ?? process.env.AKAN_PUBLIC_REPO_NAME ?? "akansoft",
96
+ tunnelUsername: process.env.SSH_TUNNEL_USERNAME ?? "username",
97
+ tunnelPassword: process.env.SSH_TUNNEL_PASSWORD ?? process.env.AKAN_PUBLIC_REPO_NAME ?? "password",
98
98
  };
99
99
  TestServer.applyProcessEnv(env, resolvedOptions);
100
100
 
@@ -6,7 +6,7 @@ type PurifiedWithObjectToId<T, StateKeys extends keyof GetStateObject<T> = keyof
6
6
  } & {
7
7
  [K in StateKeys as null extends T[K] ? K : never]?: Purified<T[K]> | undefined;
8
8
  };
9
- export type PurifiedModel<T> = T extends Upload[] ? FileList : T extends (infer S)[] ? PurifiedModel<S>[] : T extends string | number | boolean | Dayjs ? T : T extends Map<infer K, infer V> ? Map<K, PurifiedModel<V>> : PurifiedWithObjectToId<T>;
9
+ export type PurifiedModel<T> = T extends Upload[] ? FileList : T extends (infer S)[] ? PurifiedModel<S>[] : T extends string | number | boolean | Dayjs | File ? T : T extends Map<infer K, infer V> ? Map<K, PurifiedModel<V>> : PurifiedWithObjectToId<T>;
10
10
  export type PurifyFunc<Input, _DefaultInput = DefaultOf<Input>, _PurifiedInput = PurifiedModel<Input>> = (self: _DefaultInput, isChild?: boolean) => _PurifiedInput | null;
11
11
  export declare const makePurify: <I>(modelRef: ConstantCls<I>) => PurifyFunc<I>;
12
12
  export {};
@@ -10,8 +10,8 @@ export { useCsrValues } from "./useCsrValues.d.ts";
10
10
  export { useDebounce } from "./useDebounce.d.ts";
11
11
  export { useFetch, useFetchFn } from "./useFetch.d.ts";
12
12
  export { useGeoLocation } from "./useGeoLocation.d.ts";
13
- export { useInterval } from "./useInterval.d.ts";
14
- export { usePushNoti } from "./usePushNoti.d.ts";
15
13
  export { useHistory } from "./useHistory.d.ts";
14
+ export { useInterval } from "./useInterval.d.ts";
16
15
  export { useLocation } from "./useLocation.d.ts";
16
+ export { usePushNoti } from "./usePushNoti.d.ts";
17
17
  export { useThrottle } from "./useThrottle.d.ts";
package/ui/Field.tsx CHANGED
@@ -137,7 +137,6 @@ interface TextProps {
137
137
  labelClassName?: string;
138
138
  className?: string;
139
139
  value: string | null;
140
-
141
140
  onChange: (value: string) => void;
142
141
  inputClassName?: string;
143
142
  placeholder?: string;
@@ -18,7 +18,7 @@ export interface NavbarProps {
18
18
  }
19
19
 
20
20
  export const Navbar = ({ back = false, className, height, children, title, left, right }: NavbarProps) => {
21
- const [render, setRender] = useState(false);
21
+ const [render, setRender] = useState(false);
22
22
  const { location } = usePathCtx();
23
23
  const suffix = getEnv().renderMode === "csr" ? `-${location.pathRoute.path}` : "";
24
24
  useEffect(() => {
@@ -11,7 +11,7 @@ export interface TopLeftActionProps {
11
11
  }
12
12
 
13
13
  export const TopLeftAction = ({ className, children }: TopLeftActionProps) => {
14
- const [render, setRender] = useState(false);
14
+ const [render, setRender] = useState(false);
15
15
  const { location } = usePathCtx();
16
16
  const suffix = getEnv().renderMode === "csr" ? `-${location.pathRoute.path}` : "";
17
17
  useEffect(() => {
package/ui/Load/Units.tsx CHANGED
@@ -140,7 +140,7 @@ function Render<RefName extends string, Light extends { id: string }>({
140
140
  [namesOfSlice.queryArgsOfModel]: initQueryArgsOfModel,
141
141
  [namesOfSlice.sortOfModel]: initSortOfModel,
142
142
  });
143
- loaded.current = true;
143
+ loaded.current = true;
144
144
  }, []);
145
145
 
146
146
  const modelInsight = storeUse[namesOfSlice.modelInsight]() as BaseInsight;
@@ -214,6 +214,16 @@ function applyThemePolicy(theme: AkanTheme): void {
214
214
  document.documentElement.setAttribute("data-theme", theme);
215
215
  }
216
216
 
217
+ function buildSearchParams(entries: Iterable<[string, string]>): Record<string, string | string[]> {
218
+ const params: Record<string, string | string[]> = {};
219
+ for (const [key, value] of entries) {
220
+ const current = params[key];
221
+ if (current === undefined) params[key] = value;
222
+ else params[key] = Array.isArray(current) ? [...current, value] : [current, value];
223
+ }
224
+ return params;
225
+ }
226
+
217
227
  export const ClientInner = () => {
218
228
  const uiOperation = st.use.uiOperation();
219
229
  return (
@@ -249,13 +259,7 @@ export const ClientSsrBridge = ({ lang, prefix = "" }: ClientSsrBridgeProps) =>
249
259
  const syncHref = (href: string) => {
250
260
  const url = new URL(href, window.location.origin);
251
261
  const { path } = getPathInfo(`${url.pathname}${url.search}${url.hash}`, lang, prefix);
252
- const searchParams = [...url.searchParams.entries()].reduce<Record<string, string | string[]>>(
253
- (params, [key, value]) => {
254
- params[key] = params[key] ? [...(Array.isArray(params[key]) ? params[key] : [params[key]]), value] : value;
255
- return params;
256
- },
257
- {},
258
- );
262
+ const searchParams = buildSearchParams(url.searchParams.entries());
259
263
  st.set({ pathname: url.pathname, path, searchParams });
260
264
  };
261
265
  router.init({
@@ -289,13 +293,7 @@ export const ClientSsrBridge = ({ lang, prefix = "" }: ClientSsrBridgeProps) =>
289
293
  const sync = () => {
290
294
  const { pathname, search, hash } = window.location;
291
295
  const { path } = getPathInfo(`${pathname}${search}${hash}`, lang, prefix);
292
- const searchParams = [...new URLSearchParams(search).entries()].reduce<Record<string, string | string[]>>(
293
- (params, [key, value]) => {
294
- params[key] = params[key] ? [...(Array.isArray(params[key]) ? params[key] : [params[key]]), value] : value;
295
- return params;
296
- },
297
- {},
298
- );
296
+ const searchParams = buildSearchParams(new URLSearchParams(search).entries());
299
297
  st.set({ pathname: window.location.pathname, path, searchParams });
300
298
  };
301
299
  sync();
package/webkit/index.ts CHANGED
@@ -6,14 +6,12 @@ export type * from "./types";
6
6
  export { useCamera } from "./useCamera";
7
7
  export { useCodepush } from "./useCodepush";
8
8
  export { useContact } from "./useContact";
9
-
10
9
  export { useCsrValues } from "./useCsrValues";
11
10
  export { useDebounce } from "./useDebounce";
12
11
  export { useFetch, useFetchFn } from "./useFetch";
13
12
  export { useGeoLocation } from "./useGeoLocation";
14
- export { useInterval } from "./useInterval";
15
- export { usePushNoti } from "./usePushNoti";
16
-
17
13
  export { useHistory } from "./useHistory";
14
+ export { useInterval } from "./useInterval";
18
15
  export { useLocation } from "./useLocation";
16
+ export { usePushNoti } from "./usePushNoti";
19
17
  export { useThrottle } from "./useThrottle";