@cyberskill/shared 2.20.0 → 2.21.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/storybook/storybook.main.cjs +1 -1
- package/dist/config/storybook/storybook.main.js +1 -1
- package/dist/config/vitest/vitest.e2e.cjs +1 -1
- package/dist/config/vitest/vitest.e2e.js +6 -6
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +5 -5
- package/dist/node/mongo/mongo-controller.test.unit.d.ts +1 -0
- package/dist/node/mongo/mongo.test.unit.d.ts +1 -0
- package/dist/node/mongo/mongo.util.cjs +2 -2
- package/dist/node/mongo/mongo.util.d.ts +9 -203
- package/dist/node/mongo/mongo.util.js +70 -68
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.js +113 -109
- package/dist/node/path/path.test.unit.d.ts +1 -0
- package/dist/node/path/path.util.d.ts +2 -2
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.js +32 -19
- package/dist/react/loading/loading.test.unit.d.ts +1 -0
- package/dist/react/loading/loading.type.d.ts +2 -1
- package/dist/util/common/common.test.unit.d.ts +1 -0
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.js +14 -15
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.js +16 -15
- package/dist/util/object/index.cjs +1 -1
- package/dist/util/object/index.js +4 -3
- package/dist/util/object/object.test.unit.d.ts +1 -0
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.d.ts +10 -30
- package/dist/util/object/object.util.js +102 -69
- package/dist/util/serializer/serializer.test.unit.d.ts +1 -0
- package/dist/util/serializer/serializer.util.cjs +1 -1
- package/dist/util/serializer/serializer.util.js +19 -16
- package/dist/util/string/string.test.unit.d.ts +1 -0
- package/dist/util/string/string.util.cjs +1 -1
- package/dist/util/string/string.util.d.ts +4 -3
- package/dist/util/string/string.util.js +32 -41
- package/dist/util/validate/validate.test.unit.d.ts +1 -0
- package/dist/util/validate/validate.util.cjs +1 -1
- package/dist/util/validate/validate.util.js +9 -9
- package/package.json +37 -45
- /package/dist/node_modules/.pnpm/{vitest@4.0.13_@types_debug@4.1.12_@types_node@24.10.1_jiti@2.6.1_jsdom@27.2.0_sass@1.94.2_tsx@4.20.6_yaml@2.8.1 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
- /package/dist/node_modules/.pnpm/{vitest@4.0.13_@types_debug@4.1.12_@types_node@24.10.1_jiti@2.6.1_jsdom@27.2.0_sass@1.94.2_tsx@4.20.6_yaml@2.8.1 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import F from "fs-extra";
|
|
2
|
-
import { resolveWorkingPath as s, join as
|
|
2
|
+
import { resolveWorkingPath as s, join as y } from "./path.util.js";
|
|
3
3
|
import { E_CommandType as e } from "../command/command.type.js";
|
|
4
|
-
import { formatCommand as
|
|
4
|
+
import { formatCommand as g, rawCommand as D } from "../command/command.util.js";
|
|
5
5
|
import { setupPackages as b } from "../package/package.util.js";
|
|
6
|
-
import { E_PackageType as
|
|
7
|
-
import { getEnv as
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
B.call(
|
|
6
|
+
import { E_PackageType as n } from "../package/package.type.js";
|
|
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, o) => E in c ? j(c, E, { enumerable: !0, configurable: !0, writable: !0, value: o }) : c[E] = o, U = (c, E) => {
|
|
9
|
+
for (var o in E || (E = {}))
|
|
10
|
+
B.call(E, o) && P(c, o, E[o]);
|
|
11
11
|
if (L)
|
|
12
|
-
for (var
|
|
13
|
-
H.call(
|
|
14
|
-
return
|
|
15
|
-
}, J = (
|
|
16
|
-
var C = (
|
|
12
|
+
for (var o of L(E))
|
|
13
|
+
H.call(E, o) && P(c, o, E[o]);
|
|
14
|
+
return c;
|
|
15
|
+
}, J = (c, E, o) => new Promise((p, I) => {
|
|
16
|
+
var C = (_) => {
|
|
17
17
|
try {
|
|
18
|
-
O(
|
|
18
|
+
O(o.next(_));
|
|
19
19
|
} catch (T) {
|
|
20
|
-
|
|
20
|
+
I(T);
|
|
21
21
|
}
|
|
22
|
-
}, N = (
|
|
22
|
+
}, N = (_) => {
|
|
23
23
|
try {
|
|
24
|
-
O(
|
|
24
|
+
O(o.throw(_));
|
|
25
25
|
} catch (T) {
|
|
26
|
-
|
|
26
|
+
I(T);
|
|
27
27
|
}
|
|
28
|
-
}, O = (
|
|
29
|
-
O((
|
|
28
|
+
}, O = (_) => _.done ? p(_.value) : Promise.resolve(_.value).then(C, N);
|
|
29
|
+
O((o = o.apply(c, E)).next());
|
|
30
30
|
});
|
|
31
|
-
const x =
|
|
32
|
-
CYBERSKILL_DIRECTORY:
|
|
31
|
+
const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore", Z = ".simple-git-hooks.json", Q = "pnpm-lock.yaml", ee = ".git/hooks/", te = ".git/COMMIT_EDITMSG", ne = ".migrate-mongo.config.js", m = F.readJsonSync(s(Y)).name === M ? y(d, S) : y(d, K, M, S), ye = "cyberskill", ge = "src/node/cli/index.ts", A = "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", i = "tsx", V = "git", r = "pnpm", _e = "pnpm exec", me = "simple-git-hooks", Ie = "simple-git-hooks", ie = "@eslint/config-inspector", re = "eslint-config-inspector", pe = "node-modules-inspector", Ce = "node-modules-inspector", l = "migrate-mongo", G = "./node_modules/migrate-mongo/bin/migrate-mongo", R = "storybook", k = "storybook", a = {
|
|
32
|
+
CYBERSKILL_DIRECTORY: m,
|
|
33
33
|
WORKING_DIRECTORY: d,
|
|
34
34
|
PUBLIC_DIRECTORY: s(W),
|
|
35
35
|
TS_CONFIG: s(q),
|
|
36
36
|
GIT_IGNORE: s(z),
|
|
37
37
|
GIT_HOOK: s(ee),
|
|
38
38
|
GIT_COMMIT_MSG: s(te),
|
|
39
|
-
SIMPLE_GIT_HOOKS_JSON: s(
|
|
39
|
+
SIMPLE_GIT_HOOKS_JSON: s(Z),
|
|
40
40
|
PACKAGE_JSON: s(Y),
|
|
41
41
|
PACKAGE_LOCK_JSON: s(X),
|
|
42
|
-
PNPM_LOCK_YAML: s(
|
|
42
|
+
PNPM_LOCK_YAML: s(Q),
|
|
43
43
|
NODE_MODULES: s(K),
|
|
44
|
-
MIGRATE_MONGO_CONFIG: s(
|
|
45
|
-
LINT_STAGED_CONFIG: s(`${
|
|
46
|
-
COMMITLINT_CONFIG: s(`${
|
|
47
|
-
VITEST_UNIT_CONFIG: s(`${
|
|
48
|
-
VITEST_E2E_CONFIG: s(`${
|
|
49
|
-
STORYBOOK_MAIN_CONFIG: s(`${
|
|
50
|
-
STORYBOOK_PREVIEW_CONFIG: s(`${
|
|
44
|
+
MIGRATE_MONGO_CONFIG: s(ne),
|
|
45
|
+
LINT_STAGED_CONFIG: s(`${m}/config/lint-staged/index.js`),
|
|
46
|
+
COMMITLINT_CONFIG: s(`${m}/config/commitlint/index.js`),
|
|
47
|
+
VITEST_UNIT_CONFIG: s(`${m}/config/vitest/vitest.unit.js`),
|
|
48
|
+
VITEST_E2E_CONFIG: s(`${m}/config/vitest/vitest.e2e.js`),
|
|
49
|
+
STORYBOOK_MAIN_CONFIG: s(`${m}/config/storybook/storybook.main.js`),
|
|
50
|
+
STORYBOOK_PREVIEW_CONFIG: s(`${m}/config/storybook/storybook.preview.js`)
|
|
51
51
|
};
|
|
52
|
-
function Le({ isCurrentProject:
|
|
52
|
+
function Le({ isCurrentProject: c }) {
|
|
53
53
|
return U({
|
|
54
|
-
"pre-commit":
|
|
55
|
-
"commit-msg":
|
|
56
|
-
},
|
|
54
|
+
"pre-commit": v,
|
|
55
|
+
"commit-msg": h
|
|
56
|
+
}, c && { "pre-push": D(`${V} pull`) });
|
|
57
57
|
}
|
|
58
|
-
function t({ type:
|
|
59
|
-
const
|
|
58
|
+
function t({ type: c, packages: E, command: o }) {
|
|
59
|
+
const p = E == null ? void 0 : E.reduce((I, C) => (I.some((N) => N.name === C.name) || I.push(C), I), []);
|
|
60
60
|
return () => J(null, null, function* () {
|
|
61
|
-
switch (
|
|
61
|
+
switch (c) {
|
|
62
62
|
case e.CLI:
|
|
63
|
-
return
|
|
63
|
+
return p != null && p.length && (yield b(p, {
|
|
64
64
|
install: !0
|
|
65
|
-
})),
|
|
65
|
+
})), g(D(`${_e} ${o}`));
|
|
66
66
|
case e.STRING:
|
|
67
|
-
return
|
|
67
|
+
return g(D(o));
|
|
68
68
|
default:
|
|
69
69
|
throw new Error("Unsupported command type");
|
|
70
70
|
}
|
|
@@ -75,28 +75,28 @@ const Pe = {
|
|
|
75
75
|
type: e.CLI,
|
|
76
76
|
packages: [
|
|
77
77
|
{
|
|
78
|
-
name:
|
|
79
|
-
type:
|
|
78
|
+
name: me,
|
|
79
|
+
type: n.DEV_DEPENDENCY
|
|
80
80
|
}
|
|
81
81
|
],
|
|
82
|
-
command:
|
|
82
|
+
command: Ie
|
|
83
83
|
}),
|
|
84
84
|
eslintInspect: t({
|
|
85
85
|
type: e.CLI,
|
|
86
86
|
packages: [
|
|
87
87
|
{
|
|
88
88
|
name: ie,
|
|
89
|
-
type:
|
|
89
|
+
type: n.DEV_DEPENDENCY
|
|
90
90
|
}
|
|
91
91
|
],
|
|
92
|
-
command:
|
|
92
|
+
command: re
|
|
93
93
|
}),
|
|
94
94
|
nodeModulesInspect: t({
|
|
95
95
|
type: e.CLI,
|
|
96
96
|
packages: [
|
|
97
97
|
{
|
|
98
|
-
name:
|
|
99
|
-
type:
|
|
98
|
+
name: pe,
|
|
99
|
+
type: n.DEV_DEPENDENCY
|
|
100
100
|
}
|
|
101
101
|
],
|
|
102
102
|
command: Ce
|
|
@@ -106,151 +106,155 @@ const Pe = {
|
|
|
106
106
|
packages: [
|
|
107
107
|
{
|
|
108
108
|
name: A,
|
|
109
|
-
type:
|
|
109
|
+
type: n.DEV_DEPENDENCY
|
|
110
110
|
}
|
|
111
111
|
],
|
|
112
|
-
command: `${u} ${
|
|
112
|
+
command: `${u} ${a.WORKING_DIRECTORY} --no-cache`
|
|
113
113
|
}),
|
|
114
114
|
eslintFix: t({
|
|
115
115
|
type: e.CLI,
|
|
116
116
|
packages: [
|
|
117
117
|
{
|
|
118
118
|
name: A,
|
|
119
|
-
type:
|
|
119
|
+
type: n.DEV_DEPENDENCY
|
|
120
120
|
}
|
|
121
121
|
],
|
|
122
|
-
command: `${u} ${
|
|
122
|
+
command: `${u} ${a.WORKING_DIRECTORY} --fix --no-cache`
|
|
123
123
|
}),
|
|
124
124
|
typescriptCheck: t({
|
|
125
125
|
type: e.CLI,
|
|
126
126
|
packages: [
|
|
127
127
|
{
|
|
128
128
|
name: Ee,
|
|
129
|
-
type:
|
|
129
|
+
type: n.DEV_DEPENDENCY
|
|
130
130
|
}
|
|
131
131
|
],
|
|
132
|
-
command: `${
|
|
132
|
+
command: `${ae} -p ${a.TS_CONFIG} --noEmit`
|
|
133
133
|
}),
|
|
134
134
|
testUnit: t({
|
|
135
135
|
type: e.CLI,
|
|
136
136
|
packages: [
|
|
137
137
|
{
|
|
138
138
|
name: f,
|
|
139
|
-
type:
|
|
139
|
+
type: n.DEV_DEPENDENCY
|
|
140
140
|
}
|
|
141
141
|
],
|
|
142
|
-
command: `${$} --config ${
|
|
142
|
+
command: `${$} --config ${a.VITEST_UNIT_CONFIG}`
|
|
143
143
|
}),
|
|
144
144
|
testE2e: t({
|
|
145
145
|
type: e.CLI,
|
|
146
146
|
packages: [
|
|
147
147
|
{
|
|
148
148
|
name: f,
|
|
149
|
-
type:
|
|
149
|
+
type: n.DEV_DEPENDENCY
|
|
150
150
|
}
|
|
151
151
|
],
|
|
152
|
-
command: `${$} --config ${
|
|
152
|
+
command: `${$} --config ${a.VITEST_E2E_CONFIG}`
|
|
153
153
|
}),
|
|
154
|
-
mongoMigrateCreate: (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
mongoMigrateCreate: (c) => {
|
|
155
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(c))
|
|
156
|
+
throw new Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
|
|
157
|
+
return t({
|
|
158
|
+
type: e.CLI,
|
|
159
|
+
packages: [
|
|
160
|
+
{
|
|
161
|
+
name: i,
|
|
162
|
+
type: n.DEPENDENCY
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: l,
|
|
166
|
+
type: n.DEPENDENCY
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
command: `${i} ${G} create ${c} -f ${a.MIGRATE_MONGO_CONFIG}`
|
|
170
|
+
})();
|
|
171
|
+
},
|
|
168
172
|
mongoMigrateUp: t({
|
|
169
173
|
type: e.CLI,
|
|
170
174
|
packages: [
|
|
171
175
|
{
|
|
172
176
|
name: i,
|
|
173
|
-
type:
|
|
177
|
+
type: n.DEPENDENCY
|
|
174
178
|
},
|
|
175
179
|
{
|
|
176
180
|
name: l,
|
|
177
|
-
type:
|
|
181
|
+
type: n.DEPENDENCY
|
|
178
182
|
}
|
|
179
183
|
],
|
|
180
|
-
command: `${i} ${G} up -f ${
|
|
184
|
+
command: `${i} ${G} up -f ${a.MIGRATE_MONGO_CONFIG}`
|
|
181
185
|
}),
|
|
182
186
|
mongoMigrateDown: t({
|
|
183
187
|
type: e.CLI,
|
|
184
188
|
packages: [
|
|
185
189
|
{
|
|
186
190
|
name: i,
|
|
187
|
-
type:
|
|
191
|
+
type: n.DEPENDENCY
|
|
188
192
|
},
|
|
189
193
|
{
|
|
190
194
|
name: l,
|
|
191
|
-
type:
|
|
195
|
+
type: n.DEPENDENCY
|
|
192
196
|
}
|
|
193
197
|
],
|
|
194
|
-
command: `${i} ${G} down -f ${
|
|
198
|
+
command: `${i} ${G} down -f ${a.MIGRATE_MONGO_CONFIG}`
|
|
195
199
|
}),
|
|
196
200
|
commitLint: t({
|
|
197
201
|
type: e.CLI,
|
|
198
202
|
packages: [
|
|
199
203
|
{
|
|
200
|
-
name:
|
|
201
|
-
type:
|
|
204
|
+
name: oe,
|
|
205
|
+
type: n.DEV_DEPENDENCY
|
|
202
206
|
},
|
|
203
207
|
{
|
|
204
208
|
name: se,
|
|
205
|
-
type:
|
|
209
|
+
type: n.DEV_DEPENDENCY
|
|
206
210
|
}
|
|
207
211
|
],
|
|
208
|
-
command: `${
|
|
212
|
+
command: `${h} --edit ${a.GIT_COMMIT_MSG} --config ${a.COMMITLINT_CONFIG}`
|
|
209
213
|
}),
|
|
210
214
|
lintStaged: t({
|
|
211
215
|
type: e.CLI,
|
|
212
216
|
packages: [
|
|
213
217
|
{
|
|
214
218
|
name: ce,
|
|
215
|
-
type:
|
|
219
|
+
type: n.DEV_DEPENDENCY
|
|
216
220
|
}
|
|
217
221
|
],
|
|
218
|
-
command: `${
|
|
222
|
+
command: `${v} --config ${a.LINT_STAGED_CONFIG}`
|
|
219
223
|
}),
|
|
220
224
|
configureGitHook: t({
|
|
221
225
|
type: e.STRING,
|
|
222
|
-
command: `${V} config core.hooksPath ${
|
|
226
|
+
command: `${V} config core.hooksPath ${a.GIT_HOOK}`
|
|
223
227
|
}),
|
|
224
228
|
build: t({
|
|
225
229
|
type: e.STRING,
|
|
226
|
-
command: `${
|
|
230
|
+
command: `${r} run --if-present build`
|
|
227
231
|
}),
|
|
228
232
|
pnpmInstallStandard: t({
|
|
229
233
|
type: e.STRING,
|
|
230
|
-
command: `${
|
|
234
|
+
command: `${r} install --ignore-scripts`
|
|
231
235
|
}),
|
|
232
236
|
pnpmInstallLegacy: t({
|
|
233
237
|
type: e.STRING,
|
|
234
|
-
command: `${
|
|
238
|
+
command: `${r} install --ignore-scripts --legacy-peer-deps`
|
|
235
239
|
}),
|
|
236
240
|
pnpmInstallForce: t({
|
|
237
241
|
type: e.STRING,
|
|
238
|
-
command: `${
|
|
242
|
+
command: `${r} install --ignore-scripts --force`
|
|
239
243
|
}),
|
|
240
244
|
pnpmPruneStore: t({
|
|
241
245
|
type: e.STRING,
|
|
242
|
-
command: `${
|
|
246
|
+
command: `${r} store prune`
|
|
243
247
|
}),
|
|
244
248
|
pnpmCleanCache: t({
|
|
245
249
|
type: e.STRING,
|
|
246
|
-
command: `${
|
|
250
|
+
command: `${r} cache delete`
|
|
247
251
|
}),
|
|
248
252
|
storybookDev: t({
|
|
249
253
|
type: e.CLI,
|
|
250
254
|
packages: [
|
|
251
255
|
{
|
|
252
256
|
name: R,
|
|
253
|
-
type:
|
|
257
|
+
type: n.DEV_DEPENDENCY
|
|
254
258
|
}
|
|
255
259
|
],
|
|
256
260
|
command: `${k} dev`
|
|
@@ -260,7 +264,7 @@ const Pe = {
|
|
|
260
264
|
packages: [
|
|
261
265
|
{
|
|
262
266
|
name: R,
|
|
263
|
-
type:
|
|
267
|
+
type: n.DEV_DEPENDENCY
|
|
264
268
|
}
|
|
265
269
|
],
|
|
266
270
|
command: `${k} build`
|
|
@@ -268,43 +272,43 @@ const Pe = {
|
|
|
268
272
|
};
|
|
269
273
|
export {
|
|
270
274
|
S as BUILD_DIRECTORY,
|
|
271
|
-
|
|
275
|
+
h as COMMIT_LINT_CLI,
|
|
272
276
|
se as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
oe as COMMIT_LINT_PACKAGE_NAME,
|
|
278
|
+
ye as CYBERSKILL_CLI,
|
|
279
|
+
ge as CYBERSKILL_CLI_PATH,
|
|
280
|
+
m as CYBERSKILL_DIRECTORY,
|
|
277
281
|
M as CYBERSKILL_PACKAGE_NAME,
|
|
278
282
|
u as ESLINT_CLI,
|
|
279
|
-
|
|
283
|
+
re as ESLINT_INSPECT_CLI,
|
|
280
284
|
ie as ESLINT_INSPECT_PACKAGE_NAME,
|
|
281
285
|
A as ESLINT_PACKAGE_NAME,
|
|
282
286
|
V as GIT_CLI,
|
|
283
287
|
te as GIT_COMMIT_EDITMSG,
|
|
284
288
|
ee as GIT_HOOK,
|
|
285
289
|
z as GIT_IGNORE,
|
|
286
|
-
|
|
290
|
+
v as LINT_STAGED_CLI,
|
|
287
291
|
ce as LINT_STAGED_PACKAGE_NAME,
|
|
288
292
|
G as MIGRATE_MONGO_CLI,
|
|
289
|
-
|
|
293
|
+
ne as MIGRATE_MONGO_CONFIG,
|
|
290
294
|
l as MIGRATE_MONGO_PACKAGE_NAME,
|
|
291
295
|
K as NODE_MODULES,
|
|
292
296
|
Ce as NODE_MODULES_INSPECT_CLI,
|
|
293
|
-
|
|
297
|
+
pe as NODE_MODULES_INSPECT_PACKAGE_NAME,
|
|
294
298
|
Y as PACKAGE_JSON,
|
|
295
299
|
X as PACKAGE_LOCK_JSON,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
+
a as PATH,
|
|
301
|
+
r as PNPM_CLI,
|
|
302
|
+
_e as PNPM_EXEC_CLI,
|
|
303
|
+
Q as PNPM_LOCK_YAML,
|
|
300
304
|
W as PUBLIC_DIRECTORY,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
me as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
|
|
306
|
+
Ie as SIMPLE_GIT_HOOK_CLI,
|
|
307
|
+
Z as SIMPLE_GIT_HOOK_JSON,
|
|
304
308
|
k as STORYBOOK_CLI,
|
|
305
309
|
R as STORYBOOK_PACKAGE_NAME,
|
|
306
310
|
q as TSCONFIG_JSON,
|
|
307
|
-
|
|
311
|
+
ae as TSC_CLI,
|
|
308
312
|
Ee as TSC_PACKAGE_NAME,
|
|
309
313
|
i as TSX_CLI,
|
|
310
314
|
$ as VITEST_CLI,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as pathNode } from 'node:path';
|
|
2
|
-
export declare const path: pathNode
|
|
3
|
-
export declare const dirname:
|
|
2
|
+
export declare const path: typeof pathNode;
|
|
3
|
+
export declare const dirname: typeof pathNode.dirname;
|
|
4
4
|
/**
|
|
5
5
|
* Resolves a path relative to the current working directory.
|
|
6
6
|
* This function creates an absolute path by combining the current working directory
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("clsx"),n=require("react"),l=require("./loading.module.scss.cjs");var p=Object.defineProperty,i=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,u=(e,r,t)=>r in e?p(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,_=(e,r)=>{for(var t in r||(r={}))m.call(r,t)&&u(e,t,r[t]);if(i)for(var t of i(r))f.call(r,t)&&u(e,t,r[t]);return e},y=(e,r)=>{var t={};for(var a in e)m.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&i)for(var a of i(e))r.indexOf(a)<0&&f.call(e,a)&&(t[a]=e[a]);return t};function E(){if(document.getElementById("noscroll-style"))return;const e=document.createElement("style");e.id="noscroll-style",e.innerHTML=`
|
|
2
2
|
.noscroll {
|
|
3
3
|
overflow: hidden !important;
|
|
4
4
|
height: 100vh !important;
|
|
5
5
|
}
|
|
6
|
-
`,document.head.appendChild(e)}function
|
|
6
|
+
`,document.head.appendChild(e)}function h(e){var r=e,{full:t=!1,className:a="",message:o="Loading"}=r,v=y(r,["full","className","message"]);n.useEffect(()=>{if(t){document.body.classList.add("noscroll");const s=g=>g.preventDefault();return document.addEventListener("contextmenu",s),()=>{document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",s)}}},[t]),n.useEffect(()=>{E()},[]);function d(){return n.createElement("div",_({role:"status","aria-live":"polite","aria-label":o,className:l.default.container},v),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),n.createElement("div",{className:l.default.ring,"aria-hidden":"true"}),o&&n.createElement("div",{className:l.default.message},o))}return t?n.createElement("div",{className:c(l.default.full,a)},d()):n.createElement("div",{className:c(l.default.block,a)},d())}exports.Loading=h;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import m from "clsx";
|
|
2
|
-
import
|
|
2
|
+
import n, { useEffect as d } from "react";
|
|
3
3
|
import l from "./loading.module.scss.js";
|
|
4
|
-
var _ = Object.defineProperty,
|
|
4
|
+
var _ = Object.defineProperty, i = Object.getOwnPropertySymbols, u = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable, f = (e, r, t) => r in e ? _(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, y = (e, r) => {
|
|
5
5
|
for (var t in r || (r = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var t of
|
|
9
|
-
|
|
6
|
+
u.call(r, t) && f(e, t, r[t]);
|
|
7
|
+
if (i)
|
|
8
|
+
for (var t of i(r))
|
|
9
|
+
v.call(r, t) && f(e, t, r[t]);
|
|
10
10
|
return e;
|
|
11
11
|
}, E = (e, r) => {
|
|
12
12
|
var t = {};
|
|
13
|
-
for (var
|
|
14
|
-
|
|
15
|
-
if (e != null &&
|
|
16
|
-
for (var
|
|
17
|
-
r.indexOf(
|
|
13
|
+
for (var a in e)
|
|
14
|
+
u.call(e, a) && r.indexOf(a) < 0 && (t[a] = e[a]);
|
|
15
|
+
if (e != null && i)
|
|
16
|
+
for (var a of i(e))
|
|
17
|
+
r.indexOf(a) < 0 && v.call(e, a) && (t[a] = e[a]);
|
|
18
18
|
return t;
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function h() {
|
|
21
21
|
if (document.getElementById("noscroll-style"))
|
|
22
22
|
return;
|
|
23
23
|
const e = document.createElement("style");
|
|
@@ -28,8 +28,8 @@ function N() {
|
|
|
28
28
|
}
|
|
29
29
|
`, document.head.appendChild(e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
var r = e, { full: t = !1, className:
|
|
31
|
+
function L(e) {
|
|
32
|
+
var r = e, { full: t = !1, className: a = "", message: o = "Loading" } = r, p = E(r, ["full", "className", "message"]);
|
|
33
33
|
d(() => {
|
|
34
34
|
if (t) {
|
|
35
35
|
document.body.classList.add("noscroll");
|
|
@@ -39,13 +39,26 @@ function b(e) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
}, [t]), d(() => {
|
|
42
|
-
|
|
42
|
+
h();
|
|
43
43
|
}, []);
|
|
44
|
-
function
|
|
45
|
-
return /* @__PURE__ */
|
|
44
|
+
function s() {
|
|
45
|
+
return /* @__PURE__ */ n.createElement(
|
|
46
|
+
"div",
|
|
47
|
+
y({
|
|
48
|
+
role: "status",
|
|
49
|
+
"aria-live": "polite",
|
|
50
|
+
"aria-label": o,
|
|
51
|
+
className: l.container
|
|
52
|
+
}, p),
|
|
53
|
+
/* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
|
|
54
|
+
/* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
|
|
55
|
+
/* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
|
|
56
|
+
/* @__PURE__ */ n.createElement("div", { className: l.ring, "aria-hidden": "true" }),
|
|
57
|
+
o && /* @__PURE__ */ n.createElement("div", { className: l.message }, o)
|
|
58
|
+
);
|
|
46
59
|
}
|
|
47
|
-
return t ? /* @__PURE__ */
|
|
60
|
+
return t ? /* @__PURE__ */ n.createElement("div", { className: m(l.full, a) }, s()) : /* @__PURE__ */ n.createElement("div", { className: m(l.block, a) }, s());
|
|
48
61
|
}
|
|
49
62
|
export {
|
|
50
|
-
|
|
63
|
+
L as Loading
|
|
51
64
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
1
2
|
export interface I_LoadingContext {
|
|
2
3
|
isLoading: boolean;
|
|
3
4
|
isGlobalLoading: boolean;
|
|
4
5
|
showLoading: (global?: boolean) => void;
|
|
5
6
|
hideLoading: () => void;
|
|
6
7
|
}
|
|
7
|
-
export interface I_LoadingProps {
|
|
8
|
+
export interface I_LoadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
9
|
full?: boolean;
|
|
9
10
|
block?: boolean;
|
|
10
11
|
className?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../typescript/common.type.cjs");var s=Object.defineProperty,a=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,c=(e,n,r)=>n in e?s(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,p=(e,n)=>{for(var r in n||(n={}))m.call(n,r)&&c(e,r,n[r]);if(a)for(var r of a(n))_.call(n,r)&&c(e,r,n[r]);return e};const u={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},O=Object.entries(u).reduce((e,[n,r])=>(e[n.toUpperCase()]=r.map(o=>o.toUpperCase()),e),{});function v(e){e=e.normalize("NFD");const n=p(p({},u),O);for(const[r,o]of Object.entries(n)){const i=`[${r}${o.join("")}]`,E=`(${[r,...o].join("|")})`;e=e.replace(new RegExp(i,"g"),E)}return e}function f(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}function l(e,n){if(!n)return Array.from(new Set(e));const r=new Set,o=[];for(const i of e){const E=n(i);r.has(E)||(r.add(E),o.push(i))}return o}function D(e){const{NODE_ENV:n=t.E_Environment.DEVELOPMENT,NODE_ENV_MODE:r=t.E_Environment.DEVELOPMENT}=e,o=n===t.E_Environment.DEVELOPMENT&&r===t.E_Environment.DEVELOPMENT,i=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.STAGING,E=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.PRODUCTION;if(n===t.E_Environment.PRODUCTION&&r===t.E_Environment.DEVELOPMENT)throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");return{IS_DEV:o,IS_STAG:i,IS_PROD:E}}exports.mapEnvironment=D;exports.regexSearchMapper=v;exports.removeAccent=f;exports.uniqueArray=l;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import u from "unorm";
|
|
2
1
|
import { E_Environment as t } from "../../typescript/common.type.js";
|
|
3
|
-
var
|
|
2
|
+
var u = Object.defineProperty, i = Object.getOwnPropertySymbols, O = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable, p = (e, r, n) => r in e ? u(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, E = (e, r) => {
|
|
4
3
|
for (var n in r || (r = {}))
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
for (var n of
|
|
8
|
-
|
|
4
|
+
O.call(r, n) && p(e, n, r[n]);
|
|
5
|
+
if (i)
|
|
6
|
+
for (var n of i(r))
|
|
7
|
+
f.call(r, n) && p(e, n, r[n]);
|
|
9
8
|
return e;
|
|
10
9
|
};
|
|
11
10
|
const s = {
|
|
@@ -20,8 +19,8 @@ const s = {
|
|
|
20
19
|
(e, [r, n]) => (e[r.toUpperCase()] = n.map((o) => o.toUpperCase()), e),
|
|
21
20
|
{}
|
|
22
21
|
);
|
|
23
|
-
function
|
|
24
|
-
e =
|
|
22
|
+
function D(e) {
|
|
23
|
+
e = e.normalize("NFD");
|
|
25
24
|
const r = E(E({}, s), _);
|
|
26
25
|
for (const [n, o] of Object.entries(r)) {
|
|
27
26
|
const a = `[${n}${o.join("")}]`, c = `(${[n, ...o].join("|")})`;
|
|
@@ -29,10 +28,10 @@ function P(e) {
|
|
|
29
28
|
}
|
|
30
29
|
return e;
|
|
31
30
|
}
|
|
32
|
-
function
|
|
31
|
+
function N(e) {
|
|
33
32
|
return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
34
33
|
}
|
|
35
|
-
function
|
|
34
|
+
function l(e, r) {
|
|
36
35
|
if (!r)
|
|
37
36
|
return Array.from(new Set(e));
|
|
38
37
|
const n = /* @__PURE__ */ new Set(), o = [];
|
|
@@ -42,15 +41,15 @@ function v(e, r) {
|
|
|
42
41
|
}
|
|
43
42
|
return o;
|
|
44
43
|
}
|
|
45
|
-
function
|
|
44
|
+
function P(e) {
|
|
46
45
|
const { NODE_ENV: r = t.DEVELOPMENT, NODE_ENV_MODE: n = t.DEVELOPMENT } = e, o = r === t.DEVELOPMENT && n === t.DEVELOPMENT, a = r === t.PRODUCTION && n === t.STAGING, c = r === t.PRODUCTION && n === t.PRODUCTION;
|
|
47
46
|
if (r === t.PRODUCTION && n === t.DEVELOPMENT)
|
|
48
47
|
throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");
|
|
49
48
|
return { IS_DEV: o, IS_STAG: a, IS_PROD: c };
|
|
50
49
|
}
|
|
51
50
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
P as mapEnvironment,
|
|
52
|
+
D as regexSearchMapper,
|
|
53
|
+
N as removeAccent,
|
|
54
|
+
l as uniqueArray
|
|
56
55
|
};
|
package/dist/util/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./common/common.util.cjs"),e=require("./object/object.util.cjs"),a=require("./serializer/serializer.util.cjs"),r=require("./string/string.util.cjs"),i=require("./validate/validate.util.cjs");exports.mapEnvironment=t.mapEnvironment;exports.regexSearchMapper=t.regexSearchMapper;exports.removeAccent=t.removeAccent;exports.uniqueArray=t.uniqueArray;exports.deepMerge=e.deepMerge;exports.getNestedValue=e.getNestedValue;exports.isJSON=e.isJSON;exports.normalizeMongoFilter=e.normalizeMongoFilter;exports.setNestedValue=e.setNestedValue;exports.serializer=a.serializer;exports.generateRandomPassword=r.generateRandomPassword;exports.generateShortId=r.generateShortId;exports.generateSlug=r.generateSlug;exports.getFileName=r.getFileName;exports.substringBetween=r.substringBetween;exports.validate=i.validate;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./common/common.util.cjs"),e=require("./object/object.util.cjs"),a=require("./serializer/serializer.util.cjs"),r=require("./string/string.util.cjs"),i=require("./validate/validate.util.cjs");exports.mapEnvironment=t.mapEnvironment;exports.regexSearchMapper=t.regexSearchMapper;exports.removeAccent=t.removeAccent;exports.uniqueArray=t.uniqueArray;exports.deepClone=e.deepClone;exports.deepMerge=e.deepMerge;exports.getNestedValue=e.getNestedValue;exports.isJSON=e.isJSON;exports.normalizeMongoFilter=e.normalizeMongoFilter;exports.setNestedValue=e.setNestedValue;exports.serializer=a.serializer;exports.generateRandomPassword=r.generateRandomPassword;exports.generateShortId=r.generateShortId;exports.generateSlug=r.generateSlug;exports.getFileName=r.getFileName;exports.substringBetween=r.substringBetween;exports.validate=i.validate;
|