@cyberskill/shared 2.26.0 → 2.27.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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/config/config.util.cjs +1 -1
  3. package/dist/config/config.util.js +14 -19
  4. package/dist/config/eslint/index.cjs +1 -1
  5. package/dist/config/eslint/index.js +1 -1
  6. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  7. package/dist/config/vitest/vitest.e2e.js +1 -1
  8. package/dist/config/vitest/vitest.unit.cjs +1 -1
  9. package/dist/config/vitest/vitest.unit.js +1 -1
  10. package/dist/node/cli/index.cjs +3 -3
  11. package/dist/node/cli/index.js +106 -96
  12. package/dist/node/command/command.util.js +1 -1
  13. package/dist/node/path/index.cjs +1 -1
  14. package/dist/node/path/index.js +53 -51
  15. package/dist/node/path/path.constant.cjs +1 -1
  16. package/dist/node/path/path.constant.d.ts +3 -0
  17. package/dist/node/path/path.constant.js +63 -60
  18. package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
  19. package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
  20. package/dist/react/apollo-client/apollo-client.component.js +4 -3
  21. package/dist/react/apollo-client/apollo-client.context.cjs +1 -1
  22. package/dist/react/apollo-client/apollo-client.context.d.ts +1 -1
  23. package/dist/react/apollo-client/apollo-client.context.js +9 -8
  24. package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
  25. package/dist/react/apollo-client/apollo-client.util.js +3 -3
  26. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -1
  27. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +1 -1
  28. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +9 -8
  29. package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
  30. package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
  31. package/dist/react/apollo-error/apollo-error.component.js +2 -1
  32. package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
  33. package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
  34. package/dist/react/apollo-error/apollo-error.provider.js +4 -3
  35. package/dist/react/loading/loading.component.cjs +2 -2
  36. package/dist/react/loading/loading.component.d.ts +1 -1
  37. package/dist/react/loading/loading.component.js +7 -6
  38. package/dist/react/loading/loading.provider.cjs +1 -1
  39. package/dist/react/loading/loading.provider.d.ts +1 -1
  40. package/dist/react/loading/loading.provider.js +8 -7
  41. package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
  42. package/dist/react/next-intl/next-intl.hoc.d.ts +2 -1
  43. package/dist/react/next-intl/next-intl.hoc.js +12 -12
  44. package/dist/react/next-intl/next-intl.provider.cjs +1 -1
  45. package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
  46. package/dist/react/next-intl/next-intl.provider.js +5 -4
  47. package/package.json +23 -22
  48. /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
  49. /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
@@ -1,16 +1,17 @@
1
- import i, { useState as l, useCallback as r, useMemo as g } from "react";
2
- import { Loading as m } from "./loading.component.js";
1
+ import * as i from "react";
2
+ import { useState as l, useCallback as r, useMemo as m } from "react";
3
+ import { Loading as g } from "./loading.component.js";
3
4
  import { LoadingContext as u } from "./loading.context.js";
4
5
  function x({ children: c }) {
5
- const [e, t] = l(!1), [o, a] = l(!1), n = r((f = !1) => {
6
+ const [o, t] = l(!1), [e, a] = l(!1), n = r((f = !1) => {
6
7
  t(!0), a(f);
7
8
  }, []), s = r(() => {
8
9
  t(!1), a(!1);
9
- }, []), d = g(
10
- () => ({ isLoading: e, isGlobalLoading: o, showLoading: n, hideLoading: s }),
11
- [e, o, n, s]
10
+ }, []), d = m(
11
+ () => ({ isLoading: o, isGlobalLoading: e, showLoading: n, hideLoading: s }),
12
+ [o, e, n, s]
12
13
  );
13
- return /* @__PURE__ */ i.createElement(u, { value: d }, e ? /* @__PURE__ */ i.createElement(m, { full: o }) : c);
14
+ return /* @__PURE__ */ i.createElement(u, { value: d }, o ? /* @__PURE__ */ i.createElement(g, { full: e }) : c);
14
15
  }
15
16
  export {
16
17
  x as LoadingProvider
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("next-intl"),i=require("react"),m=require("./next-intl.constant.cjs"),p=require("./next-intl.hook.cjs"),I=require("../log/log.util.cjs");var N=Object.defineProperty,s=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,c=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,w=(r,e)=>{for(var t in e||(e={}))y.call(e,t)&&c(r,t,e[t]);if(s)for(var t of s(e))P.call(e,t)&&c(r,t,e[t]);return r};function O(r){const e=t=>{var a,o;const{currentLanguage:n}=p.useNextIntl(),{messages:u,languages:g}=t,l="en",v=u[(n==null?void 0:n.value)||l],_=(o=(a=g.find(d=>d.value===(n==null?void 0:n.value)))==null?void 0:a.timezone)!=null?o:m.NEXT_INTL_DEFAULT_LANGUAGE.timezone;return u?i.createElement(f.NextIntlClientProvider,{locale:(n==null?void 0:n.value)||l,messages:v||null,timeZone:_},i.createElement(r,w({},t))):(I.log.warn(`Missing messages for language: ${(n==null?void 0:n.value)||l}`),null)};return e.displayName=`withNextIntl(${r.displayName||r.name||"Component"})`,e}exports.withNextIntl=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("next-intl"),v=require("react"),p=require("./next-intl.constant.cjs"),O=require("./next-intl.hook.cjs"),y=require("../log/log.util.cjs");function I(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,l.get?l:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const i=I(v);var N=Object.defineProperty,s=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,c=(n,e,t)=>e in n?N(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,w=(n,e)=>{for(var t in e||(e={}))P.call(e,t)&&c(n,t,e[t]);if(s)for(var t of s(e))b.call(e,t)&&c(n,t,e[t]);return n};function x(n){const e=t=>{var l,o;const{currentLanguage:r}=O.useNextIntl(),{messages:u,languages:f}=t,a="en",g=u[(r==null?void 0:r.value)||a],_=(o=(l=f.find(d=>d.value===(r==null?void 0:r.value)))==null?void 0:l.timezone)!=null?o:p.NEXT_INTL_DEFAULT_LANGUAGE.timezone;return u?i.createElement(m.NextIntlClientProvider,{locale:(r==null?void 0:r.value)||a,messages:g||null,timeZone:_},i.createElement(n,w({},t))):(y.log.warn(`Missing messages for language: ${(r==null?void 0:r.value)||a}`),null)};return e.displayName=`withNextIntl(${n.displayName||n.name||"Component"})`,e}exports.withNextIntl=x;
@@ -1,6 +1,7 @@
1
- import { ComponentType, default as React } from 'react';
1
+ import { ComponentType } from 'react';
2
2
  import { I_Children } from '../../typescript/index.js';
3
3
  import { I_NextIntlLanguage, T_NextIntlMessageList } from './next-intl.type.js';
4
+ import * as React from 'react';
4
5
  /**
5
6
  * Higher-Order Component (HOC) that wraps components with Next.js internationalization support.
6
7
  * This HOC provides internationalization capabilities to React components by wrapping them
@@ -1,32 +1,32 @@
1
1
  import { NextIntlClientProvider as g } from "next-intl";
2
- import u from "react";
2
+ import * as s from "react";
3
3
  import { NEXT_INTL_DEFAULT_LANGUAGE as _ } from "./next-intl.constant.js";
4
4
  import { useNextIntl as d } from "./next-intl.hook.js";
5
5
  import { log as N } from "../log/log.util.js";
6
- var P = Object.defineProperty, s = Object.getOwnPropertySymbols, w = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable, m = (t, e, r) => e in t ? P(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, I = (t, e) => {
6
+ var P = Object.defineProperty, u = Object.getOwnPropertySymbols, w = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable, m = (t, e, r) => e in t ? P(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, I = (t, e) => {
7
7
  for (var r in e || (e = {}))
8
8
  w.call(e, r) && m(t, r, e[r]);
9
- if (s)
10
- for (var r of s(e))
9
+ if (u)
10
+ for (var r of u(e))
11
11
  y.call(e, r) && m(t, r, e[r]);
12
12
  return t;
13
13
  };
14
- function b(t) {
14
+ function L(t) {
15
15
  const e = (r) => {
16
- var a, o;
17
- const { currentLanguage: n } = d(), { messages: i, languages: f } = r, l = "en", c = i[(n == null ? void 0 : n.value) || l], p = (o = (a = f.find((v) => v.value === (n == null ? void 0 : n.value))) == null ? void 0 : a.timezone) != null ? o : _.timezone;
18
- return i ? /* @__PURE__ */ u.createElement(
16
+ var l, o;
17
+ const { currentLanguage: n } = d(), { messages: i, languages: f } = r, a = "en", c = i[(n == null ? void 0 : n.value) || a], p = (o = (l = f.find((v) => v.value === (n == null ? void 0 : n.value))) == null ? void 0 : l.timezone) != null ? o : _.timezone;
18
+ return i ? /* @__PURE__ */ s.createElement(
19
19
  g,
20
20
  {
21
- locale: (n == null ? void 0 : n.value) || l,
21
+ locale: (n == null ? void 0 : n.value) || a,
22
22
  messages: c || null,
23
23
  timeZone: p
24
24
  },
25
- /* @__PURE__ */ u.createElement(t, I({}, r))
26
- ) : (N.warn(`Missing messages for language: ${(n == null ? void 0 : n.value) || l}`), null);
25
+ /* @__PURE__ */ s.createElement(t, I({}, r))
26
+ ) : (N.warn(`Missing messages for language: ${(n == null ? void 0 : n.value) || a}`), null);
27
27
  };
28
28
  return e.displayName = `withNextIntl(${t.displayName || t.name || "Component"})`, e;
29
29
  }
30
30
  export {
31
- b as withNextIntl
31
+ L as withNextIntl
32
32
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=require("./next-intl.constant.cjs"),c=require("./next-intl.context.cjs"),i=require("./next-intl.hoc.cjs"),s=require("../storage/storage.hook.cjs");function x({children:n}){return e.createElement(e.Fragment,null,n)}const g=i.withNextIntl(x);function I({children:n,languages:t,messages:u}){const{value:r,set:o}=s.useStorage("lang",t[0]),a=e.useMemo(()=>({languages:t,currentLanguage:r!=null?r:l.NEXT_INTL_DEFAULT_LANGUAGE,setCurrentLanguage:o}),[t,o,r]);return e.createElement(c.NextIntlContext,{value:a},e.createElement(g,{languages:t,messages:u},n))}exports.NextIntlProvider=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),l=require("./next-intl.constant.cjs"),i=require("./next-intl.context.cjs"),s=require("./next-intl.hoc.cjs"),g=require("../storage/storage.hook.cjs");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=f(a);function p({children:e}){return o.createElement(o.Fragment,null,e)}const m=s.withNextIntl(p);function x({children:e,languages:t,messages:n}){const{value:r,set:u}=g.useStorage("lang",t[0]),c=a.useMemo(()=>({languages:t,currentLanguage:r!=null?r:l.NEXT_INTL_DEFAULT_LANGUAGE,setCurrentLanguage:u}),[t,u,r]);return o.createElement(i.NextIntlContext,{value:c},o.createElement(m,{languages:t,messages:n},e))}exports.NextIntlProvider=x;
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
1
  import { I_NextIntlProviderProps } from './next-intl.type.js';
2
+ import * as React from 'react';
3
3
  /**
4
4
  * Provider component that manages Next.js internationalization state and provides i18n context.
5
5
  * This component sets up a complete internationalization system for Next.js applications,
@@ -1,4 +1,5 @@
1
- import t, { useMemo as u } from "react";
1
+ import * as t from "react";
2
+ import { useMemo as u } from "react";
2
3
  import { NEXT_INTL_DEFAULT_LANGUAGE as c } from "./next-intl.constant.js";
3
4
  import { NextIntlContext as l } from "./next-intl.context.js";
4
5
  import { withNextIntl as p } from "./next-intl.hoc.js";
@@ -10,13 +11,13 @@ const L = p(f);
10
11
  function I({
11
12
  children: r,
12
13
  languages: e,
13
- messages: a
14
+ messages: m
14
15
  }) {
15
- const { value: n, set: o } = i("lang", e[0]), m = u(
16
+ const { value: n, set: o } = i("lang", e[0]), a = u(
16
17
  () => ({ languages: e, currentLanguage: n != null ? n : c, setCurrentLanguage: o }),
17
18
  [e, o, n]
18
19
  );
19
- return /* @__PURE__ */ t.createElement(l, { value: m }, /* @__PURE__ */ t.createElement(L, { languages: e, messages: a }, r));
20
+ return /* @__PURE__ */ t.createElement(l, { value: a }, /* @__PURE__ */ t.createElement(L, { languages: e, messages: m }, r));
20
21
  }
21
22
  export {
22
23
  I as NextIntlProvider
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cyberskill/shared",
3
3
  "type": "module",
4
- "version": "2.26.0",
4
+ "version": "2.27.0",
5
5
  "description": "CyberSkill Shared",
6
6
  "author": "Stephen Cheng",
7
7
  "license": "MIT",
@@ -198,6 +198,7 @@
198
198
  "public"
199
199
  ],
200
200
  "scripts": {
201
+ "ai:setup": "tsx src/node/cli/index.ts ai:setup",
201
202
  "build": "vite build",
202
203
  "commitlint": "tsx src/node/cli/index.ts commitlint",
203
204
  "dev": "vite build --watch",
@@ -212,21 +213,21 @@
212
213
  "test:unit": "tsx src/node/cli/index.ts test:unit"
213
214
  },
214
215
  "dependencies": {
215
- "@antfu/eslint-config": "6.7.3",
216
- "@apollo/client": "4.0.11",
217
- "@apollo/client-integration-nextjs": "0.14.3",
216
+ "@antfu/eslint-config": "7.1.0",
217
+ "@apollo/client": "4.1.0",
218
+ "@apollo/client-integration-nextjs": "0.14.4",
218
219
  "@apollo/server": "5.2.0",
219
220
  "@as-integrations/express5": "1.1.2",
220
221
  "@dotenvx/dotenvx": "1.51.4",
221
222
  "@eddeee888/gcg-typescript-resolver-files": "0.15.0",
222
- "@eslint-react/eslint-plugin": "2.5.1",
223
- "@graphql-codegen/cli": "6.1.0",
223
+ "@eslint-react/eslint-plugin": "2.7.2",
224
+ "@graphql-codegen/cli": "6.1.1",
224
225
  "@graphql-codegen/client-preset": "5.2.2",
225
- "@nestjs/common": "11.1.11",
226
- "@nestjs/core": "11.1.11",
226
+ "@nestjs/common": "11.1.12",
227
+ "@nestjs/core": "11.1.12",
227
228
  "@userback/widget": "0.3.12",
228
229
  "@vitejs/plugin-react-swc": "4.2.2",
229
- "body-parser": "2.2.1",
230
+ "body-parser": "2.2.2",
230
231
  "chalk": "5.6.2",
231
232
  "clsx": "2.1.1",
232
233
  "compression": "1.8.1",
@@ -235,7 +236,7 @@
235
236
  "cors": "2.8.5",
236
237
  "date-fns": "4.1.0",
237
238
  "envalid": "8.1.1",
238
- "eslint-plugin-format": "1.2.0",
239
+ "eslint-plugin-format": "1.3.1",
239
240
  "eslint-plugin-react-hooks": "7.0.1",
240
241
  "eslint-plugin-react-refresh": "0.4.26",
241
242
  "express": "5.2.1",
@@ -248,12 +249,12 @@
248
249
  "graphql-upload": "17.0.0",
249
250
  "graphql-ws": "6.0.6",
250
251
  "helmet": "8.1.0",
251
- "i18next": "25.7.3",
252
+ "i18next": "25.8.0",
252
253
  "jsdom": "27.4.0",
253
254
  "localforage": "1.10.0",
254
255
  "migrate-mongo": "14.0.7",
255
256
  "mongodb": "7.0.0",
256
- "mongoose": "9.1.2",
257
+ "mongoose": "9.1.5",
257
258
  "mongoose-aggregate-paginate-v2": "1.1.4",
258
259
  "mongoose-paginate-v2": "1.9.1",
259
260
  "next-intl": "4.7.0",
@@ -262,21 +263,21 @@
262
263
  "react": "19.2.3",
263
264
  "react-dom": "19.2.3",
264
265
  "react-hot-toast": "2.6.0",
265
- "react-i18next": "16.5.1",
266
+ "react-i18next": "16.5.3",
266
267
  "rxjs": "7.8.2",
267
268
  "vite": "7.3.1",
268
269
  "ws": "8.19.0",
269
270
  "yargs": "18.0.0"
270
271
  },
271
272
  "devDependencies": {
272
- "@commitlint/cli": "20.3.0",
273
- "@commitlint/config-conventional": "20.3.0",
273
+ "@commitlint/cli": "20.3.1",
274
+ "@commitlint/config-conventional": "20.3.1",
274
275
  "@eslint/config-inspector": "1.4.2",
275
- "@next/eslint-plugin-next": "16.1.1",
276
+ "@next/eslint-plugin-next": "16.1.4",
276
277
  "@storybook/react": "10.1.11",
277
278
  "@storybook/react-vite": "10.1.11",
278
279
  "@testing-library/jest-dom": "6.9.1",
279
- "@testing-library/react": "16.3.1",
280
+ "@testing-library/react": "16.3.2",
280
281
  "@types/body-parser": "1.19.6",
281
282
  "@types/compression": "1.8.1",
282
283
  "@types/cookie-parser": "1.4.10",
@@ -288,14 +289,14 @@
288
289
  "@types/fs-extra": "11.0.4",
289
290
  "@types/graphql-upload": "17.0.0",
290
291
  "@types/migrate-mongo": "10.0.6",
291
- "@types/node": "25.0.3",
292
- "@types/react": "19.2.7",
292
+ "@types/node": "25.0.9",
293
+ "@types/react": "19.2.9",
293
294
  "@types/react-dom": "19.2.3",
294
295
  "@types/ws": "8.18.1",
295
296
  "@types/yargs": "17.0.35",
296
- "@vitest/browser": "4.0.16",
297
+ "@vitest/browser": "4.0.17",
297
298
  "eslint": "9.39.2",
298
- "eslint-config-next": "16.1.1",
299
+ "eslint-config-next": "16.1.4",
299
300
  "glob": "13.0.0",
300
301
  "lint-staged": "16.2.7",
301
302
  "node-modules-inspector": "1.2.0",
@@ -306,7 +307,7 @@
306
307
  "typescript": "5.9.3",
307
308
  "vite": "7.3.1",
308
309
  "vite-plugin-dts": "4.5.4",
309
- "vitest": "4.0.16"
310
+ "vitest": "4.0.17"
310
311
  },
311
312
  "publishConfig": {
312
313
  "access": "public",