Browse Source

chore(deps): 移除不必要的开发依赖和命令

- 从 composer.json 中移除 topthink/think-ide-helper 依赖
- 删除 ModelPropertyCommand 相关文件及注册配置
- 清理无用的模型属性生成命令代码
runphp 3 months ago
parent
commit
5d65b95aaa
2 changed files with 0 additions and 47 deletions
  1. 0 1
      command.php
  2. 0 46
      src/Command/ModelPropertyCommand.php

+ 0 - 1
command.php

@@ -8,7 +8,6 @@ use SixShop\System\Command\ExtensionScaffoldMakeCommand;
 use SixShop\System\Command\ModelPropertyCommand;
 
 return [
-    'amp:property' => ModelPropertyCommand::class,
     'core:config' => CoreExtensionConfigCommand::class,
     'extension:manage' => ExtensionManagementCommand::class,
     'extension:make' => ExtensionScaffoldMakeCommand::class,

+ 0 - 46
src/Command/ModelPropertyCommand.php

@@ -1,46 +0,0 @@
-<?php
-declare(strict_types=1);
-
-namespace SixShop\System\Command;
-
-use Ergebnis\Classy\Constructs;
-use SixShop\Core\Helper;
-use think\console\Command;
-use think\console\input\Argument;
-use think\console\Input\InputOption;
-
-class ModelPropertyCommand extends Command
-{
-    public function configure(): void
-    {
-        // Annotation for Model Properties
-        $this->setName('amp:property')
-            ->setDescription('Set the model property for extensions')
-            ->addArgument('module', Argument::REQUIRED, 'The module name to process')
-            ->addOption('all', 'a', Argument::OPTIONAL, 'Process all modules');
-    }
-
-    public function handle(): void
-    {
-        $modules = [];
-        if ($this->input->getOption('all')) {
-            $modules = module_name_list();
-        } else {
-            $modules[] = $this->input->getArgument('module');
-        }
-
-        foreach ($modules as $module) {
-            $modelDir = Helper::extension_path($module . '/src/Model');
-            $this->output->info("Generating model property for model directory: $modelDir");
-            if (!file_exists($modelDir)) {
-                $this->output->error("Model directory does not exist: $modelDir");
-                continue;
-            }
-            $constructs = Constructs::fromDirectory($modelDir);
-            foreach ($constructs as $construct) {
-                $this->output->info("Generating model property for model: " . $construct->name());
-                $this->getConsole()->call('ide-helper:model', ['--overwrite' => true, 'model' => $construct->name()]);
-            }
-        }
-    }
-}