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,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* grf 配置迁移工具
|
|
4
|
+
* 将旧版单一 config.json 文件迁移到新的模块化配置结构
|
|
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.needsMigration = needsMigration;
|
|
11
|
+
exports.backupLegacyConfig = backupLegacyConfig;
|
|
12
|
+
exports.migrateConfig = migrateConfig;
|
|
13
|
+
exports.validateMigration = validateMigration;
|
|
14
|
+
exports.ensureMigrated = ensureMigrated;
|
|
15
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
16
|
+
const paths_js_1 = require("./paths.js");
|
|
17
|
+
const config_manager_js_1 = require("./config-manager.js");
|
|
18
|
+
const repos_index_js_1 = require("./repos-index.js");
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// 核心迁移函数
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* 检查是否需要迁移
|
|
24
|
+
* 条件:旧配置存在且新配置目录不存在或为空
|
|
25
|
+
* @returns 是否需要迁移
|
|
26
|
+
*/
|
|
27
|
+
async function needsMigration() {
|
|
28
|
+
try {
|
|
29
|
+
const legacyConfigPath = (0, paths_js_1.getLegacyConfigPath)();
|
|
30
|
+
const configDir = (0, paths_js_1.getConfigDir)();
|
|
31
|
+
const reposIndexPath = (0, paths_js_1.getReposIndexPath)();
|
|
32
|
+
// 检查旧配置文件是否存在
|
|
33
|
+
const legacyExists = await fs_extra_1.default.pathExists(legacyConfigPath);
|
|
34
|
+
if (!legacyExists) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
// 检查新配置目录是否存在
|
|
38
|
+
const configDirExists = await fs_extra_1.default.pathExists(configDir);
|
|
39
|
+
if (!configDirExists) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
// 检查新配置目录是否为空
|
|
43
|
+
const configDirContents = await fs_extra_1.default.readdir(configDir);
|
|
44
|
+
if (configDirContents.length === 0) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
// 检查 repos.json 是否存在
|
|
48
|
+
const reposIndexExists = await fs_extra_1.default.pathExists(reposIndexPath);
|
|
49
|
+
if (!reposIndexExists) {
|
|
50
|
+
// 如果旧配置有 repos 数据,需要迁移
|
|
51
|
+
const legacyConfig = await readLegacyConfig();
|
|
52
|
+
if (legacyConfig?.repos && Object.keys(legacyConfig.repos).length > 0) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// 出错时保守处理,不执行迁移
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 读取旧版配置文件
|
|
65
|
+
* @returns 旧版配置对象,如果不存在或解析失败则返回 null
|
|
66
|
+
*/
|
|
67
|
+
async function readLegacyConfig() {
|
|
68
|
+
try {
|
|
69
|
+
const legacyConfigPath = (0, paths_js_1.getLegacyConfigPath)();
|
|
70
|
+
const exists = await fs_extra_1.default.pathExists(legacyConfigPath);
|
|
71
|
+
if (!exists) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const content = await fs_extra_1.default.readFile(legacyConfigPath, "utf-8");
|
|
75
|
+
const config = JSON.parse(content);
|
|
76
|
+
return config;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 备份旧配置文件
|
|
84
|
+
* @returns 备份文件路径,如果备份失败则返回 null
|
|
85
|
+
*/
|
|
86
|
+
async function backupLegacyConfig() {
|
|
87
|
+
try {
|
|
88
|
+
const legacyConfigPath = (0, paths_js_1.getLegacyConfigPath)();
|
|
89
|
+
const exists = await fs_extra_1.default.pathExists(legacyConfigPath);
|
|
90
|
+
if (!exists) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const backupPath = `${legacyConfigPath}.backup`;
|
|
94
|
+
// 如果备份文件已存在,添加时间戳
|
|
95
|
+
let finalBackupPath = backupPath;
|
|
96
|
+
if (await fs_extra_1.default.pathExists(backupPath)) {
|
|
97
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
98
|
+
finalBackupPath = `${legacyConfigPath}.backup.${timestamp}`;
|
|
99
|
+
}
|
|
100
|
+
await fs_extra_1.default.copy(legacyConfigPath, finalBackupPath);
|
|
101
|
+
return finalBackupPath;
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 执行配置迁移
|
|
109
|
+
* @returns 迁移结果
|
|
110
|
+
*/
|
|
111
|
+
async function migrateConfig() {
|
|
112
|
+
try {
|
|
113
|
+
// 检查是否需要迁移
|
|
114
|
+
const shouldMigrate = await needsMigration();
|
|
115
|
+
if (!shouldMigrate) {
|
|
116
|
+
return {
|
|
117
|
+
success: true,
|
|
118
|
+
migrated: false,
|
|
119
|
+
message: "无需迁移:旧配置不存在或新配置已存在",
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
// 读取旧配置
|
|
123
|
+
const legacyConfig = await readLegacyConfig();
|
|
124
|
+
if (!legacyConfig) {
|
|
125
|
+
return {
|
|
126
|
+
success: false,
|
|
127
|
+
migrated: false,
|
|
128
|
+
message: "迁移失败:无法读取旧配置文件",
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// 备份旧配置
|
|
132
|
+
const backupPath = await backupLegacyConfig();
|
|
133
|
+
if (!backupPath) {
|
|
134
|
+
return {
|
|
135
|
+
success: false,
|
|
136
|
+
migrated: false,
|
|
137
|
+
message: "迁移失败:无法备份旧配置文件",
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// 确保目录存在
|
|
141
|
+
await (0, paths_js_1.ensureGrfDirs)();
|
|
142
|
+
// 记录迁移的配置项
|
|
143
|
+
const configsMigrated = [];
|
|
144
|
+
// 迁移 version
|
|
145
|
+
const version = legacyConfig.version ?? config_manager_js_1.CONFIG_DEFAULTS.VERSION;
|
|
146
|
+
await config_manager_js_1.versionConfig.set(version);
|
|
147
|
+
configsMigrated.push("version");
|
|
148
|
+
// 迁移 defaultBranch
|
|
149
|
+
const defaultBranch = legacyConfig.defaultBranch ?? config_manager_js_1.CONFIG_DEFAULTS.DEFAULT_BRANCH;
|
|
150
|
+
await config_manager_js_1.defaultBranchConfig.set(defaultBranch);
|
|
151
|
+
configsMigrated.push("defaultBranch");
|
|
152
|
+
// 迁移 shallowClone
|
|
153
|
+
const shallowClone = legacyConfig.shallowClone ?? config_manager_js_1.CONFIG_DEFAULTS.SHALLOW_CLONE;
|
|
154
|
+
await config_manager_js_1.shallowCloneConfig.set(shallowClone);
|
|
155
|
+
configsMigrated.push("shallowClone");
|
|
156
|
+
// 迁移 shallowDepth
|
|
157
|
+
const shallowDepth = legacyConfig.shallowDepth ?? config_manager_js_1.CONFIG_DEFAULTS.SHALLOW_DEPTH;
|
|
158
|
+
await config_manager_js_1.shallowDepthConfig.set(shallowDepth);
|
|
159
|
+
configsMigrated.push("shallowDepth");
|
|
160
|
+
// 迁移 repos
|
|
161
|
+
const repos = legacyConfig.repos ?? {};
|
|
162
|
+
const repoCount = Object.keys(repos).length;
|
|
163
|
+
if (repoCount > 0) {
|
|
164
|
+
await repos_index_js_1.reposIndex.setAll(repos);
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
success: true,
|
|
168
|
+
migrated: true,
|
|
169
|
+
message: `迁移成功:已迁移 ${configsMigrated.length} 个配置项和 ${repoCount} 个仓库`,
|
|
170
|
+
details: {
|
|
171
|
+
configsMigrated,
|
|
172
|
+
reposMigrated: repoCount,
|
|
173
|
+
backupPath,
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
return {
|
|
179
|
+
success: false,
|
|
180
|
+
migrated: false,
|
|
181
|
+
message: `迁移失败:${error.message}`,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 验证迁移结果
|
|
187
|
+
* 检查新配置文件是否正确创建
|
|
188
|
+
* @returns 验证是否通过
|
|
189
|
+
*/
|
|
190
|
+
async function validateMigration() {
|
|
191
|
+
try {
|
|
192
|
+
// 检查各配置文件是否存在
|
|
193
|
+
const versionExists = await config_manager_js_1.versionConfig.exists();
|
|
194
|
+
const defaultBranchExists = await config_manager_js_1.defaultBranchConfig.exists();
|
|
195
|
+
const shallowCloneExists = await config_manager_js_1.shallowCloneConfig.exists();
|
|
196
|
+
const shallowDepthExists = await config_manager_js_1.shallowDepthConfig.exists();
|
|
197
|
+
// 所有配置文件都必须存在
|
|
198
|
+
if (!versionExists ||
|
|
199
|
+
!defaultBranchExists ||
|
|
200
|
+
!shallowCloneExists ||
|
|
201
|
+
!shallowDepthExists) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
// 尝试读取各配置值,确保格式正确
|
|
205
|
+
await config_manager_js_1.versionConfig.get();
|
|
206
|
+
await config_manager_js_1.defaultBranchConfig.get();
|
|
207
|
+
await config_manager_js_1.shallowCloneConfig.get();
|
|
208
|
+
await config_manager_js_1.shallowDepthConfig.get();
|
|
209
|
+
// 检查 repos.json 是否可读
|
|
210
|
+
const reposIndexPath = (0, paths_js_1.getReposIndexPath)();
|
|
211
|
+
const reposIndexExists = await fs_extra_1.default.pathExists(reposIndexPath);
|
|
212
|
+
if (reposIndexExists) {
|
|
213
|
+
await repos_index_js_1.reposIndex.getAll();
|
|
214
|
+
}
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// ============================================================================
|
|
222
|
+
// 自动迁移入口
|
|
223
|
+
// ============================================================================
|
|
224
|
+
/**
|
|
225
|
+
* 确保配置已迁移
|
|
226
|
+
* 在应用启动时调用,自动检测并执行迁移
|
|
227
|
+
* 此函数是幂等的,多次调用结果相同
|
|
228
|
+
* @returns 迁移结果
|
|
229
|
+
*/
|
|
230
|
+
async function ensureMigrated() {
|
|
231
|
+
try {
|
|
232
|
+
// 检查是否需要迁移
|
|
233
|
+
const shouldMigrate = await needsMigration();
|
|
234
|
+
if (!shouldMigrate) {
|
|
235
|
+
// 不需要迁移,检查是否已经迁移过
|
|
236
|
+
const isValid = await validateMigration();
|
|
237
|
+
if (isValid) {
|
|
238
|
+
return {
|
|
239
|
+
success: true,
|
|
240
|
+
migrated: false,
|
|
241
|
+
message: "配置已是最新格式,无需迁移",
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
// 配置目录存在但验证失败,可能是首次运行
|
|
245
|
+
// 确保目录存在即可
|
|
246
|
+
await (0, paths_js_1.ensureGrfDirs)();
|
|
247
|
+
return {
|
|
248
|
+
success: true,
|
|
249
|
+
migrated: false,
|
|
250
|
+
message: "配置目录已初始化",
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
// 执行迁移
|
|
254
|
+
const result = await migrateConfig();
|
|
255
|
+
// 如果迁移成功,验证结果
|
|
256
|
+
if (result.success && result.migrated) {
|
|
257
|
+
const isValid = await validateMigration();
|
|
258
|
+
if (!isValid) {
|
|
259
|
+
return {
|
|
260
|
+
success: false,
|
|
261
|
+
migrated: true,
|
|
262
|
+
message: "迁移完成但验证失败,配置文件可能不完整",
|
|
263
|
+
details: result.details,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
return {
|
|
271
|
+
success: false,
|
|
272
|
+
migrated: false,
|
|
273
|
+
message: `自动迁移失败:${error.message}`,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/core/migration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAgEH,wCAuCC;AA4BD,gDAwBC;AAMD,sCAqFC;AAOD,8CAmCC;AAYD,wCAqDC;AA/VD,wDAA0B;AAC1B,yCAKoB;AACpB,2DAM6B;AAC7B,qDAA8C;AAuC9C,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E;;;;GAIG;AACI,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,IAAA,8BAAmB,GAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,IAAA,uBAAY,GAAE,CAAC;QACjC,MAAM,cAAc,GAAG,IAAA,4BAAiB,GAAE,CAAC;QAE3C,cAAc;QACd,MAAM,YAAY,GAAG,MAAM,kBAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAC3D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,cAAc;QACd,MAAM,eAAe,GAAG,MAAM,kBAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,cAAc;QACd,MAAM,iBAAiB,GAAG,MAAM,kBAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,qBAAqB;QACrB,MAAM,gBAAgB,GAAG,MAAM,kBAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,uBAAuB;YACvB,MAAM,YAAY,GAAG,M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AAC;QAE7C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,kBAAkB;YAClB,MAAM,OAAO,GAAG,MAAM,iBAAiB,EAAE,CAAC;YAE1C,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,eAAe;iBACzB,CAAC;YACJ,CAAC;YAED,sBAAsB;YACtB,WAAW;YACX,MAAM,IAAA,wBAAa,GAAE,CAAC;YAEtB,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;QAED,OAAO;QACP,MAAM,MAAM,GAAG,MAAM,aAAa,EAAE,CAAC;QAErC,cAAc;QACd,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,OAAO,GAAG,MAAM,iBAAiB,EAAE,CAAC;YAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,qBAAqB;oBAC9B,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,UAAW,KAAe,CAAC,OAAO,EAAE;SAC9C,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grf 路径管理模块
|
|
3
|
+
* 集中管理所有配置文件路径
|
|
4
|
+
*/
|
|
5
|
+
/** grf 配置目录名称 */
|
|
6
|
+
export declare const GRF_DIR_NAME = ".gitreference";
|
|
7
|
+
/** 配置子目录名称 */
|
|
8
|
+
export declare const CONFIG_DIR_NAME = "config";
|
|
9
|
+
/** 各配置项的文件名 */
|
|
10
|
+
export declare const CONFIG_FILES: {
|
|
11
|
+
readonly VERSION: "version.json";
|
|
12
|
+
readonly DEFAULT_BRANCH: "default-branch.json";
|
|
13
|
+
readonly SHALLOW_CLONE: "shallow-clone.json";
|
|
14
|
+
readonly SHALLOW_DEPTH: "shallow-depth.json";
|
|
15
|
+
};
|
|
16
|
+
/** 仓库索引文件名 */
|
|
17
|
+
export declare const REPOS_INDEX_FILE = "repos.json";
|
|
18
|
+
/** 加载状态文件名 */
|
|
19
|
+
export declare const LOADING_STATE_FILE = "loading.json";
|
|
20
|
+
/** 旧版配置文件名(用于迁移) */
|
|
21
|
+
export declare const LEGACY_CONFIG_FILE = "config.json";
|
|
22
|
+
/**
|
|
23
|
+
* 获取 .gitreference 根目录路径
|
|
24
|
+
* @returns grf 根目录的绝对路径 (~/.gitreference/)
|
|
25
|
+
*/
|
|
26
|
+
export declare function getGrfRoot(): string;
|
|
27
|
+
/**
|
|
28
|
+
* 获取 config 子目录路径
|
|
29
|
+
* @returns 配置子目录的绝对路径 (~/.gitreference/config/)
|
|
30
|
+
*/
|
|
31
|
+
export declare function getConfigDir(): string;
|
|
32
|
+
/**
|
|
33
|
+
* 获取特定配置文件路径
|
|
34
|
+
* @param configName 配置文件名(如 'version.json')
|
|
35
|
+
* @returns 配置文件的绝对路径 (~/.gitreference/config/{configName})
|
|
36
|
+
*/
|
|
37
|
+
export declare function getConfigFilePath(configName: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* 获取仓库索引文件路径
|
|
40
|
+
* @returns 仓库索引文件的绝对路径 (~/.gitreference/repos.json)
|
|
41
|
+
*/
|
|
42
|
+
export declare function getReposIndexPath(): string;
|
|
43
|
+
/**
|
|
44
|
+
* 获取加载状态文件路径
|
|
45
|
+
* @returns 加载状态文件的绝对路径 (~/.gitreference/loading.json)
|
|
46
|
+
*/
|
|
47
|
+
export declare function getLoadingStatePath(): string;
|
|
48
|
+
/**
|
|
49
|
+
* 获取旧版配置文件路径(用于迁移)
|
|
50
|
+
* @returns 旧版配置文件的绝对路径 (~/.gitreference/config.json)
|
|
51
|
+
*/
|
|
52
|
+
export declare function getLegacyConfigPath(): string;
|
|
53
|
+
/**
|
|
54
|
+
* 确保 grf 相关目录存在
|
|
55
|
+
* 如果目录不存在则创建
|
|
56
|
+
*/
|
|
57
|
+
export declare function ensureGrfDirs(): Promise<void>;
|
|
58
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/core/paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,iBAAiB;AACjB,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAE5C,cAAc;AACd,eAAO,MAAM,eAAe,WAAW,CAAC;AAMxC,eAAe;AACf,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,cAAc;AACd,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,cAAc;AACd,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD,oBAAoB;AACpB,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAMhD;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAMD;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnD"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* grf 路径管理模块
|
|
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.LEGACY_CONFIG_FILE = exports.LOADING_STATE_FILE = exports.REPOS_INDEX_FILE = exports.CONFIG_FILES = exports.CONFIG_DIR_NAME = exports.GRF_DIR_NAME = void 0;
|
|
11
|
+
exports.getGrfRoot = getGrfRoot;
|
|
12
|
+
exports.getConfigDir = getConfigDir;
|
|
13
|
+
exports.getConfigFilePath = getConfigFilePath;
|
|
14
|
+
exports.getReposIndexPath = getReposIndexPath;
|
|
15
|
+
exports.getLoadingStatePath = getLoadingStatePath;
|
|
16
|
+
exports.getLegacyConfigPath = getLegacyConfigPath;
|
|
17
|
+
exports.ensureGrfDirs = ensureGrfDirs;
|
|
18
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
19
|
+
const os_1 = __importDefault(require("os"));
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// 基础路径常量
|
|
23
|
+
// ============================================================================
|
|
24
|
+
/** grf 配置目录名称 */
|
|
25
|
+
exports.GRF_DIR_NAME = ".gitreference";
|
|
26
|
+
/** 配置子目录名称 */
|
|
27
|
+
exports.CONFIG_DIR_NAME = "config";
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// 配置文件名常量
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/** 各配置项的文件名 */
|
|
32
|
+
exports.CONFIG_FILES = {
|
|
33
|
+
VERSION: "version.json",
|
|
34
|
+
DEFAULT_BRANCH: "default-branch.json",
|
|
35
|
+
SHALLOW_CLONE: "shallow-clone.json",
|
|
36
|
+
SHALLOW_DEPTH: "shallow-depth.json",
|
|
37
|
+
};
|
|
38
|
+
/** 仓库索引文件名 */
|
|
39
|
+
exports.REPOS_INDEX_FILE = "repos.json";
|
|
40
|
+
/** 加载状态文件名 */
|
|
41
|
+
exports.LOADING_STATE_FILE = "loading.json";
|
|
42
|
+
/** 旧版配置文件名(用于迁移) */
|
|
43
|
+
exports.LEGACY_CONFIG_FILE = "config.json";
|
|
44
|
+
// ============================================================================
|
|
45
|
+
// 路径获取函数
|
|
46
|
+
// ============================================================================
|
|
47
|
+
/**
|
|
48
|
+
* 获取 .gitreference 根目录路径
|
|
49
|
+
* @returns grf 根目录的绝对路径 (~/.gitreference/)
|
|
50
|
+
*/
|
|
51
|
+
function getGrfRoot() {
|
|
52
|
+
return path_1.default.join(os_1.default.homedir(), exports.GRF_DIR_NAME);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 获取 config 子目录路径
|
|
56
|
+
* @returns 配置子目录的绝对路径 (~/.gitreference/config/)
|
|
57
|
+
*/
|
|
58
|
+
function getConfigDir() {
|
|
59
|
+
return path_1.default.join(getGrfRoot(), exports.CONFIG_DIR_NAME);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 获取特定配置文件路径
|
|
63
|
+
* @param configName 配置文件名(如 'version.json')
|
|
64
|
+
* @returns 配置文件的绝对路径 (~/.gitreference/config/{configName})
|
|
65
|
+
*/
|
|
66
|
+
function getConfigFilePath(configName) {
|
|
67
|
+
return path_1.default.join(getConfigDir(), configName);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 获取仓库索引文件路径
|
|
71
|
+
* @returns 仓库索引文件的绝对路径 (~/.gitreference/repos.json)
|
|
72
|
+
*/
|
|
73
|
+
function getReposIndexPath() {
|
|
74
|
+
return path_1.default.join(getGrfRoot(), exports.REPOS_INDEX_FILE);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 获取加载状态文件路径
|
|
78
|
+
* @returns 加载状态文件的绝对路径 (~/.gitreference/loading.json)
|
|
79
|
+
*/
|
|
80
|
+
function getLoadingStatePath() {
|
|
81
|
+
return path_1.default.join(getGrfRoot(), exports.LOADING_STATE_FILE);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 获取旧版配置文件路径(用于迁移)
|
|
85
|
+
* @returns 旧版配置文件的绝对路径 (~/.gitreference/config.json)
|
|
86
|
+
*/
|
|
87
|
+
function getLegacyConfigPath() {
|
|
88
|
+
return path_1.default.join(getGrfRoot(), exports.LEGACY_CONFIG_FILE);
|
|
89
|
+
}
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// 工具函数
|
|
92
|
+
// ============================================================================
|
|
93
|
+
/**
|
|
94
|
+
* 确保 grf 相关目录存在
|
|
95
|
+
* 如果目录不存在则创建
|
|
96
|
+
*/
|
|
97
|
+
async function ensureGrfDirs() {
|
|
98
|
+
const grfRoot = getGrfRoot();
|
|
99
|
+
const configDir = getConfigDir();
|
|
100
|
+
await fs_extra_1.default.ensureDir(grfRoot);
|
|
101
|
+
await fs_extra_1.default.ensureDir(configDir);
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/core/paths.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AA6CH,gCAEC;AAMD,oCAEC;AAOD,8CAEC;AAMD,8CAEC;AAMD,kDAEC;AAMD,kDAEC;AAUD,sCAMC;AAtGD,wDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AAExB,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,iBAAiB;AACJ,QAAA,YAAY,GAAG,eAAe,CAAC;AAE5C,cAAc;AACD,QAAA,eAAe,GAAG,QAAQ,CAAC;AAExC,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,eAAe;AACF,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE,qBAAqB;IACrC,aAAa,EAAE,oBAAoB;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,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grf 仓库索引管理模块
|
|
3
|
+
* 管理仓库列表,存储在独立的 repos.json 文件中
|
|
4
|
+
*/
|
|
5
|
+
import { RepoEntry } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* 仓库配置类型(RepoEntry 的别名)
|
|
8
|
+
* 用于保持 API 一致性
|
|
9
|
+
*/
|
|
10
|
+
export type RepoConfig = RepoEntry;
|
|
11
|
+
/**
|
|
12
|
+
* 仓库索引文件结构
|
|
13
|
+
*/
|
|
14
|
+
export interface ReposIndex {
|
|
15
|
+
repos: Record<string, RepoConfig>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 仓库索引管理器
|
|
19
|
+
* 管理 repos.json 文件中的仓库列表
|
|
20
|
+
*/
|
|
21
|
+
export declare class ReposIndexManager {
|
|
22
|
+
private cache;
|
|
23
|
+
/**
|
|
24
|
+
* 读取仓库索引文件
|
|
25
|
+
* 如果文件不存在,返回空的仓库索引
|
|
26
|
+
* @returns 仓库索引对象
|
|
27
|
+
*/
|
|
28
|
+
private read;
|
|
29
|
+
/**
|
|
30
|
+
* 写入仓库索引文件
|
|
31
|
+
* @param index 要写入的仓库索引
|
|
32
|
+
*/
|
|
33
|
+
private write;
|
|
34
|
+
/**
|
|
35
|
+
* 获取所有仓库
|
|
36
|
+
* @returns 仓库名称到配置的映射
|
|
37
|
+
*/
|
|
38
|
+
getAll(): Promise<Record<string, RepoConfig>>;
|
|
39
|
+
/**
|
|
40
|
+
* 获取单个仓库
|
|
41
|
+
* @param name 仓库名称
|
|
42
|
+
* @returns 仓库配置,如果不存在则返回 undefined
|
|
43
|
+
*/
|
|
44
|
+
get(name: string): Promise<RepoConfig | undefined>;
|
|
45
|
+
/**
|
|
46
|
+
* 添加或更新仓库
|
|
47
|
+
* @param name 仓库名称
|
|
48
|
+
* @param config 仓库配置
|
|
49
|
+
*/
|
|
50
|
+
set(name: string, config: RepoConfig): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* 删除仓库
|
|
53
|
+
* @param name 仓库名称
|
|
54
|
+
* @returns 是否成功删除(仓库存在则返回 true)
|
|
55
|
+
*/
|
|
56
|
+
remove(name: string): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* 检查仓库是否存在
|
|
59
|
+
* @param name 仓库名称
|
|
60
|
+
* @returns 仓库是否存在
|
|
61
|
+
*/
|
|
62
|
+
has(name: string): Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* 获取仓库数量
|
|
65
|
+
* @returns 仓库数量
|
|
66
|
+
*/
|
|
67
|
+
count(): Promise<number>;
|
|
68
|
+
/**
|
|
69
|
+
* 获取所有仓库名称
|
|
70
|
+
* @returns 仓库名称数组
|
|
71
|
+
*/
|
|
72
|
+
names(): Promise<string[]>;
|
|
73
|
+
/**
|
|
74
|
+
* 清空所有仓库
|
|
75
|
+
*/
|
|
76
|
+
clear(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* 批量设置仓库(用于迁移)
|
|
79
|
+
* @param repos 仓库名称到配置的映射
|
|
80
|
+
*/
|
|
81
|
+
setAll(repos: Record<string, RepoConfig>): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* 清除缓存
|
|
84
|
+
* 下次调用读取方法时会重新从文件读取
|
|
85
|
+
*/
|
|
86
|
+
clearCache(): void;
|
|
87
|
+
}
|
|
88
|
+
/** 仓库索引管理器单例 */
|
|
89
|
+
export declare const reposIndex: ReposIndexManager;
|
|
90
|
+
/**
|
|
91
|
+
* 获取所有仓库配置
|
|
92
|
+
* @returns 仓库名称到配置的映射
|
|
93
|
+
*/
|
|
94
|
+
export declare function getAllRepos(): Promise<Record<string, RepoConfig>>;
|
|
95
|
+
/**
|
|
96
|
+
* 获取单个仓库配置
|
|
97
|
+
* @param name 仓库名称
|
|
98
|
+
* @returns 仓库配置,如果不存在则返回 undefined
|
|
99
|
+
*/
|
|
100
|
+
export declare function getRepo(name: string): Promise<RepoConfig | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* 保存仓库配置
|
|
103
|
+
* @param name 仓库名称
|
|
104
|
+
* @param config 仓库配置
|
|
105
|
+
*/
|
|
106
|
+
export declare function saveRepo(name: string, config: RepoConfig): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* 删除仓库配置
|
|
109
|
+
* @param name 仓库名称
|
|
110
|
+
* @returns 是否成功删除
|
|
111
|
+
*/
|
|
112
|
+
export declare function removeRepo(name: string): Promise<boolean>;
|
|
113
|
+
//# sourceMappingURL=repos-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repos-index.d.ts","sourceRoot":"","sources":["../../src/core/repos-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAMrC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACnC;AAMD;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAA2B;IAExC;;;;OAIG;YACW,IAAI;IAqClB;;;OAGG;YACW,KAAK;IAanB;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAKnD;;;;OAIG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAKxD;;;;OAIG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1D;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAY5C;;;;OAI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