@cyberskill/shared 1.46.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/README.md +12 -18
- package/dist/_tsup-dts-rollup.d.cts +413 -31
- package/dist/_tsup-dts-rollup.d.ts +413 -31
- 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 -6
- package/dist/index.d.ts +51 -6
- 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 -5
- package/dist/utils/index-nodejs.d.ts +15 -5
- 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 +19 -16
- package/dist/utils/npm-package.cjs +0 -1
- package/dist/utils/npm-package.d.cts +0 -4
- package/dist/utils/npm-package.d.ts +0 -4
- package/dist/utils/npm-package.js +0 -1
package/dist/constants/path.cjs
CHANGED
|
@@ -1 +1,423 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
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
|
+
var __create = Object.create;
|
|
60
|
+
var __defProp = Object.defineProperty;
|
|
61
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
62
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
63
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
64
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
65
|
+
var __export = function(target, all) {
|
|
66
|
+
for(var name in all)__defProp(target, name, {
|
|
67
|
+
get: all[name],
|
|
68
|
+
enumerable: true
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
var __copyProps = function(to, from, except, desc) {
|
|
72
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
73
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
74
|
+
try {
|
|
75
|
+
var _loop = function() {
|
|
76
|
+
var key = _step.value;
|
|
77
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
78
|
+
get: function() {
|
|
79
|
+
return from[key];
|
|
80
|
+
},
|
|
81
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
85
|
+
} catch (err) {
|
|
86
|
+
_didIteratorError = true;
|
|
87
|
+
_iteratorError = err;
|
|
88
|
+
} finally{
|
|
89
|
+
try {
|
|
90
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
91
|
+
_iterator.return();
|
|
92
|
+
}
|
|
93
|
+
} finally{
|
|
94
|
+
if (_didIteratorError) {
|
|
95
|
+
throw _iteratorError;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return to;
|
|
101
|
+
};
|
|
102
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
103
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
104
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
105
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
106
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
107
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
108
|
+
value: mod,
|
|
109
|
+
enumerable: true
|
|
110
|
+
}) : target, mod);
|
|
111
|
+
};
|
|
112
|
+
var __toCommonJS = function(mod) {
|
|
113
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
114
|
+
value: true
|
|
115
|
+
}), mod);
|
|
116
|
+
};
|
|
117
|
+
// src/constants/path.ts
|
|
118
|
+
var path_exports = {};
|
|
119
|
+
__export(path_exports, {
|
|
120
|
+
BUILD_DIRECTORY: function() {
|
|
121
|
+
return BUILD_DIRECTORY;
|
|
122
|
+
},
|
|
123
|
+
COMMAND: function() {
|
|
124
|
+
return COMMAND;
|
|
125
|
+
},
|
|
126
|
+
COMMIT_LINT_CLI: function() {
|
|
127
|
+
return COMMIT_LINT_CLI;
|
|
128
|
+
},
|
|
129
|
+
CYBERSKILL_CLI: function() {
|
|
130
|
+
return CYBERSKILL_CLI;
|
|
131
|
+
},
|
|
132
|
+
CYBERSKILL_DIRECTORY: function() {
|
|
133
|
+
return CYBERSKILL_DIRECTORY;
|
|
134
|
+
},
|
|
135
|
+
CYBERSKILL_PACKAGE_NAME: function() {
|
|
136
|
+
return CYBERSKILL_PACKAGE_NAME;
|
|
137
|
+
},
|
|
138
|
+
CYBERSKILL_STORAGE: function() {
|
|
139
|
+
return CYBERSKILL_STORAGE;
|
|
140
|
+
},
|
|
141
|
+
ESLINT_CLI: function() {
|
|
142
|
+
return ESLINT_CLI;
|
|
143
|
+
},
|
|
144
|
+
ESLINT_INSPECT_CLI: function() {
|
|
145
|
+
return ESLINT_INSPECT_CLI;
|
|
146
|
+
},
|
|
147
|
+
GIT_CLI: function() {
|
|
148
|
+
return GIT_CLI;
|
|
149
|
+
},
|
|
150
|
+
GIT_COMMIT_EDITMSG: function() {
|
|
151
|
+
return GIT_COMMIT_EDITMSG;
|
|
152
|
+
},
|
|
153
|
+
GIT_HOOK: function() {
|
|
154
|
+
return GIT_HOOK;
|
|
155
|
+
},
|
|
156
|
+
GIT_IGNORE: function() {
|
|
157
|
+
return GIT_IGNORE;
|
|
158
|
+
},
|
|
159
|
+
HOOK: function() {
|
|
160
|
+
return HOOK;
|
|
161
|
+
},
|
|
162
|
+
LINT_STAGED_CLI: function() {
|
|
163
|
+
return LINT_STAGED_CLI;
|
|
164
|
+
},
|
|
165
|
+
NODE_MODULES: function() {
|
|
166
|
+
return NODE_MODULES;
|
|
167
|
+
},
|
|
168
|
+
NODE_MODULES_INSPECT_CLI: function() {
|
|
169
|
+
return NODE_MODULES_INSPECT_CLI;
|
|
170
|
+
},
|
|
171
|
+
PACKAGE_JSON: function() {
|
|
172
|
+
return PACKAGE_JSON;
|
|
173
|
+
},
|
|
174
|
+
PACKAGE_LOCK_JSON: function() {
|
|
175
|
+
return PACKAGE_LOCK_JSON;
|
|
176
|
+
},
|
|
177
|
+
PATH: function() {
|
|
178
|
+
return PATH;
|
|
179
|
+
},
|
|
180
|
+
PNPM_CLI: function() {
|
|
181
|
+
return PNPM_CLI;
|
|
182
|
+
},
|
|
183
|
+
PNPM_DLX_CLI: function() {
|
|
184
|
+
return PNPM_DLX_CLI;
|
|
185
|
+
},
|
|
186
|
+
PNPM_EXEC_CLI: function() {
|
|
187
|
+
return PNPM_EXEC_CLI;
|
|
188
|
+
},
|
|
189
|
+
PNPM_LOCK_YAML: function() {
|
|
190
|
+
return PNPM_LOCK_YAML;
|
|
191
|
+
},
|
|
192
|
+
RIMRAF_CLI: function() {
|
|
193
|
+
return RIMRAF_CLI;
|
|
194
|
+
},
|
|
195
|
+
SIMPLE_GIT_HOOK_CLI: function() {
|
|
196
|
+
return SIMPLE_GIT_HOOK_CLI;
|
|
197
|
+
},
|
|
198
|
+
SIMPLE_GIT_HOOK_JSON: function() {
|
|
199
|
+
return SIMPLE_GIT_HOOK_JSON;
|
|
200
|
+
},
|
|
201
|
+
TSCONFIG_JSON: function() {
|
|
202
|
+
return TSCONFIG_JSON;
|
|
203
|
+
},
|
|
204
|
+
TSC_CLI: function() {
|
|
205
|
+
return TSC_CLI;
|
|
206
|
+
},
|
|
207
|
+
TSX_CLI: function() {
|
|
208
|
+
return TSX_CLI;
|
|
209
|
+
},
|
|
210
|
+
VITEST_CLI: function() {
|
|
211
|
+
return VITEST_CLI;
|
|
212
|
+
},
|
|
213
|
+
WORKING_DIRECTORY: function() {
|
|
214
|
+
return WORKING_DIRECTORY;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
module.exports = __toCommonJS(path_exports);
|
|
218
|
+
// node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.2_@types+node@22.13.15__@swc+core@1.11.16_@swc_2cf618e3551c9a9c667a9bb2a289f06e/node_modules/tsup/assets/cjs_shims.js
|
|
219
|
+
var getImportMetaUrl = function() {
|
|
220
|
+
return typeof document === "undefined" ? new URL("file:".concat(__filename)).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
221
|
+
};
|
|
222
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
223
|
+
// src/constants/path.ts
|
|
224
|
+
var import_node_process3 = __toESM(require("process"), 1);
|
|
225
|
+
var import_node_url = require("url");
|
|
226
|
+
// src/utils/command.ts
|
|
227
|
+
var import_boxen = __toESM(require("boxen"), 1);
|
|
228
|
+
var import_chalk = __toESM(require("chalk"), 1);
|
|
229
|
+
var import_node_child_process = require("child_process");
|
|
230
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
231
|
+
var util = __toESM(require("util"), 1);
|
|
232
|
+
// src/utils/package.ts
|
|
233
|
+
var import_node_fetch = __toESM(require("node-fetch"), 1);
|
|
234
|
+
// src/utils/fs.ts
|
|
235
|
+
var fs = __toESM(require("fs"), 1);
|
|
236
|
+
// src/utils/path.ts
|
|
237
|
+
var import_node_module = require("module");
|
|
238
|
+
var path = __toESM(require("path"), 1);
|
|
239
|
+
function resolveCyberSkillPath() {
|
|
240
|
+
for(var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++){
|
|
241
|
+
urls[_key] = arguments[_key];
|
|
242
|
+
}
|
|
243
|
+
var _path;
|
|
244
|
+
return (_path = path).resolve.apply(_path, [
|
|
245
|
+
CYBERSKILL_DIRECTORY
|
|
246
|
+
].concat(_to_consumable_array(urls)));
|
|
247
|
+
}
|
|
248
|
+
function resolveWorkingPath() {
|
|
249
|
+
for(var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++){
|
|
250
|
+
urls[_key] = arguments[_key];
|
|
251
|
+
}
|
|
252
|
+
var _path;
|
|
253
|
+
return (_path = path).resolve.apply(_path, [
|
|
254
|
+
WORKING_DIRECTORY
|
|
255
|
+
].concat(_to_consumable_array(urls)));
|
|
256
|
+
}
|
|
257
|
+
function resolve2() {
|
|
258
|
+
for(var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++){
|
|
259
|
+
urls[_key] = arguments[_key];
|
|
260
|
+
}
|
|
261
|
+
var _path;
|
|
262
|
+
return (_path = path).resolve.apply(_path, _to_consumable_array(urls));
|
|
263
|
+
}
|
|
264
|
+
function dirname2(url) {
|
|
265
|
+
return path.dirname(url);
|
|
266
|
+
}
|
|
267
|
+
// src/utils/storage-server.ts
|
|
268
|
+
var import_node_persist = __toESM(require("node-persist"), 1);
|
|
269
|
+
var import_node_os = __toESM(require("os"), 1);
|
|
270
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
271
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
272
|
+
// src/utils/package.ts
|
|
273
|
+
var CACHE_EXPIRATION_MS = 24 * 60 * 60 * 1e3;
|
|
274
|
+
// src/utils/command.ts
|
|
275
|
+
var DEBUG = import_node_process2.default.env.DEBUG === "true";
|
|
276
|
+
var execPromise = util.promisify(import_node_child_process.exec);
|
|
277
|
+
var _import_chalk_default = import_chalk.default, gray = _import_chalk_default.gray, blue = _import_chalk_default.blue;
|
|
278
|
+
var commandFormatter = {
|
|
279
|
+
raw: function(cmd) {
|
|
280
|
+
return {
|
|
281
|
+
raw: true,
|
|
282
|
+
cmd: cmd
|
|
283
|
+
};
|
|
284
|
+
},
|
|
285
|
+
isRaw: function isRaw(cmd) {
|
|
286
|
+
return (typeof cmd === "undefined" ? "undefined" : _type_of(cmd)) === "object" && cmd !== null && cmd.raw === true;
|
|
287
|
+
},
|
|
288
|
+
format: function format(command, context) {
|
|
289
|
+
if (typeof command === "function") {
|
|
290
|
+
return commandFormatter.formatCLI(command(context), context);
|
|
291
|
+
}
|
|
292
|
+
if (commandFormatter.isRaw(command)) {
|
|
293
|
+
return command.cmd;
|
|
294
|
+
}
|
|
295
|
+
return commandFormatter.formatCLI(command, context);
|
|
296
|
+
},
|
|
297
|
+
formatCLI: function formatCLI(command, context) {
|
|
298
|
+
if (context === null || context === void 0 ? void 0 : context.isRemote) {
|
|
299
|
+
return "".concat(PNPM_DLX_CLI, " ").concat(CYBERSKILL_PACKAGE_NAME, " ").concat(command);
|
|
300
|
+
}
|
|
301
|
+
if (context === null || context === void 0 ? void 0 : context.isCurrentProject) {
|
|
302
|
+
return "".concat(PNPM_EXEC_CLI, " ").concat(TSX_CLI, " src/cli.ts ").concat(command);
|
|
303
|
+
}
|
|
304
|
+
return "".concat(PNPM_EXEC_CLI, " ").concat(CYBERSKILL_CLI, " ").concat(command);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
// src/constants/path.ts
|
|
308
|
+
var __filename2 = (0, import_node_url.fileURLToPath)(importMetaUrl);
|
|
309
|
+
var __dirname = dirname2(__filename2);
|
|
310
|
+
var CYBERSKILL_DIRECTORY = resolve2(__dirname, "../../");
|
|
311
|
+
var WORKING_DIRECTORY = import_node_process3.default.env.INIT_CWD || import_node_process3.default.cwd();
|
|
312
|
+
var CYBERSKILL_PACKAGE_NAME = "@cyberskill/shared";
|
|
313
|
+
var CYBERSKILL_STORAGE = ".cyberskill-storage";
|
|
314
|
+
var NODE_MODULES = "node_modules";
|
|
315
|
+
var BUILD_DIRECTORY = "dist";
|
|
316
|
+
var PACKAGE_JSON = "package.json";
|
|
317
|
+
var PACKAGE_LOCK_JSON = "package-lock.json";
|
|
318
|
+
var TSCONFIG_JSON = "tsconfig.json";
|
|
319
|
+
var GIT_IGNORE = ".gitignore";
|
|
320
|
+
var SIMPLE_GIT_HOOK_JSON = ".simple-git-hooks.json";
|
|
321
|
+
var PNPM_LOCK_YAML = "pnpm-lock.yaml";
|
|
322
|
+
var GIT_HOOK = ".git/hooks";
|
|
323
|
+
var GIT_COMMIT_EDITMSG = ".git/COMMIT_EDITMSG";
|
|
324
|
+
var CYBERSKILL_CLI = "cyberskill";
|
|
325
|
+
var ESLINT_CLI = "eslint";
|
|
326
|
+
var VITEST_CLI = "vitest";
|
|
327
|
+
var COMMIT_LINT_CLI = "commitlint";
|
|
328
|
+
var LINT_STAGED_CLI = "lint-staged";
|
|
329
|
+
var RIMRAF_CLI = "rimraf";
|
|
330
|
+
var TSC_CLI = "tsc";
|
|
331
|
+
var TSX_CLI = "tsx";
|
|
332
|
+
var GIT_CLI = "git";
|
|
333
|
+
var PNPM_CLI = "pnpm";
|
|
334
|
+
var PNPM_DLX_CLI = "pnpm dlx";
|
|
335
|
+
var PNPM_EXEC_CLI = "pnpm exec";
|
|
336
|
+
var SIMPLE_GIT_HOOK_CLI = "simple-git-hooks";
|
|
337
|
+
var ESLINT_INSPECT_CLI = "@eslint/config-inspector";
|
|
338
|
+
var NODE_MODULES_INSPECT_CLI = "node_modules-inspect";
|
|
339
|
+
var PATH = {
|
|
340
|
+
CYBERSKILL_DIRECTORY: CYBERSKILL_DIRECTORY,
|
|
341
|
+
WORKING_DIRECTORY: WORKING_DIRECTORY,
|
|
342
|
+
TS_CONFIG: resolveWorkingPath(TSCONFIG_JSON),
|
|
343
|
+
GIT_IGNORE: resolveWorkingPath(GIT_IGNORE),
|
|
344
|
+
GIT_HOOK: resolveWorkingPath(GIT_HOOK),
|
|
345
|
+
GIT_COMMIT_MSG: resolveWorkingPath(GIT_COMMIT_EDITMSG),
|
|
346
|
+
SIMPLE_GIT_HOOKS: resolveWorkingPath(SIMPLE_GIT_HOOK_JSON),
|
|
347
|
+
PACKAGE_JSON: resolveWorkingPath(PACKAGE_JSON),
|
|
348
|
+
PACKAGE_LOCK_JSON: resolveWorkingPath(PACKAGE_LOCK_JSON),
|
|
349
|
+
PNPM_LOCK_YAML: resolveWorkingPath(PNPM_LOCK_YAML),
|
|
350
|
+
NODE_MODULES: resolveWorkingPath(NODE_MODULES),
|
|
351
|
+
CYBERSKILL: {
|
|
352
|
+
LINT_STAGED_CONFIG: resolveCyberSkillPath("./configs/lint-staged/base.js"),
|
|
353
|
+
COMMITLINT_CONFIG: resolveCyberSkillPath("./configs/commitlint/base.js"),
|
|
354
|
+
UNIT_TEST_CONFIG: resolveCyberSkillPath("./configs/vitest/react/unit.js"),
|
|
355
|
+
E2E_TEST_CONFIG: resolveCyberSkillPath("./configs/vitest/react/e2e.js")
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
function HOOK(param) {
|
|
359
|
+
var isCurrentProject = param.isCurrentProject;
|
|
360
|
+
return _object_spread({
|
|
361
|
+
"postinstall": "setup",
|
|
362
|
+
"pre-commit": LINT_STAGED_CLI,
|
|
363
|
+
"commit-msg": COMMIT_LINT_CLI
|
|
364
|
+
}, isCurrentProject && {
|
|
365
|
+
"pre-push": commandFormatter.raw("".concat(GIT_CLI, " pull"))
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
var COMMAND = {
|
|
369
|
+
SIMPLE_GIT_HOOKS: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(SIMPLE_GIT_HOOK_CLI)),
|
|
370
|
+
ESLINT_INSPECT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(ESLINT_INSPECT_CLI)),
|
|
371
|
+
NODE_MODULES_INSPECT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(NODE_MODULES_INSPECT_CLI)),
|
|
372
|
+
RESET: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(RIMRAF_CLI, " ").concat(NODE_MODULES, " ").concat(PNPM_LOCK_YAML)),
|
|
373
|
+
ESLINT_CHECK: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(ESLINT_CLI, " ").concat(PATH.WORKING_DIRECTORY)),
|
|
374
|
+
ESLINT_FIX: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(ESLINT_CLI, " ").concat(PATH.WORKING_DIRECTORY, " --fix")),
|
|
375
|
+
TYPESCRIPT_CHECK: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(TSC_CLI, " -p ").concat(PATH.TS_CONFIG, " --noEmit")),
|
|
376
|
+
CYBERSKILL: {
|
|
377
|
+
TEST_UNIT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(VITEST_CLI, " --config ").concat(PATH.CYBERSKILL.UNIT_TEST_CONFIG)),
|
|
378
|
+
TEST_E2E: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(VITEST_CLI, " --config ").concat(PATH.CYBERSKILL.E2E_TEST_CONFIG)),
|
|
379
|
+
COMMIT_LINT: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(COMMIT_LINT_CLI, " --edit ").concat(PATH.GIT_COMMIT_MSG, " --config ").concat(PATH.CYBERSKILL.COMMITLINT_CONFIG)),
|
|
380
|
+
LINT_STAGED: commandFormatter.raw("".concat(PNPM_EXEC_CLI, " ").concat(LINT_STAGED_CLI, " --config ").concat(PATH.CYBERSKILL.LINT_STAGED_CONFIG))
|
|
381
|
+
},
|
|
382
|
+
CONFIGURE_GIT_HOOK: commandFormatter.raw("".concat(GIT_CLI, " config core.hooksPath ").concat(PATH.GIT_HOOK)),
|
|
383
|
+
BUILD: commandFormatter.raw("".concat(PNPM_CLI, " run build")),
|
|
384
|
+
STAGE_BUILD_DIRECTORY: commandFormatter.raw("".concat(GIT_CLI, " add ").concat(BUILD_DIRECTORY)),
|
|
385
|
+
PNPM_INSTALL_STANDARD: commandFormatter.raw("".concat(PNPM_CLI, " install")),
|
|
386
|
+
PNPM_INSTALL_LEGACY: commandFormatter.raw("".concat(PNPM_CLI, " install --legacy-peer-deps")),
|
|
387
|
+
PNPM_INSTALL_FORCE: commandFormatter.raw("".concat(PNPM_CLI, " install --force"))
|
|
388
|
+
};
|
|
389
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
390
|
+
0 && (module.exports = {
|
|
391
|
+
BUILD_DIRECTORY: BUILD_DIRECTORY,
|
|
392
|
+
COMMAND: COMMAND,
|
|
393
|
+
COMMIT_LINT_CLI: COMMIT_LINT_CLI,
|
|
394
|
+
CYBERSKILL_CLI: CYBERSKILL_CLI,
|
|
395
|
+
CYBERSKILL_DIRECTORY: CYBERSKILL_DIRECTORY,
|
|
396
|
+
CYBERSKILL_PACKAGE_NAME: CYBERSKILL_PACKAGE_NAME,
|
|
397
|
+
CYBERSKILL_STORAGE: CYBERSKILL_STORAGE,
|
|
398
|
+
ESLINT_CLI: ESLINT_CLI,
|
|
399
|
+
ESLINT_INSPECT_CLI: ESLINT_INSPECT_CLI,
|
|
400
|
+
GIT_CLI: GIT_CLI,
|
|
401
|
+
GIT_COMMIT_EDITMSG: GIT_COMMIT_EDITMSG,
|
|
402
|
+
GIT_HOOK: GIT_HOOK,
|
|
403
|
+
GIT_IGNORE: GIT_IGNORE,
|
|
404
|
+
HOOK: HOOK,
|
|
405
|
+
LINT_STAGED_CLI: LINT_STAGED_CLI,
|
|
406
|
+
NODE_MODULES: NODE_MODULES,
|
|
407
|
+
NODE_MODULES_INSPECT_CLI: NODE_MODULES_INSPECT_CLI,
|
|
408
|
+
PACKAGE_JSON: PACKAGE_JSON,
|
|
409
|
+
PACKAGE_LOCK_JSON: PACKAGE_LOCK_JSON,
|
|
410
|
+
PATH: PATH,
|
|
411
|
+
PNPM_CLI: PNPM_CLI,
|
|
412
|
+
PNPM_DLX_CLI: PNPM_DLX_CLI,
|
|
413
|
+
PNPM_EXEC_CLI: PNPM_EXEC_CLI,
|
|
414
|
+
PNPM_LOCK_YAML: PNPM_LOCK_YAML,
|
|
415
|
+
RIMRAF_CLI: RIMRAF_CLI,
|
|
416
|
+
SIMPLE_GIT_HOOK_CLI: SIMPLE_GIT_HOOK_CLI,
|
|
417
|
+
SIMPLE_GIT_HOOK_JSON: SIMPLE_GIT_HOOK_JSON,
|
|
418
|
+
TSCONFIG_JSON: TSCONFIG_JSON,
|
|
419
|
+
TSC_CLI: TSC_CLI,
|
|
420
|
+
TSX_CLI: TSX_CLI,
|
|
421
|
+
VITEST_CLI: VITEST_CLI,
|
|
422
|
+
WORKING_DIRECTORY: WORKING_DIRECTORY
|
|
423
|
+
});
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HOOK_alias_2 as HOOK } from '../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { CYBERSKILL_DIRECTORY_alias_2 as CYBERSKILL_DIRECTORY } from '../_tsup-dts-rollup.cjs';
|
|
2
3
|
export { WORKING_DIRECTORY_alias_2 as WORKING_DIRECTORY } from '../_tsup-dts-rollup.cjs';
|
|
4
|
+
export { CYBERSKILL_PACKAGE_NAME_alias_2 as CYBERSKILL_PACKAGE_NAME } from '../_tsup-dts-rollup.cjs';
|
|
5
|
+
export { CYBERSKILL_STORAGE_alias_2 as CYBERSKILL_STORAGE } from '../_tsup-dts-rollup.cjs';
|
|
6
|
+
export { NODE_MODULES_alias_2 as NODE_MODULES } from '../_tsup-dts-rollup.cjs';
|
|
7
|
+
export { BUILD_DIRECTORY_alias_2 as BUILD_DIRECTORY } from '../_tsup-dts-rollup.cjs';
|
|
8
|
+
export { PACKAGE_JSON_alias_2 as PACKAGE_JSON } from '../_tsup-dts-rollup.cjs';
|
|
9
|
+
export { PACKAGE_LOCK_JSON_alias_2 as PACKAGE_LOCK_JSON } from '../_tsup-dts-rollup.cjs';
|
|
10
|
+
export { TSCONFIG_JSON_alias_2 as TSCONFIG_JSON } from '../_tsup-dts-rollup.cjs';
|
|
11
|
+
export { GIT_IGNORE_alias_2 as GIT_IGNORE } from '../_tsup-dts-rollup.cjs';
|
|
12
|
+
export { SIMPLE_GIT_HOOK_JSON_alias_2 as SIMPLE_GIT_HOOK_JSON } from '../_tsup-dts-rollup.cjs';
|
|
13
|
+
export { PNPM_LOCK_YAML_alias_2 as PNPM_LOCK_YAML } from '../_tsup-dts-rollup.cjs';
|
|
14
|
+
export { GIT_HOOK_alias_2 as GIT_HOOK } from '../_tsup-dts-rollup.cjs';
|
|
15
|
+
export { GIT_COMMIT_EDITMSG_alias_2 as GIT_COMMIT_EDITMSG } from '../_tsup-dts-rollup.cjs';
|
|
16
|
+
export { CYBERSKILL_CLI_alias_2 as CYBERSKILL_CLI } from '../_tsup-dts-rollup.cjs';
|
|
17
|
+
export { ESLINT_CLI_alias_2 as ESLINT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
18
|
+
export { VITEST_CLI_alias_2 as VITEST_CLI } from '../_tsup-dts-rollup.cjs';
|
|
19
|
+
export { COMMIT_LINT_CLI_alias_2 as COMMIT_LINT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
20
|
+
export { LINT_STAGED_CLI_alias_2 as LINT_STAGED_CLI } from '../_tsup-dts-rollup.cjs';
|
|
21
|
+
export { RIMRAF_CLI_alias_2 as RIMRAF_CLI } from '../_tsup-dts-rollup.cjs';
|
|
22
|
+
export { TSC_CLI_alias_2 as TSC_CLI } from '../_tsup-dts-rollup.cjs';
|
|
23
|
+
export { TSX_CLI_alias_2 as TSX_CLI } from '../_tsup-dts-rollup.cjs';
|
|
24
|
+
export { GIT_CLI_alias_2 as GIT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
25
|
+
export { PNPM_CLI_alias_2 as PNPM_CLI } from '../_tsup-dts-rollup.cjs';
|
|
26
|
+
export { PNPM_DLX_CLI_alias_2 as PNPM_DLX_CLI } from '../_tsup-dts-rollup.cjs';
|
|
27
|
+
export { PNPM_EXEC_CLI_alias_2 as PNPM_EXEC_CLI } from '../_tsup-dts-rollup.cjs';
|
|
28
|
+
export { SIMPLE_GIT_HOOK_CLI_alias_2 as SIMPLE_GIT_HOOK_CLI } from '../_tsup-dts-rollup.cjs';
|
|
29
|
+
export { ESLINT_INSPECT_CLI_alias_2 as ESLINT_INSPECT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
30
|
+
export { NODE_MODULES_INSPECT_CLI_alias_2 as NODE_MODULES_INSPECT_CLI } from '../_tsup-dts-rollup.cjs';
|
|
31
|
+
export { PATH_alias_2 as PATH } from '../_tsup-dts-rollup.cjs';
|
|
32
|
+
export { COMMAND_alias_2 as COMMAND } from '../_tsup-dts-rollup.cjs';
|
package/dist/constants/path.d.ts
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HOOK_alias_2 as HOOK } from '../_tsup-dts-rollup.js';
|
|
2
|
+
export { CYBERSKILL_DIRECTORY_alias_2 as CYBERSKILL_DIRECTORY } from '../_tsup-dts-rollup.js';
|
|
2
3
|
export { WORKING_DIRECTORY_alias_2 as WORKING_DIRECTORY } from '../_tsup-dts-rollup.js';
|
|
4
|
+
export { CYBERSKILL_PACKAGE_NAME_alias_2 as CYBERSKILL_PACKAGE_NAME } from '../_tsup-dts-rollup.js';
|
|
5
|
+
export { CYBERSKILL_STORAGE_alias_2 as CYBERSKILL_STORAGE } from '../_tsup-dts-rollup.js';
|
|
6
|
+
export { NODE_MODULES_alias_2 as NODE_MODULES } from '../_tsup-dts-rollup.js';
|
|
7
|
+
export { BUILD_DIRECTORY_alias_2 as BUILD_DIRECTORY } from '../_tsup-dts-rollup.js';
|
|
8
|
+
export { PACKAGE_JSON_alias_2 as PACKAGE_JSON } from '../_tsup-dts-rollup.js';
|
|
9
|
+
export { PACKAGE_LOCK_JSON_alias_2 as PACKAGE_LOCK_JSON } from '../_tsup-dts-rollup.js';
|
|
10
|
+
export { TSCONFIG_JSON_alias_2 as TSCONFIG_JSON } from '../_tsup-dts-rollup.js';
|
|
11
|
+
export { GIT_IGNORE_alias_2 as GIT_IGNORE } from '../_tsup-dts-rollup.js';
|
|
12
|
+
export { SIMPLE_GIT_HOOK_JSON_alias_2 as SIMPLE_GIT_HOOK_JSON } from '../_tsup-dts-rollup.js';
|
|
13
|
+
export { PNPM_LOCK_YAML_alias_2 as PNPM_LOCK_YAML } from '../_tsup-dts-rollup.js';
|
|
14
|
+
export { GIT_HOOK_alias_2 as GIT_HOOK } from '../_tsup-dts-rollup.js';
|
|
15
|
+
export { GIT_COMMIT_EDITMSG_alias_2 as GIT_COMMIT_EDITMSG } from '../_tsup-dts-rollup.js';
|
|
16
|
+
export { CYBERSKILL_CLI_alias_2 as CYBERSKILL_CLI } from '../_tsup-dts-rollup.js';
|
|
17
|
+
export { ESLINT_CLI_alias_2 as ESLINT_CLI } from '../_tsup-dts-rollup.js';
|
|
18
|
+
export { VITEST_CLI_alias_2 as VITEST_CLI } from '../_tsup-dts-rollup.js';
|
|
19
|
+
export { COMMIT_LINT_CLI_alias_2 as COMMIT_LINT_CLI } from '../_tsup-dts-rollup.js';
|
|
20
|
+
export { LINT_STAGED_CLI_alias_2 as LINT_STAGED_CLI } from '../_tsup-dts-rollup.js';
|
|
21
|
+
export { RIMRAF_CLI_alias_2 as RIMRAF_CLI } from '../_tsup-dts-rollup.js';
|
|
22
|
+
export { TSC_CLI_alias_2 as TSC_CLI } from '../_tsup-dts-rollup.js';
|
|
23
|
+
export { TSX_CLI_alias_2 as TSX_CLI } from '../_tsup-dts-rollup.js';
|
|
24
|
+
export { GIT_CLI_alias_2 as GIT_CLI } from '../_tsup-dts-rollup.js';
|
|
25
|
+
export { PNPM_CLI_alias_2 as PNPM_CLI } from '../_tsup-dts-rollup.js';
|
|
26
|
+
export { PNPM_DLX_CLI_alias_2 as PNPM_DLX_CLI } from '../_tsup-dts-rollup.js';
|
|
27
|
+
export { PNPM_EXEC_CLI_alias_2 as PNPM_EXEC_CLI } from '../_tsup-dts-rollup.js';
|
|
28
|
+
export { SIMPLE_GIT_HOOK_CLI_alias_2 as SIMPLE_GIT_HOOK_CLI } from '../_tsup-dts-rollup.js';
|
|
29
|
+
export { ESLINT_INSPECT_CLI_alias_2 as ESLINT_INSPECT_CLI } from '../_tsup-dts-rollup.js';
|
|
30
|
+
export { NODE_MODULES_INSPECT_CLI_alias_2 as NODE_MODULES_INSPECT_CLI } from '../_tsup-dts-rollup.js';
|
|
31
|
+
export { PATH_alias_2 as PATH } from '../_tsup-dts-rollup.js';
|
|
32
|
+
export { COMMAND_alias_2 as COMMAND } from '../_tsup-dts-rollup.js';
|