@@ -12,13 +12,13 @@ import (
1212 tea "github.com/charmbracelet/bubbletea"
1313 "github.com/spf13/cobra"
1414 "github.com/spf13/viper"
15- "github.com/xinnjie/onekeymap-cli/internal/plugins"
1615 "github.com/xinnjie/onekeymap-cli/internal/views"
1716 "github.com/xinnjie/onekeymap-cli/pkg/api/importerapi"
1817 "github.com/xinnjie/onekeymap-cli/pkg/api/keymap"
1918 "github.com/xinnjie/onekeymap-cli/pkg/api/platform"
2019 "github.com/xinnjie/onekeymap-cli/pkg/api/pluginapi"
2120 "github.com/xinnjie/onekeymap-cli/pkg/api/validateapi"
21+ "github.com/xinnjie/onekeymap-cli/pkg/registry"
2222)
2323
2424type importFlags struct {
@@ -35,7 +35,7 @@ func NewCmdImport() *cobra.Command {
3535 cmd := & cobra.Command {
3636 Use : "import" ,
3737 Short : "Import an editor's keymap to the universal format" ,
38- RunE : importRun (& f , func () (* slog.Logger , * plugins .Registry , importerapi.Importer ) {
38+ RunE : importRun (& f , func () (* slog.Logger , * registry .Registry , importerapi.Importer ) {
3939 return cmdLogger , cmdPluginRegistry , cmdImportService
4040 }),
4141 Args : cobra .ExactArgs (0 ),
@@ -61,7 +61,7 @@ func NewCmdImport() *cobra.Command {
6161
6262func importRun (
6363 f * importFlags ,
64- dependencies func () (* slog.Logger , * plugins .Registry , importerapi.Importer ),
64+ dependencies func () (* slog.Logger , * registry .Registry , importerapi.Importer ),
6565) func (cmd * cobra.Command , _ []string ) error {
6666 return func (cmd * cobra.Command , _ []string ) error {
6767 logger , pluginRegistry , importService := dependencies ()
@@ -79,7 +79,7 @@ func importRunInteractive(
7979 cmd * cobra.Command ,
8080 f * importFlags ,
8181 logger * slog.Logger ,
82- pluginRegistry * plugins .Registry ,
82+ pluginRegistry * registry .Registry ,
8383 importService importerapi.Importer ,
8484 onekeymapConfig string ,
8585) error {
@@ -94,7 +94,7 @@ func importRunNonInteractive(
9494 cmd * cobra.Command ,
9595 f * importFlags ,
9696 logger * slog.Logger ,
97- pluginRegistry * plugins .Registry ,
97+ pluginRegistry * registry .Registry ,
9898 importService importerapi.Importer ,
9999 onekeymapConfig string ,
100100) error {
@@ -282,7 +282,7 @@ func handleInteractiveImportFlags(
282282 cmd * cobra.Command ,
283283 f * importFlags ,
284284 onekeymapConfig string ,
285- pluginRegistry * plugins .Registry ,
285+ pluginRegistry * registry .Registry ,
286286 logger * slog.Logger ,
287287) error {
288288 needSelectEditor := ! cmd .Flags ().Changed ("from" ) || f .from == ""
@@ -312,7 +312,7 @@ func prepareInteractiveImportFlags(
312312 cmd * cobra.Command ,
313313 f * importFlags ,
314314 onekeymapConfig string ,
315- pluginRegistry * plugins .Registry ,
315+ pluginRegistry * registry .Registry ,
316316 logger * slog.Logger ,
317317) error {
318318 if err := handleInteractiveImportFlags (cmd , f , onekeymapConfig , pluginRegistry , logger ); err != nil {
@@ -345,7 +345,7 @@ func prepareInteractiveImportFlags(
345345func prepareNonInteractiveImportFlags (
346346 f * importFlags ,
347347 onekeymapConfig string ,
348- pluginRegistry * plugins .Registry ,
348+ pluginRegistry * registry .Registry ,
349349 logger * slog.Logger ,
350350) error {
351351 if f .from == "" {
@@ -388,7 +388,7 @@ func runImportChangesPreview(changes *importerapi.KeymapChanges) (bool, error) {
388388// runImportForm runs the interactive import form and returns the selected values.
389389// All TUI logic is encapsulated here to keep cmd/import.go simple.
390390func runImportForm (
391- pluginRegistry * plugins .Registry ,
391+ pluginRegistry * registry .Registry ,
392392 from , input , output * string ,
393393 onekeymapConfigPlaceHolder string ,
394394 needSelectEditor , needInput , needOutput bool ,
0 commit comments