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/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 _0x3e1547=_0x28e0;(function(_0x358945,_0x511e8a){const _0x59d886=_0x28e0,_0x3c15f4=_0x358945();while(!![]){try{const _0x2d8abf=parseInt(_0x59d886(0x84))/0x1+parseInt(_0x59d886(0x76))/0x2+parseInt(_0x59d886(0x85))/0x3*(-parseInt(_0x59d886(0x83))/0x4)+-parseInt(_0x59d886(0x7b))/0x5*(parseInt(_0x59d886(0x7f))/0x6)+parseInt(_0x59d886(0x7a))/0x7+-parseInt(_0x59d886(0x78))/0x8+parseInt(_0x59d886(0x7c))/0x9;if(_0x2d8abf===_0x511e8a)break;else _0x3c15f4['push'](_0x3c15f4['shift']());}catch(_0x3ea06b){_0x3c15f4['push'](_0x3c15f4['shift']());}}}(_0x2e04,0x1f6e3));const r=require(_0x3e1547(0x6e)),e=require(_0x3e1547(0x70)),t=require(_0x3e1547(0x74));require(_0x3e1547(0x88));const s=require(_0x3e1547(0x89)),o=require(_0x3e1547(0x6c)),i=require(_0x3e1547(0x6d)),a=r['gray'](_0x3e1547(0x72));function _0x28e0(_0x174345,_0x8141c8){const _0x2e047a=_0x2e04();return _0x28e0=function(_0x28e03c,_0x1504ba){_0x28e03c=_0x28e03c-0x6c;let _0x483bac=_0x2e047a[_0x28e03c];return _0x483bac;},_0x28e0(_0x174345,_0x8141c8);}async function u(_0x53c124={},_0x34c0aa,{exitOnError:_0x14a5b0=!0x0,iconFile:_0x1cb94f=null}={}){const _0x3e699e=_0x3e1547;let _0x17f5a3=_0x53c124['cwd']||process['cwd']();_0x34c0aa||(_0x34c0aa={'statusStart'(){},'statusDone'(){},'statusText'(){},'statusError'(){},'text'(){},'error'(){},'showOnUI'(){}}),_0x34c0aa[_0x3e699e(0x81)]('Migrating\x20Your\x20App\x20'+a);try{let _0x2d8317,_0x2e2764=require((_0x2d8317=i[_0x3e699e(0x6f)]['zmpConfig'],t[_0x3e699e(0x79)](_0x17f5a3,_0x2d8317)));_0x3e699e(0x82)===_0x2e2764['framework']?await o(_0x53c124):(_0x34c0aa['text'](s['error']+_0x3e699e(0x71)+_0x2e2764['framework']+_0x3e699e(0x7d)),process['exit'](0x1)),_0x34c0aa['statusDone'](r['bold'][_0x3e699e(0x73)](_0x3e699e(0x75))+_0x3e699e(0x87));}catch(_0xe04ca7){_0x34c0aa[_0x3e699e(0x77)](_0x3e699e(0x7e)),e['error'](_0xe04ca7[_0x3e699e(0x86)]||_0xe04ca7),_0x14a5b0&&process[_0x3e699e(0x80)](0x1);}}function _0x2e04(){const _0x50cce3=['exit','statusStart','react','8yDOYUR','169985nrbBwS','337665lQvPsE','stderr','\x20💪','../utils/env','log-symbols','./utils/migrate-react','../config','chalk','filename','../utils/log','\x20Project\x20using\x20ZMP\x20','(Please\x20wait,\x20it\x20can\x20take\x20a\x20while)','green','path','Migration\x20Done!','297730gofEHN','statusError','1549696gtgScg','join','1034565UBWVli','259345oYFMHN','1195065CHsSOL','\x20is\x20not\x20yet\x20supported','Migration\x20error!','6tSOLvm'];_0x2e04=function(){return _0x50cce3;};return _0x2e04();}module['exports']=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 _0xfb4b0b=_0x29ea;function _0x29ea(_0x47b30d,_0x2b74e6){const _0x41fcbd=_0x41fc();return _0x29ea=function(_0x29ea31,_0x3f79e3){_0x29ea31=_0x29ea31-0x1db;let _0xc573fe=_0x41fcbd[_0x29ea31];return _0xc573fe;},_0x29ea(_0x47b30d,_0x2b74e6);}(function(_0x40be4c,_0x319943){const _0x123062=_0x29ea,_0x19c315=_0x40be4c();while(!![]){try{const _0x841494=-parseInt(_0x123062(0x1ec))/0x1+-parseInt(_0x123062(0x1f0))/0x2*(-parseInt(_0x123062(0x1e1))/0x3)+-parseInt(_0x123062(0x1e0))/0x4*(parseInt(_0x123062(0x1df))/0x5)+parseInt(_0x123062(0x1e9))/0x6+-parseInt(_0x123062(0x1ea))/0x7+-parseInt(_0x123062(0x1e6))/0x8+parseInt(_0x123062(0x1db))/0x9;if(_0x841494===_0x319943)break;else _0x19c315['push'](_0x19c315['shift']());}catch(_0x49345e){_0x19c315['push'](_0x19c315['shift']());}}}(_0x41fc,0x9b206));function _0x41fc(){const _0x40a27a=['3kSgecq','list','resolve','migrateVersion','exports','615288xUTxyY','Other','What\x20version\x20do\x20you\x20want\x20to\x20migrate?','3101544kavYrt','6231225Jhmeus','zmp-ui','872956CfgCBX','Version\x201\x20=>\x20Version\x202','other','v1tov2','1822834cIAgFx','inquirer','uiFramework','then','19301292LifsTN','zmp-framework','Icons\x20(fix\x20icon\x20not\x20displayed\x20in\x20iOS\x20v16+)','iconsv3','5DlRNEl','4389956WMOiTh'];_0x41fc=function(){return _0x40a27a;};return _0x41fc();}const e=require(_0xfb4b0b(0x1f1)),r=[{'type':_0xfb4b0b(0x1e2),'name':'migrateVersion','message':_0xfb4b0b(0x1e8),'choices':[{'name':_0xfb4b0b(0x1ed),'value':_0xfb4b0b(0x1ef)},{'name':_0xfb4b0b(0x1dd),'value':'iconsv3'}]},{'type':_0xfb4b0b(0x1e2),'name':_0xfb4b0b(0x1f2),'message':'Choose\x20which\x20framework\x20or\x20library\x20used\x20in\x20your\x20project','when':_0x31263e=>_0xfb4b0b(0x1de)===_0x31263e[_0xfb4b0b(0x1e4)],'choices':[{'name':'zmp-framework','value':_0xfb4b0b(0x1dc)},{'name':_0xfb4b0b(0x1eb),'value':_0xfb4b0b(0x1eb)},{'name':_0xfb4b0b(0x1e7),'value':_0xfb4b0b(0x1ee)}]}];module[_0xfb4b0b(0x1e5)]=function(){const _0xa8695=_0xfb4b0b;return e['prompt'](r)[_0xa8695(0x1f3)](_0x267b18=>Promise[_0xa8695(0x1e3)](_0x267b18));};
|
|
@@ -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 _0x1ada20=_0x3b5d;(function(_0x5a6130,_0x3e09ea){const _0x2317b7=_0x3b5d,_0x29095e=_0x5a6130();while(!![]){try{const _0x1cd00a=-parseInt(_0x2317b7(0xae))/0x1*(-parseInt(_0x2317b7(0xbd))/0x2)+parseInt(_0x2317b7(0xb0))/0x3+-parseInt(_0x2317b7(0xb1))/0x4+-parseInt(_0x2317b7(0xb8))/0x5*(parseInt(_0x2317b7(0xb6))/0x6)+parseInt(_0x2317b7(0xb5))/0x7+-parseInt(_0x2317b7(0xbe))/0x8+parseInt(_0x2317b7(0xb2))/0x9;if(_0x1cd00a===_0x3e09ea)break;else _0x29095e['push'](_0x29095e['shift']());}catch(_0x4fb573){_0x29095e['push'](_0x29095e['shift']());}}}(_0x272d,0x2965f));function _0x272d(){const _0x1f585b=['resolve','12csaQeh','2256440ORVriP','join','exports','../icons/update-icon-v3','v1tov2','promise','exec-sh','22970kEKTvb','writeFileSync','606231EuOZtj','337984XmpcNG','3362967qnqVuw','vite.config.js','iconsv3','984326ufMSdE','1620Stnxti','../../utils/fs-extra','5890NuEwDu','cwd','index.html','path'];_0x272d=function(){return _0x1f585b;};return _0x272d();}const e=require('../templates/v2/generate-index.react'),i=require(_0x1ada20(0xb7)),t=require(_0x1ada20(0xbb)),s=require(_0x1ada20(0xad)),r=require(_0x1ada20(0xaa));function _0x3b5d(_0xa91478,_0x40f213){const _0x272d4d=_0x272d();return _0x3b5d=function(_0x3b5d92,_0x2ae198){_0x3b5d92=_0x3b5d92-0xaa;let _0x12ed59=_0x272d4d[_0x3b5d92];return _0x12ed59;},_0x3b5d(_0xa91478,_0x40f213);}async function a(_0x4a7bb9){const _0x57682d=_0x1ada20;let _0x35fe6d=e(_0x4a7bb9);i[_0x57682d(0xaf)](t[_0x57682d(0xbf)](_0x4a7bb9[_0x57682d(0xb9)],_0x57682d(0xba)),_0x35fe6d),i['copyFileAsync'](t[_0x57682d(0xbc)](__dirname,'../templates/v2/vite.config.js'),t['resolve'](_0x4a7bb9[_0x57682d(0xb9)],_0x57682d(0xb3))),await s[_0x57682d(0xac)]('npm\x20install\x20vite\x20@vitejs/plugin-react-refresh\x20--save-dev',!0x0);}async function n(_0x842d6b){const _0x9f7e3f=_0x1ada20;switch(_0x842d6b['migrateVersion']){case _0x9f7e3f(0xab):await a(_0x842d6b);break;case _0x9f7e3f(0xb4):await r(_0x842d6b);}}module[_0x1ada20(0xc0)]=n;
|
package/package.json
CHANGED
|
@@ -1,41 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zmp-cli",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.6-beta.1",
|
|
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 _0x118a18=_0x12a7;(function(_0x850ba4,_0x576fb3){const _0x32112c=_0x12a7,_0x2ffff1=_0x850ba4();while(!![]){try{const _0x461a03=parseInt(_0x32112c(0xf2))/0x1*(-parseInt(_0x32112c(0xf7))/0x2)+-parseInt(_0x32112c(0xf4))/0x3*(parseInt(_0x32112c(0xde))/0x4)+-parseInt(_0x32112c(0xe5))/0x5+parseInt(_0x32112c(0xda))/0x6+parseInt(_0x32112c(0xe6))/0x7+parseInt(_0x32112c(0xe9))/0x8*(-parseInt(_0x32112c(0xdc))/0x9)+parseInt(_0x32112c(0xf8))/0xa*(parseInt(_0x32112c(0xee))/0xb);if(_0x461a03===_0x576fb3)break;else _0x2ffff1['push'](_0x2ffff1['shift']());}catch(_0x46951c){_0x2ffff1['push'](_0x2ffff1['shift']());}}}(_0x5844,0xe8241));function _0x5844(){const _0xff876a=['/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})()','script','chiiUrl','244393lpTuBF','data','3xgMXtE','forEach','dom-parser','2hONssF','261210CjwBBx','src','replaceAll','remote-debug-script','6814380wktNHq','getAttribute','58923UEhhiA','push','1154312MADadg','type','warn','getElementsByTagName','axios','from\x20\x22','exposedUrl','9298290VFFKUy','7028868TJUbvt','exports','text/javascript','2136VjviBY','parseFromString','from\x20\x27','innerHTML','text/html','1243IRZiJv'];_0x5844=function(){return _0xff876a;};return _0x5844();}const {default:t}=require(_0x118a18(0xe2)),e=require(_0x118a18(0xf6));function _0x12a7(_0x5b584d,_0x1dcbc2){const _0x584403=_0x5844();return _0x12a7=function(_0x12a72f,_0x356651){_0x12a72f=_0x12a72f-0xd7;let _0x44a7b3=_0x584403[_0x12a72f];return _0x44a7b3;},_0x12a7(_0x5b584d,_0x1dcbc2);}async function r(_0x2026a2,_0x2fdc17={}){const _0x36d258=_0x118a18;let _0x122d32=[];try{let _0x281747=(await t({'url':_0x2026a2,'headers':{'Accept':'text/html,application/xhtml+xml,application/xml'}}))[_0x36d258(0xf3)];new e()[_0x36d258(0xea)](_0x281747,_0x36d258(0xed))[_0x36d258(0xe1)](_0x36d258(0xf0))[_0x36d258(0xf5)](_0x2f0cc2=>{const _0x2ae373=_0x36d258;let _0x157daa=_0x2f0cc2[_0x2ae373(0xdb)](_0x2ae373(0xd7)),_0x1c8d9f=_0x2f0cc2[_0x2ae373(0xdb)](_0x2ae373(0xdf)),_0x8a3c1b=_0x2f0cc2[_0x2ae373(0xdb)]('data-skip-hr-config'),_0x2b1306=_0x2f0cc2[_0x2ae373(0xec)];null===_0x8a3c1b&&_0x122d32['push']({'src':_0x157daa,'type':_0x1c8d9f,'innerHTML':_0x2b1306?_0x2b1306[_0x2ae373(0xd8)]('from\x20\x22/',_0x2ae373(0xe3)+_0x2fdc17[_0x2ae373(0xe4)]+'/')[_0x2ae373(0xd8)]('from\x20\x27/',_0x2ae373(0xeb)+_0x2fdc17[_0x2ae373(0xe4)]+'/'):void 0x0});}),_0x122d32[_0x36d258(0xdd)]({'src':'/studio.module.js','type':'module'}),_0x122d32[_0x36d258(0xdd)]({'id':_0x36d258(0xd9),'innerHTML':'(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'+_0x2fdc17[_0x36d258(0xf1)]+_0x36d258(0xef),'type':_0x36d258(0xe8)});}catch(_0x3ed32c){console[_0x36d258(0xe0)](_0x3ed32c);}return{'listCSS':[],'listJS':_0x122d32};}module[_0x118a18(0xe7)]={'generateHrFromIndex':r};
|