@cyberskill/shared 1.95.0 → 1.96.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 +51 -17
- package/dist/_tsup-dts-rollup.d.ts +51 -17
- package/dist/configs/config.util.cjs +1 -1
- package/dist/configs/config.util.js +1 -1
- package/dist/configs/env/env.constant.cjs +1 -0
- package/dist/configs/env/env.constant.d.cts +1 -0
- package/dist/configs/env/env.constant.d.ts +1 -0
- package/dist/configs/env/env.constant.js +1 -0
- package/dist/configs/env/env.d.cjs +1 -0
- package/dist/configs/env/env.d.d.cts +1 -0
- package/dist/configs/env/env.d.d.ts +1 -0
- package/dist/configs/env/env.d.js +0 -0
- package/dist/configs/env/env.type.cjs +1 -0
- package/dist/configs/env/env.type.d.cts +1 -0
- package/dist/configs/env/env.type.d.ts +1 -0
- package/dist/configs/env/env.type.js +0 -0
- package/dist/configs/env/env.util.cjs +1 -0
- package/dist/configs/env/env.util.d.cts +1 -0
- package/dist/configs/env/env.util.d.ts +1 -0
- package/dist/configs/env/env.util.js +1 -0
- package/dist/configs/env/index.cjs +1 -0
- package/dist/configs/env/index.d.cts +3 -0
- package/dist/configs/env/index.d.ts +3 -0
- package/dist/configs/env/index.js +1 -0
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.d.cts +3 -0
- package/dist/configs/index.d.ts +3 -0
- package/dist/configs/index.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.js +1 -1
- package/dist/nodejs/apollo-server/index.cjs +1 -1
- package/dist/nodejs/apollo-server/index.js +1 -1
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/command/command.util.cjs +1 -1
- package/dist/nodejs/command/command.util.js +1 -1
- package/dist/nodejs/command/index.cjs +1 -1
- package/dist/nodejs/command/index.js +1 -1
- package/dist/nodejs/express/express.util.cjs +1 -1
- package/dist/nodejs/express/express.util.d.cts +0 -1
- package/dist/nodejs/express/express.util.d.ts +0 -1
- package/dist/nodejs/express/express.util.js +1 -1
- package/dist/nodejs/express/index.cjs +1 -1
- package/dist/nodejs/express/index.d.cts +0 -1
- package/dist/nodejs/express/index.d.ts +0 -1
- package/dist/nodejs/express/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +4 -2
- package/dist/nodejs/index.d.ts +4 -2
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/log/index.cjs +1 -1
- package/dist/nodejs/log/index.js +1 -1
- package/dist/nodejs/log/log.util.cjs +1 -1
- package/dist/nodejs/log/log.util.js +1 -1
- package/dist/nodejs/mongo/index.cjs +1 -1
- package/dist/nodejs/mongo/index.d.cts +1 -0
- package/dist/nodejs/mongo/index.d.ts +1 -0
- package/dist/nodejs/mongo/index.js +1 -1
- package/dist/nodejs/mongo/migrate.util.cjs +1 -0
- package/dist/nodejs/mongo/migrate.util.d.cts +1 -0
- package/dist/nodejs/mongo/migrate.util.d.ts +1 -0
- package/dist/nodejs/mongo/migrate.util.js +1 -0
- package/dist/nodejs/package/index.cjs +1 -1
- package/dist/nodejs/package/index.js +1 -1
- package/dist/nodejs/package/package.util.cjs +1 -1
- package/dist/nodejs/package/package.util.js +1 -1
- package/dist/nodejs/path/index.cjs +1 -1
- package/dist/nodejs/path/index.d.cts +3 -1
- package/dist/nodejs/path/index.d.ts +3 -1
- package/dist/nodejs/path/index.js +1 -1
- package/dist/nodejs/path/path.constant.cjs +1 -1
- package/dist/nodejs/path/path.constant.d.cts +2 -1
- package/dist/nodejs/path/path.constant.d.ts +2 -1
- package/dist/nodejs/path/path.constant.js +1 -1
- package/dist/nodejs/path/path.util.cjs +1 -1
- package/dist/nodejs/path/path.util.d.cts +1 -0
- package/dist/nodejs/path/path.util.d.ts +1 -0
- package/dist/nodejs/path/path.util.js +1 -1
- package/dist/nodejs/storage/index.cjs +1 -1
- package/dist/nodejs/storage/index.js +1 -1
- package/dist/nodejs/storage/storage.util.cjs +1 -1
- package/dist/nodejs/storage/storage.util.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/vitest/index.cjs +1 -1
- package/dist/react/vitest/index.js +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -1
- package/dist/react/vitest/vitest.unit.js +1 -1
- package/package.json +7 -3
- package/dist/constants/nodejs.cjs +0 -1
- package/dist/constants/nodejs.d.cts +0 -1
- package/dist/constants/nodejs.d.ts +0 -1
- package/dist/constants/nodejs.js +0 -1
|
@@ -13,6 +13,7 @@ import type { ClientSession } from 'mongoose';
|
|
|
13
13
|
import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
14
14
|
import { Collection } from 'mongodb';
|
|
15
15
|
import type { ComponentType } from 'react';
|
|
16
|
+
import { config } from 'migrate-mongo';
|
|
16
17
|
import type consola from 'consola';
|
|
17
18
|
import { Context } from 'react';
|
|
18
19
|
import cors from 'cors';
|
|
@@ -61,7 +62,7 @@ import type { ReactNode } from 'react';
|
|
|
61
62
|
import type { Schema } from 'mongoose';
|
|
62
63
|
import type { SchemaDefinition } from 'mongoose';
|
|
63
64
|
import type { Server } from 'node:http';
|
|
64
|
-
import { SessionOptions } from 'express-session';
|
|
65
|
+
import type { SessionOptions } from 'express-session';
|
|
65
66
|
import { TFunction } from 'i18next';
|
|
66
67
|
import type { Timezone } from 'next-intl';
|
|
67
68
|
import { toast } from 'react-hot-toast';
|
|
@@ -193,6 +194,9 @@ declare const command: {
|
|
|
193
194
|
configureGitHook: () => Promise<string>;
|
|
194
195
|
testUnit: () => Promise<string>;
|
|
195
196
|
testE2e: () => Promise<string>;
|
|
197
|
+
mongoMigrateCreate: (migrateName: string) => Promise<string>;
|
|
198
|
+
mongoMigrateUp: () => Promise<string>;
|
|
199
|
+
mongoMigrateDown: () => Promise<string>;
|
|
196
200
|
commitLint: () => Promise<string>;
|
|
197
201
|
lintStaged: () => Promise<string>;
|
|
198
202
|
stageBuildDirectory: () => Promise<string>;
|
|
@@ -276,16 +280,11 @@ export { CYBERSKILL_PACKAGE_NAME as CYBERSKILL_PACKAGE_NAME_alias_1 }
|
|
|
276
280
|
export { CYBERSKILL_PACKAGE_NAME as CYBERSKILL_PACKAGE_NAME_alias_2 }
|
|
277
281
|
export { CYBERSKILL_PACKAGE_NAME as CYBERSKILL_PACKAGE_NAME_alias_3 }
|
|
278
282
|
|
|
279
|
-
declare const
|
|
280
|
-
export {
|
|
281
|
-
export {
|
|
282
|
-
export {
|
|
283
|
-
export {
|
|
284
|
-
|
|
285
|
-
declare const DEBUG: boolean;
|
|
286
|
-
export { DEBUG }
|
|
287
|
-
export { DEBUG as DEBUG_alias_1 }
|
|
288
|
-
export { DEBUG as DEBUG_alias_2 }
|
|
283
|
+
declare const CYBERSKILL_STORAGE_DIRECTORY = ".cyberskill-storage";
|
|
284
|
+
export { CYBERSKILL_STORAGE_DIRECTORY }
|
|
285
|
+
export { CYBERSKILL_STORAGE_DIRECTORY as CYBERSKILL_STORAGE_DIRECTORY_alias_1 }
|
|
286
|
+
export { CYBERSKILL_STORAGE_DIRECTORY as CYBERSKILL_STORAGE_DIRECTORY_alias_2 }
|
|
287
|
+
export { CYBERSKILL_STORAGE_DIRECTORY as CYBERSKILL_STORAGE_DIRECTORY_alias_3 }
|
|
289
288
|
|
|
290
289
|
declare function deepMerge(...object: T_Object_2[]): T_Object_2;
|
|
291
290
|
export { deepMerge }
|
|
@@ -1548,6 +1547,18 @@ export { generateSlug as generateSlug_alias_1 }
|
|
|
1548
1547
|
export { generateSlug as generateSlug_alias_2 }
|
|
1549
1548
|
export { generateSlug as generateSlug_alias_3 }
|
|
1550
1549
|
|
|
1550
|
+
declare function getCyberSkillDirectory(): string;
|
|
1551
|
+
export { getCyberSkillDirectory }
|
|
1552
|
+
export { getCyberSkillDirectory as getCyberSkillDirectory_alias_1 }
|
|
1553
|
+
export { getCyberSkillDirectory as getCyberSkillDirectory_alias_2 }
|
|
1554
|
+
export { getCyberSkillDirectory as getCyberSkillDirectory_alias_3 }
|
|
1555
|
+
|
|
1556
|
+
declare function getEnv(): I_Environment;
|
|
1557
|
+
export { getEnv }
|
|
1558
|
+
export { getEnv as getEnv_alias_1 }
|
|
1559
|
+
export { getEnv as getEnv_alias_2 }
|
|
1560
|
+
export { getEnv as getEnv_alias_3 }
|
|
1561
|
+
|
|
1551
1562
|
declare function getLatestPackageVersion(packageName: string): Promise<string>;
|
|
1552
1563
|
export { getLatestPackageVersion }
|
|
1553
1564
|
export { getLatestPackageVersion as getLatestPackageVersion_alias_1 }
|
|
@@ -1697,7 +1708,7 @@ export { I_CommandContext as I_CommandContext_alias_3 }
|
|
|
1697
1708
|
|
|
1698
1709
|
declare interface I_CorsOptions {
|
|
1699
1710
|
isDev?: boolean;
|
|
1700
|
-
|
|
1711
|
+
whiteList?: string[];
|
|
1701
1712
|
}
|
|
1702
1713
|
export { I_CorsOptions }
|
|
1703
1714
|
export { I_CorsOptions as I_CorsOptions_alias_1 }
|
|
@@ -1733,6 +1744,16 @@ export { I_DeleteOptionsExtended as I_DeleteOptionsExtended_alias_1 }
|
|
|
1733
1744
|
export { I_DeleteOptionsExtended as I_DeleteOptionsExtended_alias_2 }
|
|
1734
1745
|
export { I_DeleteOptionsExtended as I_DeleteOptionsExtended_alias_3 }
|
|
1735
1746
|
|
|
1747
|
+
declare interface I_Environment {
|
|
1748
|
+
DEBUG: boolean;
|
|
1749
|
+
CWD: string;
|
|
1750
|
+
CYBERSKILL_STORAGE_DIR: string;
|
|
1751
|
+
}
|
|
1752
|
+
export { I_Environment }
|
|
1753
|
+
export { I_Environment as I_Environment_alias_1 }
|
|
1754
|
+
export { I_Environment as I_Environment_alias_2 }
|
|
1755
|
+
export { I_Environment as I_Environment_alias_3 }
|
|
1756
|
+
|
|
1736
1757
|
declare interface I_EslintError {
|
|
1737
1758
|
filePath: string;
|
|
1738
1759
|
messages: Array<{
|
|
@@ -2210,6 +2231,18 @@ export { mergeConfigs }
|
|
|
2210
2231
|
export { mergeConfigs as mergeConfigs_alias_1 }
|
|
2211
2232
|
export { mergeConfigs as mergeConfigs_alias_2 }
|
|
2212
2233
|
|
|
2234
|
+
declare const MIGRATE_MONGO_CLI = "migrate-mongo";
|
|
2235
|
+
export { MIGRATE_MONGO_CLI }
|
|
2236
|
+
export { MIGRATE_MONGO_CLI as MIGRATE_MONGO_CLI_alias_1 }
|
|
2237
|
+
export { MIGRATE_MONGO_CLI as MIGRATE_MONGO_CLI_alias_2 }
|
|
2238
|
+
export { MIGRATE_MONGO_CLI as MIGRATE_MONGO_CLI_alias_3 }
|
|
2239
|
+
|
|
2240
|
+
declare const MIGRATE_MONGO_PACKAGE_NAME = "migrate-mongo";
|
|
2241
|
+
export { MIGRATE_MONGO_PACKAGE_NAME }
|
|
2242
|
+
export { MIGRATE_MONGO_PACKAGE_NAME as MIGRATE_MONGO_PACKAGE_NAME_alias_1 }
|
|
2243
|
+
export { MIGRATE_MONGO_PACKAGE_NAME as MIGRATE_MONGO_PACKAGE_NAME_alias_2 }
|
|
2244
|
+
export { MIGRATE_MONGO_PACKAGE_NAME as MIGRATE_MONGO_PACKAGE_NAME_alias_3 }
|
|
2245
|
+
|
|
2213
2246
|
declare const mongo: {
|
|
2214
2247
|
getDateTime(now?: Date): string;
|
|
2215
2248
|
createGenericFields({ returnDateAs, }?: {
|
|
@@ -2760,17 +2793,18 @@ export { serializer as serializer_alias_1 }
|
|
|
2760
2793
|
export { serializer as serializer_alias_2 }
|
|
2761
2794
|
export { serializer as serializer_alias_3 }
|
|
2762
2795
|
|
|
2763
|
-
export { SessionOptions }
|
|
2764
|
-
export { SessionOptions as SessionOptions_alias_1 }
|
|
2765
|
-
export { SessionOptions as SessionOptions_alias_2 }
|
|
2766
|
-
export { SessionOptions as SessionOptions_alias_3 }
|
|
2767
|
-
|
|
2768
2796
|
declare function setGlobalApolloErrorCallback(callback: (err: ApolloError_2) => void): void;
|
|
2769
2797
|
export { setGlobalApolloErrorCallback }
|
|
2770
2798
|
export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_1 }
|
|
2771
2799
|
export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_2 }
|
|
2772
2800
|
export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_3 }
|
|
2773
2801
|
|
|
2802
|
+
declare function setMongoMigrateConfig(options: config.Config): void;
|
|
2803
|
+
export { setMongoMigrateConfig }
|
|
2804
|
+
export { setMongoMigrateConfig as setMongoMigrateConfig_alias_1 }
|
|
2805
|
+
export { setMongoMigrateConfig as setMongoMigrateConfig_alias_2 }
|
|
2806
|
+
export { setMongoMigrateConfig as setMongoMigrateConfig_alias_3 }
|
|
2807
|
+
|
|
2774
2808
|
declare function setupPackages(packages: string[], options?: {
|
|
2775
2809
|
update?: boolean;
|
|
2776
2810
|
postInstallActions?: (() => Promise<void>)[];
|
|
@@ -13,6 +13,7 @@ import type { ClientSession } from 'mongoose';
|
|
|
13
13
|
import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
14
14
|
import { Collection } from 'mongodb';
|
|
15
15
|
import type { ComponentType } from 'react';
|
|
16
|
+
import { config } from 'migrate-mongo';
|
|
16
17
|
import type consola from 'consola';
|
|
17
18
|
import { Context } from 'react';
|
|
18
19
|
import cors from 'cors';
|
|
@@ -61,7 +62,7 @@ import type { ReactNode } from 'react';
|
|
|
61
62
|
import type { Schema } from 'mongoose';
|
|
62
63
|
import type { SchemaDefinition } from 'mongoose';
|
|
63
64
|
import type { Server } from 'node:http';
|
|
64
|
-
import { SessionOptions } from 'express-session';
|
|
65
|
+
import type { SessionOptions } from 'express-session';
|
|
65
66
|
import { TFunction } from 'i18next';
|
|
66
67
|
import type { Timezone } from 'next-intl';
|
|
67
68
|
import { toast } from 'react-hot-toast';
|
|
@@ -193,6 +194,9 @@ declare const command: {
|
|
|
193
194
|
configureGitHook: () => Promise<string>;
|
|
194
195
|
testUnit: () => Promise<string>;
|
|
195
196
|
testE2e: () => Promise<string>;
|
|
197
|
+
mongoMigrateCreate: (migrateName: string) => Promise<string>;
|
|
198
|
+
mongoMigrateUp: () => Promise<string>;
|
|
199
|
+
mongoMigrateDown: () => Promise<string>;
|
|
196
200
|
commitLint: () => Promise<string>;
|
|
197
201
|
lintStaged: () => Promise<string>;
|
|
198
202
|
stageBuildDirectory: () => Promise<string>;
|
|
@@ -276,16 +280,11 @@ export { CYBERSKILL_PACKAGE_NAME as CYBERSKILL_PACKAGE_NAME_alias_1 }
|
|
|
276
280
|
export { CYBERSKILL_PACKAGE_NAME as CYBERSKILL_PACKAGE_NAME_alias_2 }
|
|
277
281
|
export { CYBERSKILL_PACKAGE_NAME as CYBERSKILL_PACKAGE_NAME_alias_3 }
|
|
278
282
|
|
|
279
|
-
declare const
|
|
280
|
-
export {
|
|
281
|
-
export {
|
|
282
|
-
export {
|
|
283
|
-
export {
|
|
284
|
-
|
|
285
|
-
declare const DEBUG: boolean;
|
|
286
|
-
export { DEBUG }
|
|
287
|
-
export { DEBUG as DEBUG_alias_1 }
|
|
288
|
-
export { DEBUG as DEBUG_alias_2 }
|
|
283
|
+
declare const CYBERSKILL_STORAGE_DIRECTORY = ".cyberskill-storage";
|
|
284
|
+
export { CYBERSKILL_STORAGE_DIRECTORY }
|
|
285
|
+
export { CYBERSKILL_STORAGE_DIRECTORY as CYBERSKILL_STORAGE_DIRECTORY_alias_1 }
|
|
286
|
+
export { CYBERSKILL_STORAGE_DIRECTORY as CYBERSKILL_STORAGE_DIRECTORY_alias_2 }
|
|
287
|
+
export { CYBERSKILL_STORAGE_DIRECTORY as CYBERSKILL_STORAGE_DIRECTORY_alias_3 }
|
|
289
288
|
|
|
290
289
|
declare function deepMerge(...object: T_Object_2[]): T_Object_2;
|
|
291
290
|
export { deepMerge }
|
|
@@ -1548,6 +1547,18 @@ export { generateSlug as generateSlug_alias_1 }
|
|
|
1548
1547
|
export { generateSlug as generateSlug_alias_2 }
|
|
1549
1548
|
export { generateSlug as generateSlug_alias_3 }
|
|
1550
1549
|
|
|
1550
|
+
declare function getCyberSkillDirectory(): string;
|
|
1551
|
+
export { getCyberSkillDirectory }
|
|
1552
|
+
export { getCyberSkillDirectory as getCyberSkillDirectory_alias_1 }
|
|
1553
|
+
export { getCyberSkillDirectory as getCyberSkillDirectory_alias_2 }
|
|
1554
|
+
export { getCyberSkillDirectory as getCyberSkillDirectory_alias_3 }
|
|
1555
|
+
|
|
1556
|
+
declare function getEnv(): I_Environment;
|
|
1557
|
+
export { getEnv }
|
|
1558
|
+
export { getEnv as getEnv_alias_1 }
|
|
1559
|
+
export { getEnv as getEnv_alias_2 }
|
|
1560
|
+
export { getEnv as getEnv_alias_3 }
|
|
1561
|
+
|
|
1551
1562
|
declare function getLatestPackageVersion(packageName: string): Promise<string>;
|
|
1552
1563
|
export { getLatestPackageVersion }
|
|
1553
1564
|
export { getLatestPackageVersion as getLatestPackageVersion_alias_1 }
|
|
@@ -1697,7 +1708,7 @@ export { I_CommandContext as I_CommandContext_alias_3 }
|
|
|
1697
1708
|
|
|
1698
1709
|
declare interface I_CorsOptions {
|
|
1699
1710
|
isDev?: boolean;
|
|
1700
|
-
|
|
1711
|
+
whiteList?: string[];
|
|
1701
1712
|
}
|
|
1702
1713
|
export { I_CorsOptions }
|
|
1703
1714
|
export { I_CorsOptions as I_CorsOptions_alias_1 }
|
|
@@ -1733,6 +1744,16 @@ export { I_DeleteOptionsExtended as I_DeleteOptionsExtended_alias_1 }
|
|
|
1733
1744
|
export { I_DeleteOptionsExtended as I_DeleteOptionsExtended_alias_2 }
|
|
1734
1745
|
export { I_DeleteOptionsExtended as I_DeleteOptionsExtended_alias_3 }
|
|
1735
1746
|
|
|
1747
|
+
declare interface I_Environment {
|
|
1748
|
+
DEBUG: boolean;
|
|
1749
|
+
CWD: string;
|
|
1750
|
+
CYBERSKILL_STORAGE_DIR: string;
|
|
1751
|
+
}
|
|
1752
|
+
export { I_Environment }
|
|
1753
|
+
export { I_Environment as I_Environment_alias_1 }
|
|
1754
|
+
export { I_Environment as I_Environment_alias_2 }
|
|
1755
|
+
export { I_Environment as I_Environment_alias_3 }
|
|
1756
|
+
|
|
1736
1757
|
declare interface I_EslintError {
|
|
1737
1758
|
filePath: string;
|
|
1738
1759
|
messages: Array<{
|
|
@@ -2210,6 +2231,18 @@ export { mergeConfigs }
|
|
|
2210
2231
|
export { mergeConfigs as mergeConfigs_alias_1 }
|
|
2211
2232
|
export { mergeConfigs as mergeConfigs_alias_2 }
|
|
2212
2233
|
|
|
2234
|
+
declare const MIGRATE_MONGO_CLI = "migrate-mongo";
|
|
2235
|
+
export { MIGRATE_MONGO_CLI }
|
|
2236
|
+
export { MIGRATE_MONGO_CLI as MIGRATE_MONGO_CLI_alias_1 }
|
|
2237
|
+
export { MIGRATE_MONGO_CLI as MIGRATE_MONGO_CLI_alias_2 }
|
|
2238
|
+
export { MIGRATE_MONGO_CLI as MIGRATE_MONGO_CLI_alias_3 }
|
|
2239
|
+
|
|
2240
|
+
declare const MIGRATE_MONGO_PACKAGE_NAME = "migrate-mongo";
|
|
2241
|
+
export { MIGRATE_MONGO_PACKAGE_NAME }
|
|
2242
|
+
export { MIGRATE_MONGO_PACKAGE_NAME as MIGRATE_MONGO_PACKAGE_NAME_alias_1 }
|
|
2243
|
+
export { MIGRATE_MONGO_PACKAGE_NAME as MIGRATE_MONGO_PACKAGE_NAME_alias_2 }
|
|
2244
|
+
export { MIGRATE_MONGO_PACKAGE_NAME as MIGRATE_MONGO_PACKAGE_NAME_alias_3 }
|
|
2245
|
+
|
|
2213
2246
|
declare const mongo: {
|
|
2214
2247
|
getDateTime(now?: Date): string;
|
|
2215
2248
|
createGenericFields({ returnDateAs, }?: {
|
|
@@ -2760,17 +2793,18 @@ export { serializer as serializer_alias_1 }
|
|
|
2760
2793
|
export { serializer as serializer_alias_2 }
|
|
2761
2794
|
export { serializer as serializer_alias_3 }
|
|
2762
2795
|
|
|
2763
|
-
export { SessionOptions }
|
|
2764
|
-
export { SessionOptions as SessionOptions_alias_1 }
|
|
2765
|
-
export { SessionOptions as SessionOptions_alias_2 }
|
|
2766
|
-
export { SessionOptions as SessionOptions_alias_3 }
|
|
2767
|
-
|
|
2768
2796
|
declare function setGlobalApolloErrorCallback(callback: (err: ApolloError_2) => void): void;
|
|
2769
2797
|
export { setGlobalApolloErrorCallback }
|
|
2770
2798
|
export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_1 }
|
|
2771
2799
|
export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_2 }
|
|
2772
2800
|
export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_3 }
|
|
2773
2801
|
|
|
2802
|
+
declare function setMongoMigrateConfig(options: config.Config): void;
|
|
2803
|
+
export { setMongoMigrateConfig }
|
|
2804
|
+
export { setMongoMigrateConfig as setMongoMigrateConfig_alias_1 }
|
|
2805
|
+
export { setMongoMigrateConfig as setMongoMigrateConfig_alias_2 }
|
|
2806
|
+
export { setMongoMigrateConfig as setMongoMigrateConfig_alias_3 }
|
|
2807
|
+
|
|
2774
2808
|
declare function setupPackages(packages: string[], options?: {
|
|
2775
2809
|
update?: boolean;
|
|
2776
2810
|
postInstallActions?: (() => Promise<void>)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,a,i){try{var c=e[a](i);var u=c.value}catch(e){r(e);return}if(c.done){t(u)}else{Promise.resolve(u).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,u,"next",e)}function u(e){n(i,o,a,c,u,"throw",e)}c(undefined)})}}function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function i(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,c;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;c=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw c}}return n}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){a(e,t,r[t])})}return e}function f(e,t){if(e==null)return{};var r=d(e,t);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function d(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function p(e,r){return t(e)||c(e,r)||g(e,r)||u()}function v(e){return r(e)||i(e)||g(e)||s()}function y(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function h(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=c(0),i["throw"]=c(1),i["return"]=c(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return u([e,t])}}function u(c){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(a=0)),a)try{if(r=1,n&&(o=c[0]&2?n["return"]:c[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;if(n=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:a.label++;return{value:c[1],done:false};case 5:a.label++;n=c[1];c=[0];continue;case 7:c=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(c[0]===6&&a.label<o[1]){a.label=o[1];o=c;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(c);break}if(o[2])a.ops.pop();a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e];n=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var m=void 0;var b=Object.create;var w=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var T=function(e,t){return w(e,"name",{value:t,configurable:!0})};var _=function(e,t){for(var r in t)w(e,r,{get:t[r],enumerable:!0})},C=function(e,t,r,n){var o=true,a=false,i=undefined;if(t&&(typeof t==="undefined"?"undefined":y(t))=="object"||typeof t=="function")try{var c=function(){var o=s.value;!O.call(e,o)&&o!==r&&w(e,o,{get:function(){return t[o]},enumerable:!(n=I(t,o))||n.enumerable})};for(var u=E(t)[Symbol.iterator](),s;!(o=(s=u.next()).done);o=true)c()}catch(e){a=true;i=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw i}}}return e};var A=function(e,t,r){return r=e!=null?b(S(e)):{},C(t||!e||!e.__esModule?w(r,"default",{value:e,enumerable:!0}):r,e)},j=function(e){return C(w({},"__esModule",{value:!0}),e)};var k={};_(k,{mergeConfigs:function(){return tO}});module.exports=j(k);var N=A(require("@antfu/eslint-config"),1);var L=A(require("@vitejs/plugin-react-swc"),1),P=require("vitest/config");function x(e){return(0,P.defineConfig)(l({plugins:[(0,L.default)()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}T(x,"vitestE2E");var G=A(require("@vitejs/plugin-react-swc"),1),R=require("vitest/config");var D=A(require("process"),1);var F=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});var M=require("child_process"),U=A(require("process"),1),q=A(require("util"),1);var W=A(require("process"),1),J=W.default.env.DEBUG==="true";var K=function(e){return e.Error="error",e.Warning="warning",e}({});var V=A(require("chalk"),1),Y=A(require("consola"),1),B=require("graphql");J||(Y.default.level=4);function H(e){var t=V.default[e];return typeof t=="function"?t:V.default.green}T(H,"chalkKeyword");var $={silent:Y.default.silent,level:Y.default.level,fatal:Y.default.fatal,error:Y.default.error,warn:Y.default.warn,log:Y.default.log,info:Y.default.info,success:Y.default.success,ready:Y.default.ready,start:Y.default.start,box:Y.default.box,debug:Y.default.debug,trace:Y.default.trace,verbose:Y.default.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){Y.default.box(V.default.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,a=e.message;Y.default.log("".concat(V.default.gray("File:")," ").concat(V.default.blue("".concat(t).concat(n?":".concat(n):"")))),o&&Y.default.log(" ".concat(H(r)("Rule:")," ").concat(o)),Y.default.log(" ".concat(H(r)("Message:")," ").concat(a))}),Y.default.box(H(r)("".concat(e," : ").concat(t.length))),Y.default.log(V.default.gray("─".repeat(40)))}};var z={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var Q=A(require("node-fetch"),1);var X=A(require("fs"),1);function Z(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return X.existsSync(e)})}T(Z,"existsSync");function ee(e,t){var r=X.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":y(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}T(ee,"readFileSync");function et(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,o=n===void 0?!1:n,a=o&&(typeof t==="undefined"?"undefined":y(t))=="object"?JSON.stringify(t,null,4):String(t);X.writeFileSync(e,a,"utf-8")}T(et,"writeFileSync");function er(e){var t=eP(ex,eM);if(!Z(t))return!1;try{var r=ee(t,{asJson:!0}),n=r.name,o=r.dependencies,a=o===void 0?{}:o,i=r.devDependencies,c=i===void 0?{}:i,u=n===e,s=e in a,l=e in c;return u||s||l?{path:t,file:r,isCurrentProject:u,isDepend:s,isDevDepend:l}:!1}catch(e){return $.warn("Failed to read package.json: ".concat(e.message)),!1}}T(er,"getPackage");function en(e){return eo.apply(this,arguments)}function eo(){eo=o(function(e){var t,r,n,o;return h(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,(0,Q.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=a.sent(),n=r.version;return[2,n];case 3:o=a.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return eo.apply(this,arguments)}T(en,"getLatestPackageVersion");function ea(e,t){return ei.apply(this,arguments)}function ei(){ei=o(function(e,t){var r,n,o,a,i,c,u,s,f,d,p,v,y,g,m,b,w,I,E,S,O;return h(this,function(h){switch(h.label){case 0:h.trys.push([0,4,,5]);r=er(e);if(!r)return[2,l({},z)];u=r.path,s=r.file,f=r.isCurrentProject,d=r.isDepend,p=r.isDevDepend,v=(n=s.dependencies)!==null&&n!==void 0?n:{},y=(o=s.devDependencies)!==null&&o!==void 0?o:{},g=f?(a=s.version)!==null&&a!==void 0?a:"0.0.0":d?(i=v[e])!==null&&i!==void 0?i:"0.0.0":p?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=g;return[3,3];case 1:return[4,en(e)];case 2:w=h.sent();h.label=3;case 3:m=w,b=f||g===m;if(!b&&(t===null||t===void 0?void 0:t.update)){;E=d?"dependencies":p?"devDependencies":null;E&&((I=s[E])===null||I===void 0?void 0:I[e])!==m&&(s[E]=(S=s[E])!==null&&S!==void 0?S:{},s[E][e]=m,et(u,s,{isJson:!0}),$.info('Updated "'.concat(e,'" to version ').concat(m)))}return[2,{isCurrentProject:f,installedPath:u,file:s,isUpToDate:b}];case 4:O=h.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(O.message)),l({},z))];case 5:return[2]}})});return ei.apply(this,arguments)}T(ea,"checkPackage");function ec(){return eu.apply(this,arguments)}function eu(){eu=o(function(){var e,t,r,n,o,a,i,c,u,s,l,f;return h(this,function(d){switch(d.label){case 0:e=[{command:T(function(){return tf.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:T(function(){return tf.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:T(function(){return tf.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,9,10,11]);o=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];i=a.value,c=i.command,u=i.message;d.label=3;case 3:d.trys.push([3,6,,7]);return[4,c()];case 4:s=d.sent();return[4,ej("".concat(u," using: ").concat(s),s)];case 5:d.sent();return[2];case 6:l=d.sent();$.warn("Installation attempt failed: ".concat(u)),$.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=d.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eu.apply(this,arguments)}T(ec,"installDependencies");function es(e,t){return el.apply(this,arguments)}function el(){el=o(function(e,t){var r,n,o,a,i,c,u,s,f,d,p;return h(this,function(y){switch(y.label){case 0:if(!Z(tc.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}y.label=1;case 1:y.trys.push([1,13,,14]);r=v(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return ea(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=y.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,ec()];case 3:n=y.sent();y.label=4;case 4:n;a=true,i=false,c=undefined;y.label=5;case 5:y.trys.push([5,10,11,12]);u=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();y.label=6;case 6:if(!!(a=(s=u.next()).done))return[3,9];f=s.value;return[4,f()];case 7:y.sent();y.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:d=y.sent();i=true;c=d;return[3,12];case 11:try{if(!a&&u.return!=null){u.return()}}finally{if(i){throw c}}return[7];case 12:return[3,14];case 13:p=y.sent();throw $.error('Failed to setup "'.concat(e.join(", "),'": ').concat(p.message)),p;case 14:return[2]}})});return el.apply(this,arguments)}T(es,"setupPackages");var ef=A(require("node-persist"),1),ed=A(require("os"),1),ep=A(require("process"),1);function ev(){return ep.default.env.CYBERSKILL_STORAGE_DIR||eP(ed.default.homedir(),eR)}T(ev,"getStorageDir");function ey(){return eg.apply(this,arguments)}function eg(){eg=o(function(){var e;return h(this,function(t){switch(t.label){case 0:e=ef.default.defaultInstance;if(e)return[3,2];return[4,ef.default.init({dir:ev(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eg.apply(this,arguments)}T(ey,"initNodePersist");var eh={get:function e(e){return o(function(){var t,r;return h(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ey()];case 1:n.sent();return[4,ef.default.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return h(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ey()];case 1:n.sent();return[4,ef.default.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return h(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ey()];case 1:r.sent();return[4,ef.default.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return h(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ey()];case 1:r.sent();return[4,ef.default.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return h(this,function(t){try{return[2,"".concat(ev()," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var em=q.promisify(M.exec);function eb(e){return"error_list:".concat(e)}T(eb,"getErrorListKey");function ew(e){return eI.apply(this,arguments)}function eI(){eI=o(function(e){var t,r,n;return h(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),r=eb(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,eh.set(r,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return h(this,function(t){switch(t.label){case 0:return[4,eh.getLogLink(r)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=a.sent();$.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return eI.apply(this,arguments)}T(ew,"saveErrorListToStorage");function eE(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,a=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var c,u,s,l,f;var d=o.exec(e)||[],p=a.exec(e)||[],v=i.exec(e)||[];var y,g,h,m,b,w;d.length&&n?t.push({file:n,position:"".concat(d[1],":").concat(d[2]),type:d[3]===K.Error?K.Error:K.Warning,message:(y=d===null||d===void 0?void 0:(c=d[4])===null||c===void 0?void 0:c.trim())!==null&&y!==void 0?y:"",rule:(g=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(h=p===null||p===void 0?void 0:p[1])!==null&&h!==void 0?h:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===K.Error?K.Error:K.Warning,message:(m=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&m!==void 0?m:""}):v.length?t.push({file:"commitlint",type:K.Error,message:(b=v===null||v===void 0?void 0:(l=v[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=v===null||v===void 0?void 0:(f=v[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):r.push(e.trim())}}),t.length&&ew(t),J&&r.length&&($.warn("Unmatched lines:"),r.forEach(function(e){return $.info(" ".concat(e))}))}T(eE,"parseTextErrors");function eS(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,a=e.column,i=e.ruleId,c=e.message;r.push({type:n===2?K.Error:K.Warning,file:t,position:"".concat(o,":").concat(a),rule:i,message:c})})}),r.length&&ew(r)}catch(t){eE(e)}}T(eS,"parseCommandOutput");function eO(e){return eT.apply(this,arguments)}function eT(){eT=o(function(e){var t,r,n,o,a,i,c,u,s;var l=arguments;return h(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eS;r=new AbortController;U.default.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),r.abort(),U.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,em(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,a=n.stderr;[o,a].forEach(function(e){return e&&t(e)});return[3,4];case 3:i=f.sent();c=i.stdout,u=i.stderr,s=i.message;[c,u].forEach(function(e){return e&&t(e)}),!u&&!c&&$.error("Command failed: ".concat(s));return[3,4];case 4:return[2]}})});return eT.apply(this,arguments)}T(eO,"executeCommand");function e_(e){return{raw:!0,cmd:e}}T(e_,"rawCommand");function eC(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(te," ").concat(eG," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(te," ").concat(e8," ").concat(e$," ").concat(e):"".concat(te," ").concat(eH," ").concat(e)}T(eC,"formatCLI");function eA(e,t){return typeof e=="function"?eC(e(t),t):(typeof e==="undefined"?"undefined":y(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eC(e,t):e}T(eA,"formatCommand");function ej(e,t){return ek.apply(this,arguments)}function ek(){ek=o(function(e,t){var r;return h(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);$.start("".concat(e)),J&&$.info("→ ".concat(t));return[4,eO(t)];case 1:n.sent(),$.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw $.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return ek.apply(this,arguments)}T(ej,"runCommand");var eN=A(require("path"),1);function eL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eN).resolve.apply(n,[ex].concat(v(t)))}T(eL,"resolveWorkingPath");function eP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eN).join.apply(n,v(t))}T(eP,"join");var ex=D.default.env.INIT_CWD||D.default.cwd(),eG="@cyberskill/shared",eR=".cyberskill-storage",eD="node_modules",eF="dist",eM="package.json",eU="package-lock.json",eq="tsconfig.json",eW=".gitignore",eJ=".simple-git-hooks.json",eK="pnpm-lock.yaml",eV=".git/hooks/",eY=".git/COMMIT_EDITMSG",eB=eP(ex,eD,eG,eF),eH="cyberskill",e$="src/nodejs/cli/index.ts",ez="eslint",eQ="eslint",eX="vitest",eZ="playwright",e0="vitest",e1="@commitlint/cli",e2="commitlint",e4="lint-staged",e3="lint-staged",e5="typescript",e6="tsc",e8="tsx",e7="git",e9="pnpm",te="pnpm exec",tt="simple-git-hooks",tr="simple-git-hooks",tn="@eslint/config-inspector",to="eslint-config-inspector",ta="node-modules-inspector",ti="node-modules-inspector",tc={CYBERSKILL_DIRECTORY:eB,WORKING_DIRECTORY:ex,TS_CONFIG:eL(eq),GIT_IGNORE:eL(eW),GIT_HOOK:eL(eV),GIT_COMMIT_MSG:eL(eY),SIMPLE_GIT_HOOKS_JSON:eL(eJ),PACKAGE_JSON:eL(eM),PACKAGE_LOCK_JSON:eL(eU),PNPM_LOCK_YAML:eL(eK),NODE_MODULES:eL(eD),LINT_STAGED_CONFIG:eL("".concat(eB,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eL("".concat(eB,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eL("".concat(eB,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eL("".concat(eB,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eL("".concat(eB,"/react/vitest/vitest.e2e.js"))};function tu(e){return ts.apply(this,arguments)}function ts(){ts=o(function(e){var t,r,n,o,a,i;var c=arguments;return h(this,function(u){switch(u.label){case 0:for(t=c.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=c[n]}o=p(r,2),a=o[0],i=o[1];if(!a)throw new Error("'first' argument is undefined");switch(e){case F.CLI:return[3,1];case F.RAW:return[3,3]}return[3,4];case 1:return[4,es(a.split(" "),{update:!0})];case 2:return[2,(u.sent(),eA(e_("".concat(te," ").concat(i))))];case 3:return[2,eA(e_(a))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ts.apply(this,arguments)}T(tu,"buildCommand");function tl(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return h(this,function(t){return[2,tu.apply(void 0,[e].concat(v(r)))]})})}T(tl,"commandFactory");var tf={simpleGitHooks:tl(F.CLI,tt,tr),eslintInspect:tl(F.CLI,tn,to),nodeModulesInspect:tl(F.CLI,ta,ti),eslintCheck:tl(F.CLI,ez,"".concat(eQ," ").concat(tc.WORKING_DIRECTORY)),eslintFix:tl(F.CLI,ez,"".concat(eQ," ").concat(tc.WORKING_DIRECTORY," --fix")),typescriptCheck:tl(F.CLI,e5,"".concat(e6," -p ").concat(tc.TS_CONFIG," --noEmit")),configureGitHook:tl(F.RAW,"".concat(e7," config core.hooksPath ").concat(tc.GIT_HOOK)),testUnit:tl(F.CLI,eX,"".concat(e0," --config ").concat(tc.UNIT_TEST_CONFIG)),testE2e:tl(F.CLI,"".concat(eX," ").concat(eZ),"".concat(e0," --config ").concat(tc.E2E_TEST_CONFIG)),commitLint:tl(F.CLI,e1,"".concat(e2," --edit ").concat(tc.GIT_COMMIT_MSG," --config ").concat(tc.COMMITLINT_CONFIG)),lintStaged:tl(F.CLI,e4,"".concat(e3," --config ").concat(tc.LINT_STAGED_CONFIG)),stageBuildDirectory:tl(F.RAW,"".concat(e7," add ").concat(eF)),build:tl(F.RAW,"".concat(e9," run build")),pnpmInstallStandard:tl(F.RAW,"".concat(e9," install")),pnpmInstallLegacy:tl(F.RAW,"".concat(e9," install --legacy-peer-deps")),pnpmInstallForce:tl(F.RAW,"".concat(e9," install --force"))};function td(e){return(0,R.defineConfig)(l({plugins:[(0,G.default)()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tc.UNIT_TEST_SETUP_CONFIG]}},e))}T(td,"vitestUnit");function tp(e){return!!e&&(typeof e==="undefined"?"undefined":y(e))=="object"&&!Array.isArray(e)}T(tp,"isPlainObject");function tv(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),i;!(r=(i=a.next()).done);r=true){var c=p(i.value,2),u=c[0],s=c[1];var l=e[u];Array.isArray(s)?e[u]=Array.from(new Set(v(Array.isArray(l)?l:[]).concat(v(s)))):tp(s)?e[u]=tv(tp(l)?l:{},s):e[u]=s}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return e},{})}T(tv,"deepMerge");var ty=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});var tg=A(require("globals"),1),th=[{languageOptions:{globals:l({},tg.node,tg.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tm;var tb=T(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tv.apply(void 0,v(t))},"passThroughHandler"),tw=T(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tv.apply(void 0,[th].concat(v(t))),o=n.ignores,a=f(n,["ignores"]),i=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,c=[a].concat(v(i?[i]:[]));return(0,N.default).apply(m,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(v(c)))},"handleESLint"),tI=T(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return x.apply(void 0,v(t))},"handleVitestReactE2E"),tE=T(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return td.apply(void 0,v(t))},"handleVitestReactUnit"),tS=(tm={},a(tm,ty.ESLINT,tw),a(tm,ty.COMMITLINT,tb),a(tm,ty.LINT_STAGED,tb),a(tm,ty.VITEST_REACT_E2E,tI),a(tm,ty.VITEST_REACT_UNIT,tE),tm);function tO(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var o=tS[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,v(r))}T(tO,"mergeConfigs");0&&(module.exports={mergeConfigs:mergeConfigs});
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,a,o,i){try{var c=e[o](i);var u=c.value}catch(e){r(e);return}if(c.done){t(u)}else{Promise.resolve(u).then(n,a)}}function a(e){return function(){var t=this,r=arguments;return new Promise(function(a,o){var i=e.apply(t,r);function c(e){n(i,a,o,c,u,"next",e)}function u(e){n(i,a,o,c,u,"throw",e)}c(undefined)})}}function o(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function i(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,c;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;c=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw c}}return n}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){o(e,t,r[t])})}return e}function f(e,t){if(e==null)return{};var r=d(e,t);var n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++){n=o[a];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function d(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var a,o;for(o=0;o<n.length;o++){a=n[o];if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function p(e,r){return t(e)||c(e,r)||y(e,r)||u()}function v(e){return r(e)||i(e)||y(e)||s()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function h(e,t){var r,n,a,o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=c(0),i["throw"]=c(1),i["return"]=c(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return u([e,t])}}function u(c){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(o=0)),o)try{if(r=1,n&&(a=c[0]&2?n["return"]:c[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;if(n=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;n=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1];a=c;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(c);break}if(a[2])o.ops.pop();o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e];n=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var m=void 0;var b=Object.create;var I=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(e,t){return I(e,"name",{value:t,configurable:!0})};var T=function(e,t){for(var r in t)I(e,r,{get:t[r],enumerable:!0})},_=function(e,t,r,n){var a=true,o=false,i=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var c=function(){var a=s.value;!O.call(e,a)&&a!==r&&I(e,a,{get:function(){return t[a]},enumerable:!(n=E(t,a))||n.enumerable})};for(var u=w(t)[Symbol.iterator](),s;!(a=(s=u.next()).done);a=true)c()}catch(e){o=true;i=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(o){throw i}}}return e};var A=function(e,t,r){return r=e!=null?b(S(e)):{},_(t||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e)},L=function(e){return _(I({},"__esModule",{value:!0}),e)};var j={};T(j,{mergeConfigs:function(){return tj}});module.exports=L(j);var R=A(require("@antfu/eslint-config"),1);var k=A(require("@vitejs/plugin-react-swc"),1),D=require("vitest/config");function G(e){return(0,D.defineConfig)(l({plugins:[(0,k.default)()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}C(G,"vitestE2E");var N=A(require("@vitejs/plugin-react-swc"),1),P=require("vitest/config");var x=".cyberskill-storage";var M=A(require("dotenv"),1),U=require("envalid"),F=A(require("os"),1),W=A(require("path"),1),q=A(require("process"),1);M.default.config();function K(){var e={DEBUG:q.default.env.DEBUG,CWD:q.default.env.CWD,CYBERSKILL_STORAGE_DIR:q.default.env.CYBERSKILL_STORAGE_DIR},t=(0,U.cleanEnv)(e,{DEBUG:(0,U.bool)({default:!1}),CWD:(0,U.str)({default:q.default.cwd()}),CYBERSKILL_STORAGE_DIR:(0,U.str)({default:W.default.join(F.default.homedir(),x)})});return{DEBUG:t.DEBUG,CWD:t.CWD,CYBERSKILL_STORAGE_DIR:t.CYBERSKILL_STORAGE_DIR}}C(K,"getEnv");var B=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});var J=require("child_process"),Y=A(require("process"),1),V=A(require("util"),1);var H=function(e){return e.Error="error",e.Warning="warning",e}({});var $=A(require("chalk"),1),z=A(require("consola"),1),Q=require("graphql");var X=K();X.DEBUG||(z.default.level=4);function Z(e){var t=$.default[e];return typeof t=="function"?t:$.default.green}C(Z,"chalkKeyword");var ee={silent:z.default.silent,level:z.default.level,fatal:z.default.fatal,error:z.default.error,warn:z.default.warn,log:z.default.log,info:z.default.info,success:z.default.success,ready:z.default.ready,start:z.default.start,box:z.default.box,debug:z.default.debug,trace:z.default.trace,verbose:z.default.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){z.default.box($.default.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,a=e.rule,o=e.message;z.default.log("".concat($.default.gray("File:")," ").concat($.default.blue("".concat(t).concat(n?":".concat(n):"")))),a&&z.default.log(" ".concat(Z(r)("Rule:")," ").concat(a)),z.default.log(" ".concat(Z(r)("Message:")," ").concat(o))}),z.default.box(Z(r)("".concat(e," : ").concat(t.length))),z.default.log($.default.gray("─".repeat(40)))}};var et={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var er=A(require("node-fetch"),1);var en=A(require("fs"),1);function ea(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return en.existsSync(e)})}C(ea,"existsSync");function eo(e,t){var r=en.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":g(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}C(eo,"readFileSync");function ei(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,a=n===void 0?!1:n,o=a&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);en.writeFileSync(e,o,"utf-8")}C(ei,"writeFileSync");function ec(e){var t=K(),r=ex(t.CWD,eK);if(!ea(r))return!1;try{var n=eo(r,{asJson:!0}),a=n.name,o=n.dependencies,i=o===void 0?{}:o,c=n.devDependencies,u=c===void 0?{}:c,s=a===e,l=e in i,f=e in u;return s||l||f?{path:r,file:n,isCurrentProject:s,isDepend:l,isDevDepend:f}:!1}catch(e){return ee.warn("Failed to read package.json: ".concat(e.message)),!1}}C(ec,"getPackage");function eu(e){return es.apply(this,arguments)}function es(){es=a(function(e){var t,r,n,a;return h(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,(0,er.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=o.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=o.sent(),n=r.version;return[2,n];case 3:a=o.sent();throw ee.error('Failed to fetch version for "'.concat(e,'": ').concat(a.message)),a;case 4:return[2]}})});return es.apply(this,arguments)}C(eu,"getLatestPackageVersion");function el(e,t){return ef.apply(this,arguments)}function ef(){ef=a(function(e,t){var r,n,a,o,i,c,u,s,f,d,p,v,g,y,m,b,I,E,w,S,O;return h(this,function(h){switch(h.label){case 0:h.trys.push([0,4,,5]);r=ec(e);if(!r)return[2,l({},et)];u=r.path,s=r.file,f=r.isCurrentProject,d=r.isDepend,p=r.isDevDepend,v=(n=s.dependencies)!==null&&n!==void 0?n:{},g=(a=s.devDependencies)!==null&&a!==void 0?a:{},y=f?(o=s.version)!==null&&o!==void 0?o:"0.0.0":d?(i=v[e])!==null&&i!==void 0?i:"0.0.0":p?(c=g[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];I=y;return[3,3];case 1:return[4,eu(e)];case 2:I=h.sent();h.label=3;case 3:m=I,b=f||y===m;if(!b&&(t===null||t===void 0?void 0:t.update)){;w=d?"dependencies":p?"devDependencies":null;w&&((E=s[w])===null||E===void 0?void 0:E[e])!==m&&(s[w]=(S=s[w])!==null&&S!==void 0?S:{},s[w][e]=m,ei(u,s,{isJson:!0}),ee.info('Updated "'.concat(e,'" to version ').concat(m)))}return[2,{isCurrentProject:f,installedPath:u,file:s,isUpToDate:b}];case 4:O=h.sent();return[2,(ee.error('Error checking package "'.concat(e,'": ').concat(O.message)),l({},et))];case 5:return[2]}})});return ef.apply(this,arguments)}C(el,"checkPackage");function ed(){return ep.apply(this,arguments)}function ep(){ep=a(function(){var e,t,r,n,a,o,i,c,u,s,l,f;return h(this,function(d){switch(d.label){case 0:e=[{command:C(function(){return th.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:C(function(){return th.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:C(function(){return th.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,9,10,11]);a=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(o=a.next()).done))return[3,8];i=o.value,c=i.command,u=i.message;d.label=3;case 3:d.trys.push([3,6,,7]);return[4,c()];case 4:s=d.sent();return[4,eD("".concat(u," using: ").concat(s),s)];case 5:d.sent();return[2];case 6:l=d.sent();ee.warn("Installation attempt failed: ".concat(u)),ee.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=d.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&a.return!=null){a.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return ep.apply(this,arguments)}C(ed,"installDependencies");function ev(e,t){return eg.apply(this,arguments)}function eg(){eg=a(function(e,t){var r,n,a,o,i,c,u,s,f,d,p;return h(this,function(g){switch(g.label){case 0:if(!ea(tp.PACKAGE_JSON)){ee.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,13,,14]);r=v(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return el(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=g.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,ed()];case 3:n=g.sent();g.label=4;case 4:n;o=true,i=false,c=undefined;g.label=5;case 5:g.trys.push([5,10,11,12]);u=((a=t===null||t===void 0?void 0:t.postInstallActions)!==null&&a!==void 0?a:[])[Symbol.iterator]();g.label=6;case 6:if(!!(o=(s=u.next()).done))return[3,9];f=s.value;return[4,f()];case 7:g.sent();g.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=g.sent();i=true;c=d;return[3,12];case 11:try{if(!o&&u.return!=null){u.return()}}finally{if(i){throw c}}return[7];case 12:return[3,14];case 13:p=g.sent();throw ee.error('Failed to setup "'.concat(e.join(", "),'": ').concat(p.message)),p;case 14:return[2]}})});return eg.apply(this,arguments)}C(ev,"setupPackages");var ey=A(require("node-persist"),1);var eh=K();function em(){return eb.apply(this,arguments)}function eb(){eb=a(function(){var e;return h(this,function(t){switch(t.label){case 0:e=ey.default.defaultInstance;if(e)return[3,2];return[4,ey.default.init({dir:eh.CYBERSKILL_STORAGE_DIR,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eb.apply(this,arguments)}C(em,"initNodePersist");var eI={get:function e(e){return a(function(){var t,r;return h(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,em()];case 1:n.sent();return[4,ey.default.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(ee.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return a(function(){var r;return h(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,em()];case 1:n.sent();return[4,ey.default.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();ee.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return a(function(){var t;return h(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,em()];case 1:r.sent();return[4,ey.default.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();ee.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return a(function(){var e,t;return h(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,em()];case 1:r.sent();return[4,ey.default.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(ee.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(ee.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return a(function(){return h(this,function(t){try{return[2,"".concat(eh.CYBERSKILL_STORAGE_DIR," (key: ").concat(e,")")]}catch(e){return[2,(ee.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eE=K(),ew=V.promisify(J.exec);function eS(e){return"error_list:".concat(e)}C(eS,"getErrorListKey");function eO(e){return eC.apply(this,arguments)}function eC(){eC=a(function(e){var t,r,n;return h(this,function(o){switch(o.label){case 0:if(e.length===0)return[2];t=Date.now(),r=eS(t);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,eI.set(r,{errors:e,timestamp:t})];case 2:o.sent(),setTimeout(/*#__PURE__*/a(function(){var e;return h(this,function(t){switch(t.label){case 0:return[4,eI.getLogLink(r)];case 1:e=t.sent();e&&ee.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=o.sent();ee.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return eC.apply(this,arguments)}C(eO,"saveErrorListToStorage");function eT(e){var t=[],r=[],n="",a=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var c,u,s,l,f;var d=a.exec(e)||[],p=o.exec(e)||[],v=i.exec(e)||[];var g,y,h,m,b,I;d.length&&n?t.push({file:n,position:"".concat(d[1],":").concat(d[2]),type:d[3]===H.Error?H.Error:H.Warning,message:(g=d===null||d===void 0?void 0:(c=d[4])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:"",rule:(y=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):p.length?t.push({file:(h=p===null||p===void 0?void 0:p[1])!==null&&h!==void 0?h:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===H.Error?H.Error:H.Warning,message:(m=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&m!==void 0?m:""}):v.length?t.push({file:"commitlint",type:H.Error,message:(b=v===null||v===void 0?void 0:(l=v[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(I=v===null||v===void 0?void 0:(f=v[2])===null||f===void 0?void 0:f.trim())!==null&&I!==void 0?I:""}):r.push(e.trim())}}),t.length&&eO(t),eE.DEBUG&&r.length&&(ee.warn("Unmatched lines:"),r.forEach(function(e){return ee.info(" ".concat(e))}))}C(eT,"parseTextErrors");function e_(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,a=e.line,o=e.column,i=e.ruleId,c=e.message;r.push({type:n===2?H.Error:H.Warning,file:t,position:"".concat(a,":").concat(o),rule:i,message:c})})}),r.length&&eO(r)}catch(t){eT(e)}}C(e_,"parseCommandOutput");function eA(e){return eL.apply(this,arguments)}function eL(){eL=a(function(e){var t,r,n,a,o,i,c,u,s;var l=arguments;return h(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:e_;r=new AbortController;Y.default.on("SIGINT",function(){ee.warn("Process interrupted. Terminating..."),r.abort(),Y.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ew(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),a=n.stdout,o=n.stderr;[a,o].forEach(function(e){return e&&t(e)});return[3,4];case 3:i=f.sent();c=i.stdout,u=i.stderr,s=i.message;[c,u].forEach(function(e){return e&&t(e)}),!u&&!c&&ee.error("Command failed: ".concat(s));return[3,4];case 4:return[2]}})});return eL.apply(this,arguments)}C(eA,"executeCommand");function ej(e){return{raw:!0,cmd:e}}C(ej,"rawCommand");function eR(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ta," ").concat(eF," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ta," ").concat(tt," ").concat(eZ," ").concat(e):"".concat(ta," ").concat(eX," ").concat(e)}C(eR,"formatCLI");function ek(e,t){return typeof e=="function"?eR(e(t),t):(typeof e==="undefined"?"undefined":g(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eR(e,t):e}C(ek,"formatCommand");function eD(e,t){return eG.apply(this,arguments)}function eG(){eG=a(function(e,t){var r;return h(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);ee.start("".concat(e)),eE.DEBUG&&ee.info("→ ".concat(t));return[4,eA(t)];case 1:n.sent(),ee.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw ee.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eG.apply(this,arguments)}C(eD,"runCommand");var eN=A(require("path"),1);function eP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;var a=K();return(n=eN).resolve.apply(n,[a.CWD].concat(v(t)))}C(eP,"resolveWorkingPath");function ex(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eN).join.apply(n,v(t))}C(ex,"join");var eM=K(),eU=eM.CWD,eF="@cyberskill/shared",eW="node_modules",eq="dist",eK="package.json",eB="package-lock.json",eJ="tsconfig.json",eY=".gitignore",eV=".simple-git-hooks.json",eH="pnpm-lock.yaml",e$=".git/hooks/",ez=".git/COMMIT_EDITMSG",eQ=ex(eU,eW,eF,eq),eX="cyberskill",eZ="src/nodejs/cli/index.ts",e0="eslint",e1="eslint",e2="vitest",e4="playwright",e3="vitest",e5="@commitlint/cli",e6="commitlint",e8="lint-staged",e7="lint-staged",e9="typescript",te="tsc",tt="tsx",tr="git",tn="pnpm",ta="pnpm exec",to="simple-git-hooks",ti="simple-git-hooks",tc="@eslint/config-inspector",tu="eslint-config-inspector",ts="node-modules-inspector",tl="node-modules-inspector",tf="migrate-mongo",td="migrate-mongo",tp={CYBERSKILL_DIRECTORY:eQ,WORKING_DIRECTORY:eU,TS_CONFIG:eP(eJ),GIT_IGNORE:eP(eY),GIT_HOOK:eP(e$),GIT_COMMIT_MSG:eP(ez),SIMPLE_GIT_HOOKS_JSON:eP(eV),PACKAGE_JSON:eP(eK),PACKAGE_LOCK_JSON:eP(eB),PNPM_LOCK_YAML:eP(eH),NODE_MODULES:eP(eW),LINT_STAGED_CONFIG:eP("".concat(eQ,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eP("".concat(eQ,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eP("".concat(eQ,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eP("".concat(eQ,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eP("".concat(eQ,"/react/vitest/vitest.e2e.js"))};function tv(e){return tg.apply(this,arguments)}function tg(){tg=a(function(e){var t,r,n,a,o,i;var c=arguments;return h(this,function(u){switch(u.label){case 0:for(t=c.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=c[n]}a=p(r,2),o=a[0],i=a[1];if(!o)throw new Error("'first' argument is undefined");switch(e){case B.CLI:return[3,1];case B.RAW:return[3,3]}return[3,4];case 1:return[4,ev(o.split(" "),{update:!0})];case 2:return[2,(u.sent(),ek(ej("".concat(ta," ").concat(i))))];case 3:return[2,ek(ej(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tg.apply(this,arguments)}C(tv,"buildCommand");function ty(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/a(function(){return h(this,function(t){return[2,tv.apply(void 0,[e].concat(v(r)))]})})}C(ty,"commandFactory");var th={simpleGitHooks:ty(B.CLI,to,ti),eslintInspect:ty(B.CLI,tc,tu),nodeModulesInspect:ty(B.CLI,ts,tl),eslintCheck:ty(B.CLI,e0,"".concat(e1," ").concat(tp.WORKING_DIRECTORY)),eslintFix:ty(B.CLI,e0,"".concat(e1," ").concat(tp.WORKING_DIRECTORY," --fix")),typescriptCheck:ty(B.CLI,e9,"".concat(te," -p ").concat(tp.TS_CONFIG," --noEmit")),configureGitHook:ty(B.RAW,"".concat(tr," config core.hooksPath ").concat(tp.GIT_HOOK)),testUnit:ty(B.CLI,e2,"".concat(e3," --config ").concat(tp.UNIT_TEST_CONFIG)),testE2e:ty(B.CLI,"".concat(e2," ").concat(e4),"".concat(e3," --config ").concat(tp.E2E_TEST_CONFIG)),mongoMigrateCreate:C(function(e){return ty(B.CLI,"".concat(tf),"".concat(td," create ").concat(e))()},"mongoMigrateCreate"),mongoMigrateUp:ty(B.CLI,"".concat(tf),"".concat(td," up")),mongoMigrateDown:ty(B.CLI,"".concat(tf),"".concat(td," down")),commitLint:ty(B.CLI,e5,"".concat(e6," --edit ").concat(tp.GIT_COMMIT_MSG," --config ").concat(tp.COMMITLINT_CONFIG)),lintStaged:ty(B.CLI,e8,"".concat(e7," --config ").concat(tp.LINT_STAGED_CONFIG)),stageBuildDirectory:ty(B.RAW,"".concat(tr," add ").concat(eq)),build:ty(B.RAW,"".concat(tn," run build")),pnpmInstallStandard:ty(B.RAW,"".concat(tn," install")),pnpmInstallLegacy:ty(B.RAW,"".concat(tn," install --legacy-peer-deps")),pnpmInstallForce:ty(B.RAW,"".concat(tn," install --force"))};function tm(e){return(0,P.defineConfig)(l({plugins:[(0,N.default)()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tp.UNIT_TEST_SETUP_CONFIG]}},e))}C(tm,"vitestUnit");function tb(e){return!!e&&(typeof e==="undefined"?"undefined":g(e))=="object"&&!Array.isArray(e)}C(tb,"isPlainObject");function tI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,a=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var c=p(i.value,2),u=c[0],s=c[1];var l=e[u];Array.isArray(s)?e[u]=Array.from(new Set(v(Array.isArray(l)?l:[]).concat(v(s)))):tb(s)?e[u]=tI(tb(l)?l:{},s):e[u]=s}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return e},{})}C(tI,"deepMerge");var tE=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});var tw=A(require("globals"),1),tS=[{languageOptions:{globals:l({},tw.node,tw.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tO;var tC=C(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tI.apply(void 0,v(t))},"passThroughHandler"),tT=C(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tI.apply(void 0,[tS].concat(v(t))),a=n.ignores,o=f(n,["ignores"]),i=Array.isArray(a)&&a.every(function(e){return typeof e=="string"})?{ignores:a}:void 0,c=[o].concat(v(i?[i]:[]));return(0,R.default).apply(m,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(v(c)))},"handleESLint"),t_=C(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return G.apply(void 0,v(t))},"handleVitestReactE2E"),tA=C(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tm.apply(void 0,v(t))},"handleVitestReactUnit"),tL=(tO={},o(tO,tE.ESLINT,tT),o(tO,tE.COMMITLINT,tC),o(tO,tE.LINT_STAGED,tC),o(tO,tE.VITEST_REACT_E2E,t_),o(tO,tE.VITEST_REACT_UNIT,tA),tO);function tj(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var a=tL[e];if(!a)throw new Error("Unknown config type: ".concat(e));return a.apply(void 0,v(r))}C(tj,"mergeConfigs");0&&(module.exports={mergeConfigs:mergeConfigs});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,i,a){try{var c=e[i](a);var s=c.value}catch(e){r(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,s,"next",e)}function s(e){n(a,o,i,c,s,"throw",e)}c(undefined)})}}function i(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var i=false;var a,c;try{for(r=r.call(e);!(o=(a=r.next()).done);o=true){n.push(a.value);if(t&&n.length===t)break}}catch(e){i=true;c=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(i)throw c}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){i(e,t,r[t])})}return e}function f(e,t){if(e==null)return{};var r=d(e,t);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function d(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function p(e,r){return t(e)||c(e,r)||y(e,r)||s()}function v(e){return r(e)||a(e)||y(e)||u()}function m(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function g(e,t){var r,n,o,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(i=0)),i)try{if(r=1,n&&(o=c[0]&2?n["return"]:c[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;if(n=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;n=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(c[0]===6&&i.label<o[1]){i.label=o[1];o=c;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(c);break}if(o[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];n=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var h=Object.defineProperty;var b=function(e,t){return h(e,"name",{value:t,configurable:!0})};import w from"@antfu/eslint-config";import I from"@vitejs/plugin-react-swc";import{defineConfig as E}from"vitest/config";function S(e){return E(l({plugins:[I()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}b(S,"vitestE2E");import T from"@vitejs/plugin-react-swc";import{defineConfig as O}from"vitest/config";import C from"node:process";var _=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as A}from"node:child_process";import k from"node:process";import*as j from"node:util";import L from"node:process";var N=L.env.DEBUG==="true";var P=function(e){return e.Error="error",e.Warning="warning",e}({});import G from"chalk";import R from"consola";import{GraphQLError as x}from"graphql";N||(R.level=4);function D(e){var t=G[e];return typeof t=="function"?t:G.green}b(D,"chalkKeyword");var F={silent:R.silent,level:R.level,fatal:R.fatal,error:R.error,warn:R.warn,log:R.log,info:R.info,success:R.success,ready:R.ready,start:R.start,box:R.box,debug:R.debug,trace:R.trace,verbose:R.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){R.box(G.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,i=e.message;R.log("".concat(G.gray("File:")," ").concat(G.blue("".concat(t).concat(n?":".concat(n):"")))),o&&R.log(" ".concat(D(r)("Rule:")," ").concat(o)),R.log(" ".concat(D(r)("Message:")," ").concat(i))}),R.box(D(r)("".concat(e," : ").concat(t.length))),R.log(G.gray("─".repeat(40)))}};var M={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import U from"node-fetch";import*as W from"node:fs";function J(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return W.existsSync(e)})}b(J,"existsSync");function K(e,t){var r=W.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":m(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}b(K,"readFileSync");function V(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,o=n===void 0?!1:n,i=o&&(typeof t==="undefined"?"undefined":m(t))=="object"?JSON.stringify(t,null,4):String(t);W.writeFileSync(e,i,"utf-8")}b(V,"writeFileSync");function Y(e){var t=eE(eS,eA);if(!J(t))return!1;try{var r=K(t,{asJson:!0}),n=r.name,o=r.dependencies,i=o===void 0?{}:o,a=r.devDependencies,c=a===void 0?{}:a,s=n===e,u=e in i,l=e in c;return s||u||l?{path:t,file:r,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return F.warn("Failed to read package.json: ".concat(e.message)),!1}}b(Y,"getPackage");function B(e){return H.apply(this,arguments)}function H(){H=o(function(e){var t,r,n,o;return g(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,U("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=i.sent(),n=r.version;return[2,n];case 3:o=i.sent();throw F.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return H.apply(this,arguments)}b(B,"getLatestPackageVersion");function $(e,t){return q.apply(this,arguments)}function q(){q=o(function(e,t){var r,n,o,i,a,c,s,u,f,d,p,v,m,y,h,b,w,I,E,S,T;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,4,,5]);r=Y(e);if(!r)return[2,l({},M)];s=r.path,u=r.file,f=r.isCurrentProject,d=r.isDepend,p=r.isDevDepend,v=(n=u.dependencies)!==null&&n!==void 0?n:{},m=(o=u.devDependencies)!==null&&o!==void 0?o:{},y=f?(i=u.version)!==null&&i!==void 0?i:"0.0.0":d?(a=v[e])!==null&&a!==void 0?a:"0.0.0":p?(c=m[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=y;return[3,3];case 1:return[4,B(e)];case 2:w=g.sent();g.label=3;case 3:h=w,b=f||y===h;if(!b&&(t===null||t===void 0?void 0:t.update)){;E=d?"dependencies":p?"devDependencies":null;E&&((I=u[E])===null||I===void 0?void 0:I[e])!==h&&(u[E]=(S=u[E])!==null&&S!==void 0?S:{},u[E][e]=h,V(s,u,{isJson:!0}),F.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:T=g.sent();return[2,(F.error('Error checking package "'.concat(e,'": ').concat(T.message)),l({},M))];case 5:return[2]}})});return q.apply(this,arguments)}b($,"checkPackage");function Q(){return z.apply(this,arguments)}function z(){z=o(function(){var e,t,r,n,o,i,a,c,s,u,l,f;return g(this,function(d){switch(d.label){case 0:e=[{command:b(function(){return te.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:b(function(){return te.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:b(function(){return te.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,9,10,11]);o=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(i=o.next()).done))return[3,8];a=i.value,c=a.command,s=a.message;d.label=3;case 3:d.trys.push([3,6,,7]);return[4,c()];case 4:u=d.sent();return[4,eh("".concat(s," using: ").concat(u),u)];case 5:d.sent();return[2];case 6:l=d.sent();F.warn("Installation attempt failed: ".concat(s)),F.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=d.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return z.apply(this,arguments)}b(Q,"installDependencies");function X(e,t){return Z.apply(this,arguments)}function Z(){Z=o(function(e,t){var r,n,o,i,a,c,s,u,f,d,p;return g(this,function(m){switch(m.label){case 0:if(!J(e6.PACKAGE_JSON)){F.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);r=v(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return $(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=m.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,Q()];case 3:n=m.sent();m.label=4;case 4:n;i=true,a=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);s=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:d=m.sent();a=true;c=d;return[3,12];case 11:try{if(!i&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:p=m.sent();throw F.error('Failed to setup "'.concat(e.join(", "),'": ').concat(p.message)),p;case 14:return[2]}})});return Z.apply(this,arguments)}b(X,"setupPackages");import ee from"node-persist";import et from"node:os";import er from"node:process";function en(){return er.env.CYBERSKILL_STORAGE_DIR||eE(et.homedir(),eO)}b(en,"getStorageDir");function eo(){return ei.apply(this,arguments)}function ei(){ei=o(function(){var e;return g(this,function(t){switch(t.label){case 0:e=ee.defaultInstance;if(e)return[3,2];return[4,ee.init({dir:en(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return ei.apply(this,arguments)}b(eo,"initNodePersist");var ea={get:function e(e){return o(function(){var t,r;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eo()];case 1:n.sent();return[4,ee.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(F.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eo()];case 1:n.sent();return[4,ee.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();F.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eo()];case 1:r.sent();return[4,ee.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();F.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eo()];case 1:r.sent();return[4,ee.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(F.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(F.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return g(this,function(t){try{return[2,"".concat(en()," (key: ").concat(e,")")]}catch(e){return[2,(F.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ec=j.promisify(A);function es(e){return"error_list:".concat(e)}b(es,"getErrorListKey");function eu(e){return el.apply(this,arguments)}function el(){el=o(function(e){var t,r,n;return g(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),r=es(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ea.set(r,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,ea.getLogLink(r)];case 1:e=t.sent();e&&F.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=i.sent();F.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return el.apply(this,arguments)}b(eu,"saveErrorListToStorage");function ef(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var c,s,u,l,f;var d=o.exec(e)||[],p=i.exec(e)||[],v=a.exec(e)||[];var m,y,g,h,b,w;d.length&&n?t.push({file:n,position:"".concat(d[1],":").concat(d[2]),type:d[3]===P.Error?P.Error:P.Warning,message:(m=d===null||d===void 0?void 0:(c=d[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(y=d===null||d===void 0?void 0:(s=d[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):p.length?t.push({file:(g=p===null||p===void 0?void 0:p[1])!==null&&g!==void 0?g:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===P.Error?P.Error:P.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):v.length?t.push({file:"commitlint",type:P.Error,message:(b=v===null||v===void 0?void 0:(l=v[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=v===null||v===void 0?void 0:(f=v[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):r.push(e.trim())}}),t.length&&eu(t),N&&r.length&&(F.warn("Unmatched lines:"),r.forEach(function(e){return F.info(" ".concat(e))}))}b(ef,"parseTextErrors");function ed(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,i=e.column,a=e.ruleId,c=e.message;r.push({type:n===2?P.Error:P.Warning,file:t,position:"".concat(o,":").concat(i),rule:a,message:c})})}),r.length&&eu(r)}catch(t){ef(e)}}b(ed,"parseCommandOutput");function ep(e){return ev.apply(this,arguments)}function ev(){ev=o(function(e){var t,r,n,o,i,a,c,s,u;var l=arguments;return g(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ed;r=new AbortController;k.on("SIGINT",function(){F.warn("Process interrupted. Terminating..."),r.abort(),k.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ec(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,i=n.stderr;[o,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&F.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ev.apply(this,arguments)}b(ep,"executeCommand");function em(e){return{raw:!0,cmd:e}}b(em,"rawCommand");function ey(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eZ," ").concat(eT," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eZ," ").concat(eQ," ").concat(eF," ").concat(e):"".concat(eZ," ").concat(eD," ").concat(e)}b(ey,"formatCLI");function eg(e,t){return typeof e=="function"?ey(e(t),t):(typeof e==="undefined"?"undefined":m(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ey(e,t):e}b(eg,"formatCommand");function eh(e,t){return eb.apply(this,arguments)}function eb(){eb=o(function(e,t){var r;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);F.start("".concat(e)),N&&F.info("→ ".concat(t));return[4,ep(t)];case 1:n.sent(),F.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw F.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eb.apply(this,arguments)}b(eh,"runCommand");import*as ew from"node:path";function eI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=ew).resolve.apply(n,[eS].concat(v(t)))}b(eI,"resolveWorkingPath");function eE(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=ew).join.apply(n,v(t))}b(eE,"join");var eS=C.env.INIT_CWD||C.cwd(),eT="@cyberskill/shared",eO=".cyberskill-storage",eC="node_modules",e_="dist",eA="package.json",ek="package-lock.json",ej="tsconfig.json",eL=".gitignore",eN=".simple-git-hooks.json",eP="pnpm-lock.yaml",eG=".git/hooks/",eR=".git/COMMIT_EDITMSG",ex=eE(eS,eC,eT,e_),eD="cyberskill",eF="src/nodejs/cli/index.ts",eM="eslint",eU="eslint",eW="vitest",eJ="playwright",eK="vitest",eV="@commitlint/cli",eY="commitlint",eB="lint-staged",eH="lint-staged",e$="typescript",eq="tsc",eQ="tsx",ez="git",eX="pnpm",eZ="pnpm exec",e0="simple-git-hooks",e1="simple-git-hooks",e2="@eslint/config-inspector",e4="eslint-config-inspector",e3="node-modules-inspector",e5="node-modules-inspector",e6={CYBERSKILL_DIRECTORY:ex,WORKING_DIRECTORY:eS,TS_CONFIG:eI(ej),GIT_IGNORE:eI(eL),GIT_HOOK:eI(eG),GIT_COMMIT_MSG:eI(eR),SIMPLE_GIT_HOOKS_JSON:eI(eN),PACKAGE_JSON:eI(eA),PACKAGE_LOCK_JSON:eI(ek),PNPM_LOCK_YAML:eI(eP),NODE_MODULES:eI(eC),LINT_STAGED_CONFIG:eI("".concat(ex,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eI("".concat(ex,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eI("".concat(ex,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eI("".concat(ex,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eI("".concat(ex,"/react/vitest/vitest.e2e.js"))};function e8(e){return e7.apply(this,arguments)}function e7(){e7=o(function(e){var t,r,n,o,i,a;var c=arguments;return g(this,function(s){switch(s.label){case 0:for(t=c.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=c[n]}o=p(r,2),i=o[0],a=o[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case _.CLI:return[3,1];case _.RAW:return[3,3]}return[3,4];case 1:return[4,X(i.split(" "),{update:!0})];case 2:return[2,(s.sent(),eg(em("".concat(eZ," ").concat(a))))];case 3:return[2,eg(em(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return e7.apply(this,arguments)}b(e8,"buildCommand");function e9(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return g(this,function(t){return[2,e8.apply(void 0,[e].concat(v(r)))]})})}b(e9,"commandFactory");var te={simpleGitHooks:e9(_.CLI,e0,e1),eslintInspect:e9(_.CLI,e2,e4),nodeModulesInspect:e9(_.CLI,e3,e5),eslintCheck:e9(_.CLI,eM,"".concat(eU," ").concat(e6.WORKING_DIRECTORY)),eslintFix:e9(_.CLI,eM,"".concat(eU," ").concat(e6.WORKING_DIRECTORY," --fix")),typescriptCheck:e9(_.CLI,e$,"".concat(eq," -p ").concat(e6.TS_CONFIG," --noEmit")),configureGitHook:e9(_.RAW,"".concat(ez," config core.hooksPath ").concat(e6.GIT_HOOK)),testUnit:e9(_.CLI,eW,"".concat(eK," --config ").concat(e6.UNIT_TEST_CONFIG)),testE2e:e9(_.CLI,"".concat(eW," ").concat(eJ),"".concat(eK," --config ").concat(e6.E2E_TEST_CONFIG)),commitLint:e9(_.CLI,eV,"".concat(eY," --edit ").concat(e6.GIT_COMMIT_MSG," --config ").concat(e6.COMMITLINT_CONFIG)),lintStaged:e9(_.CLI,eB,"".concat(eH," --config ").concat(e6.LINT_STAGED_CONFIG)),stageBuildDirectory:e9(_.RAW,"".concat(ez," add ").concat(e_)),build:e9(_.RAW,"".concat(eX," run build")),pnpmInstallStandard:e9(_.RAW,"".concat(eX," install")),pnpmInstallLegacy:e9(_.RAW,"".concat(eX," install --legacy-peer-deps")),pnpmInstallForce:e9(_.RAW,"".concat(eX," install --force"))};function tt(e){return O(l({plugins:[T()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[e6.UNIT_TEST_SETUP_CONFIG]}},e))}b(tt,"vitestUnit");function tr(e){return!!e&&(typeof e==="undefined"?"undefined":m(e))=="object"&&!Array.isArray(e)}b(tr,"isPlainObject");function tn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,o=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),a;!(r=(a=i.next()).done);r=true){var c=p(a.value,2),s=c[0],u=c[1];var l=e[s];Array.isArray(u)?e[s]=Array.from(new Set(v(Array.isArray(l)?l:[]).concat(v(u)))):tr(u)?e[s]=tn(tr(l)?l:{},u):e[s]=u}}catch(e){n=true;o=e}finally{try{if(!r&&i.return!=null){i.return()}}finally{if(n){throw o}}}return e},{})}b(tn,"deepMerge");var to=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import*as ti from"globals";var ta=[{languageOptions:{globals:l({},ti.node,ti.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tc;var ts=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tn.apply(void 0,v(t))},"passThroughHandler"),tu=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tn.apply(void 0,[ta].concat(v(t))),o=n.ignores,i=f(n,["ignores"]),a=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,c=[i].concat(v(a?[a]:[]));return w.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(v(c)))},"handleESLint"),tl=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return S.apply(void 0,v(t))},"handleVitestReactE2E"),tf=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tt.apply(void 0,v(t))},"handleVitestReactUnit"),td=(tc={},i(tc,to.ESLINT,tu),i(tc,to.COMMITLINT,ts),i(tc,to.LINT_STAGED,ts),i(tc,to.VITEST_REACT_E2E,tl),i(tc,to.VITEST_REACT_UNIT,tf),tc);function tp(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var o=td[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,v(r))}b(tp,"mergeConfigs");export{tp as mergeConfigs};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,a,i){try{var c=e[a](i);var s=c.value}catch(e){r(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,s,"next",e)}function s(e){n(i,o,a,c,s,"throw",e)}c(undefined)})}}function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function i(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,c;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;c=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw c}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){a(e,t,r[t])})}return e}function f(e,t){if(e==null)return{};var r=d(e,t);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function d(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function p(e,r){return t(e)||c(e,r)||g(e,r)||s()}function v(e){return r(e)||i(e)||g(e)||u()}function m(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function y(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=c(0),i["throw"]=c(1),i["return"]=c(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(a=0)),a)try{if(r=1,n&&(o=c[0]&2?n["return"]:c[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;if(n=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:a.label++;return{value:c[1],done:false};case 5:a.label++;n=c[1];c=[0];continue;case 7:c=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(c[0]===6&&a.label<o[1]){a.label=o[1];o=c;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(c);break}if(o[2])a.ops.pop();a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e];n=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var h=Object.defineProperty;var b=function(e,t){return h(e,"name",{value:t,configurable:!0})};import I from"@antfu/eslint-config";import E from"@vitejs/plugin-react-swc";import{defineConfig as w}from"vitest/config";function S(e){return w(l({plugins:[E()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}b(S,"vitestE2E");import T from"@vitejs/plugin-react-swc";import{defineConfig as C}from"vitest/config";var O=".cyberskill-storage";import _ from"dotenv";import{bool as A,cleanEnv as L,str as R}from"envalid";import k from"node:os";import D from"node:path";import G from"node:process";_.config();function j(){var e={DEBUG:G.env.DEBUG,CWD:G.env.CWD,CYBERSKILL_STORAGE_DIR:G.env.CYBERSKILL_STORAGE_DIR},t=L(e,{DEBUG:A({default:!1}),CWD:R({default:G.cwd()}),CYBERSKILL_STORAGE_DIR:R({default:D.join(k.homedir(),O)})});return{DEBUG:t.DEBUG,CWD:t.CWD,CYBERSKILL_STORAGE_DIR:t.CYBERSKILL_STORAGE_DIR}}b(j,"getEnv");var N=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as P}from"node:child_process";import x from"node:process";import*as U from"node:util";var M=function(e){return e.Error="error",e.Warning="warning",e}({});import F from"chalk";import W from"consola";import{GraphQLError as K}from"graphql";var B=j();B.DEBUG||(W.level=4);function J(e){var t=F[e];return typeof t=="function"?t:F.green}b(J,"chalkKeyword");var Y={silent:W.silent,level:W.level,fatal:W.fatal,error:W.error,warn:W.warn,log:W.log,info:W.info,success:W.success,ready:W.ready,start:W.start,box:W.box,debug:W.debug,trace:W.trace,verbose:W.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.box(F.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,a=e.message;W.log("".concat(F.gray("File:")," ").concat(F.blue("".concat(t).concat(n?":".concat(n):"")))),o&&W.log(" ".concat(J(r)("Rule:")," ").concat(o)),W.log(" ".concat(J(r)("Message:")," ").concat(a))}),W.box(J(r)("".concat(e," : ").concat(t.length))),W.log(F.gray("─".repeat(40)))}};var V={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import H from"node-fetch";import*as $ from"node:fs";function q(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return $.existsSync(e)})}b(q,"existsSync");function Q(e,t){var r=$.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":m(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}b(Q,"readFileSync");function z(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,o=n===void 0?!1:n,a=o&&(typeof t==="undefined"?"undefined":m(t))=="object"?JSON.stringify(t,null,4):String(t);$.writeFileSync(e,a,"utf-8")}b(z,"writeFileSync");function X(e){var t=j(),r=eA(t.CWD,ej);if(!q(r))return!1;try{var n=Q(r,{asJson:!0}),o=n.name,a=n.dependencies,i=a===void 0?{}:a,c=n.devDependencies,s=c===void 0?{}:c,u=o===e,l=e in i,f=e in s;return u||l||f?{path:r,file:n,isCurrentProject:u,isDepend:l,isDevDepend:f}:!1}catch(e){return Y.warn("Failed to read package.json: ".concat(e.message)),!1}}b(X,"getPackage");function Z(e){return ee.apply(this,arguments)}function ee(){ee=o(function(e){var t,r,n,o;return y(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,H("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=a.sent(),n=r.version;return[2,n];case 3:o=a.sent();throw Y.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return ee.apply(this,arguments)}b(Z,"getLatestPackageVersion");function et(e,t){return er.apply(this,arguments)}function er(){er=o(function(e,t){var r,n,o,a,i,c,s,u,f,d,p,v,m,g,h,b,I,E,w,S,T;return y(this,function(y){switch(y.label){case 0:y.trys.push([0,4,,5]);r=X(e);if(!r)return[2,l({},V)];s=r.path,u=r.file,f=r.isCurrentProject,d=r.isDepend,p=r.isDevDepend,v=(n=u.dependencies)!==null&&n!==void 0?n:{},m=(o=u.devDependencies)!==null&&o!==void 0?o:{},g=f?(a=u.version)!==null&&a!==void 0?a:"0.0.0":d?(i=v[e])!==null&&i!==void 0?i:"0.0.0":p?(c=m[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];I=g;return[3,3];case 1:return[4,Z(e)];case 2:I=y.sent();y.label=3;case 3:h=I,b=f||g===h;if(!b&&(t===null||t===void 0?void 0:t.update)){;w=d?"dependencies":p?"devDependencies":null;w&&((E=u[w])===null||E===void 0?void 0:E[e])!==h&&(u[w]=(S=u[w])!==null&&S!==void 0?S:{},u[w][e]=h,z(s,u,{isJson:!0}),Y.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:T=y.sent();return[2,(Y.error('Error checking package "'.concat(e,'": ').concat(T.message)),l({},V))];case 5:return[2]}})});return er.apply(this,arguments)}b(et,"checkPackage");function en(){return eo.apply(this,arguments)}function eo(){eo=o(function(){var e,t,r,n,o,a,i,c,s,u,l,f;return y(this,function(d){switch(d.label){case 0:e=[{command:b(function(){return ts.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:b(function(){return ts.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:b(function(){return ts.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,9,10,11]);o=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];i=a.value,c=i.command,s=i.message;d.label=3;case 3:d.trys.push([3,6,,7]);return[4,c()];case 4:u=d.sent();return[4,eT("".concat(s," using: ").concat(u),u)];case 5:d.sent();return[2];case 6:l=d.sent();Y.warn("Installation attempt failed: ".concat(s)),Y.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=d.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eo.apply(this,arguments)}b(en,"installDependencies");function ea(e,t){return ei.apply(this,arguments)}function ei(){ei=o(function(e,t){var r,n,o,a,i,c,s,u,f,d,p;return y(this,function(m){switch(m.label){case 0:if(!q(to.PACKAGE_JSON)){Y.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);r=v(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return et(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=m.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,en()];case 3:n=m.sent();m.label=4;case 4:n;a=true,i=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);s=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();m.label=6;case 6:if(!!(a=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:m.sent();m.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:d=m.sent();i=true;c=d;return[3,12];case 11:try{if(!a&&s.return!=null){s.return()}}finally{if(i){throw c}}return[7];case 12:return[3,14];case 13:p=m.sent();throw Y.error('Failed to setup "'.concat(e.join(", "),'": ').concat(p.message)),p;case 14:return[2]}})});return ei.apply(this,arguments)}b(ea,"setupPackages");import ec from"node-persist";var es=j();function eu(){return el.apply(this,arguments)}function el(){el=o(function(){var e;return y(this,function(t){switch(t.label){case 0:e=ec.defaultInstance;if(e)return[3,2];return[4,ec.init({dir:es.CYBERSKILL_STORAGE_DIR,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return el.apply(this,arguments)}b(eu,"initNodePersist");var ef={get:function e(e){return o(function(){var t,r;return y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eu()];case 1:n.sent();return[4,ec.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(Y.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eu()];case 1:n.sent();return[4,ec.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();Y.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eu()];case 1:r.sent();return[4,ec.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();Y.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eu()];case 1:r.sent();return[4,ec.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(Y.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(Y.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return y(this,function(t){try{return[2,"".concat(es.CYBERSKILL_STORAGE_DIR," (key: ").concat(e,")")]}catch(e){return[2,(Y.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ed=j(),ep=U.promisify(P);function ev(e){return"error_list:".concat(e)}b(ev,"getErrorListKey");function em(e){return eg.apply(this,arguments)}function eg(){eg=o(function(e){var t,r,n;return y(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),r=ev(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,ef.set(r,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return y(this,function(t){switch(t.label){case 0:return[4,ef.getLogLink(r)];case 1:e=t.sent();e&&Y.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=a.sent();Y.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return eg.apply(this,arguments)}b(em,"saveErrorListToStorage");function ey(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,a=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var c,s,u,l,f;var d=o.exec(e)||[],p=a.exec(e)||[],v=i.exec(e)||[];var m,g,y,h,b,I;d.length&&n?t.push({file:n,position:"".concat(d[1],":").concat(d[2]),type:d[3]===M.Error?M.Error:M.Warning,message:(m=d===null||d===void 0?void 0:(c=d[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(g=d===null||d===void 0?void 0:(s=d[5])===null||s===void 0?void 0:s.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===M.Error?M.Error:M.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):v.length?t.push({file:"commitlint",type:M.Error,message:(b=v===null||v===void 0?void 0:(l=v[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(I=v===null||v===void 0?void 0:(f=v[2])===null||f===void 0?void 0:f.trim())!==null&&I!==void 0?I:""}):r.push(e.trim())}}),t.length&&em(t),ed.DEBUG&&r.length&&(Y.warn("Unmatched lines:"),r.forEach(function(e){return Y.info(" ".concat(e))}))}b(ey,"parseTextErrors");function eh(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,a=e.column,i=e.ruleId,c=e.message;r.push({type:n===2?M.Error:M.Warning,file:t,position:"".concat(o,":").concat(a),rule:i,message:c})})}),r.length&&em(r)}catch(t){ey(e)}}b(eh,"parseCommandOutput");function eb(e){return eI.apply(this,arguments)}function eI(){eI=o(function(e){var t,r,n,o,a,i,c,s,u;var l=arguments;return y(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eh;r=new AbortController;x.on("SIGINT",function(){Y.warn("Process interrupted. Terminating..."),r.abort(),x.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ep(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,a=n.stderr;[o,a].forEach(function(e){return e&&t(e)});return[3,4];case 3:i=f.sent();c=i.stdout,s=i.stderr,u=i.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&Y.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eI.apply(this,arguments)}b(eb,"executeCommand");function eE(e){return{raw:!0,cmd:e}}b(eE,"rawCommand");function ew(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e5," ").concat(ek," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e5," ").concat(e2," ").concat(eJ," ").concat(e):"".concat(e5," ").concat(eB," ").concat(e)}b(ew,"formatCLI");function eS(e,t){return typeof e=="function"?ew(e(t),t):(typeof e==="undefined"?"undefined":m(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ew(e,t):e}b(eS,"formatCommand");function eT(e,t){return eC.apply(this,arguments)}function eC(){eC=o(function(e,t){var r;return y(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);Y.start("".concat(e)),ed.DEBUG&&Y.info("→ ".concat(t));return[4,eb(t)];case 1:n.sent(),Y.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw Y.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eC.apply(this,arguments)}b(eT,"runCommand");import*as eO from"node:path";function e_(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;var o=j();return(n=eO).resolve.apply(n,[o.CWD].concat(v(t)))}b(e_,"resolveWorkingPath");function eA(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eO).join.apply(n,v(t))}b(eA,"join");var eL=j(),eR=eL.CWD,ek="@cyberskill/shared",eD="node_modules",eG="dist",ej="package.json",eN="package-lock.json",eP="tsconfig.json",ex=".gitignore",eU=".simple-git-hooks.json",eM="pnpm-lock.yaml",eF=".git/hooks/",eW=".git/COMMIT_EDITMSG",eK=eA(eR,eD,ek,eG),eB="cyberskill",eJ="src/nodejs/cli/index.ts",eY="eslint",eV="eslint",eH="vitest",e$="playwright",eq="vitest",eQ="@commitlint/cli",ez="commitlint",eX="lint-staged",eZ="lint-staged",e0="typescript",e1="tsc",e2="tsx",e4="git",e3="pnpm",e5="pnpm exec",e6="simple-git-hooks",e8="simple-git-hooks",e7="@eslint/config-inspector",e9="eslint-config-inspector",te="node-modules-inspector",tt="node-modules-inspector",tr="migrate-mongo",tn="migrate-mongo",to={CYBERSKILL_DIRECTORY:eK,WORKING_DIRECTORY:eR,TS_CONFIG:e_(eP),GIT_IGNORE:e_(ex),GIT_HOOK:e_(eF),GIT_COMMIT_MSG:e_(eW),SIMPLE_GIT_HOOKS_JSON:e_(eU),PACKAGE_JSON:e_(ej),PACKAGE_LOCK_JSON:e_(eN),PNPM_LOCK_YAML:e_(eM),NODE_MODULES:e_(eD),LINT_STAGED_CONFIG:e_("".concat(eK,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:e_("".concat(eK,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:e_("".concat(eK,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:e_("".concat(eK,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:e_("".concat(eK,"/react/vitest/vitest.e2e.js"))};function ta(e){return ti.apply(this,arguments)}function ti(){ti=o(function(e){var t,r,n,o,a,i;var c=arguments;return y(this,function(s){switch(s.label){case 0:for(t=c.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=c[n]}o=p(r,2),a=o[0],i=o[1];if(!a)throw new Error("'first' argument is undefined");switch(e){case N.CLI:return[3,1];case N.RAW:return[3,3]}return[3,4];case 1:return[4,ea(a.split(" "),{update:!0})];case 2:return[2,(s.sent(),eS(eE("".concat(e5," ").concat(i))))];case 3:return[2,eS(eE(a))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ti.apply(this,arguments)}b(ta,"buildCommand");function tc(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return y(this,function(t){return[2,ta.apply(void 0,[e].concat(v(r)))]})})}b(tc,"commandFactory");var ts={simpleGitHooks:tc(N.CLI,e6,e8),eslintInspect:tc(N.CLI,e7,e9),nodeModulesInspect:tc(N.CLI,te,tt),eslintCheck:tc(N.CLI,eY,"".concat(eV," ").concat(to.WORKING_DIRECTORY)),eslintFix:tc(N.CLI,eY,"".concat(eV," ").concat(to.WORKING_DIRECTORY," --fix")),typescriptCheck:tc(N.CLI,e0,"".concat(e1," -p ").concat(to.TS_CONFIG," --noEmit")),configureGitHook:tc(N.RAW,"".concat(e4," config core.hooksPath ").concat(to.GIT_HOOK)),testUnit:tc(N.CLI,eH,"".concat(eq," --config ").concat(to.UNIT_TEST_CONFIG)),testE2e:tc(N.CLI,"".concat(eH," ").concat(e$),"".concat(eq," --config ").concat(to.E2E_TEST_CONFIG)),mongoMigrateCreate:b(function(e){return tc(N.CLI,"".concat(tr),"".concat(tn," create ").concat(e))()},"mongoMigrateCreate"),mongoMigrateUp:tc(N.CLI,"".concat(tr),"".concat(tn," up")),mongoMigrateDown:tc(N.CLI,"".concat(tr),"".concat(tn," down")),commitLint:tc(N.CLI,eQ,"".concat(ez," --edit ").concat(to.GIT_COMMIT_MSG," --config ").concat(to.COMMITLINT_CONFIG)),lintStaged:tc(N.CLI,eX,"".concat(eZ," --config ").concat(to.LINT_STAGED_CONFIG)),stageBuildDirectory:tc(N.RAW,"".concat(e4," add ").concat(eG)),build:tc(N.RAW,"".concat(e3," run build")),pnpmInstallStandard:tc(N.RAW,"".concat(e3," install")),pnpmInstallLegacy:tc(N.RAW,"".concat(e3," install --legacy-peer-deps")),pnpmInstallForce:tc(N.RAW,"".concat(e3," install --force"))};function tu(e){return C(l({plugins:[T()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[to.UNIT_TEST_SETUP_CONFIG]}},e))}b(tu,"vitestUnit");function tl(e){return!!e&&(typeof e==="undefined"?"undefined":m(e))=="object"&&!Array.isArray(e)}b(tl,"isPlainObject");function tf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),i;!(r=(i=a.next()).done);r=true){var c=p(i.value,2),s=c[0],u=c[1];var l=e[s];Array.isArray(u)?e[s]=Array.from(new Set(v(Array.isArray(l)?l:[]).concat(v(u)))):tl(u)?e[s]=tf(tl(l)?l:{},u):e[s]=u}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return e},{})}b(tf,"deepMerge");var td=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import*as tp from"globals";var tv=[{languageOptions:{globals:l({},tp.node,tp.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tm;var tg=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tf.apply(void 0,v(t))},"passThroughHandler"),ty=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tf.apply(void 0,[tv].concat(v(t))),o=n.ignores,a=f(n,["ignores"]),i=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,c=[a].concat(v(i?[i]:[]));return I.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(v(c)))},"handleESLint"),th=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return S.apply(void 0,v(t))},"handleVitestReactE2E"),tb=b(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tu.apply(void 0,v(t))},"handleVitestReactUnit"),tI=(tm={},a(tm,td.ESLINT,ty),a(tm,td.COMMITLINT,tg),a(tm,td.LINT_STAGED,tg),a(tm,td.VITEST_REACT_E2E,th),a(tm,td.VITEST_REACT_UNIT,tb),tm);function tE(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var o=tI[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,v(r))}b(tE,"mergeConfigs");export{tE as mergeConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(e,t){for(var n in t)r(e,n,{get:t[n],enumerable:!0})},a=function(u,a,f,l){var i=true,c=false,y=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var p=function(){var e=v.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(l=t(a,e))||l.enumerable})};for(var s=n(a)[Symbol.iterator](),v;!(i=(v=s.next()).done);i=true)p()}catch(e){c=true;y=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(c){throw y}}}return u};var f=function(e){return a(r({},"__esModule",{value:!0}),e)};var l={};u(l,{CYBERSKILL_STORAGE_DIRECTORY:function(){return i}});module.exports=f(l);var i=".cyberskill-storage";0&&(module.exports={CYBERSKILL_STORAGE_DIRECTORY:CYBERSKILL_STORAGE_DIRECTORY});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CYBERSKILL_STORAGE_DIRECTORY_alias_2 as CYBERSKILL_STORAGE_DIRECTORY } from '../../_tsup-dts-rollup.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CYBERSKILL_STORAGE_DIRECTORY_alias_2 as CYBERSKILL_STORAGE_DIRECTORY } from '../../_tsup-dts-rollup.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=".cyberskill-storage";export{r as CYBERSKILL_STORAGE_DIRECTORY};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(u,a,f,l){var c=true,i=false,y=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var p=function(){var e=d.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(l=t(a,e))||l.enumerable})};for(var v=n(a)[Symbol.iterator](),d;!(c=(d=v.next()).done);c=true)p()}catch(e){i=true;y=e}finally{try{if(!c&&v.return!=null){v.return()}}finally{if(i){throw y}}}return u};var a=function(e){return u(r({},"__esModule",{value:!0}),e)};var f={};module.exports=a(f);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { I_Environment_alias_2 as I_Environment } from '../../_tsup-dts-rollup.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { I_Environment_alias_2 as I_Environment } from '../../_tsup-dts-rollup.js';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.create;var t=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty;var l=function(e,r){return t(e,"name",{value:r,configurable:!0})};var f=function(e,r){for(var n in r)t(e,n,{get:r[n],enumerable:!0})},i=function(r,o,l,f){var i=true,c=false,v=undefined;if(o&&(typeof o==="undefined"?"undefined":e(o))=="object"||typeof o=="function")try{var d=function(){var e=y.value;!a.call(r,e)&&e!==l&&t(r,e,{get:function(){return o[e]},enumerable:!(f=n(o,e))||f.enumerable})};for(var s=u(o)[Symbol.iterator](),y;!(i=(y=s.next()).done);i=true)d()}catch(e){c=true;v=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(c){throw v}}}return r};var c=function(e,n,u){return u=e!=null?r(o(e)):{},i(n||!e||!e.__esModule?t(u,"default",{value:e,enumerable:!0}):u,e)},v=function(e){return i(t({},"__esModule",{value:!0}),e)};var d={};f(d,{getEnv:function(){return O}});module.exports=v(d);var s=c(require("dotenv"),1),y=require("envalid"),E=c(require("os"),1),b=c(require("path"),1),p=c(require("process"),1);var D=".cyberskill-storage";s.default.config();function O(){var e={DEBUG:p.default.env.DEBUG,CWD:p.default.env.CWD,CYBERSKILL_STORAGE_DIR:p.default.env.CYBERSKILL_STORAGE_DIR},r=(0,y.cleanEnv)(e,{DEBUG:(0,y.bool)({default:!1}),CWD:(0,y.str)({default:p.default.cwd()}),CYBERSKILL_STORAGE_DIR:(0,y.str)({default:b.default.join(E.default.homedir(),D)})});return{DEBUG:r.DEBUG,CWD:r.CWD,CYBERSKILL_STORAGE_DIR:r.CYBERSKILL_STORAGE_DIR}}l(O,"getEnv");0&&(module.exports={getEnv:getEnv});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getEnv_alias_2 as getEnv } from '../../_tsup-dts-rollup.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getEnv_alias_2 as getEnv } from '../../_tsup-dts-rollup.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var o=function(o,r){return e(o,"name",{value:r,configurable:!0})};import r from"dotenv";import{bool as n,cleanEnv as t,str as a}from"envalid";import E from"node:os";import D from"node:path";import R from"node:process";var i=".cyberskill-storage";r.config();function f(){var e={DEBUG:R.env.DEBUG,CWD:R.env.CWD,CYBERSKILL_STORAGE_DIR:R.env.CYBERSKILL_STORAGE_DIR},o=t(e,{DEBUG:n({default:!1}),CWD:a({default:R.cwd()}),CYBERSKILL_STORAGE_DIR:a({default:D.join(E.homedir(),i)})});return{DEBUG:o.DEBUG,CWD:o.CWD,CYBERSKILL_STORAGE_DIR:o.CYBERSKILL_STORAGE_DIR}}o(f,"getEnv");export{f as getEnv};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.create;var t=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty;var l=function(e,r){return t(e,"name",{value:r,configurable:!0})};var f=function(e,r){for(var n in r)t(e,n,{get:r[n],enumerable:!0})},i=function(r,o,l,f){var i=true,c=false,v=undefined;if(o&&(typeof o==="undefined"?"undefined":e(o))=="object"||typeof o=="function")try{var d=function(){var e=R.value;!a.call(r,e)&&e!==l&&t(r,e,{get:function(){return o[e]},enumerable:!(f=n(o,e))||f.enumerable})};for(var E=u(o)[Symbol.iterator](),R;!(i=(R=E.next()).done);i=true)d()}catch(e){c=true;v=e}finally{try{if(!i&&E.return!=null){E.return()}}finally{if(c){throw v}}}return r};var c=function(e,n,u){return u=e!=null?r(o(e)):{},i(n||!e||!e.__esModule?t(u,"default",{value:e,enumerable:!0}):u,e)},v=function(e){return i(t({},"__esModule",{value:!0}),e)};var d={};f(d,{CYBERSKILL_STORAGE_DIRECTORY:function(){return E},getEnv:function(){return D}});module.exports=v(d);var E=".cyberskill-storage";var R=c(require("dotenv"),1),s=require("envalid"),O=c(require("os"),1),y=c(require("path"),1),_=c(require("process"),1);R.default.config();function D(){var e={DEBUG:_.default.env.DEBUG,CWD:_.default.env.CWD,CYBERSKILL_STORAGE_DIR:_.default.env.CYBERSKILL_STORAGE_DIR},r=(0,s.cleanEnv)(e,{DEBUG:(0,s.bool)({default:!1}),CWD:(0,s.str)({default:_.default.cwd()}),CYBERSKILL_STORAGE_DIR:(0,s.str)({default:y.default.join(O.default.homedir(),E)})});return{DEBUG:r.DEBUG,CWD:r.CWD,CYBERSKILL_STORAGE_DIR:r.CYBERSKILL_STORAGE_DIR}}l(D,"getEnv");0&&(module.exports={CYBERSKILL_STORAGE_DIRECTORY:CYBERSKILL_STORAGE_DIRECTORY,getEnv:getEnv});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var o=function(o,r){return e(o,"name",{value:r,configurable:!0})};var r=".cyberskill-storage";import n from"dotenv";import{bool as t,cleanEnv as E,str as a}from"envalid";import R from"node:os";import D from"node:path";import i from"node:process";n.config();function f(){var e={DEBUG:i.env.DEBUG,CWD:i.env.CWD,CYBERSKILL_STORAGE_DIR:i.env.CYBERSKILL_STORAGE_DIR},o=E(e,{DEBUG:t({default:!1}),CWD:a({default:i.cwd()}),CYBERSKILL_STORAGE_DIR:a({default:D.join(R.homedir(),r)})});return{DEBUG:o.DEBUG,CWD:o.CWD,CYBERSKILL_STORAGE_DIR:o.CYBERSKILL_STORAGE_DIR}}o(f,"getEnv");export{r as CYBERSKILL_STORAGE_DIRECTORY,f as getEnv};
|