zmp-cli 3.15.5 → 3.15.6-beta.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.
- package/README.md +1 -0
- package/build/index.js +1 -184
- package/config/index.js +1 -44
- package/create/index.js +1 -230
- package/create/init-zmp-ui.js +1 -216
- package/create/templates/app-parameters.js +9 -25
- package/create/templates/common/webpack/build.js +2 -40
- package/create/templates/copy-assets.js +1 -158
- package/create/templates/core/copy-assets.js +14 -82
- package/create/templates/core/generate-home-page.js +16 -38
- package/create/templates/core/generate-root.js +28 -63
- package/create/templates/core/generate-routes.js +12 -38
- package/create/templates/core/generate-scripts.js +16 -65
- package/create/templates/create-folders.js +1 -30
- package/create/templates/generate-config-xml.js +2 -9
- package/create/templates/generate-index.js +10 -35
- package/create/templates/generate-manifest.js +1 -49
- package/create/templates/generate-recoil.js +4 -16
- package/create/templates/generate-routes.js +1 -16
- package/create/templates/generate-scripts.js +1 -16
- package/create/templates/generate-service-worker.js +4 -10
- package/create/templates/generate-store.js +4 -15
- package/create/templates/generate-styles.js +10 -64
- package/create/templates/generate-webpack-config.js +43 -125
- package/create/templates/generate-zmp-custom.js +14 -72
- package/create/templates/react/copy-assets.js +1 -85
- package/create/templates/react/generate-home-page.js +20 -50
- package/create/templates/react/generate-root.js +15 -44
- package/create/templates/react/generate-routes.js +1 -16
- package/create/templates/react/generate-scripts.js +12 -38
- package/create/templates/react/pages/404.js +2 -10
- package/create/templates/react/pages/about.js +2 -10
- package/create/templates/react/pages/catalog.js +3 -17
- package/create/templates/react/pages/dynamic-route.js +2 -10
- package/create/templates/react/pages/form.js +6 -26
- package/create/templates/react/pages/index copy.js +1 -17
- package/create/templates/react/pages/index.js +1 -17
- package/create/templates/react/pages/settings.js +3 -17
- package/create/templates/react/pages/user.js +8 -27
- package/create/templates/react-typescript/components/app-items.js +2 -9
- package/create/templates/react-typescript/components/index.js +1 -9
- package/create/templates/react-typescript/components/navbar-back.js +2 -9
- package/create/templates/react-typescript/components/user-card.js +2 -9
- package/create/templates/react-typescript/copy-assets.js +1 -94
- package/create/templates/react-typescript/generate-home-page.js +20 -52
- package/create/templates/react-typescript/generate-root.js +14 -45
- package/create/templates/react-typescript/generate-routes.js +1 -12
- package/create/templates/react-typescript/generate-scripts.js +12 -37
- package/create/templates/react-typescript/pages/404.js +2 -10
- package/create/templates/react-typescript/pages/about.js +2 -10
- package/create/templates/react-typescript/pages/catalog.js +3 -17
- package/create/templates/react-typescript/pages/dynamic-route.js +2 -10
- package/create/templates/react-typescript/pages/form.js +6 -26
- package/create/templates/react-typescript/pages/index.js +1 -17
- package/create/templates/react-typescript/pages/settings.js +3 -17
- package/create/templates/react-typescript/pages/user.js +8 -27
- package/create/templates/svelte/copy-assets.js +1 -47
- package/create/templates/svelte/generate-home-page.js +20 -56
- package/create/templates/svelte/generate-root.js +22 -80
- package/create/templates/svelte/generate-routes.js +7 -22
- package/create/templates/svelte/generate-scripts.js +7 -23
- package/create/templates/vue/copy-assets.js +1 -67
- package/create/templates/vue/generate-home-page.js +2 -8
- package/create/templates/vue/generate-root.js +3 -13
- package/create/templates/vue/generate-routes.js +1 -7
- package/create/templates/vue/generate-scripts.js +9 -26
- package/create/templates/vue/global-components.d.js +1 -0
- package/create/templates/zaui/copy-assets.js +1 -90
- package/create/templates/zaui/generate-home-page.js +27 -53
- package/create/templates/zaui/generate-root.js +14 -34
- package/create/templates/zaui/generate-routes.js +1 -10
- package/create/templates/zaui/generate-scripts.js +6 -20
- package/create/templates/zaui/generate-user-card.js +3 -18
- package/create/templates/zaui/pages/about.js +3 -20
- package/create/templates/zaui/pages/form.js +3 -20
- package/create/templates/zaui/pages/index.js +1 -9
- package/create/templates/zaui/pages/user.js +3 -20
- package/create/utils/colors.js +1 -94
- package/create/utils/generate-app-config.js +1 -34
- package/create/utils/generate-gitignore.js +1 -43
- package/create/utils/generate-npm-scripts.js +1 -26
- package/create/utils/generate-package-json.js +1 -132
- package/create/utils/generate-readme.js +1 -28
- package/create/utils/get-options.js +1 -204
- package/create/utils/indent.js +1 -31
- package/create/utils/npm-scripts.js +1 -62
- package/create/utils/string.js +1 -13
- package/create/utils/styles-extension.js +1 -9
- package/create/utils/template-if.js +1 -9
- package/deploy/index.js +1 -148
- package/deploy/utils/get-options.js +1 -69
- package/deploy/utils/request-upload.js +1 -34
- package/deploy/utils/upload-app.js +1 -82
- package/index.js +1 -319
- package/login/index.js +1 -169
- package/login/utils/get-options.js +1 -58
- package/login/utils/zalo-login.js +1 -32
- package/migrate/icons/update-icon-v3.js +1 -19
- package/migrate/index.js +1 -60
- package/migrate/utils/get-options.js +1 -46
- package/migrate/utils/migrate-react.js +1 -33
- package/package.json +11 -39
- package/start/generate-hr-config.js +1 -59
- package/start/index.js +1 -382
- package/sync/index-to-app-config.js +1 -146
- package/sync/index.js +1 -55
- package/utils/axios.js +1 -15
- package/utils/check-update.js +1 -53
- package/utils/constants.js +1 -20
- package/utils/env.js +1 -39
- package/utils/error.js +1 -16
- package/utils/find-files-by-ext.js +1 -27
- package/utils/find-free-port.js +1 -11
- package/utils/fs-extra.js +1 -90
- package/utils/generate-pages-map.js +1 -17
- package/utils/get-app-info.js +1 -22
- package/utils/get-current-project.js +1 -25
- package/utils/get-ip.js +1 -19
- package/utils/log.js +1 -19
- package/utils/node-blob.js +1 -106
- package/utils/resumable.d.js +1 -0
- package/utils/resumable.js +1 -1204
- package/utils/spinner.js +1 -25
- package/utils/tunnel.js +1 -36
- package/.editorconfig +0 -15
- package/.eslintignore +0 -8
- package/.eslintrc.js +0 -10
- package/.vscode/launch.json +0 -23
- package/LICENSE +0 -21
- package/README.git.md +0 -37
- package/assets/index.js +0 -147
- package/build/dist/index.dev.js +0 -217
- package/config/dist/index.dev.js +0 -48
- package/create/templates/dist/generate-styles.dev.js +0 -46
- package/create/utils/dist/get-options.dev.js +0 -277
- package/deploy/dist/index.dev.js +0 -227
- package/dist/index.dev.js +0 -352
- package/jsconfig.json +0 -8
- package/login/dist/index.dev.js +0 -223
- package/screenshots/wellcome.jpg +0 -0
- package/show-qr-app/assets/css/style.css +0 -87
- package/show-qr-app/assets/js/qrcode.min.js +0 -1
- package/show-qr-app/index.html +0 -57
- package/show-qr-app/package.json +0 -14
- package/start/dist/index.dev.js +0 -312
- package/ui/server.js +0 -194
- package/ui/www/css/app.css +0 -1
- package/ui/www/css/app.css.map +0 -1
- package/ui/www/fonts/ZMPIcons-Regular.eot +0 -0
- package/ui/www/fonts/ZMPIcons-Regular.ttf +0 -0
- package/ui/www/fonts/ZMPIcons-Regular.woff +0 -0
- package/ui/www/fonts/ZMPIcons-Regular.woff2 +0 -0
- package/ui/www/images/logo.png +0 -0
- package/ui/www/index.html +0 -1
- package/ui/www/js/app.js +0 -3
- package/ui/www/js/app.js.LICENSE.txt +0 -20
- package/ui/www/js/app.js.map +0 -1
- package/ui/www/static/icons/apple-touch-icon.png +0 -0
- package/ui/www/static/icons/favicon.png +0 -0
- package/utils/dist/get-app-info.dev.js +0 -54
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""
|
package/build/index.js
CHANGED
|
@@ -1,184 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint no-console: off */
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const ora = require('ora');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const { build } = require('vite');
|
|
7
|
-
const dynamicImportVars = require('@rollup/plugin-dynamic-import-vars').default;
|
|
8
|
-
const _ = require('lodash');
|
|
9
|
-
const replace = require('@rollup/plugin-replace');
|
|
10
|
-
const log = require('../utils/log');
|
|
11
|
-
const fse = require('../utils/fs-extra');
|
|
12
|
-
const getAppInfo = require('../utils/get-app-info');
|
|
13
|
-
const envUtils = require('../utils/env');
|
|
14
|
-
const config = require('../config');
|
|
15
|
-
const generatePagesMap = require('../utils/generate-pages-map');
|
|
16
|
-
|
|
17
|
-
const env = envUtils.getEnv('NODE_ENV') || 'production';
|
|
18
|
-
|
|
19
|
-
const waitText = chalk.gray('Building... (Please wait, it can take a while)');
|
|
20
|
-
const frameworkWarning = chalk.yellow(
|
|
21
|
-
'Warning: This CLI version will work better with zmp-framework version 1.5.0 or higher'
|
|
22
|
-
);
|
|
23
|
-
const spinner = ora(
|
|
24
|
-
env === 'production'
|
|
25
|
-
? 'Building for production...'
|
|
26
|
-
: 'Building development version...'
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
|
|
30
|
-
const cwd = options.cwd || process.cwd();
|
|
31
|
-
const resolvePath = (dir) => {
|
|
32
|
-
return path.join(cwd, dir);
|
|
33
|
-
};
|
|
34
|
-
const appConfig =
|
|
35
|
-
options.appConfigJson || require(resolvePath(config.filename.appConfig));
|
|
36
|
-
function errorExit(err) {
|
|
37
|
-
log.error(err.stderr || err);
|
|
38
|
-
if (exitOnError) process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
if (!logger) {
|
|
41
|
-
// eslint-disable-next-line
|
|
42
|
-
logger = {
|
|
43
|
-
statusStart() {},
|
|
44
|
-
statusDone() {},
|
|
45
|
-
statusError() {},
|
|
46
|
-
text() {},
|
|
47
|
-
error() {},
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
logger.text(frameworkWarning);
|
|
51
|
-
spinner.start();
|
|
52
|
-
logger.statusStart(waitText);
|
|
53
|
-
try {
|
|
54
|
-
const appId = envUtils.getEnv(config.env.appId);
|
|
55
|
-
let nextVersion = options.nextVersion;
|
|
56
|
-
if (!nextVersion) {
|
|
57
|
-
const appInfo = await getAppInfo(appId, options);
|
|
58
|
-
let currentVersion =
|
|
59
|
-
appInfo && appInfo.latestVersion && Number(appInfo.latestVersion);
|
|
60
|
-
if (currentVersion === undefined || currentVersion === null) {
|
|
61
|
-
currentVersion = 0;
|
|
62
|
-
}
|
|
63
|
-
nextVersion = currentVersion + 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let viteConfig = 'vite.config.js';
|
|
67
|
-
const isTypeScriptProject = fse.existsSync(
|
|
68
|
-
path.join(cwd, 'vite.config.ts')
|
|
69
|
-
);
|
|
70
|
-
if (isTypeScriptProject) {
|
|
71
|
-
viteConfig = 'vite.config.ts';
|
|
72
|
-
}
|
|
73
|
-
// eslint-disable-next-line
|
|
74
|
-
const res = await build({
|
|
75
|
-
configFile: path.join(cwd, viteConfig),
|
|
76
|
-
root: cwd,
|
|
77
|
-
base: `${config.zdn_url}${appId}/${nextVersion}/`,
|
|
78
|
-
css: {
|
|
79
|
-
modules: {
|
|
80
|
-
scopeBehaviour: 'local',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
mode: options.mode,
|
|
84
|
-
build: {
|
|
85
|
-
target: 'es2015',
|
|
86
|
-
outDir: path.join(cwd, 'www'),
|
|
87
|
-
assetsInlineLimit: 0,
|
|
88
|
-
cssCodeSplit: false,
|
|
89
|
-
cssTarget: ['es2015', 'safari13.1'],
|
|
90
|
-
rollupOptions: {
|
|
91
|
-
plugins: [
|
|
92
|
-
replace({
|
|
93
|
-
values: {
|
|
94
|
-
ZMP_IMPORT_PAGES: () => generatePagesMap(cwd),
|
|
95
|
-
},
|
|
96
|
-
}),
|
|
97
|
-
dynamicImportVars({
|
|
98
|
-
warnOnError: true,
|
|
99
|
-
}),
|
|
100
|
-
],
|
|
101
|
-
output: {
|
|
102
|
-
entryFileNames: 'assets/[name].[hash].module.js',
|
|
103
|
-
chunkFileNames: 'assets/[name].[hash].module.js',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
logLevel: 'error',
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
const output = res.output.map((obj) =>
|
|
111
|
-
_.pick(obj, [
|
|
112
|
-
'fileName',
|
|
113
|
-
'type',
|
|
114
|
-
'imports',
|
|
115
|
-
'isEntry',
|
|
116
|
-
'isImplicitEntry',
|
|
117
|
-
'isDynamicEntry',
|
|
118
|
-
])
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
const outputMap = new Map();
|
|
122
|
-
output.forEach((obj) => {
|
|
123
|
-
outputMap.set(obj.fileName, obj);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// Entry files, cần đc load sync bằng thẻ script
|
|
127
|
-
const jsFiles = output.filter((file) => {
|
|
128
|
-
return file.type === 'chunk' && file.isEntry;
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
// Các file cần preload
|
|
132
|
-
const modulePreloadFiles = [];
|
|
133
|
-
const getImportedChunks = (chunk, seen = new Set()) => {
|
|
134
|
-
const chunks = [];
|
|
135
|
-
chunk.imports.forEach((file) => {
|
|
136
|
-
const importee = outputMap.get(file);
|
|
137
|
-
if (importee?.type === 'chunk' && !seen.has(file)) {
|
|
138
|
-
seen.add(file);
|
|
139
|
-
chunks.push(...getImportedChunks(importee, seen));
|
|
140
|
-
chunks.push(importee);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
return chunks;
|
|
144
|
-
};
|
|
145
|
-
jsFiles.forEach((file) => {
|
|
146
|
-
const chunks = getImportedChunks(file);
|
|
147
|
-
modulePreloadFiles.push(...chunks);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
const cssFiles = output.filter((file) => {
|
|
151
|
-
if (file.type !== 'asset' || !file.fileName.endsWith('.css'))
|
|
152
|
-
return false;
|
|
153
|
-
// const name = file.fileName.replace(/\.([a-z0-9]{8})\.css$/, '');
|
|
154
|
-
// if (!jsFiles.find((js) => js.fileName.startsWith(name))) return false;
|
|
155
|
-
return true;
|
|
156
|
-
});
|
|
157
|
-
const appConfigJson = {
|
|
158
|
-
...appConfig,
|
|
159
|
-
listCSS: [
|
|
160
|
-
...(Array.isArray(appConfig.listCSS) ? appConfig.listCSS : []),
|
|
161
|
-
...cssFiles.map((f) => f.fileName),
|
|
162
|
-
],
|
|
163
|
-
listSyncJS: [
|
|
164
|
-
...(Array.isArray(appConfig.listSyncJS) ? appConfig.listSyncJS : []),
|
|
165
|
-
...jsFiles.map((f) => f.fileName),
|
|
166
|
-
],
|
|
167
|
-
listAsyncJS: [
|
|
168
|
-
...modulePreloadFiles.map((f) => f.fileName),
|
|
169
|
-
...(Array.isArray(appConfig.listAsyncJS) ? appConfig.listAsyncJS : []),
|
|
170
|
-
],
|
|
171
|
-
};
|
|
172
|
-
fse.writeFileSync(
|
|
173
|
-
resolvePath(`www/${config.filename.appConfig}`),
|
|
174
|
-
JSON.stringify(appConfigJson)
|
|
175
|
-
);
|
|
176
|
-
logger.statusDone(`${chalk.bold.green('Build Done!\n')}`);
|
|
177
|
-
return appConfigJson;
|
|
178
|
-
} catch (err) {
|
|
179
|
-
logger.statusError('Error building project');
|
|
180
|
-
// if (err) logger.error(err.stderr || err);
|
|
181
|
-
errorExit(err);
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
};
|
|
1
|
+
'use strict';const _0x5bf821=_0x5cad;function _0x5cad(_0x281927,_0x508ab9){const _0x2dc965=_0x2dc9();return _0x5cad=function(_0x5cad7c,_0x4a2a52){_0x5cad7c=_0x5cad7c-0x18b;let _0x1e6002=_0x2dc965[_0x5cad7c];return _0x1e6002;},_0x5cad(_0x281927,_0x508ab9);}(function(_0x44451a,_0x256e92){const _0x280eea=_0x5cad,_0x5af058=_0x44451a();while(!![]){try{const _0x17e0a9=-parseInt(_0x280eea(0x18d))/0x1*(-parseInt(_0x280eea(0x1ba))/0x2)+parseInt(_0x280eea(0x1cd))/0x3+parseInt(_0x280eea(0x1af))/0x4+-parseInt(_0x280eea(0x1d3))/0x5*(-parseInt(_0x280eea(0x18e))/0x6)+-parseInt(_0x280eea(0x1c3))/0x7*(parseInt(_0x280eea(0x1cc))/0x8)+parseInt(_0x280eea(0x1a0))/0x9*(-parseInt(_0x280eea(0x1bc))/0xa)+-parseInt(_0x280eea(0x1a6))/0xb;if(_0x17e0a9===_0x256e92)break;else _0x5af058['push'](_0x5af058['shift']());}catch(_0x4d18e0){_0x5af058['push'](_0x5af058['shift']());}}}(_0x2dc9,0xe26ba));function _0x2dc9(){const _0x2fb43f=['listAsyncJS','latestVersion','writeFileSync','Building...\x20(Please\x20wait,\x20it\x20can\x20take\x20a\x20while)','appConfigJson','4068elpARB','../utils/generate-pages-map','start','lodash','green','getEnv','6265655xsamIP','isImplicitEntry','../utils/log','@rollup/plugin-dynamic-import-vars','existsSync','path','env','mode','exit','4517136BnbWrh','endsWith','assets/[name].[hash].module.js','forEach','join','production','es2015','Building\x20development\x20version...','zdn_url','text','error','854834ohulst','../utils/fs-extra','21880tdrHlR','type','stringify','cwd','pick','statusStart','www/','7goafyu','appConfig','NODE_ENV','vite.config.js','filter','@rollup/plugin-replace','listSyncJS','Warning:\x20This\x20CLI\x20version\x20will\x20work\x20better\x20with\x20zmp-framework\x20version\x201.5.0\x20or\x20higher','Building\x20for\x20production...','4501064YSZqaL','4231776xMKndx','appId','isEntry','yellow','map','chunk','5MTGoua','fileName','isArray','gray','vite','nextVersion','1pfnOJj','488034iPeWEm','imports','statusError','default','vite.config.ts','output','has','safari13.1','push','exports','bold','listCSS','../utils/get-app-info'];_0x2dc9=function(){return _0x2fb43f;};return _0x2dc9();}const e=require('chalk'),r=require('ora'),t=require(_0x5bf821(0x1ab)),{build:i}=require(_0x5bf821(0x18b)),s=require(_0x5bf821(0x1a9))[_0x5bf821(0x191)],a=require(_0x5bf821(0x1a3)),l=require(_0x5bf821(0x1c8)),n=require(_0x5bf821(0x1a8)),o=require(_0x5bf821(0x1bb)),u=require(_0x5bf821(0x19a)),p=require('../utils/env'),c=require('../config'),m=require(_0x5bf821(0x1a1)),g=p[_0x5bf821(0x1a5)](_0x5bf821(0x1c5))||_0x5bf821(0x1b4),y=e[_0x5bf821(0x1d6)](_0x5bf821(0x19e)),d=e[_0x5bf821(0x1d0)](_0x5bf821(0x1ca)),f=r(_0x5bf821(0x1b4)===g?_0x5bf821(0x1cb):_0x5bf821(0x1b6));module[_0x5bf821(0x197)]=async(_0x12eccd={},_0x372ae7,{exitOnError:_0x299ab1=!0x0}={})=>{const _0x1911ed=_0x5bf821;let _0x266b70=_0x12eccd['cwd']||process[_0x1911ed(0x1bf)](),_0x3de071=_0x1d9fde=>t['join'](_0x266b70,_0x1d9fde),_0x382085=_0x12eccd[_0x1911ed(0x19f)]||require(_0x3de071(c['filename'][_0x1911ed(0x1c4)]));_0x372ae7||(_0x372ae7={'statusStart'(){},'statusDone'(){},'statusError'(){},'text'(){},'error'(){}}),_0x372ae7[_0x1911ed(0x1b8)](d),f[_0x1911ed(0x1a2)](),_0x372ae7[_0x1911ed(0x1c1)](y);try{let _0x124f54=p[_0x1911ed(0x1a5)](c[_0x1911ed(0x1ac)][_0x1911ed(0x1ce)]),_0x1e8c55=_0x12eccd[_0x1911ed(0x18c)];if(!_0x1e8c55){let _0x47e16d=await u(_0x124f54,_0x12eccd),_0x204200=_0x47e16d&&_0x47e16d[_0x1911ed(0x19c)]&&Number(_0x47e16d[_0x1911ed(0x19c)]);null==_0x204200&&(_0x204200=0x0),_0x1e8c55=_0x204200+0x1;}let _0x31ec71=_0x1911ed(0x1c6);o[_0x1911ed(0x1aa)](t[_0x1911ed(0x1b3)](_0x266b70,_0x1911ed(0x192)))&&(_0x31ec71='vite.config.ts');let _0x2497c7=(await i({'configFile':t[_0x1911ed(0x1b3)](_0x266b70,_0x31ec71),'root':_0x266b70,'base':''+c[_0x1911ed(0x1b7)]+_0x124f54+'/'+_0x1e8c55+'/','css':{'modules':{'scopeBehaviour':'local'}},'mode':_0x12eccd[_0x1911ed(0x1ad)],'build':{'target':_0x1911ed(0x1b5),'outDir':t[_0x1911ed(0x1b3)](_0x266b70,'www'),'assetsInlineLimit':0x0,'cssCodeSplit':!0x1,'cssTarget':[_0x1911ed(0x1b5),_0x1911ed(0x195)],'rollupOptions':{'plugins':[l({'values':{'ZMP_IMPORT_PAGES':()=>m(_0x266b70)}}),s({'warnOnError':!0x0})],'output':{'entryFileNames':_0x1911ed(0x1b1),'chunkFileNames':_0x1911ed(0x1b1)}}},'logLevel':_0x1911ed(0x1b9)}))[_0x1911ed(0x193)][_0x1911ed(0x1d1)](_0x19de06=>a[_0x1911ed(0x1c0)](_0x19de06,[_0x1911ed(0x1d4),'type',_0x1911ed(0x18f),_0x1911ed(0x1cf),_0x1911ed(0x1a7),'isDynamicEntry'])),_0x1a7a07=new Map();_0x2497c7[_0x1911ed(0x1b2)](_0x3ad150=>{_0x1a7a07['set'](_0x3ad150['fileName'],_0x3ad150);});let _0x4a885e=_0x2497c7[_0x1911ed(0x1c7)](_0x431d6d=>_0x1911ed(0x1d2)===_0x431d6d[_0x1911ed(0x1bd)]&&_0x431d6d['isEntry']),_0x3f9b31=[],_0x5cff5f=(_0x1e9fd5,_0x375dd7=new Set())=>{const _0x590b62=_0x1911ed;let _0x183c38=[];return _0x1e9fd5[_0x590b62(0x18f)][_0x590b62(0x1b2)](_0x9c49ca=>{const _0x4856c2=_0x590b62;let _0x5de527=_0x1a7a07['get'](_0x9c49ca);_0x5de527?.[_0x4856c2(0x1bd)]!==_0x4856c2(0x1d2)||_0x375dd7[_0x4856c2(0x194)](_0x9c49ca)||(_0x375dd7['add'](_0x9c49ca),_0x183c38['push'](..._0x5cff5f(_0x5de527,_0x375dd7)),_0x183c38[_0x4856c2(0x196)](_0x5de527));}),_0x183c38;};_0x4a885e['forEach'](_0x25f48e=>{let _0x4e52b5=_0x5cff5f(_0x25f48e);_0x3f9b31['push'](..._0x4e52b5);});let _0x564eb2=_0x2497c7['filter'](_0x3a2002=>!!('asset'===_0x3a2002[_0x1911ed(0x1bd)]&&_0x3a2002[_0x1911ed(0x1d4)][_0x1911ed(0x1b0)]('.css'))),_0x3c5683={..._0x382085,'listCSS':[...Array[_0x1911ed(0x1d5)](_0x382085[_0x1911ed(0x199)])?_0x382085['listCSS']:[],..._0x564eb2[_0x1911ed(0x1d1)](_0x3f0958=>_0x3f0958[_0x1911ed(0x1d4)])],'listSyncJS':[...Array[_0x1911ed(0x1d5)](_0x382085[_0x1911ed(0x1c9)])?_0x382085[_0x1911ed(0x1c9)]:[],..._0x4a885e[_0x1911ed(0x1d1)](_0x383b30=>_0x383b30[_0x1911ed(0x1d4)])],'listAsyncJS':[..._0x3f9b31[_0x1911ed(0x1d1)](_0x18f093=>_0x18f093[_0x1911ed(0x1d4)]),...Array[_0x1911ed(0x1d5)](_0x382085[_0x1911ed(0x19b)])?_0x382085[_0x1911ed(0x19b)]:[]]};return o[_0x1911ed(0x19d)](_0x3de071(_0x1911ed(0x1c2)+c['filename'][_0x1911ed(0x1c4)]),JSON[_0x1911ed(0x1be)](_0x3c5683)),_0x372ae7['statusDone'](''+e[_0x1911ed(0x198)][_0x1911ed(0x1a4)]('Build\x20Done!\x0a')),_0x3c5683;}catch(_0x173c77){_0x372ae7[_0x1911ed(0x190)]('Error\x20building\x20project'),n[_0x1911ed(0x1b9)](_0x173c77['stderr']||_0x173c77),_0x299ab1&&process[_0x1911ed(0x1ae)](0x1);return;}};
|
package/config/index.js
CHANGED
|
@@ -1,44 +1 @@
|
|
|
1
|
-
|
|
2
|
-
filename: {
|
|
3
|
-
appConfig: 'app-config.json',
|
|
4
|
-
zmpConfig: 'zmp-cli.json',
|
|
5
|
-
packageJson: 'package.json',
|
|
6
|
-
},
|
|
7
|
-
api_domain: 'https://zmp-api.developers.zalo.me/',
|
|
8
|
-
zdn_url: '//h5.zdn.vn/zapps/',
|
|
9
|
-
path: {
|
|
10
|
-
login: 'admin/login',
|
|
11
|
-
requestLogin: 'admin/request-login',
|
|
12
|
-
checkLoginStatus: 'admin/get-login-status',
|
|
13
|
-
// uploadApp: 'admin/upload-app',
|
|
14
|
-
uploadAppByChunk: 'app/upload-chunk',
|
|
15
|
-
requestUploadResumable: 'app/request-upload',
|
|
16
|
-
getAppInfo: 'app/get-info',
|
|
17
|
-
},
|
|
18
|
-
dirname: __dirname,
|
|
19
|
-
root_env: () => `${process.cwd()}/.env`,
|
|
20
|
-
env: {
|
|
21
|
-
appId: 'APP_ID',
|
|
22
|
-
token: 'ZMP_TOKEN',
|
|
23
|
-
},
|
|
24
|
-
error_code: {
|
|
25
|
-
app_config_not_found: -1400,
|
|
26
|
-
permission_denied: -2001,
|
|
27
|
-
request_timeout: -2003,
|
|
28
|
-
},
|
|
29
|
-
error_msg: {
|
|
30
|
-
app_config_not_found:
|
|
31
|
-
"App config not found. Please re-init project. (Tips: Run 'zmp init')",
|
|
32
|
-
permission_denied:
|
|
33
|
-
"Permission denied. Please login again. (Tips: Run 'zmp login')",
|
|
34
|
-
request_timeout: 'Request Timeout',
|
|
35
|
-
},
|
|
36
|
-
resumable_option: {
|
|
37
|
-
chunkSize: 512 * 1000, // bytes -> 512kb/chunk
|
|
38
|
-
simultaneousUploads: 4,
|
|
39
|
-
testChunks: true,
|
|
40
|
-
throttleProgressCallbacks: 1,
|
|
41
|
-
method: 'octet',
|
|
42
|
-
forceChunkSize: false,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
1
|
+
'use strict';function _0x5a0e(){var _0x34df91=['1qbpCYm','1075660YjkVzz','octet','app/request-upload','app/get-info','470748wirGrI','5013zbMwVn','7124403nNXEgd','10GXduwV','app/upload-chunk','12JWvGhP','zmp-cli.json','Request\x20Timeout','package.json','//h5.zdn.vn/zapps/','/.env','24qAzyMh','7OxapkQ','Permission\x20denied.\x20Please\x20login\x20again.\x20(Tips:\x20Run\x20\x27zmp\x20login\x27)','4344dcbRNX','870485kiUElL','355116JOecgz','admin/login','4939561nRBddk','App\x20config\x20not\x20found.\x20Please\x20re-init\x20project.\x20(Tips:\x20Run\x20\x27zmp\x20init\x27)','app-config.json','admin/get-login-status','ZMP_TOKEN','admin/request-login'];_0x5a0e=function(){return _0x34df91;};return _0x5a0e();}function _0x1d19(_0x4a5c21,_0x5456a2){var _0x5a0e57=_0x5a0e();return _0x1d19=function(_0x1d1926,_0x3b1a68){_0x1d1926=_0x1d1926-0x123;var _0x383efb=_0x5a0e57[_0x1d1926];return _0x383efb;},_0x1d19(_0x4a5c21,_0x5456a2);}var _0x15ffa5=_0x1d19;(function(_0x2efb9e,_0x27825a){var _0x89dae9=_0x1d19,_0xaf8f62=_0x2efb9e();while(!![]){try{var _0x31f415=-parseInt(_0x89dae9(0x134))/0x1*(parseInt(_0x89dae9(0x135))/0x2)+-parseInt(_0x89dae9(0x139))/0x3*(-parseInt(_0x89dae9(0x13e))/0x4)+parseInt(_0x89dae9(0x12b))/0x5+parseInt(_0x89dae9(0x12c))/0x6*(-parseInt(_0x89dae9(0x128))/0x7)+-parseInt(_0x89dae9(0x12a))/0x8*(parseInt(_0x89dae9(0x13a))/0x9)+parseInt(_0x89dae9(0x13c))/0xa*(-parseInt(_0x89dae9(0x12e))/0xb)+parseInt(_0x89dae9(0x127))/0xc*(parseInt(_0x89dae9(0x13b))/0xd);if(_0x31f415===_0x27825a)break;else _0xaf8f62['push'](_0xaf8f62['shift']());}catch(_0x39b220){_0xaf8f62['push'](_0xaf8f62['shift']());}}}(_0x5a0e,0x5fcc5));module['exports']={'filename':{'appConfig':_0x15ffa5(0x130),'zmpConfig':_0x15ffa5(0x13f),'packageJson':_0x15ffa5(0x124)},'api_domain':'https://zmp-api.developers.zalo.me/','zdn_url':_0x15ffa5(0x125),'path':{'login':_0x15ffa5(0x12d),'requestLogin':_0x15ffa5(0x133),'checkLoginStatus':_0x15ffa5(0x131),'uploadAppByChunk':_0x15ffa5(0x13d),'requestUploadResumable':_0x15ffa5(0x137),'getAppInfo':_0x15ffa5(0x138)},'dirname':__dirname,'root_env':()=>process['cwd']()+_0x15ffa5(0x126),'env':{'appId':'APP_ID','token':_0x15ffa5(0x132)},'error_code':{'app_config_not_found':-0x578,'permission_denied':-0x7d1,'request_timeout':-0x7d3},'error_msg':{'app_config_not_found':_0x15ffa5(0x12f),'permission_denied':_0x15ffa5(0x129),'request_timeout':_0x15ffa5(0x123)},'resumable_option':{'chunkSize':0x7d000,'simultaneousUploads':0x4,'testChunks':!0x0,'throttleProgressCallbacks':0x1,'method':_0x15ffa5(0x136),'forceChunkSize':!0x1}};
|
package/create/index.js
CHANGED
|
@@ -1,230 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint no-console: off */
|
|
3
|
-
const exec = require('exec-sh');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const chalk = require('chalk');
|
|
6
|
-
const logSymbols = require('log-symbols');
|
|
7
|
-
const fse = require('../utils/fs-extra');
|
|
8
|
-
const generatePackageJson = require('./utils/generate-package-json');
|
|
9
|
-
const generateNpmScripts = require('./utils/generate-npm-scripts');
|
|
10
|
-
const { generateTailWindScripts } = require('./utils/generate-npm-scripts');
|
|
11
|
-
|
|
12
|
-
const generateAppConfig = require('./utils/generate-app-config');
|
|
13
|
-
|
|
14
|
-
const createFolders = require('./templates/create-folders');
|
|
15
|
-
const copyAssets = require('./templates/copy-assets');
|
|
16
|
-
const generateReadme = require('./utils/generate-readme');
|
|
17
|
-
const generateGitignore = require('./utils/generate-gitignore');
|
|
18
|
-
const log = require('../utils/log');
|
|
19
|
-
const config = require('../config');
|
|
20
|
-
const initZMPUI = require('./init-zmp-ui');
|
|
21
|
-
|
|
22
|
-
const waitText = chalk.gray('(Please wait, it can take a while)');
|
|
23
|
-
|
|
24
|
-
module.exports = async (
|
|
25
|
-
options = {},
|
|
26
|
-
logger,
|
|
27
|
-
{ exitOnError = true, iconFile = null } = {}
|
|
28
|
-
) => {
|
|
29
|
-
if (options.newProject && options.package === 'zmp-ui') {
|
|
30
|
-
await initZMPUI(options, logger);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const cwd = options.cwd || process.cwd();
|
|
34
|
-
const isRunningInCwd = cwd === process.cwd();
|
|
35
|
-
function errorExit(err) {
|
|
36
|
-
log.error(err.stderr || err);
|
|
37
|
-
if (exitOnError) process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
if (!logger) {
|
|
40
|
-
// eslint-disable-next-line
|
|
41
|
-
logger = {
|
|
42
|
-
statusStart() {},
|
|
43
|
-
statusDone() {},
|
|
44
|
-
statusError() {},
|
|
45
|
-
text() {},
|
|
46
|
-
error() {},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
// App config
|
|
50
|
-
logger.statusStart('Generating app-config.json');
|
|
51
|
-
const appConfig = generateAppConfig(options);
|
|
52
|
-
|
|
53
|
-
fse.writeFileSync(
|
|
54
|
-
path.join(cwd, config.filename.appConfig),
|
|
55
|
-
appConfig.content
|
|
56
|
-
);
|
|
57
|
-
logger.statusDone('Generating app-config.json');
|
|
58
|
-
|
|
59
|
-
if (!options.newProject) {
|
|
60
|
-
const deployScripts = generateNpmScripts(['r']).map((s) => {
|
|
61
|
-
return `${s.icon} Run "npm run ${s.name}" - ${s.description}`;
|
|
62
|
-
});
|
|
63
|
-
logger.text(deployScripts.join('\n'));
|
|
64
|
-
process.exit(0);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Package
|
|
68
|
-
logger.statusStart('Generating package.json');
|
|
69
|
-
const packageJson = generatePackageJson(options);
|
|
70
|
-
|
|
71
|
-
fse.writeFileSync(path.join(cwd, 'package.json'), packageJson.content);
|
|
72
|
-
fse.writeFileSync(
|
|
73
|
-
path.join(cwd, config.filename.zmpConfig),
|
|
74
|
-
JSON.stringify(options, '', 2)
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
logger.statusDone('Generating package.json');
|
|
78
|
-
|
|
79
|
-
// Create Folders
|
|
80
|
-
logger.statusStart('Creating required folders structure');
|
|
81
|
-
try {
|
|
82
|
-
createFolders(options);
|
|
83
|
-
} catch (err) {
|
|
84
|
-
logger.statusError('Error creating required folders structure');
|
|
85
|
-
// if (err) logger.error(err.stderr);
|
|
86
|
-
errorExit(err);
|
|
87
|
-
}
|
|
88
|
-
logger.statusDone('Creating required folders structure');
|
|
89
|
-
|
|
90
|
-
// Install NPM depenencies
|
|
91
|
-
logger.statusStart(`${'Installing NPM Dependencies'} ${waitText}`);
|
|
92
|
-
try {
|
|
93
|
-
if (!isRunningInCwd) {
|
|
94
|
-
await exec.promise(
|
|
95
|
-
`cd ${cwd.replace(
|
|
96
|
-
/ /g,
|
|
97
|
-
'\\ '
|
|
98
|
-
)} && npm install ${packageJson.dependencies.join(' ')} --save`,
|
|
99
|
-
true
|
|
100
|
-
);
|
|
101
|
-
} else {
|
|
102
|
-
await exec.promise(
|
|
103
|
-
`npm install ${packageJson.dependencies.join(' ')} --save`,
|
|
104
|
-
true
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
} catch (err) {
|
|
108
|
-
logger.statusError('Error installing NPM Dependencies');
|
|
109
|
-
// if (err) logger.error(err.stderr);
|
|
110
|
-
errorExit(err);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
logger.statusDone('Installing NPM Dependencies');
|
|
114
|
-
// Install NPM dev depenencies
|
|
115
|
-
logger.statusStart(`${'Installing NPM Dev Dependencies'} ${waitText}`);
|
|
116
|
-
try {
|
|
117
|
-
if (!isRunningInCwd) {
|
|
118
|
-
await exec.promise(
|
|
119
|
-
`cd ${cwd.replace(
|
|
120
|
-
/ /g,
|
|
121
|
-
'\\ '
|
|
122
|
-
)} && npm install ${packageJson.devDependencies.join(' ')} --save-dev`,
|
|
123
|
-
true
|
|
124
|
-
);
|
|
125
|
-
} else {
|
|
126
|
-
await exec.promise(
|
|
127
|
-
`npm install ${packageJson.devDependencies.join(' ')} --save-dev`,
|
|
128
|
-
true
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
} catch (err) {
|
|
132
|
-
logger.statusError('Error installing NPM Dev Dependencies');
|
|
133
|
-
// if (err) logger.error(err.stderr);
|
|
134
|
-
errorExit(err);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
logger.statusDone('Installing NPM Dev Dependencies');
|
|
138
|
-
|
|
139
|
-
if (packageJson.postInstall && packageJson.postInstall.length) {
|
|
140
|
-
logger.statusStart('Executing NPM Scripts');
|
|
141
|
-
try {
|
|
142
|
-
if (!isRunningInCwd) {
|
|
143
|
-
await exec.promise(
|
|
144
|
-
`cd ${cwd.replace(/ /g, '\\ ')} && npm run postinstall`,
|
|
145
|
-
true
|
|
146
|
-
);
|
|
147
|
-
} else {
|
|
148
|
-
await exec.promise('npm run postinstall', true);
|
|
149
|
-
}
|
|
150
|
-
} catch (err) {
|
|
151
|
-
logger.statusError('Error executing NPM Scripts');
|
|
152
|
-
// if (err) logger.error(err.stderr);
|
|
153
|
-
errorExit(err);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
logger.statusDone('Executing NPM Scripts');
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Create Project Files
|
|
160
|
-
logger.statusStart('Creating project files');
|
|
161
|
-
const filesToCopy = copyAssets(options, iconFile);
|
|
162
|
-
try {
|
|
163
|
-
// eslint-disable-next-line
|
|
164
|
-
await Promise.all(
|
|
165
|
-
filesToCopy.map((f) => {
|
|
166
|
-
if (f.from) {
|
|
167
|
-
return fse.copyFileAsync(f.from, f.to);
|
|
168
|
-
}
|
|
169
|
-
if (f.content) {
|
|
170
|
-
return fse.writeFileAsync(f.to, f.content);
|
|
171
|
-
}
|
|
172
|
-
return Promise.resolve();
|
|
173
|
-
})
|
|
174
|
-
);
|
|
175
|
-
} catch (err) {
|
|
176
|
-
logger.statusError('Error creating project files');
|
|
177
|
-
// if (err) logger.error(err.stderr || err);
|
|
178
|
-
errorExit(err);
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Generate Readme
|
|
183
|
-
const readMeContent = generateReadme(options);
|
|
184
|
-
try {
|
|
185
|
-
fse.writeFileSync(path.join(cwd, 'README.md'), readMeContent);
|
|
186
|
-
} catch (err) {
|
|
187
|
-
logger.statusError('Error creating project files');
|
|
188
|
-
// if (err) logger.error(err.stderr || err);
|
|
189
|
-
errorExit(err);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Generate .gitignore
|
|
194
|
-
const gitignoreContent = generateGitignore(options);
|
|
195
|
-
try {
|
|
196
|
-
fse.writeFileSync(path.join(cwd, '.gitignore'), gitignoreContent);
|
|
197
|
-
} catch (err) {
|
|
198
|
-
logger.statusError('Error creating project files');
|
|
199
|
-
// if (err) logger.error(err.stderr || err);
|
|
200
|
-
errorExit(err);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
logger.statusDone('Creating project files');
|
|
205
|
-
|
|
206
|
-
let npmScripts = generateNpmScripts(['s', 'r']).map((s) => {
|
|
207
|
-
return `- ${s.icon} Run "npm run ${s.name}" - ${s.description}`;
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
if (options.includeTailwind) {
|
|
211
|
-
const tailwindScript = generateTailWindScripts(['t']).map((s) => {
|
|
212
|
-
return `- ${s.icon} Run "npm run ${s.name}" - ${s.description}`;
|
|
213
|
-
});
|
|
214
|
-
npmScripts = [...npmScripts, ...tailwindScript];
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Final Text
|
|
218
|
-
const finalText = `
|
|
219
|
-
${chalk.bold(logSymbols.success)} ${chalk.bold('Done!')} 💪
|
|
220
|
-
|
|
221
|
-
${chalk.bold(logSymbols.info)} ${chalk.bold('Next steps:')}
|
|
222
|
-
${npmScripts.join('\n ')}
|
|
223
|
-
- 📖 Visit documentation at ${chalk.bold('https://mini.zalo.me/')}
|
|
224
|
-
- 📖 Check ${chalk.bold(
|
|
225
|
-
'README.md'
|
|
226
|
-
)} in project root folder with further instructions
|
|
227
|
-
`;
|
|
228
|
-
|
|
229
|
-
logger.text(finalText);
|
|
230
|
-
};
|
|
1
|
+
'use strict';function _0x26c2(_0x32463e,_0x3e021a){const _0x3fb2d3=_0x3fb2();return _0x26c2=function(_0x26c2fb,_0x2af637){_0x26c2fb=_0x26c2fb-0x1a0;let _0x55cda3=_0x3fb2d3[_0x26c2fb];return _0x55cda3;},_0x26c2(_0x32463e,_0x3e021a);}const _0x16d836=_0x26c2;(function(_0x4c9429,_0x329996){const _0x30eee9=_0x26c2,_0x407eb3=_0x4c9429();while(!![]){try{const _0x1c21be=parseInt(_0x30eee9(0x1b1))/0x1*(parseInt(_0x30eee9(0x1f4))/0x2)+-parseInt(_0x30eee9(0x1ee))/0x3*(-parseInt(_0x30eee9(0x1bc))/0x4)+-parseInt(_0x30eee9(0x1fa))/0x5*(-parseInt(_0x30eee9(0x1c3))/0x6)+parseInt(_0x30eee9(0x1f3))/0x7+-parseInt(_0x30eee9(0x1bb))/0x8*(parseInt(_0x30eee9(0x1af))/0x9)+parseInt(_0x30eee9(0x1ad))/0xa*(parseInt(_0x30eee9(0x1ba))/0xb)+-parseInt(_0x30eee9(0x1a9))/0xc*(parseInt(_0x30eee9(0x1eb))/0xd);if(_0x1c21be===_0x329996)break;else _0x407eb3['push'](_0x407eb3['shift']());}catch(_0x46ba91){_0x407eb3['push'](_0x407eb3['shift']());}}}(_0x3fb2,0x731bb));const e=require('exec-sh'),t=require('path'),r=require(_0x16d836(0x1a8)),n=require(_0x16d836(0x1e9)),i=require('../utils/fs-extra'),s=require(_0x16d836(0x1d2)),a=require('./utils/generate-npm-scripts'),{generateTailWindScripts:o}=require('./utils/generate-npm-scripts'),c=require(_0x16d836(0x1cf)),l=require(_0x16d836(0x1f7)),u=require(_0x16d836(0x1b5)),p=require('./utils/generate-readme'),g=require(_0x16d836(0x1c8)),d=require(_0x16d836(0x1cb)),m=require(_0x16d836(0x1ab)),f=require(_0x16d836(0x1e3)),j=r[_0x16d836(0x1bd)](_0x16d836(0x1aa));function _0x3fb2(){const _0x5f0e19=['./utils/generate-app-config','statusStart','\x20&&\x20npm\x20install\x20','./utils/generate-package-json','\x0a\x20\x20-\x20📖\x20Check\x20','zmp-ui','newProject','Creating\x20required\x20folders\x20structure','Error\x20installing\x20NPM\x20Dependencies','Installing\x20NPM\x20Dev\x20Dependencies\x20','name','Generating\x20app-config.json','Generating\x20package.json','appConfig','\x20--save','map','dependencies','\x20💪\x0a\x0a','cd\x20','stringify','./init-zmp-ui','description','npm\x20install\x20','error','\x22\x20-\x20','package','log-symbols','writeFileSync','1105pzuzzB','writeFileAsync','Executing\x20NPM\x20Scripts','12QPIPmo','package.json','npm\x20run\x20postinstall','statusError','.gitignore','508536PEqGRJ','18JUAqyq','Error\x20creating\x20required\x20folders\x20structure','README.md','./templates/create-folders','from','includeTailwind','10DgDtcR','Error\x20installing\x20NPM\x20Dev\x20Dependencies','replace','bold','length','all','\x20--save-dev','resolve','Next\x20steps:','chalk','195108XcCHuU','(Please\x20wait,\x20it\x20can\x20take\x20a\x20while)','../config','statusDone','10rsApDZ','devDependencies','27036CazyMU','\x0a\x20\x20','68561SEaZiV','success','\x20in\x20project\x20root\x20folder\x20with\x20further\x20instructions\x0a\x20\x20\x20\x20','\x20Run\x20\x22npm\x20run\x20','./templates/copy-assets','content','filename','cwd','info','9108253vSHasV','1472URSjCG','487700qyrvAU','gray','join','Installing\x20NPM\x20Dependencies','\x0a\x20\x20-\x20📖\x20Visit\x20documentation\x20at\x20','Creating\x20project\x20files','stderr','1202442zEvuyS','exit','postInstall','icon','Error\x20creating\x20project\x20files','./utils/generate-gitignore','Installing\x20NPM\x20Dependencies\x20','\x20&&\x20npm\x20run\x20postinstall','../utils/log','copyFileAsync','promise','text'];_0x3fb2=function(){return _0x5f0e19;};return _0x3fb2();}module['exports']=async(_0x5cb7cf={},_0x4569b0,{exitOnError:_0x2e8889=!0x0,iconFile:_0x345a8a=null}={})=>{const _0x18dd30=_0x16d836;if(_0x5cb7cf[_0x18dd30(0x1d5)]&&_0x18dd30(0x1d4)===_0x5cb7cf[_0x18dd30(0x1e8)]){await f(_0x5cb7cf,_0x4569b0);return;}let _0x2ca657=_0x5cb7cf[_0x18dd30(0x1b8)]||process[_0x18dd30(0x1b8)](),_0x6758f5=_0x2ca657===process[_0x18dd30(0x1b8)]();function _0x3ee263(_0x587024){const _0x18ef54=_0x18dd30;d[_0x18ef54(0x1e6)](_0x587024[_0x18ef54(0x1c2)]||_0x587024),_0x2e8889&&process['exit'](0x1);}_0x4569b0||(_0x4569b0={'statusStart'(){},'statusDone'(){},'statusError'(){},'text'(){},'error'(){}}),_0x4569b0[_0x18dd30(0x1d0)](_0x18dd30(0x1da));let _0x1b81cb=c(_0x5cb7cf);if(i[_0x18dd30(0x1ea)](t['join'](_0x2ca657,m[_0x18dd30(0x1b7)][_0x18dd30(0x1dc)]),_0x1b81cb['content']),_0x4569b0[_0x18dd30(0x1ac)](_0x18dd30(0x1da)),!_0x5cb7cf[_0x18dd30(0x1d5)]){let _0x58e388=a(['r'])[_0x18dd30(0x1de)](_0x36fe5f=>_0x36fe5f['icon']+_0x18dd30(0x1b4)+_0x36fe5f['name']+_0x18dd30(0x1e7)+_0x36fe5f[_0x18dd30(0x1e4)]);_0x4569b0['text'](_0x58e388[_0x18dd30(0x1be)]('\x0a')),process[_0x18dd30(0x1c4)](0x0);}_0x4569b0[_0x18dd30(0x1d0)](_0x18dd30(0x1db));let _0x4245f2=s(_0x5cb7cf);i[_0x18dd30(0x1ea)](t[_0x18dd30(0x1be)](_0x2ca657,_0x18dd30(0x1ef)),_0x4245f2['content']),i[_0x18dd30(0x1ea)](t['join'](_0x2ca657,m[_0x18dd30(0x1b7)]['zmpConfig']),JSON[_0x18dd30(0x1e2)](_0x5cb7cf,'',0x2)),_0x4569b0[_0x18dd30(0x1ac)](_0x18dd30(0x1db)),_0x4569b0['statusStart'](_0x18dd30(0x1d6));try{l(_0x5cb7cf);}catch(_0x5ea3e8){_0x4569b0[_0x18dd30(0x1f1)](_0x18dd30(0x1f5)),_0x3ee263(_0x5ea3e8);}_0x4569b0[_0x18dd30(0x1ac)](_0x18dd30(0x1d6)),_0x4569b0[_0x18dd30(0x1d0)](_0x18dd30(0x1c9)+j);try{_0x6758f5?await e[_0x18dd30(0x1cd)](_0x18dd30(0x1e5)+_0x4245f2['dependencies']['join']('\x20')+_0x18dd30(0x1dd),!0x0):await e[_0x18dd30(0x1cd)](_0x18dd30(0x1e1)+_0x2ca657['replace'](/ /g,'\x5c\x20')+_0x18dd30(0x1d1)+_0x4245f2[_0x18dd30(0x1df)]['join']('\x20')+_0x18dd30(0x1dd),!0x0);}catch(_0x25f3fe){_0x4569b0[_0x18dd30(0x1f1)](_0x18dd30(0x1d7)),_0x3ee263(_0x25f3fe);return;}_0x4569b0[_0x18dd30(0x1ac)](_0x18dd30(0x1bf)),_0x4569b0[_0x18dd30(0x1d0)](_0x18dd30(0x1d8)+j);try{_0x6758f5?await e[_0x18dd30(0x1cd)](_0x18dd30(0x1e5)+_0x4245f2[_0x18dd30(0x1ae)][_0x18dd30(0x1be)]('\x20')+_0x18dd30(0x1a5),!0x0):await e['promise'](_0x18dd30(0x1e1)+_0x2ca657[_0x18dd30(0x1a1)](/ /g,'\x5c\x20')+_0x18dd30(0x1d1)+_0x4245f2['devDependencies']['join']('\x20')+'\x20--save-dev',!0x0);}catch(_0x31d0a5){_0x4569b0['statusError'](_0x18dd30(0x1a0)),_0x3ee263(_0x31d0a5);return;}if(_0x4569b0[_0x18dd30(0x1ac)]('Installing\x20NPM\x20Dev\x20Dependencies'),_0x4245f2[_0x18dd30(0x1c5)]&&_0x4245f2['postInstall'][_0x18dd30(0x1a3)]){_0x4569b0[_0x18dd30(0x1d0)](_0x18dd30(0x1ed));try{_0x6758f5?await e[_0x18dd30(0x1cd)](_0x18dd30(0x1f0),!0x0):await e['promise'](_0x18dd30(0x1e1)+_0x2ca657[_0x18dd30(0x1a1)](/ /g,'\x5c\x20')+_0x18dd30(0x1ca),!0x0);}catch(_0x102d6c){_0x4569b0['statusError']('Error\x20executing\x20NPM\x20Scripts'),_0x3ee263(_0x102d6c);return;}_0x4569b0[_0x18dd30(0x1ac)](_0x18dd30(0x1ed));}_0x4569b0[_0x18dd30(0x1d0)](_0x18dd30(0x1c1));let _0x1792d7=u(_0x5cb7cf,_0x345a8a);try{await Promise[_0x18dd30(0x1a4)](_0x1792d7[_0x18dd30(0x1de)](_0x52e5dd=>_0x52e5dd[_0x18dd30(0x1f8)]?i[_0x18dd30(0x1cc)](_0x52e5dd[_0x18dd30(0x1f8)],_0x52e5dd['to']):_0x52e5dd[_0x18dd30(0x1b6)]?i[_0x18dd30(0x1ec)](_0x52e5dd['to'],_0x52e5dd[_0x18dd30(0x1b6)]):Promise[_0x18dd30(0x1a6)]()));}catch(_0x86679f){_0x4569b0[_0x18dd30(0x1f1)](_0x18dd30(0x1c7)),_0x3ee263(_0x86679f);return;}let _0x4a83af=p(_0x5cb7cf);try{i[_0x18dd30(0x1ea)](t[_0x18dd30(0x1be)](_0x2ca657,_0x18dd30(0x1f6)),_0x4a83af);}catch(_0x239980){_0x4569b0['statusError'](_0x18dd30(0x1c7)),_0x3ee263(_0x239980);return;}let _0x34b7da=g(_0x5cb7cf);try{i['writeFileSync'](t[_0x18dd30(0x1be)](_0x2ca657,_0x18dd30(0x1f2)),_0x34b7da);}catch(_0x22820d){_0x4569b0[_0x18dd30(0x1f1)](_0x18dd30(0x1c7)),_0x3ee263(_0x22820d);return;}_0x4569b0['statusDone'](_0x18dd30(0x1c1));let _0x147432=a(['s','r'])['map'](_0x4f1442=>'-\x20'+_0x4f1442[_0x18dd30(0x1c6)]+_0x18dd30(0x1b4)+_0x4f1442[_0x18dd30(0x1d9)]+_0x18dd30(0x1e7)+_0x4f1442['description']);_0x5cb7cf[_0x18dd30(0x1f9)]&&(_0x147432=[..._0x147432,...o(['t'])[_0x18dd30(0x1de)](_0x18f77b=>'-\x20'+_0x18f77b['icon']+'\x20Run\x20\x22npm\x20run\x20'+_0x18f77b['name']+'\x22\x20-\x20'+_0x18f77b[_0x18dd30(0x1e4)])]);let _0x358705='\x0a'+r[_0x18dd30(0x1a2)](n[_0x18dd30(0x1b2)])+'\x20'+r[_0x18dd30(0x1a2)]('Done!')+_0x18dd30(0x1e0)+r[_0x18dd30(0x1a2)](n[_0x18dd30(0x1b9)])+'\x20'+r[_0x18dd30(0x1a2)](_0x18dd30(0x1a7))+_0x18dd30(0x1b0)+_0x147432['join'](_0x18dd30(0x1b0))+_0x18dd30(0x1c0)+r['bold']('https://mini.zalo.me/')+_0x18dd30(0x1d3)+r[_0x18dd30(0x1a2)](_0x18dd30(0x1f6))+_0x18dd30(0x1b3);_0x4569b0[_0x18dd30(0x1ce)](_0x358705);};
|