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.
- 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 -149
- 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/templates/react/dist/generate-scripts.dev.js +0 -23
- package/create/templates/react-typescript/dist/generate-scripts.dev.js +0 -23
- package/create/utils/dist/get-options.dev.js +0 -277
- package/deploy/dist/index.dev.js +0 -227
- package/deploy/utils/dist/request-upload.dev.js +0 -62
- package/deploy/utils/dist/upload-app.dev.js +0 -113
- package/dist/bundle.js +0 -1
- package/dist/index.dev.js +0 -352
- package/jsconfig.json +0 -8
- package/login/dist/index.dev.js +0 -223
- package/login/utils/dist/zalo-login.dev.js +0 -41
- 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/migrate/index.js
CHANGED
|
@@ -1,60 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint no-console: off */
|
|
3
|
-
|
|
4
|
-
const chalk = require('chalk');
|
|
5
|
-
const log = require('../utils/log');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const envUtils = require('../utils/env');
|
|
8
|
-
const logSymbols = require('log-symbols');
|
|
9
|
-
|
|
10
|
-
const migrateReact = require('./utils/migrate-react');
|
|
11
|
-
const config = require('../config');
|
|
12
|
-
|
|
13
|
-
const waitText = chalk.gray('(Please wait, it can take a while)');
|
|
14
|
-
|
|
15
|
-
async function migrateApp(
|
|
16
|
-
options = {},
|
|
17
|
-
logger,
|
|
18
|
-
{ exitOnError = true, iconFile = null } = {}
|
|
19
|
-
) {
|
|
20
|
-
const cwd = options.cwd || process.cwd();
|
|
21
|
-
const resolvePath = (dir) => {
|
|
22
|
-
return path.join(cwd, dir);
|
|
23
|
-
};
|
|
24
|
-
function errorExit(err) {
|
|
25
|
-
log.error(err.stderr || err);
|
|
26
|
-
if (exitOnError) process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
if (!logger) {
|
|
29
|
-
// eslint-disable-next-line
|
|
30
|
-
logger = {
|
|
31
|
-
statusStart() {},
|
|
32
|
-
statusDone() {},
|
|
33
|
-
statusText() {},
|
|
34
|
-
statusError() {},
|
|
35
|
-
text() {},
|
|
36
|
-
error() {},
|
|
37
|
-
showOnUI() {},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
logger.statusStart(`Migrating Your App ${waitText}`);
|
|
41
|
-
try {
|
|
42
|
-
const zmpConfig = require(resolvePath(config.filename.zmpConfig));
|
|
43
|
-
switch (zmpConfig.framework) {
|
|
44
|
-
case 'react':
|
|
45
|
-
await migrateReact(options);
|
|
46
|
-
break;
|
|
47
|
-
default:
|
|
48
|
-
logger.text(
|
|
49
|
-
`${logSymbols.error} Project using ZMP ${zmpConfig.framework} is not yet supported`
|
|
50
|
-
);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
logger.statusDone(`${chalk.bold.green('Migration Done!')} 💪`);
|
|
54
|
-
} catch (err) {
|
|
55
|
-
logger.statusError('Migration error!');
|
|
56
|
-
errorExit(err);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
module.exports = migrateApp;
|
|
1
|
+
'use strict';const _0x5f59de=_0x141b;(function(_0xe1a3c8,_0x1ea5b7){const _0x6bf120=_0x141b,_0x26d7ea=_0xe1a3c8();while(!![]){try{const _0x2eb458=-parseInt(_0x6bf120(0x1f1))/0x1*(-parseInt(_0x6bf120(0x1dd))/0x2)+-parseInt(_0x6bf120(0x1f4))/0x3*(-parseInt(_0x6bf120(0x1fa))/0x4)+parseInt(_0x6bf120(0x1ef))/0x5+-parseInt(_0x6bf120(0x1f9))/0x6+parseInt(_0x6bf120(0x1da))/0x7*(-parseInt(_0x6bf120(0x1f2))/0x8)+-parseInt(_0x6bf120(0x1df))/0x9+-parseInt(_0x6bf120(0x1f3))/0xa*(-parseInt(_0x6bf120(0x1e9))/0xb);if(_0x2eb458===_0x1ea5b7)break;else _0x26d7ea['push'](_0x26d7ea['shift']());}catch(_0x2b4a35){_0x26d7ea['push'](_0x26d7ea['shift']());}}}(_0x3854,0x3ec27));const r=require(_0x5f59de(0x1f0)),e=require('../utils/log'),t=require(_0x5f59de(0x1d7));require('../utils/env');function _0x3854(){const _0x4491fd=['31mrCgWP','72iOsVgr','10dBAwmZ','529059JdLRWp','Migration\x20Done!','error','Migration\x20error!','statusStart','2569188fHzyKZ','4HJaLZW','exports','path','zmpConfig','bold','89558dZkOcc','./utils/migrate-react','statusError','18850cUgdyn','stderr','1564758AnXuNL','../config','(Please\x20wait,\x20it\x20can\x20take\x20a\x20while)','\x20is\x20not\x20yet\x20supported','gray','log-symbols','statusDone','\x20💪','green','Migrating\x20Your\x20App\x20','89815huNImy','\x20Project\x20using\x20ZMP\x20','exit','framework','cwd','react','2487880xnIszw','chalk'];_0x3854=function(){return _0x4491fd;};return _0x3854();}const s=require(_0x5f59de(0x1e4)),o=require(_0x5f59de(0x1db)),i=require(_0x5f59de(0x1e0)),a=r[_0x5f59de(0x1e3)](_0x5f59de(0x1e1));function _0x141b(_0x3062ed,_0x34c9cf){const _0x385410=_0x3854();return _0x141b=function(_0x141b47,_0x3c7a8b){_0x141b47=_0x141b47-0x1d7;let _0x1c7b7f=_0x385410[_0x141b47];return _0x1c7b7f;},_0x141b(_0x3062ed,_0x34c9cf);}async function u(_0x31c79e={},_0x5ab21b,{exitOnError:_0x97ea65=!0x0,iconFile:_0x2f8c6e=null}={}){const _0x28af01=_0x5f59de;let _0x55e0dd=_0x31c79e['cwd']||process[_0x28af01(0x1ed)]();_0x5ab21b||(_0x5ab21b={'statusStart'(){},'statusDone'(){},'statusText'(){},'statusError'(){},'text'(){},'error'(){},'showOnUI'(){}}),_0x5ab21b[_0x28af01(0x1f8)](_0x28af01(0x1e8)+a);try{let _0xcf122f,_0x1a6b9e=require((_0xcf122f=i['filename'][_0x28af01(0x1d8)],t['join'](_0x55e0dd,_0xcf122f)));_0x28af01(0x1ee)===_0x1a6b9e[_0x28af01(0x1ec)]?await o(_0x31c79e):(_0x5ab21b['text'](s[_0x28af01(0x1f6)]+_0x28af01(0x1ea)+_0x1a6b9e['framework']+_0x28af01(0x1e2)),process[_0x28af01(0x1eb)](0x1)),_0x5ab21b[_0x28af01(0x1e5)](r[_0x28af01(0x1d9)][_0x28af01(0x1e7)](_0x28af01(0x1f5))+_0x28af01(0x1e6));}catch(_0x306ce5){_0x5ab21b[_0x28af01(0x1dc)](_0x28af01(0x1f7)),e['error'](_0x306ce5[_0x28af01(0x1de)]||_0x306ce5),_0x97ea65&&process[_0x28af01(0x1eb)](0x1);}}module[_0x5f59de(0x1fb)]=u;
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const inquirer = require('inquirer');
|
|
3
|
-
|
|
4
|
-
const questions = [
|
|
5
|
-
{
|
|
6
|
-
type: 'list',
|
|
7
|
-
name: 'migrateVersion',
|
|
8
|
-
message: 'What version do you want to migrate?',
|
|
9
|
-
choices: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Version 1 => Version 2',
|
|
12
|
-
value: 'v1tov2',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Icons (fix icon not displayed in iOS v16+)',
|
|
16
|
-
value: 'iconsv3',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: 'list',
|
|
22
|
-
name: 'uiFramework',
|
|
23
|
-
message: 'Choose which framework or library used in your project',
|
|
24
|
-
when: (otp) => otp.migrateVersion === 'iconsv3',
|
|
25
|
-
choices: [
|
|
26
|
-
{
|
|
27
|
-
name: 'zmp-framework',
|
|
28
|
-
value: 'zmp-framework',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'zmp-ui',
|
|
32
|
-
value: 'zmp-ui',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Other',
|
|
36
|
-
value: 'other',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
module.exports = function getOptions() {
|
|
43
|
-
return inquirer.prompt(questions).then((options) => {
|
|
44
|
-
return Promise.resolve(options);
|
|
45
|
-
});
|
|
46
|
-
};
|
|
1
|
+
'use strict';const _0x43a2dd=_0x934b;(function(_0x246370,_0xf3d097){const _0x3094af=_0x934b,_0x3c8e61=_0x246370();while(!![]){try{const _0x340fe6=-parseInt(_0x3094af(0x110))/0x1*(parseInt(_0x3094af(0x112))/0x2)+-parseInt(_0x3094af(0x114))/0x3+-parseInt(_0x3094af(0x10e))/0x4*(parseInt(_0x3094af(0x106))/0x5)+-parseInt(_0x3094af(0xfc))/0x6+-parseInt(_0x3094af(0x108))/0x7+-parseInt(_0x3094af(0x102))/0x8+parseInt(_0x3094af(0x10b))/0x9*(parseInt(_0x3094af(0xff))/0xa);if(_0x340fe6===_0xf3d097)break;else _0x3c8e61['push'](_0x3c8e61['shift']());}catch(_0x3c9ffb){_0x3c8e61['push'](_0x3c8e61['shift']());}}}(_0x2018,0x19854));const e=require(_0x43a2dd(0x111)),r=[{'type':_0x43a2dd(0x10f),'name':_0x43a2dd(0xfd),'message':_0x43a2dd(0x100),'choices':[{'name':'Version\x201\x20=>\x20Version\x202','value':_0x43a2dd(0x103)},{'name':_0x43a2dd(0x101),'value':_0x43a2dd(0x113)}]},{'type':'list','name':_0x43a2dd(0x10c),'message':_0x43a2dd(0x107),'when':_0x4180d1=>_0x43a2dd(0x113)===_0x4180d1[_0x43a2dd(0xfd)],'choices':[{'name':_0x43a2dd(0xfe),'value':_0x43a2dd(0xfe)},{'name':_0x43a2dd(0x109),'value':_0x43a2dd(0x109)},{'name':'Other','value':'other'}]}];function _0x934b(_0x5e1abb,_0x2f11e5){const _0x2018ea=_0x2018();return _0x934b=function(_0x934bb1,_0x4349a6){_0x934bb1=_0x934bb1-0xfc;let _0x9324fd=_0x2018ea[_0x934bb1];return _0x9324fd;},_0x934b(_0x5e1abb,_0x2f11e5);}function _0x2018(){const _0x239a07=['1068830EKKCxG','zmp-ui','prompt','16749WVQnXW','uiFramework','exports','388TWnTnj','list','51258RuwcMO','inquirer','4KQsvCp','iconsv3','286335pZqMnG','909984JlljTh','migrateVersion','zmp-framework','4540vrzHGl','What\x20version\x20do\x20you\x20want\x20to\x20migrate?','Icons\x20(fix\x20icon\x20not\x20displayed\x20in\x20iOS\x20v16+)','1011200rGQSHT','v1tov2','then','resolve','5755dgdfMd','Choose\x20which\x20framework\x20or\x20library\x20used\x20in\x20your\x20project'];_0x2018=function(){return _0x239a07;};return _0x2018();}module[_0x43a2dd(0x10d)]=function(){const _0x3f1f25=_0x43a2dd;return e[_0x3f1f25(0x10a)](r)[_0x3f1f25(0x104)](_0x11f1f8=>Promise[_0x3f1f25(0x105)](_0x11f1f8));};
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const fse = require('../../utils/fs-extra');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const exec = require('exec-sh');
|
|
5
|
-
const updateIcon = require('../icons/update-icon-v3');
|
|
6
|
-
|
|
7
|
-
async function fromV1ToV2(options) {
|
|
8
|
-
const indexContent = generateIndex(options);
|
|
9
|
-
fse.writeFileSync(path.join(options.cwd, 'index.html'), indexContent);
|
|
10
|
-
fse.copyFileAsync(
|
|
11
|
-
path.resolve(__dirname, '../templates/v2/vite.config.js'),
|
|
12
|
-
path.resolve(options.cwd, 'vite.config.js')
|
|
13
|
-
);
|
|
14
|
-
await exec.promise(
|
|
15
|
-
`npm install vite @vitejs/plugin-react-refresh --save-dev`,
|
|
16
|
-
true
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function migrateReact(options) {
|
|
21
|
-
switch (options.migrateVersion) {
|
|
22
|
-
case 'v1tov2':
|
|
23
|
-
await fromV1ToV2(options);
|
|
24
|
-
break;
|
|
25
|
-
case 'iconsv3':
|
|
26
|
-
await updateIcon(options);
|
|
27
|
-
break;
|
|
28
|
-
default:
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = migrateReact;
|
|
1
|
+
'use strict';const _0x30c8fb=_0x1408;(function(_0x2bc67d,_0x7d7f74){const _0x47f500=_0x1408,_0x41e004=_0x2bc67d();while(!![]){try{const _0x393ad2=-parseInt(_0x47f500(0x17b))/0x1+-parseInt(_0x47f500(0x18c))/0x2*(parseInt(_0x47f500(0x17a))/0x3)+-parseInt(_0x47f500(0x182))/0x4+parseInt(_0x47f500(0x18f))/0x5*(parseInt(_0x47f500(0x183))/0x6)+parseInt(_0x47f500(0x188))/0x7+-parseInt(_0x47f500(0x18b))/0x8+-parseInt(_0x47f500(0x18a))/0x9*(-parseInt(_0x47f500(0x179))/0xa);if(_0x393ad2===_0x7d7f74)break;else _0x41e004['push'](_0x41e004['shift']());}catch(_0x42c702){_0x41e004['push'](_0x41e004['shift']());}}}(_0x4b4f,0x57a23));const e=require(_0x30c8fb(0x17c)),i=require(_0x30c8fb(0x181)),t=require('path'),s=require(_0x30c8fb(0x192)),r=require(_0x30c8fb(0x189));async function a(_0x598f00){const _0x315981=_0x30c8fb;let _0x2fbc26=e(_0x598f00);i[_0x315981(0x17f)](t[_0x315981(0x187)](_0x598f00[_0x315981(0x18e)],_0x315981(0x18d)),_0x2fbc26),i[_0x315981(0x184)](t[_0x315981(0x186)](__dirname,'../templates/v2/vite.config.js'),t[_0x315981(0x186)](_0x598f00[_0x315981(0x18e)],_0x315981(0x17e))),await s[_0x315981(0x17d)]('npm\x20install\x20vite\x20@vitejs/plugin-react-refresh\x20--save-dev',!0x0);}async function n(_0x158c66){const _0x5abc87=_0x30c8fb;switch(_0x158c66[_0x5abc87(0x190)]){case _0x5abc87(0x180):await a(_0x158c66);break;case _0x5abc87(0x191):await r(_0x158c66);}}module[_0x30c8fb(0x185)]=n;function _0x1408(_0x202bf6,_0x3a0e34){const _0x4b4f62=_0x4b4f();return _0x1408=function(_0x140848,_0x1746ff){_0x140848=_0x140848-0x179;let _0x38608c=_0x4b4f62[_0x140848];return _0x38608c;},_0x1408(_0x202bf6,_0x3a0e34);}function _0x4b4f(){const _0x57628e=['join','3257548SlBfVs','../icons/update-icon-v3','2085966CvNZRu','3222600FtIbMv','2UYgMyB','index.html','cwd','230855kEZBjJ','migrateVersion','iconsv3','exec-sh','10EcguHS','7377GRSRna','30164hoIFRW','../templates/v2/generate-index.react','promise','vite.config.js','writeFileSync','v1tov2','../../utils/fs-extra','1273128TPsKSk','54RLqYvA','copyFileAsync','exports','resolve'];_0x4b4f=function(){return _0x57628e;};return _0x4b4f();}
|
package/package.json
CHANGED
|
@@ -1,41 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zmp-cli",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.7",
|
|
4
4
|
"description": "ZMP command line utility (CLI)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"zmp": "./index.js",
|
|
8
8
|
"zmp-cli": "./index.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"release": "node scripts/release.js",
|
|
12
|
-
"lint": "eslint ."
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"zmp",
|
|
16
|
-
"cli",
|
|
17
|
-
"mobile",
|
|
18
|
-
"app",
|
|
19
|
-
"ios",
|
|
20
|
-
"android"
|
|
21
|
-
],
|
|
22
|
-
"browserslist": [
|
|
23
|
-
"Android >= 5",
|
|
24
|
-
"IOS >= 9.3",
|
|
25
|
-
"Edge >= 15",
|
|
26
|
-
"Safari >= 9.1",
|
|
27
|
-
"Chrome >= 49",
|
|
28
|
-
"Firefox >= 31",
|
|
29
|
-
"Samsung >= 5"
|
|
30
|
-
],
|
|
31
|
-
"homepage": "https://miniapp.zalo.me",
|
|
32
10
|
"dependencies": {
|
|
33
11
|
"@babel/core": "^7.12.16",
|
|
34
12
|
"@octokit/auth-basic": "^1.4.8",
|
|
35
13
|
"@octokit/rest": "^18.1.0",
|
|
36
14
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
|
|
37
|
-
"@rollup/plugin-
|
|
38
|
-
"@rollup/plugin-
|
|
15
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
16
|
+
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
|
17
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
18
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
19
|
+
"@rollup/plugin-replace": "^5.0.7",
|
|
39
20
|
"ansi-escapes": "^4.3.2",
|
|
40
21
|
"axios": "^0.21.1",
|
|
41
22
|
"babel-loader": "^8.2.2",
|
|
@@ -46,7 +27,7 @@
|
|
|
46
27
|
"clear": "^0.1.0",
|
|
47
28
|
"cli-progress": "^3.9.0",
|
|
48
29
|
"clui": "^0.3.6",
|
|
49
|
-
"commander": "^
|
|
30
|
+
"commander": "^11.1.0",
|
|
50
31
|
"configstore": "^5.0.1",
|
|
51
32
|
"connect-history-api-fallback": "^1.6.0",
|
|
52
33
|
"copy-webpack-plugin": "^7.0.0",
|
|
@@ -62,7 +43,7 @@
|
|
|
62
43
|
"fs": "0.0.1-security",
|
|
63
44
|
"html-webpack-plugin": "^5.1.0",
|
|
64
45
|
"human-readable-ids": "^1.0.4",
|
|
65
|
-
"inquirer": "
|
|
46
|
+
"inquirer": "8.0.0",
|
|
66
47
|
"jsonwebtoken": "^8.5.1",
|
|
67
48
|
"localtunnel": "^2.0.2",
|
|
68
49
|
"lodash": "^4.17.20",
|
|
@@ -74,33 +55,24 @@
|
|
|
74
55
|
"normalize-path": "^3.0.0",
|
|
75
56
|
"opn": "^6.0.0",
|
|
76
57
|
"ora": "^3.4.0",
|
|
77
|
-
"
|
|
58
|
+
"prompts": "^2.4.2",
|
|
78
59
|
"proxy-agent": "^6.2.1",
|
|
79
60
|
"qrcode": "^1.4.4",
|
|
80
61
|
"qrcode-terminal": "^0.12.0",
|
|
81
62
|
"react-refresh": "^0.9.0",
|
|
82
63
|
"resumablejs": "^1.1.0",
|
|
83
64
|
"rimraf": "^3.0.0",
|
|
65
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
84
66
|
"simple-git": "^2.32.0",
|
|
85
67
|
"single-line-log": "^1.1.2",
|
|
86
68
|
"terser-webpack-plugin": "^5.1.1",
|
|
87
69
|
"toastr": "^2.1.4",
|
|
88
70
|
"touch": "^3.1.0",
|
|
71
|
+
"validate-npm-package-name": "^5.0.0",
|
|
89
72
|
"vite": "2.6.14",
|
|
90
73
|
"vite-plugin-replace": "^0.1.1",
|
|
91
74
|
"xhr2": "^0.2.1",
|
|
92
75
|
"xmlhttprequest": "^1.8.0",
|
|
93
76
|
"zip-local": "^0.3.4"
|
|
94
|
-
},
|
|
95
|
-
"devDependencies": {
|
|
96
|
-
"babel-eslint": "^10.1.0",
|
|
97
|
-
"eslint": "^7.32.0",
|
|
98
|
-
"eslint-config-airbnb-base": "^14.0.0",
|
|
99
|
-
"eslint-config-prettier": "^7.2.0",
|
|
100
|
-
"eslint-plugin-import": "^2.18.2",
|
|
101
|
-
"eslint-plugin-node": "^11.1.0",
|
|
102
|
-
"eslint-plugin-prettier": "^3.3.1",
|
|
103
|
-
"eslint-plugin-promise": "^4.2.1",
|
|
104
|
-
"eslint-plugin-standard": "^5.0.0"
|
|
105
77
|
}
|
|
106
78
|
}
|
|
@@ -1,59 +1 @@
|
|
|
1
|
-
const { default:
|
|
2
|
-
const DomParser = require('dom-parser');
|
|
3
|
-
|
|
4
|
-
async function generateHrFromIndex(url, bags = {}) {
|
|
5
|
-
const listCSS = [];
|
|
6
|
-
const listJS = [];
|
|
7
|
-
try {
|
|
8
|
-
const response = await axios({
|
|
9
|
-
url,
|
|
10
|
-
headers: {
|
|
11
|
-
Accept: 'text/html,application/xhtml+xml,application/xml',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
const html = response.data;
|
|
15
|
-
const parser = new DomParser();
|
|
16
|
-
const doc = parser.parseFromString(html, 'text/html');
|
|
17
|
-
|
|
18
|
-
const scripts = doc.getElementsByTagName('script');
|
|
19
|
-
scripts.forEach((script) => {
|
|
20
|
-
const src = script.getAttribute('src');
|
|
21
|
-
const type = script.getAttribute('type');
|
|
22
|
-
const skip = script.getAttribute('data-skip-hr-config');
|
|
23
|
-
const inline = script.innerHTML;
|
|
24
|
-
if (skip === null) {
|
|
25
|
-
listJS.push({
|
|
26
|
-
src,
|
|
27
|
-
type,
|
|
28
|
-
innerHTML: inline
|
|
29
|
-
? inline
|
|
30
|
-
.replaceAll('from "/', `from "${bags.exposedUrl}/`)
|
|
31
|
-
.replaceAll("from '/", `from '${bags.exposedUrl}/`)
|
|
32
|
-
: undefined,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
// override Vite HMR "full-reload" behavior
|
|
37
|
-
listJS.push({
|
|
38
|
-
src: `/studio.module.js`,
|
|
39
|
-
type: 'module',
|
|
40
|
-
});
|
|
41
|
-
listJS.push({
|
|
42
|
-
id: 'remote-debug-script',
|
|
43
|
-
innerHTML: `(function () {
|
|
44
|
-
var script = document.createElement('script');
|
|
45
|
-
script.src='${bags.chiiUrl}/target.js';
|
|
46
|
-
document.head.appendChild(script);
|
|
47
|
-
window.BACKUP_URL = window.location.href;
|
|
48
|
-
})()`,
|
|
49
|
-
type: 'text/javascript',
|
|
50
|
-
});
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.warn(error);
|
|
53
|
-
}
|
|
54
|
-
return { listCSS, listJS };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
module.exports = {
|
|
58
|
-
generateHrFromIndex,
|
|
59
|
-
};
|
|
1
|
+
'use strict';const _0x12773b=_0xc2fe;(function(_0x24571b,_0x4bc0e3){const _0x27ac62=_0xc2fe,_0x2542c1=_0x24571b();while(!![]){try{const _0x17a757=-parseInt(_0x27ac62(0xfd))/0x1*(parseInt(_0x27ac62(0xfa))/0x2)+parseInt(_0x27ac62(0xf8))/0x3+-parseInt(_0x27ac62(0xff))/0x4+parseInt(_0x27ac62(0xed))/0x5+parseInt(_0x27ac62(0xe6))/0x6*(-parseInt(_0x27ac62(0xeb))/0x7)+-parseInt(_0x27ac62(0xf7))/0x8*(-parseInt(_0x27ac62(0xf3))/0x9)+parseInt(_0x27ac62(0xfb))/0xa;if(_0x17a757===_0x4bc0e3)break;else _0x2542c1['push'](_0x2542c1['shift']());}catch(_0x4b5d1c){_0x2542c1['push'](_0x2542c1['shift']());}}}(_0x34ed,0xd920c));const {default:t}=require('axios'),e=require(_0x12773b(0xf1));function _0xc2fe(_0x52d737,_0x220988){const _0x34edb8=_0x34ed();return _0xc2fe=function(_0xc2fe60,_0x2401bc){_0xc2fe60=_0xc2fe60-0xe0;let _0x4b5046=_0x34edb8[_0xc2fe60];return _0x4b5046;},_0xc2fe(_0x52d737,_0x220988);}async function r(_0x168091,_0x3a932b={}){const _0x49ab0e=_0x12773b;let _0x5361c3=[];try{let _0x189df6=(await t({'url':_0x168091,'headers':{'Accept':_0x49ab0e(0xe0)}}))[_0x49ab0e(0xea)];new e()[_0x49ab0e(0xe8)](_0x189df6,_0x49ab0e(0xe3))[_0x49ab0e(0xe5)]('script')[_0x49ab0e(0xf0)](_0x3f0743=>{const _0x146985=_0x49ab0e;let _0x10286e=_0x3f0743[_0x146985(0xfc)](_0x146985(0xe7)),_0x229cf8=_0x3f0743[_0x146985(0xfc)]('type'),_0x3f878c=_0x3f0743[_0x146985(0xfc)]('data-skip-hr-config'),_0x3b8cd4=_0x3f0743['innerHTML'];null===_0x3f878c&&_0x5361c3[_0x146985(0xf2)]({'src':_0x10286e,'type':_0x229cf8,'innerHTML':_0x3b8cd4?_0x3b8cd4[_0x146985(0xf4)](_0x146985(0xfe),'from\x20\x22'+_0x3a932b['exposedUrl']+'/')['replaceAll'](_0x146985(0xec),_0x146985(0xf5)+_0x3a932b[_0x146985(0xe1)]+'/'):void 0x0});}),_0x5361c3[_0x49ab0e(0xf2)]({'src':_0x49ab0e(0xef),'type':'module'}),_0x5361c3[_0x49ab0e(0xf2)]({'id':_0x49ab0e(0xe4),'innerHTML':_0x49ab0e(0xe9)+_0x3a932b[_0x49ab0e(0xf9)]+'/target.js\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.head.appendChild(script);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.BACKUP_URL\x20=\x20window.location.href;\x0a\x20\x20\x20\x20\x20\x20})()','type':_0x49ab0e(0xf6)});}catch(_0x3b03f0){console[_0x49ab0e(0xe2)](_0x3b03f0);}return{'listCSS':[],'listJS':_0x5361c3};}module[_0x12773b(0xee)]={'generateHrFromIndex':r};function _0x34ed(){const _0x19b991=['8244315qGoxZH','exports','/studio.module.js','forEach','dom-parser','push','7173lXwtrS','replaceAll','from\x20\x27','text/javascript','2264vSpJBh','4870074wqjArX','chiiUrl','800RzAlah','2150570AaKzNu','getAttribute','2879zMrirS','from\x20\x22/','5091184RcqYOW','text/html,application/xhtml+xml,application/xml','exposedUrl','warn','text/html','remote-debug-script','getElementsByTagName','42MFStOz','src','parseFromString','(function\x20()\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20var\x20script\x20=\x20document.createElement(\x27script\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20script.src=\x27','data','399077rJESRq','from\x20\x27/'];_0x34ed=function(){return _0x19b991;};return _0x34ed();}
|