zmp-cli 3.12.0-rc.3 → 3.12.1-rc.2

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.
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "prettier.trailingComma": "none",
3
- "workbench.colorTheme": "GitHub Dark Default"
4
- }
3
+ "workbench.colorTheme": "GitHub Dark Default",
4
+ "editor.formatOnSave": false
5
+ }
@@ -2,7 +2,7 @@ const indent = require('../../utils/indent');
2
2
  const stylesExtension = require('../../utils/styles-extension');
3
3
 
4
4
  module.exports = (options) => {
5
- const { cssPreProcessor, includeTailwind } = options;
5
+ const { cssPreProcessor, includeTailwind, framework } = options;
6
6
 
7
7
  let scripts = '';
8
8
 
@@ -30,7 +30,7 @@ module.exports = (options) => {
30
30
  }
31
31
 
32
32
  // Mount React App
33
- const root = createRoot(document.getElementById('app'));
33
+ ${framework === 'react-typescript' ? "const root = createRoot(document.getElementById('app')!);" : "const root = createRoot(document.getElementById('app'));"}
34
34
  root.render(React.createElement(App));
35
35
  `
36
36
  );
@@ -1,17 +1,19 @@
1
- const generateRoutes = require('../templates/generate-routes');
2
-
3
1
  module.exports = function generateAppConfig(options) {
4
2
  const { name } = options;
5
3
 
6
4
  // Window config
7
5
  const appConfig = {
8
6
  title: name,
7
+ headerTitle: name,
9
8
  headerColor: '#1843EF',
10
9
  textColor: 'white',
11
10
  statusBarColor: '#1843EF',
12
11
  leftButton: 'back',
12
+ statusBar: 'normal',
13
+ actionBarHidden: false,
14
+ hideAndroidBottomNavigationBar: false,
15
+ hideIOSSafeAreaBottom: false,
13
16
  };
14
- const routes = generateRoutes(options);
15
17
  // Content
16
18
  const content = JSON.stringify(
17
19
  {
@@ -20,7 +22,6 @@ module.exports = function generateAppConfig(options) {
20
22
  listCSS: [],
21
23
  listSyncJS: [],
22
24
  listAsyncJS: [],
23
- pages: routes,
24
25
  },
25
26
  '',
26
27
  2
@@ -18,7 +18,6 @@ module.exports = function generatePackageJson(options) {
18
18
  : ['zmp-framework', 'zmp-sdk', 'swiper'];
19
19
  const dependenciesVue = ['vue@3', 'zmp-framework'];
20
20
  const dependenciesReact = ['react', 'react-dom', 'prop-types'];
21
- const dependenciesReactTs = ['@types/react', '@types/react-dom'];
22
21
  const tailwindDependencies = [
23
22
  'autoprefixer',
24
23
  'tailwindcss',
@@ -36,17 +35,17 @@ module.exports = function generatePackageJson(options) {
36
35
  }
37
36
  }
38
37
 
39
- if (framework === 'react-typescript') {
40
- dependencies.push(...dependenciesReactTs);
41
- if (package === 'zmp-ui') {
42
- dependencies.push('@types/react-router-dom');
43
- }
44
- }
45
38
  const devDependencies = [
46
39
  'cross-env',
47
40
  'postcss-preset-env@6.7.0',
48
41
  'vite@2.6.14',
49
42
  ];
43
+ if (framework === 'react-typescript') {
44
+ devDependencies.push('@types/react', '@types/react-dom');
45
+ if (package === 'zmp-ui') {
46
+ devDependencies.push('@types/react-router-dom');
47
+ }
48
+ }
50
49
  // CSS PreProcessor
51
50
  if (cssPreProcessor === 'stylus') devDependencies.push(...['stylus']);
52
51
  else if (cssPreProcessor === 'less') devDependencies.push(...['less']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-cli",
3
- "version": "3.12.0-rc.3",
3
+ "version": "3.12.1-rc.2",
4
4
  "description": "ZMP command line utility (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {
package/start/index.js CHANGED
@@ -88,9 +88,9 @@ module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
88
88
 
89
89
  const publicServer = {
90
90
  host: '0.0.0.0',
91
- https: !isIOS,
92
91
  hmr: {
93
92
  host: host,
93
+ protocol: 'ws',
94
94
  },
95
95
  };
96
96
 
@@ -172,9 +172,7 @@ module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
172
172
 
173
173
  spinner.stop();
174
174
  return await new Promise(() => {
175
- const previewOnZaloURL = `https://zalo.me/app/link/zapps/${appId}/?env=TESTING_LOCAL&clientIp=${
176
- isIOS ? 'http' : 'https'
177
- }://${host}:${app.config.server.port}`;
175
+ const previewOnZaloURL = `https://zalo.me/app/link/zapps/${appId}/?env=TESTING_LOCAL&clientIp=http://${host}:${app.config.server.port}`;
178
176
 
179
177
  if (previewOnZalo) {
180
178
  qrcode.generate(previewOnZaloURL, { small: true }, function (qrcode) {