@cloudbase/framework-plugin-low-code 0.7.20 → 0.7.23

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.
@@ -0,0 +1,3 @@
1
+ export declare const PRIVATE_JS_NAME = "weda-private.js";
2
+ export declare const PRIVATE_JS_CODE = "\n /**\n * An empty js file. It will be overridden in private place.\n *\n * For example:\n * ```javascript\n * window._isPrivate = true\n * ```\n */\n ";
3
+ //# sourceMappingURL=private.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private.d.ts","sourceRoot":"","sources":["../../src/config/private.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAKjD,eAAO,MAAM,eAAe,oKAS1B,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRIVATE_JS_CODE = exports.PRIVATE_JS_NAME = void 0;
4
+ exports.PRIVATE_JS_NAME = 'weda-private.js';
5
+ exports.PRIVATE_JS_CODE = `
6
+ /**
7
+ * An empty js file. It will be overridden in private place.
8
+ *
9
+ * For example:
10
+ * \`\`\`javascript
11
+ * window._isPrivate = true
12
+ * \`\`\`
13
+ */
14
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/framework-plugin-low-code",
3
- "version": "0.7.20",
3
+ "version": "0.7.23",
4
4
  "description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
5
5
  "author": "yhsunshining@gmail.com",
6
6
  "homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
@@ -87,4 +87,4 @@
87
87
  "jest": "^26.0.1",
88
88
  "typescript": "^3.8.3"
89
89
  }
90
- }
90
+ }
@@ -436,7 +436,7 @@
436
436
  ></script>
437
437
  <script
438
438
  crossorigin="anonymous"
439
- src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.11/dist/h5.browser.js"
439
+ src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.12/dist/h5.browser.js"
440
440
  ></script>
441
441
  <script>
442
442
  // zxing polifill
@@ -450,7 +450,7 @@
450
450
  ></script>
451
451
  <script
452
452
  crossorigin="anonymous"
453
- src="https://qbase.cdn-go.cn//lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-client@0.2.12/dist/web.browser.js"
453
+ src="https://qbase.cdn-go.cn//lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-client@0.2.13/dist/web.browser.js"
454
454
  ></script>
455
455
  </body>
456
456
  </html>
@@ -3,7 +3,7 @@
3
3
  "version": "1.0.0",
4
4
  "scripts": {},
5
5
  "dependencies": {
6
- "@cloudbase/weda-client": "0.2.12",
6
+ "@cloudbase/weda-client": "0.2.15",
7
7
  "@cloudbase/oauth": "0.1.1-alpha.5",
8
8
  "mobx": "^5.15.4",
9
9
  "lodash.get": "^4.4.2",
@@ -8,7 +8,7 @@
8
8
  "@cloudbase/js-sdk": "2.4.0-alpha.0",
9
9
  "@cloudbase/weda-client": "0.2.12",
10
10
  "@tcwd/weapps-core": "2.2.6",
11
- "@tcwd/weapps-sdk": "1.2.9",
11
+ "@tcwd/weapps-sdk": "1.2.10",
12
12
  "@zxing/library": "^0.18.6",
13
13
  "lodash": "^4.17.19",
14
14
  "mobx": "^5.15.4",
@@ -36,7 +36,7 @@
36
36
  "babel-plugin-import": "^1.13.0",
37
37
  "base64-inline-loader": "^1.1.1",
38
38
  "copy-webpack-plugin": "^6.2.1",
39
- "css-loader": "^3.4.0",
39
+ "css-loader": "^5",
40
40
  "happypack": "^5.0.1",
41
41
  "dart-sass": "^1.24.0",
42
42
  "postcss": "^8.3.6",
@@ -46,6 +46,7 @@
46
46
  "qiankun": "^2.7.0",
47
47
  "less": "^4.0.0",
48
48
  "less-loader": "^7.0.1",
49
+ "loader-utils": "^3.2.0",
49
50
  "sass-loader": "^8.0.0",
50
51
  "terser-webpack-plugin": "^3.0.2",
51
52
  "mini-css-extract-plugin": "^0.8.0",
@@ -139,7 +139,7 @@ export function pageLifeCycleMount(
139
139
  onTabItemTap,
140
140
  },
141
141
  app = {},
142
- extra = {}
142
+ extra = {},
143
143
  ) {
144
144
  let queryText = location.href.split('?')[1];
145
145
  let query = querystring.parse(queryText);
@@ -148,7 +148,7 @@ export function pageLifeCycleMount(
148
148
  // 包装页面加载回掉, 增加取数据变量值逻辑
149
149
  const onPageLoadCallback = (...args) => {
150
150
  beforePageCustomLaunch(...args);
151
- onPageLoad && onPageLoad(...args);
151
+ onPageLoad?.(...args);
152
152
  };
153
153
  useEffect(() => {
154
154
  onPageLoadCallback(query);
@@ -160,13 +160,13 @@ export function pageLifeCycleMount(
160
160
  }
161
161
  if (typeof onPageScroll === 'function' || typeof onReachBottom === 'function') {
162
162
  window.onscroll = throttle(() => {
163
- //变量scrollTop是滚动条滚动时,滚动条上端距离顶部的距离
163
+ // 变量scrollTop是滚动条滚动时,滚动条上端距离顶部的距离
164
164
  let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
165
165
 
166
- //变量windowHeight是可视区的高度
166
+ // 变量windowHeight是可视区的高度
167
167
  let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
168
168
 
169
- //变量scrollHeight是滚动条的总高度(当前可滚动的页面的总高度)
169
+ // 变量scrollHeight是滚动条的总高度(当前可滚动的页面的总高度)
170
170
  let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
171
171
  if (typeof onPageScroll === 'function') {
172
172
  onPageScroll({
@@ -0,0 +1,28 @@
1
+ // Stolen from https://github.com/facebook/create-react-app/blob/cee26589ff919e946030a5651a93ccba78a93293/packages/react-dev-utils/getCSSModuleLocalIdent.js
2
+ /**
3
+ * Copyright (c) 2015-present, Facebook, Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ const loaderUtils = require('loader-utils');
12
+ const path = require('path');
13
+
14
+ module.exports = function getLocalIdent(context, localIdentName, localName, options) {
15
+ // Use the filename or folder name, based on some uses the index.js / index.module.(css|scss|sass) project style
16
+ const fileNameOrFolder = context.resourcePath.match(/index\.module\.(css|scss|sass)$/) ? '[folder]' : '[name]';
17
+ // Create a hash based on a the file location and class name. Will be unique across a project, and close to globally unique.
18
+ const hash = loaderUtils.getHashDigest(
19
+ path.posix.relative(context.rootContext, context.resourcePath) + localName,
20
+ 'md5',
21
+ 'base64',
22
+ 5,
23
+ );
24
+ // Use loaderUtils to find the file or folder name
25
+ const className = loaderUtils.interpolateName(context, fileNameOrFolder + '_' + localName + '__' + hash, options);
26
+ // Remove the .module that appears in every classname when based on the file and replace all "." with "_".
27
+ return className.replace('.module_', '_').replace(/\./g, '_');
28
+ };
@@ -3,9 +3,9 @@ const webpack = require('webpack');
3
3
  const TerserPlugin = require('terser-webpack-plugin');
4
4
  const HtmlWebpackPlugin = require('html-webpack-plugin');
5
5
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6
- const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
7
6
  const CopyWebpackPlugin = require('copy-webpack-plugin');
8
7
  const themeVars = require('./themeVars');
8
+ const getCSSModuleLocalIdent = require('./getCSSModuleLocalIdent');
9
9
  const HappyPack = require('happypack');
10
10
  const core = 4;
11
11
  const happyThreadPool = HappyPack.ThreadPool({ size: core });
@@ -125,8 +125,8 @@ module.exports = function (options) {
125
125
  'process.env.isMiniprogram': false, // 注入环境变量,用于业务代码判断
126
126
  'process.env.SSR': false,
127
127
  },
128
- definePlugin
129
- )
128
+ definePlugin,
129
+ ),
130
130
  ),
131
131
  new CopyWebpackPlugin({
132
132
  patterns: [
@@ -153,7 +153,10 @@ module.exports = function (options) {
153
153
  {
154
154
  loader: 'css-loader',
155
155
  options: {
156
- modules: false,
156
+ modules: {
157
+ auto: true,
158
+ getLocalIdent: getCSSModuleLocalIdent,
159
+ },
157
160
  importLoaders: 2,
158
161
  },
159
162
  },
@@ -216,7 +219,8 @@ module.exports = function (options) {
216
219
  },
217
220
  {
218
221
  test: /\.(js|jsx)$/,
219
- exclude: /node_modules\/(?!(@cloudbase\/weda-ui)|(@tcwd\/vuera)|(@tcwd\/weapps-core)|(@tcwd\/weapps-core))|gsd-kbone-react/,
222
+ exclude:
223
+ /node_modules\/(?!(@cloudbase\/weda-ui)|(@tcwd\/vuera)|(@tcwd\/weapps-core)|(@tcwd\/weapps-core))|gsd-kbone-react/,
220
224
  use: ['happypack/loader?id=babel'],
221
225
  },
222
226
  {