@cyberskill/shared 2.27.0 → 3.0.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/dist/config/config.util.cjs +1 -1
- package/dist/config/config.util.js +24 -33
- package/dist/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +6 -0
- package/dist/config/eslint/index.js +4 -12
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.js +28 -33
- package/dist/config/storybook/storybook.preview.cjs +1 -1
- package/dist/config/storybook/storybook.preview.js +10 -13
- 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 +19 -8
- package/dist/constant/common.cjs +1 -1
- package/dist/constant/common.js +1 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/node/apollo-server/apollo-server.util.js +21 -48
- package/dist/node/cli/index.cjs +2 -5
- package/dist/node/cli/index.js +109 -170
- package/dist/node/command/command.util.cjs +2 -2
- package/dist/node/command/command.util.js +135 -170
- package/dist/node/express/express.util.cjs +1 -1
- package/dist/node/express/express.util.js +39 -72
- 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 +46 -53
- package/dist/node/fs/index.cjs +1 -1
- package/dist/node/fs/index.js +13 -12
- package/dist/node/log/log.util.cjs +1 -1
- package/dist/node/log/log.util.js +29 -30
- package/dist/node/mongo/mongo.controller.cjs +1 -1
- package/dist/node/mongo/mongo.controller.js +531 -629
- 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 +308 -354
- package/dist/node/package/package.util.cjs +1 -1
- package/dist/node/package/package.util.js +197 -226
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +26 -25
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +2 -0
- package/dist/node/path/path.constant.js +130 -150
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.js +110 -158
- package/dist/node/upload/upload.util.cjs +1 -1
- package/dist/node/upload/upload.util.js +119 -150
- package/dist/node/ws/ts.util.cjs +1 -1
- package/dist/node/ws/ts.util.js +31 -54
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +4 -4
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +51 -58
- package/dist/react/apollo-client/links/upload.cjs +1 -1
- package/dist/react/apollo-client/links/upload.js +71 -74
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -18
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +61 -23
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.module.scss.js +6 -6
- package/dist/react/apollo-error/apollo-error.test.unit.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.util.js +6 -6
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.js +30 -46
- package/dist/react/log/log.util.cjs +1 -1
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.js +13 -22
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +43 -59
- package/dist/react/storage/storage.util.cjs +1 -1
- package/dist/react/storage/storage.util.js +28 -53
- package/dist/react/userback/userback.component.cjs +1 -1
- package/dist/react/userback/userback.component.js +18 -42
- package/dist/style.css +1 -1
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +11 -0
- package/dist/util/common/common.util.js +33 -37
- 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 +22 -20
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +70 -70
- package/dist/util/string/index.cjs +1 -1
- package/dist/util/string/index.js +4 -3
- package/dist/util/string/string.util.cjs +1 -1
- package/dist/util/string/string.util.d.ts +12 -0
- package/dist/util/string/string.util.js +63 -44
- package/package.json +53 -44
- package/public/tsconfig.base.json +7 -3
- package/README.md +0 -470
- package/dist/node/mongo/mongo.util.d.ts +0 -1040
- /package/dist/node_modules/.pnpm/{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 → vitest@4.0.18_@types_node@25.3.3_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.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 → vitest@4.0.18_@types_node@25.3.3_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
|
@@ -1,156 +1,135 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveWorkingPath as o, join as
|
|
1
|
+
import K from "fs-extra";
|
|
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
|
|
5
|
-
import { setupPackages as
|
|
4
|
+
import { formatCommand as D, rawCommand as I } from "../command/command.util.js";
|
|
5
|
+
import { setupPackages as Y } from "../package/package.util.js";
|
|
6
6
|
import { E_PackageType as n } from "../package/package.type.js";
|
|
7
|
-
import { getEnv as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
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
|
-
WORKING_DIRECTORY: d,
|
|
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)
|
|
7
|
+
import { getEnv as h } from "../../config/env/env.util.js";
|
|
8
|
+
const b = h(), N = b.CWD, g = "@cyberskill/shared", P = "node_modules", L = "dist", F = "public", u = "package.json", V = "package-lock.json", v = "tsconfig.json", U = ".gitignore", j = ".simple-git-hooks.json", w = "pnpm-lock.yaml", B = ".git/hooks/", H = ".git/COMMIT_EDITMSG", x = ".git/info/exclude", J = ".migrate-mongo.config.js", E = K.readJsonSync(o(u)).name === g ? G(N, L) : G(N, P, g, L), pe = "cyberskill", re = "src/node/cli/index.ts", l = "eslint", d = "eslint", A = "vitest", M = "vitest", W = "@commitlint/cli", X = "@commitlint/config-conventional", $ = "commitlint", q = "lint-staged", f = "lint-staged", z = "typescript", Q = "tsc", a = "tsx", k = "git", _ = "pnpm", Z = "pnpm exec", ee = "simple-git-hooks", te = "simple-git-hooks", oe = "@eslint/config-inspector", ne = "eslint-config-inspector", se = "node-modules-inspector", ce = "node-modules-inspector", m = "migrate-mongo", C = "./node_modules/migrate-mongo/bin/migrate-mongo", y = "storybook", S = "storybook", Te = "@vudovn/ag-kit", Ee = ".agent", s = {
|
|
9
|
+
CYBERSKILL_DIRECTORY: E,
|
|
10
|
+
WORKING_DIRECTORY: N,
|
|
11
|
+
PUBLIC_DIRECTORY: o(F),
|
|
12
|
+
TS_CONFIG: o(v),
|
|
13
|
+
GIT_IGNORE: o(U),
|
|
14
|
+
GIT_HOOK: o(B),
|
|
15
|
+
GIT_COMMIT_MSG: o(H),
|
|
16
|
+
GIT_EXCLUDE: o(x),
|
|
17
|
+
SIMPLE_GIT_HOOKS_JSON: o(j),
|
|
18
|
+
PACKAGE_JSON: o(u),
|
|
19
|
+
PACKAGE_LOCK_JSON: o(V),
|
|
20
|
+
PNPM_LOCK_YAML: o(w),
|
|
21
|
+
NODE_MODULES: o(P),
|
|
22
|
+
MIGRATE_MONGO_CONFIG: o(J),
|
|
23
|
+
LINT_STAGED_CONFIG: o(`${E}/config/lint-staged/index.js`),
|
|
24
|
+
COMMITLINT_CONFIG: o(`${E}/config/commitlint/index.js`),
|
|
25
|
+
VITEST_UNIT_CONFIG: o(`${E}/config/vitest/vitest.unit.js`),
|
|
26
|
+
VITEST_E2E_CONFIG: o(`${E}/config/vitest/vitest.e2e.js`),
|
|
27
|
+
STORYBOOK_MAIN_CONFIG: o(`${E}/config/storybook/storybook.main.js`),
|
|
28
|
+
STORYBOOK_PREVIEW_CONFIG: o(`${E}/config/storybook/storybook.preview.js`),
|
|
29
|
+
DOT_AGENT: o(Ee)
|
|
52
30
|
};
|
|
53
|
-
function
|
|
54
|
-
return
|
|
55
|
-
"pre-commit":
|
|
56
|
-
"commit-msg":
|
|
57
|
-
|
|
31
|
+
function Oe({ isCurrentProject: c }) {
|
|
32
|
+
return {
|
|
33
|
+
"pre-commit": f,
|
|
34
|
+
"commit-msg": $,
|
|
35
|
+
...c ? { "pre-push": I(`${k} pull`) } : { "pre-push": I(`TAG_ONLY=true; while read local_ref local_oid remote_ref remote_oid; do case "$local_ref" in refs/tags/*) ;; *) TAG_ONLY=false; break ;; esac; done; if [ "$TAG_ONLY" = true ]; then echo '[pre-push] Tag-only push, skipping build.'; exit 0; fi; ${_} build`) }
|
|
36
|
+
};
|
|
58
37
|
}
|
|
59
|
-
function t({ type: c, packages:
|
|
60
|
-
const
|
|
61
|
-
return () =>
|
|
38
|
+
function t({ type: c, packages: p, command: r }) {
|
|
39
|
+
const T = p?.reduce((i, O) => (i.some((R) => R.name === O.name) || i.push(O), i), []);
|
|
40
|
+
return async () => {
|
|
62
41
|
switch (c) {
|
|
63
42
|
case e.CLI:
|
|
64
|
-
return
|
|
43
|
+
return T?.length && await Y(T, {
|
|
65
44
|
install: !0
|
|
66
|
-
})
|
|
45
|
+
}), D(I(`${Z} ${r}`));
|
|
67
46
|
case e.STRING:
|
|
68
|
-
return
|
|
47
|
+
return D(I(r));
|
|
69
48
|
default:
|
|
70
49
|
throw new Error("Unsupported command type");
|
|
71
50
|
}
|
|
72
|
-
}
|
|
51
|
+
};
|
|
73
52
|
}
|
|
74
|
-
const
|
|
53
|
+
const Ge = {
|
|
75
54
|
simpleGitHooks: t({
|
|
76
55
|
type: e.CLI,
|
|
77
56
|
packages: [
|
|
78
57
|
{
|
|
79
|
-
name:
|
|
58
|
+
name: ee,
|
|
80
59
|
type: n.DEV_DEPENDENCY
|
|
81
60
|
}
|
|
82
61
|
],
|
|
83
|
-
command:
|
|
62
|
+
command: te
|
|
84
63
|
}),
|
|
85
64
|
eslintInspect: t({
|
|
86
65
|
type: e.CLI,
|
|
87
66
|
packages: [
|
|
88
67
|
{
|
|
89
|
-
name:
|
|
68
|
+
name: oe,
|
|
90
69
|
type: n.DEV_DEPENDENCY
|
|
91
70
|
}
|
|
92
71
|
],
|
|
93
|
-
command:
|
|
72
|
+
command: ne
|
|
94
73
|
}),
|
|
95
74
|
nodeModulesInspect: t({
|
|
96
75
|
type: e.CLI,
|
|
97
76
|
packages: [
|
|
98
77
|
{
|
|
99
|
-
name:
|
|
78
|
+
name: se,
|
|
100
79
|
type: n.DEV_DEPENDENCY
|
|
101
80
|
}
|
|
102
81
|
],
|
|
103
|
-
command:
|
|
82
|
+
command: ce
|
|
104
83
|
}),
|
|
105
84
|
eslintCheck: t({
|
|
106
85
|
type: e.CLI,
|
|
107
86
|
packages: [
|
|
108
87
|
{
|
|
109
|
-
name:
|
|
88
|
+
name: l,
|
|
110
89
|
type: n.DEV_DEPENDENCY
|
|
111
90
|
}
|
|
112
91
|
],
|
|
113
|
-
command: `${
|
|
92
|
+
command: `${d} ${s.WORKING_DIRECTORY} --no-cache`
|
|
114
93
|
}),
|
|
115
94
|
eslintFix: t({
|
|
116
95
|
type: e.CLI,
|
|
117
96
|
packages: [
|
|
118
97
|
{
|
|
119
|
-
name:
|
|
98
|
+
name: l,
|
|
120
99
|
type: n.DEV_DEPENDENCY
|
|
121
100
|
}
|
|
122
101
|
],
|
|
123
|
-
command: `${
|
|
102
|
+
command: `${d} ${s.WORKING_DIRECTORY} --fix --no-cache`
|
|
124
103
|
}),
|
|
125
104
|
typescriptCheck: t({
|
|
126
105
|
type: e.CLI,
|
|
127
106
|
packages: [
|
|
128
107
|
{
|
|
129
|
-
name:
|
|
108
|
+
name: z,
|
|
130
109
|
type: n.DEV_DEPENDENCY
|
|
131
110
|
}
|
|
132
111
|
],
|
|
133
|
-
command: `${
|
|
112
|
+
command: `${Q} -p ${s.TS_CONFIG} --noEmit`
|
|
134
113
|
}),
|
|
135
114
|
testUnit: t({
|
|
136
115
|
type: e.CLI,
|
|
137
116
|
packages: [
|
|
138
117
|
{
|
|
139
|
-
name:
|
|
118
|
+
name: A,
|
|
140
119
|
type: n.DEV_DEPENDENCY
|
|
141
120
|
}
|
|
142
121
|
],
|
|
143
|
-
command: `${
|
|
122
|
+
command: `${M} --config ${s.VITEST_UNIT_CONFIG}`
|
|
144
123
|
}),
|
|
145
124
|
testE2e: t({
|
|
146
125
|
type: e.CLI,
|
|
147
126
|
packages: [
|
|
148
127
|
{
|
|
149
|
-
name:
|
|
128
|
+
name: A,
|
|
150
129
|
type: n.DEV_DEPENDENCY
|
|
151
130
|
}
|
|
152
131
|
],
|
|
153
|
-
command: `${
|
|
132
|
+
command: `${M} --config ${s.VITEST_E2E_CONFIG}`
|
|
154
133
|
}),
|
|
155
134
|
mongoMigrateCreate: (c) => {
|
|
156
135
|
if (!/^[\w-]+$/.test(c))
|
|
@@ -159,164 +138,165 @@ const Ae = {
|
|
|
159
138
|
type: e.CLI,
|
|
160
139
|
packages: [
|
|
161
140
|
{
|
|
162
|
-
name:
|
|
141
|
+
name: a,
|
|
163
142
|
type: n.DEPENDENCY
|
|
164
143
|
},
|
|
165
144
|
{
|
|
166
|
-
name:
|
|
145
|
+
name: m,
|
|
167
146
|
type: n.DEPENDENCY
|
|
168
147
|
}
|
|
169
148
|
],
|
|
170
|
-
command: `${
|
|
149
|
+
command: `${a} ${C} create ${c} -f ${s.MIGRATE_MONGO_CONFIG}`
|
|
171
150
|
})();
|
|
172
151
|
},
|
|
173
152
|
mongoMigrateUp: t({
|
|
174
153
|
type: e.CLI,
|
|
175
154
|
packages: [
|
|
176
155
|
{
|
|
177
|
-
name:
|
|
156
|
+
name: a,
|
|
178
157
|
type: n.DEPENDENCY
|
|
179
158
|
},
|
|
180
159
|
{
|
|
181
|
-
name:
|
|
160
|
+
name: m,
|
|
182
161
|
type: n.DEPENDENCY
|
|
183
162
|
}
|
|
184
163
|
],
|
|
185
|
-
command: `${
|
|
164
|
+
command: `${a} ${C} up -f ${s.MIGRATE_MONGO_CONFIG}`
|
|
186
165
|
}),
|
|
187
166
|
mongoMigrateDown: t({
|
|
188
167
|
type: e.CLI,
|
|
189
168
|
packages: [
|
|
190
169
|
{
|
|
191
|
-
name:
|
|
170
|
+
name: a,
|
|
192
171
|
type: n.DEPENDENCY
|
|
193
172
|
},
|
|
194
173
|
{
|
|
195
|
-
name:
|
|
174
|
+
name: m,
|
|
196
175
|
type: n.DEPENDENCY
|
|
197
176
|
}
|
|
198
177
|
],
|
|
199
|
-
command: `${
|
|
178
|
+
command: `${a} ${C} down -f ${s.MIGRATE_MONGO_CONFIG}`
|
|
200
179
|
}),
|
|
201
180
|
commitLint: t({
|
|
202
181
|
type: e.CLI,
|
|
203
182
|
packages: [
|
|
204
183
|
{
|
|
205
|
-
name:
|
|
184
|
+
name: W,
|
|
206
185
|
type: n.DEV_DEPENDENCY
|
|
207
186
|
},
|
|
208
187
|
{
|
|
209
|
-
name:
|
|
188
|
+
name: X,
|
|
210
189
|
type: n.DEV_DEPENDENCY
|
|
211
190
|
}
|
|
212
191
|
],
|
|
213
|
-
command: `${
|
|
192
|
+
command: `${$} --edit ${s.GIT_COMMIT_MSG} --config ${s.COMMITLINT_CONFIG}`
|
|
214
193
|
}),
|
|
215
194
|
lintStaged: t({
|
|
216
195
|
type: e.CLI,
|
|
217
196
|
packages: [
|
|
218
197
|
{
|
|
219
|
-
name:
|
|
198
|
+
name: q,
|
|
220
199
|
type: n.DEV_DEPENDENCY
|
|
221
200
|
}
|
|
222
201
|
],
|
|
223
|
-
command: `${
|
|
202
|
+
command: `${f} --config ${s.LINT_STAGED_CONFIG}`
|
|
224
203
|
}),
|
|
225
204
|
configureGitHook: t({
|
|
226
205
|
type: e.STRING,
|
|
227
|
-
command: `${
|
|
206
|
+
command: `${k} config core.hooksPath ${s.GIT_HOOK}`
|
|
228
207
|
}),
|
|
229
208
|
build: t({
|
|
230
209
|
type: e.STRING,
|
|
231
|
-
command: `${
|
|
210
|
+
command: `${_} run --if-present build`
|
|
232
211
|
}),
|
|
233
212
|
pnpmInstallStandard: t({
|
|
234
213
|
type: e.STRING,
|
|
235
|
-
command: `${
|
|
214
|
+
command: `${_} install --ignore-scripts`
|
|
236
215
|
}),
|
|
237
216
|
pnpmInstallLegacy: t({
|
|
238
217
|
type: e.STRING,
|
|
239
|
-
command: `${
|
|
218
|
+
command: `${_} install --ignore-scripts --legacy-peer-deps`
|
|
240
219
|
}),
|
|
241
220
|
pnpmInstallForce: t({
|
|
242
221
|
type: e.STRING,
|
|
243
|
-
command: `${
|
|
222
|
+
command: `${_} install --ignore-scripts --force`
|
|
244
223
|
}),
|
|
245
224
|
pnpmPruneStore: t({
|
|
246
225
|
type: e.STRING,
|
|
247
|
-
command: `${
|
|
226
|
+
command: `${_} store prune`
|
|
248
227
|
}),
|
|
249
228
|
pnpmCleanCache: t({
|
|
250
229
|
type: e.STRING,
|
|
251
|
-
command: `${
|
|
230
|
+
command: `${_} cache delete`
|
|
252
231
|
}),
|
|
253
232
|
storybookDev: t({
|
|
254
233
|
type: e.CLI,
|
|
255
234
|
packages: [
|
|
256
235
|
{
|
|
257
|
-
name:
|
|
236
|
+
name: y,
|
|
258
237
|
type: n.DEV_DEPENDENCY
|
|
259
238
|
}
|
|
260
239
|
],
|
|
261
|
-
command: `${
|
|
240
|
+
command: `${S} dev`
|
|
262
241
|
}),
|
|
263
242
|
storybookBuild: t({
|
|
264
243
|
type: e.CLI,
|
|
265
244
|
packages: [
|
|
266
245
|
{
|
|
267
|
-
name:
|
|
246
|
+
name: y,
|
|
268
247
|
type: n.DEV_DEPENDENCY
|
|
269
248
|
}
|
|
270
249
|
],
|
|
271
|
-
command: `${
|
|
250
|
+
command: `${S} build`
|
|
272
251
|
})
|
|
273
252
|
};
|
|
274
253
|
export {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
Z as
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
254
|
+
Te as AG_KIT_PACKAGE_NAME,
|
|
255
|
+
L as BUILD_DIRECTORY,
|
|
256
|
+
$ as COMMIT_LINT_CLI,
|
|
257
|
+
X as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
|
|
258
|
+
W as COMMIT_LINT_PACKAGE_NAME,
|
|
259
|
+
pe as CYBERSKILL_CLI,
|
|
260
|
+
re as CYBERSKILL_CLI_PATH,
|
|
261
|
+
E as CYBERSKILL_DIRECTORY,
|
|
262
|
+
g as CYBERSKILL_PACKAGE_NAME,
|
|
263
|
+
Ee as DOT_AGENT,
|
|
264
|
+
d as ESLINT_CLI,
|
|
265
|
+
ne as ESLINT_INSPECT_CLI,
|
|
266
|
+
oe as ESLINT_INSPECT_PACKAGE_NAME,
|
|
267
|
+
l as ESLINT_PACKAGE_NAME,
|
|
268
|
+
k as GIT_CLI,
|
|
269
|
+
H as GIT_COMMIT_EDITMSG,
|
|
270
|
+
x as GIT_EXCLUDE,
|
|
271
|
+
B as GIT_HOOK,
|
|
272
|
+
U as GIT_IGNORE,
|
|
273
|
+
f as LINT_STAGED_CLI,
|
|
274
|
+
q as LINT_STAGED_PACKAGE_NAME,
|
|
275
|
+
C as MIGRATE_MONGO_CLI,
|
|
276
|
+
J as MIGRATE_MONGO_CONFIG,
|
|
277
|
+
m as MIGRATE_MONGO_PACKAGE_NAME,
|
|
278
|
+
P as NODE_MODULES,
|
|
279
|
+
ce as NODE_MODULES_INSPECT_CLI,
|
|
280
|
+
se as NODE_MODULES_INSPECT_PACKAGE_NAME,
|
|
281
|
+
u as PACKAGE_JSON,
|
|
282
|
+
V as PACKAGE_LOCK_JSON,
|
|
283
|
+
s as PATH,
|
|
284
|
+
_ as PNPM_CLI,
|
|
285
|
+
Z as PNPM_EXEC_CLI,
|
|
286
|
+
w as PNPM_LOCK_YAML,
|
|
287
|
+
F as PUBLIC_DIRECTORY,
|
|
288
|
+
ee as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
|
|
289
|
+
te as SIMPLE_GIT_HOOK_CLI,
|
|
290
|
+
j as SIMPLE_GIT_HOOK_JSON,
|
|
291
|
+
S as STORYBOOK_CLI,
|
|
292
|
+
y as STORYBOOK_PACKAGE_NAME,
|
|
293
|
+
v as TSCONFIG_JSON,
|
|
294
|
+
Q as TSC_CLI,
|
|
295
|
+
z as TSC_PACKAGE_NAME,
|
|
296
|
+
a as TSX_CLI,
|
|
297
|
+
M as VITEST_CLI,
|
|
298
|
+
A as VITEST_PACKAGE_NAME,
|
|
299
|
+
N as WORKING_DIRECTORY,
|
|
300
|
+
Ge as command,
|
|
301
|
+
Oe as createGitHooksConfig
|
|
322
302
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("localforage"),i=require("node:fs/promises"),_=require("node:path"),o=require("./storage.constant.cjs"),s=require("../log/log.util.cjs"),R=require("../../config/env/env.util.cjs"),y=R.getEnv(),a={baseDir:y.CYBERSKILL_STORAGE_DIRECTORY};function h(r){return`${encodeURIComponent(r)}${o.STORAGE_KEY_EXTENSION}`}function S(r){return decodeURIComponent(r.slice(0,-o.STORAGE_KEY_EXTENSION.length))}function E(r,e){return _.join(e,h(r))}const u={_driver:o.NODE_FS_DRIVER_NAME,_support:!0,async _initStorage(r){try{const e=typeof r=="object"&&r!==null&&"baseDir"in r?r.baseDir:void 0;typeof e=="string"&&e.length>0?a.baseDir=e:a.baseDir=y.CYBERSKILL_STORAGE_DIRECTORY,await i.mkdir(a.baseDir,{recursive:!0})}catch(e){throw s.log.error("[Storage:init]",e),e}},async clear(){const{baseDir:r}=a;await i.rm(r,{recursive:!0,force:!0}),await i.mkdir(r,{recursive:!0})},async getItem(r){const{baseDir:e}=a,t=E(r,e);try{const n=await i.readFile(t,"utf8");return JSON.parse(n)}catch(n){if(n.code==="ENOENT")return null;throw n}},async iterate(r){const e=await u.keys();let t=1;for(const n of e){const v=await u.getItem(n),g=r(v,n,t);if(g!==void 0)return g;t+=1}},async key(r){return(await u.keys())[r]??null},async keys(){const{baseDir:r}=a;try{return(await i.readdir(r)).filter(t=>t.endsWith(o.STORAGE_KEY_EXTENSION)).map(S)}catch(e){if(e.code==="ENOENT")return[];throw e}},async length(){return(await u.keys()).length},async removeItem(r){const{baseDir:e}=a,t=E(r,e);await i.rm(t,{force:!0})},async setItem(r,e){const{baseDir:t}=a,n=E(r,t);return await i.mkdir(t,{recursive:!0}),await i.writeFile(n,JSON.stringify(e),"utf8"),e}};let c=null,d=null;async function l(){return c?(await c,d):(c=(async()=>{await w.defineDriver(u),a.baseDir=y.CYBERSKILL_STORAGE_DIRECTORY;const r=await w.getDriver(o.NODE_FS_DRIVER_NAME),e={baseDir:a.baseDir,name:o.STORAGE_INSTANCE_NAME,storeName:o.STORAGE_STORE_NAME};await r._initStorage(e),d=r})().catch(r=>{throw c=null,r}),await c,d)}const f={async get(r){try{return await(await l()).getItem(r)??null}catch(e){return s.catchError(e,{returnValue:null})}},async set(r,e){try{await(await l()).setItem(r,e)}catch(t){s.catchError(t)}},async remove(r){try{await(await l()).removeItem(r)}catch(e){s.catchError(e)}},async keys(){try{const e=await(await l()).keys();return Array.isArray(e)?e:(s.log.warn("[Storage:keys] Invalid keys response:",e),[])}catch(r){return s.catchError(r,{returnValue:[]})}},async getLogLink(r){try{return`${_.join(y.CYBERSKILL_STORAGE_DIRECTORY,h(r))} (key: ${r})`}catch(e){return s.catchError(e,{returnValue:null})}}};exports.storage=f;
|