zmp-cli 3.15.6 → 3.15.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 (166) hide show
  1. package/README.md +1 -0
  2. package/build/index.js +1 -184
  3. package/config/index.js +1 -44
  4. package/create/index.js +1 -230
  5. package/create/init-zmp-ui.js +1 -216
  6. package/create/templates/app-parameters.js +9 -25
  7. package/create/templates/common/webpack/build.js +2 -40
  8. package/create/templates/copy-assets.js +1 -158
  9. package/create/templates/core/copy-assets.js +14 -82
  10. package/create/templates/core/generate-home-page.js +16 -38
  11. package/create/templates/core/generate-root.js +28 -63
  12. package/create/templates/core/generate-routes.js +12 -38
  13. package/create/templates/core/generate-scripts.js +16 -65
  14. package/create/templates/create-folders.js +1 -30
  15. package/create/templates/generate-config-xml.js +2 -9
  16. package/create/templates/generate-index.js +10 -35
  17. package/create/templates/generate-manifest.js +1 -49
  18. package/create/templates/generate-recoil.js +4 -16
  19. package/create/templates/generate-routes.js +1 -16
  20. package/create/templates/generate-scripts.js +1 -16
  21. package/create/templates/generate-service-worker.js +4 -10
  22. package/create/templates/generate-store.js +4 -15
  23. package/create/templates/generate-styles.js +10 -64
  24. package/create/templates/generate-webpack-config.js +43 -125
  25. package/create/templates/generate-zmp-custom.js +14 -72
  26. package/create/templates/react/copy-assets.js +1 -85
  27. package/create/templates/react/generate-home-page.js +20 -50
  28. package/create/templates/react/generate-root.js +15 -44
  29. package/create/templates/react/generate-routes.js +1 -16
  30. package/create/templates/react/generate-scripts.js +12 -38
  31. package/create/templates/react/pages/404.js +2 -10
  32. package/create/templates/react/pages/about.js +2 -10
  33. package/create/templates/react/pages/catalog.js +3 -17
  34. package/create/templates/react/pages/dynamic-route.js +2 -10
  35. package/create/templates/react/pages/form.js +6 -26
  36. package/create/templates/react/pages/index copy.js +1 -17
  37. package/create/templates/react/pages/index.js +1 -17
  38. package/create/templates/react/pages/settings.js +3 -17
  39. package/create/templates/react/pages/user.js +8 -27
  40. package/create/templates/react-typescript/components/app-items.js +2 -9
  41. package/create/templates/react-typescript/components/index.js +1 -9
  42. package/create/templates/react-typescript/components/navbar-back.js +2 -9
  43. package/create/templates/react-typescript/components/user-card.js +2 -9
  44. package/create/templates/react-typescript/copy-assets.js +1 -94
  45. package/create/templates/react-typescript/generate-home-page.js +20 -52
  46. package/create/templates/react-typescript/generate-root.js +14 -45
  47. package/create/templates/react-typescript/generate-routes.js +1 -12
  48. package/create/templates/react-typescript/generate-scripts.js +12 -37
  49. package/create/templates/react-typescript/pages/404.js +2 -10
  50. package/create/templates/react-typescript/pages/about.js +2 -10
  51. package/create/templates/react-typescript/pages/catalog.js +3 -17
  52. package/create/templates/react-typescript/pages/dynamic-route.js +2 -10
  53. package/create/templates/react-typescript/pages/form.js +6 -26
  54. package/create/templates/react-typescript/pages/index.js +1 -17
  55. package/create/templates/react-typescript/pages/settings.js +3 -17
  56. package/create/templates/react-typescript/pages/user.js +8 -27
  57. package/create/templates/svelte/copy-assets.js +1 -47
  58. package/create/templates/svelte/generate-home-page.js +20 -56
  59. package/create/templates/svelte/generate-root.js +22 -80
  60. package/create/templates/svelte/generate-routes.js +7 -22
  61. package/create/templates/svelte/generate-scripts.js +7 -23
  62. package/create/templates/vue/copy-assets.js +1 -67
  63. package/create/templates/vue/generate-home-page.js +2 -8
  64. package/create/templates/vue/generate-root.js +3 -13
  65. package/create/templates/vue/generate-routes.js +1 -7
  66. package/create/templates/vue/generate-scripts.js +9 -26
  67. package/create/templates/vue/global-components.d.js +1 -0
  68. package/create/templates/zaui/copy-assets.js +1 -90
  69. package/create/templates/zaui/generate-home-page.js +27 -53
  70. package/create/templates/zaui/generate-root.js +14 -34
  71. package/create/templates/zaui/generate-routes.js +1 -10
  72. package/create/templates/zaui/generate-scripts.js +6 -20
  73. package/create/templates/zaui/generate-user-card.js +3 -18
  74. package/create/templates/zaui/pages/about.js +3 -20
  75. package/create/templates/zaui/pages/form.js +3 -20
  76. package/create/templates/zaui/pages/index.js +1 -9
  77. package/create/templates/zaui/pages/user.js +3 -20
  78. package/create/utils/colors.js +1 -94
  79. package/create/utils/generate-app-config.js +1 -34
  80. package/create/utils/generate-gitignore.js +1 -43
  81. package/create/utils/generate-npm-scripts.js +1 -26
  82. package/create/utils/generate-package-json.js +1 -132
  83. package/create/utils/generate-readme.js +1 -28
  84. package/create/utils/get-options.js +1 -204
  85. package/create/utils/indent.js +1 -31
  86. package/create/utils/npm-scripts.js +1 -62
  87. package/create/utils/string.js +1 -13
  88. package/create/utils/styles-extension.js +1 -9
  89. package/create/utils/template-if.js +1 -9
  90. package/deploy/index.js +1 -149
  91. package/deploy/utils/get-options.js +1 -69
  92. package/deploy/utils/request-upload.js +1 -34
  93. package/deploy/utils/upload-app.js +1 -82
  94. package/index.js +1 -319
  95. package/login/index.js +1 -169
  96. package/login/utils/get-options.js +1 -58
  97. package/login/utils/zalo-login.js +1 -32
  98. package/migrate/icons/update-icon-v3.js +1 -19
  99. package/migrate/index.js +1 -60
  100. package/migrate/utils/get-options.js +1 -46
  101. package/migrate/utils/migrate-react.js +1 -33
  102. package/package.json +11 -39
  103. package/start/generate-hr-config.js +1 -59
  104. package/start/index.js +1 -382
  105. package/sync/index-to-app-config.js +1 -146
  106. package/sync/index.js +1 -55
  107. package/utils/axios.js +1 -15
  108. package/utils/check-update.js +1 -53
  109. package/utils/constants.js +1 -20
  110. package/utils/env.js +1 -39
  111. package/utils/error.js +1 -16
  112. package/utils/find-files-by-ext.js +1 -27
  113. package/utils/find-free-port.js +1 -11
  114. package/utils/fs-extra.js +1 -90
  115. package/utils/generate-pages-map.js +1 -17
  116. package/utils/get-app-info.js +1 -22
  117. package/utils/get-current-project.js +1 -25
  118. package/utils/get-ip.js +1 -19
  119. package/utils/log.js +1 -19
  120. package/utils/node-blob.js +1 -106
  121. package/utils/resumable.d.js +1 -0
  122. package/utils/resumable.js +1 -1204
  123. package/utils/spinner.js +1 -25
  124. package/utils/tunnel.js +1 -36
  125. package/.editorconfig +0 -15
  126. package/.eslintignore +0 -8
  127. package/.eslintrc.js +0 -10
  128. package/.vscode/launch.json +0 -23
  129. package/LICENSE +0 -21
  130. package/README.git.md +0 -37
  131. package/assets/index.js +0 -147
  132. package/build/dist/index.dev.js +0 -217
  133. package/config/dist/index.dev.js +0 -48
  134. package/create/templates/dist/generate-styles.dev.js +0 -46
  135. package/create/templates/react/dist/generate-scripts.dev.js +0 -23
  136. package/create/templates/react-typescript/dist/generate-scripts.dev.js +0 -23
  137. package/create/utils/dist/get-options.dev.js +0 -277
  138. package/deploy/dist/index.dev.js +0 -227
  139. package/deploy/utils/dist/request-upload.dev.js +0 -62
  140. package/deploy/utils/dist/upload-app.dev.js +0 -113
  141. package/dist/bundle.js +0 -1
  142. package/dist/index.dev.js +0 -352
  143. package/jsconfig.json +0 -8
  144. package/login/dist/index.dev.js +0 -223
  145. package/login/utils/dist/zalo-login.dev.js +0 -41
  146. package/screenshots/wellcome.jpg +0 -0
  147. package/show-qr-app/assets/css/style.css +0 -87
  148. package/show-qr-app/assets/js/qrcode.min.js +0 -1
  149. package/show-qr-app/index.html +0 -57
  150. package/show-qr-app/package.json +0 -14
  151. package/start/dist/index.dev.js +0 -312
  152. package/ui/server.js +0 -194
  153. package/ui/www/css/app.css +0 -1
  154. package/ui/www/css/app.css.map +0 -1
  155. package/ui/www/fonts/ZMPIcons-Regular.eot +0 -0
  156. package/ui/www/fonts/ZMPIcons-Regular.ttf +0 -0
  157. package/ui/www/fonts/ZMPIcons-Regular.woff +0 -0
  158. package/ui/www/fonts/ZMPIcons-Regular.woff2 +0 -0
  159. package/ui/www/images/logo.png +0 -0
  160. package/ui/www/index.html +0 -1
  161. package/ui/www/js/app.js +0 -3
  162. package/ui/www/js/app.js.LICENSE.txt +0 -20
  163. package/ui/www/js/app.js.map +0 -1
  164. package/ui/www/static/icons/apple-touch-icon.png +0 -0
  165. package/ui/www/static/icons/favicon.png +0 -0
  166. package/utils/dist/get-app-info.dev.js +0 -54
@@ -1,9 +1 @@
1
- const copyUser = require('./user');
2
- const copyForm = require('./form');
3
- const copyAbout = require('./about');
4
-
5
- module.exports = {
6
- copyUser,
7
- copyForm,
8
- copyAbout,
9
- };
1
+ "use strict";const e=require("./user"),r=require("./form"),u=require("./about");module.exports={copyUser:e,copyForm:r,copyAbout:u};
@@ -1,13 +1,4 @@
1
- const indent = require('../../../utils/indent');
2
- const { projectFramework } = require('../../../../utils/constants')
3
-
4
- module.exports = (options) => {
5
- const { framework } = options;
6
-
7
- if(framework === projectFramework.REACT_TYPESCRIPT){
8
- return indent(
9
- 0,
10
- `
1
+ "use strict";const e=require("../../../utils/indent"),{projectFramework:t}=require("../../../../utils/constants");module.exports=a=>{let{framework:i}=a;return i===t.REACT_TYPESCRIPT?e(0,`
11
2
  import React from "react";
12
3
  import { Avatar, List, Text, Box, Page, Button, Icon, useNavigate } from "zmp-ui";
13
4
  import { useRecoilValue } from "recoil";
@@ -53,13 +44,7 @@ module.exports = (options) => {
53
44
  };
54
45
 
55
46
  export default UserPage;
56
- `
57
- ).trim();
58
- }
59
-
60
- return indent(
61
- 0,
62
- `
47
+ `).trim():e(0,`
63
48
  import React from "react";
64
49
  import { Avatar, List, Text, Box, Page, Button, Icon, useNavigate } from "zmp-ui";
65
50
  import { useRecoilValue } from "recoil";
@@ -104,6 +89,4 @@ module.exports = (options) => {
104
89
  };
105
90
 
106
91
  export default UserPage;
107
- `
108
- ).trim();
109
- };
92
+ `).trim()};
@@ -1,94 +1 @@
1
- function colorHexToRgb(hex) {
2
- const h = hex.replace(
3
- /^#?([a-f\d])([a-f\d])([a-f\d])$/i,
4
- (m, r, g, b) => r + r + g + g + b + b
5
- );
6
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);
7
- return result ? result.slice(1).map((n) => parseInt(n, 16)) : null;
8
- }
9
- function colorRgbToHex(r, g, b) {
10
- const result = [r, g, b]
11
- .map((n) => {
12
- const hex = n.toString(16);
13
- return hex.length === 1 ? `0${hex}` : hex;
14
- })
15
- .join('');
16
- return `#${result}`;
17
- }
18
- function colorRgbToHsl(r, g, b) {
19
- r /= 255; // eslint-disable-line
20
- g /= 255; // eslint-disable-line
21
- b /= 255; // eslint-disable-line
22
- const max = Math.max(r, g, b);
23
- const min = Math.min(r, g, b);
24
- const d = max - min;
25
- let h;
26
- if (d === 0) h = 0;
27
- else if (max === r) h = ((g - b) / d) % 6;
28
- else if (max === g) h = (b - r) / d + 2;
29
- else if (max === b) h = (r - g) / d + 4;
30
- const l = (min + max) / 2;
31
- const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));
32
- return [h * 60, s, l];
33
- }
34
- function colorHslToRgb(h, s, l) {
35
- const c = (1 - Math.abs(2 * l - 1)) * s;
36
- const hp = h / 60;
37
- const x = c * (1 - Math.abs((hp % 2) - 1));
38
- let rgb1;
39
- if (Number.isNaN(h) || typeof h === 'undefined') {
40
- rgb1 = [0, 0, 0];
41
- } else if (hp <= 1) rgb1 = [c, x, 0];
42
- else if (hp <= 2) rgb1 = [x, c, 0];
43
- else if (hp <= 3) rgb1 = [0, c, x];
44
- else if (hp <= 4) rgb1 = [0, x, c];
45
- else if (hp <= 5) rgb1 = [x, 0, c];
46
- else if (hp <= 6) rgb1 = [c, 0, x];
47
- const m = l - c / 2;
48
- return rgb1.map((n) => Math.max(0, Math.min(255, Math.round(255 * (n + m)))));
49
- }
50
- function colorThemeCSSProperties(...args) {
51
- let hex;
52
- let rgb;
53
- if (args.length === 1) {
54
- [hex] = args;
55
- rgb = colorHexToRgb(hex);
56
- } else if (args.length === 3) {
57
- rgb = args;
58
- hex = colorRgbToHex(...rgb);
59
- }
60
- if (!rgb) return {};
61
- const hsl = colorRgbToHsl(...rgb);
62
- const hslShade = [hsl[0], hsl[1], Math.max(0, hsl[2] - 0.08)];
63
- const hslTint = [hsl[0], hsl[1], Math.max(0, hsl[2] + 0.08)];
64
- const shade = colorRgbToHex(...colorHslToRgb(...hslShade));
65
- const tint = colorRgbToHex(...colorHslToRgb(...hslTint));
66
- const hslSecondaryColor = [hsl[0], hsl[1], Math.max(0, hsl[2] + 0.6)];
67
- const secondaryColor = colorRgbToHex(...colorHslToRgb(...hslSecondaryColor));
68
- return {
69
- '--zmp-theme-color': hex,
70
- '--zmp-theme-color-rgb': rgb.join(', '),
71
- '--zmp-theme-color-shade': shade,
72
- '--zmp-theme-color-tint': tint,
73
- '--zmp-checkbox-active-color-disabled': 'var(--zmp-theme-color-shade)',
74
- '--zmp-radio-active-color-disabled': 'var(--zmp-theme-color-shade)',
75
- '--zmp-toggle-active-color-disabled': 'var(--zmp-theme-color-shade)',
76
- '--zmp-picker-action-button-hover-bg-color': 'var(--zmp-theme-color-shade)',
77
- '--zmp-button-pressed-bg-color-primary': 'var(--zmp-theme-color-shade)',
78
- ' --zmp-button-bg-color-secondary': secondaryColor,
79
- '--zmp-button-pressed-bg-color-secondary': secondaryColor,
80
- '--zmp-button-pressed-color-secondary': 'var(--zmp-theme-color)',
81
- '--zmp-button-border-color-secondary': 'var(--zmp-theme-color)',
82
- '--zmp-tabbar-fill-link-active-color': 'var(--zmp-theme-color)',
83
- '--zmp-tabbar-fill-link-active-border-color': 'var(--zmp-theme-color)',
84
- '--zmp-fab-pressed-bg-color': 'var(--zmp-theme-color-shade)',
85
- };
86
- }
87
-
88
- module.exports = {
89
- colorHexToRgb,
90
- colorHslToRgb,
91
- colorRgbToHex,
92
- colorRgbToHsl,
93
- colorThemeCSSProperties,
94
- };
1
+ 'use strict';const _0x307902=_0x50ab;(function(_0xd90c6b,_0x5c32cf){const _0x4bdec3=_0x50ab,_0x47c88f=_0xd90c6b();while(!![]){try{const _0x533694=parseInt(_0x4bdec3(0xc6))/0x1*(parseInt(_0x4bdec3(0xc9))/0x2)+parseInt(_0x4bdec3(0xce))/0x3*(-parseInt(_0x4bdec3(0xcd))/0x4)+parseInt(_0x4bdec3(0xd2))/0x5*(-parseInt(_0x4bdec3(0xd9))/0x6)+-parseInt(_0x4bdec3(0xcb))/0x7+-parseInt(_0x4bdec3(0xd3))/0x8*(parseInt(_0x4bdec3(0xcc))/0x9)+-parseInt(_0x4bdec3(0xdc))/0xa+-parseInt(_0x4bdec3(0xc4))/0xb*(-parseInt(_0x4bdec3(0xd1))/0xc);if(_0x533694===_0x5c32cf)break;else _0x47c88f['push'](_0x47c88f['shift']());}catch(_0x448ee7){_0x47c88f['push'](_0x47c88f['shift']());}}}(_0x1934,0xe8ff0));function e(_0x4f0570){const _0xa7ba8b=_0x50ab;let _0x5d5ac5=_0x4f0570[_0xa7ba8b(0xc7)](/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(_0x490c64,_0x16424b,_0x5b2060,_0x5073cf)=>_0x16424b+_0x16424b+_0x5b2060+_0x5b2060+_0x5073cf+_0x5073cf),_0x2090dd=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i[_0xa7ba8b(0xdb)](_0x5d5ac5);return _0x2090dd?_0x2090dd['slice'](0x1)['map'](_0x2f318e=>parseInt(_0x2f318e,0x10)):null;}function _0x1934(){const _0x414c39=['var(--zmp-theme-color)','24oxVLbW','max','exec','16713920aDDcPa','isNaN','3724391hYGLsn','min','2deVIWi','replace','round','1504686qyiNdw','length','10575229jigGcp','1773945GZheGb','3620LbmEyg','1245wpBQsw','abs','exports','204Gctxpb','1218190kWYOSv','72skxJEs','toString','join','map','var(--zmp-theme-color-shade)'];_0x1934=function(){return _0x414c39;};return _0x1934();}function o(_0x3db529,_0x5287b4,_0x953243){const _0x3806e6=_0x50ab;let _0x337dcb=[_0x3db529,_0x5287b4,_0x953243][_0x3806e6(0xd6)](_0x5c12fb=>{const _0xea9188=_0x3806e6;let _0x55fb9a=_0x5c12fb[_0xea9188(0xd4)](0x10);return 0x1===_0x55fb9a['length']?'0'+_0x55fb9a:_0x55fb9a;})['join']('');return'#'+_0x337dcb;}function t(_0x28c9c3,_0x582f6b,_0x47e73b){const _0x563226=_0x50ab;let _0x1cb975,_0x1a63e3=Math['max'](_0x28c9c3/=0xff,_0x582f6b/=0xff,_0x47e73b/=0xff),_0x232193=Math[_0x563226(0xc5)](_0x28c9c3,_0x582f6b,_0x47e73b),_0xf31fd9=_0x1a63e3-_0x232193;0x0===_0xf31fd9?_0x1cb975=0x0:_0x1a63e3===_0x28c9c3?_0x1cb975=(_0x582f6b-_0x47e73b)/_0xf31fd9%0x6:_0x1a63e3===_0x582f6b?_0x1cb975=(_0x47e73b-_0x28c9c3)/_0xf31fd9+0x2:_0x1a63e3===_0x47e73b&&(_0x1cb975=(_0x28c9c3-_0x582f6b)/_0xf31fd9+0x4);let _0x4695d6=(_0x232193+_0x1a63e3)/0x2;return[0x3c*_0x1cb975,0x0===_0xf31fd9?0x0:_0xf31fd9/(0x1-Math[_0x563226(0xcf)](0x2*_0x4695d6-0x1)),_0x4695d6];}function _0x50ab(_0x35a9dc,_0x278118){const _0x1934ef=_0x1934();return _0x50ab=function(_0x50ab4f,_0x4b1f41){_0x50ab4f=_0x50ab4f-0xc4;let _0x1498df=_0x1934ef[_0x50ab4f];return _0x1498df;},_0x50ab(_0x35a9dc,_0x278118);}function r(_0x224ea6,_0x59cf00,_0x4ebf60){const _0xea1888=_0x50ab;let _0x250703,_0x25b642=(0x1-Math[_0xea1888(0xcf)](0x2*_0x4ebf60-0x1))*_0x59cf00,_0xa19f0c=_0x224ea6/0x3c,_0x393541=_0x25b642*(0x1-Math['abs'](_0xa19f0c%0x2-0x1));Number[_0xea1888(0xdd)](_0x224ea6)||void 0x0===_0x224ea6?_0x250703=[0x0,0x0,0x0]:_0xa19f0c<=0x1?_0x250703=[_0x25b642,_0x393541,0x0]:_0xa19f0c<=0x2?_0x250703=[_0x393541,_0x25b642,0x0]:_0xa19f0c<=0x3?_0x250703=[0x0,_0x25b642,_0x393541]:_0xa19f0c<=0x4?_0x250703=[0x0,_0x393541,_0x25b642]:_0xa19f0c<=0x5?_0x250703=[_0x393541,0x0,_0x25b642]:_0xa19f0c<=0x6&&(_0x250703=[_0x25b642,0x0,_0x393541]);let _0x4e0ef9=_0x4ebf60-_0x25b642/0x2;return _0x250703[_0xea1888(0xd6)](_0x2acd3c=>Math[_0xea1888(0xda)](0x0,Math[_0xea1888(0xc5)](0xff,Math[_0xea1888(0xc8)](0xff*(_0x2acd3c+_0x4e0ef9)))));}module[_0x307902(0xd0)]={'colorHexToRgb':e,'colorHslToRgb':r,'colorRgbToHex':o,'colorRgbToHsl':t,'colorThemeCSSProperties':function(..._0x51f3bd){const _0x41fc22=_0x307902;let _0x414ebc,_0x12fae4;if(0x1===_0x51f3bd[_0x41fc22(0xca)]?([_0x414ebc]=_0x51f3bd,_0x12fae4=e(_0x414ebc)):0x3===_0x51f3bd[_0x41fc22(0xca)]&&(_0x414ebc=o(..._0x12fae4=_0x51f3bd)),!_0x12fae4)return{};let _0x9a65db=t(..._0x12fae4),_0x5321fd=[_0x9a65db[0x0],_0x9a65db[0x1],Math[_0x41fc22(0xda)](0x0,_0x9a65db[0x2]-0.08)],_0x2217b2=[_0x9a65db[0x0],_0x9a65db[0x1],Math[_0x41fc22(0xda)](0x0,_0x9a65db[0x2]+0.08)],_0x237851=o(...r(..._0x5321fd)),_0x58ce37=o(...r(..._0x2217b2)),_0x16569a=o(...r(_0x9a65db[0x0],_0x9a65db[0x1],Math[_0x41fc22(0xda)](0x0,_0x9a65db[0x2]+0.6)));return{'--zmp-theme-color':_0x414ebc,'--zmp-theme-color-rgb':_0x12fae4[_0x41fc22(0xd5)](',\x20'),'--zmp-theme-color-shade':_0x237851,'--zmp-theme-color-tint':_0x58ce37,'--zmp-checkbox-active-color-disabled':_0x41fc22(0xd7),'--zmp-radio-active-color-disabled':_0x41fc22(0xd7),'--zmp-toggle-active-color-disabled':'var(--zmp-theme-color-shade)','--zmp-picker-action-button-hover-bg-color':_0x41fc22(0xd7),'--zmp-button-pressed-bg-color-primary':_0x41fc22(0xd7),'\x20--zmp-button-bg-color-secondary':_0x16569a,'--zmp-button-pressed-bg-color-secondary':_0x16569a,'--zmp-button-pressed-color-secondary':'var(--zmp-theme-color)','--zmp-button-border-color-secondary':'var(--zmp-theme-color)','--zmp-tabbar-fill-link-active-color':_0x41fc22(0xd8),'--zmp-tabbar-fill-link-active-border-color':_0x41fc22(0xd8),'--zmp-fab-pressed-bg-color':_0x41fc22(0xd7)};}};
@@ -1,34 +1 @@
1
- module.exports = function generateAppConfig(options) {
2
- const { name } = options;
3
-
4
- // Window config
5
- const appConfig = {
6
- title: name,
7
- headerTitle: name,
8
- headerColor: '#1843EF',
9
- textColor: 'white',
10
- statusBarColor: '#1843EF',
11
- leftButton: 'back',
12
- statusBar: 'normal',
13
- actionBarHidden: false,
14
- hideAndroidBottomNavigationBar: false,
15
- hideIOSSafeAreaBottom: false,
16
- };
17
- // Content
18
- const content = JSON.stringify(
19
- {
20
- app: appConfig,
21
- debug: false,
22
- listCSS: [],
23
- listSyncJS: [],
24
- listAsyncJS: [],
25
- },
26
- '',
27
- 2
28
- ).trim();
29
-
30
- return {
31
- content,
32
- appConfig,
33
- };
34
- };
1
+ 'use strict';const _0x3b749e=_0x2b90;(function(_0x3a2a1e,_0x2b3aac){const _0xdc1c88=_0x2b90,_0x1db24e=_0x3a2a1e();while(!![]){try{const _0x25e210=parseInt(_0xdc1c88(0x1d6))/0x1+-parseInt(_0xdc1c88(0x1d5))/0x2*(-parseInt(_0xdc1c88(0x1ca))/0x3)+-parseInt(_0xdc1c88(0x1d3))/0x4*(-parseInt(_0xdc1c88(0x1cb))/0x5)+parseInt(_0xdc1c88(0x1ce))/0x6*(parseInt(_0xdc1c88(0x1d9))/0x7)+parseInt(_0xdc1c88(0x1d1))/0x8*(parseInt(_0xdc1c88(0x1cd))/0x9)+-parseInt(_0xdc1c88(0x1c9))/0xa+-parseInt(_0xdc1c88(0x1d4))/0xb;if(_0x25e210===_0x2b3aac)break;else _0x1db24e['push'](_0x1db24e['shift']());}catch(_0x144849){_0x1db24e['push'](_0x1db24e['shift']());}}}(_0x14e9,0xbc1ab));function _0x2b90(_0x345c52,_0x5c4db0){const _0x14e92c=_0x14e9();return _0x2b90=function(_0x2b9020,_0x485299){_0x2b9020=_0x2b9020-0x1c9;let _0x5edc3e=_0x14e92c[_0x2b9020];return _0x5edc3e;},_0x2b90(_0x345c52,_0x5c4db0);}module[_0x3b749e(0x1d8)]=function(_0x45b829){const _0x2517fc=_0x3b749e;let {name:_0x3ca232}=_0x45b829,_0x2e9c3d={'title':_0x3ca232,'headerTitle':_0x3ca232,'headerColor':_0x2517fc(0x1cc),'textColor':_0x2517fc(0x1d2),'statusBarColor':_0x2517fc(0x1cc),'leftButton':_0x2517fc(0x1cf),'statusBar':_0x2517fc(0x1d0),'actionBarHidden':!0x1,'hideAndroidBottomNavigationBar':!0x1,'hideIOSSafeAreaBottom':!0x1};return{'content':JSON['stringify']({'app':_0x2e9c3d,'debug':!0x1,'listCSS':[],'listSyncJS':[],'listAsyncJS':[]},'',0x2)[_0x2517fc(0x1d7)](),'appConfig':_0x2e9c3d};};function _0x14e9(){const _0x3952e2=['exports','178759LHXpVk','3156780HzEOQm','39759mrJesz','2890gVZHkp','#1843EF','2457360ONLvpU','270ftZIfo','back','normal','8aAxrDs','white','2944JIciLD','18152079RicUam','22bOmAmr','742946JoRDoP','trim'];_0x14e9=function(){return _0x3952e2;};return _0x14e9();}
@@ -1,43 +1 @@
1
- const templateIf = require('./template-if');
2
-
3
- module.exports = (options) => {
4
- return `
5
- # Logs
6
- logs
7
- *.log
8
- npm-debug.log*
9
- yarn-debug.log*
10
- yarn-error.log*
11
-
12
- # Runtime data
13
- pids
14
- *.pid
15
- *.seed
16
- *.pid.lock
17
-
18
- # Dependency directories
19
- node_modules/
20
-
21
- # Optional npm cache directory
22
- .npm
23
-
24
- # Optional eslint cache
25
- .eslintcache
26
-
27
- # Optional REPL history
28
- .node_repl_history
29
-
30
- # Yarn Integrity file
31
- .yarn-integrity
32
-
33
- # dotenv environment variables file
34
- .env
35
-
36
- # Misc
37
- .DS_Store
38
- Thumbs.db
39
-
40
- # Production build
41
- www/
42
- `;
43
- };
1
+ 'use strict';var _0x44d735=_0x30d2;(function(_0xb6abe9,_0x1da4dc){var _0x332e31=_0x30d2,_0x34dfe6=_0xb6abe9();while(!![]){try{var _0x39940c=parseInt(_0x332e31(0xd7))/0x1+-parseInt(_0x332e31(0xd6))/0x2+parseInt(_0x332e31(0xe1))/0x3+-parseInt(_0x332e31(0xdd))/0x4*(-parseInt(_0x332e31(0xe0))/0x5)+parseInt(_0x332e31(0xdb))/0x6*(parseInt(_0x332e31(0xd9))/0x7)+parseInt(_0x332e31(0xd5))/0x8+parseInt(_0x332e31(0xdc))/0x9*(-parseInt(_0x332e31(0xda))/0xa);if(_0x39940c===_0x1da4dc)break;else _0x34dfe6['push'](_0x34dfe6['shift']());}catch(_0x296647){_0x34dfe6['push'](_0x34dfe6['shift']());}}}(_0x492f,0x83cff));function _0x492f(){var _0x1d8a1c=['523490ttdLhH','6153702XbUdoi','414HCdmYO','1752vhqefr','exports','./template-if','11075uoHYpG','2311500tkYlZF','6603056PeEQiD','2060700eCcjkP','386638omLCbt','\x0a#\x20Logs\x0alogs\x0a*.log\x0anpm-debug.log*\x0ayarn-debug.log*\x0ayarn-error.log*\x0a\x0a#\x20Runtime\x20data\x0apids\x0a*.pid\x0a*.seed\x0a*.pid.lock\x0a\x0a#\x20Dependency\x20directories\x0anode_modules/\x0a\x0a#\x20Optional\x20npm\x20cache\x20directory\x0a.npm\x0a\x0a#\x20Optional\x20eslint\x20cache\x0a.eslintcache\x0a\x0a#\x20Optional\x20REPL\x20history\x0a.node_repl_history\x0a\x0a#\x20Yarn\x20Integrity\x20file\x0a.yarn-integrity\x0a\x0a#\x20dotenv\x20environment\x20variables\x20file\x0a.env\x0a\x0a#\x20Misc\x0a.DS_Store\x0aThumbs.db\x0a\x0a#\x20Production\x20build\x0awww/\x0a','7xqRxXn'];_0x492f=function(){return _0x1d8a1c;};return _0x492f();}function _0x30d2(_0x4c35ee,_0x2b19fa){var _0x492f44=_0x492f();return _0x30d2=function(_0x30d2a4,_0x24a607){_0x30d2a4=_0x30d2a4-0xd5;var _0x3306d7=_0x492f44[_0x30d2a4];return _0x3306d7;},_0x30d2(_0x4c35ee,_0x2b19fa);}require(_0x44d735(0xdf)),module[_0x44d735(0xde)]=_0x2b77c4=>_0x44d735(0xd8);
@@ -1,26 +1 @@
1
- const npmScripts = require('./npm-scripts');
2
-
3
- const generateNpmScripts = (tokens = ['s', 'r']) => {
4
- return tokens.map((token) => {
5
- return {
6
- icon: npmScripts.default[token].icon,
7
- name: npmScripts.default[token].name,
8
- script: npmScripts.default[token].script,
9
- description: npmScripts.default[token].description,
10
- };
11
- });
12
- };
13
-
14
- const generateTailWindScripts = (tokens = ['t']) => {
15
- return tokens.map((token) => {
16
- return {
17
- icon: npmScripts.tailwind[token].icon,
18
- name: npmScripts.tailwind[token].name,
19
- script: npmScripts.tailwind[token].script,
20
- description: npmScripts.tailwind[token].description,
21
- };
22
- });
23
- };
24
-
25
- module.exports = generateNpmScripts;
26
- module.exports.generateTailWindScripts = generateTailWindScripts;
1
+ 'use strict';function _0x224a(){const _0x42f2f4=['tailwind','3412090mxSPgP','77KIwhjM','2855007kuYuPK','17709MMVKvt','8rurTog','name','icon','275666kwoEFq','3538766dBZYTV','description','508USZoKr','1uAGgge','script','264102CcHKoP','default','8412440EcUgjl'];_0x224a=function(){return _0x42f2f4;};return _0x224a();}const _0x60152a=_0x21fd;(function(_0x57b585,_0x5a026c){const _0x10050f=_0x21fd,_0x5b3b22=_0x57b585();while(!![]){try{const _0x5a1623=-parseInt(_0x10050f(0x7c))/0x1*(-parseInt(_0x10050f(0x78))/0x2)+parseInt(_0x10050f(0x74))/0x3*(-parseInt(_0x10050f(0x7b))/0x4)+parseInt(_0x10050f(0x71))/0x5+-parseInt(_0x10050f(0x7e))/0x6*(parseInt(_0x10050f(0x72))/0x7)+-parseInt(_0x10050f(0x75))/0x8*(parseInt(_0x10050f(0x73))/0x9)+parseInt(_0x10050f(0x80))/0xa+parseInt(_0x10050f(0x79))/0xb;if(_0x5a1623===_0x5a026c)break;else _0x5b3b22['push'](_0x5b3b22['shift']());}catch(_0x1631f4){_0x5b3b22['push'](_0x5b3b22['shift']());}}}(_0x224a,0x697ee));function _0x21fd(_0x2c5aaa,_0x5afd9c){const _0x224afd=_0x224a();return _0x21fd=function(_0x21fdab,_0x591404){_0x21fdab=_0x21fdab-0x70;let _0x321074=_0x224afd[_0x21fdab];return _0x321074;},_0x21fd(_0x2c5aaa,_0x5afd9c);}const i=require('./npm-scripts');module['exports']=(_0x52da6f=['s','r'])=>_0x52da6f['map'](_0xd015a4=>({'icon':i[_0x60152a(0x7f)][_0xd015a4][_0x60152a(0x77)],'name':i[_0x60152a(0x7f)][_0xd015a4][_0x60152a(0x76)],'script':i['default'][_0xd015a4][_0x60152a(0x7d)],'description':i[_0x60152a(0x7f)][_0xd015a4]['description']})),module['exports']['generateTailWindScripts']=(_0x79c64f=['t'])=>_0x79c64f['map'](_0x96b7e9=>({'icon':i[_0x60152a(0x70)][_0x96b7e9][_0x60152a(0x77)],'name':i[_0x60152a(0x70)][_0x96b7e9][_0x60152a(0x76)],'script':i[_0x60152a(0x70)][_0x96b7e9][_0x60152a(0x7d)],'description':i[_0x60152a(0x70)][_0x96b7e9][_0x60152a(0x7a)]}));
@@ -1,132 +1 @@
1
- const generateNpmScripts = require('./generate-npm-scripts');
2
- const { generateTailWindScripts } = require('./generate-npm-scripts');
3
-
4
- module.exports = function generatePackageJson(options) {
5
- const {
6
- name,
7
- package,
8
- framework,
9
- cssPreProcessor,
10
- includeTailwind,
11
- stateManagement,
12
- } = options;
13
-
14
- // Dependencies
15
- const dependencies =
16
- package === 'zmp-ui'
17
- ? ['zmp-ui', 'zmp-sdk', 'react-router-dom']
18
- : ['zmp-framework', 'zmp-sdk', 'swiper'];
19
- const dependenciesVue = ['vue@3', 'zmp-framework'];
20
- const dependenciesReact = ['react', 'react-dom', 'prop-types'];
21
- const tailwindDependencies = [
22
- 'autoprefixer',
23
- 'tailwindcss',
24
- 'postcss@^8',
25
- 'postcss-cli@^8',
26
- ];
27
- const recoilDependencies = ['recoil'];
28
-
29
- if (framework === 'vue') {
30
- dependencies.push(...dependenciesVue);
31
- } else if (framework === 'react' || framework === 'react-typescript') {
32
- dependencies.push(...dependenciesReact);
33
- if (stateManagement === 'recoil') {
34
- dependencies.push(...recoilDependencies);
35
- }
36
- }
37
-
38
- const devDependencies = [
39
- 'cross-env',
40
- 'postcss-preset-env@6.7.0',
41
- 'vite@2.6.14',
42
- ];
43
- if (framework === 'react-typescript') {
44
- devDependencies.push('@types/react', '@types/react-dom');
45
- if (package === 'zmp-ui') {
46
- devDependencies.push('@types/react-router-dom');
47
- }
48
- }
49
- // CSS PreProcessor
50
- if (cssPreProcessor === 'stylus') devDependencies.push(...['stylus']);
51
- else if (cssPreProcessor === 'less') devDependencies.push(...['less']);
52
- else if (cssPreProcessor === 'scss') devDependencies.push(...['sass']);
53
-
54
- // DevDependencies
55
- const devDependenciesCore = ['zmp-loader'];
56
- const devDependenciesReact = ['@vitejs/plugin-react-refresh'];
57
- const devDependenciesVue = ['@vitejs/plugin-vue@2.3.3', '@vue/compiler-sfc'];
58
-
59
- if (framework === 'react' || framework === 'react-typescript')
60
- devDependencies.push(
61
- ...[devDependenciesReact],
62
- ...(includeTailwind ? tailwindDependencies : [])
63
- );
64
- else if (framework === 'vue')
65
- devDependencies.push(
66
- ...devDependenciesVue,
67
- ...(includeTailwind ? tailwindDependencies : [])
68
- );
69
- else if (framework === 'core')
70
- devDependencies.push(
71
- ...devDependenciesCore,
72
- ...(includeTailwind ? tailwindDependencies : [])
73
- );
74
-
75
- if (package === 'zmp-ui') {
76
- dependencies.push('recoil');
77
- dependencies.push(...dependenciesReact);
78
- devDependencies.push(
79
- ...[devDependenciesReact],
80
- ...(includeTailwind ? tailwindDependencies : [])
81
- );
82
- }
83
- // Scripts
84
- const scripts = {};
85
- generateNpmScripts().forEach((s) => {
86
- scripts[s.name] = s.script;
87
- });
88
- if (includeTailwind) {
89
- generateTailWindScripts().forEach((s) => {
90
- scripts[s.name] = s.script;
91
- });
92
- }
93
- const postInstall = [];
94
-
95
- if (postInstall.length) {
96
- scripts.postinstall = postInstall.join(' && ');
97
- }
98
-
99
- // Content
100
- const content = `
101
- {
102
- "name": "${name
103
- .toLowerCase()
104
- .replace(/[ ]{2,}/, ' ')
105
- .replace(/ /g, '-')}",
106
- "private": true,
107
- "version": "1.0.0",
108
- "description": "${name}",
109
- "repository" : "",
110
- "license" : "UNLICENSED",
111
- "browserslist": [
112
- "Android >= 5",
113
- "IOS >= 9.3",
114
- "Edge >= 15",
115
- "Safari >= 9.1",
116
- "Chrome >= 49",
117
- "Firefox >= 31",
118
- "Samsung >= 5"
119
- ],
120
- "scripts" : ${JSON.stringify(scripts)},
121
- "dependencies": {},
122
- "devDependencies": {}
123
- }
124
- `.trim();
125
-
126
- return {
127
- content,
128
- dependencies,
129
- devDependencies,
130
- postInstall,
131
- };
132
- };
1
+ 'use strict';function _0xd020(_0xf72d51,_0x9756b0){const _0xb7a9c4=_0xb7a9();return _0xd020=function(_0xd020e1,_0x33e4d3){_0xd020e1=_0xd020e1-0x1f4;let _0x39e8ca=_0xb7a9c4[_0xd020e1];return _0x39e8ca;},_0xd020(_0xf72d51,_0x9756b0);}const _0x5a466a=_0xd020;function _0xb7a9(){const _0x226914=['react-router-dom','exports','1220fHwCxH','recoil','postcss-cli@^8','cross-env','zmp-framework','postcss@^8','swiper','1crLLfV','less','vue','postinstall','./generate-npm-scripts','1219799GnqpSr','1100LzGDkb','react-typescript','@vitejs/plugin-react-refresh','\x22,\x0a\x20\x20\x22private\x22:\x20true,\x0a\x20\x20\x22version\x22:\x20\x221.0.0\x22,\x0a\x20\x20\x22description\x22:\x20\x22','6774JVftHP','\x20&&\x20','@vue/compiler-sfc','core','join','stringify','script','25762ZVcYCV','name','stylus','@types/react','zmp-ui','\x0a{\x0a\x20\x20\x22name\x22:\x20\x22','react-dom','@types/react-router-dom','vite@2.6.14',',\x0a\x20\x20\x22dependencies\x22:\x20{},\x0a\x20\x20\x22devDependencies\x22:\x20{}\x0a}\x0a','length','1063376nwEhjJ','package','replace','@types/react-dom','4OSrzHG','sass','prop-types','1398951LvKIWG','vue@3','forEach','258728OXbWnv','push','react','731316pZGbJl'];_0xb7a9=function(){return _0x226914;};return _0xb7a9();}(function(_0x1a0df0,_0x5506a4){const _0x43c00f=_0xd020,_0x2fdbf2=_0x1a0df0();while(!![]){try{const _0x53c11f=parseInt(_0x43c00f(0x216))/0x1*(-parseInt(_0x43c00f(0x209))/0x2)+parseInt(_0x43c00f(0x20c))/0x3*(-parseInt(_0x43c00f(0x203))/0x4)+-parseInt(_0x43c00f(0x21c))/0x5*(parseInt(_0x43c00f(0x220))/0x6)+parseInt(_0x43c00f(0x21b))/0x7+parseInt(_0x43c00f(0x1ff))/0x8+parseInt(_0x43c00f(0x206))/0x9+-parseInt(_0x43c00f(0x20f))/0xa*(-parseInt(_0x43c00f(0x1f4))/0xb);if(_0x53c11f===_0x5506a4)break;else _0x2fdbf2['push'](_0x2fdbf2['shift']());}catch(_0x1b6b2b){_0x2fdbf2['push'](_0x2fdbf2['shift']());}}}(_0xb7a9,0x1ef6a));const e=require('./generate-npm-scripts'),{generateTailWindScripts:s}=require(_0x5a466a(0x21a));module[_0x5a466a(0x20e)]=function(_0x3fc912){const _0x3657da=_0x5a466a;let {name:_0x12fcd3,framework:_0x434a0b,cssPreProcessor:_0x39baeb,includeTailwind:_0x16735b,stateManagement:_0x475122}=_0x3fc912,_0x3635a9=_0x3657da(0x1f8)===_0x3fc912[_0x3657da(0x200)]?[_0x3657da(0x1f8),'zmp-sdk',_0x3657da(0x20d)]:[_0x3657da(0x213),'zmp-sdk',_0x3657da(0x215)],_0x3187bd=[_0x3657da(0x20b),_0x3657da(0x1fa),_0x3657da(0x205)],_0x503322=['autoprefixer','tailwindcss',_0x3657da(0x214),_0x3657da(0x211)];_0x3657da(0x218)===_0x434a0b?_0x3635a9['push'](_0x3657da(0x207),_0x3657da(0x213)):(_0x3657da(0x20b)===_0x434a0b||_0x3657da(0x21d)===_0x434a0b)&&(_0x3635a9[_0x3657da(0x20a)](..._0x3187bd),'recoil'===_0x475122&&_0x3635a9['push'](_0x3657da(0x210)));let _0x85fa67=[_0x3657da(0x212),'postcss-preset-env@6.7.0',_0x3657da(0x1fc)];_0x3657da(0x21d)===_0x434a0b&&(_0x85fa67[_0x3657da(0x20a)](_0x3657da(0x1f7),_0x3657da(0x202)),_0x3657da(0x1f8)===_0x3fc912[_0x3657da(0x200)]&&_0x85fa67[_0x3657da(0x20a)](_0x3657da(0x1fb))),_0x3657da(0x1f6)===_0x39baeb?_0x85fa67['push'](_0x3657da(0x1f6)):_0x3657da(0x217)===_0x39baeb?_0x85fa67[_0x3657da(0x20a)]('less'):'scss'===_0x39baeb&&_0x85fa67['push'](_0x3657da(0x204));let _0x4bf425=[_0x3657da(0x21e)];_0x3657da(0x20b)===_0x434a0b||_0x3657da(0x21d)===_0x434a0b?_0x85fa67['push'](_0x4bf425,..._0x16735b?_0x503322:[]):_0x3657da(0x218)===_0x434a0b?_0x85fa67[_0x3657da(0x20a)]('@vitejs/plugin-vue@2.3.3',_0x3657da(0x222),..._0x16735b?_0x503322:[]):_0x3657da(0x223)===_0x434a0b&&_0x85fa67['push']('zmp-loader',..._0x16735b?_0x503322:[]),_0x3657da(0x1f8)===_0x3fc912[_0x3657da(0x200)]&&(_0x3635a9[_0x3657da(0x20a)]('recoil'),_0x3635a9['push'](..._0x3187bd),_0x85fa67[_0x3657da(0x20a)](_0x4bf425,..._0x16735b?_0x503322:[]));let _0x223e5c={};e()[_0x3657da(0x208)](_0x201624=>{const _0x3d7c85=_0x3657da;_0x223e5c[_0x201624[_0x3d7c85(0x1f5)]]=_0x201624['script'];}),_0x16735b&&s()[_0x3657da(0x208)](_0x31c588=>{const _0x169467=_0x3657da;_0x223e5c[_0x31c588[_0x169467(0x1f5)]]=_0x31c588[_0x169467(0x226)];});let _0x4ae491=[];return _0x4ae491[_0x3657da(0x1fe)]&&(_0x223e5c[_0x3657da(0x219)]=_0x4ae491[_0x3657da(0x224)](_0x3657da(0x221))),{'content':(_0x3657da(0x1f9)+_0x12fcd3['toLowerCase']()[_0x3657da(0x201)](/[ ]{2,}/,'\x20')[_0x3657da(0x201)](/ /g,'-')+_0x3657da(0x21f)+_0x12fcd3+'\x22,\x0a\x20\x20\x22repository\x22\x20:\x20\x22\x22,\x0a\x20\x20\x22license\x22\x20:\x20\x22UNLICENSED\x22,\x0a\x20\x20\x22browserslist\x22:\x20[\x0a\x20\x20\x20\x20\x22Android\x20>=\x205\x22,\x0a\x20\x20\x20\x20\x22IOS\x20>=\x209.3\x22,\x0a\x20\x20\x20\x20\x22Edge\x20>=\x2015\x22,\x0a\x20\x20\x20\x20\x22Safari\x20>=\x209.1\x22,\x0a\x20\x20\x20\x20\x22Chrome\x20>=\x2049\x22,\x0a\x20\x20\x20\x20\x22Firefox\x20>=\x2031\x22,\x0a\x20\x20\x20\x20\x22Samsung\x20>=\x205\x22\x0a\x20\x20],\x0a\x20\x20\x22scripts\x22\x20:\x20'+JSON[_0x3657da(0x225)](_0x223e5c)+_0x3657da(0x1fd))['trim'](),'dependencies':_0x3635a9,'devDependencies':_0x85fa67,'postInstall':_0x4ae491};};
@@ -1,28 +1 @@
1
- const generateNpmScripts = require('./generate-npm-scripts');
2
-
3
- module.exports = (options) => {
4
- const { name } = options;
5
-
6
- const npmScripts = generateNpmScripts().map((s) => {
7
- return `* ${s.icon} \`${s.name}\` - ${s.description}`;
8
- });
9
-
10
- return `
11
-
12
- # ${name}
13
-
14
- ## ZMP CLI Options
15
-
16
- ZMP app created with following options:
17
-
18
- \`\`\`
19
- ${JSON.stringify(options, null, 2)}
20
- \`\`\`
21
-
22
- ## NPM Scripts
23
-
24
- ${npmScripts.join('\n')}
25
- `
26
- .trim()
27
- .replace(/[\n]{3,}/, '\n');
28
- };
1
+ 'use strict';const _0x2dd897=_0x5591;(function(_0x3b2c35,_0x4b741e){const _0x4ea957=_0x5591,_0x259907=_0x3b2c35();while(!![]){try{const _0x1dae80=parseInt(_0x4ea957(0x10f))/0x1+parseInt(_0x4ea957(0x10d))/0x2+parseInt(_0x4ea957(0x10e))/0x3+-parseInt(_0x4ea957(0x113))/0x4+parseInt(_0x4ea957(0x10b))/0x5+-parseInt(_0x4ea957(0x10a))/0x6*(parseInt(_0x4ea957(0x114))/0x7)+parseInt(_0x4ea957(0x10c))/0x8*(-parseInt(_0x4ea957(0x109))/0x9);if(_0x1dae80===_0x4b741e)break;else _0x259907['push'](_0x259907['shift']());}catch(_0x10eedb){_0x259907['push'](_0x259907['shift']());}}}(_0x573c,0x819a6));function _0x5591(_0x355333,_0x58165b){const _0x573cfb=_0x573c();return _0x5591=function(_0x559148,_0x42e5df){_0x559148=_0x559148-0x107;let _0x549cb3=_0x573cfb[_0x559148];return _0x549cb3;},_0x5591(_0x355333,_0x58165b);}function _0x573c(){const _0x5bf889=['249578NaRfNz','\x0a```\x0a\x0a##\x20NPM\x20Scripts\x0a\x0a','description','icon','./generate-npm-scripts','trim','exports','replace','map','531gxQrel','54eGwbXE','1698810DENeRH','63864oPvOxE','102996leiqBt','2722848OIbESU','837690bBrXPu','name','\x0a\x0a#\x20','join','3255316thQQGc'];_0x573c=function(){return _0x5bf889;};return _0x573c();}const e=require(_0x2dd897(0x118));module[_0x2dd897(0x11a)]=_0x277362=>{const _0x368955=_0x2dd897;let {name:_0x44eb9b}=_0x277362,_0x2202ba=e()[_0x368955(0x108)](_0x4aa347=>'*\x20'+_0x4aa347[_0x368955(0x117)]+'\x20`'+_0x4aa347[_0x368955(0x110)]+'`\x20-\x20'+_0x4aa347[_0x368955(0x116)]);return(_0x368955(0x111)+_0x44eb9b+'\x0a\x0a##\x20ZMP\x20CLI\x20Options\x0a\x0aZMP\x20app\x20created\x20with\x20following\x20options:\x0a\x0a```\x0a'+JSON['stringify'](_0x277362,null,0x2)+_0x368955(0x115)+_0x2202ba[_0x368955(0x112)]('\x0a')+'\x0a')[_0x368955(0x119)]()[_0x368955(0x107)](/[\n]{3,}/,'\x0a');};
@@ -1,204 +1 @@
1
- /* eslint no-param-reassign: ["off"] */
2
- const inquirer = require('inquirer');
3
- var chalk = require('chalk');
4
- const { projectFramework } = require('../../utils/constants');
5
-
6
- const moreOptionsText = chalk.italic(
7
- `\t- Including Tailwind CSS\n\t- Including Recoil (React only)`
8
- );
9
- const questions = [
10
- {
11
- type: 'list',
12
- name: 'newProject',
13
- message: 'What action you want to do?',
14
- choices: [
15
- { name: 'Create a new ZMP project', value: true },
16
- { name: 'Using ZMP to deploy only', value: false },
17
- ],
18
- },
19
- {
20
- type: 'input',
21
- name: 'name',
22
- message: 'App (project) name:',
23
- default: 'My App',
24
- validate(input) {
25
- return new Promise((resolve, reject) => {
26
- if (!input) reject(new Error('App name is required'));
27
- else resolve(true);
28
- });
29
- },
30
- },
31
- {
32
- type: 'list',
33
- name: 'package',
34
- when: (opts) => opts.newProject,
35
- message: 'Choose an UI library',
36
- choices: [
37
- {
38
- name: 'zmp-ui',
39
- value: 'zmp-ui',
40
- },
41
- ],
42
- },
43
- // Framework
44
-
45
- {
46
- type: 'list',
47
- name: 'framework',
48
- when: (opts) => opts.package == 'zmp-ui',
49
- message: 'What type of framework/library do you prefer?',
50
- choices: [
51
- {
52
- name: 'ReactJS',
53
- value: projectFramework.REACT,
54
- },
55
- {
56
- name: 'React Typescript',
57
- value: projectFramework.REACT_TYPESCRIPT,
58
- },
59
- ],
60
- },
61
- // Template
62
- {
63
- type: 'list',
64
- name: 'cssPreProcessor',
65
- when: (opts) => opts.newProject,
66
- message: 'Do you want to setup CSS Pre-Processor',
67
- default: false,
68
- choices: [
69
- {
70
- name: 'No, i am good with CSS',
71
- value: false,
72
- },
73
- {
74
- name: 'Less',
75
- value: 'less',
76
- },
77
- {
78
- name: 'SCSS (SASS)',
79
- value: 'scss',
80
- },
81
- {
82
- name: 'Stylus',
83
- value: 'stylus',
84
- },
85
- ],
86
- },
87
- // Template
88
- {
89
- type: 'list',
90
- name: 'template',
91
- when: (opts) => opts.package === 'zmp-ui',
92
- message: 'Choose starter template:',
93
- choices: [
94
- {
95
- name: 'Blank',
96
- value: 'blank',
97
- },
98
- {
99
- name: 'Single View',
100
- value: 'single-view',
101
- },
102
- ],
103
- },
104
- // Color
105
- {
106
- type: 'list',
107
- name: 'themingCustomColor',
108
- when: (opts) => opts.newProject && opts.package !== 'zmp-ui',
109
- message: 'Do you want to specify custom theme color?',
110
- choices: [
111
- {
112
- name: 'No, use default color theme',
113
- value: false,
114
- },
115
- {
116
- name: 'Yes, i want to specify my brand color',
117
- value: true,
118
- },
119
- ],
120
- },
121
- {
122
- type: 'input',
123
- name: 'themingColor',
124
- message: 'Enter custom theme color in HEX format (e.g. ff0000)',
125
- when: (opts) => opts.themingCustomColor === true,
126
- validate(input) {
127
- return new Promise((resolve, reject) => {
128
- const num = input.replace(/#/g, '');
129
- if (num.length === 3 || num.length === 6) resolve(true);
130
- else reject(new Error("It doesn't look like a correct HEX number"));
131
- });
132
- },
133
- filter(input) {
134
- return input.replace(/#/g, '');
135
- },
136
- },
137
- {
138
- type: 'list',
139
- name: 'moreOptions',
140
- when: (opts) => opts.newProject,
141
- message: `More Options?\n${moreOptionsText}`,
142
- default: false,
143
- choices: [
144
- {
145
- name: 'No, I want to complete initializing process now',
146
- value: false,
147
- },
148
- {
149
- name: 'Yes, I want to get more options',
150
- value: true,
151
- },
152
- ],
153
- },
154
-
155
- {
156
- type: 'list',
157
- name: 'includeTailwind',
158
- when: (opts) => opts.moreOptions,
159
- message: 'Do you want to include Tailwind CSS?',
160
- default: true,
161
- choices: [
162
- {
163
- name: 'Yes, I want to iclude Tailwind CSS',
164
- value: true,
165
- },
166
- {
167
- name: 'No',
168
- value: false,
169
- },
170
- ],
171
- },
172
- ];
173
-
174
- module.exports = function getOptions() {
175
- const listQuestion = questions;
176
- return inquirer.prompt(listQuestion).then((options) => {
177
- options.theming = {
178
- customColor: options.themingCustomColor,
179
- color:
180
- options.themingCustomColor && options.themingColor
181
- ? `#${options.themingColor}`
182
- : '#007aff',
183
- darkTheme: false,
184
- iconFonts: options.themingIconFonts,
185
- fillBars: false,
186
- useUiKits: options.useUIKits,
187
- };
188
- options.customBuild = false;
189
- options.includeTailwind = options.moreOptions && options.includeTailwind;
190
- if (!options.stateManagement) {
191
- options.stateManagement = 'store';
192
- }
193
- if (options.package === 'zmp-ui') {
194
- options.stateManagement = 'recoil';
195
- }
196
- delete options.themingCustomColor;
197
- delete options.themingColor;
198
- delete options.themingIconFonts;
199
- delete options.useUIKits;
200
- delete options.moreOptions;
201
-
202
- return Promise.resolve(options);
203
- });
204
- };
1
+ 'use strict';const _0x1f864f=_0x3677;(function(_0xc25af4,_0x9750e1){const _0x18d53c=_0x3677,_0x2836dc=_0xc25af4();while(!![]){try{const _0x1875fb=-parseInt(_0x18d53c(0x170))/0x1*(-parseInt(_0x18d53c(0x157))/0x2)+-parseInt(_0x18d53c(0x18a))/0x3*(-parseInt(_0x18d53c(0x17e))/0x4)+parseInt(_0x18d53c(0x18f))/0x5+-parseInt(_0x18d53c(0x172))/0x6+-parseInt(_0x18d53c(0x18e))/0x7+-parseInt(_0x18d53c(0x180))/0x8+parseInt(_0x18d53c(0x184))/0x9*(-parseInt(_0x18d53c(0x188))/0xa);if(_0x1875fb===_0x9750e1)break;else _0x2836dc['push'](_0x2836dc['shift']());}catch(_0x4af34e){_0x2836dc['push'](_0x2836dc['shift']());}}}(_0x330a,0x5e9c2));const e=require(_0x1f864f(0x18b));var t=require(_0x1f864f(0x190));const {projectFramework:o}=require('../../utils/constants'),a=t[_0x1f864f(0x174)]('\x09-\x20Including\x20Tailwind\x20CSS\x0a\x09-\x20Including\x20Recoil\x20(React\x20only)'),n=[{'type':'list','name':_0x1f864f(0x16f),'message':'What\x20action\x20you\x20want\x20to\x20do?','choices':[{'name':_0x1f864f(0x179),'value':!0x0},{'name':'Using\x20ZMP\x20to\x20deploy\x20only','value':!0x1}]},{'type':'input','name':'name','message':'App\x20(project)\x20name:','default':_0x1f864f(0x16a),'validate':_0x4087c2=>new Promise((_0x30da01,_0x5c16fd)=>{const _0x4be9eb=_0x1f864f;_0x4087c2?_0x30da01(!0x0):_0x5c16fd(Error(_0x4be9eb(0x183)));})},{'type':_0x1f864f(0x160),'name':_0x1f864f(0x159),'when':_0x346c8d=>_0x346c8d[_0x1f864f(0x16f)],'message':_0x1f864f(0x166),'choices':[{'name':_0x1f864f(0x16d),'value':_0x1f864f(0x16d)}]},{'type':_0x1f864f(0x160),'name':'framework','when':_0x1167a1=>'zmp-ui'==_0x1167a1[_0x1f864f(0x159)],'message':_0x1f864f(0x191),'choices':[{'name':_0x1f864f(0x185),'value':o[_0x1f864f(0x17d)]},{'name':_0x1f864f(0x175),'value':o[_0x1f864f(0x15f)]}]},{'type':_0x1f864f(0x160),'name':'cssPreProcessor','when':_0x4060fb=>_0x4060fb[_0x1f864f(0x16f)],'message':_0x1f864f(0x18d),'default':!0x1,'choices':[{'name':_0x1f864f(0x152),'value':!0x1},{'name':_0x1f864f(0x153),'value':_0x1f864f(0x15a)},{'name':_0x1f864f(0x177),'value':_0x1f864f(0x156)},{'name':_0x1f864f(0x17a),'value':_0x1f864f(0x181)}]},{'type':_0x1f864f(0x160),'name':_0x1f864f(0x173),'when':_0x4ff16b=>_0x1f864f(0x16d)===_0x4ff16b[_0x1f864f(0x159)],'message':_0x1f864f(0x164),'choices':[{'name':'Blank','value':_0x1f864f(0x155)},{'name':_0x1f864f(0x187),'value':'single-view'}]},{'type':_0x1f864f(0x160),'name':_0x1f864f(0x16e),'when':_0x4e782e=>_0x4e782e[_0x1f864f(0x16f)]&&_0x1f864f(0x16d)!==_0x4e782e[_0x1f864f(0x159)],'message':_0x1f864f(0x15d),'choices':[{'name':_0x1f864f(0x182),'value':!0x1},{'name':_0x1f864f(0x15b),'value':!0x0}]},{'type':_0x1f864f(0x178),'name':_0x1f864f(0x169),'message':_0x1f864f(0x15e),'when':_0x6ffb6b=>!0x0===_0x6ffb6b[_0x1f864f(0x16e)],'validate':_0x5a0184=>new Promise((_0x5cf024,_0x5119b8)=>{const _0x2a6701=_0x1f864f;let _0x3ffaef=_0x5a0184[_0x2a6701(0x17c)](/#/g,'');0x3===_0x3ffaef['length']||0x6===_0x3ffaef[_0x2a6701(0x167)]?_0x5cf024(!0x0):_0x5119b8(Error(_0x2a6701(0x18c)));}),'filter':_0x28395f=>_0x28395f[_0x1f864f(0x17c)](/#/g,'')},{'type':'list','name':_0x1f864f(0x189),'when':_0x1e9949=>_0x1e9949[_0x1f864f(0x16f)],'message':_0x1f864f(0x165)+a,'default':!0x1,'choices':[{'name':_0x1f864f(0x16c),'value':!0x1},{'name':'Yes,\x20I\x20want\x20to\x20get\x20more\x20options','value':!0x0}]},{'type':'list','name':_0x1f864f(0x16b),'when':_0x22de20=>_0x22de20[_0x1f864f(0x189)],'message':_0x1f864f(0x17f),'default':!0x0,'choices':[{'name':'Yes,\x20I\x20want\x20to\x20iclude\x20Tailwind\x20CSS','value':!0x0},{'name':'No','value':!0x1}]}];module[_0x1f864f(0x163)]=function(){const _0x2d3cd0=_0x1f864f;return e[_0x2d3cd0(0x168)](n)[_0x2d3cd0(0x17b)](_0x2b86dc=>(_0x2b86dc['theming']={'customColor':_0x2b86dc[_0x2d3cd0(0x16e)],'color':_0x2b86dc[_0x2d3cd0(0x16e)]&&_0x2b86dc[_0x2d3cd0(0x169)]?'#'+_0x2b86dc[_0x2d3cd0(0x169)]:_0x2d3cd0(0x171),'darkTheme':!0x1,'iconFonts':_0x2b86dc[_0x2d3cd0(0x162)],'fillBars':!0x1,'useUiKits':_0x2b86dc[_0x2d3cd0(0x186)]},_0x2b86dc[_0x2d3cd0(0x158)]=!0x1,_0x2b86dc[_0x2d3cd0(0x16b)]=_0x2b86dc[_0x2d3cd0(0x189)]&&_0x2b86dc[_0x2d3cd0(0x16b)],_0x2b86dc['stateManagement']||(_0x2b86dc[_0x2d3cd0(0x154)]=_0x2d3cd0(0x161)),_0x2d3cd0(0x16d)===_0x2b86dc[_0x2d3cd0(0x159)]&&(_0x2b86dc[_0x2d3cd0(0x154)]=_0x2d3cd0(0x15c)),delete _0x2b86dc[_0x2d3cd0(0x16e)],delete _0x2b86dc[_0x2d3cd0(0x169)],delete _0x2b86dc[_0x2d3cd0(0x162)],delete _0x2b86dc[_0x2d3cd0(0x186)],delete _0x2b86dc[_0x2d3cd0(0x189)],Promise[_0x2d3cd0(0x176)](_0x2b86dc)));};function _0x3677(_0x389462,_0x3048f2){const _0x330a87=_0x330a();return _0x3677=function(_0x3677ff,_0x2bb918){_0x3677ff=_0x3677ff-0x152;let _0x205955=_0x330a87[_0x3677ff];return _0x205955;},_0x3677(_0x389462,_0x3048f2);}function _0x330a(){const _0x531398=['React\x20Typescript','resolve','SCSS\x20(SASS)','input','Create\x20a\x20new\x20ZMP\x20project','Stylus','then','replace','REACT','4mBzUGK','Do\x20you\x20want\x20to\x20include\x20Tailwind\x20CSS?','1882320unjTdL','stylus','No,\x20use\x20default\x20color\x20theme','App\x20name\x20is\x20required','891hVVqTe','ReactJS','useUIKits','Single\x20View','49230vpHPzo','moreOptions','649617lLnmhc','inquirer','It\x20doesn\x27t\x20look\x20like\x20a\x20correct\x20HEX\x20number','Do\x20you\x20want\x20to\x20setup\x20CSS\x20Pre-Processor','1207451sFsZLs','3857970ThexJH','chalk','What\x20type\x20of\x20framework/library\x20do\x20you\x20prefer?','No,\x20i\x20am\x20good\x20with\x20CSS','Less','stateManagement','blank','scss','2zApqqQ','customBuild','package','less','Yes,\x20i\x20want\x20to\x20specify\x20my\x20brand\x20color','recoil','Do\x20you\x20want\x20to\x20specify\x20custom\x20theme\x20color?','Enter\x20custom\x20theme\x20color\x20in\x20HEX\x20format\x20(e.g.\x20ff0000)','REACT_TYPESCRIPT','list','store','themingIconFonts','exports','Choose\x20starter\x20template:','More\x20Options?\x0a','Choose\x20an\x20UI\x20library','length','prompt','themingColor','My\x20App','includeTailwind','No,\x20I\x20want\x20to\x20complete\x20initializing\x20process\x20now','zmp-ui','themingCustomColor','newProject','382528lhvtaG','#007aff','527874jljdjF','template','italic'];_0x330a=function(){return _0x531398;};return _0x330a();}