@cyberskill/shared 1.210.0 → 1.211.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/commitlint/index.cjs +1 -0
- package/dist/config/config.type.cjs +1 -0
- package/dist/config/config.util.cjs +1 -0
- package/dist/config/config.util.js +35 -26
- package/dist/config/env/env.constant.cjs +1 -0
- package/dist/config/env/env.util.cjs +1 -0
- package/dist/config/env/index.cjs +1 -0
- package/dist/config/eslint/index.cjs +1 -0
- package/dist/config/eslint/index.js +12 -4
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +33 -28
- package/dist/config/graphql-codegen/index.cjs +1 -0
- package/dist/config/index.cjs +1 -0
- package/dist/config/lint-staged/index.cjs +1 -0
- package/dist/config/vitest/index.cjs +1 -0
- package/dist/config/vitest/vitest.e2e.cjs +1 -0
- package/dist/config/vitest/vitest.e2e.js +16 -9
- package/dist/config/vitest/vitest.unit.cjs +1 -0
- package/dist/config/vitest/vitest.unit.js +18 -11
- package/dist/constant/common.cjs +1 -0
- package/dist/constant/common.js +1 -1
- package/dist/constant/index.cjs +1 -0
- package/dist/constant/response-status.cjs +1 -0
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +48 -21
- package/dist/node/apollo-server/index.cjs +1 -0
- package/dist/node/cli/index.cjs +6 -0
- package/dist/node/cli/index.js +140 -90
- package/dist/node/command/command.type.cjs +1 -0
- package/dist/node/command/command.util.cjs +2 -0
- package/dist/node/command/command.util.js +148 -117
- package/dist/node/command/index.cjs +1 -0
- package/dist/node/express/express.util.cjs +1 -0
- package/dist/node/express/express.util.js +70 -37
- package/dist/node/express/index.cjs +1 -0
- package/dist/node/fs/fs.util.cjs +1 -0
- package/dist/node/fs/fs.util.js +55 -40
- package/dist/node/fs/index.cjs +1 -0
- package/dist/node/log/index.cjs +1 -0
- package/dist/node/log/log.type.cjs +1 -0
- package/dist/node/log/log.util.cjs +1 -0
- package/dist/node/log/log.util.js +31 -30
- package/dist/node/mongo/index.cjs +1 -0
- package/dist/node/mongo/mongo.constant.cjs +1 -0
- package/dist/node/mongo/mongo.type.cjs +1 -0
- package/dist/node/mongo/mongo.util.cjs +5 -0
- package/dist/node/mongo/mongo.util.js +433 -365
- package/dist/node/package/index.cjs +1 -0
- package/dist/node/package/package.type.cjs +1 -0
- package/dist/node/package/package.util.cjs +1 -0
- package/dist/node/package/package.util.js +224 -195
- package/dist/node/path/index.cjs +1 -0
- package/dist/node/path/path.constant.cjs +1 -0
- package/dist/node/path/path.constant.js +205 -183
- package/dist/node/path/path.util.cjs +1 -0
- package/dist/node/storage/index.cjs +1 -0
- package/dist/node/storage/storage.util.cjs +1 -0
- package/dist/node/storage/storage.util.js +70 -40
- package/dist/node/upload/index.cjs +1 -0
- package/dist/node/upload/upload.type.cjs +1 -0
- package/dist/node/upload/upload.util.cjs +1 -0
- package/dist/node/upload/upload.util.js +119 -91
- package/dist/node/ws/index.cjs +1 -0
- package/dist/node/ws/ts.util.cjs +1 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.13_@vitest_browser@3.2.4_jiti@2.4.2_j_cac3da623d5688a51c0b1a2270e144db/node_modules/vitest/dist/config.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.constant.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.context.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.util.js +74 -64
- package/dist/react/apollo-client/index.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +18 -11
- package/dist/react/apollo-client-nextjs/index.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +6 -6
- package/dist/react/apollo-error/apollo-error.context.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.hook.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +1 -1
- package/dist/react/apollo-error/index.cjs +1 -0
- package/dist/react/i18next/i18next.hook.cjs +1 -0
- package/dist/react/i18next/i18next.util.cjs +1 -0
- package/dist/react/i18next/index.cjs +1 -0
- package/dist/react/loading/index.cjs +1 -0
- package/dist/react/loading/loading.component.cjs +6 -0
- package/dist/react/loading/loading.component.js +36 -19
- package/dist/react/loading/loading.context.cjs +1 -0
- package/dist/react/loading/loading.hook.cjs +1 -0
- package/dist/react/loading/loading.module.scss.cjs +1 -0
- package/dist/react/loading/loading.provider.cjs +1 -0
- package/dist/react/log/index.cjs +1 -0
- package/dist/react/log/log.util.cjs +1 -0
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/index.cjs +1 -0
- package/dist/react/next-intl/next-intl.constant.cjs +1 -0
- package/dist/react/next-intl/next-intl.context.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +23 -14
- package/dist/react/next-intl/next-intl.hook.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/index.cjs +1 -0
- package/dist/react/storage/storage.hook.cjs +1 -0
- package/dist/react/storage/storage.hook.js +57 -41
- package/dist/react/storage/storage.util.cjs +1 -0
- package/dist/react/storage/storage.util.js +50 -25
- package/dist/react/toast/index.cjs +1 -0
- package/dist/react/userback/index.cjs +1 -0
- package/dist/react/userback/userback.component.cjs +1 -0
- package/dist/react/userback/userback.component.js +42 -18
- package/dist/style.css +1 -1
- package/dist/typescript/common.type.cjs +1 -0
- package/dist/typescript/index.cjs +1 -0
- package/dist/util/common/common.util.cjs +1 -0
- package/dist/util/common/common.util.js +37 -29
- package/dist/util/common/index.cjs +1 -0
- package/dist/util/index.cjs +1 -0
- package/dist/util/object/index.cjs +1 -0
- package/dist/util/object/object.util.cjs +1 -0
- package/dist/util/object/object.util.js +55 -49
- package/dist/util/serializer/index.cjs +1 -0
- package/dist/util/serializer/serializer.util.cjs +1 -0
- package/dist/util/string/index.cjs +1 -0
- package/dist/util/string/string.util.cjs +1 -0
- package/dist/util/string/string.util.js +46 -36
- package/dist/util/validate/index.cjs +1 -0
- package/dist/util/validate/validate.util.cjs +1 -0
- package/package.json +69 -35
|
@@ -1,273 +1,295 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveWorkingPath as
|
|
3
|
-
import { E_CommandType as
|
|
4
|
-
import { formatCommand as
|
|
5
|
-
import { setupPackages as
|
|
6
|
-
import { E_PackageType as
|
|
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
|
-
|
|
1
|
+
import v from "fs-extra";
|
|
2
|
+
import { resolveWorkingPath as c, join as L } from "./path.util.js";
|
|
3
|
+
import { E_CommandType as e } from "../command/command.type.js";
|
|
4
|
+
import { formatCommand as d, rawCommand as g } from "../command/command.util.js";
|
|
5
|
+
import { setupPackages as h } from "../package/package.util.js";
|
|
6
|
+
import { E_PackageType as s } from "../package/package.type.js";
|
|
7
|
+
import { getEnv as F } from "../../config/env/env.util.js";
|
|
8
|
+
var V = Object.defineProperty, P = Object.getOwnPropertySymbols, U = Object.prototype.hasOwnProperty, j = Object.prototype.propertyIsEnumerable, M = (E, n, o) => n in E ? V(E, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : E[n] = o, w = (E, n) => {
|
|
9
|
+
for (var o in n || (n = {}))
|
|
10
|
+
U.call(n, o) && M(E, o, n[o]);
|
|
11
|
+
if (P)
|
|
12
|
+
for (var o of P(n))
|
|
13
|
+
j.call(n, o) && M(E, o, n[o]);
|
|
14
|
+
return E;
|
|
15
|
+
}, H = (E, n, o) => new Promise((r, I) => {
|
|
16
|
+
var C = (a) => {
|
|
17
|
+
try {
|
|
18
|
+
O(o.next(a));
|
|
19
|
+
} catch (T) {
|
|
20
|
+
I(T);
|
|
21
|
+
}
|
|
22
|
+
}, N = (a) => {
|
|
23
|
+
try {
|
|
24
|
+
O(o.throw(a));
|
|
25
|
+
} catch (T) {
|
|
26
|
+
I(T);
|
|
27
|
+
}
|
|
28
|
+
}, O = (a) => a.done ? r(a.value) : Promise.resolve(a.value).then(C, N);
|
|
29
|
+
O((o = o.apply(E, n)).next());
|
|
30
|
+
});
|
|
31
|
+
const b = F(), D = b.CWD, S = "@cyberskill/shared", $ = "node_modules", J = "dist", x = "public", R = "package.json", B = "package-lock.json", W = "tsconfig.json", X = ".gitignore", q = ".simple-git-hooks.json", z = "pnpm-lock.yaml", Q = ".git/hooks/", Z = ".git/COMMIT_EDITMSG", ee = ".migrate-mongo.config.js", m = (() => {
|
|
32
|
+
const n = v.readJsonSync(c(R)).name === S ? D : L(D, $, S);
|
|
33
|
+
return L(n, J);
|
|
34
|
+
})(), ge = "cyberskill", De = "src/node/cli/index.ts", y = "eslint", A = "eslint", u = "vitest", f = "vitest", te = "@commitlint/cli", ne = "@commitlint/config-conventional", K = "commitlint", oe = "lint-staged", k = "lint-staged", se = "typescript", ce = "tsc", i = "tsx", Y = "git", p = "pnpm", Ee = "pnpm exec", _e = "simple-git-hooks", ae = "simple-git-hooks", Ie = "@eslint/config-inspector", me = "eslint-config-inspector", ie = "node-modules-inspector", pe = "node-modules-inspector", l = "migrate-mongo", G = "./node_modules/migrate-mongo/bin/migrate-mongo", _ = {
|
|
35
|
+
CYBERSKILL_DIRECTORY: m,
|
|
36
|
+
WORKING_DIRECTORY: D,
|
|
37
|
+
PUBLIC_DIRECTORY: c(x),
|
|
38
|
+
TS_CONFIG: c(W),
|
|
39
|
+
GIT_IGNORE: c(X),
|
|
40
|
+
GIT_HOOK: c(Q),
|
|
41
|
+
GIT_COMMIT_MSG: c(Z),
|
|
42
|
+
SIMPLE_GIT_HOOKS_JSON: c(q),
|
|
43
|
+
PACKAGE_JSON: c(R),
|
|
44
|
+
PACKAGE_LOCK_JSON: c(B),
|
|
45
|
+
PNPM_LOCK_YAML: c(z),
|
|
46
|
+
NODE_MODULES: c($),
|
|
47
|
+
MIGRATE_MONGO_CONFIG: c(ee),
|
|
48
|
+
LINT_STAGED_CONFIG: c(`${m}/src/config/lint-staged/index.js`),
|
|
49
|
+
COMMITLINT_CONFIG: c(`${m}/src/config/commitlint/index.js`),
|
|
50
|
+
VITEST_UNIT_CONFIG: c(`${m}/src/config/vitest/vitest.unit.js`),
|
|
51
|
+
VITEST_UNIT_SETUP_CONFIG: c(`${m}/src/config/vitest/vitest.unit.setup.js`),
|
|
52
|
+
VITEST_E2E_CONFIG: c(`${m}/src/config/vitest/vitest.e2e.js`)
|
|
30
53
|
};
|
|
31
|
-
function
|
|
32
|
-
return {
|
|
33
|
-
"pre-commit":
|
|
34
|
-
"commit-msg":
|
|
35
|
-
|
|
36
|
-
};
|
|
54
|
+
function Le({ isCurrentProject: E }) {
|
|
55
|
+
return w({
|
|
56
|
+
"pre-commit": k,
|
|
57
|
+
"commit-msg": K
|
|
58
|
+
}, E && { "pre-push": g(`${Y} pull`) });
|
|
37
59
|
}
|
|
38
|
-
function
|
|
39
|
-
const r =
|
|
40
|
-
return
|
|
41
|
-
switch (
|
|
42
|
-
case
|
|
43
|
-
return r
|
|
60
|
+
function t({ type: E, packages: n, command: o }) {
|
|
61
|
+
const r = n == null ? void 0 : n.reduce((I, C) => (I.some((N) => N.name === C.name) || I.push(C), I), []);
|
|
62
|
+
return () => H(null, null, function* () {
|
|
63
|
+
switch (E) {
|
|
64
|
+
case e.CLI:
|
|
65
|
+
return r != null && r.length && (yield h(r, {
|
|
44
66
|
install: !0
|
|
45
|
-
}), g(
|
|
46
|
-
case
|
|
47
|
-
return g(
|
|
67
|
+
})), d(g(`${Ee} ${o}`));
|
|
68
|
+
case e.STRING:
|
|
69
|
+
return d(g(o));
|
|
48
70
|
default:
|
|
49
71
|
throw new Error("Unsupported command type");
|
|
50
72
|
}
|
|
51
|
-
};
|
|
73
|
+
});
|
|
52
74
|
}
|
|
53
|
-
const
|
|
54
|
-
simpleGitHooks:
|
|
55
|
-
type:
|
|
75
|
+
const de = {
|
|
76
|
+
simpleGitHooks: t({
|
|
77
|
+
type: e.CLI,
|
|
56
78
|
packages: [
|
|
57
79
|
{
|
|
58
|
-
name:
|
|
59
|
-
type:
|
|
80
|
+
name: _e,
|
|
81
|
+
type: s.DEV_DEPENDENCY
|
|
60
82
|
}
|
|
61
83
|
],
|
|
62
|
-
command:
|
|
84
|
+
command: ae
|
|
63
85
|
}),
|
|
64
|
-
eslintInspect:
|
|
65
|
-
type:
|
|
86
|
+
eslintInspect: t({
|
|
87
|
+
type: e.CLI,
|
|
66
88
|
packages: [
|
|
67
89
|
{
|
|
68
|
-
name:
|
|
69
|
-
type:
|
|
90
|
+
name: Ie,
|
|
91
|
+
type: s.DEV_DEPENDENCY
|
|
70
92
|
}
|
|
71
93
|
],
|
|
72
|
-
command:
|
|
94
|
+
command: me
|
|
73
95
|
}),
|
|
74
|
-
nodeModulesInspect:
|
|
75
|
-
type:
|
|
96
|
+
nodeModulesInspect: t({
|
|
97
|
+
type: e.CLI,
|
|
76
98
|
packages: [
|
|
77
99
|
{
|
|
78
|
-
name:
|
|
79
|
-
type:
|
|
100
|
+
name: ie,
|
|
101
|
+
type: s.DEV_DEPENDENCY
|
|
80
102
|
}
|
|
81
103
|
],
|
|
82
|
-
command:
|
|
104
|
+
command: pe
|
|
83
105
|
}),
|
|
84
|
-
eslintCheck:
|
|
85
|
-
type:
|
|
106
|
+
eslintCheck: t({
|
|
107
|
+
type: e.CLI,
|
|
86
108
|
packages: [
|
|
87
109
|
{
|
|
88
|
-
name:
|
|
89
|
-
type:
|
|
110
|
+
name: y,
|
|
111
|
+
type: s.DEV_DEPENDENCY
|
|
90
112
|
}
|
|
91
113
|
],
|
|
92
|
-
command: `${
|
|
114
|
+
command: `${A} ${_.WORKING_DIRECTORY} --no-cache`
|
|
93
115
|
}),
|
|
94
|
-
eslintFix:
|
|
95
|
-
type:
|
|
116
|
+
eslintFix: t({
|
|
117
|
+
type: e.CLI,
|
|
96
118
|
packages: [
|
|
97
119
|
{
|
|
98
|
-
name:
|
|
99
|
-
type:
|
|
120
|
+
name: y,
|
|
121
|
+
type: s.DEV_DEPENDENCY
|
|
100
122
|
}
|
|
101
123
|
],
|
|
102
|
-
command: `${
|
|
124
|
+
command: `${A} ${_.WORKING_DIRECTORY} --fix --no-cache`
|
|
103
125
|
}),
|
|
104
|
-
typescriptCheck:
|
|
105
|
-
type:
|
|
126
|
+
typescriptCheck: t({
|
|
127
|
+
type: e.CLI,
|
|
106
128
|
packages: [
|
|
107
129
|
{
|
|
108
|
-
name:
|
|
109
|
-
type:
|
|
130
|
+
name: se,
|
|
131
|
+
type: s.DEV_DEPENDENCY
|
|
110
132
|
}
|
|
111
133
|
],
|
|
112
|
-
command: `${
|
|
134
|
+
command: `${ce} -p ${_.TS_CONFIG} --noEmit`
|
|
113
135
|
}),
|
|
114
|
-
testUnit:
|
|
115
|
-
type:
|
|
136
|
+
testUnit: t({
|
|
137
|
+
type: e.CLI,
|
|
116
138
|
packages: [
|
|
117
139
|
{
|
|
118
|
-
name:
|
|
119
|
-
type:
|
|
140
|
+
name: u,
|
|
141
|
+
type: s.DEV_DEPENDENCY
|
|
120
142
|
}
|
|
121
143
|
],
|
|
122
|
-
command: `${
|
|
144
|
+
command: `${f} --config ${_.VITEST_UNIT_CONFIG}`
|
|
123
145
|
}),
|
|
124
|
-
testE2e:
|
|
125
|
-
type:
|
|
146
|
+
testE2e: t({
|
|
147
|
+
type: e.CLI,
|
|
126
148
|
packages: [
|
|
127
149
|
{
|
|
128
|
-
name:
|
|
129
|
-
type:
|
|
150
|
+
name: u,
|
|
151
|
+
type: s.DEV_DEPENDENCY
|
|
130
152
|
}
|
|
131
153
|
],
|
|
132
|
-
command: `${
|
|
154
|
+
command: `${f} --config ${_.VITEST_E2E_CONFIG}`
|
|
133
155
|
}),
|
|
134
|
-
mongoMigrateCreate: (
|
|
135
|
-
type:
|
|
156
|
+
mongoMigrateCreate: (E) => t({
|
|
157
|
+
type: e.CLI,
|
|
136
158
|
packages: [
|
|
137
159
|
{
|
|
138
|
-
name:
|
|
139
|
-
type:
|
|
160
|
+
name: i,
|
|
161
|
+
type: s.DEPENDENCY
|
|
140
162
|
},
|
|
141
163
|
{
|
|
142
|
-
name:
|
|
143
|
-
type:
|
|
164
|
+
name: l,
|
|
165
|
+
type: s.DEPENDENCY
|
|
144
166
|
}
|
|
145
167
|
],
|
|
146
|
-
command: `${
|
|
168
|
+
command: `${i} ${G} create ${E} -f ${_.MIGRATE_MONGO_CONFIG}`
|
|
147
169
|
})(),
|
|
148
|
-
mongoMigrateUp:
|
|
149
|
-
type:
|
|
170
|
+
mongoMigrateUp: t({
|
|
171
|
+
type: e.CLI,
|
|
150
172
|
packages: [
|
|
151
173
|
{
|
|
152
|
-
name:
|
|
153
|
-
type:
|
|
174
|
+
name: i,
|
|
175
|
+
type: s.DEPENDENCY
|
|
154
176
|
},
|
|
155
177
|
{
|
|
156
|
-
name:
|
|
157
|
-
type:
|
|
178
|
+
name: l,
|
|
179
|
+
type: s.DEPENDENCY
|
|
158
180
|
}
|
|
159
181
|
],
|
|
160
|
-
command: `${
|
|
182
|
+
command: `${i} ${G} up -f ${_.MIGRATE_MONGO_CONFIG}`
|
|
161
183
|
}),
|
|
162
|
-
mongoMigrateDown:
|
|
163
|
-
type:
|
|
184
|
+
mongoMigrateDown: t({
|
|
185
|
+
type: e.CLI,
|
|
164
186
|
packages: [
|
|
165
187
|
{
|
|
166
|
-
name:
|
|
167
|
-
type:
|
|
188
|
+
name: i,
|
|
189
|
+
type: s.DEPENDENCY
|
|
168
190
|
},
|
|
169
191
|
{
|
|
170
|
-
name:
|
|
171
|
-
type:
|
|
192
|
+
name: l,
|
|
193
|
+
type: s.DEPENDENCY
|
|
172
194
|
}
|
|
173
195
|
],
|
|
174
|
-
command: `${
|
|
196
|
+
command: `${i} ${G} down -f ${_.MIGRATE_MONGO_CONFIG}`
|
|
175
197
|
}),
|
|
176
|
-
commitLint:
|
|
177
|
-
type:
|
|
198
|
+
commitLint: t({
|
|
199
|
+
type: e.CLI,
|
|
178
200
|
packages: [
|
|
179
201
|
{
|
|
180
|
-
name:
|
|
181
|
-
type:
|
|
202
|
+
name: te,
|
|
203
|
+
type: s.DEV_DEPENDENCY
|
|
182
204
|
},
|
|
183
205
|
{
|
|
184
|
-
name:
|
|
185
|
-
type:
|
|
206
|
+
name: ne,
|
|
207
|
+
type: s.DEV_DEPENDENCY
|
|
186
208
|
}
|
|
187
209
|
],
|
|
188
|
-
command: `${
|
|
210
|
+
command: `${K} --edit ${_.GIT_COMMIT_MSG} --config ${_.COMMITLINT_CONFIG}`
|
|
189
211
|
}),
|
|
190
|
-
lintStaged:
|
|
191
|
-
type:
|
|
212
|
+
lintStaged: t({
|
|
213
|
+
type: e.CLI,
|
|
192
214
|
packages: [
|
|
193
215
|
{
|
|
194
|
-
name:
|
|
195
|
-
type:
|
|
216
|
+
name: oe,
|
|
217
|
+
type: s.DEV_DEPENDENCY
|
|
196
218
|
}
|
|
197
219
|
],
|
|
198
|
-
command: `${
|
|
220
|
+
command: `${k} --config ${_.LINT_STAGED_CONFIG}`
|
|
199
221
|
}),
|
|
200
|
-
configureGitHook:
|
|
201
|
-
type:
|
|
202
|
-
command: `${
|
|
222
|
+
configureGitHook: t({
|
|
223
|
+
type: e.STRING,
|
|
224
|
+
command: `${Y} config core.hooksPath ${_.GIT_HOOK}`
|
|
203
225
|
}),
|
|
204
|
-
build:
|
|
205
|
-
type:
|
|
206
|
-
command: `${
|
|
226
|
+
build: t({
|
|
227
|
+
type: e.STRING,
|
|
228
|
+
command: `${p} run --if-present build`
|
|
207
229
|
}),
|
|
208
|
-
pnpmInstallStandard:
|
|
209
|
-
type:
|
|
210
|
-
command: `${
|
|
230
|
+
pnpmInstallStandard: t({
|
|
231
|
+
type: e.STRING,
|
|
232
|
+
command: `${p} install --ignore-scripts`
|
|
211
233
|
}),
|
|
212
|
-
pnpmInstallLegacy:
|
|
213
|
-
type:
|
|
214
|
-
command: `${
|
|
234
|
+
pnpmInstallLegacy: t({
|
|
235
|
+
type: e.STRING,
|
|
236
|
+
command: `${p} install --ignore-scripts --legacy-peer-deps`
|
|
215
237
|
}),
|
|
216
|
-
pnpmInstallForce:
|
|
217
|
-
type:
|
|
218
|
-
command: `${
|
|
238
|
+
pnpmInstallForce: t({
|
|
239
|
+
type: e.STRING,
|
|
240
|
+
command: `${p} install --ignore-scripts --force`
|
|
219
241
|
}),
|
|
220
|
-
pnpmPruneStore:
|
|
221
|
-
type:
|
|
222
|
-
command: `${
|
|
242
|
+
pnpmPruneStore: t({
|
|
243
|
+
type: e.STRING,
|
|
244
|
+
command: `${p} store prune`
|
|
223
245
|
}),
|
|
224
|
-
pnpmCleanCache:
|
|
225
|
-
type:
|
|
226
|
-
command: `${
|
|
246
|
+
pnpmCleanCache: t({
|
|
247
|
+
type: e.STRING,
|
|
248
|
+
command: `${p} cache delete`
|
|
227
249
|
})
|
|
228
250
|
};
|
|
229
251
|
export {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
252
|
+
J as BUILD_DIRECTORY,
|
|
253
|
+
K as COMMIT_LINT_CLI,
|
|
254
|
+
ne as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
|
|
255
|
+
te as COMMIT_LINT_PACKAGE_NAME,
|
|
256
|
+
ge as CYBERSKILL_CLI,
|
|
257
|
+
De as CYBERSKILL_CLI_PATH,
|
|
258
|
+
m as CYBERSKILL_DIRECTORY,
|
|
259
|
+
S as CYBERSKILL_PACKAGE_NAME,
|
|
260
|
+
A as ESLINT_CLI,
|
|
261
|
+
me as ESLINT_INSPECT_CLI,
|
|
262
|
+
Ie as ESLINT_INSPECT_PACKAGE_NAME,
|
|
263
|
+
y as ESLINT_PACKAGE_NAME,
|
|
264
|
+
Y as GIT_CLI,
|
|
265
|
+
Z as GIT_COMMIT_EDITMSG,
|
|
266
|
+
Q as GIT_HOOK,
|
|
267
|
+
X as GIT_IGNORE,
|
|
268
|
+
k as LINT_STAGED_CLI,
|
|
269
|
+
oe as LINT_STAGED_PACKAGE_NAME,
|
|
270
|
+
G as MIGRATE_MONGO_CLI,
|
|
271
|
+
ee as MIGRATE_MONGO_CONFIG,
|
|
272
|
+
l as MIGRATE_MONGO_PACKAGE_NAME,
|
|
273
|
+
$ as NODE_MODULES,
|
|
274
|
+
pe as NODE_MODULES_INSPECT_CLI,
|
|
275
|
+
ie as NODE_MODULES_INSPECT_PACKAGE_NAME,
|
|
276
|
+
R as PACKAGE_JSON,
|
|
277
|
+
B as PACKAGE_LOCK_JSON,
|
|
278
|
+
_ as PATH,
|
|
279
|
+
p as PNPM_CLI,
|
|
280
|
+
Ee as PNPM_EXEC_CLI,
|
|
281
|
+
z as PNPM_LOCK_YAML,
|
|
282
|
+
x as PUBLIC_DIRECTORY,
|
|
283
|
+
_e as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
|
|
284
|
+
ae as SIMPLE_GIT_HOOK_CLI,
|
|
285
|
+
q as SIMPLE_GIT_HOOK_JSON,
|
|
286
|
+
W as TSCONFIG_JSON,
|
|
287
|
+
ce as TSC_CLI,
|
|
288
|
+
se as TSC_PACKAGE_NAME,
|
|
289
|
+
i as TSX_CLI,
|
|
290
|
+
f as VITEST_CLI,
|
|
291
|
+
u as VITEST_PACKAGE_NAME,
|
|
292
|
+
D as WORKING_DIRECTORY,
|
|
293
|
+
de as command,
|
|
294
|
+
Le as createGitHooksConfig
|
|
273
295
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("node:path"),t=require("../../config/env/env.util.cjs"),o=t.getEnv(),n=r,i=n.dirname;function s(...e){return n.resolve(o.CWD,...e)}function u(...e){return n.resolve(...e)}function a(...e){return n.join(...e)}exports.dirname=i;exports.join=a;exports.path=n;exports.resolve=u;exports.resolveWorkingPath=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./storage.util.cjs");exports.storage=e.storage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node-persist"),f=require("../../config/env/env.util.cjs"),u=require("../log/log.util.cjs");var l=(r,e,n)=>new Promise((h,a)=>{var d=t=>{try{c(n.next(t))}catch(s){a(s)}},v=t=>{try{c(n.throw(t))}catch(s){a(s)}},c=t=>t.done?h(t.value):Promise.resolve(t.value).then(d,v);c((n=n.apply(r,e)).next())});const y=f.getEnv();function o(){return l(this,null,function*(){i.defaultInstance||(yield i.init({dir:y.CYBERSKILL_STORAGE_DIRECTORY}))})}const E={get(r){return l(this,null,function*(){try{yield o();const e=yield i.getItem(r);return e!=null?e:null}catch(e){return u.catchError(e,{returnValue:null})}})},set(r,e){return l(this,null,function*(){try{yield o(),yield i.setItem(r,e)}catch(n){u.catchError(n)}})},remove(r){return l(this,null,function*(){try{yield o(),yield i.removeItem(r)}catch(e){u.catchError(e)}})},keys(){return l(this,null,function*(){try{yield o();const r=yield i.keys();return Array.isArray(r)?r:(u.log.warn("[Storage:keys] Invalid keys response:",r),[])}catch(r){return u.catchError(r,{returnValue:[]})}})},getLogLink(r){return l(this,null,function*(){try{return`${y.CYBERSKILL_STORAGE_DIRECTORY} (key: ${r})`}catch(e){return u.catchError(e,{returnValue:null})}})}};exports.storage=E;
|
|
@@ -1,51 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getEnv as
|
|
3
|
-
import { catchError as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
e.defaultInstance || await e.init({
|
|
7
|
-
dir: s.CYBERSKILL_STORAGE_DIRECTORY
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
const m = {
|
|
11
|
-
async get(r) {
|
|
1
|
+
import u from "node-persist";
|
|
2
|
+
import { getEnv as m } from "../../config/env/env.util.js";
|
|
3
|
+
import { catchError as i, log as v } from "../log/log.util.js";
|
|
4
|
+
var l = (r, e, n) => new Promise((h, a) => {
|
|
5
|
+
var d = (t) => {
|
|
12
6
|
try {
|
|
13
|
-
|
|
14
|
-
} catch (
|
|
15
|
-
|
|
7
|
+
s(n.next(t));
|
|
8
|
+
} catch (c) {
|
|
9
|
+
a(c);
|
|
16
10
|
}
|
|
17
|
-
},
|
|
18
|
-
async set(r, t) {
|
|
11
|
+
}, f = (t) => {
|
|
19
12
|
try {
|
|
20
|
-
|
|
21
|
-
} catch (
|
|
22
|
-
a(
|
|
13
|
+
s(n.throw(t));
|
|
14
|
+
} catch (c) {
|
|
15
|
+
a(c);
|
|
23
16
|
}
|
|
17
|
+
}, s = (t) => t.done ? h(t.value) : Promise.resolve(t.value).then(d, f);
|
|
18
|
+
s((n = n.apply(r, e)).next());
|
|
19
|
+
});
|
|
20
|
+
const y = m();
|
|
21
|
+
function o() {
|
|
22
|
+
return l(this, null, function* () {
|
|
23
|
+
u.defaultInstance || (yield u.init({
|
|
24
|
+
dir: y.CYBERSKILL_STORAGE_DIRECTORY
|
|
25
|
+
}));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const R = {
|
|
29
|
+
get(r) {
|
|
30
|
+
return l(this, null, function* () {
|
|
31
|
+
try {
|
|
32
|
+
yield o();
|
|
33
|
+
const e = yield u.getItem(r);
|
|
34
|
+
return e != null ? e : null;
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return i(e, { returnValue: null });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
24
39
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
set(r, e) {
|
|
41
|
+
return l(this, null, function* () {
|
|
42
|
+
try {
|
|
43
|
+
yield o(), yield u.setItem(r, e);
|
|
44
|
+
} catch (n) {
|
|
45
|
+
i(n);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
31
48
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
49
|
+
remove(r) {
|
|
50
|
+
return l(this, null, function* () {
|
|
51
|
+
try {
|
|
52
|
+
yield o(), yield u.removeItem(r);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
i(e);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
40
57
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
keys() {
|
|
59
|
+
return l(this, null, function* () {
|
|
60
|
+
try {
|
|
61
|
+
yield o();
|
|
62
|
+
const r = yield u.keys();
|
|
63
|
+
return Array.isArray(r) ? r : (v.warn("[Storage:keys] Invalid keys response:", r), []);
|
|
64
|
+
} catch (r) {
|
|
65
|
+
return i(r, { returnValue: [] });
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
getLogLink(r) {
|
|
70
|
+
return l(this, null, function* () {
|
|
71
|
+
try {
|
|
72
|
+
return `${y.CYBERSKILL_STORAGE_DIRECTORY} (key: ${r})`;
|
|
73
|
+
} catch (e) {
|
|
74
|
+
return i(e, { returnValue: null });
|
|
75
|
+
}
|
|
76
|
+
});
|
|
47
77
|
}
|
|
48
78
|
};
|
|
49
79
|
export {
|
|
50
|
-
|
|
80
|
+
R as storage
|
|
51
81
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./upload.type.cjs"),e=require("./upload.util.cjs");Object.defineProperty(exports,"E_UploadType",{enumerable:!0,get:()=>o.E_UploadType});exports.createUploadConfig=e.createUploadConfig;exports.upload=e.upload;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.E_UploadType=(t=>(t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.DOCUMENT="DOCUMENT",t.OTHER="OTHER",t))(exports.E_UploadType||{});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./upload.type.cjs"),_=require("../path/path.util.cjs"),m=require("../fs/fs.util.cjs");var x=Object.defineProperty,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,E=(t,r,e)=>r in t?x(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,g=(t,r)=>{for(var e in r||(r={}))h.call(r,e)&&E(t,e,r[e]);if(v)for(var e of v(r))z.call(r,e)&&E(t,e,r[e]);return t},w=(t,r,e)=>new Promise((i,l)=>{var n=o=>{try{a(e.next(o))}catch(u){l(u)}},s=o=>{try{a(e.throw(o))}catch(u){l(u)}},a=o=>o.done?i(o.value):Promise.resolve(o.value).then(n,s);a((e=e.apply(t,r)).next())});function O(t){return w(this,null,function*(){return new Promise((r,e)=>{let i=0;t.on("data",l=>{i+=l.length}),t.on("end",()=>r(i)),t.on("error",e)})})}function S(t,r){const e=t.lastIndexOf(".");if(e===-1)return!1;const i=t.substring(e+1).toLowerCase();return r.includes(i)}function T(t,r,e){const{filename:i,fileSize:l}=t,n=r[e],{allowedExtensions:s,sizeLimit:a}=n;if(!S(i,s))return{isValid:!1,error:`File extension not allowed for ${e.toLowerCase()} files. Allowed extensions: ${s.join(", ")}`};if(l!==void 0&&l>a){const o=Math.round(a/1048576);return{isValid:!1,error:`File size exceeds limit for ${e.toLowerCase()} files. Maximum size: ${o}MB`}}return{isValid:!0}}function U(t){const r={[f.E_UploadType.IMAGE]:{allowedExtensions:["jpg","jpeg","png","gif","webp","svg"],sizeLimit:5242880},[f.E_UploadType.VIDEO]:{allowedExtensions:["mp4","avi","mov","wmv","flv","webm"],sizeLimit:524288e3},[f.E_UploadType.DOCUMENT]:{allowedExtensions:["pdf","doc","docx","txt","rtf"],sizeLimit:10485760},[f.E_UploadType.OTHER]:{allowedExtensions:["zip","rar","tar","gz"],sizeLimit:5242880}};return g(g({},r),t)}function I(t){return w(this,null,function*(){const{path:r,file:e,config:i,type:l}=t;if(!r||typeof r!="string")return{success:!1,message:"Invalid path provided",result:""};if(!e||typeof e!="object")return{success:!1,message:"Invalid file provided",result:""};if(i){const n=[f.E_UploadType.IMAGE,f.E_UploadType.VIDEO,f.E_UploadType.DOCUMENT,f.E_UploadType.OTHER];for(const s of n){if(!i[s]||!Array.isArray(i[s].allowedExtensions)||i[s].allowedExtensions.length===0)return{success:!1,message:`Invalid config for ${s.toLowerCase()} files`,result:""};if(typeof i[s].sizeLimit!="number"||i[s].sizeLimit<=0)return{success:!1,message:`Invalid size limit for ${s.toLowerCase()} files`,result:""}}}try{const n=yield(yield e).file,{filename:s,createReadStream:a}=n;if(i){const p=a(),d=yield O(p),y=T({filename:s,fileSize:d},i,l);if(!y.isValid)return{success:!1,message:y.error||"File validation failed",result:""}}const o=_.dirname(r);m.pathExistsSync(o)||m.mkdirSync(o,{recursive:!0});const u=a(),c=m.createWriteStream(r);return u.pipe(c),yield new Promise((p,d)=>{c.on("finish",()=>p()),c.on("error",d),u.on("error",d)}),{success:!0,message:"File uploaded successfully",result:r}}catch(n){return{success:!1,message:n instanceof Error?n.message:"File upload failed",result:""}}})}exports.createUploadConfig=U;exports.upload=I;
|