@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
package/dist/configs/index.cjs
CHANGED
|
@@ -1 +1,232 @@
|
|
|
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 _object_without_properties(source, excluded) {
|
|
45
|
+
if (source == null) return {};
|
|
46
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
47
|
+
var key, i;
|
|
48
|
+
if (Object.getOwnPropertySymbols) {
|
|
49
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
50
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
51
|
+
key = sourceSymbolKeys[i];
|
|
52
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
53
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
54
|
+
target[key] = source[key];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
}
|
|
59
|
+
function _object_without_properties_loose(source, excluded) {
|
|
60
|
+
if (source == null) return {};
|
|
61
|
+
var target = {};
|
|
62
|
+
var sourceKeys = Object.keys(source);
|
|
63
|
+
var key, i;
|
|
64
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
65
|
+
key = sourceKeys[i];
|
|
66
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
67
|
+
target[key] = source[key];
|
|
68
|
+
}
|
|
69
|
+
return target;
|
|
70
|
+
}
|
|
71
|
+
function _to_consumable_array(arr) {
|
|
72
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
73
|
+
}
|
|
74
|
+
function _type_of(obj) {
|
|
75
|
+
"@swc/helpers - typeof";
|
|
76
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
77
|
+
}
|
|
78
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
79
|
+
if (!o) return;
|
|
80
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
81
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
82
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
83
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
84
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
85
|
+
}
|
|
86
|
+
var _this = void 0;
|
|
87
|
+
var __create = Object.create;
|
|
88
|
+
var __defProp = Object.defineProperty;
|
|
89
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
90
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
91
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
92
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
93
|
+
var __export = function(target, all) {
|
|
94
|
+
for(var name in all)__defProp(target, name, {
|
|
95
|
+
get: all[name],
|
|
96
|
+
enumerable: true
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
var __copyProps = function(to, from, except, desc) {
|
|
100
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
101
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
102
|
+
try {
|
|
103
|
+
var _loop = function() {
|
|
104
|
+
var key = _step.value;
|
|
105
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
106
|
+
get: function() {
|
|
107
|
+
return from[key];
|
|
108
|
+
},
|
|
109
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
113
|
+
} catch (err) {
|
|
114
|
+
_didIteratorError = true;
|
|
115
|
+
_iteratorError = err;
|
|
116
|
+
} finally{
|
|
117
|
+
try {
|
|
118
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
119
|
+
_iterator.return();
|
|
120
|
+
}
|
|
121
|
+
} finally{
|
|
122
|
+
if (_didIteratorError) {
|
|
123
|
+
throw _iteratorError;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return to;
|
|
129
|
+
};
|
|
130
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
131
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
132
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
133
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
134
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
135
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
136
|
+
value: mod,
|
|
137
|
+
enumerable: true
|
|
138
|
+
}) : target, mod);
|
|
139
|
+
};
|
|
140
|
+
var __toCommonJS = function(mod) {
|
|
141
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
142
|
+
value: true
|
|
143
|
+
}), mod);
|
|
144
|
+
};
|
|
145
|
+
// src/configs/index.ts
|
|
146
|
+
var configs_exports = {};
|
|
147
|
+
__export(configs_exports, {
|
|
148
|
+
default: function() {
|
|
149
|
+
return configs_default;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
module.exports = __toCommonJS(configs_exports);
|
|
153
|
+
var import_eslint_config = __toESM(require("@antfu/eslint-config"), 1);
|
|
154
|
+
// src/utils/config.ts
|
|
155
|
+
function deepMerge() {
|
|
156
|
+
for(var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
157
|
+
configs[_key] = arguments[_key];
|
|
158
|
+
}
|
|
159
|
+
var merge = function(target, source) {
|
|
160
|
+
var result = _object_spread({}, target);
|
|
161
|
+
Object.keys(source).forEach(function(key) {
|
|
162
|
+
if (!Object.hasOwnProperty.call(source, key)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
var sourceValue = source[key];
|
|
166
|
+
var targetValue = result[key];
|
|
167
|
+
if (Array.isArray(sourceValue)) {
|
|
168
|
+
result[key] = _to_consumable_array(/* @__PURE__ */ new Set(_to_consumable_array(Array.isArray(targetValue) ? targetValue : []).concat(_to_consumable_array(sourceValue))));
|
|
169
|
+
} else if ((typeof sourceValue === "undefined" ? "undefined" : _type_of(sourceValue)) === "object" && sourceValue !== null && !Array.isArray(sourceValue)) {
|
|
170
|
+
result[key] = merge((typeof targetValue === "undefined" ? "undefined" : _type_of(targetValue)) === "object" && targetValue !== null && !Array.isArray(targetValue) ? targetValue : {}, sourceValue);
|
|
171
|
+
} else {
|
|
172
|
+
result[key] = sourceValue;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return result;
|
|
176
|
+
};
|
|
177
|
+
return configs.flatMap(function(config2) {
|
|
178
|
+
return Array.isArray(config2) ? config2 : [
|
|
179
|
+
config2
|
|
180
|
+
];
|
|
181
|
+
}).reduce(function(acc, config2) {
|
|
182
|
+
return merge(acc, config2);
|
|
183
|
+
}, {});
|
|
184
|
+
}
|
|
185
|
+
// src/configs/index.ts
|
|
186
|
+
var config = {
|
|
187
|
+
merge: function() {
|
|
188
|
+
var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "eslint";
|
|
189
|
+
for(var _len = arguments.length, configs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
190
|
+
configs[_key - 1] = arguments[_key];
|
|
191
|
+
}
|
|
192
|
+
var mergeConfigs = function() {
|
|
193
|
+
return deepMerge.apply(void 0, _to_consumable_array(configs));
|
|
194
|
+
};
|
|
195
|
+
if (type === "eslint") {
|
|
196
|
+
var _mergeConfigs = mergeConfigs(), ignores = _mergeConfigs.ignores, rest = _object_without_properties(_mergeConfigs, [
|
|
197
|
+
"ignores"
|
|
198
|
+
]);
|
|
199
|
+
var normalizedIgnores = Array.isArray(ignores) && ignores.every(function(item) {
|
|
200
|
+
return typeof item === "string";
|
|
201
|
+
}) ? {
|
|
202
|
+
ignores: ignores
|
|
203
|
+
} : void 0;
|
|
204
|
+
var configArray = [
|
|
205
|
+
rest
|
|
206
|
+
].concat(_to_consumable_array(normalizedIgnores ? [
|
|
207
|
+
normalizedIgnores
|
|
208
|
+
] : []));
|
|
209
|
+
return (0, import_eslint_config.default).apply(_this, [
|
|
210
|
+
{
|
|
211
|
+
stylistic: {
|
|
212
|
+
semi: true,
|
|
213
|
+
indent: 4,
|
|
214
|
+
quotes: "single"
|
|
215
|
+
},
|
|
216
|
+
yaml: false,
|
|
217
|
+
react: true,
|
|
218
|
+
formatters: {
|
|
219
|
+
css: true,
|
|
220
|
+
html: true,
|
|
221
|
+
markdown: "prettier"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
].concat(_to_consumable_array(configArray)));
|
|
225
|
+
}
|
|
226
|
+
if (type === "commitlint" || type === "lint-staged" || type === "vitest") {
|
|
227
|
+
return mergeConfigs();
|
|
228
|
+
}
|
|
229
|
+
throw new Error("Unknown type: ".concat(type));
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
var configs_default = config;
|
package/dist/configs/index.js
CHANGED
|
@@ -1 +1,166 @@
|
|
|
1
|
-
|
|
1
|
+
// src/configs/index.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 _object_without_properties(source, excluded) {
|
|
45
|
+
if (source == null) return {};
|
|
46
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
47
|
+
var key, i;
|
|
48
|
+
if (Object.getOwnPropertySymbols) {
|
|
49
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
50
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
51
|
+
key = sourceSymbolKeys[i];
|
|
52
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
53
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
54
|
+
target[key] = source[key];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
}
|
|
59
|
+
function _object_without_properties_loose(source, excluded) {
|
|
60
|
+
if (source == null) return {};
|
|
61
|
+
var target = {};
|
|
62
|
+
var sourceKeys = Object.keys(source);
|
|
63
|
+
var key, i;
|
|
64
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
65
|
+
key = sourceKeys[i];
|
|
66
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
67
|
+
target[key] = source[key];
|
|
68
|
+
}
|
|
69
|
+
return target;
|
|
70
|
+
}
|
|
71
|
+
function _to_consumable_array(arr) {
|
|
72
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
73
|
+
}
|
|
74
|
+
function _type_of(obj) {
|
|
75
|
+
"@swc/helpers - typeof";
|
|
76
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
77
|
+
}
|
|
78
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
79
|
+
if (!o) return;
|
|
80
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
81
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
82
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
83
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
84
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
85
|
+
}
|
|
86
|
+
import antfu from "@antfu/eslint-config";
|
|
87
|
+
// src/utils/config.ts
|
|
88
|
+
function deepMerge() {
|
|
89
|
+
for(var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
90
|
+
configs[_key] = arguments[_key];
|
|
91
|
+
}
|
|
92
|
+
var merge = function(target, source) {
|
|
93
|
+
var result = _object_spread({}, target);
|
|
94
|
+
Object.keys(source).forEach(function(key) {
|
|
95
|
+
if (!Object.hasOwnProperty.call(source, key)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
var sourceValue = source[key];
|
|
99
|
+
var targetValue = result[key];
|
|
100
|
+
if (Array.isArray(sourceValue)) {
|
|
101
|
+
result[key] = _to_consumable_array(/* @__PURE__ */ new Set(_to_consumable_array(Array.isArray(targetValue) ? targetValue : []).concat(_to_consumable_array(sourceValue))));
|
|
102
|
+
} else if ((typeof sourceValue === "undefined" ? "undefined" : _type_of(sourceValue)) === "object" && sourceValue !== null && !Array.isArray(sourceValue)) {
|
|
103
|
+
result[key] = merge((typeof targetValue === "undefined" ? "undefined" : _type_of(targetValue)) === "object" && targetValue !== null && !Array.isArray(targetValue) ? targetValue : {}, sourceValue);
|
|
104
|
+
} else {
|
|
105
|
+
result[key] = sourceValue;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return result;
|
|
109
|
+
};
|
|
110
|
+
return configs.flatMap(function(config2) {
|
|
111
|
+
return Array.isArray(config2) ? config2 : [
|
|
112
|
+
config2
|
|
113
|
+
];
|
|
114
|
+
}).reduce(function(acc, config2) {
|
|
115
|
+
return merge(acc, config2);
|
|
116
|
+
}, {});
|
|
117
|
+
}
|
|
118
|
+
// src/configs/index.ts
|
|
119
|
+
var config = {
|
|
120
|
+
merge: function() {
|
|
121
|
+
var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "eslint";
|
|
122
|
+
for(var _len = arguments.length, configs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
123
|
+
configs[_key - 1] = arguments[_key];
|
|
124
|
+
}
|
|
125
|
+
var mergeConfigs = function() {
|
|
126
|
+
return deepMerge.apply(void 0, _to_consumable_array(configs));
|
|
127
|
+
};
|
|
128
|
+
if (type === "eslint") {
|
|
129
|
+
var _mergeConfigs = mergeConfigs(), ignores = _mergeConfigs.ignores, rest = _object_without_properties(_mergeConfigs, [
|
|
130
|
+
"ignores"
|
|
131
|
+
]);
|
|
132
|
+
var normalizedIgnores = Array.isArray(ignores) && ignores.every(function(item) {
|
|
133
|
+
return typeof item === "string";
|
|
134
|
+
}) ? {
|
|
135
|
+
ignores: ignores
|
|
136
|
+
} : void 0;
|
|
137
|
+
var configArray = [
|
|
138
|
+
rest
|
|
139
|
+
].concat(_to_consumable_array(normalizedIgnores ? [
|
|
140
|
+
normalizedIgnores
|
|
141
|
+
] : []));
|
|
142
|
+
return antfu.apply(void 0, [
|
|
143
|
+
{
|
|
144
|
+
stylistic: {
|
|
145
|
+
semi: true,
|
|
146
|
+
indent: 4,
|
|
147
|
+
quotes: "single"
|
|
148
|
+
},
|
|
149
|
+
yaml: false,
|
|
150
|
+
react: true,
|
|
151
|
+
formatters: {
|
|
152
|
+
css: true,
|
|
153
|
+
html: true,
|
|
154
|
+
markdown: "prettier"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
].concat(_to_consumable_array(configArray)));
|
|
158
|
+
}
|
|
159
|
+
if (type === "commitlint" || type === "lint-staged" || type === "vitest") {
|
|
160
|
+
return mergeConfigs();
|
|
161
|
+
}
|
|
162
|
+
throw new Error("Unknown type: ".concat(type));
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var configs_default = config;
|
|
166
|
+
export { configs_default as default };
|
|
@@ -1 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
function _type_of(obj) {
|
|
3
|
+
"@swc/helpers - typeof";
|
|
4
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
5
|
+
}
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = function(target, all) {
|
|
11
|
+
for(var name in all)__defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = function(to, from, except, desc) {
|
|
17
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
18
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
19
|
+
try {
|
|
20
|
+
var _loop = function() {
|
|
21
|
+
var key = _step.value;
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[key];
|
|
25
|
+
},
|
|
26
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
30
|
+
} catch (err) {
|
|
31
|
+
_didIteratorError = true;
|
|
32
|
+
_iteratorError = err;
|
|
33
|
+
} finally{
|
|
34
|
+
try {
|
|
35
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
36
|
+
_iterator.return();
|
|
37
|
+
}
|
|
38
|
+
} finally{
|
|
39
|
+
if (_didIteratorError) {
|
|
40
|
+
throw _iteratorError;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = function(mod) {
|
|
48
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
49
|
+
value: true
|
|
50
|
+
}), mod);
|
|
51
|
+
};
|
|
52
|
+
// src/configs/lint-staged/base.ts
|
|
53
|
+
var base_exports = {};
|
|
54
|
+
__export(base_exports, {
|
|
55
|
+
default: function() {
|
|
56
|
+
return base_default;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
module.exports = __toCommonJS(base_exports);
|
|
60
|
+
var base_default = {
|
|
61
|
+
"*": [
|
|
62
|
+
"pnpm exec cyberskill lint:fix"
|
|
63
|
+
]
|
|
64
|
+
};
|
|
@@ -1 +1,128 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function _type_of(obj) {
|
|
31
|
+
"@swc/helpers - typeof";
|
|
32
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
33
|
+
}
|
|
34
|
+
var __create = Object.create;
|
|
35
|
+
var __defProp = Object.defineProperty;
|
|
36
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
37
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
38
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
39
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
40
|
+
var __export = function(target, all) {
|
|
41
|
+
for(var name in all)__defProp(target, name, {
|
|
42
|
+
get: all[name],
|
|
43
|
+
enumerable: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var __copyProps = function(to, from, except, desc) {
|
|
47
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
48
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
49
|
+
try {
|
|
50
|
+
var _loop = function() {
|
|
51
|
+
var key = _step.value;
|
|
52
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
53
|
+
get: function() {
|
|
54
|
+
return from[key];
|
|
55
|
+
},
|
|
56
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
60
|
+
} catch (err) {
|
|
61
|
+
_didIteratorError = true;
|
|
62
|
+
_iteratorError = err;
|
|
63
|
+
} finally{
|
|
64
|
+
try {
|
|
65
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
66
|
+
_iterator.return();
|
|
67
|
+
}
|
|
68
|
+
} finally{
|
|
69
|
+
if (_didIteratorError) {
|
|
70
|
+
throw _iteratorError;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return to;
|
|
76
|
+
};
|
|
77
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
78
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
79
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
80
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
81
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
82
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
83
|
+
value: mod,
|
|
84
|
+
enumerable: true
|
|
85
|
+
}) : target, mod);
|
|
86
|
+
};
|
|
87
|
+
var __toCommonJS = function(mod) {
|
|
88
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
89
|
+
value: true
|
|
90
|
+
}), mod);
|
|
91
|
+
};
|
|
92
|
+
// src/configs/vitest/react/e2e.ts
|
|
93
|
+
var e2e_exports = {};
|
|
94
|
+
__export(e2e_exports, {
|
|
95
|
+
default: function() {
|
|
96
|
+
return e2e_default;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
module.exports = __toCommonJS(e2e_exports);
|
|
100
|
+
var import_plugin_react_swc = __toESM(require("@vitejs/plugin-react-swc"), 1);
|
|
101
|
+
var import_config = require("vitest/config");
|
|
102
|
+
var e2e_default = function(options) {
|
|
103
|
+
return (0, import_config.defineConfig)(_object_spread({
|
|
104
|
+
plugins: [
|
|
105
|
+
(0, import_plugin_react_swc.default)()
|
|
106
|
+
],
|
|
107
|
+
test: {
|
|
108
|
+
include: [
|
|
109
|
+
"**/*.test.e2e.?(c|m)[jt]s?(x)"
|
|
110
|
+
],
|
|
111
|
+
browser: {
|
|
112
|
+
enabled: true,
|
|
113
|
+
provider: "playwright",
|
|
114
|
+
instances: [
|
|
115
|
+
{
|
|
116
|
+
browser: "chromium"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
browser: "firefox"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
browser: "webkit"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, options));
|
|
128
|
+
};
|