@gct-paas/cli 0.0.1-dev.2 → 0.0.1-dev.21

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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/dist/actions/gen-api/api-manage.cjs +46 -0
  3. package/dist/actions/gen-api/api-manage.d.ts +36 -0
  4. package/dist/actions/gen-api/gen-api.cjs +157 -0
  5. package/dist/actions/gen-api/gen-api.d.ts +58 -0
  6. package/dist/actions/gen-api/model-manage.cjs +127 -0
  7. package/dist/actions/gen-api/model-manage.d.ts +124 -0
  8. package/dist/actions/index.cjs +12 -0
  9. package/dist/actions/index.d.ts +1 -0
  10. package/dist/bin.cjs +5 -0
  11. package/dist/commands/gen-api/gen-api.cjs +16 -0
  12. package/dist/commands/gen-api/gen-api.d.ts +44 -0
  13. package/dist/commands/index.cjs +23 -0
  14. package/dist/core/handlebars/constant/index.cjs +8 -0
  15. package/dist/core/handlebars/constant/index.d.ts +2 -0
  16. package/dist/core/handlebars/handlebars-engine.cjs +134 -0
  17. package/dist/core/handlebars/handlebars-engine.d.ts +74 -0
  18. package/dist/core/handlebars/helpers/and/and.cjs +21 -0
  19. package/dist/core/handlebars/helpers/and/and.d.ts +13 -0
  20. package/dist/core/handlebars/helpers/camel-case/camel-case.cjs +20 -0
  21. package/dist/core/handlebars/helpers/camel-case/camel-case.d.ts +13 -0
  22. package/dist/core/handlebars/helpers/concat/concat.cjs +17 -0
  23. package/dist/core/handlebars/helpers/concat/concat.d.ts +13 -0
  24. package/dist/core/handlebars/helpers/eq/eq.cjs +19 -0
  25. package/dist/core/handlebars/helpers/eq/eq.d.ts +14 -0
  26. package/dist/core/handlebars/helpers/format-import/format-import.cjs +41 -0
  27. package/dist/core/handlebars/helpers/format-import/format-import.d.ts +13 -0
  28. package/dist/core/handlebars/helpers/format-import-item/format-import-item.cjs +40 -0
  29. package/dist/core/handlebars/helpers/format-import-item/format-import-item.d.ts +13 -0
  30. package/dist/core/handlebars/helpers/format-js-type/format-js-type.cjs +41 -0
  31. package/dist/core/handlebars/helpers/format-js-type/format-js-type.d.ts +14 -0
  32. package/dist/core/handlebars/helpers/gt/gt.cjs +19 -0
  33. package/dist/core/handlebars/helpers/gt/gt.d.ts +14 -0
  34. package/dist/core/handlebars/helpers/gte/gte.cjs +19 -0
  35. package/dist/core/handlebars/helpers/gte/gte.d.ts +14 -0
  36. package/dist/core/handlebars/helpers/helper-base.cjs +19 -0
  37. package/dist/core/handlebars/helpers/helper-base.d.ts +22 -0
  38. package/dist/core/handlebars/helpers/includes/includes.cjs +18 -0
  39. package/dist/core/handlebars/helpers/includes/includes.d.ts +13 -0
  40. package/dist/core/handlebars/helpers/index.cjs +52 -0
  41. package/dist/core/handlebars/helpers/index.d.ts +6 -0
  42. package/dist/core/handlebars/helpers/json/json.cjs +16 -0
  43. package/dist/core/handlebars/helpers/json/json.d.ts +13 -0
  44. package/dist/core/handlebars/helpers/lower-case/lower-case.cjs +19 -0
  45. package/dist/core/handlebars/helpers/lower-case/lower-case.d.ts +13 -0
  46. package/dist/core/handlebars/helpers/lt/lt.cjs +19 -0
  47. package/dist/core/handlebars/helpers/lt/lt.d.ts +14 -0
  48. package/dist/core/handlebars/helpers/lte/lte.cjs +19 -0
  49. package/dist/core/handlebars/helpers/lte/lte.d.ts +14 -0
  50. package/dist/core/handlebars/helpers/neq/neq.cjs +19 -0
  51. package/dist/core/handlebars/helpers/neq/neq.d.ts +14 -0
  52. package/dist/core/handlebars/helpers/not/not.cjs +21 -0
  53. package/dist/core/handlebars/helpers/not/not.d.ts +14 -0
  54. package/dist/core/handlebars/helpers/not-includes/not-includes.cjs +18 -0
  55. package/dist/core/handlebars/helpers/not-includes/not-includes.d.ts +13 -0
  56. package/dist/core/handlebars/helpers/or/or.cjs +23 -0
  57. package/dist/core/handlebars/helpers/or/or.d.ts +13 -0
  58. package/dist/core/handlebars/helpers/pascal-case/pascal-case.cjs +20 -0
  59. package/dist/core/handlebars/helpers/pascal-case/pascal-case.d.ts +13 -0
  60. package/dist/core/handlebars/helpers/snake-case/snake-case.cjs +20 -0
  61. package/dist/core/handlebars/helpers/snake-case/snake-case.d.ts +13 -0
  62. package/dist/core/handlebars/helpers/spinal-case/spinal-case.cjs +20 -0
  63. package/dist/core/handlebars/helpers/spinal-case/spinal-case.d.ts +13 -0
  64. package/dist/core/handlebars/helpers/upper-case/upper-case.cjs +19 -0
  65. package/dist/core/handlebars/helpers/upper-case/upper-case.d.ts +13 -0
  66. package/dist/core/handlebars/index.cjs +27 -0
  67. package/dist/core/handlebars/index.d.ts +2 -0
  68. package/dist/core/handlebars/utils/helper/helper.cjs +41 -0
  69. package/dist/core/handlebars/utils/helper/helper.d.ts +33 -0
  70. package/dist/core/handlebars/utils/index.cjs +20 -0
  71. package/dist/core/handlebars/utils/index.d.ts +17 -0
  72. package/dist/core/index.cjs +27 -0
  73. package/dist/core/index.d.ts +2 -7
  74. package/dist/core/interface/index.cjs +1 -0
  75. package/dist/core/interface/index.d.ts +1 -0
  76. package/dist/index.cjs +47 -0
  77. package/dist/interface/i-command/i-command.cjs +1 -0
  78. package/dist/interface/i-command/i-command.d.ts +0 -6
  79. package/dist/interface/index.cjs +16 -0
  80. package/dist/utils/index.cjs +18 -0
  81. package/dist/utils/local-binaries/local-binaries.cjs +19 -0
  82. package/es/actions/gen-api/api-manage.d.ts +36 -0
  83. package/es/actions/gen-api/api-manage.mjs +38 -0
  84. package/es/actions/gen-api/gen-api.d.ts +58 -0
  85. package/es/actions/gen-api/gen-api.mjs +164 -0
  86. package/es/actions/gen-api/model-manage.d.ts +124 -0
  87. package/es/actions/gen-api/model-manage.mjs +126 -0
  88. package/es/actions/index.d.ts +1 -0
  89. package/es/actions/index.mjs +1 -0
  90. package/es/bin.d.ts +2 -0
  91. package/es/commands/gen-api/gen-api.d.ts +44 -0
  92. package/es/commands/gen-api/gen-api.mjs +15 -0
  93. package/es/commands/index.d.ts +5 -0
  94. package/{dist → es}/commands/index.mjs +2 -0
  95. package/es/core/handlebars/constant/index.d.ts +2 -0
  96. package/es/core/handlebars/constant/index.mjs +2 -0
  97. package/es/core/handlebars/handlebars-engine.d.ts +74 -0
  98. package/es/core/handlebars/handlebars-engine.mjs +122 -0
  99. package/es/core/handlebars/helpers/and/and.d.ts +13 -0
  100. package/es/core/handlebars/helpers/and/and.mjs +14 -0
  101. package/es/core/handlebars/helpers/camel-case/camel-case.d.ts +13 -0
  102. package/es/core/handlebars/helpers/camel-case/camel-case.mjs +13 -0
  103. package/es/core/handlebars/helpers/concat/concat.d.ts +13 -0
  104. package/es/core/handlebars/helpers/concat/concat.mjs +10 -0
  105. package/es/core/handlebars/helpers/eq/eq.d.ts +14 -0
  106. package/es/core/handlebars/helpers/eq/eq.mjs +12 -0
  107. package/es/core/handlebars/helpers/format-import/format-import.d.ts +13 -0
  108. package/es/core/handlebars/helpers/format-import/format-import.mjs +34 -0
  109. package/es/core/handlebars/helpers/format-import-item/format-import-item.d.ts +13 -0
  110. package/es/core/handlebars/helpers/format-import-item/format-import-item.mjs +33 -0
  111. package/es/core/handlebars/helpers/format-js-type/format-js-type.d.ts +14 -0
  112. package/es/core/handlebars/helpers/format-js-type/format-js-type.mjs +34 -0
  113. package/es/core/handlebars/helpers/gt/gt.d.ts +14 -0
  114. package/es/core/handlebars/helpers/gt/gt.mjs +12 -0
  115. package/es/core/handlebars/helpers/gte/gte.d.ts +14 -0
  116. package/es/core/handlebars/helpers/gte/gte.mjs +12 -0
  117. package/es/core/handlebars/helpers/helper-base.d.ts +22 -0
  118. package/es/core/handlebars/helpers/helper-base.mjs +11 -0
  119. package/es/core/handlebars/helpers/includes/includes.d.ts +13 -0
  120. package/es/core/handlebars/helpers/includes/includes.mjs +11 -0
  121. package/es/core/handlebars/helpers/index.d.ts +6 -0
  122. package/es/core/handlebars/helpers/index.mjs +46 -0
  123. package/es/core/handlebars/helpers/json/json.d.ts +13 -0
  124. package/es/core/handlebars/helpers/json/json.mjs +13 -0
  125. package/es/core/handlebars/helpers/lower-case/lower-case.d.ts +13 -0
  126. package/es/core/handlebars/helpers/lower-case/lower-case.mjs +12 -0
  127. package/es/core/handlebars/helpers/lt/lt.d.ts +14 -0
  128. package/es/core/handlebars/helpers/lt/lt.mjs +12 -0
  129. package/es/core/handlebars/helpers/lte/lte.d.ts +14 -0
  130. package/es/core/handlebars/helpers/lte/lte.mjs +12 -0
  131. package/es/core/handlebars/helpers/neq/neq.d.ts +14 -0
  132. package/es/core/handlebars/helpers/neq/neq.mjs +12 -0
  133. package/es/core/handlebars/helpers/not/not.d.ts +14 -0
  134. package/es/core/handlebars/helpers/not/not.mjs +12 -0
  135. package/es/core/handlebars/helpers/not-includes/not-includes.d.ts +13 -0
  136. package/es/core/handlebars/helpers/not-includes/not-includes.mjs +11 -0
  137. package/es/core/handlebars/helpers/or/or.d.ts +13 -0
  138. package/es/core/handlebars/helpers/or/or.mjs +16 -0
  139. package/es/core/handlebars/helpers/pascal-case/pascal-case.d.ts +13 -0
  140. package/es/core/handlebars/helpers/pascal-case/pascal-case.mjs +13 -0
  141. package/es/core/handlebars/helpers/snake-case/snake-case.d.ts +13 -0
  142. package/es/core/handlebars/helpers/snake-case/snake-case.mjs +13 -0
  143. package/es/core/handlebars/helpers/spinal-case/spinal-case.d.ts +13 -0
  144. package/es/core/handlebars/helpers/spinal-case/spinal-case.mjs +13 -0
  145. package/es/core/handlebars/helpers/upper-case/upper-case.d.ts +13 -0
  146. package/es/core/handlebars/helpers/upper-case/upper-case.mjs +12 -0
  147. package/es/core/handlebars/index.d.ts +2 -0
  148. package/es/core/handlebars/index.mjs +2 -0
  149. package/es/core/handlebars/utils/helper/helper.d.ts +33 -0
  150. package/es/core/handlebars/utils/helper/helper.mjs +54 -0
  151. package/es/core/handlebars/utils/index.d.ts +17 -0
  152. package/es/core/handlebars/utils/index.mjs +7 -0
  153. package/es/core/index.d.ts +2 -0
  154. package/es/core/index.mjs +2 -0
  155. package/es/core/interface/index.d.ts +1 -0
  156. package/es/index.d.ts +2 -0
  157. package/es/interface/i-command/i-command.d.ts +22 -0
  158. package/es/interface/i-command/i-command.mjs +0 -0
  159. package/es/interface/index.d.ts +1 -0
  160. package/es/types/index.d.ts +1 -0
  161. package/es/utils/index.d.ts +1 -0
  162. package/es/utils/local-binaries/local-binaries.d.ts +3 -0
  163. package/package.json +28 -46
  164. package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
  165. package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +0 -28
  166. package/dist/core/commitlint/index.d.ts +0 -1
  167. package/dist/core/commitlint/index.mjs +0 -1
  168. package/dist/core/constants/index.d.ts +0 -8
  169. package/dist/core/constants/index.mjs +0 -2
  170. package/dist/core/eslint/eslint-config/eslint-config.d.ts +0 -9
  171. package/dist/core/eslint/eslint-config/eslint-config.mjs +0 -109
  172. package/dist/core/eslint/index.d.ts +0 -1
  173. package/dist/core/eslint/index.mjs +0 -1
  174. package/dist/core/index.mjs +0 -7
  175. package/dist/core/prettier/index.d.ts +0 -1
  176. package/dist/core/prettier/index.mjs +0 -1
  177. package/dist/core/prettier/prettier-config/prettier-config.d.ts +0 -22
  178. package/dist/core/prettier/prettier-config/prettier-config.mjs +0 -26
  179. package/dist/core/rollup/index.d.ts +0 -2
  180. package/dist/core/rollup/index.mjs +0 -2
  181. package/dist/core/rollup/rollup-config/dev-config.d.ts +0 -9
  182. package/dist/core/rollup/rollup-config/dev-config.mjs +0 -98
  183. package/dist/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
  184. package/dist/core/rollup/rollup-plugins/copy-file.mjs +0 -18
  185. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  186. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
  187. package/dist/core/rollup/rollup-plugins/index.d.ts +0 -2
  188. package/dist/core/rollup/rollup-plugins/index.mjs +0 -2
  189. package/dist/core/stylelint/index.d.ts +0 -1
  190. package/dist/core/stylelint/index.mjs +0 -1
  191. package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
  192. package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +0 -21
  193. package/dist/core/util/index.d.ts +0 -21
  194. package/dist/core/util/index.mjs +0 -7
  195. package/dist/core/util/watcher/watcher.d.ts +0 -61
  196. package/dist/core/util/watcher/watcher.mjs +0 -108
  197. package/dist/core/vite/index.d.ts +0 -1
  198. package/dist/core/vite/index.mjs +0 -1
  199. package/dist/core/vite/vite-config/vite-config.d.ts +0 -9
  200. package/dist/core/vite/vite-config/vite-config.mjs +0 -47
  201. /package/{dist → es}/bin.mjs +0 -0
  202. /package/{dist/interface/i-command/i-command.mjs → es/core/interface/index.mjs} +0 -0
  203. /package/{dist → es}/index.mjs +0 -0
  204. /package/{dist → es}/interface/index.mjs +0 -0
  205. /package/{dist → es}/utils/index.mjs +0 -0
  206. /package/{dist → es}/utils/local-binaries/local-binaries.mjs +0 -0
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 安装自定义助手
3
+ *
4
+ * @export
5
+ */
6
+ export declare function installHelpers(): void;
@@ -0,0 +1,46 @@
1
+ import { HelperAnd } from "./and/and.mjs";
2
+ import { HelperCamelCase } from "./camel-case/camel-case.mjs";
3
+ import { HelperConcat } from "./concat/concat.mjs";
4
+ import { HelperEq } from "./eq/eq.mjs";
5
+ import { HelperFormatImport } from "./format-import/format-import.mjs";
6
+ import { HelperFormatImportItem } from "./format-import-item/format-import-item.mjs";
7
+ import { HelperFormatJsType } from "./format-js-type/format-js-type.mjs";
8
+ import { HelperGt } from "./gt/gt.mjs";
9
+ import { HelperGte } from "./gte/gte.mjs";
10
+ import { HelperIncludes } from "./includes/includes.mjs";
11
+ import { HelperJson } from "./json/json.mjs";
12
+ import { HelperLowerCase } from "./lower-case/lower-case.mjs";
13
+ import { HelperLt } from "./lt/lt.mjs";
14
+ import { HelperLte } from "./lte/lte.mjs";
15
+ import { HelperNeq } from "./neq/neq.mjs";
16
+ import { HelperNotIncludes } from "./not-includes/not-includes.mjs";
17
+ import { HelperNot } from "./not/not.mjs";
18
+ import { HelperOr } from "./or/or.mjs";
19
+ import { HelperPascalCase } from "./pascal-case/pascal-case.mjs";
20
+ import { HelperSnakeCase } from "./snake-case/snake-case.mjs";
21
+ import { HelperSpinalCase } from "./spinal-case/spinal-case.mjs";
22
+ import { HelperUpperCase } from "./upper-case/upper-case.mjs";
23
+ export function installHelpers() {
24
+ new HelperAnd();
25
+ new HelperCamelCase();
26
+ new HelperConcat();
27
+ new HelperEq();
28
+ new HelperFormatImport();
29
+ new HelperFormatImportItem();
30
+ new HelperFormatJsType();
31
+ new HelperGt();
32
+ new HelperGte();
33
+ new HelperIncludes();
34
+ new HelperJson();
35
+ new HelperLowerCase();
36
+ new HelperLt();
37
+ new HelperLte();
38
+ new HelperNeq();
39
+ new HelperNot();
40
+ new HelperNotIncludes();
41
+ new HelperOr();
42
+ new HelperPascalCase();
43
+ new HelperSnakeCase();
44
+ new HelperSpinalCase();
45
+ new HelperUpperCase();
46
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * json 转 string
4
+ *
5
+ * @description 用法 {{json xxx 2}},支持第二个参数传递格式化。效果: 将 json 对象转为 json 字符串
6
+ * @export
7
+ * @class HelperJson
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperJson extends HelperBase {
11
+ constructor();
12
+ onExecute(obj: Record<string, unknown> | unknown[], space: number): string;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from "../helper-base.mjs";
2
+ export class HelperJson extends HelperBase {
3
+ constructor() {
4
+ super("jsonStringify");
5
+ }
6
+ onExecute(obj, space) {
7
+ return JSON.stringify(
8
+ obj,
9
+ null,
10
+ typeof space === "number" ? space : void 0
11
+ );
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串转换小写
4
+ *
5
+ * @description 用法 {{lowerCase word}}, 效果: MyName => myname
6
+ * @export
7
+ * @class HelperLowerCase
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperLowerCase extends HelperBase {
11
+ constructor();
12
+ onExecute(param: string): string;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { HelperBase } from "../helper-base.mjs";
2
+ export class HelperLowerCase extends HelperBase {
3
+ constructor() {
4
+ super("lowerCase");
5
+ }
6
+ onExecute(param) {
7
+ if (!param) {
8
+ return "";
9
+ }
10
+ return param.toLowerCase();
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import * as Handlebars from 'handlebars';
2
+ import { HelperBase } from '../helper-base';
3
+ /**
4
+ * 小于
5
+ *
6
+ * @description 判断: word < word2, 用法 {{#lt word word2}}xxx{{else}}yyy{{/lt}}、{{lt word word2}} 返回值为 boolean 类型
7
+ * @export
8
+ * @class HelperLt
9
+ * @extends {HelperBase}
10
+ */
11
+ export declare class HelperLt extends HelperBase {
12
+ constructor();
13
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { lt } from "lodash-es";
2
+ import { HelperUtil } from "../../utils/index.mjs";
3
+ import { HelperBase } from "../helper-base.mjs";
4
+ export class HelperLt extends HelperBase {
5
+ constructor() {
6
+ super("lt");
7
+ }
8
+ onExecute(param, param2, options) {
9
+ const bol = lt(param, param2);
10
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import * as Handlebars from 'handlebars';
2
+ import { HelperBase } from '../helper-base';
3
+ /**
4
+ * 小于等于
5
+ *
6
+ * @description 判断: word <= word2, 用法 {{#lte word word2}}xxx{{else}}yyy{{/lte}}、{{lte word word2}} 返回值为 boolean 类型
7
+ * @export
8
+ * @class HelperLte
9
+ * @extends {HelperBase}
10
+ */
11
+ export declare class HelperLte extends HelperBase {
12
+ constructor();
13
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { lte } from "lodash-es";
2
+ import { HelperUtil } from "../../utils/index.mjs";
3
+ import { HelperBase } from "../helper-base.mjs";
4
+ export class HelperLte extends HelperBase {
5
+ constructor() {
6
+ super("lte");
7
+ }
8
+ onExecute(param, param2, options) {
9
+ const bol = lte(param, param2);
10
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import * as Handlebars from 'handlebars';
2
+ import { HelperBase } from '../helper-base';
3
+ /**
4
+ * 不等于
5
+ *
6
+ * @description 判断: word !== word2, 用法 {{#neq word 'xxx'}}xxx{{else}}yyy{{/neq}}、{{neq word 'xxx'}} 返回值为 boolean 类型
7
+ * @export
8
+ * @class HelperNeq
9
+ * @extends {HelperBase}
10
+ */
11
+ export declare class HelperNeq extends HelperBase {
12
+ constructor();
13
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { eq } from "lodash-es";
2
+ import { HelperUtil } from "../../utils/index.mjs";
3
+ import { HelperBase } from "../helper-base.mjs";
4
+ export class HelperNeq extends HelperBase {
5
+ constructor() {
6
+ super("neq");
7
+ }
8
+ onExecute(param, param2, options) {
9
+ const bol = !eq(param, param2);
10
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import * as Handlebars from 'handlebars';
2
+ import { HelperBase } from '../helper-base';
3
+ /**
4
+ * 参数不存在或者为空时返回 true
5
+ *
6
+ * @description 判断: 参数为 null、undefined、空字符串、空数组、空对象时返回 true, 用法: {{#not value}}xxx{{else}}yyy{{/not}}、{{not value}} 返回值为 boolean 类型
7
+ * @export
8
+ * @class HelperNot
9
+ * @extends {HelperBase}
10
+ */
11
+ export declare class HelperNot extends HelperBase {
12
+ constructor();
13
+ onExecute(param: unknown, options: Handlebars.HelperOptions): string | boolean;
14
+ }
@@ -0,0 +1,12 @@
1
+ import * as Handlebars from "handlebars";
2
+ import { HelperUtil } from "../../utils/index.mjs";
3
+ import { HelperBase } from "../helper-base.mjs";
4
+ export class HelperNot extends HelperBase {
5
+ constructor() {
6
+ super("not");
7
+ }
8
+ onExecute(param, options) {
9
+ const bol = Handlebars.Utils.isEmpty(param);
10
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
11
+ }
12
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串不包含内容
4
+ *
5
+ * @description 判断: !'test'.notIncludes('t'), 用法: {{#notIncludes word word2}}xxx{{else}}yyy{{/notIncludes}}、{{notIncludes word word2}} 返回值为 boolean 类型
6
+ * @export
7
+ * @class HelperNotIncludes
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperNotIncludes extends HelperBase {
11
+ constructor();
12
+ onExecute(param: string, param2: string, options: Handlebars.HelperOptions): string | boolean;
13
+ }
@@ -0,0 +1,11 @@
1
+ import { HelperUtil } from "../../utils/index.mjs";
2
+ import { HelperBase } from "../helper-base.mjs";
3
+ export class HelperNotIncludes extends HelperBase {
4
+ constructor() {
5
+ super("notIncludes");
6
+ }
7
+ onExecute(param, param2, options) {
8
+ const bol = !param.includes(param2);
9
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
10
+ }
11
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 或者条件
4
+ *
5
+ * @description 判断: word word2 word3 其中任意一个值在判断中为 true, 用法 {{#or word word2 word3}}xxx{{else}}yyy{{/or}}、{{or word word2 word3}} 返回值为 boolean 类型
6
+ * @export
7
+ * @class HelperOr
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperOr extends HelperBase {
11
+ constructor();
12
+ onExecute(...args: unknown[] | Handlebars.HelperOptions[]): string;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from "../helper-base.mjs";
2
+ export class HelperOr extends HelperBase {
3
+ constructor() {
4
+ super("or");
5
+ }
6
+ onExecute(...args) {
7
+ const options = args[args.length - 1];
8
+ args.pop();
9
+ const item = args.find((itemArg) => !!itemArg);
10
+ if (options.fn) {
11
+ const data = options.data?.root || {};
12
+ return item ? options.fn(data) : options.inverse(data);
13
+ }
14
+ return item || "";
15
+ }
16
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 首字母转大写
4
+ *
5
+ * @description 用法 {{pascalCase word}},效果: myName => MyName
6
+ * @export
7
+ * @class HelperPascalCase
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperPascalCase extends HelperBase {
11
+ constructor();
12
+ onExecute(param: string): string;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { upperFirst } from "lodash-es";
2
+ import { HelperBase } from "../helper-base.mjs";
3
+ export class HelperPascalCase extends HelperBase {
4
+ constructor() {
5
+ super("pascalCase");
6
+ }
7
+ onExecute(param) {
8
+ if (!param) {
9
+ return "";
10
+ }
11
+ return upperFirst(param);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 驼峰转蛇形命名法
4
+ *
5
+ * @description 用法 {{snakeCase word}},效果: myName => my_name
6
+ * @export
7
+ * @class HelperSnakeCase
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperSnakeCase extends HelperBase {
11
+ constructor();
12
+ onExecute(param: string): string;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { snakeCase } from "lodash-es";
2
+ import { HelperBase } from "../helper-base.mjs";
3
+ export class HelperSnakeCase extends HelperBase {
4
+ constructor() {
5
+ super("snakeCase");
6
+ }
7
+ onExecute(param) {
8
+ if (!param) {
9
+ return "";
10
+ }
11
+ return snakeCase(param);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 驼峰命名法转为横线命名法
4
+ *
5
+ * @description 用法 {{spinalCase word}},效果: myName => my-name
6
+ * @export
7
+ * @class HelperSpinalCase
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperSpinalCase extends HelperBase {
11
+ constructor();
12
+ onExecute(param: string): string;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { kebabCase } from "lodash-es";
2
+ import { HelperBase } from "../helper-base.mjs";
3
+ export class HelperSpinalCase extends HelperBase {
4
+ constructor() {
5
+ super("spinalCase");
6
+ }
7
+ onExecute(param) {
8
+ if (!param) {
9
+ return "";
10
+ }
11
+ return kebabCase(param);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串转大写
4
+ *
5
+ * @description 用法 {{upperCase word}},效果: myName => MYNAME
6
+ * @export
7
+ * @class HelperUpCase
8
+ * @extends {HelperBase}
9
+ */
10
+ export declare class HelperUpperCase extends HelperBase {
11
+ constructor();
12
+ onExecute(param: string): string;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { HelperBase } from "../helper-base.mjs";
2
+ export class HelperUpperCase extends HelperBase {
3
+ constructor() {
4
+ super("upperCase");
5
+ }
6
+ onExecute(param) {
7
+ if (!param) {
8
+ return "";
9
+ }
10
+ return param.toUpperCase();
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ export { HandlebarsEngine } from './handlebars-engine';
2
+ export * from './constant';
@@ -0,0 +1,2 @@
1
+ export { HandlebarsEngine } from "./handlebars-engine.mjs";
2
+ export * from "./constant/index.mjs";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 助手工具类
3
+ *
4
+ * @export
5
+ * @class HelperUtil
6
+ */
7
+ export declare class HelperUtil {
8
+ /**
9
+ * 当前所有助手 tag 名称
10
+ *
11
+ * @protected
12
+ * @type {string[]}
13
+ */
14
+ protected static helperNames: string[];
15
+ /**
16
+ * 判断字符串是否为助手
17
+ *
18
+ * @static
19
+ * @param {string} name
20
+ * @return {*} {boolean}
21
+ */
22
+ static isHelperName(name: string): boolean;
23
+ /**
24
+ * 判断类助手统一结果调用处理
25
+ *
26
+ * @static
27
+ * @param {unknown} context 执行上下文
28
+ * @param {boolean} bol 判断结果
29
+ * @param {Handlebars.HelperOptions} options
30
+ * @return {*} {(string | boolean)}
31
+ */
32
+ static handleJudgmentExecute(context: unknown, bol: boolean, options: Handlebars.HelperOptions): string | boolean;
33
+ }
@@ -0,0 +1,54 @@
1
+ export class HelperUtil {
2
+ /**
3
+ * 当前所有助手 tag 名称
4
+ *
5
+ * @protected
6
+ * @type {string[]}
7
+ */
8
+ static helperNames = [
9
+ "lookup",
10
+ "log",
11
+ "and",
12
+ "camelCase",
13
+ "concat",
14
+ "eq",
15
+ "gt",
16
+ "get",
17
+ "lowerCase",
18
+ "lt",
19
+ "lte",
20
+ "neq",
21
+ "not",
22
+ "or",
23
+ "pascalCase",
24
+ "pluralize",
25
+ "snakeCase",
26
+ "spinalCase",
27
+ "upperCase"
28
+ ];
29
+ /**
30
+ * 判断字符串是否为助手
31
+ *
32
+ * @static
33
+ * @param {string} name
34
+ * @return {*} {boolean}
35
+ */
36
+ static isHelperName(name) {
37
+ return this.helperNames.includes(name);
38
+ }
39
+ /**
40
+ * 判断类助手统一结果调用处理
41
+ *
42
+ * @static
43
+ * @param {unknown} context 执行上下文
44
+ * @param {boolean} bol 判断结果
45
+ * @param {Handlebars.HelperOptions} options
46
+ * @return {*} {(string | boolean)}
47
+ */
48
+ static handleJudgmentExecute(context, bol, options) {
49
+ if (options.fn) {
50
+ return bol ? options.fn(context) : options.inverse(context);
51
+ }
52
+ return bol ? options.hash.yes = true : options.hash.no = false;
53
+ }
54
+ }
@@ -0,0 +1,17 @@
1
+ export { HelperUtil } from './helper/helper';
2
+ /**
3
+ * win 路径 \\ 转 linux 路径 /
4
+ *
5
+ * @export
6
+ * @param {string} path
7
+ * @return {*} {string}
8
+ */
9
+ export declare function winToUnixPath(path: string): string;
10
+ /**
11
+ * linux 路径 / 转 win 路径 \\
12
+ *
13
+ * @export
14
+ * @param {string} path
15
+ * @return {*} {string}
16
+ */
17
+ export declare function unixToWinPath(path: string): string;
@@ -0,0 +1,7 @@
1
+ export { HelperUtil } from "./helper/helper.mjs";
2
+ export function winToUnixPath(path) {
3
+ return path.replace(/\\/g, "/");
4
+ }
5
+ export function unixToWinPath(path) {
6
+ return path.replace(/\//g, "\\");
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './handlebars';
2
+ export * from './interface';
@@ -0,0 +1,2 @@
1
+ export * from "./handlebars/index.mjs";
2
+ export * from "./interface/index.mjs";
@@ -0,0 +1 @@
1
+ export type IObject = Record<string | symbol, any>;
package/es/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function bootstrap(): Promise<void>;
2
+ export * from './core';
@@ -0,0 +1,22 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * 命令项
4
+ *
5
+ * @export
6
+ * @interface ICommand
7
+ */
8
+ export interface ICommand {
9
+ /**
10
+ * 加载命令
11
+ *
12
+ * @param {Command} program
13
+ */
14
+ load(program: Command): void;
15
+ /**
16
+ * 执行行为
17
+ *
18
+ * @param {...unknown[]} args
19
+ * @return {*} {(void | Promise<void>)}
20
+ */
21
+ action(...args: unknown[]): void | Promise<void>;
22
+ }
File without changes
@@ -0,0 +1 @@
1
+ export * from './i-command/i-command';
@@ -0,0 +1 @@
1
+ declare module 'eslint-plugin-import';
@@ -0,0 +1 @@
1
+ export { localBinExists, loadLocalBinCommandLoader, } from './local-binaries/local-binaries';
@@ -0,0 +1,3 @@
1
+ import { CommandLoader } from '../../commands/index';
2
+ export declare function localBinExists(): boolean;
3
+ export declare function loadLocalBinCommandLoader(): typeof CommandLoader;