@cyberskill/shared 1.47.0 → 1.48.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/_tsup-dts-rollup.d.cts +410 -30
- package/dist/_tsup-dts-rollup.d.ts +410 -30
- package/dist/cli.cjs +2136 -1
- package/dist/cli.d.cts +2 -1
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +2056 -1
- package/dist/configs/commitlint/base.cjs +64 -1
- package/dist/configs/commitlint/base.js +7 -1
- package/dist/configs/eslint/base.cjs +121 -1
- package/dist/configs/eslint/base.js +52 -1
- package/dist/configs/eslint/nestjs.cjs +155 -1
- package/dist/configs/eslint/nestjs.js +85 -1
- package/dist/configs/eslint/nextjs.cjs +155 -1
- package/dist/configs/eslint/nextjs.js +85 -1
- package/dist/configs/eslint/nodejs.cjs +156 -1
- package/dist/configs/eslint/nodejs.js +86 -1
- package/dist/configs/eslint/vite-react.cjs +159 -1
- package/dist/configs/eslint/vite-react.js +89 -1
- package/dist/configs/graphql/graphql-codegen.cjs +125 -1
- package/dist/configs/graphql/graphql-codegen.js +64 -1
- package/dist/configs/graphql/index.cjs +126 -1
- package/dist/configs/graphql/index.js +64 -1
- package/dist/configs/i18n/react/i18next.cjs +80 -1
- package/dist/configs/i18n/react/i18next.js +7 -1
- package/dist/configs/i18n/react/index.cjs +81 -1
- package/dist/configs/i18n/react/index.js +7 -1
- package/dist/configs/index.cjs +232 -1
- package/dist/configs/index.js +166 -1
- package/dist/configs/lint-staged/base.cjs +64 -1
- package/dist/configs/lint-staged/base.js +7 -1
- package/dist/configs/vitest/react/e2e.cjs +128 -1
- package/dist/configs/vitest/react/e2e.js +59 -1
- package/dist/configs/vitest/react/unit.cjs +305 -1
- package/dist/configs/vitest/react/unit.js +228 -1
- package/dist/configs/vitest/react/unit.setup.cjs +60 -1
- package/dist/configs/vitest/react/unit.setup.js +8 -1
- package/dist/constants/index.cjs +678 -1
- package/dist/constants/index.d.cts +31 -1
- package/dist/constants/index.d.ts +31 -1
- package/dist/constants/index.js +469 -1
- package/dist/constants/path.cjs +423 -1
- package/dist/constants/path.d.cts +31 -1
- package/dist/constants/path.d.ts +31 -1
- package/dist/constants/path.js +218 -1
- package/dist/constants/response-status.cjs +313 -1
- package/dist/constants/response-status.js +252 -1
- package/dist/index.cjs +4546 -1
- package/dist/index.d.cts +51 -7
- package/dist/index.d.ts +51 -7
- package/dist/index.js +4133 -1
- package/dist/nodejs/index.cjs +2138 -1
- package/dist/nodejs/index.js +2054 -1
- package/dist/nodejs/mongo.cjs +2137 -1
- package/dist/nodejs/mongo.js +2054 -1
- package/dist/react/apollo-client.cjs +177 -1
- package/dist/react/apollo-client.js +116 -1
- package/dist/react/index.cjs +990 -1
- package/dist/react/index.js +876 -1
- package/dist/react/loading.cjs +301 -1
- package/dist/react/loading.js +216 -1
- package/dist/react/next-intl.cjs +744 -1
- package/dist/react/next-intl.js +655 -1
- package/dist/react/storage.cjs +631 -1
- package/dist/react/storage.js +558 -1
- package/dist/typescript/api-response.cjs +48 -1
- package/dist/typescript/apollo.cjs +48 -1
- package/dist/typescript/command.cjs +68 -1
- package/dist/typescript/command.d.cts +4 -0
- package/dist/typescript/command.d.ts +4 -0
- package/dist/typescript/command.js +7 -1
- package/dist/typescript/config.cjs +48 -1
- package/dist/typescript/fs.cjs +48 -0
- package/dist/typescript/fs.d.cts +1 -0
- package/dist/typescript/fs.d.ts +1 -0
- package/dist/typescript/fs.js +0 -0
- package/dist/typescript/graphql-codegen.cjs +48 -1
- package/dist/typescript/index.cjs +175 -1
- package/dist/typescript/index.d.cts +5 -0
- package/dist/typescript/index.d.ts +5 -0
- package/dist/typescript/index.js +151 -1
- package/dist/typescript/loading.cjs +48 -1
- package/dist/typescript/log.cjs +48 -1
- package/dist/typescript/mongo.cjs +164 -1
- package/dist/typescript/mongo.js +145 -1
- package/dist/typescript/next-intl.cjs +48 -1
- package/dist/typescript/react.cjs +48 -1
- package/dist/typescript/serializer.cjs +48 -1
- package/dist/typescript/string.cjs +48 -1
- package/dist/utils/command.cjs +1387 -1
- package/dist/utils/command.d.cts +2 -0
- package/dist/utils/command.d.ts +2 -0
- package/dist/utils/command.js +1287 -1
- package/dist/utils/common.cjs +300 -1
- package/dist/utils/common.js +219 -1
- package/dist/utils/config.cjs +146 -1
- package/dist/utils/config.js +89 -1
- package/dist/utils/fs.cjs +118 -1
- package/dist/utils/fs.d.cts +4 -1
- package/dist/utils/fs.d.ts +4 -1
- package/dist/utils/fs.js +37 -1
- package/dist/utils/index-nodejs.cjs +1738 -1
- package/dist/utils/index-nodejs.d.cts +15 -6
- package/dist/utils/index-nodejs.d.ts +15 -6
- package/dist/utils/index-nodejs.js +1571 -1
- package/dist/utils/index.cjs +727 -1
- package/dist/utils/index.js +625 -1
- package/dist/utils/log.cjs +330 -1
- package/dist/utils/log.js +269 -1
- package/dist/utils/package.cjs +941 -0
- package/dist/utils/package.d.cts +3 -0
- package/dist/utils/package.d.ts +3 -0
- package/dist/utils/package.js +857 -0
- package/dist/utils/path.cjs +291 -0
- package/dist/utils/path.d.cts +6 -0
- package/dist/utils/path.d.ts +6 -0
- package/dist/utils/path.js +191 -0
- package/dist/utils/serializer.cjs +91 -1
- package/dist/utils/serializer.js +30 -1
- package/dist/utils/storage-client.cjs +349 -1
- package/dist/utils/storage-client.js +276 -1
- package/dist/utils/storage-server.cjs +636 -1
- package/dist/utils/storage-server.d.cts +1 -1
- package/dist/utils/storage-server.d.ts +1 -1
- package/dist/utils/storage-server.js +550 -1
- package/dist/utils/string.cjs +152 -1
- package/dist/utils/string.js +75 -1
- package/dist/utils/validate.cjs +90 -1
- package/dist/utils/validate.js +33 -1
- package/package.json +11 -11
- package/dist/utils/npm-package.cjs +0 -1
- package/dist/utils/npm-package.d.cts +0 -5
- package/dist/utils/npm-package.d.ts +0 -5
- package/dist/utils/npm-package.js +0 -1
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HOOK_alias_1 as HOOK } from '../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { CYBERSKILL_DIRECTORY_alias_1 as CYBERSKILL_DIRECTORY } from '../_tsup-dts-rollup.cjs';
|
|
2
3
|
export { WORKING_DIRECTORY_alias_1 as WORKING_DIRECTORY } from '../_tsup-dts-rollup.cjs';
|
|
4
|
+
export { CYBERSKILL_PACKAGE_NAME_alias_1 as CYBERSKILL_PACKAGE_NAME } from '../_tsup-dts-rollup.cjs';
|
|
5
|
+
export { CYBERSKILL_STORAGE_alias_1 as CYBERSKILL_STORAGE } from '../_tsup-dts-rollup.cjs';
|
|
6
|
+
export { NODE_MODULES_alias_1 as NODE_MODULES } from '../_tsup-dts-rollup.cjs';
|
|
7
|
+
export { BUILD_DIRECTORY_alias_1 as BUILD_DIRECTORY } from '../_tsup-dts-rollup.cjs';
|
|
8
|
+
export { PACKAGE_JSON_alias_1 as PACKAGE_JSON } from '../_tsup-dts-rollup.cjs';
|
|
9
|
+
export { PACKAGE_LOCK_JSON_alias_1 as PACKAGE_LOCK_JSON } from '../_tsup-dts-rollup.cjs';
|
|
10
|
+
export { TSCONFIG_JSON_alias_1 as TSCONFIG_JSON } from '../_tsup-dts-rollup.cjs';
|
|
11
|
+
export { GIT_IGNORE_alias_1 as GIT_IGNORE } from '../_tsup-dts-rollup.cjs';
|
|
12
|
+
export { SIMPLE_GIT_HOOK_JSON_alias_1 as SIMPLE_GIT_HOOK_JSON } from '../_tsup-dts-rollup.cjs';
|
|
13
|
+
export { PNPM_LOCK_YAML_alias_1 as PNPM_LOCK_YAML } from '../_tsup-dts-rollup.cjs';
|
|
14
|
+
export { GIT_HOOK_alias_1 as GIT_HOOK } from '../_tsup-dts-rollup.cjs';
|
|
15
|
+
export { GIT_COMMIT_EDITMSG_alias_1 as GIT_COMMIT_EDITMSG } from '../_tsup-dts-rollup.cjs';
|
|
16
|
+
export { CYBERSKILL_CLI_alias_1 as CYBERSKILL_CLI } from '../_tsup-dts-rollup.cjs';
|
|
17
|
+
export { ESLINT_CLI_alias_1 as ESLINT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
18
|
+
export { VITEST_CLI_alias_1 as VITEST_CLI } from '../_tsup-dts-rollup.cjs';
|
|
19
|
+
export { COMMIT_LINT_CLI_alias_1 as COMMIT_LINT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
20
|
+
export { LINT_STAGED_CLI_alias_1 as LINT_STAGED_CLI } from '../_tsup-dts-rollup.cjs';
|
|
21
|
+
export { RIMRAF_CLI_alias_1 as RIMRAF_CLI } from '../_tsup-dts-rollup.cjs';
|
|
22
|
+
export { TSC_CLI_alias_1 as TSC_CLI } from '../_tsup-dts-rollup.cjs';
|
|
23
|
+
export { TSX_CLI_alias_1 as TSX_CLI } from '../_tsup-dts-rollup.cjs';
|
|
24
|
+
export { GIT_CLI_alias_1 as GIT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
25
|
+
export { PNPM_CLI_alias_1 as PNPM_CLI } from '../_tsup-dts-rollup.cjs';
|
|
26
|
+
export { PNPM_DLX_CLI_alias_1 as PNPM_DLX_CLI } from '../_tsup-dts-rollup.cjs';
|
|
27
|
+
export { PNPM_EXEC_CLI_alias_1 as PNPM_EXEC_CLI } from '../_tsup-dts-rollup.cjs';
|
|
28
|
+
export { SIMPLE_GIT_HOOK_CLI_alias_1 as SIMPLE_GIT_HOOK_CLI } from '../_tsup-dts-rollup.cjs';
|
|
29
|
+
export { ESLINT_INSPECT_CLI_alias_1 as ESLINT_INSPECT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
30
|
+
export { NODE_MODULES_INSPECT_CLI_alias_1 as NODE_MODULES_INSPECT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
31
|
+
export { PATH_alias_1 as PATH } from '../_tsup-dts-rollup.cjs';
|
|
32
|
+
export { COMMAND_alias_1 as COMMAND } from '../_tsup-dts-rollup.cjs';
|
|
3
33
|
export { RESPONSE_STATUS_alias_1 as RESPONSE_STATUS } from '../_tsup-dts-rollup.cjs';
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HOOK_alias_1 as HOOK } from '../_tsup-dts-rollup.js';
|
|
2
|
+
export { CYBERSKILL_DIRECTORY_alias_1 as CYBERSKILL_DIRECTORY } from '../_tsup-dts-rollup.js';
|
|
2
3
|
export { WORKING_DIRECTORY_alias_1 as WORKING_DIRECTORY } from '../_tsup-dts-rollup.js';
|
|
4
|
+
export { CYBERSKILL_PACKAGE_NAME_alias_1 as CYBERSKILL_PACKAGE_NAME } from '../_tsup-dts-rollup.js';
|
|
5
|
+
export { CYBERSKILL_STORAGE_alias_1 as CYBERSKILL_STORAGE } from '../_tsup-dts-rollup.js';
|
|
6
|
+
export { NODE_MODULES_alias_1 as NODE_MODULES } from '../_tsup-dts-rollup.js';
|
|
7
|
+
export { BUILD_DIRECTORY_alias_1 as BUILD_DIRECTORY } from '../_tsup-dts-rollup.js';
|
|
8
|
+
export { PACKAGE_JSON_alias_1 as PACKAGE_JSON } from '../_tsup-dts-rollup.js';
|
|
9
|
+
export { PACKAGE_LOCK_JSON_alias_1 as PACKAGE_LOCK_JSON } from '../_tsup-dts-rollup.js';
|
|
10
|
+
export { TSCONFIG_JSON_alias_1 as TSCONFIG_JSON } from '../_tsup-dts-rollup.js';
|
|
11
|
+
export { GIT_IGNORE_alias_1 as GIT_IGNORE } from '../_tsup-dts-rollup.js';
|
|
12
|
+
export { SIMPLE_GIT_HOOK_JSON_alias_1 as SIMPLE_GIT_HOOK_JSON } from '../_tsup-dts-rollup.js';
|
|
13
|
+
export { PNPM_LOCK_YAML_alias_1 as PNPM_LOCK_YAML } from '../_tsup-dts-rollup.js';
|
|
14
|
+
export { GIT_HOOK_alias_1 as GIT_HOOK } from '../_tsup-dts-rollup.js';
|
|
15
|
+
export { GIT_COMMIT_EDITMSG_alias_1 as GIT_COMMIT_EDITMSG } from '../_tsup-dts-rollup.js';
|
|
16
|
+
export { CYBERSKILL_CLI_alias_1 as CYBERSKILL_CLI } from '../_tsup-dts-rollup.js';
|
|
17
|
+
export { ESLINT_CLI_alias_1 as ESLINT_CLI } from '../_tsup-dts-rollup.js';
|
|
18
|
+
export { VITEST_CLI_alias_1 as VITEST_CLI } from '../_tsup-dts-rollup.js';
|
|
19
|
+
export { COMMIT_LINT_CLI_alias_1 as COMMIT_LINT_CLI } from '../_tsup-dts-rollup.js';
|
|
20
|
+
export { LINT_STAGED_CLI_alias_1 as LINT_STAGED_CLI } from '../_tsup-dts-rollup.js';
|
|
21
|
+
export { RIMRAF_CLI_alias_1 as RIMRAF_CLI } from '../_tsup-dts-rollup.js';
|
|
22
|
+
export { TSC_CLI_alias_1 as TSC_CLI } from '../_tsup-dts-rollup.js';
|
|
23
|
+
export { TSX_CLI_alias_1 as TSX_CLI } from '../_tsup-dts-rollup.js';
|
|
24
|
+
export { GIT_CLI_alias_1 as GIT_CLI } from '../_tsup-dts-rollup.js';
|
|
25
|
+
export { PNPM_CLI_alias_1 as PNPM_CLI } from '../_tsup-dts-rollup.js';
|
|
26
|
+
export { PNPM_DLX_CLI_alias_1 as PNPM_DLX_CLI } from '../_tsup-dts-rollup.js';
|
|
27
|
+
export { PNPM_EXEC_CLI_alias_1 as PNPM_EXEC_CLI } from '../_tsup-dts-rollup.js';
|
|
28
|
+
export { SIMPLE_GIT_HOOK_CLI_alias_1 as SIMPLE_GIT_HOOK_CLI } from '../_tsup-dts-rollup.js';
|
|
29
|
+
export { ESLINT_INSPECT_CLI_alias_1 as ESLINT_INSPECT_CLI } from '../_tsup-dts-rollup.js';
|
|
30
|
+
export { NODE_MODULES_INSPECT_CLI_alias_1 as NODE_MODULES_INSPECT_CLI } from '../_tsup-dts-rollup.js';
|
|
31
|
+
export { PATH_alias_1 as PATH } from '../_tsup-dts-rollup.js';
|
|
32
|
+
export { COMMAND_alias_1 as COMMAND } from '../_tsup-dts-rollup.js';
|
|
3
33
|
export { RESPONSE_STATUS_alias_1 as RESPONSE_STATUS } from '../_tsup-dts-rollup.js';
|
package/dist/constants/index.js
CHANGED
|
@@ -1 +1,469 @@
|
|
|
1
|
-
|
|
1
|
+
// src/constants/path.ts
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_without_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
9
|
+
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
function _iterable_to_array(iter) {
|
|
24
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
25
|
+
}
|
|
26
|
+
function _non_iterable_spread() {
|
|
27
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
28
|
+
}
|
|
29
|
+
function _object_spread(target) {
|
|
30
|
+
for(var i = 1; i < arguments.length; i++){
|
|
31
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
32
|
+
var ownKeys = Object.keys(source);
|
|
33
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
34
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
ownKeys.forEach(function(key) {
|
|
39
|
+
_define_property(target, key, source[key]);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return target;
|
|
43
|
+
}
|
|
44
|
+
function _to_consumable_array(arr) {
|
|
45
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
46
|
+
}
|
|
47
|
+
function _type_of(obj) {
|
|
48
|
+
"@swc/helpers - typeof";
|
|
49
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
50
|
+
}
|
|
51
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
52
|
+
if (!o) return;
|
|
53
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
54
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
55
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
56
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
57
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
58
|
+
}
|
|
59
|
+
import process2 from "node:process";
|
|
60
|
+
import { fileURLToPath } from "node:url";
|
|
61
|
+
// src/utils/command.ts
|
|
62
|
+
import boxen from "boxen";
|
|
63
|
+
import chalk from "chalk";
|
|
64
|
+
import { exec } from "node:child_process";
|
|
65
|
+
import process from "node:process";
|
|
66
|
+
import * as util from "node:util";
|
|
67
|
+
// src/utils/package.ts
|
|
68
|
+
import fetch from "node-fetch";
|
|
69
|
+
// src/utils/path.ts
|
|
70
|
+
import * as path from "node:path";
|
|
71
|
+
function resolveCyberSkillPath() {
|
|
72
|
+
for(var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++){
|
|
73
|
+
urls[_key] = arguments[_key];
|
|
74
|
+
}
|
|
75
|
+
var _path;
|
|
76
|
+
return (_path = path).resolve.apply(_path, [
|
|
77
|
+
CYBERSKILL_DIRECTORY
|
|
78
|
+
].concat(_to_consumable_array(urls)));
|
|
79
|
+
}
|
|
80
|
+
function resolveWorkingPath() {
|
|
81
|
+
for(var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++){
|
|
82
|
+
urls[_key] = arguments[_key];
|
|
83
|
+
}
|
|
84
|
+
var _path;
|
|
85
|
+
return (_path = path).resolve.apply(_path, [
|
|
86
|
+
WORKING_DIRECTORY
|
|
87
|
+
].concat(_to_consumable_array(urls)));
|
|
88
|
+
}
|
|
89
|
+
function resolve2() {
|
|
90
|
+
for(var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++){
|
|
91
|
+
urls[_key] = arguments[_key];
|
|
92
|
+
}
|
|
93
|
+
var _path;
|
|
94
|
+
return (_path = path).resolve.apply(_path, _to_consumable_array(urls));
|
|
95
|
+
}
|
|
96
|
+
function dirname2(url) {
|
|
97
|
+
return path.dirname(url);
|
|
98
|
+
}
|
|
99
|
+
// src/utils/storage-server.ts
|
|
100
|
+
import nodePersist from "node-persist";
|
|
101
|
+
// src/utils/package.ts
|
|
102
|
+
var CACHE_EXPIRATION_MS = 24 * 60 * 60 * 1e3;
|
|
103
|
+
// src/utils/command.ts
|
|
104
|
+
var DEBUG = process.env.DEBUG === "true";
|
|
105
|
+
var execPromise = util.promisify(exec);
|
|
106
|
+
var gray = chalk.gray, blue = chalk.blue;
|
|
107
|
+
var commandFormatter = {
|
|
108
|
+
raw: function(cmd) {
|
|
109
|
+
return {
|
|
110
|
+
raw: true,
|
|
111
|
+
cmd: cmd
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
isRaw: function isRaw(cmd) {
|
|
115
|
+
return (typeof cmd === "undefined" ? "undefined" : _type_of(cmd)) === "object" && cmd !== null && cmd.raw === true;
|
|
116
|
+
},
|
|
117
|
+
format: function format(command, context) {
|
|
118
|
+
if (typeof command === "function") {
|
|
119
|
+
return commandFormatter.formatCLI(command(context), context);
|
|
120
|
+
}
|
|
121
|
+
if (commandFormatter.isRaw(command)) {
|
|
122
|
+
return command.cmd;
|
|
123
|
+
}
|
|
124
|
+
return commandFormatter.formatCLI(command, context);
|
|
125
|
+
},
|
|
126
|
+
formatCLI: function formatCLI(command, context) {
|
|
127
|
+
if (context === null || context === void 0 ? void 0 : context.isRemote) {
|
|
128
|
+
return "".concat(PNPM_DLX_CLI, " ").concat(CYBERSKILL_PACKAGE_NAME, " ").concat(command);
|
|
129
|
+
}
|
|
130
|
+
if (context === null || context === void 0 ? void 0 : context.isCurrentProject) {
|
|
131
|
+
return "".concat(PNPM_EXEC_CLI, " ").concat(TSX_CLI, " src/cli.ts ").concat(command);
|
|
132
|
+
}
|
|
133
|
+
return "".concat(PNPM_EXEC_CLI, " ").concat(CYBERSKILL_CLI, " ").concat(command);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
// src/constants/path.ts
|
|
137
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
138
|
+
var __dirname2 = dirname2(__filename2);
|
|
139
|
+
var CYBERSKILL_DIRECTORY = resolve2(__dirname2, "../../");
|
|
140
|
+
var WORKING_DIRECTORY = process2.env.INIT_CWD || process2.cwd();
|
|
141
|
+
var CYBERSKILL_PACKAGE_NAME = "@cyberskill/shared";
|
|
142
|
+
var CYBERSKILL_STORAGE = ".cyberskill-storage";
|
|
143
|
+
var NODE_MODULES = "node_modules";
|
|
144
|
+
var BUILD_DIRECTORY = "dist";
|
|
145
|
+
var PACKAGE_JSON = "package.json";
|
|
146
|
+
var PACKAGE_LOCK_JSON = "package-lock.json";
|
|
147
|
+
var TSCONFIG_JSON = "tsconfig.json";
|
|
148
|
+
var GIT_IGNORE = ".gitignore";
|
|
149
|
+
var SIMPLE_GIT_HOOK_JSON = ".simple-git-hooks.json";
|
|
150
|
+
var PNPM_LOCK_YAML = "pnpm-lock.yaml";
|
|
151
|
+
var GIT_HOOK = ".git/hooks";
|
|
152
|
+
var GIT_COMMIT_EDITMSG = ".git/COMMIT_EDITMSG";
|
|
153
|
+
var CYBERSKILL_CLI = "cyberskill";
|
|
154
|
+
var ESLINT_CLI = "eslint";
|
|
155
|
+
var VITEST_CLI = "vitest";
|
|
156
|
+
var COMMIT_LINT_CLI = "commitlint";
|
|
157
|
+
var LINT_STAGED_CLI = "lint-staged";
|
|
158
|
+
var RIMRAF_CLI = "rimraf";
|
|
159
|
+
var TSC_CLI = "tsc";
|
|
160
|
+
var TSX_CLI = "tsx";
|
|
161
|
+
var GIT_CLI = "git";
|
|
162
|
+
var PNPM_CLI = "pnpm";
|
|
163
|
+
var PNPM_DLX_CLI = "pnpm dlx";
|
|
164
|
+
var PNPM_EXEC_CLI = "pnpm exec";
|
|
165
|
+
var SIMPLE_GIT_HOOK_CLI = "simple-git-hooks";
|
|
166
|
+
var ESLINT_INSPECT_CLI = "@eslint/config-inspector";
|
|
167
|
+
var NODE_MODULES_INSPECT_CLI = "node_modules-inspect";
|
|
168
|
+
var PATH = {
|
|
169
|
+
CYBERSKILL_DIRECTORY: CYBERSKILL_DIRECTORY,
|
|
170
|
+
WORKING_DIRECTORY: WORKING_DIRECTORY,
|
|
171
|
+
TS_CONFIG: resolveWorkingPath(TSCONFIG_JSON),
|
|
172
|
+
GIT_IGNORE: resolveWorkingPath(GIT_IGNORE),
|
|
173
|
+
GIT_HOOK: resolveWorkingPath(GIT_HOOK),
|
|
174
|
+
GIT_COMMIT_MSG: resolveWorkingPath(GIT_COMMIT_EDITMSG),
|
|
175
|
+
SIMPLE_GIT_HOOKS: resolveWorkingPath(SIMPLE_GIT_HOOK_JSON),
|
|
176
|
+
PACKAGE_JSON: resolveWorkingPath(PACKAGE_JSON),
|
|
177
|
+
PACKAGE_LOCK_JSON: resolveWorkingPath(PACKAGE_LOCK_JSON),
|
|
178
|
+
PNPM_LOCK_YAML: resolveWorkingPath(PNPM_LOCK_YAML),
|
|
179
|
+
NODE_MODULES: resolveWorkingPath(NODE_MODULES),
|
|
180
|
+
CYBERSKILL: {
|
|
181
|
+
LINT_STAGED_CONFIG: resolveCyberSkillPath("./configs/lint-staged/base.js"),
|
|
182
|
+
COMMITLINT_CONFIG: resolveCyberSkillPath("./configs/commitlint/base.js"),
|
|
183
|
+
UNIT_TEST_CONFIG: resolveCyberSkillPath("./configs/vitest/react/unit.js"),
|
|
184
|
+
E2E_TEST_CONFIG: resolveCyberSkillPath("./configs/vitest/react/e2e.js")
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
function HOOK(param) {
|
|
188
|
+
var isCurrentProject = param.isCurrentProject;
|
|
189
|
+
return _object_spread({
|
|
190
|
+
"postinstall": "setup",
|
|
191
|
+
"pre-commit": LINT_STAGED_CLI,
|
|
192
|
+
"commit-msg": COMMIT_LINT_CLI
|
|
193
|
+
}, isCurrentProject && {
|
|
194
|
+
"pre-push": commandFormatter.raw("".concat(GIT_CLI, " pull"))
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
var COMMAND = {
|
|
198
|
+
SIMPLE_GIT_HOOKS: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(SIMPLE_GIT_HOOK_CLI)),
|
|
199
|
+
ESLINT_INSPECT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(ESLINT_INSPECT_CLI)),
|
|
200
|
+
NODE_MODULES_INSPECT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(NODE_MODULES_INSPECT_CLI)),
|
|
201
|
+
RESET: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(RIMRAF_CLI, " ").concat(NODE_MODULES, " ").concat(PNPM_LOCK_YAML)),
|
|
202
|
+
ESLINT_CHECK: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(ESLINT_CLI, " ").concat(PATH.WORKING_DIRECTORY)),
|
|
203
|
+
ESLINT_FIX: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(ESLINT_CLI, " ").concat(PATH.WORKING_DIRECTORY, " --fix")),
|
|
204
|
+
TYPESCRIPT_CHECK: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(TSC_CLI, " -p ").concat(PATH.TS_CONFIG, " --noEmit")),
|
|
205
|
+
CYBERSKILL: {
|
|
206
|
+
TEST_UNIT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(VITEST_CLI, " --config ").concat(PATH.CYBERSKILL.UNIT_TEST_CONFIG)),
|
|
207
|
+
TEST_E2E: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(VITEST_CLI, " --config ").concat(PATH.CYBERSKILL.E2E_TEST_CONFIG)),
|
|
208
|
+
COMMIT_LINT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(COMMIT_LINT_CLI, " --edit ").concat(PATH.GIT_COMMIT_MSG, " --config ").concat(PATH.CYBERSKILL.COMMITLINT_CONFIG)),
|
|
209
|
+
LINT_STAGED: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(LINT_STAGED_CLI, " --config ").concat(PATH.CYBERSKILL.LINT_STAGED_CONFIG))
|
|
210
|
+
},
|
|
211
|
+
CONFIGURE_GIT_HOOK: commandFormatter.raw("".concat(GIT_CLI, " config core.hooksPath ").concat(PATH.GIT_HOOK)),
|
|
212
|
+
BUILD: commandFormatter.raw("".concat(PNPM_CLI, " run build")),
|
|
213
|
+
STAGE_BUILD_DIRECTORY: commandFormatter.raw("".concat(GIT_CLI, " add ").concat(BUILD_DIRECTORY)),
|
|
214
|
+
PNPM_INSTALL_STANDARD: commandFormatter.raw("".concat(PNPM_CLI, " install")),
|
|
215
|
+
PNPM_INSTALL_LEGACY: commandFormatter.raw("".concat(PNPM_CLI, " install --legacy-peer-deps")),
|
|
216
|
+
PNPM_INSTALL_FORCE: commandFormatter.raw("".concat(PNPM_CLI, " install --force"))
|
|
217
|
+
};
|
|
218
|
+
// src/constants/response-status.ts
|
|
219
|
+
var RESPONSE_STATUS = {
|
|
220
|
+
GRAPHQL_PARSE_FAILED: {
|
|
221
|
+
CODE: "GRAPHQL_PARSE_FAILED",
|
|
222
|
+
MESSAGE: "The GraphQL operation string contains a syntax error."
|
|
223
|
+
},
|
|
224
|
+
GRAPHQL_VALIDATION_FAILED: {
|
|
225
|
+
CODE: "GRAPHQL_VALIDATION_FAILED",
|
|
226
|
+
MESSAGE: "The GraphQL operation is not valid against the server's schema."
|
|
227
|
+
},
|
|
228
|
+
BAD_USER_INPUT: {
|
|
229
|
+
CODE: "BAD_USER_INPUT",
|
|
230
|
+
MESSAGE: "The GraphQL operation includes an invalid value for a field argument."
|
|
231
|
+
},
|
|
232
|
+
PERSISTED_QUERY_NOT_FOUND: {
|
|
233
|
+
CODE: "PERSISTED_QUERY_NOT_FOUND",
|
|
234
|
+
MESSAGE: "A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."
|
|
235
|
+
},
|
|
236
|
+
PERSISTED_QUERY_NOT_SUPPORTED: {
|
|
237
|
+
CODE: "PERSISTED_QUERY_NOT_SUPPORTED",
|
|
238
|
+
MESSAGE: "A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."
|
|
239
|
+
},
|
|
240
|
+
OPERATION_RESOLUTION_FAILURE: {
|
|
241
|
+
CODE: "OPERATION_RESOLUTION_FAILURE",
|
|
242
|
+
MESSAGE: "The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."
|
|
243
|
+
},
|
|
244
|
+
CONTINUE: {
|
|
245
|
+
CODE: 100,
|
|
246
|
+
MESSAGE: "Continue"
|
|
247
|
+
},
|
|
248
|
+
SWITCHING_PROTOCOLS: {
|
|
249
|
+
CODE: 101,
|
|
250
|
+
MESSAGE: "Switching Protocols"
|
|
251
|
+
},
|
|
252
|
+
PROCESSING: {
|
|
253
|
+
CODE: 102,
|
|
254
|
+
MESSAGE: "Processing"
|
|
255
|
+
},
|
|
256
|
+
OK: {
|
|
257
|
+
CODE: 200,
|
|
258
|
+
MESSAGE: "OK"
|
|
259
|
+
},
|
|
260
|
+
CREATED: {
|
|
261
|
+
CODE: 201,
|
|
262
|
+
MESSAGE: "Created"
|
|
263
|
+
},
|
|
264
|
+
ACCEPTED: {
|
|
265
|
+
CODE: 202,
|
|
266
|
+
MESSAGE: "Accepted"
|
|
267
|
+
},
|
|
268
|
+
NON_AUTHORITATIVE_INFORMATION: {
|
|
269
|
+
CODE: 203,
|
|
270
|
+
MESSAGE: "Non Authoritative Information"
|
|
271
|
+
},
|
|
272
|
+
NO_CONTENT: {
|
|
273
|
+
CODE: 204,
|
|
274
|
+
MESSAGE: "No Content"
|
|
275
|
+
},
|
|
276
|
+
RESET_CONTENT: {
|
|
277
|
+
CODE: 205,
|
|
278
|
+
MESSAGE: "Reset Content"
|
|
279
|
+
},
|
|
280
|
+
PARTIAL_CONTENT: {
|
|
281
|
+
CODE: 206,
|
|
282
|
+
MESSAGE: "Partial Content"
|
|
283
|
+
},
|
|
284
|
+
MULTI_STATUS: {
|
|
285
|
+
CODE: 207,
|
|
286
|
+
MESSAGE: "Multi-Status"
|
|
287
|
+
},
|
|
288
|
+
MULTIPLE_CHOICES: {
|
|
289
|
+
CODE: 300,
|
|
290
|
+
MESSAGE: "Multiple Choices"
|
|
291
|
+
},
|
|
292
|
+
MOVED_PERMANENTLY: {
|
|
293
|
+
CODE: 301,
|
|
294
|
+
MESSAGE: "Moved Permanently"
|
|
295
|
+
},
|
|
296
|
+
MOVED_TEMPORARILY: {
|
|
297
|
+
CODE: 302,
|
|
298
|
+
MESSAGE: "Moved Temporarily"
|
|
299
|
+
},
|
|
300
|
+
SEE_OTHER: {
|
|
301
|
+
CODE: 303,
|
|
302
|
+
MESSAGE: "See Other"
|
|
303
|
+
},
|
|
304
|
+
NOT_MODIFIED: {
|
|
305
|
+
CODE: 304,
|
|
306
|
+
MESSAGE: "Not Modified"
|
|
307
|
+
},
|
|
308
|
+
USE_PROXY: {
|
|
309
|
+
CODE: 305,
|
|
310
|
+
MESSAGE: "Use Proxy"
|
|
311
|
+
},
|
|
312
|
+
TEMPORARY_REDIRECT: {
|
|
313
|
+
CODE: 307,
|
|
314
|
+
MESSAGE: "Temporary Redirect"
|
|
315
|
+
},
|
|
316
|
+
PERMANENT_REDIRECT: {
|
|
317
|
+
CODE: 308,
|
|
318
|
+
MESSAGE: "Permanent Redirect"
|
|
319
|
+
},
|
|
320
|
+
BAD_REQUEST: {
|
|
321
|
+
CODE: 400,
|
|
322
|
+
MESSAGE: "Bad Request"
|
|
323
|
+
},
|
|
324
|
+
UNAUTHORIZED: {
|
|
325
|
+
CODE: 401,
|
|
326
|
+
MESSAGE: "Unauthorized"
|
|
327
|
+
},
|
|
328
|
+
PAYMENT_REQUIRED: {
|
|
329
|
+
CODE: 402,
|
|
330
|
+
MESSAGE: "Payment Required"
|
|
331
|
+
},
|
|
332
|
+
FORBIDDEN: {
|
|
333
|
+
CODE: 403,
|
|
334
|
+
MESSAGE: "Forbidden"
|
|
335
|
+
},
|
|
336
|
+
NOT_FOUND: {
|
|
337
|
+
CODE: 404,
|
|
338
|
+
MESSAGE: "Not Found"
|
|
339
|
+
},
|
|
340
|
+
METHOD_NOT_ALLOWED: {
|
|
341
|
+
CODE: 405,
|
|
342
|
+
MESSAGE: "Method Not Allowed"
|
|
343
|
+
},
|
|
344
|
+
NOT_ACCEPTABLE: {
|
|
345
|
+
CODE: 406,
|
|
346
|
+
MESSAGE: "Not Acceptable"
|
|
347
|
+
},
|
|
348
|
+
PROXY_AUTHENTICATION_REQUIRED: {
|
|
349
|
+
CODE: 407,
|
|
350
|
+
MESSAGE: "Proxy Authentication Required"
|
|
351
|
+
},
|
|
352
|
+
REQUEST_TIMEOUT: {
|
|
353
|
+
CODE: 408,
|
|
354
|
+
MESSAGE: "Request Timeout"
|
|
355
|
+
},
|
|
356
|
+
CONFLICT: {
|
|
357
|
+
CODE: 409,
|
|
358
|
+
MESSAGE: "Conflict"
|
|
359
|
+
},
|
|
360
|
+
GONE: {
|
|
361
|
+
CODE: 410,
|
|
362
|
+
MESSAGE: "Gone"
|
|
363
|
+
},
|
|
364
|
+
LENGTH_REQUIRED: {
|
|
365
|
+
CODE: 411,
|
|
366
|
+
MESSAGE: "Length Required"
|
|
367
|
+
},
|
|
368
|
+
PRECONDITION_FAILED: {
|
|
369
|
+
CODE: 412,
|
|
370
|
+
MESSAGE: "Precondition Failed"
|
|
371
|
+
},
|
|
372
|
+
REQUEST_TOO_LONG: {
|
|
373
|
+
CODE: 413,
|
|
374
|
+
MESSAGE: "Request Entity Too Large"
|
|
375
|
+
},
|
|
376
|
+
REQUEST_URI_TOO_LONG: {
|
|
377
|
+
CODE: 414,
|
|
378
|
+
MESSAGE: "Request-URI Too Long"
|
|
379
|
+
},
|
|
380
|
+
UNSUPPORTED_MEDIA_TYPE: {
|
|
381
|
+
CODE: 415,
|
|
382
|
+
MESSAGE: "Unsupported Media Type"
|
|
383
|
+
},
|
|
384
|
+
REQUESTED_RANGE_NOT_SATISFIABLE: {
|
|
385
|
+
CODE: 416,
|
|
386
|
+
MESSAGE: "Requested Range Not Satisfiable"
|
|
387
|
+
},
|
|
388
|
+
EXPECTATION_FAILED: {
|
|
389
|
+
CODE: 417,
|
|
390
|
+
MESSAGE: "Expectation Failed"
|
|
391
|
+
},
|
|
392
|
+
IM_A_TEAPOT: {
|
|
393
|
+
CODE: 418,
|
|
394
|
+
MESSAGE: "I'm a teapot"
|
|
395
|
+
},
|
|
396
|
+
INSUFFICIENT_SPACE_ON_RESOURCE: {
|
|
397
|
+
CODE: 419,
|
|
398
|
+
MESSAGE: "Insufficient Space on Resource"
|
|
399
|
+
},
|
|
400
|
+
METHOD_FAILURE: {
|
|
401
|
+
CODE: 420,
|
|
402
|
+
MESSAGE: "Method Failure"
|
|
403
|
+
},
|
|
404
|
+
MISDIRECTED_REQUEST: {
|
|
405
|
+
CODE: 421,
|
|
406
|
+
MESSAGE: "Misdirected Request"
|
|
407
|
+
},
|
|
408
|
+
UNPROCESSABLE_ENTITY: {
|
|
409
|
+
CODE: 422,
|
|
410
|
+
MESSAGE: "Unprocessable Entity"
|
|
411
|
+
},
|
|
412
|
+
LOCKED: {
|
|
413
|
+
CODE: 423,
|
|
414
|
+
MESSAGE: "Locked"
|
|
415
|
+
},
|
|
416
|
+
FAILED_DEPENDENCY: {
|
|
417
|
+
CODE: 424,
|
|
418
|
+
MESSAGE: "Failed Dependency"
|
|
419
|
+
},
|
|
420
|
+
PRECONDITION_REQUIRED: {
|
|
421
|
+
CODE: 428,
|
|
422
|
+
MESSAGE: "Precondition Required"
|
|
423
|
+
},
|
|
424
|
+
TOO_MANY_REQUESTS: {
|
|
425
|
+
CODE: 429,
|
|
426
|
+
MESSAGE: "Too Many Requests"
|
|
427
|
+
},
|
|
428
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE: {
|
|
429
|
+
CODE: 431,
|
|
430
|
+
MESSAGE: "Request Header Fields Too Large"
|
|
431
|
+
},
|
|
432
|
+
UNAVAILABLE_FOR_LEGAL_REASONS: {
|
|
433
|
+
CODE: 451,
|
|
434
|
+
MESSAGE: "Unavailable For Legal Reasons"
|
|
435
|
+
},
|
|
436
|
+
INTERNAL_SERVER_ERROR: {
|
|
437
|
+
CODE: 500,
|
|
438
|
+
MESSAGE: "Internal Server Error"
|
|
439
|
+
},
|
|
440
|
+
NOT_IMPLEMENTED: {
|
|
441
|
+
CODE: 501,
|
|
442
|
+
MESSAGE: "Not Implemented"
|
|
443
|
+
},
|
|
444
|
+
BAD_GATEWAY: {
|
|
445
|
+
CODE: 502,
|
|
446
|
+
MESSAGE: "Bad Gateway"
|
|
447
|
+
},
|
|
448
|
+
SERVICE_UNAVAILABLE: {
|
|
449
|
+
CODE: 503,
|
|
450
|
+
MESSAGE: "Service Unavailable"
|
|
451
|
+
},
|
|
452
|
+
GATEWAY_TIMEOUT: {
|
|
453
|
+
CODE: 504,
|
|
454
|
+
MESSAGE: "Gateway Timeout"
|
|
455
|
+
},
|
|
456
|
+
HTTP_VERSION_NOT_SUPPORTED: {
|
|
457
|
+
CODE: 505,
|
|
458
|
+
MESSAGE: "HTTP Version Not Supported"
|
|
459
|
+
},
|
|
460
|
+
INSUFFICIENT_STORAGE: {
|
|
461
|
+
CODE: 507,
|
|
462
|
+
MESSAGE: "Insufficient Storage"
|
|
463
|
+
},
|
|
464
|
+
NETWORK_AUTHENTICATION_REQUIRED: {
|
|
465
|
+
CODE: 511,
|
|
466
|
+
MESSAGE: "Network Authentication Required"
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
export { BUILD_DIRECTORY, COMMAND, COMMIT_LINT_CLI, CYBERSKILL_CLI, CYBERSKILL_DIRECTORY, CYBERSKILL_PACKAGE_NAME, CYBERSKILL_STORAGE, ESLINT_CLI, ESLINT_INSPECT_CLI, GIT_CLI, GIT_COMMIT_EDITMSG, GIT_HOOK, GIT_IGNORE, HOOK, LINT_STAGED_CLI, NODE_MODULES, NODE_MODULES_INSPECT_CLI, PACKAGE_JSON, PACKAGE_LOCK_JSON, PATH, PNPM_CLI, PNPM_DLX_CLI, PNPM_EXEC_CLI, PNPM_LOCK_YAML, RESPONSE_STATUS, RIMRAF_CLI, SIMPLE_GIT_HOOK_CLI, SIMPLE_GIT_HOOK_JSON, TSCONFIG_JSON, TSC_CLI, TSX_CLI, VITEST_CLI, WORKING_DIRECTORY };
|