grf-cli 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -7
- package/README.zh-CN.md +15 -7
- package/dist/cli.js +2 -14
- package/dist/cli.js.map +1 -1
- package/dist/commands/add/display.d.ts +10 -0
- package/dist/commands/add/display.d.ts.map +1 -0
- package/dist/commands/add/display.js +25 -0
- package/dist/commands/add/display.js.map +1 -0
- package/dist/commands/add/helpers.d.ts +11 -0
- package/dist/commands/add/helpers.d.ts.map +1 -0
- package/dist/commands/add/helpers.js +59 -0
- package/dist/commands/add/helpers.js.map +1 -0
- package/dist/commands/add/index.d.ts +12 -0
- package/dist/commands/add/index.d.ts.map +1 -0
- package/dist/commands/add/index.js +57 -0
- package/dist/commands/add/index.js.map +1 -0
- package/dist/commands/add/types.d.ts +32 -0
- package/dist/commands/add/types.d.ts.map +1 -0
- package/dist/commands/add/types.js +6 -0
- package/dist/commands/add/types.js.map +1 -0
- package/dist/commands/add.d.ts +5 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +21 -21
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/clean/display.d.ts +30 -0
- package/dist/commands/clean/display.d.ts.map +1 -0
- package/dist/commands/clean/display.js +67 -0
- package/dist/commands/clean/display.js.map +1 -0
- package/dist/commands/clean/handlers/clean-all.d.ts +12 -0
- package/dist/commands/clean/handlers/clean-all.d.ts.map +1 -0
- package/dist/commands/clean/handlers/clean-all.js +43 -0
- package/dist/commands/clean/handlers/clean-all.js.map +1 -0
- package/dist/commands/clean/handlers/clean-single.d.ts +13 -0
- package/dist/commands/clean/handlers/clean-single.d.ts.map +1 -0
- package/dist/commands/clean/handlers/clean-single.js +78 -0
- package/dist/commands/clean/handlers/clean-single.js.map +1 -0
- package/dist/commands/clean/handlers/index.d.ts +6 -0
- package/dist/commands/clean/handlers/index.d.ts.map +1 -0
- package/dist/commands/clean/handlers/index.js +11 -0
- package/dist/commands/clean/handlers/index.js.map +1 -0
- package/dist/commands/clean/helpers.d.ts +25 -0
- package/dist/commands/clean/helpers.d.ts.map +1 -0
- package/dist/commands/clean/helpers.js +70 -0
- package/dist/commands/clean/helpers.js.map +1 -0
- package/dist/commands/clean/index.d.ts +12 -0
- package/dist/commands/clean/index.d.ts.map +1 -0
- package/dist/commands/clean/index.js +90 -0
- package/dist/commands/clean/index.js.map +1 -0
- package/dist/commands/clean/types.d.ts +21 -0
- package/dist/commands/clean/types.d.ts.map +1 -0
- package/dist/commands/clean/types.js +6 -0
- package/dist/commands/clean/types.js.map +1 -0
- package/dist/commands/clean.d.ts +5 -0
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +18 -35
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/config/display.d.ts +36 -0
- package/dist/commands/config/display.d.ts.map +1 -0
- package/dist/commands/config/display.js +86 -0
- package/dist/commands/config/display.js.map +1 -0
- package/dist/commands/config/handlers/index.d.ts +8 -0
- package/dist/commands/config/handlers/index.d.ts.map +1 -0
- package/dist/commands/config/handlers/index.js +15 -0
- package/dist/commands/config/handlers/index.js.map +1 -0
- package/dist/commands/config/handlers/set-value.d.ts +11 -0
- package/dist/commands/config/handlers/set-value.d.ts.map +1 -0
- package/dist/commands/config/handlers/set-value.js +36 -0
- package/dist/commands/config/handlers/set-value.js.map +1 -0
- package/dist/commands/config/handlers/show-all.d.ts +11 -0
- package/dist/commands/config/handlers/show-all.d.ts.map +1 -0
- package/dist/commands/config/handlers/show-all.js +24 -0
- package/dist/commands/config/handlers/show-all.js.map +1 -0
- package/dist/commands/config/handlers/show-path.d.ts +11 -0
- package/dist/commands/config/handlers/show-path.d.ts.map +1 -0
- package/dist/commands/config/handlers/show-path.js +20 -0
- package/dist/commands/config/handlers/show-path.js.map +1 -0
- package/dist/commands/config/handlers/show-value.d.ts +11 -0
- package/dist/commands/config/handlers/show-value.d.ts.map +1 -0
- package/dist/commands/config/handlers/show-value.js +31 -0
- package/dist/commands/config/handlers/show-value.js.map +1 -0
- package/dist/commands/config/helpers.d.ts +23 -0
- package/dist/commands/config/helpers.d.ts.map +1 -0
- package/dist/commands/config/helpers.js +53 -0
- package/dist/commands/config/helpers.js.map +1 -0
- package/dist/commands/config/index.d.ts +12 -0
- package/dist/commands/config/index.d.ts.map +1 -0
- package/dist/commands/config/index.js +56 -0
- package/dist/commands/config/index.js.map +1 -0
- package/dist/commands/config/types.d.ts +31 -0
- package/dist/commands/config/types.d.ts.map +1 -0
- package/dist/commands/config/types.js +13 -0
- package/dist/commands/config/types.js.map +1 -0
- package/dist/commands/config.d.ts +5 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +22 -41
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/index.d.ts +27 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +52 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/list/display.d.ts +39 -0
- package/dist/commands/list/display.d.ts.map +1 -0
- package/dist/commands/list/display.js +144 -0
- package/dist/commands/list/display.js.map +1 -0
- package/dist/commands/list/index.d.ts +12 -0
- package/dist/commands/list/index.d.ts.map +1 -0
- package/dist/commands/list/index.js +128 -0
- package/dist/commands/list/index.js.map +1 -0
- package/dist/commands/list/types.d.ts +32 -0
- package/dist/commands/list/types.d.ts.map +1 -0
- package/dist/commands/list/types.js +6 -0
- package/dist/commands/list/types.js.map +1 -0
- package/dist/commands/list.d.ts +5 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +29 -60
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/load/display.d.ts +28 -0
- package/dist/commands/load/display.d.ts.map +1 -0
- package/dist/commands/load/display.js +53 -0
- package/dist/commands/load/display.js.map +1 -0
- package/dist/commands/load/handlers/copy-repo.d.ts +13 -0
- package/dist/commands/load/handlers/copy-repo.d.ts.map +1 -0
- package/dist/commands/load/handlers/copy-repo.js +82 -0
- package/dist/commands/load/handlers/copy-repo.js.map +1 -0
- package/dist/commands/load/handlers/index.d.ts +6 -0
- package/dist/commands/load/handlers/index.d.ts.map +1 -0
- package/dist/commands/load/handlers/index.js +11 -0
- package/dist/commands/load/handlers/index.js.map +1 -0
- package/dist/commands/load/handlers/url-add.d.ts +13 -0
- package/dist/commands/load/handlers/url-add.d.ts.map +1 -0
- package/dist/commands/load/handlers/url-add.js +50 -0
- package/dist/commands/load/handlers/url-add.js.map +1 -0
- package/dist/commands/load/helpers.d.ts +81 -0
- package/dist/commands/load/helpers.d.ts.map +1 -0
- package/dist/commands/load/helpers.js +199 -0
- package/dist/commands/load/helpers.js.map +1 -0
- package/dist/commands/load/index.d.ts +13 -0
- package/dist/commands/load/index.d.ts.map +1 -0
- package/dist/commands/load/index.js +46 -0
- package/dist/commands/load/index.js.map +1 -0
- package/dist/commands/load/types.d.ts +37 -0
- package/dist/commands/load/types.d.ts.map +1 -0
- package/dist/commands/load/types.js +6 -0
- package/dist/commands/load/types.js.map +1 -0
- package/dist/commands/load.d.ts +5 -0
- package/dist/commands/load.d.ts.map +1 -1
- package/dist/commands/load.js +27 -64
- package/dist/commands/load.js.map +1 -1
- package/dist/commands/options/all.d.ts +11 -0
- package/dist/commands/options/all.d.ts.map +1 -0
- package/dist/commands/options/all.js +14 -0
- package/dist/commands/options/all.js.map +1 -0
- package/dist/commands/options/branch.d.ts +11 -0
- package/dist/commands/options/branch.d.ts.map +1 -0
- package/dist/commands/options/branch.js +14 -0
- package/dist/commands/options/branch.js.map +1 -0
- package/dist/commands/options/check.d.ts +11 -0
- package/dist/commands/options/check.d.ts.map +1 -0
- package/dist/commands/options/check.js +14 -0
- package/dist/commands/options/check.js.map +1 -0
- package/dist/commands/options/clean-empty.d.ts +11 -0
- package/dist/commands/options/clean-empty.d.ts.map +1 -0
- package/dist/commands/options/clean-empty.js +14 -0
- package/dist/commands/options/clean-empty.js.map +1 -0
- package/dist/commands/options/depth.d.ts +11 -0
- package/dist/commands/options/depth.d.ts.map +1 -0
- package/dist/commands/options/depth.js +14 -0
- package/dist/commands/options/depth.js.map +1 -0
- package/dist/commands/options/dry-run.d.ts +11 -0
- package/dist/commands/options/dry-run.d.ts.map +1 -0
- package/dist/commands/options/dry-run.js +14 -0
- package/dist/commands/options/dry-run.js.map +1 -0
- package/dist/commands/options/force.d.ts +11 -0
- package/dist/commands/options/force.d.ts.map +1 -0
- package/dist/commands/options/force.js +14 -0
- package/dist/commands/options/force.js.map +1 -0
- package/dist/commands/options/index.d.ts +24 -0
- package/dist/commands/options/index.d.ts.map +1 -0
- package/dist/commands/options/index.js +53 -0
- package/dist/commands/options/index.js.map +1 -0
- package/dist/commands/options/json.d.ts +11 -0
- package/dist/commands/options/json.d.ts.map +1 -0
- package/dist/commands/options/json.js +14 -0
- package/dist/commands/options/json.js.map +1 -0
- package/dist/commands/options/keep-empty.d.ts +11 -0
- package/dist/commands/options/keep-empty.d.ts.map +1 -0
- package/dist/commands/options/keep-empty.js +14 -0
- package/dist/commands/options/keep-empty.js.map +1 -0
- package/dist/commands/options/list.d.ts +11 -0
- package/dist/commands/options/list.d.ts.map +1 -0
- package/dist/commands/options/list.js +14 -0
- package/dist/commands/options/list.js.map +1 -0
- package/dist/commands/options/name.d.ts +11 -0
- package/dist/commands/options/name.d.ts.map +1 -0
- package/dist/commands/options/name.js +14 -0
- package/dist/commands/options/name.js.map +1 -0
- package/dist/commands/options/no-ignore.d.ts +11 -0
- package/dist/commands/options/no-ignore.d.ts.map +1 -0
- package/dist/commands/options/no-ignore.js +14 -0
- package/dist/commands/options/no-ignore.js.map +1 -0
- package/dist/commands/options/path.d.ts +11 -0
- package/dist/commands/options/path.d.ts.map +1 -0
- package/dist/commands/options/path.js +14 -0
- package/dist/commands/options/path.js.map +1 -0
- package/dist/commands/options/shallow.d.ts +16 -0
- package/dist/commands/options/shallow.d.ts.map +1 -0
- package/dist/commands/options/shallow.js +19 -0
- package/dist/commands/options/shallow.js.map +1 -0
- package/dist/commands/options/status.d.ts +11 -0
- package/dist/commands/options/status.d.ts.map +1 -0
- package/dist/commands/options/status.js +14 -0
- package/dist/commands/options/status.js.map +1 -0
- package/dist/commands/options/subdir.d.ts +11 -0
- package/dist/commands/options/subdir.d.ts.map +1 -0
- package/dist/commands/options/subdir.js +14 -0
- package/dist/commands/options/subdir.js.map +1 -0
- package/dist/commands/options/sync-only.d.ts +11 -0
- package/dist/commands/options/sync-only.d.ts.map +1 -0
- package/dist/commands/options/sync-only.js +14 -0
- package/dist/commands/options/sync-only.js.map +1 -0
- package/dist/commands/options/sync.d.ts +11 -0
- package/dist/commands/options/sync.d.ts.map +1 -0
- package/dist/commands/options/sync.js +14 -0
- package/dist/commands/options/sync.js.map +1 -0
- package/dist/commands/options/verbose.d.ts +11 -0
- package/dist/commands/options/verbose.d.ts.map +1 -0
- package/dist/commands/options/verbose.js +14 -0
- package/dist/commands/options/verbose.js.map +1 -0
- package/dist/commands/unload/display.d.ts +29 -0
- package/dist/commands/unload/display.d.ts.map +1 -0
- package/dist/commands/unload/display.js +125 -0
- package/dist/commands/unload/display.js.map +1 -0
- package/dist/commands/unload/handlers/clean-empty.d.ts +11 -0
- package/dist/commands/unload/handlers/clean-empty.d.ts.map +1 -0
- package/dist/commands/unload/handlers/clean-empty.js +111 -0
- package/dist/commands/unload/handlers/clean-empty.js.map +1 -0
- package/dist/commands/unload/handlers/index.d.ts +8 -0
- package/dist/commands/unload/handlers/index.d.ts.map +1 -0
- package/dist/commands/unload/handlers/index.js +15 -0
- package/dist/commands/unload/handlers/index.js.map +1 -0
- package/dist/commands/unload/handlers/list.d.ts +11 -0
- package/dist/commands/unload/handlers/list.d.ts.map +1 -0
- package/dist/commands/unload/handlers/list.js +42 -0
- package/dist/commands/unload/handlers/list.js.map +1 -0
- package/dist/commands/unload/handlers/remove-all.d.ts +11 -0
- package/dist/commands/unload/handlers/remove-all.d.ts.map +1 -0
- package/dist/commands/unload/handlers/remove-all.js +184 -0
- package/dist/commands/unload/handlers/remove-all.js.map +1 -0
- package/dist/commands/unload/handlers/remove-single.d.ts +12 -0
- package/dist/commands/unload/handlers/remove-single.d.ts.map +1 -0
- package/dist/commands/unload/handlers/remove-single.js +217 -0
- package/dist/commands/unload/handlers/remove-single.js.map +1 -0
- package/dist/commands/unload/helpers.d.ts +55 -0
- package/dist/commands/unload/helpers.d.ts.map +1 -0
- package/dist/commands/unload/helpers.js +256 -0
- package/dist/commands/unload/helpers.js.map +1 -0
- package/dist/commands/unload/index.d.ts +12 -0
- package/dist/commands/unload/index.d.ts.map +1 -0
- package/dist/commands/unload/index.js +121 -0
- package/dist/commands/unload/index.js.map +1 -0
- package/dist/commands/unload/types.d.ts +53 -0
- package/dist/commands/unload/types.d.ts.map +1 -0
- package/dist/commands/unload/types.js +6 -0
- package/dist/commands/unload/types.js.map +1 -0
- package/dist/commands/unload.d.ts +6 -1
- package/dist/commands/unload.d.ts.map +1 -1
- package/dist/commands/unload.js +165 -169
- package/dist/commands/unload.js.map +1 -1
- package/dist/commands/update/display.d.ts +30 -0
- package/dist/commands/update/display.d.ts.map +1 -0
- package/dist/commands/update/display.js +161 -0
- package/dist/commands/update/display.js.map +1 -0
- package/dist/commands/update/handlers/index.d.ts +8 -0
- package/dist/commands/update/handlers/index.d.ts.map +1 -0
- package/dist/commands/update/handlers/index.js +15 -0
- package/dist/commands/update/handlers/index.js.map +1 -0
- package/dist/commands/update/handlers/status.d.ts +11 -0
- package/dist/commands/update/handlers/status.d.ts.map +1 -0
- package/dist/commands/update/handlers/status.js +20 -0
- package/dist/commands/update/handlers/status.js.map +1 -0
- package/dist/commands/update/handlers/sync-only.d.ts +11 -0
- package/dist/commands/update/handlers/sync-only.d.ts.map +1 -0
- package/dist/commands/update/handlers/sync-only.js +41 -0
- package/dist/commands/update/handlers/sync-only.js.map +1 -0
- package/dist/commands/update/handlers/update-all.d.ts +10 -0
- package/dist/commands/update/handlers/update-all.d.ts.map +1 -0
- package/dist/commands/update/handlers/update-all.js +125 -0
- package/dist/commands/update/handlers/update-all.js.map +1 -0
- package/dist/commands/update/handlers/update-single.d.ts +11 -0
- package/dist/commands/update/handlers/update-single.d.ts.map +1 -0
- package/dist/commands/update/handlers/update-single.js +154 -0
- package/dist/commands/update/handlers/update-single.js.map +1 -0
- package/dist/commands/update/helpers.d.ts +13 -0
- package/dist/commands/update/helpers.d.ts.map +1 -0
- package/dist/commands/update/helpers.js +86 -0
- package/dist/commands/update/helpers.js.map +1 -0
- package/dist/commands/update/index.d.ts +12 -0
- package/dist/commands/update/index.d.ts.map +1 -0
- package/dist/commands/update/index.js +67 -0
- package/dist/commands/update/index.js.map +1 -0
- package/dist/commands/update/types.d.ts +55 -0
- package/dist/commands/update/types.d.ts.map +1 -0
- package/dist/commands/update/types.js +6 -0
- package/dist/commands/update/types.js.map +1 -0
- package/dist/commands/update.d.ts +6 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +73 -80
- package/dist/commands/update.js.map +1 -1
- package/dist/core/config-manager.d.ts +83 -0
- package/dist/core/config-manager.d.ts.map +1 -0
- package/dist/core/config-manager.js +170 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/config.d.ts +22 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +71 -35
- package/dist/core/config.js.map +1 -1
- package/dist/core/filesystem.js +1 -1
- package/dist/core/filesystem.js.map +1 -1
- package/dist/core/loading-state.d.ts +141 -0
- package/dist/core/loading-state.d.ts.map +1 -0
- package/dist/core/loading-state.js +237 -0
- package/dist/core/loading-state.js.map +1 -0
- package/dist/core/loading.d.ts +24 -27
- package/dist/core/loading.d.ts.map +1 -1
- package/dist/core/loading.js +127 -88
- package/dist/core/loading.js.map +1 -1
- package/dist/core/migration.d.ts +54 -0
- package/dist/core/migration.d.ts.map +1 -0
- package/dist/core/migration.js +277 -0
- package/dist/core/migration.js.map +1 -0
- package/dist/core/paths.d.ts +58 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +103 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/repos-index.d.ts +113 -0
- package/dist/core/repos-index.d.ts.map +1 -0
- package/dist/core/repos-index.js +206 -0
- package/dist/core/repos-index.js.map +1 -0
- package/dist/core/repository.js +2 -2
- package/dist/core/repository.js.map +1 -1
- package/dist/core/sync.d.ts.map +1 -1
- package/dist/core/sync.js +3 -3
- package/dist/core/sync.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/format.d.ts +159 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/format.js +300 -0
- package/dist/ui/format.js.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +53 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/prompt.d.ts +94 -0
- package/dist/ui/prompt.d.ts.map +1 -0
- package/dist/ui/prompt.js +223 -0
- package/dist/ui/prompt.js.map +1 -0
- package/dist/ui/spinner.d.ts +99 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +136 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/table.d.ts +142 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +213 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/utils/constants.d.ts +152 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +160 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/error.d.ts +109 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +212 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +44 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/validation.d.ts +122 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +248 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +23 -3
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 错误处理模块
|
|
4
|
+
* 提供统一的错误处理工具
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.handleError = handleError;
|
|
11
|
+
exports.getErrorMessage = getErrorMessage;
|
|
12
|
+
exports.createError = createError;
|
|
13
|
+
exports.wrapAsync = wrapAsync;
|
|
14
|
+
exports.assertCondition = assertCondition;
|
|
15
|
+
exports.assertNotNull = assertNotNull;
|
|
16
|
+
exports.isGrfError = isGrfError;
|
|
17
|
+
exports.isErrorCode = isErrorCode;
|
|
18
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
19
|
+
const index_js_1 = require("../types/index.js");
|
|
20
|
+
/**
|
|
21
|
+
* 统一处理错误并输出到控制台
|
|
22
|
+
* @param error 错误对象
|
|
23
|
+
* @param options 处理选项
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* try {
|
|
28
|
+
* await someOperation();
|
|
29
|
+
* } catch (error) {
|
|
30
|
+
* handleError(error, { exit: true });
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function handleError(error, options = {}) {
|
|
35
|
+
const { exit = false, exitCode = 1, verbose = false, hints = [] } = options;
|
|
36
|
+
// 格式化并输出错误消息
|
|
37
|
+
const message = getErrorMessage(error);
|
|
38
|
+
console.error(chalk_1.default.red(`${chalk_1.default.bold("✗")} ${message}`));
|
|
39
|
+
// 如果是 GrfError,提供更具体的错误提示
|
|
40
|
+
if (error instanceof index_js_1.GrfError) {
|
|
41
|
+
const errorHints = getErrorHints(error);
|
|
42
|
+
for (const hint of errorHints) {
|
|
43
|
+
console.error(chalk_1.default.gray(` ${hint}`));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// 显示额外的提示信息
|
|
47
|
+
for (const hint of hints) {
|
|
48
|
+
console.error(chalk_1.default.gray(` ${hint}`));
|
|
49
|
+
}
|
|
50
|
+
// 在详细模式下显示堆栈信息
|
|
51
|
+
if (verbose && error instanceof Error && error.stack) {
|
|
52
|
+
console.error();
|
|
53
|
+
console.error(chalk_1.default.gray("Stack trace:"));
|
|
54
|
+
console.error(chalk_1.default.gray(error.stack));
|
|
55
|
+
}
|
|
56
|
+
// 退出进程
|
|
57
|
+
if (exit) {
|
|
58
|
+
process.exit(exitCode);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 获取错误消息
|
|
63
|
+
* @param error 错误对象
|
|
64
|
+
* @returns 错误消息字符串
|
|
65
|
+
*/
|
|
66
|
+
function getErrorMessage(error) {
|
|
67
|
+
if (error instanceof index_js_1.GrfError) {
|
|
68
|
+
return error.message;
|
|
69
|
+
}
|
|
70
|
+
if (error instanceof Error) {
|
|
71
|
+
return error.message;
|
|
72
|
+
}
|
|
73
|
+
if (typeof error === "string") {
|
|
74
|
+
return error;
|
|
75
|
+
}
|
|
76
|
+
return "An unknown error occurred";
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 根据错误码获取提示信息
|
|
80
|
+
* @param error GrfError 实例
|
|
81
|
+
* @returns 提示信息数组
|
|
82
|
+
*/
|
|
83
|
+
function getErrorHints(error) {
|
|
84
|
+
const hints = [];
|
|
85
|
+
switch (error.code) {
|
|
86
|
+
case index_js_1.ErrorCode.REPO_NOT_FOUND:
|
|
87
|
+
hints.push(`Use ${chalk_1.default.cyan("grf add <url>")} to add a repository first.`);
|
|
88
|
+
hints.push(`Or use ${chalk_1.default.cyan("grf list")} to see all cached repositories.`);
|
|
89
|
+
break;
|
|
90
|
+
case index_js_1.ErrorCode.REPO_ALREADY_EXISTS:
|
|
91
|
+
hints.push(`Use ${chalk_1.default.cyan("grf update <name>")} to update the existing repository.`);
|
|
92
|
+
hints.push(`Or use ${chalk_1.default.cyan("grf clean <name>")} to remove it first.`);
|
|
93
|
+
break;
|
|
94
|
+
case index_js_1.ErrorCode.FS_PATH_NOT_FOUND:
|
|
95
|
+
hints.push("The source path does not exist. Please check the repository or subdirectory.");
|
|
96
|
+
break;
|
|
97
|
+
case index_js_1.ErrorCode.FS_PERMISSION_DENIED:
|
|
98
|
+
hints.push("Permission denied. Please check your file permissions.");
|
|
99
|
+
break;
|
|
100
|
+
case index_js_1.ErrorCode.GIT_CLONE_FAILED:
|
|
101
|
+
hints.push("Failed to clone repository. Please check the URL and your network connection.");
|
|
102
|
+
hints.push("Please check your network connection and try again.");
|
|
103
|
+
break;
|
|
104
|
+
case index_js_1.ErrorCode.GIT_CHECKOUT_FAILED:
|
|
105
|
+
hints.push(`The branch may not exist. Use ${chalk_1.default.cyan("git branch -r")} to list available branches.`);
|
|
106
|
+
break;
|
|
107
|
+
case index_js_1.ErrorCode.CONFIG_PARSE_ERROR:
|
|
108
|
+
hints.push("The configuration file may be corrupted. Try deleting it and reconfiguring.");
|
|
109
|
+
break;
|
|
110
|
+
case index_js_1.ErrorCode.GIT_PULL_FAILED:
|
|
111
|
+
hints.push("Please check your network connection and try again.");
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
return hints;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 创建一个 GrfError 实例
|
|
118
|
+
* @param code 错误码
|
|
119
|
+
* @param message 错误消息
|
|
120
|
+
* @returns GrfError 实例
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* throw createError(ErrorCode.REPO_NOT_FOUND, "Repository 'my-repo' not found");
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
function createError(code, message) {
|
|
128
|
+
return new index_js_1.GrfError(code, message);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 包装异步操作,统一处理错误
|
|
132
|
+
* @param operation 异步操作
|
|
133
|
+
* @param options 错误处理选项
|
|
134
|
+
* @returns 操作结果或 undefined(如果发生错误且不退出)
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* const result = await wrapAsync(
|
|
139
|
+
* async () => await fetchData(),
|
|
140
|
+
* { exit: true }
|
|
141
|
+
* );
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
async function wrapAsync(operation, options = {}) {
|
|
145
|
+
try {
|
|
146
|
+
return await operation();
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
handleError(error, options);
|
|
150
|
+
if (!options.exit) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
// 如果设置了 exit,handleError 会调用 process.exit,不会到达这里
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* 断言条件为真,否则抛出错误
|
|
159
|
+
* @param condition 条件
|
|
160
|
+
* @param code 错误码
|
|
161
|
+
* @param message 错误消息
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* assertCondition(repo !== null, ErrorCode.REPO_NOT_FOUND, "Repository not found");
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
function assertCondition(condition, code, message) {
|
|
169
|
+
if (!condition) {
|
|
170
|
+
throw createError(code, message);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 断言值不为 null 或 undefined
|
|
175
|
+
* @param value 要检查的值
|
|
176
|
+
* @param code 错误码
|
|
177
|
+
* @param message 错误消息
|
|
178
|
+
* @returns 非空值
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* const repo = assertNotNull(
|
|
183
|
+
* await repository.get(name),
|
|
184
|
+
* ErrorCode.REPO_NOT_FOUND,
|
|
185
|
+
* `Repository '${name}' not found`
|
|
186
|
+
* );
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
function assertNotNull(value, code, message) {
|
|
190
|
+
if (value === null || value === undefined) {
|
|
191
|
+
throw createError(code, message);
|
|
192
|
+
}
|
|
193
|
+
return value;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 检查是否为 GrfError
|
|
197
|
+
* @param error 错误对象
|
|
198
|
+
* @returns 是否为 GrfError
|
|
199
|
+
*/
|
|
200
|
+
function isGrfError(error) {
|
|
201
|
+
return error instanceof index_js_1.GrfError;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 检查错误是否为特定错误码
|
|
205
|
+
* @param error 错误对象
|
|
206
|
+
* @param code 错误码
|
|
207
|
+
* @returns 是否匹配
|
|
208
|
+
*/
|
|
209
|
+
function isErrorCode(error, code) {
|
|
210
|
+
return error instanceof index_js_1.GrfError && error.code === code;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAiCH,kCAkCC;AAOD,0CAcC;AA6ED,kCAEC;AAgBD,8BAcC;AAaD,0CAQC;AAkBD,sCASC;AAOD,gCAEC;AAQD,kCAEC;AAtQD,kDAA0B;AAC1B,gDAAwD;AAgBxD;;;;;;;;;;;;;GAaG;AACH,SAAgB,WAAW,CACzB,KAAc,EACd,UAA8B,EAAE;IAEhC,MAAM,EAAE,IAAI,GAAG,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAE5E,aAAa;IACb,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,O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,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utils 模块统一导出
|
|
3
|
+
* 提供工具函数和常量
|
|
4
|
+
*/
|
|
5
|
+
export { handleError, getErrorMessage, createError, wrapAsync, assertCondition, assertNotNull, isGrfError, isErrorCode, type HandleErrorOptions, } from "./error.js";
|
|
6
|
+
export { validateRepoName, validateGitUrl, isGitUrl, validateBranchName, validatePath, validatePositiveInteger, validateConfigKey, combineValidations, createValidator, assertValid, type ValidationResult, } from "./validation.js";
|
|
7
|
+
export { DIR_NAMES, FILE_NAMES, DEFAULTS, TABLE_COLUMNS, COPY_EXCLUDES, GIT, TIMEOUTS, LIMITS, PATTERNS, MESSAGES, HINTS, APP_INFO, } from "./constants.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,aAAa,EACb,aAAa,EACb,GAAG,EACH,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utils 模块统一导出
|
|
4
|
+
* 提供工具函数和常量
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.APP_INFO = exports.HINTS = exports.MESSAGES = exports.PATTERNS = exports.LIMITS = exports.TIMEOUTS = exports.GIT = exports.COPY_EXCLUDES = exports.TABLE_COLUMNS = exports.DEFAULTS = exports.FILE_NAMES = exports.DIR_NAMES = exports.assertValid = exports.createValidator = exports.combineValidations = exports.validateConfigKey = exports.validatePositiveInteger = exports.validatePath = exports.validateBranchName = exports.isGitUrl = exports.validateGitUrl = exports.validateRepoName = exports.isErrorCode = exports.isGrfError = exports.assertNotNull = exports.assertCondition = exports.wrapAsync = exports.createError = exports.getErrorMessage = exports.handleError = void 0;
|
|
8
|
+
// 错误处理相关
|
|
9
|
+
var error_js_1 = require("./error.js");
|
|
10
|
+
Object.defineProperty(exports, "handleError", { enumerable: true, get: function () { return error_js_1.handleError; } });
|
|
11
|
+
Object.defineProperty(exports, "getErrorMessage", { enumerable: true, get: function () { return error_js_1.getErrorMessage; } });
|
|
12
|
+
Object.defineProperty(exports, "createError", { enumerable: true, get: function () { return error_js_1.createError; } });
|
|
13
|
+
Object.defineProperty(exports, "wrapAsync", { enumerable: true, get: function () { return error_js_1.wrapAsync; } });
|
|
14
|
+
Object.defineProperty(exports, "assertCondition", { enumerable: true, get: function () { return error_js_1.assertCondition; } });
|
|
15
|
+
Object.defineProperty(exports, "assertNotNull", { enumerable: true, get: function () { return error_js_1.assertNotNull; } });
|
|
16
|
+
Object.defineProperty(exports, "isGrfError", { enumerable: true, get: function () { return error_js_1.isGrfError; } });
|
|
17
|
+
Object.defineProperty(exports, "isErrorCode", { enumerable: true, get: function () { return error_js_1.isErrorCode; } });
|
|
18
|
+
// 输入验证相关
|
|
19
|
+
var validation_js_1 = require("./validation.js");
|
|
20
|
+
Object.defineProperty(exports, "validateRepoName", { enumerable: true, get: function () { return validation_js_1.validateRepoName; } });
|
|
21
|
+
Object.defineProperty(exports, "validateGitUrl", { enumerable: true, get: function () { return validation_js_1.validateGitUrl; } });
|
|
22
|
+
Object.defineProperty(exports, "isGitUrl", { enumerable: true, get: function () { return validation_js_1.isGitUrl; } });
|
|
23
|
+
Object.defineProperty(exports, "validateBranchName", { enumerable: true, get: function () { return validation_js_1.validateBranchName; } });
|
|
24
|
+
Object.defineProperty(exports, "validatePath", { enumerable: true, get: function () { return validation_js_1.validatePath; } });
|
|
25
|
+
Object.defineProperty(exports, "validatePositiveInteger", { enumerable: true, get: function () { return validation_js_1.validatePositiveInteger; } });
|
|
26
|
+
Object.defineProperty(exports, "validateConfigKey", { enumerable: true, get: function () { return validation_js_1.validateConfigKey; } });
|
|
27
|
+
Object.defineProperty(exports, "combineValidations", { enumerable: true, get: function () { return validation_js_1.combineValidations; } });
|
|
28
|
+
Object.defineProperty(exports, "createValidator", { enumerable: true, get: function () { return validation_js_1.createValidator; } });
|
|
29
|
+
Object.defineProperty(exports, "assertValid", { enumerable: true, get: function () { return validation_js_1.assertValid; } });
|
|
30
|
+
// 常量
|
|
31
|
+
var constants_js_1 = require("./constants.js");
|
|
32
|
+
Object.defineProperty(exports, "DIR_NAMES", { enumerable: true, get: function () { return constants_js_1.DIR_NAMES; } });
|
|
33
|
+
Object.defineProperty(exports, "FILE_NAMES", { enumerable: true, get: function () { return constants_js_1.FILE_NAMES; } });
|
|
34
|
+
Object.defineProperty(exports, "DEFAULTS", { enumerable: true, get: function () { return constants_js_1.DEFAULTS; } });
|
|
35
|
+
Object.defineProperty(exports, "TABLE_COLUMNS", { enumerable: true, get: function () { return constants_js_1.TABLE_COLUMNS; } });
|
|
36
|
+
Object.defineProperty(exports, "COPY_EXCLUDES", { enumerable: true, get: function () { return constants_js_1.COPY_EXCLUDES; } });
|
|
37
|
+
Object.defineProperty(exports, "GIT", { enumerable: true, get: function () { return constants_js_1.GIT; } });
|
|
38
|
+
Object.defineProperty(exports, "TIMEOUTS", { enumerable: true, get: function () { return constants_js_1.TIMEOUTS; } });
|
|
39
|
+
Object.defineProperty(exports, "LIMITS", { enumerable: true, get: function () { return constants_js_1.LIMITS; } });
|
|
40
|
+
Object.defineProperty(exports, "PATTERNS", { enumerable: true, get: function () { return constants_js_1.PATTERNS; } });
|
|
41
|
+
Object.defineProperty(exports, "MESSAGES", { enumerable: true, get: function () { return constants_js_1.MESSAGES; } });
|
|
42
|
+
Object.defineProperty(exports, "HINTS", { enumerable: true, get: function () { return constants_js_1.HINTS; } });
|
|
43
|
+
Object.defineProperty(exports, "APP_INFO", { enumerable: true, get: function () { return constants_js_1.APP_INFO; } });
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,SAAS;AACT,uCAUoB;AATlB,uGAAA,WAAW,OAAA;AACX,2GAAA,eAAe,OAAA;AACf,uGAAA,WAAW,OAAA;AACX,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,uGAAA,WAAW,OAAA;AAIb,SAAS;AACT,iDAYyB;AAXvB,iHAAA,gBAAgB,OAAA;AAChB,+GAAA,cAAc,OAAA;AACd,yGAAA,QAAQ,OAAA;AACR,mHAAA,kBAAkB,OAAA;AAClB,6GAAA,YAAY,OAAA;AACZ,wHAAA,uBAAuB,OAAA;AACvB,kHAAA,iBAAiB,OAAA;AACjB,mHAAA,kBAAkB,OAAA;AAClB,gHAAA,eAAe,OAAA;AACf,4GAAA,WAAW,OAAA;AAIb,KAAK;AACL,+CAawB;AAZtB,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,wGAAA,QAAQ,OAAA;AACR,6GAAA,aAAa,OAAA;AACb,6GAAA,aAAa,OAAA;AACb,mGAAA,GAAG,OAAA;AACH,wGAAA,QAAQ,OAAA;AACR,sGAAA,MAAM,OAAA;AACN,wGAAA,QAAQ,OAAA;AACR,wGAAA,QAAQ,OAAA;AACR,qGAAA,KAAK,OAAA;AACL,wGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 输入验证模块
|
|
3
|
+
* 提供各种输入验证工具函数
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 验证结果
|
|
7
|
+
*/
|
|
8
|
+
export interface ValidationResult {
|
|
9
|
+
/** 是否有效 */
|
|
10
|
+
valid: boolean;
|
|
11
|
+
/** 错误消息(如果无效) */
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 验证仓库名称
|
|
16
|
+
* @param name 仓库名称
|
|
17
|
+
* @returns 验证结果
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const result = validateRepoName("my-repo");
|
|
22
|
+
* if (!result.valid) {
|
|
23
|
+
* console.error(result.message);
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateRepoName(name: string): ValidationResult;
|
|
28
|
+
/**
|
|
29
|
+
* 验证 Git URL
|
|
30
|
+
* @param url URL 字符串
|
|
31
|
+
* @returns 验证结果
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const result = validateGitUrl("https://github.com/user/repo.git");
|
|
36
|
+
* if (!result.valid) {
|
|
37
|
+
* console.error(result.message);
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function validateGitUrl(url: string): ValidationResult;
|
|
42
|
+
/**
|
|
43
|
+
* 检查字符串是否为 Git URL
|
|
44
|
+
* @param str 字符串
|
|
45
|
+
* @returns 是否为 Git URL
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* if (isGitUrl(input)) {
|
|
50
|
+
* // 处理 URL
|
|
51
|
+
* } else {
|
|
52
|
+
* // 处理仓库名称
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function isGitUrl(str: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* 验证分支名称
|
|
59
|
+
* @param branch 分支名称
|
|
60
|
+
* @returns 验证结果
|
|
61
|
+
*/
|
|
62
|
+
export declare function validateBranchName(branch: string): ValidationResult;
|
|
63
|
+
/**
|
|
64
|
+
* 验证路径
|
|
65
|
+
* @param path 路径字符串
|
|
66
|
+
* @returns 验证结果
|
|
67
|
+
*/
|
|
68
|
+
export declare function validatePath(path: string): ValidationResult;
|
|
69
|
+
/**
|
|
70
|
+
* 验证正整数
|
|
71
|
+
* @param value 值
|
|
72
|
+
* @param options 选项
|
|
73
|
+
* @returns 验证结果
|
|
74
|
+
*/
|
|
75
|
+
export declare function validatePositiveInteger(value: string | number, options?: {
|
|
76
|
+
min?: number;
|
|
77
|
+
max?: number;
|
|
78
|
+
fieldName?: string;
|
|
79
|
+
}): ValidationResult;
|
|
80
|
+
/**
|
|
81
|
+
* 验证配置键名
|
|
82
|
+
* @param key 键名
|
|
83
|
+
* @param validKeys 有效的键名列表
|
|
84
|
+
* @returns 验证结果
|
|
85
|
+
*/
|
|
86
|
+
export declare function validateConfigKey(key: string, validKeys: readonly string[]): ValidationResult;
|
|
87
|
+
/**
|
|
88
|
+
* 组合多个验证器
|
|
89
|
+
* @param validators 验证器数组
|
|
90
|
+
* @returns 组合后的验证结果
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const result = combineValidations([
|
|
95
|
+
* validateRepoName(name),
|
|
96
|
+
* validatePath(path)
|
|
97
|
+
* ]);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare function combineValidations(validators: ValidationResult[]): ValidationResult;
|
|
101
|
+
/**
|
|
102
|
+
* 创建自定义验证器
|
|
103
|
+
* @param predicate 验证函数
|
|
104
|
+
* @param message 错误消息
|
|
105
|
+
* @returns 验证函数
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const validateEmail = createValidator(
|
|
110
|
+
* (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value),
|
|
111
|
+
* "Invalid email format"
|
|
112
|
+
* );
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function createValidator(predicate: (value: string) => boolean, message: string): (value: string) => ValidationResult;
|
|
116
|
+
/**
|
|
117
|
+
* 验证并抛出错误(如果无效)
|
|
118
|
+
* @param result 验证结果
|
|
119
|
+
* @throws Error 如果验证失败
|
|
120
|
+
*/
|
|
121
|
+
export declare function assertValid(result: ValidationResult): void;
|
|
122
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW;IACX,KAAK,EAAE,OAAO,CAAC;IACf,iBAAiB;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAuB/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAmB5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO7C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAiCnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAiB3D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/D,gBAAgB,CA0BlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,gBAAgB,CAalB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,gBAAgB,EAAE,GAC7B,gBAAgB,CAOlB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EACrC,OAAO,EAAE,MAAM,GACd,CAAC,KAAK,EAAE,MAAM,KAAK,gBAAgB,CAOrC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAI1D"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 输入验证模块
|
|
4
|
+
* 提供各种输入验证工具函数
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.validateRepoName = validateRepoName;
|
|
8
|
+
exports.validateGitUrl = validateGitUrl;
|
|
9
|
+
exports.isGitUrl = isGitUrl;
|
|
10
|
+
exports.validateBranchName = validateBranchName;
|
|
11
|
+
exports.validatePath = validatePath;
|
|
12
|
+
exports.validatePositiveInteger = validatePositiveInteger;
|
|
13
|
+
exports.validateConfigKey = validateConfigKey;
|
|
14
|
+
exports.combineValidations = combineValidations;
|
|
15
|
+
exports.createValidator = createValidator;
|
|
16
|
+
exports.assertValid = assertValid;
|
|
17
|
+
/**
|
|
18
|
+
* 验证仓库名称
|
|
19
|
+
* @param name 仓库名称
|
|
20
|
+
* @returns 验证结果
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const result = validateRepoName("my-repo");
|
|
25
|
+
* if (!result.valid) {
|
|
26
|
+
* console.error(result.message);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
function validateRepoName(name) {
|
|
31
|
+
if (!name || name.trim() === "") {
|
|
32
|
+
return { valid: false, message: "Repository name cannot be empty" };
|
|
33
|
+
}
|
|
34
|
+
// 检查是否包含非法字符
|
|
35
|
+
const invalidChars = /[<>:"|?*\x00-\x1f]/;
|
|
36
|
+
if (invalidChars.test(name)) {
|
|
37
|
+
return {
|
|
38
|
+
valid: false,
|
|
39
|
+
message: "Repository name contains invalid characters",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// 检查长度
|
|
43
|
+
if (name.length > 255) {
|
|
44
|
+
return {
|
|
45
|
+
valid: false,
|
|
46
|
+
message: "Repository name is too long (max 255 characters)",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return { valid: true };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 验证 Git URL
|
|
53
|
+
* @param url URL 字符串
|
|
54
|
+
* @returns 验证结果
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const result = validateGitUrl("https://github.com/user/repo.git");
|
|
59
|
+
* if (!result.valid) {
|
|
60
|
+
* console.error(result.message);
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
function validateGitUrl(url) {
|
|
65
|
+
if (!url || url.trim() === "") {
|
|
66
|
+
return { valid: false, message: "URL cannot be empty" };
|
|
67
|
+
}
|
|
68
|
+
// HTTPS 格式: https://github.com/user/repo.git
|
|
69
|
+
const httpsRegex = /^https?:\/\/[^/]+\/[^/]+\/[^/]+/;
|
|
70
|
+
// SSH 格式: git@github.com:user/repo.git
|
|
71
|
+
const sshRegex = /^git@[^:]+:[^/]+\/[^/]+/;
|
|
72
|
+
if (!httpsRegex.test(url) && !sshRegex.test(url)) {
|
|
73
|
+
return {
|
|
74
|
+
valid: false,
|
|
75
|
+
message: "Invalid Git URL format. Expected HTTPS (https://...) or SSH (git@...) format",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return { valid: true };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 检查字符串是否为 Git URL
|
|
82
|
+
* @param str 字符串
|
|
83
|
+
* @returns 是否为 Git URL
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* if (isGitUrl(input)) {
|
|
88
|
+
* // 处理 URL
|
|
89
|
+
* } else {
|
|
90
|
+
* // 处理仓库名称
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
function isGitUrl(str) {
|
|
95
|
+
// HTTPS 格式: https://github.com/user/repo.git
|
|
96
|
+
const httpsRegex = /^https?:\/\/[^/]+\/[^/]+\/[^/]+/;
|
|
97
|
+
// SSH 格式: git@github.com:user/repo.git
|
|
98
|
+
const sshRegex = /^git@[^:]+:[^/]+\/[^/]+/;
|
|
99
|
+
return httpsRegex.test(str) || sshRegex.test(str);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 验证分支名称
|
|
103
|
+
* @param branch 分支名称
|
|
104
|
+
* @returns 验证结果
|
|
105
|
+
*/
|
|
106
|
+
function validateBranchName(branch) {
|
|
107
|
+
if (!branch || branch.trim() === "") {
|
|
108
|
+
return { valid: false, message: "Branch name cannot be empty" };
|
|
109
|
+
}
|
|
110
|
+
// Git 分支名称规则
|
|
111
|
+
// 不能以 . 开头
|
|
112
|
+
if (branch.startsWith(".")) {
|
|
113
|
+
return { valid: false, message: "Branch name cannot start with '.'" };
|
|
114
|
+
}
|
|
115
|
+
// 不能包含连续的 ..
|
|
116
|
+
if (branch.includes("..")) {
|
|
117
|
+
return { valid: false, message: "Branch name cannot contain '..'" };
|
|
118
|
+
}
|
|
119
|
+
// 不能包含特殊字符
|
|
120
|
+
const invalidChars = /[\s~^:?*\[\]\\@{}\x00-\x1f\x7f]/;
|
|
121
|
+
if (invalidChars.test(branch)) {
|
|
122
|
+
return { valid: false, message: "Branch name contains invalid characters" };
|
|
123
|
+
}
|
|
124
|
+
// 不能以 / 结尾
|
|
125
|
+
if (branch.endsWith("/")) {
|
|
126
|
+
return { valid: false, message: "Branch name cannot end with '/'" };
|
|
127
|
+
}
|
|
128
|
+
// 不能以 .lock 结尾
|
|
129
|
+
if (branch.endsWith(".lock")) {
|
|
130
|
+
return { valid: false, message: "Branch name cannot end with '.lock'" };
|
|
131
|
+
}
|
|
132
|
+
return { valid: true };
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 验证路径
|
|
136
|
+
* @param path 路径字符串
|
|
137
|
+
* @returns 验证结果
|
|
138
|
+
*/
|
|
139
|
+
function validatePath(path) {
|
|
140
|
+
if (!path || path.trim() === "") {
|
|
141
|
+
return { valid: false, message: "Path cannot be empty" };
|
|
142
|
+
}
|
|
143
|
+
// 检查是否包含非法字符(Windows)
|
|
144
|
+
const invalidChars = /[<>:"|?*\x00-\x1f]/;
|
|
145
|
+
if (invalidChars.test(path)) {
|
|
146
|
+
return { valid: false, message: "Path contains invalid characters" };
|
|
147
|
+
}
|
|
148
|
+
// 检查路径长度
|
|
149
|
+
if (path.length > 260) {
|
|
150
|
+
return { valid: false, message: "Path is too long (max 260 characters)" };
|
|
151
|
+
}
|
|
152
|
+
return { valid: true };
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 验证正整数
|
|
156
|
+
* @param value 值
|
|
157
|
+
* @param options 选项
|
|
158
|
+
* @returns 验证结果
|
|
159
|
+
*/
|
|
160
|
+
function validatePositiveInteger(value, options = {}) {
|
|
161
|
+
const { min = 1, max = Number.MAX_SAFE_INTEGER, fieldName = "Value", } = options;
|
|
162
|
+
const num = typeof value === "string" ? parseInt(value, 10) : value;
|
|
163
|
+
if (isNaN(num)) {
|
|
164
|
+
return { valid: false, message: `${fieldName} must be a number` };
|
|
165
|
+
}
|
|
166
|
+
if (!Number.isInteger(num)) {
|
|
167
|
+
return { valid: false, message: `${fieldName} must be an integer` };
|
|
168
|
+
}
|
|
169
|
+
if (num < min) {
|
|
170
|
+
return { valid: false, message: `${fieldName} must be at least ${min}` };
|
|
171
|
+
}
|
|
172
|
+
if (num > max) {
|
|
173
|
+
return { valid: false, message: `${fieldName} must be at most ${max}` };
|
|
174
|
+
}
|
|
175
|
+
return { valid: true };
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 验证配置键名
|
|
179
|
+
* @param key 键名
|
|
180
|
+
* @param validKeys 有效的键名列表
|
|
181
|
+
* @returns 验证结果
|
|
182
|
+
*/
|
|
183
|
+
function validateConfigKey(key, validKeys) {
|
|
184
|
+
if (!key || key.trim() === "") {
|
|
185
|
+
return { valid: false, message: "Configuration key cannot be empty" };
|
|
186
|
+
}
|
|
187
|
+
if (!validKeys.includes(key)) {
|
|
188
|
+
return {
|
|
189
|
+
valid: false,
|
|
190
|
+
message: `Unknown configuration key: ${key}. Valid keys: ${validKeys.join(", ")}`,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return { valid: true };
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 组合多个验证器
|
|
197
|
+
* @param validators 验证器数组
|
|
198
|
+
* @returns 组合后的验证结果
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* const result = combineValidations([
|
|
203
|
+
* validateRepoName(name),
|
|
204
|
+
* validatePath(path)
|
|
205
|
+
* ]);
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
function combineValidations(validators) {
|
|
209
|
+
for (const result of validators) {
|
|
210
|
+
if (!result.valid) {
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return { valid: true };
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* 创建自定义验证器
|
|
218
|
+
* @param predicate 验证函数
|
|
219
|
+
* @param message 错误消息
|
|
220
|
+
* @returns 验证函数
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* const validateEmail = createValidator(
|
|
225
|
+
* (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value),
|
|
226
|
+
* "Invalid email format"
|
|
227
|
+
* );
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
function createValidator(predicate, message) {
|
|
231
|
+
return (value) => {
|
|
232
|
+
if (predicate(value)) {
|
|
233
|
+
return { valid: true };
|
|
234
|
+
}
|
|
235
|
+
return { valid: false, message };
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* 验证并抛出错误(如果无效)
|
|
240
|
+
* @param result 验证结果
|
|
241
|
+
* @throws Error 如果验证失败
|
|
242
|
+
*/
|
|
243
|
+
function assertValid(result) {
|
|
244
|
+
if (!result.valid) {
|
|
245
|
+
throw new Error(result.message);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAyBH,4CAuBC;AAeD,wCAmBC;AAgBD,4BAOC;AAOD,gDAiCC;AAOD,oCAiBC;AAQD,0DA6BC;AAQD,8CAgBC;AAeD,gDASC;AAgBD,0CAUC;AAOD,kCAIC;AAvRD;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,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