@pisell/common 0.0.19 → 1.0.1

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 (279) hide show
  1. package/.fatherrc.ts +7 -0
  2. package/CHANGELOG.md +7 -0
  3. package/README.md +1 -38
  4. package/{lib/components → es}/button/index.d.ts +5 -4
  5. package/es/button/index.d.ts.map +1 -0
  6. package/es/button/index.js +33 -0
  7. package/{es/components → lib}/button/index.d.ts +5 -4
  8. package/lib/button/index.d.ts.map +1 -0
  9. package/lib/{components/avatar → button}/index.js +14 -11
  10. package/package.json +20 -77
  11. package/src/button/index.md +17 -0
  12. package/src/button/index.tsx +38 -0
  13. package/tsconfig.json +14 -0
  14. package/LICENSE +0 -21
  15. package/es/bin/pisell.js +0 -2
  16. package/es/business-components/colorInput/index.d.ts +0 -21
  17. package/es/business-components/colorInput/index.js +0 -43
  18. package/es/business-components/colorInput/index.less +0 -10
  19. package/es/business-components/index.d.ts +0 -11
  20. package/es/business-components/index.js +0 -7
  21. package/es/business-components/rechargeOption/index.d.ts +0 -36
  22. package/es/business-components/rechargeOption/index.js +0 -132
  23. package/es/business-components/rechargeOption/index.less +0 -0
  24. package/es/business-components/selectTag/index.d.ts +0 -25
  25. package/es/business-components/selectTag/index.js +0 -179
  26. package/es/business-components/selectTag/index.less +0 -22
  27. package/es/business-components/sortModal/index.d.ts +0 -30
  28. package/es/business-components/sortModal/index.js +0 -85
  29. package/es/business-components/sortModal/index.less +0 -29
  30. package/es/business-components/statistics/index.d.ts +0 -12
  31. package/es/business-components/statistics/index.js +0 -38
  32. package/es/business-components/statistics/index.less +0 -64
  33. package/es/business-components/tagModal/index.d.ts +0 -17
  34. package/es/business-components/tagModal/index.js +0 -58
  35. package/es/business-hooks/index.d.ts +0 -2
  36. package/es/business-hooks/index.js +0 -2
  37. package/es/business-hooks/useModal/index.d.ts +0 -31
  38. package/es/business-hooks/useModal/index.js +0 -91
  39. package/es/business-hooks/useModal/index.less +0 -0
  40. package/es/business-hooks/useTagModal/index.d.ts +0 -17
  41. package/es/business-hooks/useTagModal/index.js +0 -47
  42. package/es/components/ColorPicker/index.d.ts +0 -22
  43. package/es/components/ColorPicker/index.js +0 -51
  44. package/es/components/ColorPicker/index.less +0 -17
  45. package/es/components/DragSort/index.d.ts +0 -2
  46. package/es/components/DragSort/index.js +0 -68
  47. package/es/components/EditorPreview/index.d.ts +0 -5
  48. package/es/components/EditorPreview/index.js +0 -14
  49. package/es/components/EditorPreview/index.less +0 -81
  50. package/es/components/Iconfont/index.d.ts +0 -6
  51. package/es/components/Iconfont/index.js +0 -29
  52. package/es/components/Iconfont/index.less +0 -0
  53. package/es/components/agreement/Detail/index.d.ts +0 -3
  54. package/es/components/agreement/Detail/index.js +0 -77
  55. package/es/components/agreement/Detail/serve.d.ts +0 -1
  56. package/es/components/agreement/Detail/serve.js +0 -6
  57. package/es/components/agreement/index.d.ts +0 -11
  58. package/es/components/agreement/index.js +0 -45
  59. package/es/components/agreement/index.less +0 -20
  60. package/es/components/avatar/index.d.ts +0 -13
  61. package/es/components/avatar/index.js +0 -25
  62. package/es/components/button/index.js +0 -36
  63. package/es/components/card/index.d.ts +0 -5
  64. package/es/components/card/index.js +0 -16
  65. package/es/components/card/index.less +0 -9
  66. package/es/components/checkbox/index.d.ts +0 -20
  67. package/es/components/checkbox/index.js +0 -43
  68. package/es/components/configProvider/index.d.ts +0 -113
  69. package/es/components/configProvider/index.js +0 -114
  70. package/es/components/datePicker/index.d.ts +0 -9
  71. package/es/components/datePicker/index.js +0 -17
  72. package/es/components/index.d.ts +0 -30
  73. package/es/components/index.js +0 -16
  74. package/es/components/input/index.d.ts +0 -35
  75. package/es/components/input/index.js +0 -97
  76. package/es/components/inputNumber/index.d.ts +0 -9
  77. package/es/components/inputNumber/index.js +0 -17
  78. package/es/components/pagination/index.d.ts +0 -10
  79. package/es/components/pagination/index.js +0 -18
  80. package/es/components/radio/index.d.ts +0 -13
  81. package/es/components/radio/index.js +0 -28
  82. package/es/components/select/index.d.ts +0 -9
  83. package/es/components/select/index.js +0 -17
  84. package/es/components/switch/index.d.ts +0 -10
  85. package/es/components/switch/index.js +0 -18
  86. package/es/config/index.d.ts +0 -30
  87. package/es/config/index.js +0 -18
  88. package/es/config/request.d.ts +0 -7
  89. package/es/config/request.js +0 -67
  90. package/es/config/utils.d.ts +0 -0
  91. package/es/config/utils.js +0 -0
  92. package/es/hooks/index.d.ts +0 -8
  93. package/es/hooks/index.js +0 -8
  94. package/es/hooks/useCountDown/index.d.ts +0 -10
  95. package/es/hooks/useCountDown/index.js +0 -48
  96. package/es/hooks/useDocumentScroll/index.d.ts +0 -8
  97. package/es/hooks/useDocumentScroll/index.js +0 -41
  98. package/es/hooks/useDocumentScroll/index.less +0 -0
  99. package/es/hooks/useMousemove/index.d.ts +0 -8
  100. package/es/hooks/useMousemove/index.js +0 -61
  101. package/es/hooks/useResponsive/index.d.ts +0 -2
  102. package/es/hooks/useResponsive/index.js +0 -29
  103. package/es/hooks/useResponsive/index.less +0 -0
  104. package/es/hooks/useSize/index.d.ts +0 -2
  105. package/es/hooks/useSize/index.js +0 -27
  106. package/es/hooks/useSize/index.less +0 -0
  107. package/es/hooks/useStateMulti/index.d.ts +0 -2
  108. package/es/hooks/useStateMulti/index.js +0 -29
  109. package/es/hooks/useStateWithCb/index.d.ts +0 -2
  110. package/es/hooks/useStateWithCb/index.js +0 -42
  111. package/es/hooks/useTable/index.d.ts +0 -12
  112. package/es/hooks/useTable/index.js +0 -74
  113. package/es/hooks/useTable/index.less +0 -0
  114. package/es/hooks/useTableModal/index.d.ts +0 -12
  115. package/es/hooks/useTableModal/index.js +0 -25
  116. package/es/hooks/useTableModal/index.less +0 -0
  117. package/es/hooks/useUrlState/index.d.ts +0 -2
  118. package/es/hooks/useUrlState/index.js +0 -56
  119. package/es/hooks/useWebSocket/index.d.ts +0 -13
  120. package/es/hooks/useWebSocket/index.js +0 -121
  121. package/es/index.d.ts +0 -4
  122. package/es/index.js +0 -4
  123. package/es/locales/en-US.d.ts +0 -11
  124. package/es/locales/en-US.js +0 -10
  125. package/es/locales/index.d.ts +0 -1
  126. package/es/locales/index.js +0 -23
  127. package/es/locales/zh-CN.d.ts +0 -11
  128. package/es/locales/zh-CN.js +0 -10
  129. package/es/locales/zh-TW.d.ts +0 -11
  130. package/es/locales/zh-TW.js +0 -10
  131. package/es/script/constants/index.js +0 -8
  132. package/es/script/deploy.js +0 -47
  133. package/es/script/index.js +0 -40
  134. package/es/script/package.json +0 -4
  135. package/es/script/release/index.js +0 -161
  136. package/es/script/release/release.js +0 -163
  137. package/es/script/uploadCode/index.js +0 -278
  138. package/es/script/uploadCode/uploadCode.js +0 -401
  139. package/es/script/utils/index.js +0 -321
  140. package/es/utils/index.d.ts +0 -3
  141. package/es/utils/index.js +0 -3
  142. package/es/utils/otherUtils.d.ts +0 -8
  143. package/es/utils/otherUtils.js +0 -12
  144. package/es/utils/storage.d.ts +0 -30
  145. package/es/utils/storage.js +0 -70
  146. package/es/utils/typeUtils.d.ts +0 -42
  147. package/es/utils/typeUtils.js +0 -86
  148. package/lib/bin/pisell.js +0 -26
  149. package/lib/business-components/colorInput/index.d.ts +0 -21
  150. package/lib/business-components/colorInput/index.js +0 -70
  151. package/lib/business-components/colorInput/index.less +0 -10
  152. package/lib/business-components/index.d.ts +0 -11
  153. package/lib/business-components/index.js +0 -54
  154. package/lib/business-components/rechargeOption/index.d.ts +0 -36
  155. package/lib/business-components/rechargeOption/index.js +0 -112
  156. package/lib/business-components/rechargeOption/index.less +0 -0
  157. package/lib/business-components/selectTag/index.d.ts +0 -25
  158. package/lib/business-components/selectTag/index.js +0 -181
  159. package/lib/business-components/selectTag/index.less +0 -22
  160. package/lib/business-components/sortModal/index.d.ts +0 -30
  161. package/lib/business-components/sortModal/index.js +0 -100
  162. package/lib/business-components/sortModal/index.less +0 -29
  163. package/lib/business-components/statistics/index.d.ts +0 -12
  164. package/lib/business-components/statistics/index.js +0 -63
  165. package/lib/business-components/statistics/index.less +0 -64
  166. package/lib/business-components/tagModal/index.d.ts +0 -17
  167. package/lib/business-components/tagModal/index.js +0 -66
  168. package/lib/business-hooks/index.d.ts +0 -2
  169. package/lib/business-hooks/index.js +0 -42
  170. package/lib/business-hooks/useModal/index.d.ts +0 -31
  171. package/lib/business-hooks/useModal/index.js +0 -68
  172. package/lib/business-hooks/useModal/index.less +0 -0
  173. package/lib/business-hooks/useTagModal/index.d.ts +0 -17
  174. package/lib/business-hooks/useTagModal/index.js +0 -61
  175. package/lib/components/ColorPicker/index.d.ts +0 -22
  176. package/lib/components/ColorPicker/index.js +0 -80
  177. package/lib/components/ColorPicker/index.less +0 -17
  178. package/lib/components/DragSort/index.d.ts +0 -2
  179. package/lib/components/DragSort/index.js +0 -101
  180. package/lib/components/EditorPreview/index.d.ts +0 -5
  181. package/lib/components/EditorPreview/index.js +0 -37
  182. package/lib/components/EditorPreview/index.less +0 -81
  183. package/lib/components/Iconfont/index.d.ts +0 -6
  184. package/lib/components/Iconfont/index.js +0 -48
  185. package/lib/components/Iconfont/index.less +0 -0
  186. package/lib/components/agreement/Detail/index.d.ts +0 -3
  187. package/lib/components/agreement/Detail/index.js +0 -86
  188. package/lib/components/agreement/Detail/serve.d.ts +0 -1
  189. package/lib/components/agreement/Detail/serve.js +0 -30
  190. package/lib/components/agreement/index.d.ts +0 -11
  191. package/lib/components/agreement/index.js +0 -82
  192. package/lib/components/agreement/index.less +0 -20
  193. package/lib/components/avatar/index.d.ts +0 -13
  194. package/lib/components/button/index.js +0 -36
  195. package/lib/components/card/index.d.ts +0 -5
  196. package/lib/components/card/index.js +0 -42
  197. package/lib/components/card/index.less +0 -9
  198. package/lib/components/checkbox/index.d.ts +0 -20
  199. package/lib/components/checkbox/index.js +0 -36
  200. package/lib/components/configProvider/index.d.ts +0 -113
  201. package/lib/components/configProvider/index.js +0 -159
  202. package/lib/components/datePicker/index.d.ts +0 -9
  203. package/lib/components/datePicker/index.js +0 -31
  204. package/lib/components/index.d.ts +0 -30
  205. package/lib/components/index.js +0 -83
  206. package/lib/components/input/index.d.ts +0 -35
  207. package/lib/components/input/index.js +0 -53
  208. package/lib/components/inputNumber/index.d.ts +0 -9
  209. package/lib/components/inputNumber/index.js +0 -31
  210. package/lib/components/pagination/index.d.ts +0 -10
  211. package/lib/components/pagination/index.js +0 -42
  212. package/lib/components/radio/index.d.ts +0 -13
  213. package/lib/components/radio/index.js +0 -36
  214. package/lib/components/select/index.d.ts +0 -9
  215. package/lib/components/select/index.js +0 -36
  216. package/lib/components/switch/index.d.ts +0 -10
  217. package/lib/components/switch/index.js +0 -42
  218. package/lib/config/index.d.ts +0 -30
  219. package/lib/config/index.js +0 -39
  220. package/lib/config/request.d.ts +0 -7
  221. package/lib/config/request.js +0 -76
  222. package/lib/config/utils.d.ts +0 -0
  223. package/lib/config/utils.js +0 -0
  224. package/lib/hooks/index.d.ts +0 -8
  225. package/lib/hooks/index.js +0 -57
  226. package/lib/hooks/useCountDown/index.d.ts +0 -10
  227. package/lib/hooks/useCountDown/index.js +0 -57
  228. package/lib/hooks/useDocumentScroll/index.d.ts +0 -8
  229. package/lib/hooks/useDocumentScroll/index.js +0 -54
  230. package/lib/hooks/useDocumentScroll/index.less +0 -0
  231. package/lib/hooks/useMousemove/index.d.ts +0 -8
  232. package/lib/hooks/useMousemove/index.js +0 -70
  233. package/lib/hooks/useResponsive/index.d.ts +0 -2
  234. package/lib/hooks/useResponsive/index.js +0 -47
  235. package/lib/hooks/useResponsive/index.less +0 -0
  236. package/lib/hooks/useSize/index.d.ts +0 -2
  237. package/lib/hooks/useSize/index.js +0 -45
  238. package/lib/hooks/useSize/index.less +0 -0
  239. package/lib/hooks/useStateMulti/index.d.ts +0 -2
  240. package/lib/hooks/useStateMulti/index.js +0 -43
  241. package/lib/hooks/useStateWithCb/index.d.ts +0 -2
  242. package/lib/hooks/useStateWithCb/index.js +0 -53
  243. package/lib/hooks/useTable/index.d.ts +0 -12
  244. package/lib/hooks/useTable/index.js +0 -75
  245. package/lib/hooks/useTable/index.less +0 -0
  246. package/lib/hooks/useTableModal/index.d.ts +0 -12
  247. package/lib/hooks/useTableModal/index.js +0 -43
  248. package/lib/hooks/useTableModal/index.less +0 -0
  249. package/lib/hooks/useUrlState/index.d.ts +0 -2
  250. package/lib/hooks/useUrlState/index.js +0 -59
  251. package/lib/hooks/useWebSocket/index.d.ts +0 -13
  252. package/lib/hooks/useWebSocket/index.js +0 -91
  253. package/lib/index.d.ts +0 -4
  254. package/lib/index.js +0 -22
  255. package/lib/locales/en-US.d.ts +0 -11
  256. package/lib/locales/en-US.js +0 -36
  257. package/lib/locales/index.d.ts +0 -1
  258. package/lib/locales/index.js +0 -59
  259. package/lib/locales/zh-CN.d.ts +0 -11
  260. package/lib/locales/zh-CN.js +0 -36
  261. package/lib/locales/zh-TW.d.ts +0 -11
  262. package/lib/locales/zh-TW.js +0 -36
  263. package/lib/script/constants/index.js +0 -35
  264. package/lib/script/deploy.js +0 -61
  265. package/lib/script/index.js +0 -61
  266. package/lib/script/package.json +0 -4
  267. package/lib/script/release/index.js +0 -116
  268. package/lib/script/release/release.js +0 -89
  269. package/lib/script/uploadCode/index.js +0 -202
  270. package/lib/script/uploadCode/uploadCode.js +0 -208
  271. package/lib/script/utils/index.js +0 -248
  272. package/lib/utils/index.d.ts +0 -3
  273. package/lib/utils/index.js +0 -21
  274. package/lib/utils/otherUtils.d.ts +0 -8
  275. package/lib/utils/otherUtils.js +0 -31
  276. package/lib/utils/storage.d.ts +0 -30
  277. package/lib/utils/storage.js +0 -63
  278. package/lib/utils/typeUtils.d.ts +0 -42
  279. package/lib/utils/typeUtils.js +0 -75
@@ -1,11 +0,0 @@
1
- declare const _default: {
2
- 'pisell-design.multi-select.apply': string;
3
- 'pisell-design.multi-select.apply.no-data': string;
4
- 'pisell-design.paginator.previous': string;
5
- 'pisell-design.paginator.next': string;
6
- 'pisell-design.search.search': string;
7
- 'pisell-design.recharge.option.button.edit': string;
8
- 'pisell-design.recharge.option.button.add': string;
9
- 'pisell-design.select.tag.modal.title': string;
10
- };
11
- export default _default;
@@ -1,36 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/locales/zh-TW.ts
20
- var zh_TW_exports = {};
21
- __export(zh_TW_exports, {
22
- default: () => zh_TW_default
23
- });
24
- module.exports = __toCommonJS(zh_TW_exports);
25
- var zh_TW_default = {
26
- "pisell-design.multi-select.apply": "應用",
27
- "pisell-design.multi-select.apply.no-data": "對不起,沒有符合您選擇的產品",
28
- "pisell-design.paginator.previous": "上一頁",
29
- "pisell-design.paginator.next": "下一頁",
30
- "pisell-design.search.search": "搜索",
31
- "pisell-design.recharge.option.button.edit": "編輯",
32
- "pisell-design.recharge.option.button.add": "添加充值項",
33
- "pisell-design.select.tag.modal.title": "選擇標籤"
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {});
@@ -1,35 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/script/constants/index.js
20
- var constants_exports = {};
21
- __export(constants_exports, {
22
- outPathMap: () => outPathMap
23
- });
24
- module.exports = __toCommonJS(constants_exports);
25
- var outPathMap = {
26
- my_pisel_shop: {
27
- prod: "../data/release/project/mypisel_shop",
28
- release: "../data/release/project/my_pisel_shop",
29
- pre: "../data/release/project/my_pisel_shop"
30
- }
31
- };
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- outPathMap
35
- });
@@ -1,61 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/script/deploy.js
30
- var deploy_exports = {};
31
- __export(deploy_exports, {
32
- default: () => deploy_default
33
- });
34
- module.exports = __toCommonJS(deploy_exports);
35
- var import_inquirer = __toESM(require("inquirer"));
36
- var import_release = __toESM(require("./release/index.js"));
37
- var import_uploadCode = __toESM(require("./uploadCode/index.js"));
38
- var actions = {
39
- uploadCode: import_uploadCode.default,
40
- release: import_release.default
41
- };
42
- var inquirerResult = () => {
43
- return import_inquirer.default.prompt([
44
- {
45
- type: "list",
46
- message: "请选择功能",
47
- name: "action",
48
- choices: [
49
- { value: "uploadCode", name: "上传代码" },
50
- { value: "release", name: "发布代码" }
51
- ]
52
- }
53
- ]);
54
- };
55
- var deploy = async () => {
56
- let res = await inquirerResult();
57
- return actions[res.action]();
58
- };
59
- var deploy_default = deploy;
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {});
@@ -1,61 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from))
10
- if (!__hasOwnProp.call(to, key) && key !== except)
11
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- }
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
- mod
22
- ));
23
-
24
- // src/script/index.js
25
- var import_url = require("url");
26
- var import_deploy = __toESM(require("./deploy.js"));
27
- var import_utils = require("./utils/index.js");
28
- var import_meta = {};
29
- var args = process.argv.slice(2);
30
- var isVersion = (v) => {
31
- return ["-v", "--version", "-V"].includes(v);
32
- };
33
- var isHelp = (v) => {
34
- return ["-h", "--help", "-H"].includes(v);
35
- };
36
- var __dirname = path.dirname((0, import_url.fileURLToPath)(import_meta.url));
37
- (() => {
38
- try {
39
- const params = args.slice(1);
40
- switch (true) {
41
- case args[0] === "deploy":
42
- (0, import_deploy.default)(...params);
43
- break;
44
- case isVersion(args[0]):
45
- console.log(
46
- `@pisell/common@${(0, import_utils.loadJSON)(path.join(__dirname, "../../package.json")).version}`
47
- );
48
- break;
49
- case isHelp(args[0]):
50
- console.log("pisell -h --help -H [全部命令]");
51
- console.log("pisell -v --version -V [显示版本]");
52
- console.log("pisell deploy [上传代码|发布代码]");
53
- break;
54
- default:
55
- break;
56
- }
57
- } catch (e) {
58
- console.error(e.stack);
59
- process.exit(1);
60
- }
61
- })();
@@ -1,4 +0,0 @@
1
- {
2
- "name": "script",
3
- "type": "module"
4
- }
@@ -1,116 +0,0 @@
1
- #!/usr/bin/env zx
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/script/release/index.js
31
- var release_exports = {};
32
- __export(release_exports, {
33
- default: () => release_default
34
- });
35
- module.exports = __toCommonJS(release_exports);
36
- var import_inquirer = __toESM(require("inquirer"));
37
- var import_utils = require("../utils/index.js");
38
- var import_release = __toESM(require("./release.js"));
39
- var selectProject = () => {
40
- return import_inquirer.default.prompt([
41
- // {
42
- // type: "list",
43
- // message: "请选择项目",
44
- // name: "project",
45
- // choices: [
46
- // {
47
- // value: {
48
- // fileName: "my_pisel_shop",
49
- // path:"./",
50
- // },
51
- // name: "my_pisel_shop"
52
- // },
53
- // ],
54
- // },
55
- {
56
- type: "list",
57
- message: "请选择发布环境",
58
- name: "env",
59
- choices: ["release", "pre", "prod"]
60
- }
61
- ]);
62
- };
63
- var inquirerResult = (versionList) => {
64
- return import_inquirer.default.prompt([
65
- {
66
- type: "list",
67
- message: "请选择发布版本号",
68
- name: "version",
69
- default: versionList,
70
- choices: versionList
71
- },
72
- {
73
- type: "confirm",
74
- message: "确认发布",
75
- name: "is_release",
76
- default: true
77
- }
78
- ]);
79
- };
80
- var ignoreName = ["master", ".git", "pre-master"];
81
- var getVersionList = async ({ env, project }) => {
82
- const config = await (0, import_utils.getServerConfig)();
83
- let host = config[env].host;
84
- if (env === "release") {
85
- host = config.cn[env].host;
86
- }
87
- let projectName = project.fileName;
88
- if (projectName === "my_pisel_shop" && env === "prod") {
89
- projectName = "mypisel_shop";
90
- }
91
- const versionList = await fetch(
92
- `http://${host}:3600/version?projectName=${projectName}`
93
- ).then((res) => res.json());
94
- return (0, import_utils.versionSort)(versionList.filter((item) => !ignoreName.includes(item)));
95
- };
96
- async function init() {
97
- let projectAndEnv = await selectProject();
98
- projectAndEnv.project = {
99
- path: "./",
100
- fileName: (0, import_utils.getCurrentProjectName)()
101
- };
102
- const versionList = await getVersionList(projectAndEnv);
103
- const res = await inquirerResult(versionList);
104
- const releaseInstance = new import_release.default({ ...res, ...projectAndEnv });
105
- try {
106
- await releaseInstance.setConfig();
107
- await releaseInstance.connectServer();
108
- await releaseInstance.release();
109
- await releaseInstance.disconnectServer();
110
- } catch (error) {
111
- console.log(error);
112
- }
113
- }
114
- var release_default = init;
115
- // Annotate the CommonJS export names for ESM import in node:
116
- 0 && (module.exports = {});
@@ -1,89 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/script/release/release.js
20
- var release_exports = {};
21
- __export(release_exports, {
22
- default: () => release_default
23
- });
24
- module.exports = __toCommonJS(release_exports);
25
- var import_constants = require("../constants/index.js");
26
- var import_utils = require("../utils/index.js");
27
- var Release = class {
28
- constructor(props) {
29
- const { project, env, version, conn } = props;
30
- this.projectName = project.fileName;
31
- this.env = env;
32
- this.version = version;
33
- this.conn = conn;
34
- this.outPath = import_constants.outPathMap[this.projectName][this.env];
35
- }
36
- /**
37
- * @Title: 设置连接服务器配置
38
- * @Describe:
39
- * @Author: Zsj
40
- */
41
- async setConfig() {
42
- const serverConfigMap = await (0, import_utils.getServerConfig)();
43
- let serverConfig = serverConfigMap[this.env];
44
- if (this.env === "release") {
45
- serverConfig = serverConfigMap.cn[this.env];
46
- }
47
- if (this.env === "prod") {
48
- serverConfig.privateKey = fs.readFileSync(
49
- path.join(process.env.HOME, ".ssh", "id_rsa")
50
- );
51
- }
52
- this.serverConfig = serverConfig;
53
- }
54
- /**
55
- * @Title: 连接服务器
56
- * @Describe:
57
- * @Author: Zsj
58
- */
59
- async connectServer() {
60
- if (!this.serverConfig) {
61
- console.log("未找到发布配置!");
62
- return null;
63
- }
64
- this.conn = await (0, import_utils.connectServer)(this.serverConfig);
65
- return this.conn;
66
- }
67
- /**
68
- * @Title: 执行发布操作
69
- * @Describe:
70
- * @Author: Zsj
71
- */
72
- async release() {
73
- return await (0, import_utils.releaseProject)(this.conn, {
74
- path: this.outPath,
75
- fileName: `${this.version}`
76
- });
77
- }
78
- /**
79
- * @Title: 断开服务连接
80
- * @Describe:
81
- * @Author: Zsj
82
- */
83
- async disconnectServer() {
84
- return await this.conn.end();
85
- }
86
- };
87
- var release_default = Release;
88
- // Annotate the CommonJS export names for ESM import in node:
89
- 0 && (module.exports = {});
@@ -1,202 +0,0 @@
1
- #!/usr/bin/env zx
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/script/uploadCode/index.js
31
- var uploadCode_exports = {};
32
- __export(uploadCode_exports, {
33
- default: () => uploadCode_default
34
- });
35
- module.exports = __toCommonJS(uploadCode_exports);
36
- var import_inquirer = __toESM(require("inquirer"));
37
- var import_globals = require("zx/globals");
38
- var import_release = __toESM(require("../release/release.js"));
39
- var import_utils = require("../utils/index.js");
40
- var import_uploadCode = __toESM(require("./uploadCode.js"));
41
- var inquirerResult = () => {
42
- return import_inquirer.default.prompt([
43
- // {
44
- // type: "list",
45
- // message: "请选择项目",
46
- // name: "project",
47
- // choices: [
48
- // {
49
- // value: {
50
- // path: "./",
51
- // fileName: "my_pisel_shop"
52
- // },
53
- // name: "my_pisel_shop"
54
- // },
55
- // ],
56
- // },
57
- {
58
- type: "list",
59
- message: "请选择发布环境",
60
- name: "env",
61
- choices: ["release", "pre", "prod"]
62
- },
63
- {
64
- type: "rawlist",
65
- message: "请选择当前更新版本号",
66
- name: "version",
67
- default: false,
68
- choices: ["patch", "minor", "major"]
69
- },
70
- {
71
- type: "input",
72
- message: "请输入更新内容",
73
- name: "changelog",
74
- default: "update"
75
- },
76
- {
77
- type: "list",
78
- message: "上传之后是否执行发布",
79
- name: "is_release",
80
- choices: [
81
- { value: true, name: "上传并发布" },
82
- { value: false, name: "只上传" }
83
- ]
84
- },
85
- {
86
- type: "confirm",
87
- message: "确认信息无误",
88
- name: "is_confirm",
89
- default: true
90
- }
91
- ]);
92
- };
93
- async function init() {
94
- let res = await inquirerResult();
95
- if (!res.is_confirm) {
96
- console.log("取消发布");
97
- return;
98
- }
99
- res.project = {
100
- path: "./",
101
- fileName: (0, import_utils.getCurrentProjectName)()
102
- };
103
- await $`git fetch --prune-tags`;
104
- const uploadCode = new import_uploadCode.default(res);
105
- if (!await uploadCode.check()) {
106
- return;
107
- }
108
- console.log("开始更新版本号");
109
- const version = await uploadCode.updateVersion();
110
- console.log("✅ 版本更新完成");
111
- const currentUserName = await (0, import_utils.getCurrentUserName)();
112
- const result = await (0, import_utils.sendWebhook)({
113
- title: `${res.project.fileName} ${res.env}环境开始${res.is_release ? "上传并发布" : "上传"}`,
114
- content: [
115
- {
116
- key: "发布人",
117
- value: currentUserName.replace("\n", "")
118
- },
119
- {
120
- key: "更新内容",
121
- value: res.changelog
122
- },
123
- {
124
- key: "版本号",
125
- value: version || ""
126
- }
127
- ]
128
- });
129
- console.log(result, "result");
130
- try {
131
- console.log("开始打包");
132
- await uploadCode.build();
133
- console.log("✅ 打包完成");
134
- console.log("开始压缩");
135
- await uploadCode.compress();
136
- console.log("✅ 压缩完成");
137
- console.log("开始连接服务器");
138
- const conn = await uploadCode.connectServer();
139
- console.log("✅ 连接服务器完成");
140
- console.log("开始上传");
141
- await uploadCode.serverUpload();
142
- console.log("✅ 上传完成");
143
- console.log("开始解压");
144
- await uploadCode.serverUnpack();
145
- if (res.is_release) {
146
- const releaseInstance = new import_release.default({
147
- project: res.project,
148
- env: res.env,
149
- version,
150
- conn
151
- });
152
- console.log("开始发布");
153
- await releaseInstance.release();
154
- }
155
- await uploadCode.disconnectServer();
156
- await $`git pull --no-edit`;
157
- await $`git push --follow-tags`;
158
- console.log("✅ 成功后推送到git");
159
- } catch (error) {
160
- console.log(error, "执行出错 请排查重试");
161
- await $`git reset HEAD~1`;
162
- await $`git tag -d v${uploadCode.currentVersion}`;
163
- await (0, import_utils.sendWebhook)({
164
- title: `${res.project.fileName} ${res.env}环境${res.is_release ? "上传并发布" : "上传"}失败`,
165
- content: [
166
- {
167
- key: "发布人",
168
- value: currentUserName.replace("\n", "")
169
- },
170
- {
171
- key: "更新内容",
172
- value: res.changelog
173
- },
174
- {
175
- key: "版本号",
176
- value: version || ""
177
- }
178
- ]
179
- });
180
- }
181
- await (0, import_utils.sendWebhook)({
182
- title: `${res.project.fileName} ${res.env}环境${res.is_release ? "上传并发布" : "上传"}成功`,
183
- content: [
184
- {
185
- key: "发布人",
186
- value: currentUserName.replace("\n", "")
187
- },
188
- {
189
- key: "更新内容",
190
- value: res.changelog
191
- },
192
- {
193
- key: "版本号",
194
- value: version || ""
195
- }
196
- ]
197
- });
198
- uploadCode.deleteLocalZip();
199
- }
200
- var uploadCode_default = init;
201
- // Annotate the CommonJS export names for ESM import in node:
202
- 0 && (module.exports = {});