terminal.php 4.3 KB

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