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