@oinone/cli 7.2.5 → 7.2.7

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.
Files changed (224) hide show
  1. package/README.md +100 -71
  2. package/README_zh-CN.md +100 -71
  3. package/bin/cli.js +48 -473
  4. package/bin/commands/cache.js +70 -0
  5. package/bin/commands/create/enterprise.js +81 -0
  6. package/bin/commands/create/index.js +128 -0
  7. package/bin/commands/create/project.js +81 -0
  8. package/bin/commands/create/prompts.js +126 -0
  9. package/bin/commands/create/static-resources.js +159 -0
  10. package/bin/commands/create/template.js +38 -0
  11. package/bin/commands/create/update-check.js +44 -0
  12. package/bin/commands/create/version-source.js +32 -0
  13. package/bin/commands/create.js +1 -0
  14. package/bin/commands/doctor.js +51 -0
  15. package/bin/config.js +54 -0
  16. package/bin/i18n.js +51 -125
  17. package/bin/locales/en-US.json +81 -0
  18. package/bin/locales/zh-CN.json +81 -0
  19. package/bin/utils/oinone-version.js +60 -0
  20. package/package.json +2 -2
  21. package/template-6.4.0/packages/ss-boot/public/favicon.ico +0 -0
  22. package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/src/main.ts +1 -2
  23. package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/vue.config.js +1 -1
  24. package/{template-7.2.0-community → template-7.2.0}/npmrc +2 -0
  25. package/{template-7.2.0-community → template-7.2.0}/packages/ss-admin-widget/package.json +3 -2
  26. package/{template-7.2.0-community → template-7.2.0}/packages/ss-admin-widget/rollup.config.js +2 -0
  27. package/template-7.2.0/packages/ss-boot/public/favicon.ico +0 -0
  28. package/{template-7.2.0-community → template-7.2.0}/packages/ss-boot/src/main.ts +1 -2
  29. package/{template-7.2.0-community → template-7.2.0}/packages/ss-boot/vue.config.js +1 -1
  30. package/{template-7.2.0-enterprise → template-7.2.0}/packages/ss-oinone/package.json +3 -2
  31. package/{template-7.2.0-enterprise → template-7.2.0}/packages/ss-oinone/rollup.config.js +2 -0
  32. package/{template-7.2.0-community → template-7.2.0}/packages/ss-project/package.json +3 -2
  33. package/{template-7.2.0-enterprise → template-7.2.0}/packages/ss-project/rollup.config.js +2 -0
  34. package/template-6.4.0-community/packages/ss-boot/public/favicon.ico +0 -0
  35. package/template-6.4.0-enterprise/.eslintignore +0 -5
  36. package/template-6.4.0-enterprise/.eslintrc.json +0 -72
  37. package/template-6.4.0-enterprise/_package.json +0 -47
  38. package/template-6.4.0-enterprise/npmrc +0 -3
  39. package/template-6.4.0-enterprise/packages/ss-admin-widget/package.json +0 -25
  40. package/template-6.4.0-enterprise/packages/ss-admin-widget/rollup.config.js +0 -73
  41. package/template-6.4.0-enterprise/packages/ss-admin-widget/tsconfig.json +0 -45
  42. package/template-6.4.0-enterprise/packages/ss-boot/package.json +0 -66
  43. package/template-6.4.0-enterprise/packages/ss-boot/public/favicon.ico +0 -0
  44. package/template-6.4.0-enterprise/packages/ss-boot/src/main.ts +0 -69
  45. package/template-6.4.0-enterprise/packages/ss-boot/tsconfig.json +0 -44
  46. package/template-6.4.0-enterprise/packages/ss-boot/vue.config.js +0 -84
  47. package/template-6.4.0-enterprise/packages/ss-oinone/package.json +0 -29
  48. package/template-6.4.0-enterprise/packages/ss-oinone/rollup.config.js +0 -82
  49. package/template-6.4.0-enterprise/packages/ss-oinone/tsconfig.json +0 -42
  50. package/template-6.4.0-enterprise/packages/ss-project/package.json +0 -30
  51. package/template-6.4.0-enterprise/packages/ss-project/rollup.config.js +0 -83
  52. package/template-6.4.0-enterprise/packages/ss-project/tsconfig.json +0 -42
  53. package/template-6.4.0-enterprise/scripts/build/postbuild.js +0 -42
  54. package/template-6.4.0-enterprise/scripts/build/prebuild-only.js +0 -48
  55. package/template-7.2.0-community/.prettierrc.json +0 -8
  56. package/template-7.2.0-community/README.md +0 -59
  57. package/template-7.2.0-community/gitignore +0 -58
  58. package/template-7.2.0-community/lerna.json +0 -12
  59. package/template-7.2.0-community/packages/ss-admin-widget/index.ts +0 -1
  60. package/template-7.2.0-community/packages/ss-admin-widget/scripts/postpublish.js +0 -13
  61. package/template-7.2.0-community/packages/ss-admin-widget/scripts/prepublish-only.js +0 -24
  62. package/template-7.2.0-community/packages/ss-admin-widget/src/index.ts +0 -1
  63. package/template-7.2.0-community/packages/ss-admin-widget/src/shim-translate.d.ts +0 -10
  64. package/template-7.2.0-community/packages/ss-admin-widget/src/shim-vue.d.ts +0 -6
  65. package/template-7.2.0-community/packages/ss-boot/.env +0 -1
  66. package/template-7.2.0-community/packages/ss-boot/.env.example +0 -6
  67. package/template-7.2.0-community/packages/ss-boot/public/favicon.ico +0 -0
  68. package/template-7.2.0-community/packages/ss-boot/public/index.html +0 -83
  69. package/template-7.2.0-community/packages/ss-boot/public/manifest.js +0 -5
  70. package/template-7.2.0-community/packages/ss-boot/src/shim-translate.d.ts +0 -10
  71. package/template-7.2.0-community/packages/ss-boot/src/shim-vue.d.ts +0 -6
  72. package/template-7.2.0-community/packages/ss-oinone/index.ts +0 -1
  73. package/template-7.2.0-community/packages/ss-oinone/package.json +0 -30
  74. package/template-7.2.0-community/packages/ss-oinone/rollup.config.js +0 -14
  75. package/template-7.2.0-community/packages/ss-oinone/scripts/postpublish.js +0 -13
  76. package/template-7.2.0-community/packages/ss-oinone/scripts/prepublish-only.js +0 -24
  77. package/template-7.2.0-community/packages/ss-oinone/src/index.ts +0 -1
  78. package/template-7.2.0-community/packages/ss-oinone/src/shim-translate.d.ts +0 -10
  79. package/template-7.2.0-community/packages/ss-oinone/src/shim-vue.d.ts +0 -6
  80. package/template-7.2.0-community/packages/ss-project/index.ts +0 -1
  81. package/template-7.2.0-community/packages/ss-project/rollup.config.js +0 -14
  82. package/template-7.2.0-community/packages/ss-project/scripts/postpublish.js +0 -13
  83. package/template-7.2.0-community/packages/ss-project/scripts/prepublish-only.js +0 -24
  84. package/template-7.2.0-community/packages/ss-project/src/index.ts +0 -1
  85. package/template-7.2.0-community/packages/ss-project/src/shim-translate.d.ts +0 -10
  86. package/template-7.2.0-community/packages/ss-project/src/shim-vue.d.ts +0 -6
  87. package/template-7.2.0-community/pnpm-workspace.yaml +0 -3
  88. package/template-7.2.0-community/scripts/build/inset-tsconfig.js +0 -68
  89. package/template-7.2.0-community/scripts/build/package-name.js +0 -25
  90. package/template-7.2.0-community/scripts/clean.mjs +0 -22
  91. package/template-7.2.0-enterprise/.prettierrc.json +0 -8
  92. package/template-7.2.0-enterprise/README.md +0 -59
  93. package/template-7.2.0-enterprise/_package.json +0 -57
  94. package/template-7.2.0-enterprise/eslint.config.ts +0 -23
  95. package/template-7.2.0-enterprise/gitignore +0 -58
  96. package/template-7.2.0-enterprise/lerna.json +0 -12
  97. package/template-7.2.0-enterprise/npmrc +0 -3
  98. package/template-7.2.0-enterprise/packages/ss-admin-widget/index.ts +0 -1
  99. package/template-7.2.0-enterprise/packages/ss-admin-widget/package.json +0 -27
  100. package/template-7.2.0-enterprise/packages/ss-admin-widget/rollup.config.js +0 -14
  101. package/template-7.2.0-enterprise/packages/ss-admin-widget/scripts/postpublish.js +0 -13
  102. package/template-7.2.0-enterprise/packages/ss-admin-widget/scripts/prepublish-only.js +0 -24
  103. package/template-7.2.0-enterprise/packages/ss-admin-widget/src/index.ts +0 -1
  104. package/template-7.2.0-enterprise/packages/ss-admin-widget/src/shim-translate.d.ts +0 -10
  105. package/template-7.2.0-enterprise/packages/ss-admin-widget/src/shim-vue.d.ts +0 -6
  106. package/template-7.2.0-enterprise/packages/ss-admin-widget/tsconfig.json +0 -14
  107. package/template-7.2.0-enterprise/packages/ss-boot/.env +0 -1
  108. package/template-7.2.0-enterprise/packages/ss-boot/.env.example +0 -6
  109. package/template-7.2.0-enterprise/packages/ss-boot/package.json +0 -64
  110. package/template-7.2.0-enterprise/packages/ss-boot/public/favicon.ico +0 -0
  111. package/template-7.2.0-enterprise/packages/ss-boot/public/index.html +0 -83
  112. package/template-7.2.0-enterprise/packages/ss-boot/public/manifest.js +0 -5
  113. package/template-7.2.0-enterprise/packages/ss-boot/src/main.ts +0 -66
  114. package/template-7.2.0-enterprise/packages/ss-boot/src/shim-translate.d.ts +0 -10
  115. package/template-7.2.0-enterprise/packages/ss-boot/src/shim-vue.d.ts +0 -6
  116. package/template-7.2.0-enterprise/packages/ss-boot/tsconfig.json +0 -27
  117. package/template-7.2.0-enterprise/packages/ss-boot/vue.config.js +0 -87
  118. package/template-7.2.0-enterprise/packages/ss-oinone/index.ts +0 -1
  119. package/template-7.2.0-enterprise/packages/ss-oinone/scripts/postpublish.js +0 -13
  120. package/template-7.2.0-enterprise/packages/ss-oinone/scripts/prepublish-only.js +0 -24
  121. package/template-7.2.0-enterprise/packages/ss-oinone/src/index.ts +0 -1
  122. package/template-7.2.0-enterprise/packages/ss-oinone/src/shim-translate.d.ts +0 -10
  123. package/template-7.2.0-enterprise/packages/ss-oinone/src/shim-vue.d.ts +0 -6
  124. package/template-7.2.0-enterprise/packages/ss-oinone/tsconfig.json +0 -14
  125. package/template-7.2.0-enterprise/packages/ss-project/index.ts +0 -1
  126. package/template-7.2.0-enterprise/packages/ss-project/package.json +0 -30
  127. package/template-7.2.0-enterprise/packages/ss-project/scripts/postpublish.js +0 -13
  128. package/template-7.2.0-enterprise/packages/ss-project/scripts/prepublish-only.js +0 -24
  129. package/template-7.2.0-enterprise/packages/ss-project/src/index.ts +0 -1
  130. package/template-7.2.0-enterprise/packages/ss-project/src/shim-translate.d.ts +0 -10
  131. package/template-7.2.0-enterprise/packages/ss-project/src/shim-vue.d.ts +0 -6
  132. package/template-7.2.0-enterprise/packages/ss-project/tsconfig.json +0 -14
  133. package/template-7.2.0-enterprise/pnpm-workspace.yaml +0 -3
  134. package/template-7.2.0-enterprise/scripts/build/inset-tsconfig.js +0 -68
  135. package/template-7.2.0-enterprise/scripts/build/package-name.js +0 -25
  136. package/template-7.2.0-enterprise/scripts/clean.mjs +0 -22
  137. /package/{template-6.4.0-community → template-6.4.0}/.eslintignore +0 -0
  138. /package/{template-6.4.0-community → template-6.4.0}/.eslintrc.json +0 -0
  139. /package/{template-6.4.0-community → template-6.4.0}/.prettierrc.json +0 -0
  140. /package/{template-6.4.0-community → template-6.4.0}/README.md +0 -0
  141. /package/{template-6.4.0-community → template-6.4.0}/_package.json +0 -0
  142. /package/{template-6.4.0-community → template-6.4.0}/gitignore +0 -0
  143. /package/{template-6.4.0-community → template-6.4.0}/lerna.json +0 -0
  144. /package/{template-6.4.0-community → template-6.4.0}/npmrc +0 -0
  145. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/index.ts +0 -0
  146. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/package.json +0 -0
  147. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/rollup.config.js +0 -0
  148. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/scripts/postpublish.js +0 -0
  149. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/scripts/prepublish-only.js +0 -0
  150. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/src/index.ts +0 -0
  151. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/src/shim-translate.d.ts +0 -0
  152. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/src/shim-vue.d.ts +0 -0
  153. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-admin-widget/tsconfig.json +0 -0
  154. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/.env +0 -0
  155. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/.env.example +0 -0
  156. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/package.json +0 -0
  157. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/public/index.html +0 -0
  158. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/public/manifest.js +0 -0
  159. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/src/shim-translate.d.ts +0 -0
  160. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/src/shim-vue.d.ts +0 -0
  161. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-boot/tsconfig.json +0 -0
  162. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/index.ts +0 -0
  163. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/package.json +0 -0
  164. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/rollup.config.js +0 -0
  165. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/scripts/postpublish.js +0 -0
  166. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/scripts/prepublish-only.js +0 -0
  167. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/src/index.ts +0 -0
  168. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/src/shim-translate.d.ts +0 -0
  169. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/src/shim-vue.d.ts +0 -0
  170. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-oinone/tsconfig.json +0 -0
  171. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/index.ts +0 -0
  172. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/package.json +0 -0
  173. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/rollup.config.js +0 -0
  174. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/scripts/postpublish.js +0 -0
  175. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/scripts/prepublish-only.js +0 -0
  176. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/src/index.ts +0 -0
  177. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/src/shim-translate.d.ts +0 -0
  178. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/src/shim-vue.d.ts +0 -0
  179. /package/{template-6.4.0-community → template-6.4.0}/packages/ss-project/tsconfig.json +0 -0
  180. /package/{template-6.4.0-community → template-6.4.0}/pnpm-workspace.yaml +0 -0
  181. /package/{template-6.4.0-community → template-6.4.0}/scripts/build/inset-tsconfig.js +0 -0
  182. /package/{template-6.4.0-community → template-6.4.0}/scripts/build/package-name.js +0 -0
  183. /package/{template-6.4.0-community → template-6.4.0}/scripts/build/postbuild.js +0 -0
  184. /package/{template-6.4.0-community → template-6.4.0}/scripts/build/prebuild-only.js +0 -0
  185. /package/{template-6.4.0-community → template-6.4.0}/scripts/clean.mjs +0 -0
  186. /package/{template-6.4.0-enterprise → template-7.2.0}/.prettierrc.json +0 -0
  187. /package/{template-6.4.0-enterprise → template-7.2.0}/README.md +0 -0
  188. /package/{template-7.2.0-community → template-7.2.0}/_package.json +0 -0
  189. /package/{template-7.2.0-community → template-7.2.0}/eslint.config.ts +0 -0
  190. /package/{template-6.4.0-enterprise → template-7.2.0}/gitignore +0 -0
  191. /package/{template-6.4.0-enterprise → template-7.2.0}/lerna.json +0 -0
  192. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-admin-widget/index.ts +0 -0
  193. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-admin-widget/scripts/postpublish.js +0 -0
  194. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-admin-widget/scripts/prepublish-only.js +0 -0
  195. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-admin-widget/src/index.ts +0 -0
  196. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-admin-widget/src/shim-translate.d.ts +0 -0
  197. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-admin-widget/src/shim-vue.d.ts +0 -0
  198. /package/{template-7.2.0-community → template-7.2.0}/packages/ss-admin-widget/tsconfig.json +0 -0
  199. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-boot/.env +0 -0
  200. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-boot/.env.example +0 -0
  201. /package/{template-7.2.0-community → template-7.2.0}/packages/ss-boot/package.json +0 -0
  202. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-boot/public/index.html +0 -0
  203. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-boot/public/manifest.js +0 -0
  204. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-boot/src/shim-translate.d.ts +0 -0
  205. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-boot/src/shim-vue.d.ts +0 -0
  206. /package/{template-7.2.0-community → template-7.2.0}/packages/ss-boot/tsconfig.json +0 -0
  207. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-oinone/index.ts +0 -0
  208. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-oinone/scripts/postpublish.js +0 -0
  209. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-oinone/scripts/prepublish-only.js +0 -0
  210. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-oinone/src/index.ts +0 -0
  211. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-oinone/src/shim-translate.d.ts +0 -0
  212. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-oinone/src/shim-vue.d.ts +0 -0
  213. /package/{template-7.2.0-community → template-7.2.0}/packages/ss-oinone/tsconfig.json +0 -0
  214. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-project/index.ts +0 -0
  215. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-project/scripts/postpublish.js +0 -0
  216. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-project/scripts/prepublish-only.js +0 -0
  217. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-project/src/index.ts +0 -0
  218. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-project/src/shim-translate.d.ts +0 -0
  219. /package/{template-6.4.0-enterprise → template-7.2.0}/packages/ss-project/src/shim-vue.d.ts +0 -0
  220. /package/{template-7.2.0-community → template-7.2.0}/packages/ss-project/tsconfig.json +0 -0
  221. /package/{template-6.4.0-enterprise → template-7.2.0}/pnpm-workspace.yaml +0 -0
  222. /package/{template-6.4.0-enterprise → template-7.2.0}/scripts/build/inset-tsconfig.js +0 -0
  223. /package/{template-6.4.0-enterprise → template-7.2.0}/scripts/build/package-name.js +0 -0
  224. /package/{template-6.4.0-enterprise → template-7.2.0}/scripts/clean.mjs +0 -0
package/README.md CHANGED
@@ -1,115 +1,144 @@
1
- # Quick Start
1
+ # Oinone Frontend CLI
2
2
 
3
- Read this in [中文](README_zh-CN.md).
3
+ CLI scaffolding tool to generate Oinone frontend projects.
4
4
 
5
- ## Global Installation of `@oinone/cli`
5
+ - Package: `@oinone/cli`
6
+ - Binary: `oinone-frontend`
7
+ - 中文文档: [README_zh-CN.md](./README_zh-CN.md)
6
8
 
7
- ```shell
8
- npm install -g @oinone/cli
9
- ```
9
+ ## Features
10
10
 
11
- ## Create Frontend Project
11
+ - Interactive project scaffolding with sensible defaults
12
+ - Non-interactive (CI-friendly) mode via CLI options
13
+ - Optional enterprise registry credential file generation
14
+ - Static resource cache management via `cache`
15
+ - Environment check via `doctor`
12
16
 
13
- Create a frontend project in any directory. We provide two modes: interactive creation and silent creation.
17
+ ## Requirements
14
18
 
15
- ### 1. **Interactive Creation**
19
+ - Node.js to run the CLI
20
+ - pnpm is recommended for installing dependencies in the generated project
16
21
 
17
- Follow the prompts to enter the company abbreviation, project name, select the Oinone edition, version, and whether to download the latest static resources.
22
+ ## Installation
18
23
 
19
- ```shell
20
- oinone-frontend
24
+ ```bash
25
+ npm install -g @oinone/cli
21
26
  ```
22
27
 
23
- **Example:**
28
+ Or run with `npx`:
24
29
 
25
- ```shell
26
- Please enter the company name (e.g. ss): ss
27
- Please enter the project name (e.g. oms): oms
28
- Please select the Oinone edition: Community Edition (Default)
29
- Please select the Oinone version: 7.2.0 (Default)
30
- Do you want to download the latest static resources? (Y/n): Y
30
+ ```bash
31
+ npx @oinone/cli create my-project
32
+ ```
31
33
 
32
- Project created successfully!
34
+ ## Usage
33
35
 
34
- To get started:
36
+ ### Quick create (recommended)
35
37
 
36
- cd ss-oms-frontend
37
- pnpm install
38
- pnpm run dev
38
+ ```bash
39
+ oinone-frontend create my-project --oinone-version 7.2.0 --edition community
39
40
  ```
40
41
 
41
- ### 2. Silent Creation
42
+ ```bash
43
+ oinone-frontend create my-project-enterprise --oinone-version 7.2.0 --edition enterprise --auth-token <token> --write-project-credential
44
+ ```
42
45
 
43
- If you want to skip the interactive steps to quickly create a project, you can directly append the project name after the command. In silent creation mode, the sub-packages and file prefixes in the project will default to this project name, the Oinone version will default to `7.2.0`, and the edition will default to `community`.
46
+ ### More examples
44
47
 
45
- ```shell
46
- oinone-frontend <project-name>
47
- ```
48
+ Create project (interactive):
48
49
 
49
- **Parameters:**
50
- - `<project-name>`: The name of the project you want to create (will be used as the project folder name and module prefix).
51
- - `--download-static-resource`: Controls whether to automatically download static resources. Optional values are `true` (default) or `false`.
52
- - `--oinone-version`: Specifies the Oinone version number (e.g., `7.2.0` or `6.4.0`). The default value is `7.2.0`.
53
- - `--edition`: Specifies the Oinone edition to use. Optional values are `community` (default) or `enterprise`.
50
+ ```bash
51
+ oinone-frontend create
52
+ ```
54
53
 
55
- **Example (Create, skip resource download, and specify version number and edition):**
54
+ Create project (non-interactive):
56
55
 
57
- ```shell
58
- oinone-frontend my-project --download-static-resource=true --oinone-version="7.2.0" --edition="enterprise"
56
+ ```bash
57
+ oinone-frontend create my-project --oinone-version 7.2.0 --edition community
59
58
  ```
60
59
 
61
- When you disable the automatic download of the resource package, the CLI will output the script commands required for manual download after the project creation is completed.
60
+ Create project with `--company-name` / `--project-name`:
62
61
 
63
- ### 3. Cache Management
62
+ ```bash
63
+ oinone-frontend create --company-name ss --project-name oms --oinone-version 7.2.0 --edition community
64
+ ```
64
65
 
65
- The CLI caches downloaded static resources in the system's temporary directory to speed up subsequent project creations. You can manage this cache using the `cache` command.
66
+ Dry-run (no files written):
66
67
 
67
- **View Cache Information:**
68
- ```shell
69
- oinone-frontend cache info
68
+ ```bash
69
+ oinone-frontend create my-project --oinone-version 7.2.0 --edition community --dry-run
70
70
  ```
71
71
 
72
- **Clean Cache:**
73
- ```shell
74
- oinone-frontend cache clean
72
+ Create project (Oinone `6.4.*`):
73
+
74
+ ```bash
75
+ oinone-frontend create my-project-64 --oinone-version 6.4.0 --edition community
75
76
  ```
76
77
 
77
- **Cache Help Command:**
78
- You can use the `-h` or `--help` option with the `cache` command to view its specific help documentation.
79
- ```shell
80
- oinone-frontend cache -h
78
+ ### Check environment
79
+
80
+ ```bash
81
+ oinone-frontend doctor --oinone-version 7.2.0
81
82
  ```
82
83
 
83
- ### 4. Help Command
84
+ ## Command reference
84
85
 
85
- You can use the `-h` or `--help` option to view the CLI's standard help documentation.
86
+ ### Global options
86
87
 
87
- ```shell
88
- oinone-frontend -h
89
- ```
88
+ | Option | Description |
89
+ | --- | --- |
90
+ | `-l, --lang <lang>` | Language (`zh-CN` or `en-US`) |
91
+ | `-v, --version` | Print version |
92
+ | `-h, --help` | Show help |
90
93
 
91
- **Output:**
94
+ ### `oinone-frontend create [projectName]`
92
95
 
93
- ```shell
94
- Usage: cli [options] [command]
96
+ | Option | Description |
97
+ | --- | --- |
98
+ | `--company-name <name>` | Company/organization name (silent mode) |
99
+ | `--project-name <name>` | Project name (silent mode) |
100
+ | `--download-static-resource <boolean>` | Download static resources (`true`/`false`) |
101
+ | `-o, --oinone-version <version>` | Oinone version (e.g. `7.2.0`, `6.4.0`) |
102
+ | `-e, --edition <edition>` | Edition (`community`, `enterprise`) |
103
+ | `--auth-token <token>` | Enterprise registry auth token (optional) |
104
+ | `--write-project-credential` | Write `.npmrc` into the project and auto-add to `.gitignore` |
105
+ | `-f, --force` | Overwrite/merge into existing directory |
106
+ | `-d, --dry-run` | Dry-run (no files written) |
95
107
 
96
- Oinone Frontend Template CLI
108
+ ### `oinone-frontend doctor`
97
109
 
98
- Options:
99
- -V, --version output the version number
100
- -h, --help display help for command
110
+ | Option | Description |
111
+ | --- | --- |
112
+ | `-o, --oinone-version <version>` | Oinone version to validate against (`6.4.*` or `7.2+`) |
101
113
 
102
- Commands:
103
- cache Manage the local static resources cache
104
- help [command] display help for command
105
- ```
114
+ ### `oinone-frontend cache`
115
+
116
+ | Command | Description |
117
+ | --- | --- |
118
+ | `cache info` | Print cache directory information |
119
+ | `cache clean` | Clean cached static resources |
120
+
121
+ ## Enterprise credentials
122
+
123
+ When `--write-project-credential` is enabled for enterprise edition, the CLI writes `.npmrc` into the project directory and appends it to `.gitignore`.
124
+
125
+ ## Template mapping
106
126
 
107
- ## Uninstall `@oinone/cli`
127
+ - `6.4.*` `template-6.4.0`
128
+ - `7.2+` → `template-7.2.0`
108
129
 
109
- If you need to uninstall the CLI tool, you can run the following command:
130
+ Unsupported versions fail fast.
110
131
 
111
- ```shell
112
- npm uninstall -g @oinone/cli
132
+ ## Notes
133
+
134
+ Uninstalling the CLI does not remove cached static resources. To clean the cache:
135
+
136
+ ```bash
137
+ oinone-frontend cache clean
113
138
  ```
114
139
 
115
- > **Note:** Uninstalling the CLI will **not** automatically clean up the cached static resources in your temporary directory. If you want to completely remove the cache, please run `oinone-frontend cache clean` before uninstalling, or manually delete the `oinone-cli-cache` folder in your system's temporary directory.
140
+ ## Development
141
+
142
+ ```bash
143
+ npm test
144
+ ```
package/README_zh-CN.md CHANGED
@@ -1,115 +1,144 @@
1
- # 快速开始
1
+ # Oinone Frontend CLI
2
2
 
3
- Read this in [English](README.MD).
3
+ 用于生成 Oinone 前端工程的脚手架 CLI。
4
4
 
5
- ## 全局安装 `@oinone/cli`
5
+ - 包名:`@oinone/cli`
6
+ - 命令:`oinone-frontend`
7
+ - English: [README.md](./README.md)
6
8
 
7
- ``` shell
8
- npm install -g @oinone/cli
9
- ```
9
+ ## 功能特性
10
10
 
11
- ## 创建前端工程
11
+ - 交互式创建工程,内置默认值与合理校验
12
+ - 支持参数静默创建(适用于 CI/CD)
13
+ - 企业版可选生成仓库凭证文件
14
+ - 提供 `cache` 静态资源缓存管理
15
+ - 提供 `doctor` 环境检查
12
16
 
13
- 在任意目录下创建前端工程。我们提供了交互式创建和静默创建两种模式。
17
+ ## 环境要求
14
18
 
15
- ### 1. 交互式创建
19
+ - 运行 CLI:Node.js
20
+ - 安装生成的前端工程依赖:建议使用 pnpm
16
21
 
17
- 根据提示输入公司简称, 项目名称、选择 Oinone 版本(社区/企业)、版本号以及是否下载最新静态资源包即可。
22
+ ## 安装
18
23
 
19
- ``` shell
20
- oinone-frontend
24
+ ```bash
25
+ npm install -g @oinone/cli
21
26
  ```
22
27
 
23
- **示例:**
28
+ 或使用 `npx`:
24
29
 
25
- ``` shell
26
- Please enter the company name (e.g. ss): ss
27
- Please enter the project name (e.g. oms): oms
28
- Please select the Oinone edition: Community Edition (Default)
29
- Please select the Oinone version: 7.2.0 (Default)
30
- Do you want to download the latest static resources? (Y/n): Y
30
+ ```bash
31
+ npx @oinone/cli create my-project
32
+ ```
31
33
 
32
- Project created successfully!
34
+ ## 使用
33
35
 
34
- To get started:
36
+ ### 快速创建(推荐)
35
37
 
36
- cd ss-oms-frontend
37
- pnpm install
38
- pnpm run dev
38
+ ```bash
39
+ oinone-frontend create my-project --oinone-version 7.2.0 --edition community
39
40
  ```
40
41
 
41
- ### 2. 静默创建
42
+ ```bash
43
+ oinone-frontend create my-project-enterprise --oinone-version 7.2.0 --edition enterprise --auth-token <token> --write-project-credential
44
+ ```
42
45
 
43
- 如果您希望跳过交互步骤快速创建工程,可以直接在命令后追加项目名称。静默创建时,项目中的子包及文件前缀将默认使用该项目名称,Oinone 版本号默认为 `7.2.0`,版本默认为 `community`(社区版)。
46
+ ### 更多示例
44
47
 
45
- ``` shell
46
- oinone-frontend <project-name>
47
- ```
48
+ 创建项目(交互式):
48
49
 
49
- **参数说明:**
50
- - `<project-name>`: 您要创建的项目名称(将作为项目文件夹名称和各模块前缀)。
51
- - `--download-static-resource`: 控制是否自动下载静态资源包。可选值为 `true` (默认) 或 `false`。
52
- - `--oinone-version`: 指定 Oinone 的版本号(如 `7.2.0` 或 `6.4.0`)。默认值为 `7.2.0`。
53
- - `--edition`: 指定要使用的 Oinone 版本(社区版/企业版)。可选值为 `community` (默认) 或 `enterprise`。
50
+ ```bash
51
+ oinone-frontend create
52
+ ```
54
53
 
55
- **示例(创建并跳过资源下载,指定版本号及企业版):**
54
+ 创建项目(静默式):
56
55
 
57
- ```shell
58
- oinone-frontend my-project --download-static-resource=true --oinone-version="7.2.0" --edition="enterprise"
56
+ ```bash
57
+ oinone-frontend create my-project --oinone-version 7.2.0 --edition community
59
58
  ```
60
59
 
61
- 当您禁用自动下载资源包时,CLI 在项目创建完成后会输出手动下载所需执行的脚本命令。
60
+ 使用 `--company-name` / `--project-name` 创建:
62
61
 
63
- ### 3. 缓存管理
62
+ ```bash
63
+ oinone-frontend create --company-name ss --project-name oms --oinone-version 7.2.0 --edition community
64
+ ```
64
65
 
65
- CLI 会在系统临时目录中缓存下载过的静态资源,以加快后续项目的创建速度。您可以通过 `cache` 命令来管理这些缓存文件。
66
+ 演练模式(不落盘):
66
67
 
67
- **查看缓存信息:**
68
- ```shell
69
- oinone-frontend cache info
68
+ ```bash
69
+ oinone-frontend create my-project --oinone-version 7.2.0 --edition community --dry-run
70
70
  ```
71
71
 
72
- **清理缓存:**
73
- ```shell
74
- oinone-frontend cache clean
72
+ 创建工程(Oinone `6.4.*`):
73
+
74
+ ```bash
75
+ oinone-frontend create my-project-64 --oinone-version 6.4.0 --edition community
75
76
  ```
76
77
 
77
- **缓存帮助文档:**
78
- 您可以使用 `-h` 或 `--help` 选项来查看 `cache` 命令的专属帮助文档。
79
- ```shell
80
- oinone-frontend cache -h
78
+ ### 检查环境
79
+
80
+ ```bash
81
+ oinone-frontend doctor --oinone-version 7.2.0
81
82
  ```
82
83
 
83
- ### 4. 查看帮助文档
84
+ ## 命令参考
84
85
 
85
- 您可以使用 `-h` 或 `--help` 选项来查看 CLI 的标准帮助文档。
86
+ ### 全局参数
86
87
 
87
- ```shell
88
- oinone-frontend -h
89
- ```
88
+ | 参数 | 说明 |
89
+ | --- | --- |
90
+ | `-l, --lang <lang>` | 语言(`zh-CN` / `en-US`) |
91
+ | `-v, --version` | 输出版本号 |
92
+ | `-h, --help` | 输出帮助 |
90
93
 
91
- **输出:**
94
+ ### `oinone-frontend create [projectName]`
92
95
 
93
- ```shell
94
- Usage: cli [options] [command]
96
+ | 参数 | 说明 |
97
+ | --- | --- |
98
+ | `--company-name <name>` | 静默模式:公司/组织简称 |
99
+ | `--project-name <name>` | 静默模式:项目名;与 `--company-name` 同用时目录名为 `{company}-{project}-frontend` |
100
+ | `--download-static-resource <boolean>` | 是否下载静态资源(`true` / `false`) |
101
+ | `-o, --oinone-version <version>` | Oinone 版本(例如 `7.2.0` / `6.4.0`) |
102
+ | `-e, --edition <edition>` | 版本类型(`community` / `enterprise`) |
103
+ | `--auth-token <token>` | 企业版仓库 auth token(可选) |
104
+ | `--write-project-credential` | 在项目目录写入 `.npmrc` 并自动加入 `.gitignore` |
105
+ | `-f, --force` | 目标目录存在时覆盖/合并 |
106
+ | `-d, --dry-run` | 演练模式:不落盘 |
95
107
 
96
- Oinone Frontend Template CLI
108
+ ### `oinone-frontend doctor`
97
109
 
98
- Options:
99
- -V, --version output the version number
100
- -h, --help display help for command
110
+ | 参数 | 说明 |
111
+ | --- | --- |
112
+ | `-o, --oinone-version <version>` | 用于校验的 Oinone 版本(仅支持 `6.4.*` 与 `7.2+`) |
101
113
 
102
- Commands:
103
- cache Manage the local static resources cache
104
- help [command] display help for command
105
- ```
114
+ ### `oinone-frontend cache`
115
+
116
+ | 命令 | 说明 |
117
+ | --- | --- |
118
+ | `cache info` | 打印缓存目录信息 |
119
+ | `cache clean` | 清理缓存的静态资源 |
120
+
121
+ ## 企业版凭证
122
+
123
+ 当企业版创建时启用 `--write-project-credential`,CLI 会在项目目录写入 `.npmrc`,并把它追加到 `.gitignore`。
124
+
125
+ ## 模板映射
106
126
 
107
- ## 卸载 `@oinone/cli`
127
+ - `6.4.*` `template-6.4.0`
128
+ - `7.2+` → `template-7.2.0`
108
129
 
109
- 如果您需要卸载该 CLI 工具,可以运行以下命令:
130
+ 不支持的版本会直接报错。
110
131
 
111
- ```shell
112
- npm uninstall -g @oinone/cli
132
+ ## 备注
133
+
134
+ 卸载 CLI 不会清理系统临时目录中的静态资源缓存。如需清理:
135
+
136
+ ```bash
137
+ oinone-frontend cache clean
113
138
  ```
114
139
 
115
- > **注意:** 卸载 CLI **不会**自动清理存储在系统临时目录中的静态资源缓存文件。如果您希望完全移除缓存,请在卸载前执行 `oinone-frontend cache clean`,或者手动删除系统临时目录下的 `oinone-cli-cache` 文件夹。
140
+ ## 开发
141
+
142
+ ```bash
143
+ npm test
144
+ ```