@cyberskill/shared 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config.util.js +3 -2
- package/dist/config/config.util.js.map +1 -1
- package/dist/config/storybook/storybook.preview.d.ts +1 -1
- package/dist/config/storybook/storybook.preview.js +5 -4
- package/dist/config/storybook/storybook.preview.js.map +1 -1
- package/dist/config/vitest/vitest.e2e.d.ts +2 -0
- package/dist/config/vitest/vitest.e2e.js +11 -18
- package/dist/config/vitest/vitest.e2e.js.map +1 -1
- package/dist/config/vitest/vitest.unit.d.ts +2 -0
- package/dist/config/vitest/vitest.unit.js +7 -5
- package/dist/config/vitest/vitest.unit.js.map +1 -1
- package/dist/node/cli/index.js +55 -45
- package/dist/node/cli/index.js.map +1 -1
- package/dist/node/command/command.util.js +75 -75
- package/dist/node/command/command.util.js.map +1 -1
- package/dist/node/express/express.util.js +16 -16
- package/dist/node/express/express.util.js.map +1 -1
- package/dist/node/mongo/mongo.controller.d.ts +1 -1
- package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -1
- package/dist/node/mongo/mongo.dynamic-populate.js +64 -64
- package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -1
- package/dist/node/mongo/mongo.populate.js.map +1 -1
- package/dist/node/mongo/mongo.util.d.ts +16 -16
- package/dist/node/mongo/mongo.util.js.map +1 -1
- package/dist/node/path/path.constant.js +9 -9
- package/dist/node/path/path.constant.js.map +1 -1
- package/dist/node/ws/index.d.ts +1 -1
- package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +13 -13
- package/dist/react/apollo-client/apollo-client.util.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +22 -21
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
- package/dist/util/common/common.util.js +26 -25
- package/dist/util/common/common.util.js.map +1 -1
- package/dist/util/object/object.util.js +49 -49
- package/dist/util/object/object.util.js.map +1 -1
- package/dist/util/serializer/serializer.util.js +12 -12
- package/dist/util/serializer/serializer.util.js.map +1 -1
- package/dist/util/string/string.util.js +29 -28
- package/dist/util/string/string.util.js.map +1 -1
- package/dist/util/validate/validate.util.d.ts +0 -4
- package/dist/util/validate/validate.util.js +3 -3
- package/dist/util/validate/validate.util.js.map +1 -1
- package/package.json +31 -29
- package/public/tsconfig.base.json +1 -1
- package/dist/config/config.test.unit.d.ts +0 -1
- package/dist/config/config.type.test.unit.d.ts +0 -1
- package/dist/constant/constant.test.unit.d.ts +0 -1
- package/dist/node/command/command.test.unit.d.ts +0 -1
- package/dist/node/fs/fs.test.unit.d.ts +0 -1
- package/dist/node/log/log.test.unit.d.ts +0 -1
- package/dist/node/mongo/mongo.controller.test.unit.d.ts +0 -1
- package/dist/node/mongo/mongo.util.test.unit.d.ts +0 -1
- package/dist/node/package/package.test.unit.d.ts +0 -1
- package/dist/node/path/path.test.unit.d.ts +0 -1
- package/dist/react/apollo-error/apollo-error.test.unit.d.ts +0 -1
- package/dist/react/loading/loading.test.unit.d.ts +0 -1
- package/dist/react/storage/storage.test.unit.d.ts +0 -1
- package/dist/typescript/typescript.test.unit.d.ts +0 -1
- package/dist/util/common/common.test.unit.d.ts +0 -1
- package/dist/util/object/object.test.unit.d.ts +0 -1
- package/dist/util/serializer/serializer.test.unit.d.ts +0 -1
- package/dist/util/string/string.test.unit.d.ts +0 -1
- package/dist/util/validate/validate.test.unit.d.ts +0 -1
- /package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
|
@@ -17,6 +17,7 @@ const E = (...r) => {
|
|
|
17
17
|
},
|
|
18
18
|
formatters: !0,
|
|
19
19
|
yaml: !1,
|
|
20
|
+
markdown: !1,
|
|
20
21
|
react: !0
|
|
21
22
|
},
|
|
22
23
|
s,
|
|
@@ -29,7 +30,7 @@ const E = (...r) => {
|
|
|
29
30
|
[n.VITEST_REACT_UNIT]: (r) => a(r),
|
|
30
31
|
[n.VITEST_REACT_E2E]: (r) => m(r)
|
|
31
32
|
};
|
|
32
|
-
function
|
|
33
|
+
function d(r, ...e) {
|
|
33
34
|
const t = T[r];
|
|
34
35
|
if (!e || e.length === 0)
|
|
35
36
|
return t({});
|
|
@@ -38,6 +39,6 @@ function y(r, ...e) {
|
|
|
38
39
|
return t(...e);
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
d as mergeConfigs
|
|
42
43
|
};
|
|
43
44
|
//# sourceMappingURL=config.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.util.js","sources":["../../src/config/config.util.ts"],"sourcesContent":["import antfu from '@antfu/eslint-config';\n\nimport type { T_Object } from '#typescript/index.js';\n\nimport { vitestE2E, vitestUnit } from '#config/vitest/index.js';\nimport { deepMerge } from '#util/index.js';\n\nimport type { T_ConfigHandler, T_ConfigType } from './config.type.js';\n\nimport { E_ConfigType } from './config.type.js';\nimport eslintBaseConfig from './eslint/index.js';\n\n/**\n * Handles ESLint configuration merging and processing.\n * This function merges the base ESLint configuration with additional configs\n * and applies the Antfu ESLint preset with specific styling and formatting rules.\n * It processes ignores separately and applies them as a final configuration layer.\n *\n * The function configures:\n * - Stylistic rules (semicolons, indentation, quotes)\n * - Formatters for CSS, HTML, and Markdown\n * - React support\n * - Custom ignore patterns\n *\n * @param config - Additional ESLint configuration objects to merge with the base config.\n * @returns A processed ESLint configuration object ready for use.\n */\nconst handleESLint: T_ConfigHandler = (...config) => {\n const mergedConfig = deepMerge(\n ...(Array.isArray(eslintBaseConfig) ? eslintBaseConfig : [eslintBaseConfig]),\n ...config,\n );\n\n const { ignores, ...restConfig } = mergedConfig;\n\n return antfu(\n {\n stylistic: {\n semi: true,\n indent: 4,\n },\n formatters: true,\n yaml: false,\n react: true,\n },\n restConfig,\n ...(Array.isArray(ignores) ? [{ ignores }] : []),\n ) as unknown as T_Object;\n};\n\n/**\n * Configuration handlers for different config types.\n * This object maps configuration types to their respective handler functions,\n * providing a centralized way to process different types of configurations\n * with appropriate merging and processing logic.\n */\nconst configHandlers: Record<E_ConfigType, T_ConfigHandler> = {\n [E_ConfigType.ESLINT]: config => handleESLint(config),\n [E_ConfigType.COMMITLINT]: config => deepMerge(config),\n [E_ConfigType.LINT_STAGED]: config => deepMerge(config),\n [E_ConfigType.VITEST_REACT_UNIT]: config => vitestUnit(config) as T_Object,\n [E_ConfigType.VITEST_REACT_E2E]: config => vitestE2E(config) as T_Object,\n};\n\n/**\n * Merges configurations based on the specified type.\n * This function provides a unified interface for merging different types of\n * configurations using their respective handlers. It supports ESLint, commitlint,\n * lint-staged, and Vitest configurations with appropriate processing for each type.\n *\n * The function automatically:\n * - Selects the appropriate handler for the config type\n * - Merges multiple configuration objects\n * - Handles empty configuration arrays gracefully\n * - Provides error handling for unknown config types\n *\n * @param type - The type of configuration to merge (ESLint, commitlint, lint-staged, or Vitest).\n * @param config - Configuration objects to merge, can be empty for default handling.\n * @returns A merged configuration object processed according to the specified type.\n * @throws {Error} When an unknown configuration type is provided.\n */\nexport function mergeConfigs(type: T_ConfigType, ...config: T_Object[]) {\n const handler = configHandlers[type];\n\n if (!config || config.length === 0) {\n return handler({});\n }\n\n if (!handler) {\n throw new Error(`Unknown config type: ${type}`);\n }\n\n return handler(...config);\n}\n"],"names":["antfu","E_ConfigType","eslintBaseConfig","vitestE2E","vitestUnit","deepMerge","handleESLint","config","mergedConfig","ignores","restConfig","configHandlers","mergeConfigs","type","handler"],"mappings":"AA2BA,OAAAA,OAAA;AAAA,SAAA,gBAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,SAAA,cAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,MAAMC,IAAgC,IAAIC,MAAW;AACjD,QAAMC,IAAeH;AAAA,IACjB,GAAI,MAAM,QAAQH,CAAgB,IAAIA,IAAmB,CAACA,CAAgB;AAAA,IAC1E,GAAGK;AAAA,EAAA,GAGD,EAAE,SAAAE,GAAS,GAAGC,EAAA,IAAeF;AAEnC,SAAOR;AAAA,IACH;AAAA,MACI,WAAW;AAAA,QACP,MAAM;AAAA,QACN,QAAQ;AAAA,MAAA;AAAA,MAEZ,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAEXU;AAAA,IACA,GAAI,MAAM,QAAQD,CAAO,IAAI,CAAC,EAAE,SAAAA,EAAA,CAAS,IAAI,CAAA;AAAA,EAAC;AAEtD,GAQME,IAAwD;AAAA,EAC1D,CAACV,EAAa,MAAM,GAAG,CAAAM,MAAUD,EAAaC,CAAM;AAAA,EACpD,CAACN,EAAa,UAAU,GAAG,CAAAM,MAAUF,EAAUE,CAAM;AAAA,EACrD,CAACN,EAAa,WAAW,GAAG,CAAAM,MAAUF,EAAUE,CAAM;AAAA,EACtD,CAACN,EAAa,iBAAiB,GAAG,CAAAM,MAAUH,EAAWG,CAAM;AAAA,EAC7D,CAACN,EAAa,gBAAgB,GAAG,CAAAM,MAAUJ,EAAUI,CAAM;AAC/D;AAmBO,SAASK,EAAaC,MAAuBN,GAAoB;AACpE,QAAMO,IAAUH,EAAeE,CAAI;AAEnC,MAAI,CAACN,KAAUA,EAAO,WAAW;AAC7B,WAAOO,EAAQ,CAAA,CAAE;AAGrB,MAAI,CAACA;AACD,UAAM,IAAI,MAAM,wBAAwBD,CAAI,EAAE;AAGlD,SAAOC,EAAQ,GAAGP,CAAM;AAC5B;"}
|
|
1
|
+
{"version":3,"file":"config.util.js","sources":["../../src/config/config.util.ts"],"sourcesContent":["import antfu from '@antfu/eslint-config';\n\nimport type { T_Object } from '#typescript/index.js';\n\nimport { vitestE2E, vitestUnit } from '#config/vitest/index.js';\nimport { deepMerge } from '#util/index.js';\n\nimport type { T_ConfigHandler, T_ConfigType } from './config.type.js';\n\nimport { E_ConfigType } from './config.type.js';\nimport eslintBaseConfig from './eslint/index.js';\n\n/**\n * Handles ESLint configuration merging and processing.\n * This function merges the base ESLint configuration with additional configs\n * and applies the Antfu ESLint preset with specific styling and formatting rules.\n * It processes ignores separately and applies them as a final configuration layer.\n *\n * The function configures:\n * - Stylistic rules (semicolons, indentation, quotes)\n * - Formatters for CSS, HTML, and Markdown\n * - React support\n * - Custom ignore patterns\n *\n * @param config - Additional ESLint configuration objects to merge with the base config.\n * @returns A processed ESLint configuration object ready for use.\n */\nconst handleESLint: T_ConfigHandler = (...config) => {\n const mergedConfig = deepMerge(\n ...(Array.isArray(eslintBaseConfig) ? eslintBaseConfig : [eslintBaseConfig]),\n ...config,\n );\n\n const { ignores, ...restConfig } = mergedConfig;\n\n return antfu(\n {\n stylistic: {\n semi: true,\n indent: 4,\n },\n formatters: true,\n yaml: false,\n markdown: false,\n react: true,\n },\n restConfig,\n ...(Array.isArray(ignores) ? [{ ignores }] : []),\n ) as unknown as T_Object;\n};\n\n/**\n * Configuration handlers for different config types.\n * This object maps configuration types to their respective handler functions,\n * providing a centralized way to process different types of configurations\n * with appropriate merging and processing logic.\n */\nconst configHandlers: Record<E_ConfigType, T_ConfigHandler> = {\n [E_ConfigType.ESLINT]: config => handleESLint(config),\n [E_ConfigType.COMMITLINT]: config => deepMerge(config),\n [E_ConfigType.LINT_STAGED]: config => deepMerge(config),\n [E_ConfigType.VITEST_REACT_UNIT]: config => vitestUnit(config) as T_Object,\n [E_ConfigType.VITEST_REACT_E2E]: config => vitestE2E(config) as T_Object,\n};\n\n/**\n * Merges configurations based on the specified type.\n * This function provides a unified interface for merging different types of\n * configurations using their respective handlers. It supports ESLint, commitlint,\n * lint-staged, and Vitest configurations with appropriate processing for each type.\n *\n * The function automatically:\n * - Selects the appropriate handler for the config type\n * - Merges multiple configuration objects\n * - Handles empty configuration arrays gracefully\n * - Provides error handling for unknown config types\n *\n * @param type - The type of configuration to merge (ESLint, commitlint, lint-staged, or Vitest).\n * @param config - Configuration objects to merge, can be empty for default handling.\n * @returns A merged configuration object processed according to the specified type.\n * @throws {Error} When an unknown configuration type is provided.\n */\nexport function mergeConfigs(type: T_ConfigType, ...config: T_Object[]) {\n const handler = configHandlers[type];\n\n if (!config || config.length === 0) {\n return handler({});\n }\n\n if (!handler) {\n throw new Error(`Unknown config type: ${type}`);\n }\n\n return handler(...config);\n}\n"],"names":["antfu","E_ConfigType","eslintBaseConfig","vitestE2E","vitestUnit","deepMerge","handleESLint","config","mergedConfig","ignores","restConfig","configHandlers","mergeConfigs","type","handler"],"mappings":"AA2BA,OAAAA,OAAA;AAAA,SAAA,gBAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,SAAA,cAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,MAAMC,IAAgC,IAAIC,MAAW;AACjD,QAAMC,IAAeH;AAAA,IACjB,GAAI,MAAM,QAAQH,CAAgB,IAAIA,IAAmB,CAACA,CAAgB;AAAA,IAC1E,GAAGK;AAAA,EAAA,GAGD,EAAE,SAAAE,GAAS,GAAGC,EAAA,IAAeF;AAEnC,SAAOR;AAAA,IACH;AAAA,MACI,WAAW;AAAA,QACP,MAAM;AAAA,QACN,QAAQ;AAAA,MAAA;AAAA,MAEZ,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IAAA;AAAA,IAEXU;AAAA,IACA,GAAI,MAAM,QAAQD,CAAO,IAAI,CAAC,EAAE,SAAAA,EAAA,CAAS,IAAI,CAAA;AAAA,EAAC;AAEtD,GAQME,IAAwD;AAAA,EAC1D,CAACV,EAAa,MAAM,GAAG,CAAAM,MAAUD,EAAaC,CAAM;AAAA,EACpD,CAACN,EAAa,UAAU,GAAG,CAAAM,MAAUF,EAAUE,CAAM;AAAA,EACrD,CAACN,EAAa,WAAW,GAAG,CAAAM,MAAUF,EAAUE,CAAM;AAAA,EACtD,CAACN,EAAa,iBAAiB,GAAG,CAAAM,MAAUH,EAAWG,CAAM;AAAA,EAC7D,CAACN,EAAa,gBAAgB,GAAG,CAAAM,MAAUJ,EAAUI,CAAM;AAC/D;AAmBO,SAASK,EAAaC,MAAuBN,GAAoB;AACpE,QAAMO,IAAUH,EAAeE,CAAI;AAEnC,MAAI,CAACN,KAAUA,EAAO,WAAW;AAC7B,WAAOO,EAAQ,CAAA,CAAE;AAGrB,MAAI,CAACA;AACD,UAAM,IAAI,MAAM,wBAAwBD,CAAI,EAAE;AAGlD,SAAOC,EAAQ,GAAGP,CAAM;AAC5B;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Preview } from '@storybook/react';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a Storybook preview configuration
|
|
3
|
+
* Creates a Storybook preview configuration with preconfigured controls and background settings.
|
|
4
4
|
* This function generates a preview configuration that provides default parameters
|
|
5
5
|
* and decorators for Storybook stories. It sets up common controls, backgrounds,
|
|
6
6
|
* and viewport settings for consistent story rendering.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
const a = /(background|color)$/i, t = /Date$/i;
|
|
2
|
+
function o(e) {
|
|
2
3
|
const r = {
|
|
3
4
|
parameters: {
|
|
4
5
|
controls: {
|
|
5
6
|
matchers: {
|
|
6
|
-
color:
|
|
7
|
-
date:
|
|
7
|
+
color: a,
|
|
8
|
+
date: t
|
|
8
9
|
}
|
|
9
10
|
},
|
|
10
11
|
backgrounds: {
|
|
@@ -32,6 +33,6 @@ function a(e) {
|
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
o as storybookPreview
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=storybook.preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.preview.js","sources":["../../../src/config/storybook/storybook.preview.ts"],"sourcesContent":["import type { Preview } from '@storybook/react';\n\n/**\n * Creates a Storybook preview configuration
|
|
1
|
+
{"version":3,"file":"storybook.preview.js","sources":["../../../src/config/storybook/storybook.preview.ts"],"sourcesContent":["import type { Preview } from '@storybook/react';\n\nconst RE_COLOR_MATCHER = /(background|color)$/i;\nconst RE_DATE_MATCHER = /Date$/i;\n\n/**\n * Creates a Storybook preview configuration with preconfigured controls and background settings.\n * This function generates a preview configuration that provides default parameters\n * and decorators for Storybook stories. It sets up common controls, backgrounds,\n * and viewport settings for consistent story rendering.\n *\n * The configuration includes:\n * - Default control parameters for common props\n * - Background color options\n * - Viewport presets for responsive testing\n * - Actions configuration for event handlers\n * - Configurable options merging\n *\n * @param options - Additional preview configuration options to merge with the base config.\n * @returns A Storybook preview configuration object.\n */\nexport function storybookPreview(options?: Partial<Preview>): Preview {\n const preview: Preview = {\n parameters: {\n controls: {\n matchers: {\n color: RE_COLOR_MATCHER,\n date: RE_DATE_MATCHER,\n },\n },\n backgrounds: {\n default: 'light',\n values: [\n {\n name: 'light',\n value: '#ffffff',\n },\n {\n name: 'dark',\n value: '#333333',\n },\n ],\n },\n },\n };\n\n return {\n ...preview,\n ...options,\n parameters: {\n ...preview.parameters,\n ...options?.parameters,\n },\n };\n}\n"],"names":["RE_COLOR_MATCHER","RE_DATE_MATCHER","storybookPreview","options","preview"],"mappings":"AAEA,MAAMA,IAAmB,wBACnBC,IAAkB;AAkBjB,SAASC,EAAiBC,GAAqC;AAClE,QAAMC,IAAmB;AAAA,IACrB,YAAY;AAAA,MACR,UAAU;AAAA,QACN,UAAU;AAAA,UACN,OAAOJ;AAAA,UACP,MAAMC;AAAA,QAAA;AAAA,MACV;AAAA,MAEJ,aAAa;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,UACJ;AAAA,YACI,MAAM;AAAA,YACN,OAAO;AAAA,UAAA;AAAA,UAEX;AAAA,YACI,MAAM;AAAA,YACN,OAAO;AAAA,UAAA;AAAA,QACX;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAGJ,SAAO;AAAA,IACH,GAAGG;AAAA,IACH,GAAGD;AAAA,IACH,YAAY;AAAA,MACR,GAAGC,EAAQ;AAAA,MACX,GAAGD,GAAS;AAAA,IAAA;AAAA,EAChB;AAER;"}
|
|
@@ -16,3 +16,5 @@ import { UserConfig } from 'vite';
|
|
|
16
16
|
* @returns A Vitest configuration object optimized for end-to-end testing with browser automation.
|
|
17
17
|
*/
|
|
18
18
|
export declare function vitestE2E(options: UserConfig): UserConfig;
|
|
19
|
+
declare const _default: UserConfig;
|
|
20
|
+
export default _default;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineConfig as
|
|
3
|
-
import { deepMerge as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
plugins: [
|
|
1
|
+
import o from "@vitejs/plugin-react-swc";
|
|
2
|
+
import { defineConfig as i } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js";
|
|
3
|
+
import { deepMerge as r } from "../../util/object/object.util.js";
|
|
4
|
+
function n(e) {
|
|
5
|
+
const t = {
|
|
6
|
+
plugins: [o()],
|
|
7
7
|
test: {
|
|
8
|
-
include: ["**/*.test.e2e.?(c|m)[jt]s?(x)"]
|
|
9
|
-
browser: {
|
|
10
|
-
enabled: !0,
|
|
11
|
-
provider: "playwright",
|
|
12
|
-
instances: [
|
|
13
|
-
{ browser: "chromium" },
|
|
14
|
-
{ browser: "firefox" },
|
|
15
|
-
{ browser: "webkit" }
|
|
16
|
-
]
|
|
17
|
-
}
|
|
8
|
+
include: ["**/*.test.e2e.?(c|m)[jt]s?(x)"]
|
|
18
9
|
}
|
|
19
10
|
};
|
|
20
|
-
return
|
|
11
|
+
return i(r(t, e));
|
|
21
12
|
}
|
|
13
|
+
const m = n({});
|
|
22
14
|
export {
|
|
23
|
-
m as
|
|
15
|
+
m as default,
|
|
16
|
+
n as vitestE2E
|
|
24
17
|
};
|
|
25
18
|
//# sourceMappingURL=vitest.e2e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.e2e.js","sources":["../../../src/config/vitest/vitest.e2e.ts"],"sourcesContent":["import type { UserConfig } from 'vite';\n\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vitest/config';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Vitest configuration for end-to-end testing with browser automation.\n * This function generates a Vitest configuration specifically designed for E2E testing\n * using Playwright with multiple browser instances. It includes React support and\n * browser automation capabilities for comprehensive end-to-end testing.\n *\n * The configuration includes:\n * - React SWC plugin for fast React compilation\n * - Browser automation with Playwright provider\n * - Multiple browser instances (Chromium, Firefox, WebKit)\n * - E2E test file pattern matching\n * - Configurable options merging\n *\n * @param options - Additional Vite configuration options to merge with the E2E config.\n * @returns A Vitest configuration object optimized for end-to-end testing with browser automation.\n */\nexport function vitestE2E(options: UserConfig) {\n const config = {\n plugins: [react()],\n test: {\n include: ['**/*.test.e2e.?(c|m)[jt]s?(x)'],\n
|
|
1
|
+
{"version":3,"file":"vitest.e2e.js","sources":["../../../src/config/vitest/vitest.e2e.ts"],"sourcesContent":["import type { UserConfig } from 'vite';\n\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vitest/config';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Vitest configuration for end-to-end testing with browser automation.\n * This function generates a Vitest configuration specifically designed for E2E testing\n * using Playwright with multiple browser instances. It includes React support and\n * browser automation capabilities for comprehensive end-to-end testing.\n *\n * The configuration includes:\n * - React SWC plugin for fast React compilation\n * - Browser automation with Playwright provider\n * - Multiple browser instances (Chromium, Firefox, WebKit)\n * - E2E test file pattern matching\n * - Configurable options merging\n *\n * @param options - Additional Vite configuration options to merge with the E2E config.\n * @returns A Vitest configuration object optimized for end-to-end testing with browser automation.\n */\nexport function vitestE2E(options: UserConfig) {\n const config = {\n plugins: [react()],\n test: {\n include: ['**/*.test.e2e.?(c|m)[jt]s?(x)'],\n },\n };\n\n return defineConfig(deepMerge(config as any, options as any) as UserConfig);\n}\n\nexport default vitestE2E({});\n"],"names":["vitestE2E","options","config","react","defineConfig","deepMerge","vitest_e2e"],"mappings":";;;AAuBO,SAASA,EAAUC,GAAqB;AAC3C,QAAMC,IAAS;AAAA,IACX,SAAS,CAACC,GAAO;AAAA,IACjB,MAAM;AAAA,MACF,SAAS,CAAC,+BAA+B;AAAA,IAAA;AAAA,EAC7C;AAGJ,SAAOC,EAAaC,EAAUH,GAAeD,CAAc,CAAe;AAC9E;AAEA,MAAAK,IAAeN,EAAU,CAAA,CAAE;"}
|
|
@@ -18,3 +18,5 @@ import { UserConfig } from 'vite';
|
|
|
18
18
|
* @returns A Vitest configuration object optimized for unit testing with React and DOM support.
|
|
19
19
|
*/
|
|
20
20
|
export declare function vitestUnit(options: UserConfig): UserConfig;
|
|
21
|
+
declare const _default: UserConfig;
|
|
22
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import r from "@vitejs/plugin-react-swc";
|
|
2
|
-
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.
|
|
2
|
+
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js";
|
|
3
3
|
import { deepMerge as s } from "../../util/object/object.util.js";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
4
|
+
function i(t) {
|
|
5
|
+
const e = {
|
|
6
6
|
plugins: [r()],
|
|
7
7
|
test: {
|
|
8
8
|
globals: !0,
|
|
@@ -23,9 +23,11 @@ function p(e) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return o(s(
|
|
26
|
+
return o(s(e, t));
|
|
27
27
|
}
|
|
28
|
+
const p = i({});
|
|
28
29
|
export {
|
|
29
|
-
p as
|
|
30
|
+
p as default,
|
|
31
|
+
i as vitestUnit
|
|
30
32
|
};
|
|
31
33
|
//# sourceMappingURL=vitest.unit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.unit.js","sources":["../../../src/config/vitest/vitest.unit.ts"],"sourcesContent":["import type { UserConfig } from 'vite';\n\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vitest/config';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Vitest configuration for unit testing with React support.\n * This function generates a Vitest configuration specifically designed for unit testing\n * React components and JavaScript/TypeScript modules. It includes JSDOM environment\n * for DOM simulation and comprehensive testing setup.\n *\n * The configuration includes:\n * - React SWC plugin for fast React compilation\n * - JSDOM environment for DOM simulation\n * - Global test functions availability\n * - VM threads pool for parallel test execution\n * - Unit test file pattern matching\n * - Setup files for testing library configuration\n * - Configurable options merging\n *\n * @param options - Additional Vite configuration options to merge with the unit test config.\n * @returns A Vitest configuration object optimized for unit testing with React and DOM support.\n */\nexport function vitestUnit(options: UserConfig) {\n const config = {\n plugins: [react()],\n test: {\n globals: true,\n environment: 'jsdom',\n pool: 'vmThreads',\n include: ['**/*.test.unit.?(c|m)[jt]s?(x)'],\n setupFiles: ['./vitest.unit.setup.ts'],\n coverage: {\n provider: 'istanbul',\n reporter: ['text', 'lcov'],\n reportsDirectory: './coverage',\n thresholds: {\n statements: 80,\n branches: 80,\n functions: 80,\n lines: 80,\n },\n },\n },\n };\n\n return defineConfig(deepMerge(config as any, options as any) as UserConfig);\n}\n"],"names":["vitestUnit","options","config","react","defineConfig","deepMerge"],"mappings":";;;AAyBO,SAASA,EAAWC,GAAqB;AAC5C,QAAMC,IAAS;AAAA,IACX,SAAS,CAACC,GAAO;AAAA,IACjB,MAAM;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS,CAAC,gCAAgC;AAAA,MAC1C,YAAY,CAAC,wBAAwB;AAAA,MACrC,UAAU;AAAA,QACN,UAAU;AAAA,QACV,UAAU,CAAC,QAAQ,MAAM;AAAA,QACzB,kBAAkB;AAAA,QAClB,YAAY;AAAA,UACR,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,WAAW;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACX;AAAA,IACJ;AAAA,EACJ;AAGJ,SAAOC,EAAaC,EAAUH,GAAeD,CAAc,CAAe;AAC9E;"}
|
|
1
|
+
{"version":3,"file":"vitest.unit.js","sources":["../../../src/config/vitest/vitest.unit.ts"],"sourcesContent":["import type { UserConfig } from 'vite';\n\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vitest/config';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Vitest configuration for unit testing with React support.\n * This function generates a Vitest configuration specifically designed for unit testing\n * React components and JavaScript/TypeScript modules. It includes JSDOM environment\n * for DOM simulation and comprehensive testing setup.\n *\n * The configuration includes:\n * - React SWC plugin for fast React compilation\n * - JSDOM environment for DOM simulation\n * - Global test functions availability\n * - VM threads pool for parallel test execution\n * - Unit test file pattern matching\n * - Setup files for testing library configuration\n * - Configurable options merging\n *\n * @param options - Additional Vite configuration options to merge with the unit test config.\n * @returns A Vitest configuration object optimized for unit testing with React and DOM support.\n */\nexport function vitestUnit(options: UserConfig) {\n const config = {\n plugins: [react()],\n test: {\n globals: true,\n environment: 'jsdom',\n pool: 'vmThreads',\n include: ['**/*.test.unit.?(c|m)[jt]s?(x)'],\n setupFiles: ['./vitest.unit.setup.ts'],\n coverage: {\n provider: 'istanbul',\n reporter: ['text', 'lcov'],\n reportsDirectory: './coverage',\n thresholds: {\n statements: 80,\n branches: 80,\n functions: 80,\n lines: 80,\n },\n },\n },\n };\n\n return defineConfig(deepMerge(config as any, options as any) as UserConfig);\n}\n\nexport default vitestUnit({});\n"],"names":["vitestUnit","options","config","react","defineConfig","deepMerge","vitest_unit"],"mappings":";;;AAyBO,SAASA,EAAWC,GAAqB;AAC5C,QAAMC,IAAS;AAAA,IACX,SAAS,CAACC,GAAO;AAAA,IACjB,MAAM;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS,CAAC,gCAAgC;AAAA,MAC1C,YAAY,CAAC,wBAAwB;AAAA,MACrC,UAAU;AAAA,QACN,UAAU;AAAA,QACV,UAAU,CAAC,QAAQ,MAAM;AAAA,QACzB,kBAAkB;AAAA,QAClB,YAAY;AAAA,UACR,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,WAAW;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACX;AAAA,IACJ;AAAA,EACJ;AAGJ,SAAOC,EAAaC,EAAUH,GAAeD,CAAc,CAAe;AAC9E;AAEA,MAAAK,IAAeN,EAAW,CAAA,CAAE;"}
|
package/dist/node/cli/index.js
CHANGED
|
@@ -1,99 +1,109 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import s from "node:process";
|
|
3
3
|
import { hideBin as M } from "yargs/helpers";
|
|
4
4
|
import _ from "yargs/yargs";
|
|
5
|
-
import { runCommand as n, clearAllErrorLists as
|
|
6
|
-
import { getPackage as
|
|
7
|
-
import { pathExistsSync as
|
|
8
|
-
import { resolve as
|
|
9
|
-
import { CYBERSKILL_CLI as G, command as i, CYBERSKILL_PACKAGE_NAME as
|
|
10
|
-
import { log as
|
|
5
|
+
import { runCommand as n, clearAllErrorLists as l, getStoredErrorLists as D, resolveCommands as L } from "../command/command.util.js";
|
|
6
|
+
import { getPackage as p, installDependencies as y } from "../package/package.util.js";
|
|
7
|
+
import { pathExistsSync as f, addGitIgnoreEntry as h, removeSync as k, readFileSync as O, writeFileSync as T } from "../fs/fs.util.js";
|
|
8
|
+
import { resolve as b } from "../path/path.util.js";
|
|
9
|
+
import { CYBERSKILL_CLI as G, command as i, CYBERSKILL_PACKAGE_NAME as g, PATH as o, SIMPLE_GIT_HOOK_JSON as R, createGitHooksConfig as A, AG_KIT_PACKAGE_NAME as m, DOT_AGENT as B } from "../path/path.constant.js";
|
|
10
|
+
import { log as c, catchError as E } from "../log/log.util.js";
|
|
11
11
|
import { E_IssueType as d } from "../log/log.type.js";
|
|
12
12
|
function N() {
|
|
13
13
|
try {
|
|
14
14
|
return JSON.parse(
|
|
15
|
-
|
|
15
|
+
O(b(__dirname, "../../../package.json"), "utf-8")
|
|
16
16
|
).version;
|
|
17
17
|
} catch {
|
|
18
18
|
return "1.0.0";
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
async function S() {
|
|
22
|
-
|
|
22
|
+
f(o.TS_CONFIG) ? await n("Performing TypeScript validation", await i.typescriptCheck()) : c.warn("No TypeScript configuration found. Skipping type check.");
|
|
23
23
|
}
|
|
24
|
-
async function
|
|
24
|
+
async function C(t = !1) {
|
|
25
25
|
const a = t ? await i.eslintFix() : await i.eslintCheck(), r = t ? "Running ESLint with auto-fix" : "Running ESLint check";
|
|
26
26
|
try {
|
|
27
27
|
await n(r, a, { timeout: 6e4, throwOnError: !0 });
|
|
28
28
|
} catch (e) {
|
|
29
|
-
e.code === "ETIMEDOUT" || e.killed || e.signal === "SIGTERM" ? (
|
|
29
|
+
e.code === "ETIMEDOUT" || e.killed || e.signal === "SIGTERM" ? (c.warn("Lint check timed out. Retrying with debug mode enabled..."), s.env.DEBUG = "true", await n(`${r} (Debug Mode)`, a)) : E(e);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function w(t, a) {
|
|
33
33
|
if (!a.length)
|
|
34
34
|
return;
|
|
35
35
|
const r = t === "Errors" ? "red" : "yellow";
|
|
36
|
-
|
|
36
|
+
c.printBoxedLog(t === "Errors" ? "✖ Errors" : "⚠ Warnings", a, r);
|
|
37
37
|
}
|
|
38
|
-
async function
|
|
38
|
+
async function u() {
|
|
39
39
|
setTimeout(async () => {
|
|
40
|
-
const t = await
|
|
41
|
-
!a.length && !r.length ?
|
|
40
|
+
const t = await D() || [], a = t.filter((e) => e.type === d.Error), r = t.filter((e) => e.type === d.Warning);
|
|
41
|
+
!a.length && !r.length ? c.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (w("Warnings", r), w("Errors", a), a.length > 0 && s.exit(1));
|
|
42
42
|
}, 0);
|
|
43
43
|
}
|
|
44
44
|
async function P() {
|
|
45
|
-
await
|
|
46
|
-
const t = await
|
|
45
|
+
await l();
|
|
46
|
+
const t = await p({ name: g });
|
|
47
47
|
if (!t.success) {
|
|
48
|
-
|
|
48
|
+
c.error("Failed to retrieve package information. Aborting lint-staged.");
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
t.result.isCurrentProject && await n(`Building package: ${
|
|
51
|
+
t.result.isCurrentProject && await n(`Building package: ${g}`, await i.build()), await n("Executing lint-staged", await i.lintStaged()), u();
|
|
52
52
|
}
|
|
53
|
-
async function
|
|
53
|
+
async function x() {
|
|
54
54
|
await n("Inspecting ESLint configuration", await i.eslintInspect());
|
|
55
55
|
}
|
|
56
|
-
async function
|
|
57
|
-
await
|
|
56
|
+
async function U() {
|
|
57
|
+
await l(), await S(), await C(), u();
|
|
58
58
|
}
|
|
59
59
|
async function K() {
|
|
60
|
-
await
|
|
60
|
+
await l(), await S(), await C(!0), u();
|
|
61
61
|
}
|
|
62
|
-
async function
|
|
63
|
-
await
|
|
62
|
+
async function j() {
|
|
63
|
+
await l(), await n("Validating commit message", await i.commitLint()), u();
|
|
64
64
|
}
|
|
65
65
|
async function I() {
|
|
66
66
|
await n("Configuring Git hooks", await i.configureGitHook()), k(o.GIT_HOOK);
|
|
67
|
-
const t = await
|
|
68
|
-
|
|
67
|
+
const t = await L(A);
|
|
68
|
+
T(o.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(t, null, 4)), h(o.GIT_IGNORE, R), await n("Setting up simple-git-hooks", await i.simpleGitHooks());
|
|
69
69
|
}
|
|
70
|
-
async function
|
|
70
|
+
async function v() {
|
|
71
71
|
try {
|
|
72
|
-
await n(`Checking for ${
|
|
72
|
+
await n(`Checking for ${m}`, `pnpm list -g ${m}`);
|
|
73
73
|
} catch {
|
|
74
|
-
await n(`Installing ${
|
|
74
|
+
await n(`Installing ${m} globally`, `pnpm i -g ${m}`);
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
f(o.DOT_AGENT) ? await n("Updating AI agent", "echo y | ag-kit update") : await n("Initializing AI agent", "ag-kit init"), h(o.GIT_EXCLUDE, B);
|
|
77
|
+
}
|
|
78
|
+
async function F() {
|
|
79
|
+
await y(), await I();
|
|
77
80
|
}
|
|
78
81
|
async function H() {
|
|
79
|
-
await
|
|
82
|
+
k(o.NODE_MODULES, o.PNPM_LOCK_YAML), await n("Pruning pnpm store", await i.pnpmPruneStore()), await n("Clearing pnpm cache", await i.pnpmCleanCache()), await y(), await I(), await v();
|
|
80
83
|
}
|
|
81
84
|
async function $() {
|
|
82
|
-
k(o.NODE_MODULES, o.PNPM_LOCK_YAML), await n("Pruning pnpm store", await i.pnpmPruneStore()), await n("Clearing pnpm cache", await i.pnpmCleanCache()), await w(), await I(), await C();
|
|
83
|
-
}
|
|
84
|
-
async function j() {
|
|
85
85
|
await n("Inspecting project dependencies", await i.nodeModulesInspect());
|
|
86
86
|
}
|
|
87
87
|
async function J() {
|
|
88
|
-
|
|
88
|
+
try {
|
|
89
|
+
const t = await p({ name: g }), a = t.success && t.result.isCurrentProject ? "pnpm exec vitest run" : await i.testUnit();
|
|
90
|
+
await n("Running unit tests", a, { throwOnError: !0 });
|
|
91
|
+
} catch {
|
|
92
|
+
s.exit(1);
|
|
93
|
+
}
|
|
89
94
|
}
|
|
90
95
|
async function V() {
|
|
91
|
-
|
|
96
|
+
try {
|
|
97
|
+
const t = await p({ name: g }), a = t.success && t.result.isCurrentProject ? "pnpm exec vitest run --passWithNoTests --config src/config/vitest/vitest.e2e.ts" : await i.testE2e();
|
|
98
|
+
await n("Running end-to-end tests", a, { throwOnError: !0 });
|
|
99
|
+
} catch {
|
|
100
|
+
s.exit(1);
|
|
101
|
+
}
|
|
92
102
|
}
|
|
93
|
-
async function
|
|
103
|
+
async function W(t) {
|
|
94
104
|
await n("Creating MongoDB migration", await i.mongoMigrateCreate(t));
|
|
95
105
|
}
|
|
96
|
-
async function
|
|
106
|
+
async function z() {
|
|
97
107
|
await n("Running MongoDB migrations", await i.mongoMigrateUp());
|
|
98
108
|
}
|
|
99
109
|
async function Y() {
|
|
@@ -107,19 +117,19 @@ async function X() {
|
|
|
107
117
|
}
|
|
108
118
|
(async () => {
|
|
109
119
|
try {
|
|
110
|
-
await _(M(
|
|
120
|
+
await _(M(s.argv)).scriptName(G).usage("$0 <command> [options]").command("ai:setup", "Setup AI agent environment", v).command("lint", "Check code for linting issues", U).command("lint:fix", "Fix linting issues automatically", K).command("lint:inspect", "View active ESLint configuration", x).command("lint-staged", "Run lint checks on staged files", P).command("commitlint", "Validate commit message format", j).command("ready", "Initialize project and dependencies", F).command("reset", "Reset the project and reinstall dependencies", H).command("inspect", "Analyze installed project dependencies", $).command("test:unit", "Run unit test suite", J).command("test:e2e", "Run end-to-end test suite", V).command("mongo:migrate:create <name>", "Create a MongoDB migration", (t) => t.positional("name", {
|
|
111
121
|
describe: "Migration name",
|
|
112
122
|
type: "string"
|
|
113
123
|
}), async (t) => {
|
|
114
124
|
if (!t.name) {
|
|
115
|
-
|
|
125
|
+
c.error("Migration name is required.");
|
|
116
126
|
return;
|
|
117
127
|
}
|
|
118
|
-
await
|
|
119
|
-
}).command("mongo:migrate:up", "Apply all MongoDB migrations",
|
|
128
|
+
await W(t.name);
|
|
129
|
+
}).command("mongo:migrate:up", "Apply all MongoDB migrations", z).command("mongo:migrate:down", "Rollback last MongoDB migration", Y).command("storybook:dev", "Start Storybook development server", q).command("storybook:build", "Build Storybook for production", X).demandCommand(1, "Please specify a valid command.").strict().help().alias("h", "help").alias("v", "version").version(N()).epilog(`💡 Tip: Use "--help" with any command to see options
|
|
120
130
|
`).parse();
|
|
121
131
|
} catch (t) {
|
|
122
|
-
E(t),
|
|
132
|
+
E(t), s.exit(1);
|
|
123
133
|
}
|
|
124
134
|
})();
|
|
125
135
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/node/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport process from 'node:process';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nimport type { I_IssueEntry } from '../log/index.js';\n\nimport { clearAllErrorLists, getStoredErrorLists, resolveCommands, runCommand } from '../command/index.js';\nimport { addGitIgnoreEntry, pathExistsSync, readFileSync, removeSync, writeFileSync } from '../fs/index.js';\nimport { catchError, E_IssueType, log } from '../log/index.js';\nimport { getPackage, installDependencies } from '../package/index.js';\nimport { AG_KIT_PACKAGE_NAME, command, createGitHooksConfig, CYBERSKILL_CLI, CYBERSKILL_PACKAGE_NAME, DOT_AGENT, PATH, resolve, SIMPLE_GIT_HOOK_JSON } from '../path/index.js';\n\n/**\n * Retrieves the version from the package.json file.\n * This function reads the package.json file and extracts the version number.\n * If the file cannot be read or parsed, it returns a default version of '1.0.0'.\n *\n * @returns The version string from package.json or '1.0.0' as fallback.\n */\nfunction getVersion(): string {\n try {\n const pkg = JSON.parse(\n readFileSync(resolve(__dirname, '../../../package.json'), 'utf-8'),\n );\n return pkg.version;\n }\n catch {\n return '1.0.0';\n }\n}\n\n/**\n * Performs TypeScript validation if a TypeScript configuration file exists.\n * This function checks for the presence of a TypeScript configuration file\n * and runs TypeScript validation if found. If no configuration is found,\n * it logs a warning and skips the type check.\n *\n * @returns A promise that resolves when the TypeScript validation is complete.\n */\nasync function checkTypescript() {\n if (pathExistsSync(PATH.TS_CONFIG)) {\n await runCommand('Performing TypeScript validation', await command.typescriptCheck());\n }\n else {\n log.warn('No TypeScript configuration found. Skipping type check.');\n }\n}\n\n/**\n * Performs ESLint checking with optional auto-fix functionality.\n * This function runs ESLint checks on the codebase and optionally applies\n * automatic fixes to resolve linting issues.\n *\n * @param fix - Whether to apply automatic fixes to linting issues (default: false).\n * @returns A promise that resolves when the ESLint check is complete.\n */\nasync function checkEslint(fix = false) {\n const commandToRun = fix ? await command.eslintFix() : await command.eslintCheck();\n const label = fix ? 'Running ESLint with auto-fix' : 'Running ESLint check';\n\n try {\n await runCommand(label, commandToRun, { timeout: 60000, throwOnError: true });\n }\n catch (error: any) {\n if (error.code === 'ETIMEDOUT' || error.killed || error.signal === 'SIGTERM') {\n log.warn('Lint check timed out. Retrying with debug mode enabled...');\n process.env['DEBUG'] = 'true';\n await runCommand(`${label} (Debug Mode)`, commandToRun);\n }\n else {\n catchError(error);\n }\n }\n}\n\n/**\n * Prints a formatted list of issues (errors or warnings) to the console.\n * This function displays issues in a boxed format with appropriate color coding\n * based on the issue type. It only displays issues if the list is not empty.\n *\n * @param type - The type of issues to display ('Errors' or 'Warnings').\n * @param list - An array of issue entries to display.\n */\nfunction printIssues(type: 'Errors' | 'Warnings', list: I_IssueEntry[]) {\n if (!list.length) {\n return;\n }\n\n const color = type === 'Errors' ? 'red' : 'yellow';\n log.printBoxedLog(type === 'Errors' ? '✖ Errors' : '⚠ Warnings', list, color);\n}\n\n/**\n * Displays the final check results after all validation processes.\n * This function retrieves stored error lists and displays them in a formatted manner.\n * If no errors or warnings are found, it displays a success message. If errors are found,\n * it exits the process with code 1 to indicate failure.\n *\n * @returns A promise that resolves when the results are displayed.\n */\nasync function showCheckResult() {\n setTimeout(async () => {\n const allResults = (await getStoredErrorLists()) || [];\n const errors = allResults.filter(e => e.type === E_IssueType.Error);\n const warnings = allResults.filter(e => e.type === E_IssueType.Warning);\n\n if (!errors.length && !warnings.length) {\n log.printBoxedLog('✔ NO ISSUES FOUND', [], 'green');\n }\n else {\n printIssues('Warnings', warnings);\n printIssues('Errors', errors);\n\n if (errors.length > 0) {\n process.exit(1);\n }\n }\n }, 0);\n}\n\n/**\n * Executes lint-staged to check only staged files.\n * This function runs lint-staged which executes linting tools only on files\n * that are staged for commit. It includes building the package if it's the current project\n * and displays the results after completion.\n *\n * @returns A promise that resolves when lint-staged execution is complete.\n */\nasync function lintStaged() {\n await clearAllErrorLists();\n const packageData = await getPackage({ name: CYBERSKILL_PACKAGE_NAME });\n\n if (!packageData.success) {\n log.error('Failed to retrieve package information. Aborting lint-staged.');\n return;\n }\n\n if (packageData.result.isCurrentProject) {\n await runCommand(`Building package: ${CYBERSKILL_PACKAGE_NAME}`, await command.build());\n }\n\n await runCommand('Executing lint-staged', await command.lintStaged());\n showCheckResult();\n}\n\n/**\n * Inspects the ESLint configuration to show active rules and settings.\n * This function runs ESLint inspection to display the current configuration,\n * including which rules are active and their settings.\n *\n * @returns A promise that resolves when the ESLint inspection is complete.\n */\nasync function inspectLint() {\n await runCommand('Inspecting ESLint configuration', await command.eslintInspect());\n}\n\n/**\n * Performs comprehensive linting checks including TypeScript and ESLint.\n * This function runs both TypeScript validation and ESLint checks in parallel,\n * then displays the combined results.\n *\n * @returns A promise that resolves when all linting checks are complete.\n */\nasync function lintCheck() {\n await clearAllErrorLists();\n await checkTypescript();\n await checkEslint();\n showCheckResult();\n}\n\n/**\n * Performs comprehensive linting checks with automatic fixes.\n * This function runs both TypeScript validation and ESLint checks with auto-fix\n * in parallel, then displays the combined results.\n *\n * @returns A promise that resolves when all linting checks with fixes are complete.\n */\nasync function lintFix() {\n await clearAllErrorLists();\n await checkTypescript();\n await checkEslint(true);\n showCheckResult();\n}\n\n/**\n * Validates commit message format using commitlint.\n * This function runs commitlint to check if the current commit message\n * follows the conventional commit format and displays the results.\n *\n * @returns A promise that resolves when commit message validation is complete.\n */\nasync function commitLint() {\n await clearAllErrorLists();\n await runCommand('Validating commit message', await command.commitLint());\n showCheckResult();\n}\n\n/**\n * Sets up Git hooks for automated code quality checks.\n * This function configures Git hooks using simple-git-hooks, creates the necessary\n * configuration files, and updates .gitignore to exclude hook configuration files.\n * It also sets up the hooks to run linting and commit validation automatically.\n *\n * @returns A promise that resolves when Git hook setup is complete.\n */\nasync function gitHookSetup() {\n await runCommand('Configuring Git hooks', await command.configureGitHook());\n\n removeSync(PATH.GIT_HOOK);\n\n const hooks = await resolveCommands(createGitHooksConfig);\n\n writeFileSync(PATH.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(hooks, null, 4));\n\n addGitIgnoreEntry(PATH.GIT_IGNORE, SIMPLE_GIT_HOOK_JSON);\n\n await runCommand('Setting up simple-git-hooks', await command.simpleGitHooks());\n}\n\n/**\n * Sets up the AI agent environment.\n * This function ensures the ag-kit package is installed globally, initializes\n * or updates the AI agent configuration, and adds the agent directory\n * to .gitignore to exclude it from version control.\n *\n * @returns A promise that resolves when the AI agent setup is complete.\n */\nasync function aiSetup() {\n try {\n await runCommand(`Checking for ${AG_KIT_PACKAGE_NAME}`, `pnpm list -g ${AG_KIT_PACKAGE_NAME}`);\n }\n catch {\n await runCommand(`Installing ${AG_KIT_PACKAGE_NAME} globally`, `pnpm i -g ${AG_KIT_PACKAGE_NAME}`);\n }\n\n if (pathExistsSync(PATH.DOT_AGENT)) {\n await runCommand('Updating AI agent', 'ag-kit update -y');\n }\n else {\n await runCommand('Initializing AI agent', 'ag-kit init');\n }\n\n addGitIgnoreEntry(PATH.GIT_EXCLUDE, DOT_AGENT);\n}\n\n/**\n * Initializes the project with dependencies and Git hooks.\n * This function installs project dependencies and sets up Git hooks for\n * automated code quality checks. It's typically run when setting up a new project.\n *\n * @returns A promise that resolves when project initialization is complete.\n */\nasync function ready() {\n await installDependencies();\n await gitHookSetup();\n}\n\n/**\n * Resets the project by removing dependencies and reinstalling them.\n * This function removes node_modules and lock files, cleans the package manager cache,\n * reinstalls dependencies, and sets up Git hooks. It's useful for resolving\n * dependency-related issues.\n *\n * @returns A promise that resolves when project reset is complete.\n */\nasync function reset() {\n removeSync(PATH.NODE_MODULES, PATH.PNPM_LOCK_YAML);\n await runCommand('Pruning pnpm store', await command.pnpmPruneStore());\n await runCommand('Clearing pnpm cache', await command.pnpmCleanCache());\n await installDependencies();\n await gitHookSetup();\n await aiSetup();\n}\n\n/**\n * Inspects project dependencies to analyze their status.\n * This function runs dependency inspection to check for outdated packages,\n * security vulnerabilities, and other dependency-related issues.\n *\n * @returns A promise that resolves when dependency inspection is complete.\n */\nasync function inspect() {\n await runCommand('Inspecting project dependencies', await command.nodeModulesInspect());\n}\n\n/**\n * Runs the unit test suite.\n * This function executes unit tests using the configured test runner\n * and displays the test results.\n *\n * @returns A promise that resolves when unit tests are complete.\n */\nasync function testUnit() {\n await runCommand('Running unit tests', await command.testUnit());\n}\n\n/**\n * Runs the end-to-end test suite.\n * This function executes end-to-end tests using the configured test runner\n * and displays the test results.\n *\n * @returns A promise that resolves when end-to-end tests are complete.\n */\nasync function testE2E() {\n await runCommand('Running end-to-end tests', await command.testE2e());\n}\n\n/**\n * Creates a new MongoDB migration file.\n * This function creates a new migration file with the specified name\n * for database schema changes.\n *\n * @param migrationName - The name for the new migration file.\n * @returns A promise that resolves when the migration file is created.\n */\nasync function mongoMigrateCreate(migrationName: string) {\n await runCommand('Creating MongoDB migration', await command.mongoMigrateCreate(migrationName));\n}\n\n/**\n * Applies all pending MongoDB migrations.\n * This function runs all pending database migrations to update the database schema\n * to the latest version.\n *\n * @returns A promise that resolves when all migrations are applied.\n */\nasync function mongoMigrateUp() {\n await runCommand('Running MongoDB migrations', await command.mongoMigrateUp());\n}\n\n/**\n * Rolls back the last applied MongoDB migration.\n * This function reverts the most recent database migration, undoing\n * the last schema change.\n *\n * @returns A promise that resolves when the migration is rolled back.\n */\nasync function mongoMigrateDown() {\n await runCommand('Rolling back MongoDB migration', await command.mongoMigrateDown());\n}\n\n/**\n * Starts the Storybook development server.\n * This function runs Storybook in development mode, allowing you to\n * view and interact with your component stories in a browser.\n *\n * @returns A promise that resolves when the Storybook dev server is started.\n */\nasync function storybookDev() {\n await runCommand('Starting Storybook development server', await command.storybookDev());\n}\n\n/**\n * Builds Storybook for production deployment.\n * This function creates a static build of Storybook that can be\n * deployed to a web server or hosting service.\n *\n * @returns A promise that resolves when the Storybook build is complete.\n */\nasync function storybookBuild() {\n await runCommand('Building Storybook', await command.storybookBuild());\n}\n\n(async () => {\n try {\n await yargs(hideBin(process.argv))\n .scriptName(CYBERSKILL_CLI)\n .usage('$0 <command> [options]')\n .command('ai:setup', 'Setup AI agent environment', aiSetup)\n .command('lint', 'Check code for linting issues', lintCheck)\n .command('lint:fix', 'Fix linting issues automatically', lintFix)\n .command('lint:inspect', 'View active ESLint configuration', inspectLint)\n .command('lint-staged', 'Run lint checks on staged files', lintStaged)\n .command('commitlint', 'Validate commit message format', commitLint)\n .command('ready', 'Initialize project and dependencies', ready)\n .command('reset', 'Reset the project and reinstall dependencies', reset)\n .command('inspect', 'Analyze installed project dependencies', inspect)\n .command('test:unit', 'Run unit test suite', testUnit)\n .command('test:e2e', 'Run end-to-end test suite', testE2E)\n .command('mongo:migrate:create <name>', 'Create a MongoDB migration', y =>\n y.positional('name', {\n describe: 'Migration name',\n type: 'string',\n }), async (argv) => {\n if (!argv.name) {\n log.error('Migration name is required.');\n\n return;\n }\n\n await mongoMigrateCreate(argv.name);\n })\n .command('mongo:migrate:up', 'Apply all MongoDB migrations', mongoMigrateUp)\n .command('mongo:migrate:down', 'Rollback last MongoDB migration', mongoMigrateDown)\n .command('storybook:dev', 'Start Storybook development server', storybookDev)\n .command('storybook:build', 'Build Storybook for production', storybookBuild)\n .demandCommand(1, 'Please specify a valid command.')\n .strict()\n .help()\n .alias('h', 'help')\n .alias('v', 'version')\n .version(getVersion())\n .epilog('💡 Tip: Use \"--help\" with any command to see options\\n')\n .parse();\n }\n catch (error) {\n catchError(error);\n process.exit(1);\n }\n})();\n"],"names":["process","hideBin","yargs","runCommand","clearAllErrorLists","getStoredErrorLists","resolveCommands","getPackage","installDependencies","pathExistsSync","addGitIgnoreEntry","removeSync","readFileSync","writeFileSync","resolve","CYBERSKILL_CLI","command","CYBERSKILL_PACKAGE_NAME","PATH","SIMPLE_GIT_HOOK_JSON","createGitHooksConfig","AG_KIT_PACKAGE_NAME","DOT_AGENT","log","catchError","E_IssueType","getVersion","checkTypescript","checkEslint","fix","commandToRun","label","error","printIssues","type","list","color","showCheckResult","allResults","errors","warnings","lintStaged","packageData","inspectLint","lintCheck","lintFix","commitLint","gitHookSetup","hooks","aiSetup","ready","reset","inspect","testUnit","testE2E","mongoMigrateCreate","migrationName","mongoMigrateUp","mongoMigrateDown","storybookDev","storybookBuild","y","argv"],"mappings":";AAoBA,OAAAA,OAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,cAAAC,GAAA,sBAAAC,GAAA,uBAAAC,GAAA,mBAAAC,SAAA;AAAA,SAAA,cAAAC,GAAA,uBAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,qBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,iBAAAC,SAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,WAAAC,GAAA,2BAAAC,GAAA,QAAAC,GAAA,wBAAAC,GAAA,wBAAAC,GAAA,uBAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,OAAAC,GAAA,cAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAASC,IAAqB;AAC1B,MAAI;AAIA,WAHY,KAAK;AAAA,MACbd,EAAaE,EAAQ,WAAW,uBAAuB,GAAG,OAAO;AAAA,IAAA,EAE1D;AAAA,EACf,QACM;AACF,WAAO;AAAA,EACX;AACJ;AAUA,eAAea,IAAkB;A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AAQ,gBAAgB,oCAAoCF,CAAW,EACvE,QAAQ,eAAe,mCAAmCF,CAAU,EACpE,QAAQ,cAAc,kCAAkCK,CAAU,EAClE,QAAQ,SAAS,uCAAuCI,CAAK,EAC7D,QAAQ,SAAS,gDAAgDC,CAAK,EACtE,QAAQ,WAAW,0CAA0CC,CAAO,EACpE,QAAQ,aAAa,uBAAuBC,CAAQ,EACpD,QAAQ,YAAY,6BAA6BC,CAAO,EACxD,QAAQ,+BAA+B,8BAA8B,CAAAO,MAClEA,EAAE,WAAW,QAAQ;AAAA,MACjB,UAAU;AAAA,MACV,MAAM;AAAA,IAAA,CACT,GAAG,OAAOC,MAAS;AAChB,UAAI,CAACA,EAAK,MAAM;AACZ,QAAAvC,EAAI,MAAM,6BAA6B;AAEvC;AAAA,MACJ;AAEA,YAAMgC,EAAmBO,EAAK,IAAI;AAAA,IACtC,CAAC,EACJ,QAAQ,oBAAoB,gCAAgCL,CAAc,EAC1E,QAAQ,sBAAsB,mCAAmCC,CAAgB,EACjF,QAAQ,iBAAiB,sCAAsCC,CAAY,EAC3E,QAAQ,mBAAmB,kCAAkCC,CAAc,EAC3E,cAAc,GAAG,iCAAiC,EAClD,OAAA,EACA,OACA,MAAM,KAAK,MAAM,EACjB,MAAM,KAAK,SAAS,EACpB,QAAQlC,EAAA,CAAY,EACpB,OAAO;AAAA,CAAwD,EAC/D,MAAA;AAAA,EACT,SACOM,GAAO;AACV,IAAAR,EAAWQ,CAAK,GAChBhC,EAAQ,KAAK,CAAC;AAAA,EAClB;AACJ,GAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/node/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport process from 'node:process';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nimport type { I_IssueEntry } from '../log/index.js';\n\nimport { clearAllErrorLists, getStoredErrorLists, resolveCommands, runCommand } from '../command/index.js';\nimport { addGitIgnoreEntry, pathExistsSync, readFileSync, removeSync, writeFileSync } from '../fs/index.js';\nimport { catchError, E_IssueType, log } from '../log/index.js';\nimport { getPackage, installDependencies } from '../package/index.js';\nimport { AG_KIT_PACKAGE_NAME, command, createGitHooksConfig, CYBERSKILL_CLI, CYBERSKILL_PACKAGE_NAME, DOT_AGENT, PATH, resolve, SIMPLE_GIT_HOOK_JSON } from '../path/index.js';\n\n/**\n * Retrieves the version from the package.json file.\n * This function reads the package.json file and extracts the version number.\n * If the file cannot be read or parsed, it returns a default version of '1.0.0'.\n *\n * @returns The version string from package.json or '1.0.0' as fallback.\n */\nfunction getVersion(): string {\n try {\n const pkg = JSON.parse(\n readFileSync(resolve(__dirname, '../../../package.json'), 'utf-8'),\n );\n return pkg.version;\n }\n catch {\n return '1.0.0';\n }\n}\n\n/**\n * Performs TypeScript validation if a TypeScript configuration file exists.\n * This function checks for the presence of a TypeScript configuration file\n * and runs TypeScript validation if found. If no configuration is found,\n * it logs a warning and skips the type check.\n *\n * @returns A promise that resolves when the TypeScript validation is complete.\n */\nasync function checkTypescript() {\n if (pathExistsSync(PATH.TS_CONFIG)) {\n await runCommand('Performing TypeScript validation', await command.typescriptCheck());\n }\n else {\n log.warn('No TypeScript configuration found. Skipping type check.');\n }\n}\n\n/**\n * Performs ESLint checking with optional auto-fix functionality.\n * This function runs ESLint checks on the codebase and optionally applies\n * automatic fixes to resolve linting issues.\n *\n * @param fix - Whether to apply automatic fixes to linting issues (default: false).\n * @returns A promise that resolves when the ESLint check is complete.\n */\nasync function checkEslint(fix = false) {\n const commandToRun = fix ? await command.eslintFix() : await command.eslintCheck();\n const label = fix ? 'Running ESLint with auto-fix' : 'Running ESLint check';\n\n try {\n await runCommand(label, commandToRun, { timeout: 60000, throwOnError: true });\n }\n catch (error: any) {\n if (error.code === 'ETIMEDOUT' || error.killed || error.signal === 'SIGTERM') {\n log.warn('Lint check timed out. Retrying with debug mode enabled...');\n process.env['DEBUG'] = 'true';\n await runCommand(`${label} (Debug Mode)`, commandToRun);\n }\n else {\n catchError(error);\n }\n }\n}\n\n/**\n * Prints a formatted list of issues (errors or warnings) to the console.\n * This function displays issues in a boxed format with appropriate color coding\n * based on the issue type. It only displays issues if the list is not empty.\n *\n * @param type - The type of issues to display ('Errors' or 'Warnings').\n * @param list - An array of issue entries to display.\n */\nfunction printIssues(type: 'Errors' | 'Warnings', list: I_IssueEntry[]) {\n if (!list.length) {\n return;\n }\n\n const color = type === 'Errors' ? 'red' : 'yellow';\n log.printBoxedLog(type === 'Errors' ? '✖ Errors' : '⚠ Warnings', list, color);\n}\n\n/**\n * Displays the final check results after all validation processes.\n * This function retrieves stored error lists and displays them in a formatted manner.\n * If no errors or warnings are found, it displays a success message. If errors are found,\n * it exits the process with code 1 to indicate failure.\n *\n * @returns A promise that resolves when the results are displayed.\n */\nasync function showCheckResult() {\n setTimeout(async () => {\n const allResults = (await getStoredErrorLists()) || [];\n const errors = allResults.filter(e => e.type === E_IssueType.Error);\n const warnings = allResults.filter(e => e.type === E_IssueType.Warning);\n\n if (!errors.length && !warnings.length) {\n log.printBoxedLog('✔ NO ISSUES FOUND', [], 'green');\n }\n else {\n printIssues('Warnings', warnings);\n printIssues('Errors', errors);\n\n if (errors.length > 0) {\n process.exit(1);\n }\n }\n }, 0);\n}\n\n/**\n * Executes lint-staged to check only staged files.\n * This function runs lint-staged which executes linting tools only on files\n * that are staged for commit. It includes building the package if it's the current project\n * and displays the results after completion.\n *\n * @returns A promise that resolves when lint-staged execution is complete.\n */\nasync function lintStaged() {\n await clearAllErrorLists();\n const packageData = await getPackage({ name: CYBERSKILL_PACKAGE_NAME });\n\n if (!packageData.success) {\n log.error('Failed to retrieve package information. Aborting lint-staged.');\n return;\n }\n\n if (packageData.result.isCurrentProject) {\n await runCommand(`Building package: ${CYBERSKILL_PACKAGE_NAME}`, await command.build());\n }\n\n await runCommand('Executing lint-staged', await command.lintStaged());\n showCheckResult();\n}\n\n/**\n * Inspects the ESLint configuration to show active rules and settings.\n * This function runs ESLint inspection to display the current configuration,\n * including which rules are active and their settings.\n *\n * @returns A promise that resolves when the ESLint inspection is complete.\n */\nasync function inspectLint() {\n await runCommand('Inspecting ESLint configuration', await command.eslintInspect());\n}\n\n/**\n * Performs comprehensive linting checks including TypeScript and ESLint.\n * This function runs both TypeScript validation and ESLint checks in parallel,\n * then displays the combined results.\n *\n * @returns A promise that resolves when all linting checks are complete.\n */\nasync function lintCheck() {\n await clearAllErrorLists();\n await checkTypescript();\n await checkEslint();\n showCheckResult();\n}\n\n/**\n * Performs comprehensive linting checks with automatic fixes.\n * This function runs both TypeScript validation and ESLint checks with auto-fix\n * in parallel, then displays the combined results.\n *\n * @returns A promise that resolves when all linting checks with fixes are complete.\n */\nasync function lintFix() {\n await clearAllErrorLists();\n await checkTypescript();\n await checkEslint(true);\n showCheckResult();\n}\n\n/**\n * Validates commit message format using commitlint.\n * This function runs commitlint to check if the current commit message\n * follows the conventional commit format and displays the results.\n *\n * @returns A promise that resolves when commit message validation is complete.\n */\nasync function commitLint() {\n await clearAllErrorLists();\n await runCommand('Validating commit message', await command.commitLint());\n showCheckResult();\n}\n\n/**\n * Sets up Git hooks for automated code quality checks.\n * This function configures Git hooks using simple-git-hooks, creates the necessary\n * configuration files, and updates .gitignore to exclude hook configuration files.\n * It also sets up the hooks to run linting and commit validation automatically.\n *\n * @returns A promise that resolves when Git hook setup is complete.\n */\nasync function gitHookSetup() {\n await runCommand('Configuring Git hooks', await command.configureGitHook());\n\n removeSync(PATH.GIT_HOOK);\n\n const hooks = await resolveCommands(createGitHooksConfig);\n\n writeFileSync(PATH.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(hooks, null, 4));\n\n addGitIgnoreEntry(PATH.GIT_IGNORE, SIMPLE_GIT_HOOK_JSON);\n\n await runCommand('Setting up simple-git-hooks', await command.simpleGitHooks());\n}\n\n/**\n * Sets up the AI agent environment.\n * This function ensures the ag-kit package is installed globally, initializes\n * or updates the AI agent configuration, and adds the agent directory\n * to .gitignore to exclude it from version control.\n *\n * @returns A promise that resolves when the AI agent setup is complete.\n */\nasync function aiSetup() {\n try {\n await runCommand(`Checking for ${AG_KIT_PACKAGE_NAME}`, `pnpm list -g ${AG_KIT_PACKAGE_NAME}`);\n }\n catch {\n await runCommand(`Installing ${AG_KIT_PACKAGE_NAME} globally`, `pnpm i -g ${AG_KIT_PACKAGE_NAME}`);\n }\n\n if (pathExistsSync(PATH.DOT_AGENT)) {\n await runCommand('Updating AI agent', 'echo y | ag-kit update');\n }\n else {\n await runCommand('Initializing AI agent', 'ag-kit init');\n }\n\n addGitIgnoreEntry(PATH.GIT_EXCLUDE, DOT_AGENT);\n}\n\n/**\n * Initializes the project with dependencies and Git hooks.\n * This function installs project dependencies and sets up Git hooks for\n * automated code quality checks. It's typically run when setting up a new project.\n *\n * @returns A promise that resolves when project initialization is complete.\n */\nasync function ready() {\n await installDependencies();\n await gitHookSetup();\n}\n\n/**\n * Resets the project by removing dependencies and reinstalling them.\n * This function removes node_modules and lock files, cleans the package manager cache,\n * reinstalls dependencies, and sets up Git hooks. It's useful for resolving\n * dependency-related issues.\n *\n * @returns A promise that resolves when project reset is complete.\n */\nasync function reset() {\n removeSync(PATH.NODE_MODULES, PATH.PNPM_LOCK_YAML);\n await runCommand('Pruning pnpm store', await command.pnpmPruneStore());\n await runCommand('Clearing pnpm cache', await command.pnpmCleanCache());\n await installDependencies();\n await gitHookSetup();\n await aiSetup();\n}\n\n/**\n * Inspects project dependencies to analyze their status.\n * This function runs dependency inspection to check for outdated packages,\n * security vulnerabilities, and other dependency-related issues.\n *\n * @returns A promise that resolves when dependency inspection is complete.\n */\nasync function inspect() {\n await runCommand('Inspecting project dependencies', await command.nodeModulesInspect());\n}\n\n/**\n * Runs the unit test suite.\n * This function executes unit tests using the configured test runner\n * and displays the test results.\n *\n * @returns A promise that resolves when unit tests are complete.\n */\nasync function testUnit() {\n try {\n const packageData = await getPackage({ name: CYBERSKILL_PACKAGE_NAME });\n const cmd = packageData.success && packageData.result.isCurrentProject\n ? `pnpm exec vitest run`\n : await command.testUnit();\n\n await runCommand('Running unit tests', cmd, { throwOnError: true });\n }\n catch {\n process.exit(1);\n }\n}\n\n/**\n * Runs the end-to-end test suite.\n * This function executes end-to-end tests using the configured test runner\n * and displays the test results.\n *\n * @returns A promise that resolves when end-to-end tests are complete.\n */\nasync function testE2E() {\n try {\n const packageData = await getPackage({ name: CYBERSKILL_PACKAGE_NAME });\n const cmd = packageData.success && packageData.result.isCurrentProject\n ? `pnpm exec vitest run --passWithNoTests --config src/config/vitest/vitest.e2e.ts`\n : await command.testE2e();\n\n await runCommand('Running end-to-end tests', cmd, { throwOnError: true });\n }\n catch {\n process.exit(1);\n }\n}\n\n/**\n * Creates a new MongoDB migration file.\n * This function creates a new migration file with the specified name\n * for database schema changes.\n *\n * @param migrationName - The name for the new migration file.\n * @returns A promise that resolves when the migration file is created.\n */\nasync function mongoMigrateCreate(migrationName: string) {\n await runCommand('Creating MongoDB migration', await command.mongoMigrateCreate(migrationName));\n}\n\n/**\n * Applies all pending MongoDB migrations.\n * This function runs all pending database migrations to update the database schema\n * to the latest version.\n *\n * @returns A promise that resolves when all migrations are applied.\n */\nasync function mongoMigrateUp() {\n await runCommand('Running MongoDB migrations', await command.mongoMigrateUp());\n}\n\n/**\n * Rolls back the last applied MongoDB migration.\n * This function reverts the most recent database migration, undoing\n * the last schema change.\n *\n * @returns A promise that resolves when the migration is rolled back.\n */\nasync function mongoMigrateDown() {\n await runCommand('Rolling back MongoDB migration', await command.mongoMigrateDown());\n}\n\n/**\n * Starts the Storybook development server.\n * This function runs Storybook in development mode, allowing you to\n * view and interact with your component stories in a browser.\n *\n * @returns A promise that resolves when the Storybook dev server is started.\n */\nasync function storybookDev() {\n await runCommand('Starting Storybook development server', await command.storybookDev());\n}\n\n/**\n * Builds Storybook for production deployment.\n * This function creates a static build of Storybook that can be\n * deployed to a web server or hosting service.\n *\n * @returns A promise that resolves when the Storybook build is complete.\n */\nasync function storybookBuild() {\n await runCommand('Building Storybook', await command.storybookBuild());\n}\n\n(async () => {\n try {\n await yargs(hideBin(process.argv))\n .scriptName(CYBERSKILL_CLI)\n .usage('$0 <command> [options]')\n .command('ai:setup', 'Setup AI agent environment', aiSetup)\n .command('lint', 'Check code for linting issues', lintCheck)\n .command('lint:fix', 'Fix linting issues automatically', lintFix)\n .command('lint:inspect', 'View active ESLint configuration', inspectLint)\n .command('lint-staged', 'Run lint checks on staged files', lintStaged)\n .command('commitlint', 'Validate commit message format', commitLint)\n .command('ready', 'Initialize project and dependencies', ready)\n .command('reset', 'Reset the project and reinstall dependencies', reset)\n .command('inspect', 'Analyze installed project dependencies', inspect)\n .command('test:unit', 'Run unit test suite', testUnit)\n .command('test:e2e', 'Run end-to-end test suite', testE2E)\n .command('mongo:migrate:create <name>', 'Create a MongoDB migration', y =>\n y.positional('name', {\n describe: 'Migration name',\n type: 'string',\n }), async (argv) => {\n if (!argv.name) {\n log.error('Migration name is required.');\n\n return;\n }\n\n await mongoMigrateCreate(argv.name);\n })\n .command('mongo:migrate:up', 'Apply all MongoDB migrations', mongoMigrateUp)\n .command('mongo:migrate:down', 'Rollback last MongoDB migration', mongoMigrateDown)\n .command('storybook:dev', 'Start Storybook development server', storybookDev)\n .command('storybook:build', 'Build Storybook for production', storybookBuild)\n .demandCommand(1, 'Please specify a valid command.')\n .strict()\n .help()\n .alias('h', 'help')\n .alias('v', 'version')\n .version(getVersion())\n .epilog('💡 Tip: Use \"--help\" with any command to see options\\n')\n .parse();\n }\n catch (error) {\n catchError(error);\n process.exit(1);\n }\n})();\n"],"names":["process","hideBin","yargs","runCommand","clearAllErrorLists","getStoredErrorLists","resolveCommands","getPackage","installDependencies","pathExistsSync","addGitIgnoreEntry","removeSync","readFileSync","writeFileSync","resolve","CYBERSKILL_CLI","command","CYBERSKILL_PACKAGE_NAME","PATH","SIMPLE_GIT_HOOK_JSON","createGitHooksConfig","AG_KIT_PACKAGE_NAME","DOT_AGENT","log","catchError","E_IssueType","getVersion","checkTypescript","checkEslint","fix","commandToRun","label","error","printIssues","type","list","color","showCheckResult","allResults","errors","warnings","lintStaged","packageData","inspectLint","lintCheck","lintFix","commitLint","gitHookSetup","hooks","aiSetup","ready","reset","inspect","testUnit","cmd","testE2E","mongoMigrateCreate","migrationName","mongoMigrateUp","mongoMigrateDown","storybookDev","storybookBuild","y","argv"],"mappings":";AAoBA,OAAAA,OAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,cAAAC,GAAA,sBAAAC,GAAA,uBAAAC,GAAA,mBAAAC,SAAA;AAAA,SAAA,cAAAC,GAAA,uBAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,qBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,iBAAAC,SAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,WAAAC,GAAA,2BAAAC,GAAA,QAAAC,GAAA,wBAAAC,GAAA,wBAAAC,GAAA,uBAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,OAAAC,GAAA,cAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAASC,IAAqB;AAC1B,MAAI;AAIA,WAHY,KAAK;AAAA,MACbd,EAAaE,EAAQ,WAAW,uBAAuB,GAAG,OAAO;AAAA,IAAA,EAE1D;AAAA,EACf,QACM;AACF,WAAO;AAAA,EACX;AACJ;AAUA,eAAea,IAAkB;AAC7B,EAAIlB,EAAeS,EAAK,SAAS,IAC7B,MAAMf,EAAW,oCAAoC,MAAMa,EAAQ,iBAAiB,IAGpFO,EAAI,KAAK,yDAAyD;AAE1E;AAUA,eAAeK,EAAYC,IAAM,IAAO;AACpC,QAAMC,IAAeD,IAAM,MAAMb,EAAQ,cAAc,MAAMA,EAAQ,YAAA,GAC/De,IAAQF,IAAM,iCAAiC;AAErD,MAAI;AACA,UAAM1B,EAAW4B,GAAOD,GAAc,EAAE,SAAS,KAAO,cAAc,IAAM;AAAA,EAChF,SACOE,GAAY;AACf,IAAIA,EAAM,SAAS,eAAeA,EAA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