@cyberskill/shared 3.13.0 → 3.14.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/env/env.util.d.ts +5 -0
- package/dist/config/env/env.util.js +20 -16
- package/dist/config/env/env.util.js.map +1 -1
- package/dist/config/env/index.js +2 -2
- package/dist/config/vitest/vitest.e2e.js +4 -4
- package/dist/config/vitest/vitest.e2e.js.map +1 -1
- package/dist/config/vitest/vitest.unit.js +5 -5
- package/dist/config/vitest/vitest.unit.js.map +1 -1
- package/dist/config/vitest/vitest.unit.setup.js +10 -0
- package/dist/config/vitest/vitest.unit.setup.js.map +1 -0
- package/dist/node/apollo-server/apollo-server.type.d.ts +13 -1
- package/dist/node/apollo-server/apollo-server.util.d.ts +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +40 -16
- package/dist/node/apollo-server/apollo-server.util.js.map +1 -1
- package/dist/node/cli/index.js +26 -28
- package/dist/node/cli/index.js.map +1 -1
- package/dist/node/command/command.util.d.ts +5 -0
- package/dist/node/command/command.util.js +49 -48
- package/dist/node/command/command.util.js.map +1 -1
- package/dist/node/command/index.js +2 -2
- package/dist/node/express/express.type.d.ts +11 -0
- package/dist/node/express/express.util.d.ts +34 -6
- package/dist/node/express/express.util.js +81 -56
- package/dist/node/express/express.util.js.map +1 -1
- package/dist/node/express/index.js +2 -2
- package/dist/node/log/log.type.d.ts +17 -0
- package/dist/node/log/log.type.js.map +1 -1
- package/dist/node/log/log.util.js +25 -11
- package/dist/node/log/log.util.js.map +1 -1
- package/dist/node/mongo/index.d.ts +2 -1
- package/dist/node/mongo/index.js +7 -8
- package/dist/node/mongo/mongo.constant.d.ts +5 -0
- package/dist/node/mongo/mongo.constant.js +2 -2
- package/dist/node/mongo/mongo.constant.js.map +1 -1
- package/dist/node/mongo/mongo.controller.mongoose.d.ts +3 -0
- package/dist/node/mongo/mongo.controller.mongoose.js +41 -55
- package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -1
- package/dist/node/mongo/mongo.controller.native.d.ts +29 -2
- package/dist/node/mongo/mongo.controller.native.js +31 -14
- package/dist/node/mongo/mongo.controller.native.js.map +1 -1
- package/dist/node/mongo/mongo.type.d.ts +3 -1
- package/dist/node/mongo/mongo.util.d.ts +1 -0
- package/dist/node/mongo/mongo.util.js +38 -17
- package/dist/node/mongo/mongo.util.js.map +1 -1
- package/dist/node/package/package.util.js +47 -47
- package/dist/node/path/index.js +2 -2
- package/dist/node/path/path.constant.d.ts +4 -0
- package/dist/node/path/path.constant.js +75 -72
- package/dist/node/path/path.constant.js.map +1 -1
- package/dist/node/storage/storage.util.d.ts +50 -1
- package/dist/node/storage/storage.util.js +79 -54
- package/dist/node/storage/storage.util.js.map +1 -1
- package/dist/node/upload/upload.type.d.ts +2 -0
- package/dist/node/upload/upload.type.js.map +1 -1
- package/dist/node/upload/upload.util.d.ts +1 -0
- package/dist/node/upload/upload.util.js +62 -52
- package/dist/node/upload/upload.util.js.map +1 -1
- package/dist/node/ws/ws.util.d.ts +7 -0
- package/dist/node/ws/ws.util.js +20 -19
- package/dist/node/ws/ws.util.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.component.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.type.d.ts +2 -0
- package/dist/react/apollo-client/apollo-client.util.js +6 -6
- package/dist/react/apollo-client/apollo-client.util.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +1 -1
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.util.js.map +1 -1
- package/dist/react/i18next/i18next.server.d.ts +17 -0
- package/dist/react/i18next/i18next.server.js +9 -0
- package/dist/react/i18next/i18next.server.js.map +1 -0
- package/dist/react/next-intl/next-intl.hoc.d.ts +4 -8
- package/dist/react/next-intl/next-intl.hoc.js +14 -10
- package/dist/react/next-intl/next-intl.hoc.js.map +1 -1
- package/dist/react/next-intl/next-intl.server.d.ts +10 -0
- package/dist/react/next-intl/next-intl.server.js +7 -0
- package/dist/react/next-intl/next-intl.server.js.map +1 -0
- package/dist/react/storage/storage.util.d.ts +34 -1
- package/dist/react/storage/storage.util.js +30 -5
- package/dist/react/storage/storage.util.js.map +1 -1
- package/dist/react/userback/userback.component.js.map +1 -1
- package/dist/typescript/common.type.d.ts +4 -0
- package/dist/typescript/common.type.js +2 -2
- package/dist/typescript/common.type.js.map +1 -1
- package/dist/typescript/index.js +2 -2
- package/dist/util/object/object.util.js +29 -18
- package/dist/util/object/object.util.js.map +1 -1
- package/dist/util/serializer/serializer.util.d.ts +8 -0
- package/dist/util/serializer/serializer.util.js +51 -64
- package/dist/util/serializer/serializer.util.js.map +1 -1
- package/dist/util/storage/storage-envelope.d.ts +25 -0
- package/dist/util/storage/storage-envelope.js +18 -0
- package/dist/util/storage/storage-envelope.js.map +1 -0
- package/package.json +33 -12
- package/dist/node/mongo/mongo.type.js +0 -8
- package/dist/node/mongo/mongo.type.js.map +0 -1
- package/dist/node_modules/.pnpm/vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde/node_modules/vitest/dist/config.js +0 -8
- package/dist/node_modules/.pnpm/vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde/node_modules/vitest/dist/config.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getEnv as e } from "../../config/env/env.util.js";
|
|
2
|
+
import { catchError as t, log as n } from "../log/log.util.js";
|
|
3
|
+
import { pathExistsSync as r, readJsonSync as i, writeFileSync as a } from "../fs/fs.util.js";
|
|
4
4
|
import { E_PackageType as o } from "./package.type.js";
|
|
5
5
|
import { runCommand as s } from "../command/command.util.js";
|
|
6
6
|
import { join as c } from "../path/path.util.js";
|
|
7
7
|
import { NODE_MODULES as l, PACKAGE_JSON as u, PATH as d, command as f } from "../path/path.constant.js";
|
|
8
8
|
//#region src/node/package/package.util.ts
|
|
9
|
-
var p =
|
|
9
|
+
var p = e();
|
|
10
10
|
async function m(e) {
|
|
11
11
|
try {
|
|
12
12
|
let t = await fetch(`https://registry.npmjs.org/${e}/latest`);
|
|
@@ -17,20 +17,20 @@ async function m(e) {
|
|
|
17
17
|
result: n
|
|
18
18
|
};
|
|
19
19
|
} catch (e) {
|
|
20
|
-
return
|
|
20
|
+
return t(e);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
async function h(
|
|
23
|
+
async function h(e) {
|
|
24
24
|
try {
|
|
25
|
-
if (!
|
|
26
|
-
if (
|
|
27
|
-
let e =
|
|
25
|
+
if (!e) {
|
|
26
|
+
if (r(d.PACKAGE_JSON)) {
|
|
27
|
+
let e = i(d.PACKAGE_JSON), { name: t = "", version: n = "" } = e;
|
|
28
28
|
return {
|
|
29
29
|
success: !0,
|
|
30
30
|
result: {
|
|
31
|
-
name:
|
|
32
|
-
currentVersion:
|
|
33
|
-
latestVersion:
|
|
31
|
+
name: t,
|
|
32
|
+
currentVersion: n,
|
|
33
|
+
latestVersion: n,
|
|
34
34
|
isCurrentProject: !0,
|
|
35
35
|
isInstalled: !0,
|
|
36
36
|
isUpToDate: !0,
|
|
@@ -57,42 +57,42 @@ async function h(n) {
|
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
if (!
|
|
60
|
+
if (!r(d.PACKAGE_JSON)) return {
|
|
61
61
|
success: !0,
|
|
62
62
|
result: {
|
|
63
|
-
name:
|
|
63
|
+
name: e.name,
|
|
64
64
|
currentVersion: "",
|
|
65
65
|
latestVersion: "",
|
|
66
66
|
isCurrentProject: !1,
|
|
67
67
|
isInstalled: !1,
|
|
68
68
|
isUpToDate: !1,
|
|
69
|
-
isDependency:
|
|
70
|
-
isDevDependency:
|
|
69
|
+
isDependency: e.type === o.DEPENDENCY,
|
|
70
|
+
isDevDependency: e.type === o.DEV_DEPENDENCY,
|
|
71
71
|
installedPath: "",
|
|
72
72
|
file: {}
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
let
|
|
76
|
-
if (
|
|
75
|
+
let t = i(d.PACKAGE_JSON), { name: n, version: a = "", dependencies: s = {}, devDependencies: f = {} } = t;
|
|
76
|
+
if (e.name === n) return {
|
|
77
77
|
success: !0,
|
|
78
78
|
result: {
|
|
79
|
-
name:
|
|
79
|
+
name: n,
|
|
80
80
|
currentVersion: a,
|
|
81
81
|
latestVersion: a,
|
|
82
82
|
isCurrentProject: !0,
|
|
83
83
|
isInstalled: !0,
|
|
84
84
|
isUpToDate: !0,
|
|
85
|
-
isDependency:
|
|
86
|
-
isDevDependency:
|
|
85
|
+
isDependency: e.type === o.DEPENDENCY,
|
|
86
|
+
isDevDependency: e.type === o.DEV_DEPENDENCY,
|
|
87
87
|
installedPath: d.PACKAGE_JSON,
|
|
88
|
-
file:
|
|
88
|
+
file: t
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
let h =
|
|
91
|
+
let h = e.name in s, g = e.name in f, _ = await m(e.name);
|
|
92
92
|
if (!_.success) return {
|
|
93
93
|
success: !0,
|
|
94
94
|
result: {
|
|
95
|
-
name:
|
|
95
|
+
name: e.name,
|
|
96
96
|
currentVersion: "",
|
|
97
97
|
latestVersion: "",
|
|
98
98
|
isCurrentProject: !1,
|
|
@@ -107,23 +107,23 @@ async function h(n) {
|
|
|
107
107
|
if (!h && !g) return {
|
|
108
108
|
success: !0,
|
|
109
109
|
result: {
|
|
110
|
-
name:
|
|
110
|
+
name: e.name,
|
|
111
111
|
currentVersion: "",
|
|
112
112
|
latestVersion: _.result,
|
|
113
113
|
isCurrentProject: !1,
|
|
114
114
|
isInstalled: !1,
|
|
115
115
|
isUpToDate: !1,
|
|
116
|
-
isDependency:
|
|
117
|
-
isDevDependency:
|
|
116
|
+
isDependency: e.type === o.DEPENDENCY,
|
|
117
|
+
isDevDependency: e.type === o.DEV_DEPENDENCY,
|
|
118
118
|
installedPath: "",
|
|
119
119
|
file: {}
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
|
-
let v = s[
|
|
123
|
-
if (!
|
|
122
|
+
let v = s[e.name] ?? f[e.name] ?? "", y = c(p.CWD, l, e.name, u);
|
|
123
|
+
if (!r(y)) return {
|
|
124
124
|
success: !0,
|
|
125
125
|
result: {
|
|
126
|
-
name:
|
|
126
|
+
name: e.name,
|
|
127
127
|
currentVersion: "",
|
|
128
128
|
latestVersion: _.result,
|
|
129
129
|
isCurrentProject: !1,
|
|
@@ -135,11 +135,11 @@ async function h(n) {
|
|
|
135
135
|
file: {}
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
let b =
|
|
138
|
+
let b = i(y), { version: x = "" } = b;
|
|
139
139
|
return v === x ? {
|
|
140
140
|
success: !0,
|
|
141
141
|
result: {
|
|
142
|
-
name:
|
|
142
|
+
name: e.name,
|
|
143
143
|
currentVersion: v,
|
|
144
144
|
latestVersion: _.result,
|
|
145
145
|
isCurrentProject: !1,
|
|
@@ -153,7 +153,7 @@ async function h(n) {
|
|
|
153
153
|
} : {
|
|
154
154
|
success: !0,
|
|
155
155
|
result: {
|
|
156
|
-
name:
|
|
156
|
+
name: e.name,
|
|
157
157
|
currentVersion: x || v,
|
|
158
158
|
latestVersion: _.result,
|
|
159
159
|
isCurrentProject: !1,
|
|
@@ -166,15 +166,15 @@ async function h(n) {
|
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
} catch (e) {
|
|
169
|
-
return
|
|
169
|
+
return t(e);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
async function g(e) {
|
|
173
173
|
try {
|
|
174
|
-
let
|
|
175
|
-
e.isDependency ?
|
|
174
|
+
let t = i(d.PACKAGE_JSON), r = t.dependencies ?? {}, o = t.devDependencies ?? {};
|
|
175
|
+
e.isDependency ? r[e.name] = e.latestVersion : e.isDevDependency && (o[e.name] = e.latestVersion), a(d.PACKAGE_JSON, JSON.stringify(t, null, 4)), n.info(`Updated "${e.name}" to version ${e.latestVersion}`);
|
|
176
176
|
} catch (e) {
|
|
177
|
-
|
|
177
|
+
t(e);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
async function _() {
|
|
@@ -184,35 +184,35 @@ async function _() {
|
|
|
184
184
|
await s(`Installing dependencies (standard) using: ${e}`, e);
|
|
185
185
|
return;
|
|
186
186
|
} catch (e) {
|
|
187
|
-
|
|
187
|
+
t(e);
|
|
188
188
|
}
|
|
189
189
|
try {
|
|
190
190
|
let e = await f.pnpmInstallLegacy();
|
|
191
191
|
await s(`Retrying with legacy peer dependencies using: ${e}`, e);
|
|
192
192
|
return;
|
|
193
193
|
} catch (e) {
|
|
194
|
-
|
|
194
|
+
t(e);
|
|
195
195
|
}
|
|
196
196
|
try {
|
|
197
197
|
let e = await f.pnpmInstallForce();
|
|
198
198
|
await s(`Retrying with force install using: ${e}`, e);
|
|
199
199
|
} catch (e) {
|
|
200
|
-
|
|
200
|
+
t(e);
|
|
201
201
|
}
|
|
202
202
|
} catch (e) {
|
|
203
|
-
|
|
203
|
+
t(e);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
async function v(
|
|
206
|
+
async function v(e, i) {
|
|
207
207
|
try {
|
|
208
|
-
if (!
|
|
209
|
-
|
|
208
|
+
if (!r(d.PACKAGE_JSON)) {
|
|
209
|
+
n.error("package.json not found. Aborting setup.");
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
let
|
|
213
|
-
|
|
212
|
+
let t = (await Promise.all(e.map(h))).filter((e) => e.success && !!e.result && !e.result.isCurrentProject).map((e) => e.result), a = t.filter((e) => !e.isInstalled), o = t.filter((e) => !e.isUpToDate), c = [];
|
|
213
|
+
i?.install && a.length > 0 && c.push(...a.map(g)), i?.update && o.length > 0 && c.push(...o.map(g)), c.length > 0 && (await Promise.all(c), await _(), await s("Running ESLint with auto-fix", await f.eslintFix())), await i?.callback?.();
|
|
214
214
|
} catch (e) {
|
|
215
|
-
|
|
215
|
+
t(e);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
//#endregion
|
package/dist/node/path/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { dirname as e, join as t, path as n, resolve as r, resolveWorkingPath as i } from "./path.util.js";
|
|
2
|
-
import { AG_KIT_PACKAGE_NAME as a, BUILD_DIRECTORY as o, COMMIT_LINT_CLI as s, COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME as c, COMMIT_LINT_PACKAGE_NAME as l, CYBERSKILL_CLI as u, CYBERSKILL_CLI_PATH as d, CYBERSKILL_DIRECTORY as f, CYBERSKILL_PACKAGE_NAME as p, DOT_AGENT as m, ESLINT_CLI as h, ESLINT_INSPECT_CLI as g, ESLINT_INSPECT_PACKAGE_NAME as _, ESLINT_PACKAGE_NAME as v, GIT_CLI as y, GIT_COMMIT_EDITMSG as b, GIT_EXCLUDE as x, GIT_HOOK as S, GIT_IGNORE as C, LINT_STAGED_CLI as w, LINT_STAGED_PACKAGE_NAME as T, MIGRATE_MONGO_CLI as E, MIGRATE_MONGO_CONFIG as D, MIGRATE_MONGO_PACKAGE_NAME as O, NODE_MODULES as k, NODE_MODULES_INSPECT_CLI as A, NODE_MODULES_INSPECT_PACKAGE_NAME as j, PACKAGE_JSON as M, PACKAGE_LOCK_JSON as N, PATH as P, PNPM_CLI as F, PNPM_EXEC_CLI as I, PNPM_LOCK_YAML as L, PUBLIC_DIRECTORY as R, SIMPLE_GIT_HOOKS_PACKAGE_NAME as z, SIMPLE_GIT_HOOK_CLI as B, SIMPLE_GIT_HOOK_JSON as V, STORYBOOK_CLI as H, STORYBOOK_PACKAGE_NAME as U, TSCONFIG_JSON as W, TSC_CLI as G, TSC_PACKAGE_NAME as K, TSX_CLI as q, VITEST_CLI as J, VITEST_PACKAGE_NAME as Y, WORKING_DIRECTORY as X, command as Z, createGitHooksConfig as Q, getCyberskillDirectory as
|
|
3
|
-
export { a as AG_KIT_PACKAGE_NAME, o as BUILD_DIRECTORY, s as COMMIT_LINT_CLI, c as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, l as COMMIT_LINT_PACKAGE_NAME, u as CYBERSKILL_CLI, d as CYBERSKILL_CLI_PATH, f as CYBERSKILL_DIRECTORY, p as CYBERSKILL_PACKAGE_NAME, m as DOT_AGENT, h as ESLINT_CLI, g as ESLINT_INSPECT_CLI, _ as ESLINT_INSPECT_PACKAGE_NAME, v as ESLINT_PACKAGE_NAME, y as GIT_CLI, b as GIT_COMMIT_EDITMSG, x as GIT_EXCLUDE, S as GIT_HOOK, C as GIT_IGNORE, w as LINT_STAGED_CLI, T as LINT_STAGED_PACKAGE_NAME, E as MIGRATE_MONGO_CLI, D as MIGRATE_MONGO_CONFIG, O as MIGRATE_MONGO_PACKAGE_NAME, k as NODE_MODULES, A as NODE_MODULES_INSPECT_CLI, j as NODE_MODULES_INSPECT_PACKAGE_NAME, M as PACKAGE_JSON, N as PACKAGE_LOCK_JSON, P as PATH, F as PNPM_CLI, I as PNPM_EXEC_CLI, L as PNPM_LOCK_YAML, R as PUBLIC_DIRECTORY, z as SIMPLE_GIT_HOOKS_PACKAGE_NAME, B as SIMPLE_GIT_HOOK_CLI, V as SIMPLE_GIT_HOOK_JSON, H as STORYBOOK_CLI, U as STORYBOOK_PACKAGE_NAME, W as TSCONFIG_JSON, G as TSC_CLI, K as TSC_PACKAGE_NAME, q as TSX_CLI, J as VITEST_CLI, Y as VITEST_PACKAGE_NAME, X as WORKING_DIRECTORY, Z as command, Q as createGitHooksConfig, e as dirname, $ as getCyberskillDirectory, t as join, n as path, r as resolve, i as resolveWorkingPath };
|
|
2
|
+
import { AG_KIT_PACKAGE_NAME as a, BUILD_DIRECTORY as o, COMMIT_LINT_CLI as s, COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME as c, COMMIT_LINT_PACKAGE_NAME as l, CYBERSKILL_CLI as u, CYBERSKILL_CLI_PATH as d, CYBERSKILL_DIRECTORY as f, CYBERSKILL_PACKAGE_NAME as p, DOT_AGENT as m, ESLINT_CLI as h, ESLINT_INSPECT_CLI as g, ESLINT_INSPECT_PACKAGE_NAME as _, ESLINT_PACKAGE_NAME as v, GIT_CLI as y, GIT_COMMIT_EDITMSG as b, GIT_EXCLUDE as x, GIT_HOOK as S, GIT_IGNORE as C, LINT_STAGED_CLI as w, LINT_STAGED_PACKAGE_NAME as T, MIGRATE_MONGO_CLI as E, MIGRATE_MONGO_CONFIG as D, MIGRATE_MONGO_PACKAGE_NAME as O, NODE_MODULES as k, NODE_MODULES_INSPECT_CLI as A, NODE_MODULES_INSPECT_PACKAGE_NAME as j, PACKAGE_JSON as M, PACKAGE_LOCK_JSON as N, PATH as P, PNPM_CLI as F, PNPM_EXEC_CLI as I, PNPM_LOCK_YAML as L, PUBLIC_DIRECTORY as R, SIMPLE_GIT_HOOKS_PACKAGE_NAME as z, SIMPLE_GIT_HOOK_CLI as B, SIMPLE_GIT_HOOK_JSON as V, STORYBOOK_CLI as H, STORYBOOK_PACKAGE_NAME as U, TSCONFIG_JSON as W, TSC_CLI as G, TSC_PACKAGE_NAME as K, TSX_CLI as q, VITEST_CLI as J, VITEST_PACKAGE_NAME as Y, WORKING_DIRECTORY as X, command as Z, createGitHooksConfig as Q, getCyberskillDirectory as $, resetCyberskillDirCacheForTesting as ee } from "./path.constant.js";
|
|
3
|
+
export { a as AG_KIT_PACKAGE_NAME, o as BUILD_DIRECTORY, s as COMMIT_LINT_CLI, c as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, l as COMMIT_LINT_PACKAGE_NAME, u as CYBERSKILL_CLI, d as CYBERSKILL_CLI_PATH, f as CYBERSKILL_DIRECTORY, p as CYBERSKILL_PACKAGE_NAME, m as DOT_AGENT, h as ESLINT_CLI, g as ESLINT_INSPECT_CLI, _ as ESLINT_INSPECT_PACKAGE_NAME, v as ESLINT_PACKAGE_NAME, y as GIT_CLI, b as GIT_COMMIT_EDITMSG, x as GIT_EXCLUDE, S as GIT_HOOK, C as GIT_IGNORE, w as LINT_STAGED_CLI, T as LINT_STAGED_PACKAGE_NAME, E as MIGRATE_MONGO_CLI, D as MIGRATE_MONGO_CONFIG, O as MIGRATE_MONGO_PACKAGE_NAME, k as NODE_MODULES, A as NODE_MODULES_INSPECT_CLI, j as NODE_MODULES_INSPECT_PACKAGE_NAME, M as PACKAGE_JSON, N as PACKAGE_LOCK_JSON, P as PATH, F as PNPM_CLI, I as PNPM_EXEC_CLI, L as PNPM_LOCK_YAML, R as PUBLIC_DIRECTORY, z as SIMPLE_GIT_HOOKS_PACKAGE_NAME, B as SIMPLE_GIT_HOOK_CLI, V as SIMPLE_GIT_HOOK_JSON, H as STORYBOOK_CLI, U as STORYBOOK_PACKAGE_NAME, W as TSCONFIG_JSON, G as TSC_CLI, K as TSC_PACKAGE_NAME, q as TSX_CLI, J as VITEST_CLI, Y as VITEST_PACKAGE_NAME, X as WORKING_DIRECTORY, Z as command, Q as createGitHooksConfig, e as dirname, $ as getCyberskillDirectory, t as join, n as path, ee as resetCyberskillDirCacheForTesting, r as resolve, i as resolveWorkingPath };
|
|
@@ -13,6 +13,10 @@ export declare const GIT_HOOK = ".git/hooks/";
|
|
|
13
13
|
export declare const GIT_COMMIT_EDITMSG = ".git/COMMIT_EDITMSG";
|
|
14
14
|
export declare const GIT_EXCLUDE = ".git/info/exclude";
|
|
15
15
|
export declare const MIGRATE_MONGO_CONFIG = ".migrate-mongo.config.js";
|
|
16
|
+
/**
|
|
17
|
+
* Resets the cached directory path. For testing only.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resetCyberskillDirCacheForTesting(): void;
|
|
16
20
|
/**
|
|
17
21
|
* Lazily computes the CyberSkill directory path.
|
|
18
22
|
* Reads package.json on first access to determine whether this is the shared package itself
|
|
@@ -4,117 +4,120 @@ import { E_PackageType as n } from "../package/package.type.js";
|
|
|
4
4
|
import { setupPackages as ee } from "../package/package.util.js";
|
|
5
5
|
import { formatCommand as r, rawCommand as i } from "../command/command.util.js";
|
|
6
6
|
import { join as a, resolveWorkingPath as o } from "./path.util.js";
|
|
7
|
-
import
|
|
7
|
+
import s from "fs-extra";
|
|
8
8
|
//#region src/node/path/path.constant.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
|
|
9
|
+
var c = e().CWD, l = "@cyberskill/shared", u = "node_modules", d = "dist", f = "public", p = "package.json", m = "package-lock.json", h = "tsconfig.json", g = ".gitignore", _ = ".simple-git-hooks.json", v = "pnpm-lock.yaml", y = ".git/hooks/", b = ".git/COMMIT_EDITMSG", x = ".git/info/exclude", S = ".migrate-mongo.config.js", C = null;
|
|
10
|
+
function te() {
|
|
11
|
+
C = null;
|
|
12
|
+
}
|
|
13
|
+
function w() {
|
|
14
|
+
if (C !== null) return C;
|
|
12
15
|
try {
|
|
13
|
-
|
|
16
|
+
C = s.readJsonSync(o("package.json")).name === "@cyberskill/shared" ? a(c, d) : a(c, u, l, d);
|
|
14
17
|
} catch {
|
|
15
|
-
|
|
18
|
+
C = a(c, u, l, d);
|
|
16
19
|
}
|
|
17
|
-
return
|
|
20
|
+
return C;
|
|
18
21
|
}
|
|
19
|
-
var
|
|
22
|
+
var T = w(), E = "cyberskill", ne = "src/node/cli/index.ts", D = "eslint", O = "eslint", k = "vitest", A = "vitest", j = "@commitlint/cli", M = "@commitlint/config-conventional", N = "commitlint", P = "lint-staged", F = "lint-staged", I = "typescript", re = "tsc", L = "tsx", R = "git", z = "pnpm", B = "pnpm exec", V = "simple-git-hooks", H = "simple-git-hooks", U = "@eslint/config-inspector", W = "eslint-config-inspector", G = "node-modules-inspector", K = "node-modules-inspector", q = "migrate-mongo", J = "./node_modules/migrate-mongo/bin/migrate-mongo", Y = "storybook", X = "storybook", ie = "@vudovn/ag-kit", Z = ".agent", Q = {
|
|
20
23
|
get CYBERSKILL_DIRECTORY() {
|
|
21
|
-
return
|
|
24
|
+
return w();
|
|
22
25
|
},
|
|
23
|
-
WORKING_DIRECTORY:
|
|
24
|
-
PUBLIC_DIRECTORY: o(
|
|
25
|
-
TS_CONFIG: o(
|
|
26
|
-
GIT_IGNORE: o(
|
|
27
|
-
GIT_HOOK: o(
|
|
28
|
-
GIT_COMMIT_MSG: o(
|
|
29
|
-
GIT_EXCLUDE: o(
|
|
30
|
-
SIMPLE_GIT_HOOKS_JSON: o(
|
|
31
|
-
PACKAGE_JSON: o(
|
|
32
|
-
PACKAGE_LOCK_JSON: o(
|
|
33
|
-
PNPM_LOCK_YAML: o(
|
|
34
|
-
NODE_MODULES: o(
|
|
35
|
-
MIGRATE_MONGO_CONFIG: o(
|
|
26
|
+
WORKING_DIRECTORY: c,
|
|
27
|
+
PUBLIC_DIRECTORY: o(f),
|
|
28
|
+
TS_CONFIG: o(h),
|
|
29
|
+
GIT_IGNORE: o(g),
|
|
30
|
+
GIT_HOOK: o(y),
|
|
31
|
+
GIT_COMMIT_MSG: o(b),
|
|
32
|
+
GIT_EXCLUDE: o(x),
|
|
33
|
+
SIMPLE_GIT_HOOKS_JSON: o(_),
|
|
34
|
+
PACKAGE_JSON: o(p),
|
|
35
|
+
PACKAGE_LOCK_JSON: o(m),
|
|
36
|
+
PNPM_LOCK_YAML: o(v),
|
|
37
|
+
NODE_MODULES: o(u),
|
|
38
|
+
MIGRATE_MONGO_CONFIG: o(S),
|
|
36
39
|
get LINT_STAGED_CONFIG() {
|
|
37
|
-
return o(`${
|
|
40
|
+
return o(`${w()}/config/lint-staged/index.js`);
|
|
38
41
|
},
|
|
39
42
|
get COMMITLINT_CONFIG() {
|
|
40
|
-
return o(`${
|
|
43
|
+
return o(`${w()}/config/commitlint/index.js`);
|
|
41
44
|
},
|
|
42
45
|
get VITEST_UNIT_CONFIG() {
|
|
43
|
-
return o(`${
|
|
46
|
+
return o(`${w()}/config/vitest/vitest.unit.js`);
|
|
44
47
|
},
|
|
45
48
|
get VITEST_E2E_CONFIG() {
|
|
46
|
-
return o(`${
|
|
49
|
+
return o(`${w()}/config/vitest/vitest.e2e.js`);
|
|
47
50
|
},
|
|
48
51
|
get STORYBOOK_MAIN_CONFIG() {
|
|
49
|
-
return o(`${
|
|
52
|
+
return o(`${w()}/config/storybook/storybook.main.js`);
|
|
50
53
|
},
|
|
51
54
|
get STORYBOOK_PREVIEW_CONFIG() {
|
|
52
|
-
return o(`${
|
|
55
|
+
return o(`${w()}/config/storybook/storybook.preview.js`);
|
|
53
56
|
},
|
|
54
57
|
DOT_AGENT: o(Z)
|
|
55
58
|
};
|
|
56
|
-
function
|
|
59
|
+
function ae() {
|
|
57
60
|
return {
|
|
58
|
-
"pre-commit":
|
|
59
|
-
"commit-msg":
|
|
60
|
-
"pre-push": i(`git pull && ${
|
|
61
|
+
"pre-commit": F,
|
|
62
|
+
"commit-msg": N,
|
|
63
|
+
"pre-push": i(`git pull && ${z} run --if-present test`)
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
66
|
function $({ type: e, packages: n, command: a }) {
|
|
64
67
|
let o = n?.reduce((e, t) => (e.some((e) => e.name === t.name) || e.push(t), e), []);
|
|
65
68
|
return async () => {
|
|
66
69
|
switch (e) {
|
|
67
|
-
case t.CLI: return o?.length && await ee(o, { install: !0 }), r(i(`${
|
|
70
|
+
case t.CLI: return o?.length && await ee(o, { install: !0 }), r(i(`${B} ${a}`));
|
|
68
71
|
case t.STRING: return r(i(a));
|
|
69
72
|
default: throw Error("Unsupported command type");
|
|
70
73
|
}
|
|
71
74
|
};
|
|
72
75
|
}
|
|
73
|
-
var
|
|
76
|
+
var oe = /^[\w-]+$/, se = {
|
|
74
77
|
simpleGitHooks: $({
|
|
75
78
|
type: t.CLI,
|
|
76
79
|
packages: [{
|
|
77
|
-
name:
|
|
80
|
+
name: V,
|
|
78
81
|
type: n.DEV_DEPENDENCY
|
|
79
82
|
}],
|
|
80
|
-
command:
|
|
83
|
+
command: H
|
|
81
84
|
}),
|
|
82
85
|
eslintInspect: $({
|
|
83
86
|
type: t.CLI,
|
|
84
87
|
packages: [{
|
|
85
|
-
name:
|
|
88
|
+
name: U,
|
|
86
89
|
type: n.DEV_DEPENDENCY
|
|
87
90
|
}],
|
|
88
|
-
command:
|
|
91
|
+
command: W
|
|
89
92
|
}),
|
|
90
93
|
nodeModulesInspect: $({
|
|
91
94
|
type: t.CLI,
|
|
92
95
|
packages: [{
|
|
93
|
-
name:
|
|
96
|
+
name: G,
|
|
94
97
|
type: n.DEV_DEPENDENCY
|
|
95
98
|
}],
|
|
96
|
-
command:
|
|
99
|
+
command: K
|
|
97
100
|
}),
|
|
98
101
|
eslintCheck: $({
|
|
99
102
|
type: t.CLI,
|
|
100
103
|
packages: [{
|
|
101
|
-
name:
|
|
104
|
+
name: D,
|
|
102
105
|
type: n.DEV_DEPENDENCY
|
|
103
106
|
}],
|
|
104
|
-
command: `${
|
|
107
|
+
command: `${O} ${Q.WORKING_DIRECTORY} --no-cache`
|
|
105
108
|
}),
|
|
106
109
|
eslintFix: $({
|
|
107
110
|
type: t.CLI,
|
|
108
111
|
packages: [{
|
|
109
|
-
name:
|
|
112
|
+
name: D,
|
|
110
113
|
type: n.DEV_DEPENDENCY
|
|
111
114
|
}],
|
|
112
|
-
command: `${
|
|
115
|
+
command: `${O} ${Q.WORKING_DIRECTORY} --fix --no-cache`
|
|
113
116
|
}),
|
|
114
117
|
typescriptCheck: $({
|
|
115
118
|
type: t.CLI,
|
|
116
119
|
packages: [{
|
|
117
|
-
name:
|
|
120
|
+
name: I,
|
|
118
121
|
type: n.DEV_DEPENDENCY
|
|
119
122
|
}],
|
|
120
123
|
command: `tsc -p ${Q.TS_CONFIG} --noEmit --incremental`
|
|
@@ -122,31 +125,31 @@ var ae = /^[\w-]+$/, oe = {
|
|
|
122
125
|
testUnit: $({
|
|
123
126
|
type: t.CLI,
|
|
124
127
|
packages: [{
|
|
125
|
-
name:
|
|
128
|
+
name: k,
|
|
126
129
|
type: n.DEV_DEPENDENCY
|
|
127
130
|
}],
|
|
128
|
-
command: `${
|
|
131
|
+
command: `${A} --config ${Q.VITEST_UNIT_CONFIG}`
|
|
129
132
|
}),
|
|
130
133
|
testE2e: $({
|
|
131
134
|
type: t.CLI,
|
|
132
135
|
packages: [{
|
|
133
|
-
name:
|
|
136
|
+
name: k,
|
|
134
137
|
type: n.DEV_DEPENDENCY
|
|
135
138
|
}],
|
|
136
|
-
command: `${
|
|
139
|
+
command: `${A} --config ${Q.VITEST_E2E_CONFIG}`
|
|
137
140
|
}),
|
|
138
141
|
mongoMigrateCreate: (e) => {
|
|
139
|
-
if (!
|
|
142
|
+
if (!oe.test(e)) throw Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
|
|
140
143
|
return $({
|
|
141
144
|
type: t.CLI,
|
|
142
145
|
packages: [{
|
|
143
146
|
name: "tsx",
|
|
144
147
|
type: n.DEPENDENCY
|
|
145
148
|
}, {
|
|
146
|
-
name:
|
|
149
|
+
name: q,
|
|
147
150
|
type: n.DEPENDENCY
|
|
148
151
|
}],
|
|
149
|
-
command: `tsx ${
|
|
152
|
+
command: `tsx ${J} create ${e} -f ${Q.MIGRATE_MONGO_CONFIG}`
|
|
150
153
|
})();
|
|
151
154
|
},
|
|
152
155
|
mongoMigrateUp: $({
|
|
@@ -155,10 +158,10 @@ var ae = /^[\w-]+$/, oe = {
|
|
|
155
158
|
name: "tsx",
|
|
156
159
|
type: n.DEPENDENCY
|
|
157
160
|
}, {
|
|
158
|
-
name:
|
|
161
|
+
name: q,
|
|
159
162
|
type: n.DEPENDENCY
|
|
160
163
|
}],
|
|
161
|
-
command: `tsx ${
|
|
164
|
+
command: `tsx ${J} up -f ${Q.MIGRATE_MONGO_CONFIG}`
|
|
162
165
|
}),
|
|
163
166
|
mongoMigrateDown: $({
|
|
164
167
|
type: t.CLI,
|
|
@@ -166,29 +169,29 @@ var ae = /^[\w-]+$/, oe = {
|
|
|
166
169
|
name: "tsx",
|
|
167
170
|
type: n.DEPENDENCY
|
|
168
171
|
}, {
|
|
169
|
-
name:
|
|
172
|
+
name: q,
|
|
170
173
|
type: n.DEPENDENCY
|
|
171
174
|
}],
|
|
172
|
-
command: `tsx ${
|
|
175
|
+
command: `tsx ${J} down -f ${Q.MIGRATE_MONGO_CONFIG}`
|
|
173
176
|
}),
|
|
174
177
|
commitLint: $({
|
|
175
178
|
type: t.CLI,
|
|
176
179
|
packages: [{
|
|
177
|
-
name:
|
|
180
|
+
name: j,
|
|
178
181
|
type: n.DEV_DEPENDENCY
|
|
179
182
|
}, {
|
|
180
|
-
name:
|
|
183
|
+
name: M,
|
|
181
184
|
type: n.DEV_DEPENDENCY
|
|
182
185
|
}],
|
|
183
|
-
command: `${
|
|
186
|
+
command: `${N} --edit ${Q.GIT_COMMIT_MSG} --config ${Q.COMMITLINT_CONFIG}`
|
|
184
187
|
}),
|
|
185
188
|
lintStaged: $({
|
|
186
189
|
type: t.CLI,
|
|
187
190
|
packages: [{
|
|
188
|
-
name:
|
|
191
|
+
name: P,
|
|
189
192
|
type: n.DEV_DEPENDENCY
|
|
190
193
|
}],
|
|
191
|
-
command: `${
|
|
194
|
+
command: `${F} --config ${Q.LINT_STAGED_CONFIG}`
|
|
192
195
|
}),
|
|
193
196
|
configureGitHook: $({
|
|
194
197
|
type: t.STRING,
|
|
@@ -196,46 +199,46 @@ var ae = /^[\w-]+$/, oe = {
|
|
|
196
199
|
}),
|
|
197
200
|
build: $({
|
|
198
201
|
type: t.STRING,
|
|
199
|
-
command: `${
|
|
202
|
+
command: `${z} run --if-present build`
|
|
200
203
|
}),
|
|
201
204
|
pnpmInstallStandard: $({
|
|
202
205
|
type: t.STRING,
|
|
203
|
-
command: `${
|
|
206
|
+
command: `${z} install --ignore-scripts`
|
|
204
207
|
}),
|
|
205
208
|
pnpmInstallLegacy: $({
|
|
206
209
|
type: t.STRING,
|
|
207
|
-
command: `${
|
|
210
|
+
command: `${z} install --ignore-scripts --legacy-peer-deps`
|
|
208
211
|
}),
|
|
209
212
|
pnpmInstallForce: $({
|
|
210
213
|
type: t.STRING,
|
|
211
|
-
command: `${
|
|
214
|
+
command: `${z} install --ignore-scripts --force`
|
|
212
215
|
}),
|
|
213
216
|
pnpmPruneStore: $({
|
|
214
217
|
type: t.STRING,
|
|
215
|
-
command: `${
|
|
218
|
+
command: `${z} store prune`
|
|
216
219
|
}),
|
|
217
220
|
pnpmCleanCache: $({
|
|
218
221
|
type: t.STRING,
|
|
219
|
-
command: `${
|
|
222
|
+
command: `${z} cache delete`
|
|
220
223
|
}),
|
|
221
224
|
storybookDev: $({
|
|
222
225
|
type: t.CLI,
|
|
223
226
|
packages: [{
|
|
224
|
-
name:
|
|
227
|
+
name: Y,
|
|
225
228
|
type: n.DEV_DEPENDENCY
|
|
226
229
|
}],
|
|
227
|
-
command: `${
|
|
230
|
+
command: `${X} dev`
|
|
228
231
|
}),
|
|
229
232
|
storybookBuild: $({
|
|
230
233
|
type: t.CLI,
|
|
231
234
|
packages: [{
|
|
232
|
-
name:
|
|
235
|
+
name: Y,
|
|
233
236
|
type: n.DEV_DEPENDENCY
|
|
234
237
|
}],
|
|
235
|
-
command: `${
|
|
238
|
+
command: `${X} build`
|
|
236
239
|
})
|
|
237
240
|
};
|
|
238
241
|
//#endregion
|
|
239
|
-
export {
|
|
242
|
+
export { ie as AG_KIT_PACKAGE_NAME, d as BUILD_DIRECTORY, N as COMMIT_LINT_CLI, M as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, j as COMMIT_LINT_PACKAGE_NAME, E as CYBERSKILL_CLI, ne as CYBERSKILL_CLI_PATH, T as CYBERSKILL_DIRECTORY, l as CYBERSKILL_PACKAGE_NAME, Z as DOT_AGENT, O as ESLINT_CLI, W as ESLINT_INSPECT_CLI, U as ESLINT_INSPECT_PACKAGE_NAME, D as ESLINT_PACKAGE_NAME, R as GIT_CLI, b as GIT_COMMIT_EDITMSG, x as GIT_EXCLUDE, y as GIT_HOOK, g as GIT_IGNORE, F as LINT_STAGED_CLI, P as LINT_STAGED_PACKAGE_NAME, J as MIGRATE_MONGO_CLI, S as MIGRATE_MONGO_CONFIG, q as MIGRATE_MONGO_PACKAGE_NAME, u as NODE_MODULES, K as NODE_MODULES_INSPECT_CLI, G as NODE_MODULES_INSPECT_PACKAGE_NAME, p as PACKAGE_JSON, m as PACKAGE_LOCK_JSON, Q as PATH, z as PNPM_CLI, B as PNPM_EXEC_CLI, v as PNPM_LOCK_YAML, f as PUBLIC_DIRECTORY, V as SIMPLE_GIT_HOOKS_PACKAGE_NAME, H as SIMPLE_GIT_HOOK_CLI, _ as SIMPLE_GIT_HOOK_JSON, X as STORYBOOK_CLI, Y as STORYBOOK_PACKAGE_NAME, h as TSCONFIG_JSON, re as TSC_CLI, I as TSC_PACKAGE_NAME, L as TSX_CLI, A as VITEST_CLI, k as VITEST_PACKAGE_NAME, c as WORKING_DIRECTORY, se as command, ae as createGitHooksConfig, w as getCyberskillDirectory, te as resetCyberskillDirCacheForTesting };
|
|
240
243
|
|
|
241
244
|
//# sourceMappingURL=path.constant.js.map
|