@cyberskill/shared 2.26.0 → 2.28.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/README.md +1 -1
- package/dist/config/config.util.cjs +1 -1
- package/dist/config/config.util.js +14 -19
- package/dist/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +2 -0
- package/dist/config/eslint/index.js +1 -1
- package/dist/config/vitest/vitest.e2e.cjs +1 -1
- package/dist/config/vitest/vitest.e2e.js +1 -1
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +1 -1
- package/dist/node/cli/index.cjs +2 -5
- package/dist/node/cli/index.js +108 -103
- package/dist/node/command/command.util.js +1 -1
- package/dist/node/fs/fs.util.cjs +4 -1
- package/dist/node/fs/fs.util.d.ts +8 -0
- package/dist/node/fs/fs.util.js +58 -50
- package/dist/node/fs/index.cjs +1 -1
- package/dist/node/fs/index.js +13 -12
- package/dist/node/mongo/mongo.type.js +3 -3
- package/dist/node/mongo/mongo.util.cjs +2 -5
- package/dist/node/mongo/mongo.util.js +206 -211
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +53 -51
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +3 -0
- package/dist/node/path/path.constant.js +63 -60
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.js +1 -1
- package/dist/node/upload/upload.util.js +3 -3
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +4 -3
- package/dist/react/apollo-client/apollo-client.context.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.context.d.ts +1 -1
- package/dist/react/apollo-client/apollo-client.context.js +9 -8
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +3 -3
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +9 -8
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +2 -1
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.provider.js +4 -3
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.d.ts +1 -1
- package/dist/react/loading/loading.component.js +7 -6
- package/dist/react/loading/loading.provider.cjs +1 -1
- package/dist/react/loading/loading.provider.d.ts +1 -1
- package/dist/react/loading/loading.provider.js +8 -7
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.d.ts +2 -1
- package/dist/react/next-intl/next-intl.hoc.js +12 -12
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
- package/dist/react/next-intl/next-intl.provider.js +5 -4
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +9 -0
- package/dist/util/common/common.util.js +33 -29
- package/dist/util/common/index.cjs +1 -1
- package/dist/util/common/index.js +6 -5
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.js +23 -22
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +40 -36
- package/package.json +45 -44
- package/dist/node/mongo/mongo.util.d.ts +0 -1040
- /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.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
- /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.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
package/dist/node/path/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./path.constant.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./path.constant.cjs"),E=require("./path.util.cjs");exports.AG_KIT_PACKAGE_NAME=_.AG_KIT_PACKAGE_NAME;exports.BUILD_DIRECTORY=_.BUILD_DIRECTORY;exports.COMMIT_LINT_CLI=_.COMMIT_LINT_CLI;exports.COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME=_.COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME;exports.COMMIT_LINT_PACKAGE_NAME=_.COMMIT_LINT_PACKAGE_NAME;exports.CYBERSKILL_CLI=_.CYBERSKILL_CLI;exports.CYBERSKILL_CLI_PATH=_.CYBERSKILL_CLI_PATH;exports.CYBERSKILL_DIRECTORY=_.CYBERSKILL_DIRECTORY;exports.CYBERSKILL_PACKAGE_NAME=_.CYBERSKILL_PACKAGE_NAME;exports.DOT_AGENT=_.DOT_AGENT;exports.ESLINT_CLI=_.ESLINT_CLI;exports.ESLINT_INSPECT_CLI=_.ESLINT_INSPECT_CLI;exports.ESLINT_INSPECT_PACKAGE_NAME=_.ESLINT_INSPECT_PACKAGE_NAME;exports.ESLINT_PACKAGE_NAME=_.ESLINT_PACKAGE_NAME;exports.GIT_CLI=_.GIT_CLI;exports.GIT_COMMIT_EDITMSG=_.GIT_COMMIT_EDITMSG;exports.GIT_HOOK=_.GIT_HOOK;exports.GIT_IGNORE=_.GIT_IGNORE;exports.LINT_STAGED_CLI=_.LINT_STAGED_CLI;exports.LINT_STAGED_PACKAGE_NAME=_.LINT_STAGED_PACKAGE_NAME;exports.MIGRATE_MONGO_CLI=_.MIGRATE_MONGO_CLI;exports.MIGRATE_MONGO_CONFIG=_.MIGRATE_MONGO_CONFIG;exports.MIGRATE_MONGO_PACKAGE_NAME=_.MIGRATE_MONGO_PACKAGE_NAME;exports.NODE_MODULES=_.NODE_MODULES;exports.NODE_MODULES_INSPECT_CLI=_.NODE_MODULES_INSPECT_CLI;exports.NODE_MODULES_INSPECT_PACKAGE_NAME=_.NODE_MODULES_INSPECT_PACKAGE_NAME;exports.PACKAGE_JSON=_.PACKAGE_JSON;exports.PACKAGE_LOCK_JSON=_.PACKAGE_LOCK_JSON;exports.PATH=_.PATH;exports.PNPM_CLI=_.PNPM_CLI;exports.PNPM_EXEC_CLI=_.PNPM_EXEC_CLI;exports.PNPM_LOCK_YAML=_.PNPM_LOCK_YAML;exports.PUBLIC_DIRECTORY=_.PUBLIC_DIRECTORY;exports.SIMPLE_GIT_HOOKS_PACKAGE_NAME=_.SIMPLE_GIT_HOOKS_PACKAGE_NAME;exports.SIMPLE_GIT_HOOK_CLI=_.SIMPLE_GIT_HOOK_CLI;exports.SIMPLE_GIT_HOOK_JSON=_.SIMPLE_GIT_HOOK_JSON;exports.STORYBOOK_CLI=_.STORYBOOK_CLI;exports.STORYBOOK_PACKAGE_NAME=_.STORYBOOK_PACKAGE_NAME;exports.TSCONFIG_JSON=_.TSCONFIG_JSON;exports.TSC_CLI=_.TSC_CLI;exports.TSC_PACKAGE_NAME=_.TSC_PACKAGE_NAME;exports.TSX_CLI=_.TSX_CLI;exports.VITEST_CLI=_.VITEST_CLI;exports.VITEST_PACKAGE_NAME=_.VITEST_PACKAGE_NAME;exports.WORKING_DIRECTORY=_.WORKING_DIRECTORY;exports.command=_.command;exports.createGitHooksConfig=_.createGitHooksConfig;exports.dirname=E.dirname;exports.join=E.join;exports.path=E.path;exports.resolve=E.resolve;exports.resolveWorkingPath=E.resolveWorkingPath;
|
package/dist/node/path/index.js
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import { BUILD_DIRECTORY as
|
|
2
|
-
import { dirname as
|
|
1
|
+
import { AG_KIT_PACKAGE_NAME as I, BUILD_DIRECTORY as C, COMMIT_LINT_CLI as A, COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME as T, COMMIT_LINT_PACKAGE_NAME as N, CYBERSKILL_CLI as O, CYBERSKILL_CLI_PATH as L, CYBERSKILL_DIRECTORY as G, CYBERSKILL_PACKAGE_NAME as M, DOT_AGENT as S, ESLINT_CLI as P, ESLINT_INSPECT_CLI as K, ESLINT_INSPECT_PACKAGE_NAME as R, ESLINT_PACKAGE_NAME as D, GIT_CLI as o, GIT_COMMIT_EDITMSG as Y, GIT_HOOK as e, GIT_IGNORE as r, LINT_STAGED_CLI as B, LINT_STAGED_PACKAGE_NAME as H, MIGRATE_MONGO_CLI as t, MIGRATE_MONGO_CONFIG as a, MIGRATE_MONGO_PACKAGE_NAME as i, NODE_MODULES as m, NODE_MODULES_INSPECT_CLI as n, NODE_MODULES_INSPECT_PACKAGE_NAME as U, PACKAGE_JSON as J, PACKAGE_LOCK_JSON as f, PATH as p, PNPM_CLI as s, PNPM_EXEC_CLI as F, PNPM_LOCK_YAML as V, PUBLIC_DIRECTORY as c, SIMPLE_GIT_HOOKS_PACKAGE_NAME as d, SIMPLE_GIT_HOOK_CLI as g, SIMPLE_GIT_HOOK_JSON as h, STORYBOOK_CLI as k, STORYBOOK_PACKAGE_NAME as l, TSCONFIG_JSON as v, TSC_CLI as x, TSC_PACKAGE_NAME as W, TSX_CLI as X, VITEST_CLI as j, VITEST_PACKAGE_NAME as b, WORKING_DIRECTORY as q, command as u, createGitHooksConfig as w } from "./path.constant.js";
|
|
2
|
+
import { dirname as z, join as Q, path as Z, resolve as $, resolveWorkingPath as __ } from "./path.util.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
C as
|
|
6
|
-
A as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
L as
|
|
4
|
+
I as AG_KIT_PACKAGE_NAME,
|
|
5
|
+
C as BUILD_DIRECTORY,
|
|
6
|
+
A as COMMIT_LINT_CLI,
|
|
7
|
+
T as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
|
|
8
|
+
N as COMMIT_LINT_PACKAGE_NAME,
|
|
9
|
+
O as CYBERSKILL_CLI,
|
|
10
|
+
L as CYBERSKILL_CLI_PATH,
|
|
11
|
+
G as CYBERSKILL_DIRECTORY,
|
|
11
12
|
M as CYBERSKILL_PACKAGE_NAME,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
w as
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
13
|
+
S as DOT_AGENT,
|
|
14
|
+
P as ESLINT_CLI,
|
|
15
|
+
K as ESLINT_INSPECT_CLI,
|
|
16
|
+
R as ESLINT_INSPECT_PACKAGE_NAME,
|
|
17
|
+
D as ESLINT_PACKAGE_NAME,
|
|
18
|
+
o as GIT_CLI,
|
|
19
|
+
Y as GIT_COMMIT_EDITMSG,
|
|
20
|
+
e as GIT_HOOK,
|
|
21
|
+
r as GIT_IGNORE,
|
|
22
|
+
B as LINT_STAGED_CLI,
|
|
23
|
+
H as LINT_STAGED_PACKAGE_NAME,
|
|
24
|
+
t as MIGRATE_MONGO_CLI,
|
|
25
|
+
a as MIGRATE_MONGO_CONFIG,
|
|
26
|
+
i as MIGRATE_MONGO_PACKAGE_NAME,
|
|
27
|
+
m as NODE_MODULES,
|
|
28
|
+
n as NODE_MODULES_INSPECT_CLI,
|
|
29
|
+
U as NODE_MODULES_INSPECT_PACKAGE_NAME,
|
|
30
|
+
J as PACKAGE_JSON,
|
|
31
|
+
f as PACKAGE_LOCK_JSON,
|
|
32
|
+
p as PATH,
|
|
33
|
+
s as PNPM_CLI,
|
|
34
|
+
F as PNPM_EXEC_CLI,
|
|
35
|
+
V as PNPM_LOCK_YAML,
|
|
36
|
+
c as PUBLIC_DIRECTORY,
|
|
37
|
+
d as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
|
|
38
|
+
g as SIMPLE_GIT_HOOK_CLI,
|
|
39
|
+
h as SIMPLE_GIT_HOOK_JSON,
|
|
40
|
+
k as STORYBOOK_CLI,
|
|
41
|
+
l as STORYBOOK_PACKAGE_NAME,
|
|
42
|
+
v as TSCONFIG_JSON,
|
|
43
|
+
x as TSC_CLI,
|
|
44
|
+
W as TSC_PACKAGE_NAME,
|
|
45
|
+
X as TSX_CLI,
|
|
46
|
+
j as VITEST_CLI,
|
|
47
|
+
b as VITEST_PACKAGE_NAME,
|
|
48
|
+
q as WORKING_DIRECTORY,
|
|
49
|
+
u as command,
|
|
50
|
+
w as createGitHooksConfig,
|
|
51
|
+
z as dirname,
|
|
52
|
+
Q as join,
|
|
53
|
+
Z as path,
|
|
54
|
+
$ as resolve,
|
|
55
|
+
__ as resolveWorkingPath
|
|
54
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("fs-extra"),n=require("./path.util.cjs"),e=require("../command/command.type.cjs"),r=require("../command/command.util.cjs"),ae=require("../package/package.util.cjs"),_=require("../package/package.type.cjs"),Ce=require("../../config/env/env.util.cjs");var Ie=Object.defineProperty,f=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,Y=(E,a,t)=>a in E?Ie(E,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):E[a]=t,me=(E,a)=>{for(var t in a||(a={}))se.call(a,t)&&Y(E,t,a[t]);if(f)for(var t of f(a))ce.call(a,t)&&Y(E,t,a[t]);return E},Te=(E,a,t)=>new Promise((p,T)=>{var N=c=>{try{A(t.next(c))}catch(y){T(y)}},G=c=>{try{A(t.throw(c))}catch(y){T(y)}},A=c=>c.done?p(c.value):Promise.resolve(c.value).then(N,G);A((t=t.apply(E,a)).next())});const re=Ce.getEnv(),P=re.CWD,L="@cyberskill/shared",u="node_modules",l="dist",$="public",K="package.json",V="package-lock.json",W="tsconfig.json",F=".gitignore",b=".simple-git-hooks.json",w="pnpm-lock.yaml",B=".git/hooks/",H=".git/COMMIT_EDITMSG",U=".migrate-mongo.config.js",I=Ee.readJsonSync(n.resolveWorkingPath(K)).name===L?n.join(P,l):n.join(P,u,L,l),pe="cyberskill",Ne="src/node/cli/index.ts",g="eslint",d="eslint",M="vitest",S="vitest",j="@commitlint/cli",J="@commitlint/config-conventional",R="commitlint",q="lint-staged",v="lint-staged",x="typescript",X="tsc",m="tsx",h="git",s="pnpm",z="pnpm exec",Q="simple-git-hooks",Z="simple-git-hooks",ee="@eslint/config-inspector",oe="eslint-config-inspector",ne="node-modules-inspector",_e="node-modules-inspector",i="migrate-mongo",O="./node_modules/migrate-mongo/bin/migrate-mongo",D="storybook",k="storybook",ie="@vudovn/ag-kit",te=".agent",C={CYBERSKILL_DIRECTORY:I,WORKING_DIRECTORY:P,PUBLIC_DIRECTORY:n.resolveWorkingPath($),TS_CONFIG:n.resolveWorkingPath(W),GIT_IGNORE:n.resolveWorkingPath(F),GIT_HOOK:n.resolveWorkingPath(B),GIT_COMMIT_MSG:n.resolveWorkingPath(H),SIMPLE_GIT_HOOKS_JSON:n.resolveWorkingPath(b),PACKAGE_JSON:n.resolveWorkingPath(K),PACKAGE_LOCK_JSON:n.resolveWorkingPath(V),PNPM_LOCK_YAML:n.resolveWorkingPath(w),NODE_MODULES:n.resolveWorkingPath(u),MIGRATE_MONGO_CONFIG:n.resolveWorkingPath(U),LINT_STAGED_CONFIG:n.resolveWorkingPath(`${I}/config/lint-staged/index.js`),COMMITLINT_CONFIG:n.resolveWorkingPath(`${I}/config/commitlint/index.js`),VITEST_UNIT_CONFIG:n.resolveWorkingPath(`${I}/config/vitest/vitest.unit.js`),VITEST_E2E_CONFIG:n.resolveWorkingPath(`${I}/config/vitest/vitest.e2e.js`),STORYBOOK_MAIN_CONFIG:n.resolveWorkingPath(`${I}/config/storybook/storybook.main.js`),STORYBOOK_PREVIEW_CONFIG:n.resolveWorkingPath(`${I}/config/storybook/storybook.preview.js`),DOT_AGENT:n.resolveWorkingPath(te)};function Oe({isCurrentProject:E}){return me({"pre-commit":v,"commit-msg":R},E?{"pre-push":r.rawCommand(`${h} pull`)}:{"pre-push":r.rawCommand(`${s} build`)})}function o({type:E,packages:a,command:t}){const p=a==null?void 0:a.reduce((T,N)=>(T.some(G=>G.name===N.name)||T.push(N),T),[]);return()=>Te(null,null,function*(){switch(E){case e.E_CommandType.CLI:return p!=null&&p.length&&(yield ae.setupPackages(p,{install:!0})),r.formatCommand(r.rawCommand(`${z} ${t}`));case e.E_CommandType.STRING:return r.formatCommand(r.rawCommand(t));default:throw new Error("Unsupported command type")}})}const Pe={simpleGitHooks:o({type:e.E_CommandType.CLI,packages:[{name:Q,type:_.E_PackageType.DEV_DEPENDENCY}],command:Z}),eslintInspect:o({type:e.E_CommandType.CLI,packages:[{name:ee,type:_.E_PackageType.DEV_DEPENDENCY}],command:oe}),nodeModulesInspect:o({type:e.E_CommandType.CLI,packages:[{name:ne,type:_.E_PackageType.DEV_DEPENDENCY}],command:_e}),eslintCheck:o({type:e.E_CommandType.CLI,packages:[{name:g,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${d} ${C.WORKING_DIRECTORY} --no-cache`}),eslintFix:o({type:e.E_CommandType.CLI,packages:[{name:g,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${d} ${C.WORKING_DIRECTORY} --fix --no-cache`}),typescriptCheck:o({type:e.E_CommandType.CLI,packages:[{name:x,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${X} -p ${C.TS_CONFIG} --noEmit`}),testUnit:o({type:e.E_CommandType.CLI,packages:[{name:M,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${S} --config ${C.VITEST_UNIT_CONFIG}`}),testE2e:o({type:e.E_CommandType.CLI,packages:[{name:M,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${S} --config ${C.VITEST_E2E_CONFIG}`}),mongoMigrateCreate:E=>{if(!/^[\w-]+$/.test(E))throw new Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");return o({type:e.E_CommandType.CLI,packages:[{name:m,type:_.E_PackageType.DEPENDENCY},{name:i,type:_.E_PackageType.DEPENDENCY}],command:`${m} ${O} create ${E} -f ${C.MIGRATE_MONGO_CONFIG}`})()},mongoMigrateUp:o({type:e.E_CommandType.CLI,packages:[{name:m,type:_.E_PackageType.DEPENDENCY},{name:i,type:_.E_PackageType.DEPENDENCY}],command:`${m} ${O} up -f ${C.MIGRATE_MONGO_CONFIG}`}),mongoMigrateDown:o({type:e.E_CommandType.CLI,packages:[{name:m,type:_.E_PackageType.DEPENDENCY},{name:i,type:_.E_PackageType.DEPENDENCY}],command:`${m} ${O} down -f ${C.MIGRATE_MONGO_CONFIG}`}),commitLint:o({type:e.E_CommandType.CLI,packages:[{name:j,type:_.E_PackageType.DEV_DEPENDENCY},{name:J,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${R} --edit ${C.GIT_COMMIT_MSG} --config ${C.COMMITLINT_CONFIG}`}),lintStaged:o({type:e.E_CommandType.CLI,packages:[{name:q,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${v} --config ${C.LINT_STAGED_CONFIG}`}),configureGitHook:o({type:e.E_CommandType.STRING,command:`${h} config core.hooksPath ${C.GIT_HOOK}`}),build:o({type:e.E_CommandType.STRING,command:`${s} run --if-present build`}),pnpmInstallStandard:o({type:e.E_CommandType.STRING,command:`${s} install --ignore-scripts`}),pnpmInstallLegacy:o({type:e.E_CommandType.STRING,command:`${s} install --ignore-scripts --legacy-peer-deps`}),pnpmInstallForce:o({type:e.E_CommandType.STRING,command:`${s} install --ignore-scripts --force`}),pnpmPruneStore:o({type:e.E_CommandType.STRING,command:`${s} store prune`}),pnpmCleanCache:o({type:e.E_CommandType.STRING,command:`${s} cache delete`}),storybookDev:o({type:e.E_CommandType.CLI,packages:[{name:D,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${k} dev`}),storybookBuild:o({type:e.E_CommandType.CLI,packages:[{name:D,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${k} build`})};exports.AG_KIT_PACKAGE_NAME=ie;exports.BUILD_DIRECTORY=l;exports.COMMIT_LINT_CLI=R;exports.COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME=J;exports.COMMIT_LINT_PACKAGE_NAME=j;exports.CYBERSKILL_CLI=pe;exports.CYBERSKILL_CLI_PATH=Ne;exports.CYBERSKILL_DIRECTORY=I;exports.CYBERSKILL_PACKAGE_NAME=L;exports.DOT_AGENT=te;exports.ESLINT_CLI=d;exports.ESLINT_INSPECT_CLI=oe;exports.ESLINT_INSPECT_PACKAGE_NAME=ee;exports.ESLINT_PACKAGE_NAME=g;exports.GIT_CLI=h;exports.GIT_COMMIT_EDITMSG=H;exports.GIT_HOOK=B;exports.GIT_IGNORE=F;exports.LINT_STAGED_CLI=v;exports.LINT_STAGED_PACKAGE_NAME=q;exports.MIGRATE_MONGO_CLI=O;exports.MIGRATE_MONGO_CONFIG=U;exports.MIGRATE_MONGO_PACKAGE_NAME=i;exports.NODE_MODULES=u;exports.NODE_MODULES_INSPECT_CLI=_e;exports.NODE_MODULES_INSPECT_PACKAGE_NAME=ne;exports.PACKAGE_JSON=K;exports.PACKAGE_LOCK_JSON=V;exports.PATH=C;exports.PNPM_CLI=s;exports.PNPM_EXEC_CLI=z;exports.PNPM_LOCK_YAML=w;exports.PUBLIC_DIRECTORY=$;exports.SIMPLE_GIT_HOOKS_PACKAGE_NAME=Q;exports.SIMPLE_GIT_HOOK_CLI=Z;exports.SIMPLE_GIT_HOOK_JSON=b;exports.STORYBOOK_CLI=k;exports.STORYBOOK_PACKAGE_NAME=D;exports.TSCONFIG_JSON=W;exports.TSC_CLI=X;exports.TSC_PACKAGE_NAME=x;exports.TSX_CLI=m;exports.VITEST_CLI=S;exports.VITEST_PACKAGE_NAME=M;exports.WORKING_DIRECTORY=P;exports.command=Pe;exports.createGitHooksConfig=Oe;
|
|
@@ -41,6 +41,8 @@ export declare const MIGRATE_MONGO_PACKAGE_NAME = "migrate-mongo";
|
|
|
41
41
|
export declare const MIGRATE_MONGO_CLI = "./node_modules/migrate-mongo/bin/migrate-mongo";
|
|
42
42
|
export declare const STORYBOOK_PACKAGE_NAME = "storybook";
|
|
43
43
|
export declare const STORYBOOK_CLI = "storybook";
|
|
44
|
+
export declare const AG_KIT_PACKAGE_NAME = "@vudovn/ag-kit";
|
|
45
|
+
export declare const DOT_AGENT = ".agent";
|
|
44
46
|
export declare const PATH: {
|
|
45
47
|
CYBERSKILL_DIRECTORY: string;
|
|
46
48
|
WORKING_DIRECTORY: string;
|
|
@@ -61,6 +63,7 @@ export declare const PATH: {
|
|
|
61
63
|
VITEST_E2E_CONFIG: string;
|
|
62
64
|
STORYBOOK_MAIN_CONFIG: string;
|
|
63
65
|
STORYBOOK_PREVIEW_CONFIG: string;
|
|
66
|
+
DOT_AGENT: string;
|
|
64
67
|
};
|
|
65
68
|
/**
|
|
66
69
|
* Creates Git hooks configuration based on whether this is the current project.
|
|
@@ -1,91 +1,92 @@
|
|
|
1
1
|
import b from "fs-extra";
|
|
2
|
-
import { resolveWorkingPath as
|
|
2
|
+
import { resolveWorkingPath as o, join as g } from "./path.util.js";
|
|
3
3
|
import { E_CommandType as e } from "../command/command.type.js";
|
|
4
|
-
import { formatCommand as
|
|
4
|
+
import { formatCommand as y, rawCommand as N } from "../command/command.util.js";
|
|
5
5
|
import { setupPackages as F } from "../package/package.util.js";
|
|
6
6
|
import { E_PackageType as n } from "../package/package.type.js";
|
|
7
7
|
import { getEnv as w } from "../../config/env/env.util.js";
|
|
8
|
-
var j = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, P = (c, E,
|
|
9
|
-
for (var
|
|
10
|
-
B.call(E,
|
|
8
|
+
var j = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, P = (c, E, s) => E in c ? j(c, E, { enumerable: !0, configurable: !0, writable: !0, value: s }) : c[E] = s, U = (c, E) => {
|
|
9
|
+
for (var s in E || (E = {}))
|
|
10
|
+
B.call(E, s) && P(c, s, E[s]);
|
|
11
11
|
if (L)
|
|
12
|
-
for (var
|
|
13
|
-
H.call(E,
|
|
12
|
+
for (var s of L(E))
|
|
13
|
+
H.call(E, s) && P(c, s, E[s]);
|
|
14
14
|
return c;
|
|
15
|
-
}, J = (c, E,
|
|
15
|
+
}, J = (c, E, s) => new Promise((p, m) => {
|
|
16
16
|
var C = (_) => {
|
|
17
17
|
try {
|
|
18
|
-
T(
|
|
18
|
+
T(s.next(_));
|
|
19
19
|
} catch (l) {
|
|
20
|
-
|
|
20
|
+
m(l);
|
|
21
21
|
}
|
|
22
22
|
}, O = (_) => {
|
|
23
23
|
try {
|
|
24
|
-
T(
|
|
24
|
+
T(s.throw(_));
|
|
25
25
|
} catch (l) {
|
|
26
|
-
|
|
26
|
+
m(l);
|
|
27
27
|
}
|
|
28
28
|
}, T = (_) => _.done ? p(_.value) : Promise.resolve(_.value).then(C, O);
|
|
29
|
-
T((
|
|
29
|
+
T((s = s.apply(c, E)).next());
|
|
30
30
|
});
|
|
31
|
-
const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules",
|
|
32
|
-
CYBERSKILL_DIRECTORY:
|
|
31
|
+
const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", A = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore", Q = ".simple-git-hooks.json", Z = "pnpm-lock.yaml", ee = ".git/hooks/", te = ".git/COMMIT_EDITMSG", ne = ".migrate-mongo.config.js", I = b.readJsonSync(o(Y)).name === M ? g(d, A) : g(d, K, M, A), ye = "cyberskill", Le = "src/node/cli/index.ts", S = "eslint", u = "eslint", f = "vitest", $ = "vitest", oe = "@commitlint/cli", se = "@commitlint/config-conventional", h = "commitlint", ce = "lint-staged", v = "lint-staged", Ee = "typescript", ae = "tsc", r = "tsx", V = "git", i = "pnpm", _e = "pnpm exec", Ie = "simple-git-hooks", ie = "simple-git-hooks", me = "@eslint/config-inspector", re = "eslint-config-inspector", pe = "node-modules-inspector", Ce = "node-modules-inspector", G = "migrate-mongo", D = "./node_modules/migrate-mongo/bin/migrate-mongo", R = "storybook", k = "storybook", Pe = "@vudovn/ag-kit", Ne = ".agent", a = {
|
|
32
|
+
CYBERSKILL_DIRECTORY: I,
|
|
33
33
|
WORKING_DIRECTORY: d,
|
|
34
|
-
PUBLIC_DIRECTORY:
|
|
35
|
-
TS_CONFIG:
|
|
36
|
-
GIT_IGNORE:
|
|
37
|
-
GIT_HOOK:
|
|
38
|
-
GIT_COMMIT_MSG:
|
|
39
|
-
SIMPLE_GIT_HOOKS_JSON:
|
|
40
|
-
PACKAGE_JSON:
|
|
41
|
-
PACKAGE_LOCK_JSON:
|
|
42
|
-
PNPM_LOCK_YAML:
|
|
43
|
-
NODE_MODULES:
|
|
44
|
-
MIGRATE_MONGO_CONFIG:
|
|
45
|
-
LINT_STAGED_CONFIG:
|
|
46
|
-
COMMITLINT_CONFIG:
|
|
47
|
-
VITEST_UNIT_CONFIG:
|
|
48
|
-
VITEST_E2E_CONFIG:
|
|
49
|
-
STORYBOOK_MAIN_CONFIG:
|
|
50
|
-
STORYBOOK_PREVIEW_CONFIG:
|
|
34
|
+
PUBLIC_DIRECTORY: o(W),
|
|
35
|
+
TS_CONFIG: o(q),
|
|
36
|
+
GIT_IGNORE: o(z),
|
|
37
|
+
GIT_HOOK: o(ee),
|
|
38
|
+
GIT_COMMIT_MSG: o(te),
|
|
39
|
+
SIMPLE_GIT_HOOKS_JSON: o(Q),
|
|
40
|
+
PACKAGE_JSON: o(Y),
|
|
41
|
+
PACKAGE_LOCK_JSON: o(X),
|
|
42
|
+
PNPM_LOCK_YAML: o(Z),
|
|
43
|
+
NODE_MODULES: o(K),
|
|
44
|
+
MIGRATE_MONGO_CONFIG: o(ne),
|
|
45
|
+
LINT_STAGED_CONFIG: o(`${I}/config/lint-staged/index.js`),
|
|
46
|
+
COMMITLINT_CONFIG: o(`${I}/config/commitlint/index.js`),
|
|
47
|
+
VITEST_UNIT_CONFIG: o(`${I}/config/vitest/vitest.unit.js`),
|
|
48
|
+
VITEST_E2E_CONFIG: o(`${I}/config/vitest/vitest.e2e.js`),
|
|
49
|
+
STORYBOOK_MAIN_CONFIG: o(`${I}/config/storybook/storybook.main.js`),
|
|
50
|
+
STORYBOOK_PREVIEW_CONFIG: o(`${I}/config/storybook/storybook.preview.js`),
|
|
51
|
+
DOT_AGENT: o(Ne)
|
|
51
52
|
};
|
|
52
|
-
function
|
|
53
|
+
function Me({ isCurrentProject: c }) {
|
|
53
54
|
return U({
|
|
54
55
|
"pre-commit": v,
|
|
55
56
|
"commit-msg": h
|
|
56
|
-
}, c ? { "pre-push": N(`${V} pull`) } : { "pre-push": N(`${
|
|
57
|
+
}, c ? { "pre-push": N(`${V} pull`) } : { "pre-push": N(`${i} build`) });
|
|
57
58
|
}
|
|
58
|
-
function t({ type: c, packages: E, command:
|
|
59
|
-
const p = E == null ? void 0 : E.reduce((
|
|
59
|
+
function t({ type: c, packages: E, command: s }) {
|
|
60
|
+
const p = E == null ? void 0 : E.reduce((m, C) => (m.some((O) => O.name === C.name) || m.push(C), m), []);
|
|
60
61
|
return () => J(null, null, function* () {
|
|
61
62
|
switch (c) {
|
|
62
63
|
case e.CLI:
|
|
63
64
|
return p != null && p.length && (yield F(p, {
|
|
64
65
|
install: !0
|
|
65
|
-
})),
|
|
66
|
+
})), y(N(`${_e} ${s}`));
|
|
66
67
|
case e.STRING:
|
|
67
|
-
return
|
|
68
|
+
return y(N(s));
|
|
68
69
|
default:
|
|
69
70
|
throw new Error("Unsupported command type");
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
const
|
|
74
|
+
const Ae = {
|
|
74
75
|
simpleGitHooks: t({
|
|
75
76
|
type: e.CLI,
|
|
76
77
|
packages: [
|
|
77
78
|
{
|
|
78
|
-
name:
|
|
79
|
+
name: Ie,
|
|
79
80
|
type: n.DEV_DEPENDENCY
|
|
80
81
|
}
|
|
81
82
|
],
|
|
82
|
-
command:
|
|
83
|
+
command: ie
|
|
83
84
|
}),
|
|
84
85
|
eslintInspect: t({
|
|
85
86
|
type: e.CLI,
|
|
86
87
|
packages: [
|
|
87
88
|
{
|
|
88
|
-
name:
|
|
89
|
+
name: me,
|
|
89
90
|
type: n.DEV_DEPENDENCY
|
|
90
91
|
}
|
|
91
92
|
],
|
|
@@ -105,7 +106,7 @@ const Pe = {
|
|
|
105
106
|
type: e.CLI,
|
|
106
107
|
packages: [
|
|
107
108
|
{
|
|
108
|
-
name:
|
|
109
|
+
name: S,
|
|
109
110
|
type: n.DEV_DEPENDENCY
|
|
110
111
|
}
|
|
111
112
|
],
|
|
@@ -115,7 +116,7 @@ const Pe = {
|
|
|
115
116
|
type: e.CLI,
|
|
116
117
|
packages: [
|
|
117
118
|
{
|
|
118
|
-
name:
|
|
119
|
+
name: S,
|
|
119
120
|
type: n.DEV_DEPENDENCY
|
|
120
121
|
}
|
|
121
122
|
],
|
|
@@ -227,27 +228,27 @@ const Pe = {
|
|
|
227
228
|
}),
|
|
228
229
|
build: t({
|
|
229
230
|
type: e.STRING,
|
|
230
|
-
command: `${
|
|
231
|
+
command: `${i} run --if-present build`
|
|
231
232
|
}),
|
|
232
233
|
pnpmInstallStandard: t({
|
|
233
234
|
type: e.STRING,
|
|
234
|
-
command: `${
|
|
235
|
+
command: `${i} install --ignore-scripts`
|
|
235
236
|
}),
|
|
236
237
|
pnpmInstallLegacy: t({
|
|
237
238
|
type: e.STRING,
|
|
238
|
-
command: `${
|
|
239
|
+
command: `${i} install --ignore-scripts --legacy-peer-deps`
|
|
239
240
|
}),
|
|
240
241
|
pnpmInstallForce: t({
|
|
241
242
|
type: e.STRING,
|
|
242
|
-
command: `${
|
|
243
|
+
command: `${i} install --ignore-scripts --force`
|
|
243
244
|
}),
|
|
244
245
|
pnpmPruneStore: t({
|
|
245
246
|
type: e.STRING,
|
|
246
|
-
command: `${
|
|
247
|
+
command: `${i} store prune`
|
|
247
248
|
}),
|
|
248
249
|
pnpmCleanCache: t({
|
|
249
250
|
type: e.STRING,
|
|
250
|
-
command: `${
|
|
251
|
+
command: `${i} cache delete`
|
|
251
252
|
}),
|
|
252
253
|
storybookDev: t({
|
|
253
254
|
type: e.CLI,
|
|
@@ -271,18 +272,20 @@ const Pe = {
|
|
|
271
272
|
})
|
|
272
273
|
};
|
|
273
274
|
export {
|
|
274
|
-
|
|
275
|
+
Pe as AG_KIT_PACKAGE_NAME,
|
|
276
|
+
A as BUILD_DIRECTORY,
|
|
275
277
|
h as COMMIT_LINT_CLI,
|
|
276
278
|
se as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
|
|
277
279
|
oe as COMMIT_LINT_PACKAGE_NAME,
|
|
278
280
|
ye as CYBERSKILL_CLI,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
Le as CYBERSKILL_CLI_PATH,
|
|
282
|
+
I as CYBERSKILL_DIRECTORY,
|
|
281
283
|
M as CYBERSKILL_PACKAGE_NAME,
|
|
284
|
+
Ne as DOT_AGENT,
|
|
282
285
|
u as ESLINT_CLI,
|
|
283
286
|
re as ESLINT_INSPECT_CLI,
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
me as ESLINT_INSPECT_PACKAGE_NAME,
|
|
288
|
+
S as ESLINT_PACKAGE_NAME,
|
|
286
289
|
V as GIT_CLI,
|
|
287
290
|
te as GIT_COMMIT_EDITMSG,
|
|
288
291
|
ee as GIT_HOOK,
|
|
@@ -298,12 +301,12 @@ export {
|
|
|
298
301
|
Y as PACKAGE_JSON,
|
|
299
302
|
X as PACKAGE_LOCK_JSON,
|
|
300
303
|
a as PATH,
|
|
301
|
-
|
|
304
|
+
i as PNPM_CLI,
|
|
302
305
|
_e as PNPM_EXEC_CLI,
|
|
303
306
|
Z as PNPM_LOCK_YAML,
|
|
304
307
|
W as PUBLIC_DIRECTORY,
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
Ie as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
|
|
309
|
+
ie as SIMPLE_GIT_HOOK_CLI,
|
|
307
310
|
Q as SIMPLE_GIT_HOOK_JSON,
|
|
308
311
|
k as STORYBOOK_CLI,
|
|
309
312
|
R as STORYBOOK_PACKAGE_NAME,
|
|
@@ -314,6 +317,6 @@ export {
|
|
|
314
317
|
$ as VITEST_CLI,
|
|
315
318
|
f as VITEST_PACKAGE_NAME,
|
|
316
319
|
d as WORKING_DIRECTORY,
|
|
317
|
-
|
|
318
|
-
|
|
320
|
+
Ae as command,
|
|
321
|
+
Me as createGitHooksConfig
|
|
319
322
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("localforage"),o=require("node:fs/promises"),D=require("node:path"),c=require("./storage.constant.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("localforage"),o=require("node:fs/promises"),D=require("node:path"),c=require("./storage.constant.cjs"),s=require("../log/log.util.cjs"),I=require("../../config/env/env.util.cjs");var n=(e,r,t)=>new Promise((i,y)=>{var h=u=>{try{v(t.next(u))}catch(_){y(_)}},O=u=>{try{v(t.throw(u))}catch(_){y(_)}},v=u=>u.done?i(u.value):Promise.resolve(u.value).then(h,O);v((t=t.apply(e,r)).next())});const E=I.getEnv(),l={baseDir:E.CYBERSKILL_STORAGE_DIRECTORY};function m(e){return`${encodeURIComponent(e)}${c.STORAGE_KEY_EXTENSION}`}function N(e){return decodeURIComponent(e.slice(0,-c.STORAGE_KEY_EXTENSION.length))}function R(e,r){return D.join(r,m(e))}const d={_driver:c.NODE_FS_DRIVER_NAME,_support:!0,_initStorage(e){return n(this,null,function*(){try{const r=typeof e=="object"&&e!==null&&"baseDir"in e?e.baseDir:void 0;typeof r=="string"&&r.length>0?l.baseDir=r:l.baseDir=E.CYBERSKILL_STORAGE_DIRECTORY,yield o.mkdir(l.baseDir,{recursive:!0})}catch(r){throw s.log.error("[Storage:init]",r),r}})},clear(){return n(this,null,function*(){const{baseDir:e}=l;yield o.rm(e,{recursive:!0,force:!0}),yield o.mkdir(e,{recursive:!0})})},getItem(e){return n(this,null,function*(){const{baseDir:r}=l,t=R(e,r);try{const i=yield o.readFile(t,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}})},iterate(e){return n(this,null,function*(){const r=yield d.keys();let t=1;for(const i of r){const y=yield d.getItem(i),h=e(y,i,t);if(h!==void 0)return h;t+=1}})},key(e){return n(this,null,function*(){var r;return(r=(yield d.keys())[e])!=null?r:null})},keys(){return n(this,null,function*(){const{baseDir:e}=l;try{return(yield o.readdir(e)).filter(t=>t.endsWith(c.STORAGE_KEY_EXTENSION)).map(N)}catch(r){if(r.code==="ENOENT")return[];throw r}})},length(){return n(this,null,function*(){return(yield d.keys()).length})},removeItem(e){return n(this,null,function*(){const{baseDir:r}=l,t=R(e,r);yield o.rm(t,{force:!0})})},setItem(e,r){return n(this,null,function*(){const{baseDir:t}=l,i=R(e,t);return yield o.mkdir(t,{recursive:!0}),yield o.writeFile(i,JSON.stringify(r),"utf8"),r})}};let a=null,S=null;function f(){return n(this,null,function*(){return a?(yield a,S):(a=n(null,null,function*(){yield g.defineDriver(d),l.baseDir=E.CYBERSKILL_STORAGE_DIRECTORY;const e=yield g.getDriver(c.NODE_FS_DRIVER_NAME),r={baseDir:l.baseDir,name:c.STORAGE_INSTANCE_NAME,storeName:c.STORAGE_STORE_NAME};yield e._initStorage(r),S=e}).catch(e=>{throw a=null,e}),yield a,S)})}const T={get(e){return n(this,null,function*(){try{const t=yield(yield f()).getItem(e);return t!=null?t:null}catch(r){return s.catchError(r,{returnValue:null})}})},set(e,r){return n(this,null,function*(){try{yield(yield f()).setItem(e,r)}catch(t){s.catchError(t)}})},remove(e){return n(this,null,function*(){try{yield(yield f()).removeItem(e)}catch(r){s.catchError(r)}})},keys(){return n(this,null,function*(){try{const r=yield(yield f()).keys();return Array.isArray(r)?r:(s.log.warn("[Storage:keys] Invalid keys response:",r),[])}catch(e){return s.catchError(e,{returnValue:[]})}})},getLogLink(e){return n(this,null,function*(){try{return`${D.join(E.CYBERSKILL_STORAGE_DIRECTORY,m(e))} (key: ${e})`}catch(r){return s.catchError(r,{returnValue:null})}})}};exports.storage=T;
|
|
@@ -2,8 +2,8 @@ import _ from "localforage";
|
|
|
2
2
|
import l from "node:fs/promises";
|
|
3
3
|
import g from "node:path";
|
|
4
4
|
import { STORAGE_KEY_EXTENSION as R, NODE_FS_DRIVER_NAME as I, STORAGE_STORE_NAME as p, STORAGE_INSTANCE_NAME as b } from "./storage.constant.js";
|
|
5
|
-
import { getEnv as N } from "../../config/env/env.util.js";
|
|
6
5
|
import { catchError as s, log as S } from "../log/log.util.js";
|
|
6
|
+
import { getEnv as N } from "../../config/env/env.util.js";
|
|
7
7
|
var n = (e, r, t) => new Promise((i, d) => {
|
|
8
8
|
var y = (u) => {
|
|
9
9
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer as w } from "node:buffer";
|
|
2
2
|
import { Transform as C } from "node:stream";
|
|
3
3
|
import { ReadableStream as D } from "node:stream/web";
|
|
4
|
-
import {
|
|
4
|
+
import { DEFAULT_UPLOAD_CONFIG as R, BYTES_PER_MB as h } from "./upload.constant.js";
|
|
5
5
|
import { E_UploadType as p } from "./upload.type.js";
|
|
6
6
|
import { dirname as x } from "../path/path.util.js";
|
|
7
7
|
import { pathExistsSync as z, mkdirSync as A, createWriteStream as F } from "../fs/fs.util.js";
|
|
@@ -66,7 +66,7 @@ function G(t, r, e) {
|
|
|
66
66
|
let n = a.sizeLimit;
|
|
67
67
|
const l = new C({
|
|
68
68
|
transform(f, d, y) {
|
|
69
|
-
n -= f.length, n < 0 ? y(new Error(`File size exceeds limit of ${a.sizeLimit /
|
|
69
|
+
n -= f.length, n < 0 ? y(new Error(`File size exceeds limit of ${a.sizeLimit / h}MB`)) : y(null, f);
|
|
70
70
|
}
|
|
71
71
|
}), m = o().pipe(l);
|
|
72
72
|
return {
|
|
@@ -105,7 +105,7 @@ function U(t, r, e) {
|
|
|
105
105
|
return { isValid: !0 };
|
|
106
106
|
}
|
|
107
107
|
function O(t) {
|
|
108
|
-
return _(_({},
|
|
108
|
+
return _(_({}, R), t);
|
|
109
109
|
}
|
|
110
110
|
function W(t) {
|
|
111
111
|
return E(this, null, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@apollo/client/react"),n=require("react"),c=require("./apollo-client.context.cjs"),a=require("./apollo-client.util.cjs"),u=require("../apollo-error/apollo-error.provider.cjs"),p=require("../apollo-error/apollo-error.component.cjs"),m=require("react-hot-toast");function d(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const t=d(n);function s({options:e,children:o,onError:r}){const l=n.useMemo(()=>a.getClient(e!=null?e:{}),[e]);return t.createElement(t.Fragment,null,t.createElement(u.ApolloErrorProvider,{onError:r},t.createElement(c.ApolloClientProvider,{client:l},t.createElement(i.ApolloProvider,{client:l},o)),!r&&t.createElement(p.ApolloErrorComponent,null)),t.createElement(m.Toaster,{position:"top-right"}))}exports.ApolloProvider=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { I_ApolloProviderProps } from './apollo-client.type.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Apollo Provider component that wraps the application with Apollo Client context.
|
|
5
5
|
* This component provides the Apollo Client instance to all child components,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ApolloProvider as m } from "@apollo/client/react";
|
|
2
|
-
import
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { useMemo as i } from "react";
|
|
3
4
|
import { ApolloClientProvider as n } from "./apollo-client.context.js";
|
|
4
5
|
import { getClient as p } from "./apollo-client.util.js";
|
|
5
6
|
import { ApolloErrorProvider as a } from "../apollo-error/apollo-error.provider.js";
|
|
6
7
|
import { ApolloErrorComponent as c } from "../apollo-error/apollo-error.component.js";
|
|
7
8
|
import { Toaster as f } from "react-hot-toast";
|
|
8
|
-
function
|
|
9
|
+
function g({ options: r, children: l, onError: o }) {
|
|
9
10
|
const t = i(
|
|
10
11
|
() => p(r != null ? r : {}),
|
|
11
12
|
[r]
|
|
@@ -13,5 +14,5 @@ function s({ options: r, children: l, onError: o }) {
|
|
|
13
14
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(a, { onError: o }, /* @__PURE__ */ e.createElement(n, { client: t }, /* @__PURE__ */ e.createElement(m, { client: t }, l)), !o && /* @__PURE__ */ e.createElement(c, null)), /* @__PURE__ */ e.createElement(f, { position: "top-right" }));
|
|
14
15
|
}
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
g as ApolloProvider
|
|
17
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const i=c(r),l=r.createContext(null);function a({client:e,children:t}){return i.createElement(l,{value:e},t)}exports.ApolloClientContext=l;exports.ApolloClientProvider=a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloClient } from '@apollo/client';
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* React context for providing Apollo Client instance to child components.
|
|
5
5
|
* This context allows components to access the Apollo Client instance without
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { createContext as r } from "react";
|
|
3
|
+
const l = r(null);
|
|
4
|
+
function i({
|
|
5
|
+
client: t,
|
|
6
|
+
children: e
|
|
6
7
|
}) {
|
|
7
|
-
return /* @__PURE__ */ o.createElement(
|
|
8
|
+
return /* @__PURE__ */ o.createElement(l, { value: t }, e);
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
l as ApolloClientContext,
|
|
12
|
+
i as ApolloClientProvider
|
|
12
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@apollo/client/core"),c=require("@apollo/client/link"),b=require("@apollo/client/link/error"),y=require("@apollo/client/link/remove-typename"),h=require("@apollo/client/link/subscriptions"),O=require("graphql"),q=require("graphql-ws"),E=require("react"),v=require("rxjs"),f=require("./apollo-client.constant.cjs"),m=require("./apollo-client.module.scss.cjs"),P=require("./links/upload.cjs"),p=require("../apollo-error/apollo-error.util.cjs"),i=require("../log/log.util.cjs"),d=require("react-hot-toast");function A(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,t.get?t:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const g=A(E);var C=Object.defineProperty,L=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,k=(e,r,o)=>r in e?C(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,S=(e,r)=>{for(var o in r||(r={}))T.call(r,o)&&k(e,o,r[o]);if(L)for(var o of L(r))N.call(r,o)&&k(e,o,r[o]);return e};const $=new c.ApolloLink((e,r)=>(e.setContext({start:new Date}),r(e).pipe(v.tap(()=>{const o=new Date().getTime()-e.getContext().start;i.log.info(`Operation ${e.operationName} took ${o}ms to complete`)})))),R=new b.ErrorLink(({error:e,operation:r})=>{const o=(r==null?void 0:r.operationName)||"Unknown";let t="";s.CombinedGraphQLErrors.is(e)?e.errors.forEach(({message:n,locations:l,path:a},u)=>{u===0&&(t=n),i.log.error(`[GraphQL error] ${o}: ${n}, Location: ${JSON.stringify(l,null,4)}, Path: ${a}`)}):s.CombinedProtocolErrors.is(e)?e.errors.forEach(({message:n,extensions:l},a)=>{a===0&&(t=n),i.log.error(`[Protocol error]: ${n}, Extensions: ${JSON.stringify(l,null,4)}`)}):s.ServerError.is(e)?(t=e.message,i.log.error(`[Server error]: ${e.message}`)):(t=e.message,i.log.error(`[Network error]: ${e.message}`)),e&&t&&typeof window!="undefined"&&(p.hasCustomApolloErrorHandler()?p.showGlobalApolloError(e):d.toast.error(n=>g.createElement("div",{className:m.default["error-container"]},t,g.createElement("button",{type:"button",className:m.default["error-details-button"],onClick:()=>{p.showGlobalApolloError(e),d.toast.dismiss(n.id)}},"Error Details"))))});function w(e){const{uri:r,wsUrl:o,customLinks:t}=e,n=new y.RemoveTypenameFromVariablesLink;r||i.log.warn(`[Apollo] No GraphQL URI provided — using "${f.GRAPHQL_URI_DEFAULT}" as default`);const l=P.createUploadLink({uri:r!=null?r:f.GRAPHQL_URI_DEFAULT,credentials:"include",headers:{"apollo-require-preflight":"true"}}),a=o?new h.GraphQLWsLink(q.createClient({url:o})):c.ApolloLink.empty(),u=o?c.ApolloLink.split(({operationType:_})=>_===O.OperationTypeNode.SUBSCRIPTION,a,l):l;return o&&u===l&&i.log.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[$,R,n,...t!=null?t:[],u]}function U(e){const r=c.ApolloLink.from(w(e));return new s.ApolloClient(S({link:r,cache:new s.InMemoryCache},e))}exports.createApolloLinks=w;exports.getClient=U;
|
|
@@ -5,7 +5,7 @@ import { RemoveTypenameFromVariablesLink as O } from "@apollo/client/link/remove
|
|
|
5
5
|
import { GraphQLWsLink as P } from "@apollo/client/link/subscriptions";
|
|
6
6
|
import { OperationTypeNode as b } from "graphql";
|
|
7
7
|
import { createClient as C } from "graphql-ws";
|
|
8
|
-
import p from "react";
|
|
8
|
+
import * as p from "react";
|
|
9
9
|
import { tap as N } from "rxjs";
|
|
10
10
|
import { GRAPHQL_URI_DEFAULT as f } from "./apollo-client.constant.js";
|
|
11
11
|
import c from "./apollo-client.module.scss.js";
|
|
@@ -71,7 +71,7 @@ function Q(r) {
|
|
|
71
71
|
a
|
|
72
72
|
];
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Y(r) {
|
|
75
75
|
const e = m.from(Q(r));
|
|
76
76
|
return new y(I({
|
|
77
77
|
link: e,
|
|
@@ -80,5 +80,5 @@ function Z(r) {
|
|
|
80
80
|
}
|
|
81
81
|
export {
|
|
82
82
|
Q as createApolloLinks,
|
|
83
|
-
|
|
83
|
+
Y as getClient
|
|
84
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@apollo/client-integration-nextjs"),n=require("react"),a=require("./apollo-client-nextjs.util.cjs"),c=require("../apollo-error/apollo-error.provider.cjs"),u=require("../apollo-error/apollo-error.component.cjs"),p=require("react-hot-toast");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const r=s(n);function m({options:e,children:o,onError:t}){const l=n.useMemo(()=>()=>a.getClient(e||{}),[e]);return r.createElement(r.Fragment,null,r.createElement(c.ApolloErrorProvider,{onError:t},r.createElement(i.ApolloNextAppProvider,{makeClient:l},o),!t&&r.createElement(u.ApolloErrorComponent,null)),r.createElement(p.Toaster,{position:"top-right"}))}exports.ApolloProvider=m;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { I_ApolloProviderProps } from '../apollo-client/index.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Next.js Apollo Provider component that wraps the application with Apollo Client context.
|
|
5
5
|
* This component provides the Apollo Client instance to all child components,
|