@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
@@ -0,0 +1 @@
1
+ module.exports = require('./create/index');
@@ -0,0 +1,51 @@
1
+ const { execSync } = require('child_process');
2
+ const chalk = require('chalk');
3
+ const { t } = require('../i18n');
4
+
5
+ function parseOinoneVersion(versionStr) {
6
+ const raw = String(versionStr || '').trim();
7
+ const normalized = raw.replace(/[^0-9.]/g, '');
8
+ const m = normalized.match(/^(\d+)\.(\d+)(?:\.(\d+))?/);
9
+ if (!m) return null;
10
+ return { raw, normalized, major: Number(m[1]), minor: Number(m[2]) };
11
+ }
12
+
13
+ function parseNodeMajor(versionStr) {
14
+ const raw = String(versionStr || '').trim().replace(/^v/, '');
15
+ const m = raw.match(/^(\d+)\./);
16
+ return m ? Number(m[1]) : null;
17
+ }
18
+
19
+ function doctorAction(options) {
20
+ const parsed = parseOinoneVersion(options && options.oinoneVersion);
21
+ if (!parsed) {
22
+ console.log(chalk.red(t('doctor.doctorMissingVersion')));
23
+ process.exit(1);
24
+ }
25
+
26
+ const is72Plus = parsed.major > 7 || (parsed.major === 7 && parsed.minor >= 2);
27
+ const is64 = parsed.major === 6 && parsed.minor === 4;
28
+ if (!is72Plus && !is64) {
29
+ console.log(chalk.red(t('doctor.doctorUnsupportedVersion', { version: parsed.raw })));
30
+ process.exit(1);
31
+ }
32
+
33
+ console.log(chalk.cyan(t('doctor.checkingEnv')));
34
+
35
+ try {
36
+ const nodeVersion = execSync('node -v', { encoding: 'utf-8' }).trim();
37
+ const nodeMajor = parseNodeMajor(nodeVersion);
38
+ console.log(chalk.green(t('doctor.nodeInstalled')));
39
+ console.log(chalk.gray(nodeVersion));
40
+
41
+ if (nodeMajor === null || nodeMajor < 12) {
42
+ console.log(chalk.red(t('doctor.nodeVersionMismatch', { expect: '12+', actual: nodeVersion })));
43
+ process.exit(1);
44
+ }
45
+ } catch (err) {
46
+ console.log(chalk.red(t('doctor.nodeNotFound')));
47
+ process.exit(1);
48
+ }
49
+ }
50
+
51
+ module.exports = doctorAction;
package/bin/config.js ADDED
@@ -0,0 +1,54 @@
1
+ module.exports = {
2
+ getEnterpriseConfig: (version) => {
3
+ // version is like '~7.2.0' or '~6.4.0', we can use it as is for dependencies
4
+ return {
5
+ npmrc: {
6
+ uncommentRegistry: true
7
+ },
8
+ packageJson: {
9
+ dependencies: {
10
+ "@oinone/kunlun-ai-dependencies": version,
11
+ "@oinone/kunlun-data-designer": version,
12
+ "@oinone/kunlun-data-designer-core": version,
13
+ "@oinone/kunlun-data-designer-open-pc": version,
14
+ "@oinone/kunlun-designer-common": version,
15
+ "@oinone/kunlun-designer-common-ee": version,
16
+ "@oinone/kunlun-eip-dependencies": version,
17
+ "@oinone/kunlun-microflow-designer": version,
18
+ "@oinone/kunlun-model-designer": version,
19
+ "@oinone/kunlun-print-designer-dependencies": version,
20
+ "@oinone/kunlun-ui-designer-dependencies": version,
21
+ "@oinone/kunlun-workflow": version,
22
+ "@oinone/kunlun-workflow-designer": version
23
+ }
24
+ },
25
+ mainTs: {
26
+ cssImports: [
27
+ "import '@oinone/kunlun-designer-common/dist/oinone-kunlun-designer-common.css';",
28
+ "import '@oinone/kunlun-model-designer/dist/oinone-kunlun-model-designer.css';",
29
+ "import '@oinone/kunlun-workflow-designer/dist/oinone-kunlun-workflow-designer.css';",
30
+ "import '@oinone/kunlun-workflow/dist/oinone-kunlun-workflow.css';",
31
+ "import '@oinone/kunlun-data-designer/dist/oinone-kunlun-data-designer.css';",
32
+ "import '@oinone/kunlun-microflow-designer/dist/oinone-kunlun-microflow-designer.css';"
33
+ ],
34
+ scriptImports: [
35
+ "// 设计器",
36
+ "import '@oinone/kunlun-ui-designer-dependencies';",
37
+ "import '@oinone/kunlun-print-designer-dependencies';",
38
+ "import '@oinone/kunlun-workflow';",
39
+ "import '@oinone/kunlun-workflow-designer';",
40
+ "import '@oinone/kunlun-model-designer';",
41
+ "import '@oinone/kunlun-data-designer';",
42
+ "import '@oinone/kunlun-data-designer-open-pc';",
43
+ "import '@oinone/kunlun-eip-dependencies';",
44
+ "import '@oinone/kunlun-ai-dependencies';",
45
+ "import '@oinone/kunlun-microflow-designer';",
46
+ "import '@oinone/kunlun-designer-common-ee';"
47
+ ],
48
+ components: [
49
+ "kunlunDataDesignerCore: import('@oinone/kunlun-data-designer-core'),"
50
+ ]
51
+ }
52
+ };
53
+ }
54
+ };
package/bin/i18n.js CHANGED
@@ -1,134 +1,60 @@
1
- const detectLanguage = () => {
1
+ const zhCN = require('./locales/zh-CN.json');
2
+ const enUS = require('./locales/en-US.json');
3
+
4
+ const supported = new Set(['zh-CN', 'en-US']);
5
+ let currentLang = detectLang();
6
+
7
+ function detectLang() {
2
8
  try {
3
- const locale = new Intl.DateTimeFormat().resolvedOptions().locale;
4
- if (locale.toLowerCase().startsWith('zh')) {
5
- return 'zh-CN';
6
- }
9
+ const intlLocale = Intl.DateTimeFormat().resolvedOptions().locale;
10
+ if (intlLocale && intlLocale.toLowerCase().startsWith('zh')) return 'zh-CN';
7
11
  } catch (e) {
8
- // Ignore error
9
12
  }
10
-
11
- // Also check environment variables for language
12
- const envLang = process.env.LANG || process.env.LANGUAGE || process.env.LC_ALL || '';
13
- if (envLang.toLowerCase().startsWith('zh')) {
14
- return 'zh-CN';
15
- }
16
-
13
+
14
+ const envLocale = (process.env.LANG || process.env.LANGUAGE || process.env.LC_ALL || '').toLowerCase();
15
+ if (envLocale.startsWith('zh')) return 'zh-CN';
16
+ if (envLocale.startsWith('en')) return 'en-US';
17
17
  return 'en-US';
18
- };
18
+ }
19
19
 
20
- const currentLang = detectLanguage();
20
+ function setLang(lang) {
21
+ if (!lang) return;
22
+ const normalized = String(lang).replace('_', '-');
23
+ if (supported.has(normalized)) currentLang = normalized;
24
+ else if (normalized.toLowerCase().startsWith('zh')) currentLang = 'zh-CN';
25
+ else if (normalized.toLowerCase().startsWith('en')) currentLang = 'en-US';
26
+ }
21
27
 
22
- const locales = {
23
- 'en-US': {
24
- usingCached: '⚡ Zap! Using cached static resources...',
25
- fetchFileInfoFailed: 'Failed to fetch file info: {status}',
26
- downloadFailed: 'Failed to download: {status}',
27
- fetchingAwesomeness: '🚀 Fetching awesomeness ',
28
- progressLeft: 'left',
29
- cacheCleaned: '✨ Whoosh! Cache swept clean at {dir}',
30
- cacheAlreadyEmpty: '🤷 Cache directory already vanished (or never existed): {dir}',
31
- cacheDir: '📂 Cache Directory: ',
32
- cachedFiles: '📦 Cached Files:',
33
- totalCacheSize: '\n📊 Total Cache Size: ',
34
- cacheEmpty: '🍃 Cache is currently as empty as space.',
35
- description: 'Oinone Frontend Template CLI',
36
- cacheCmdDesc: 'Manage the local static resources cache',
37
- cacheCleanDesc: 'Clean the local static resources cache',
38
- cacheInfoDesc: 'Print cache directory information',
39
- versionOption: 'output the version number',
40
- helpOption: 'display help for command',
41
- projectNameArg: 'Name of the project to create silently',
42
- downloadOpt: 'Download static resources (true/false)',
43
- versionOpt: 'Oinone version to use (e.g. 7.2.0, 6.4.0)',
44
- editionOpt: 'Oinone edition to use (community/enterprise)',
45
- promptCompany: '🏢 What is your awesome company/org name? (e.g. ss):',
46
- errorCompanyEmpty: 'Oops! Company name cannot be empty 🙈',
47
- promptProject: '🚀 Name your epic project (e.g. oms):',
48
- errorProjectEmpty: 'Hold on! Project name cannot be empty 🛑',
49
- promptEdition: '💎 Choose your Oinone flavor:',
50
- editionCommunity: '🌱 Community Edition (Default)',
51
- editionEnterprise: '👑 Enterprise Edition',
52
- promptVersion: '📦 Which Oinone version are we rocking today?',
53
- version720: '✨ 7.2.0 (Default)',
54
- version640: '🕰️ 6.4.0',
55
- promptDownload: '📥 Shall we fetch the latest static resources for you? (Highly recommended! 🌟)',
56
- errorDirExists: '\n🚫 Yikes! The directory {name} already exists. Try a different name or clear the path.\n',
57
- weavingMagic: '✨ Weaving magic to create your project...',
58
- errorTemplateMissing: '😢 Uh-oh! Template for version {version} ({edition} edition) went missing in action.',
59
- structureReady: '🎉 Boom! Project structure is ready!',
60
- haulingStatic: '🚚 Hauling in the static resources...',
61
- staticDownloaded: '🎯 Bullseye! Static resources downloaded and ready to roll!',
62
- staticHiccup: '⚠️ Project is ready, but the static resources had a hiccup: {msg}',
63
- projectCreated: '🎉 Boom! Project created successfully!',
64
- skipStaticWarning: '\n⚠️ You chose to skip the static resources download.',
65
- manualStaticInstructions: 'Don\'t forget to grab them manually before you fire up the project:',
66
- partyStarted: '\n🚀 Let\'s get this party started:\n',
67
- happyCoding: 'Happy coding! 💻☕\n',
68
- updateAvailable: '📦 Update available! {current} → {latest}',
69
- runUpdate: 'Run {cmd} to update.',
70
- somethingBroke: '\n💥 Oops! Something broke: {msg}\n'
71
- },
72
- 'zh-CN': {
73
- usingCached: '⚡ 嗖!正在使用本地缓存的静态资源...',
74
- fetchFileInfoFailed: '获取文件信息失败: {status}',
75
- downloadFailed: '下载失败: {status}',
76
- fetchingAwesomeness: '🚀 正在获取静态资源 ',
77
- progressLeft: '剩余',
78
- cacheCleaned: '✨ 呼!缓存清理完毕,位置:{dir}',
79
- cacheAlreadyEmpty: '🤷 缓存目录已消失(或从未存在):{dir}',
80
- cacheDir: '📂 缓存目录: ',
81
- cachedFiles: '📦 缓存文件:',
82
- totalCacheSize: '\n📊 总缓存大小: ',
83
- cacheEmpty: '🍃 当前缓存空空如也。',
84
- description: 'Oinone 前端脚手架',
85
- cacheCmdDesc: '管理本地静态资源缓存',
86
- cacheCleanDesc: '清理本地静态资源缓存',
87
- cacheInfoDesc: '打印缓存目录信息',
88
- versionOption: '输出版本号',
89
- helpOption: '显示命令帮助',
90
- projectNameArg: '静默创建时的项目名称',
91
- downloadOpt: '是否下载静态资源 (true/false)',
92
- versionOpt: '使用的 Oinone 版本 (例如 7.2.0, 6.4.0)',
93
- editionOpt: '使用的 Oinone 版本类型 (community/enterprise)',
94
- promptCompany: '🏢 您的公司/组织名称是?(例如 ss):',
95
- errorCompanyEmpty: '哎呀!公司名称不能为空 🙈',
96
- promptProject: '🚀 给您的项目起个名字吧 (例如 oms):',
97
- errorProjectEmpty: '稍等!项目名称不能为空 🛑',
98
- promptEdition: '💎 请选择 Oinone 版本类型:',
99
- editionCommunity: '🌱 社区版 (默认)',
100
- editionEnterprise: '👑 企业版',
101
- promptVersion: '📦 今天我们要使用哪个 Oinone 版本?',
102
- version720: '✨ 7.2.0 (默认)',
103
- version640: '🕰️ 6.4.0',
104
- promptDownload: '📥 是否为您获取最新的静态资源?(强烈推荐!🌟)',
105
- errorDirExists: '\n🚫 哎呀!目录 {name} 已存在。请尝试其他名称或清理该路径。\n',
106
- weavingMagic: '✨ 正在施展魔法为您创建项目...',
107
- errorTemplateMissing: '😢 糟糕!未找到 {version} 版本 ({edition}版) 的模板。',
108
- structureReady: '🎉 棒!项目结构已准备就绪!',
109
- haulingStatic: '🚚 正在搬运静态资源...',
110
- staticDownloaded: '🎯 太准了!静态资源下载完毕,随时可以起飞!',
111
- staticHiccup: '⚠️ 项目已就绪,但静态资源遇到点小麻烦: {msg}',
112
- projectCreated: '🎉 棒!项目创建成功!',
113
- skipStaticWarning: '\n⚠️ 您选择了跳过静态资源下载。',
114
- manualStaticInstructions: '启动项目前,别忘了手动获取它们:',
115
- partyStarted: '\n🚀 让我们开始狂欢吧:\n',
116
- happyCoding: '编码愉快!💻☕\n',
117
- updateAvailable: '📦 发现新版本!{current} → {latest}',
118
- runUpdate: '运行 {cmd} 进行更新。',
119
- somethingBroke: '\n💥 糟糕!出了点问题: {msg}\n'
28
+ function getLang() {
29
+ return currentLang;
30
+ }
31
+
32
+ function getDict(lang) {
33
+ return lang === 'zh-CN' ? zhCN : enUS;
34
+ }
35
+
36
+ function getByPath(obj, key) {
37
+ const parts = key.split('.');
38
+ let cur = obj;
39
+ for (const p of parts) {
40
+ if (!cur || typeof cur !== 'object' || !(p in cur)) return undefined;
41
+ cur = cur[p];
120
42
  }
121
- };
43
+ return cur;
44
+ }
45
+
46
+ function interpolate(str, params) {
47
+ if (!params) return str;
48
+ return str.replace(/\{(\w+)\}/g, (_, k) => (k in params ? String(params[k]) : `{${k}}`));
49
+ }
122
50
 
123
- const t = (key, params = {}) => {
124
- let str = locales[currentLang][key] || locales['en-US'][key] || key;
125
- Object.keys(params).forEach((k) => {
126
- str = str.replace(new RegExp(`{${k}}`, 'g'), params[k]);
127
- });
128
- return str;
129
- };
51
+ function t(key, params) {
52
+ const dict = getDict(currentLang);
53
+ let val = getByPath(dict, key);
54
+ if (val === undefined) val = getByPath(enUS, key);
55
+ if (val === undefined) return key;
56
+ if (typeof val !== 'string') return String(val);
57
+ return interpolate(val, params);
58
+ }
130
59
 
131
- module.exports = {
132
- currentLang,
133
- t
134
- };
60
+ module.exports = { t, setLang, getLang };
@@ -0,0 +1,81 @@
1
+ {
2
+ "common": {
3
+ "canceled": "\n❌ Generation canceled.",
4
+ "dryRun": "\n🧪 --dry-run is enabled, skipping actual file generation.",
5
+ "updateAvailable": "📦 Update available! {current} → {latest}",
6
+ "runUpdate": "Run {cmd} to update.",
7
+ "newMinorAvailable": "📦 A newer version {latest} is available. Consider upgrading via: --oinone-version {latest}.",
8
+ "somethingBroke": "\n💥 Oops! Something broke: {msg}\n"
9
+ },
10
+ "cli": {
11
+ "description": "Oinone Frontend Template CLI",
12
+ "versionOption": "output the version number",
13
+ "helpOption": "display help for command",
14
+ "requireCreateSubcommand": "❌ Use `oinone-frontend create` to create a project (unknown command: {cmd})",
15
+ "projectNameArg": "Name of the project to create silently",
16
+ "downloadOpt": "Download static resources (true/false)",
17
+ "versionOpt": "Oinone version to use (e.g. 7.2.0, 6.4.0)",
18
+ "editionOpt": "Oinone edition to use (community/enterprise)"
19
+ },
20
+ "create": {
21
+ "createCmdDesc": "Create an Oinone frontend project",
22
+ "fetchFileInfoFailed": "Failed to fetch file info: {status}",
23
+ "downloadFailed": "Failed to download: {status}",
24
+ "fetchingAwesomeness": "🚀 Fetching awesomeness ",
25
+ "progressLeft": "left",
26
+ "promptCompany": "🏢 What is your awesome company/org name? (e.g. ss):",
27
+ "errorCompanyEmpty": "Oops! Company name cannot be empty 🙈",
28
+ "promptProject": "🚀 Name your epic project (e.g. oms):",
29
+ "errorProjectEmpty": "Hold on! Project name cannot be empty 🛑",
30
+ "promptEdition": "💎 Choose your Oinone flavor:",
31
+ "editionCommunity": "🌱 Community Edition (Default)",
32
+ "editionEnterprise": "👑 Enterprise Edition",
33
+ "promptVersion": "📦 Which Oinone version are we rocking today?",
34
+ "version720": "✨ {version} (Default)",
35
+ "version640": "🕰️ {version}",
36
+ "versionOther": "📦 {version}",
37
+ "promptDownload": "📥 Shall we fetch the latest static resources for you? (Highly recommended! 🌟)",
38
+ "errorDirExists": "\n🚫 Yikes! The directory {name} already exists. Try a different name or clear the path.\n",
39
+ "weavingMagic": "✨ Weaving magic to create your project...",
40
+ "unsupportedVersion": "Unsupported Oinone version: {version}",
41
+ "errorTemplateMissing": "😢 Uh-oh! Template for version {version} ({edition} edition) went missing in action.",
42
+ "structureReady": "🎉 Boom! Project structure is ready!",
43
+ "haulingStatic": "🚚 Hauling in the static resources...",
44
+ "staticDownloaded": "🎯 Bullseye! Static resources downloaded and ready to roll!",
45
+ "staticHiccup": "⚠️ Project is ready, but the static resources had a hiccup: {msg}",
46
+ "projectCreated": "🎉 Boom! Project created successfully!",
47
+ "skipStaticWarning": "\n⚠️ You chose to skip the static resources download.",
48
+ "manualStaticInstructions": "Don't forget to grab them manually before you fire up the project:",
49
+ "partyStarted": "\n🚀 Let's get this party started:\n",
50
+ "happyCoding": "Happy coding! 💻☕\n",
51
+ "promptWantRepo": "Do you want to configure Oinone registry credentials?",
52
+ "promptUsername": "Enter Oinone registry username:",
53
+ "promptPassword": "Enter Oinone registry password:",
54
+ "promptAuthToken": "Enter Oinone registry auth token:",
55
+ "skipProjectCredential": "\n⚠️ --write-project-credential not set. Skipped writing .npmrc credentials into the project. Configure ~/.npmrc or inject via CI secrets.",
56
+ "overwritePrompt": "Directory {name} already exists, do you want to overwrite/merge?"
57
+ },
58
+ "doctor": {
59
+ "doctorCmdDesc": "Check environment dependencies for Oinone Frontend",
60
+ "checkingEnv": "Checking environment dependencies...\n",
61
+ "doctorMissingVersion": "❌ Please specify --oinone-version (only 6.4.* and 7.2+ are supported)",
62
+ "doctorUnsupportedVersion": "❌ Unsupported Oinone version: {version} (only 6.4.* and 7.2+ are supported)",
63
+ "nodeInstalled": "✅ Node.js is installed",
64
+ "nodeNotFound": "❌ Node.js not found, please install Node 12+",
65
+ "nodeVersionMismatch": "❌ Node.js version mismatch: expected {expect}, got {actual}",
66
+ "pnpmInstalled": "✅ pnpm is installed",
67
+ "pnpmNotFound": "\n❌ pnpm not found, please install it via: npm install -g pnpm"
68
+ },
69
+ "cache": {
70
+ "cacheCmdDesc": "Manage the local static resources cache",
71
+ "cacheCleanDesc": "Clean the local static resources cache",
72
+ "cacheInfoDesc": "Print cache directory information",
73
+ "usingCached": "⚡ Zap! Using cached static resources...",
74
+ "cacheCleaned": "✨ Whoosh! Cache swept clean at {dir}",
75
+ "cacheAlreadyEmpty": "🤷 Cache directory already vanished (or never existed): {dir}",
76
+ "cacheDir": "📂 Cache Directory: ",
77
+ "cachedFiles": "📦 Cached Files:",
78
+ "totalCacheSize": "\n📊 Total Cache Size: ",
79
+ "cacheEmpty": "🍃 Cache is currently as empty as space."
80
+ }
81
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "common": {
3
+ "canceled": "\n❌ 已取消生成。",
4
+ "dryRun": "\n🧪 --dry-run 已开启,本次只演练不落盘。",
5
+ "updateAvailable": "📦 发现新版本!{current} → {latest}",
6
+ "runUpdate": "运行 {cmd} 进行更新。",
7
+ "newMinorAvailable": "📦 发现更高版本 {latest},可使用 --oinone-version {latest} 进行升级。",
8
+ "somethingBroke": "\n💥 糟糕!出了点问题: {msg}\n"
9
+ },
10
+ "cli": {
11
+ "description": "Oinone 前端脚手架",
12
+ "versionOption": "输出版本号",
13
+ "helpOption": "显示命令帮助",
14
+ "requireCreateSubcommand": "❌ 请使用 `oinone-frontend create` 来创建项目(收到未知命令: {cmd})",
15
+ "projectNameArg": "静默创建时的项目名称",
16
+ "downloadOpt": "是否下载静态资源 (true/false)",
17
+ "versionOpt": "使用的 Oinone 版本 (例如 7.2.0, 6.4.0)",
18
+ "editionOpt": "使用的 Oinone 版本类型 (community/enterprise)"
19
+ },
20
+ "create": {
21
+ "createCmdDesc": "创建 Oinone 前端工程",
22
+ "fetchFileInfoFailed": "获取文件信息失败: {status}",
23
+ "downloadFailed": "下载失败: {status}",
24
+ "fetchingAwesomeness": "🚀 正在获取静态资源 ",
25
+ "progressLeft": "剩余",
26
+ "promptCompany": "🏢 您的公司/组织名称是?(例如 ss):",
27
+ "errorCompanyEmpty": "哎呀!公司名称不能为空 🙈",
28
+ "promptProject": "🚀 给您的项目起个名字吧 (例如 oms):",
29
+ "errorProjectEmpty": "稍等!项目名称不能为空 🛑",
30
+ "promptEdition": "💎 请选择 Oinone 版本类型:",
31
+ "editionCommunity": "🌱 社区版 (默认)",
32
+ "editionEnterprise": "👑 企业版",
33
+ "promptVersion": "📦 今天我们要使用哪个 Oinone 版本?",
34
+ "version720": "✨ {version} (默认)",
35
+ "version640": "🕰️ {version}",
36
+ "versionOther": "📦 {version}",
37
+ "promptDownload": "📥 是否为您获取最新的静态资源?(强烈推荐!🌟)",
38
+ "errorDirExists": "\n🚫 哎呀!目录 {name} 已存在。请尝试其他名称或清理该路径。\n",
39
+ "weavingMagic": "✨ 正在施展魔法为您创建项目...",
40
+ "unsupportedVersion": "不支持的 Oinone 版本: {version}",
41
+ "errorTemplateMissing": "😢 糟糕!未找到 {version} 版本 ({edition}版) 的模板。",
42
+ "structureReady": "🎉 棒!项目结构已准备就绪!",
43
+ "haulingStatic": "🚚 正在搬运静态资源...",
44
+ "staticDownloaded": "🎯 太准了!静态资源下载完毕,随时可以起飞!",
45
+ "staticHiccup": "⚠️ 项目已就绪,但静态资源遇到点小麻烦: {msg}",
46
+ "projectCreated": "🎉 棒!项目创建成功!",
47
+ "skipStaticWarning": "\n⚠️ 您选择了跳过静态资源下载。",
48
+ "manualStaticInstructions": "启动项目前,别忘了手动获取它们:",
49
+ "partyStarted": "\n🚀 让我们开始狂欢吧:\n",
50
+ "happyCoding": "编码愉快!💻☕\n",
51
+ "promptWantRepo": "是否配置 Oinone 内置仓库的访问凭证?",
52
+ "promptUsername": "请输入 Oinone 仓库用户名:",
53
+ "promptPassword": "请输入 Oinone 仓库密码:",
54
+ "promptAuthToken": "请输入 Oinone 仓库 auth token:",
55
+ "skipProjectCredential": "\n⚠️ 未指定 --write-project-credential,已跳过在项目目录写入 .npmrc 凭证。请按团队规范配置 ~/.npmrc 或通过 CI Secret 注入。",
56
+ "overwritePrompt": "目录 {name} 已存在,是否覆盖/合并?"
57
+ },
58
+ "doctor": {
59
+ "doctorCmdDesc": "检查 Oinone 前端的环境依赖",
60
+ "checkingEnv": "检查环境依赖...\n",
61
+ "doctorMissingVersion": "❌ 请指定 --oinone-version (仅支持 6.4.* 与 7.2+)",
62
+ "doctorUnsupportedVersion": "❌ 不支持的 Oinone 版本: {version} (仅支持 6.4.* 与 7.2+)",
63
+ "nodeInstalled": "✅ Node.js 已安装",
64
+ "nodeNotFound": "❌ 未找到 Node.js,请安装 Node 12+",
65
+ "nodeVersionMismatch": "❌ Node.js 版本不满足要求: 期望 {expect},当前 {actual}",
66
+ "pnpmInstalled": "✅ pnpm 已安装",
67
+ "pnpmNotFound": "\n❌ 未找到 pnpm,请执行 npm install -g pnpm 安装"
68
+ },
69
+ "cache": {
70
+ "usingCached": "⚡ 嗖!正在使用本地缓存的静态资源...",
71
+ "cacheCleaned": "✨ 呼!缓存清理完毕,位置:{dir}",
72
+ "cacheAlreadyEmpty": "🤷 缓存目录已消失(或从未存在):{dir}",
73
+ "cacheDir": "📂 缓存目录: ",
74
+ "cachedFiles": "📦 缓存文件:",
75
+ "totalCacheSize": "\n📊 总缓存大小: ",
76
+ "cacheEmpty": "🍃 当前缓存空空如也。",
77
+ "cacheCmdDesc": "管理本地静态资源缓存",
78
+ "cacheCleanDesc": "清理本地静态资源缓存",
79
+ "cacheInfoDesc": "打印缓存目录信息"
80
+ }
81
+ }
@@ -0,0 +1,60 @@
1
+ function parseSemver(version) {
2
+ const raw = String(version || '').trim();
3
+ const m = raw.match(/^(\d+)\.(\d+)\.(\d+)$/);
4
+ if (!m) return null;
5
+ return { major: Number(m[1]), minor: Number(m[2]), patch: Number(m[3]) };
6
+ }
7
+
8
+ function compareSemver(a, b) {
9
+ const pa = parseSemver(a);
10
+ const pb = parseSemver(b);
11
+ if (!pa || !pb) return 0;
12
+ if (pa.major !== pb.major) return pa.major - pb.major;
13
+ if (pa.minor !== pb.minor) return pa.minor - pb.minor;
14
+ return pa.patch - pb.patch;
15
+ }
16
+
17
+ function normalizeToMinorVersion(version) {
18
+ const raw = String(version || '').trim();
19
+ const normalized = raw.replace(/[^0-9.]/g, '');
20
+ const m = normalized.match(/^(\d+)\.(\d+)/);
21
+ if (!m) return null;
22
+ return `${Number(m[1])}.${Number(m[2])}.0`;
23
+ }
24
+
25
+ function isSupportedMinorVersion(minorVersion) {
26
+ const p = parseSemver(minorVersion);
27
+ if (!p) return false;
28
+ if (p.major === 6 && p.minor === 4) return true;
29
+ if (p.major > 7) return true;
30
+ if (p.major === 7 && p.minor >= 2) return true;
31
+ return false;
32
+ }
33
+
34
+ function isAtLeast73(minorVersion) {
35
+ const p = parseSemver(minorVersion);
36
+ if (!p) return false;
37
+ if (p.major > 7) return true;
38
+ return p.major === 7 && p.minor >= 3;
39
+ }
40
+
41
+ function toMinorVersions(versions) {
42
+ const list = Array.isArray(versions) ? versions : [];
43
+ const set = new Set();
44
+ for (const v of list) {
45
+ const p = parseSemver(v);
46
+ if (!p) continue;
47
+ set.add(`${p.major}.${p.minor}.0`);
48
+ }
49
+ return Array.from(set).sort((a, b) => compareSemver(b, a));
50
+ }
51
+
52
+ module.exports = {
53
+ parseSemver,
54
+ compareSemver,
55
+ normalizeToMinorVersion,
56
+ isSupportedMinorVersion,
57
+ isAtLeast73,
58
+ toMinorVersions
59
+ };
60
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oinone/cli",
3
- "version": "7.2.5",
3
+ "version": "7.2.7",
4
4
  "description": "CLI tool to generate Oinone Frontend Template",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "commander": "^14.0.3",
24
24
  "ejs": "^5.0.2",
25
25
  "fs-extra": "^11.3.4",
26
- "inquirer": "^8.2.6",
26
+ "inquirer": "^8.2.7",
27
27
  "ora": "^5.4.1"
28
28
  },
29
29
  "devDependencies": {
@@ -23,8 +23,7 @@ import '@ss/project';
23
23
  VueOioProvider(
24
24
  {
25
25
  browser: {
26
- title: 'Oinone',
27
- favicon: 'https://pamirs.oss-cn-hangzhou.aliyuncs.com/pamirs/image/default_favicon.ico'
26
+ title: 'Oinone'
28
27
  },
29
28
  dependencies: {
30
29
  vue: import('vue'),
@@ -75,7 +75,7 @@ module.exports = {
75
75
  // 支持跨域
76
76
  changeOrigin: true,
77
77
  // 请求后端地址
78
- target: 'http://127.0.0.1:8091'
78
+ target: 'http://127.0.0.1:8191'
79
79
  // Oinone 提供的演示环境地址
80
80
  // target: 'https://demo.oinone.top'
81
81
  },
@@ -1,3 +1,5 @@
1
1
  registry=https://registry.npmmirror.com/
2
2
  # @oinone:registry=http://nexus.shushi.pro/repository/kunlun/
3
3
  legacy-peer-deps=true
4
+ link-workspace-packages=true
5
+ prefer-workspace-packages=true
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@ss/admin-widget",
3
3
  "version": "1.0.0",
4
+ "type": "module",
4
5
  "main": "index.ts",
5
6
  "scripts": {
6
7
  "clean": "rimraf dist package-lock.json node_modules",
7
8
  "prebuild": "rimraf dist",
8
9
  "build": "rollup -c && npm run build-css",
9
- "build-css": "[ -f './dist/kunlun-module-demo.scss' ] && sass ./dist/kunlun-module-demo.scss ./dist/kunlun-module-demo.css || exit 0",
10
+ "build-css": "[ -f './dist/ss-admin-widget.scss' ] && sass ./dist/ss-admin-widget.scss ./dist/ss-admin-widget.css || exit 0",
10
11
  "build-win": "rollup -c && npm run build-css-win",
11
- "build-css-win": "IF EXIST ./dist/kunlun-module-demo.scss (sass ./dist/kunlun-module-demo.scss ./dist/kunlun-module-demo.css) ELSE (exit 0)",
12
+ "build-css-win": "IF EXIST ./dist/ss-admin-widget.scss (sass ./dist/ss-admin-widget.scss ./dist/ss-admin-widget.css) ELSE (exit 0)",
12
13
  "prepublishOnly": "node ./scripts/prepublish-only.js",
13
14
  "postpublish": "node ./scripts/postpublish.js"
14
15
  },
@@ -6,6 +6,8 @@ export default CompileConfigBuilder.config()
6
6
  .externalPkg(pkg)
7
7
  .singleModule()
8
8
  .replace()
9
+ .vue()
10
+ .scss()
9
11
  .nodeResolve()
10
12
  .commonjs()
11
13
  .typescript2()
@@ -19,8 +19,7 @@ import '@ss/project';
19
19
  VueOioProvider(
20
20
  {
21
21
  browser: {
22
- title: 'Oinone',
23
- favicon: 'https://pamirs.oss-cn-hangzhou.aliyuncs.com/pamirs/image/default_favicon.ico'
22
+ title: 'Oinone'
24
23
  },
25
24
  dependencies: {
26
25
  vue: import('vue'),
@@ -78,7 +78,7 @@ module.exports = {
78
78
  // 支持跨域
79
79
  changeOrigin: true,
80
80
  // 请求后端地址
81
- target: 'http://127.0.0.1:8091'
81
+ target: 'http://127.0.0.1:8191'
82
82
  // Oinone 提供的演示环境地址
83
83
  // target: 'https://demo.oinone.top'
84
84
  }
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@ss/oinone",
3
3
  "version": "1.0.0",
4
+ "type": "module",
4
5
  "main": "index.ts",
5
6
  "scripts": {
6
7
  "clean": "rimraf dist package-lock.json node_modules",
7
8
  "prebuild": "rimraf dist",
8
9
  "build": "rollup -c && npm run build-css",
9
- "build-css": "[ -f './dist/kunlun-module-demo.scss' ] && sass ./dist/kunlun-module-demo.scss ./dist/kunlun-module-demo.css || exit 0",
10
+ "build-css": "[ -f './dist/ss-oinone.scss' ] && sass ./dist/ss-oinone.scss ./dist/ss-oinone.css || exit 0",
10
11
  "build-win": "rollup -c && npm run build-css-win",
11
- "build-css-win": "IF EXIST ./dist/kunlun-module-demo.scss (sass ./dist/kunlun-module-demo.scss ./dist/kunlun-module-demo.css) ELSE (exit 0)",
12
+ "build-css-win": "IF EXIST ./dist/ss-oinone.scss (sass ./dist/ss-oinone.scss ./dist/ss-oinone.css) ELSE (exit 0)",
12
13
  "prepublishOnly": "node ./scripts/prepublish-only.js",
13
14
  "postpublish": "node ./scripts/postpublish.js"
14
15
  },