terminal.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | BuildAdmin-WEB终端配置
  4. // +----------------------------------------------------------------------
  5. return [
  6. // npm包管理器
  7. 'npm_package_manager' => 'npm',
  8. // 安装服务端口
  9. 'install_service_port' => '8000',
  10. // 允许执行的命令
  11. 'commands' => [
  12. // 数据库迁移命令
  13. 'migrate' => [
  14. 'run' => 'php think migrate:run',
  15. 'rollback' => 'php think migrate:rollback',
  16. 'breakpoint' => 'php think migrate:breakpoint',
  17. ],
  18. // 安装包管理器的命令
  19. 'install' => [
  20. 'cnpm' => 'npm install cnpm -g --registry=https://registry.npmmirror.com',
  21. 'yarn' => 'npm install -g yarn',
  22. 'pnpm' => 'npm install -g pnpm',
  23. 'ni' => 'npm install -g @antfu/ni',
  24. ],
  25. // 查看版本的命令
  26. 'version' => [
  27. 'npm' => 'npm -v',
  28. 'cnpm' => 'cnpm -v',
  29. 'yarn' => 'yarn -v',
  30. 'pnpm' => 'pnpm -v',
  31. 'node' => 'node -v',
  32. ],
  33. // 测试命令
  34. 'test' => [
  35. 'npm' => [
  36. 'cwd' => 'public/npm-install-test',
  37. 'command' => 'npm install',
  38. ],
  39. 'cnpm' => [
  40. 'cwd' => 'public/npm-install-test',
  41. 'command' => 'cnpm install',
  42. ],
  43. 'yarn' => [
  44. 'cwd' => 'public/npm-install-test',
  45. 'command' => 'yarn install',
  46. ],
  47. 'pnpm' => [
  48. 'cwd' => 'public/npm-install-test',
  49. 'command' => 'pnpm install',
  50. ],
  51. 'ni' => [
  52. 'cwd' => 'public/npm-install-test',
  53. 'command' => 'ni install',
  54. ],
  55. ],
  56. // 安装 WEB 依赖包
  57. 'web-install' => [
  58. 'npm' => [
  59. 'cwd' => 'web',
  60. 'command' => 'npm install',
  61. ],
  62. 'cnpm' => [
  63. 'cwd' => 'web',
  64. 'command' => 'cnpm install',
  65. ],
  66. 'yarn' => [
  67. 'cwd' => 'web',
  68. 'command' => 'yarn install',
  69. ],
  70. 'pnpm' => [
  71. 'cwd' => 'web',
  72. 'command' => 'pnpm install',
  73. ],
  74. 'ni' => [
  75. 'cwd' => 'web',
  76. 'command' => 'ni install',
  77. ],
  78. ],
  79. // 安装 Web-Nuxt 依赖包
  80. 'nuxt-install' => [
  81. 'npm' => [
  82. 'cwd' => 'web-nuxt',
  83. 'command' => 'npm install',
  84. ],
  85. 'cnpm' => [
  86. 'cwd' => 'web-nuxt',
  87. 'command' => 'cnpm install',
  88. ],
  89. 'yarn' => [
  90. 'cwd' => 'web-nuxt',
  91. 'command' => 'yarn install',
  92. ],
  93. 'pnpm' => [
  94. 'cwd' => 'web-nuxt',
  95. 'command' => 'pnpm install',
  96. ],
  97. 'ni' => [
  98. 'cwd' => 'web-nuxt',
  99. 'command' => 'ni install',
  100. ],
  101. ],
  102. // 构建 WEB 端
  103. 'web-build' => [
  104. 'npm' => [
  105. 'cwd' => 'web',
  106. 'command' => 'npm run build',
  107. ],
  108. 'cnpm' => [
  109. 'cwd' => 'web',
  110. 'command' => 'cnpm run build',
  111. ],
  112. 'yarn' => [
  113. 'cwd' => 'web',
  114. 'command' => 'yarn run build',
  115. ],
  116. 'pnpm' => [
  117. 'cwd' => 'web',
  118. 'command' => 'pnpm run build',
  119. ],
  120. 'ni' => [
  121. 'cwd' => 'web',
  122. 'command' => 'nr build',
  123. ],
  124. ],
  125. // 设置源
  126. 'set-registry' => [
  127. 'npm' => 'npm config set registry https://registry.npmjs.org/ && npm config get registry',
  128. 'taobao' => 'npm config set registry https://registry.npm.taobao.org/ && npm config get registry',
  129. 'rednpm' => 'npm config set registry http://registry.mirror.cqupt.edu.cn/ && npm config get registry'
  130. ],
  131. 'composer' => [
  132. 'update' => [
  133. 'cwd' => '',
  134. 'command' => 'composer update --no-interaction',
  135. ]
  136. ],
  137. 'ping' => [
  138. 'baidu' => 'ping baidu.com',
  139. 'localhost' => 'ping 127.0.0.1 -n 6',
  140. ]
  141. ],
  142. ];