@cloudbase/lowcode-builder 1.9.0 → 1.9.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/lib/builder/config/dependencies.js +3 -3
- package/lib/builder/h5/index.js +45 -0
- package/lib/builder/h5/npm.d.ts +3 -2
- package/lib/builder/h5/npm.js +4 -3
- package/lib/builder/h5/webpack.d.ts +2 -1
- package/lib/builder/h5/webpack.js +2 -1
- package/lib/builder/service/webpack.d.ts +3 -2
- package/lib/builder/service/webpack.js +4 -3
- package/lib/builder.web.js +3 -3
- package/package.json +3 -3
- package/template/html/index.html.ejs +7 -1
- package/template/mp/common/util.js +5 -1
- package/template/package.json +3 -1
- package/template/webpack/web.prod.js +76 -59
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/core": "7.21.4",
|
|
49
49
|
"@babel/preset-env": "7.21.4",
|
|
50
|
-
"@cloudbase/cals": "^1.1.
|
|
50
|
+
"@cloudbase/cals": "^1.1.12",
|
|
51
51
|
"@cloudbase/lowcode-generator": "^1.8.34",
|
|
52
52
|
"axios": "^0.21.0",
|
|
53
53
|
"browserfs": "^1.4.3",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"compare-versions": "^3.6.0",
|
|
57
57
|
"compressing": "^1.4.0",
|
|
58
58
|
"constants-browserify": "^1.0.0",
|
|
59
|
-
"cross-spawn": "^
|
|
59
|
+
"cross-spawn": "^7.0.3",
|
|
60
60
|
"crypto-browserify": "^3.12.0",
|
|
61
61
|
"fs-extra": "^7.0.1",
|
|
62
62
|
"jszip": "^3.7.1",
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
<link type="text/css" rel="stylesheet" href="<%=styleUrl %>" />
|
|
25
25
|
<% })%> <% if(cdnEndpoints.aegis){ %>
|
|
26
26
|
<script crossorigin="anonymous" src="<%= cdnEndpoints.aegis %>/aegis-sdk/latest/aegis.min.js"></script>
|
|
27
|
+
<script>
|
|
28
|
+
// globalThis polifill
|
|
29
|
+
if (!this.globalThis) {
|
|
30
|
+
this.globalThis = this;
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
27
33
|
<script>
|
|
28
34
|
if (Aegis) {
|
|
29
35
|
const _aegis = new Aegis({
|
|
@@ -551,7 +557,7 @@
|
|
|
551
557
|
crossorigin
|
|
552
558
|
src="<%=
|
|
553
559
|
cdnEndpoints.cdngo
|
|
554
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
560
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.666cbe2101327384c0ed.bundle.js"
|
|
555
561
|
></script>
|
|
556
562
|
</body>
|
|
557
563
|
</html>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
import { auth } from '@cloudbase/weda-client';
|
|
4
4
|
const { checkAnonymous, __internal__ = {}} = auth;
|
|
5
|
-
const { getAuthConfig, redirectToLogin, getAccessPermission, findLoginPage } = __internal__
|
|
5
|
+
const { getAuthConfig, redirectToLogin, getAccessPermission, findLoginPage, cleanAccessPermissionCache } = __internal__
|
|
6
6
|
import { getWedaAPI } from '@cloudbase/weda-client'
|
|
7
7
|
|
|
8
8
|
let LOGIN_CONFIG = <%= customLoginConfig %>
|
|
@@ -66,10 +66,12 @@ export async function checkAuth(app, appId, $page) {
|
|
|
66
66
|
if(hasOpenIdLoginType){
|
|
67
67
|
// 开启了openId静默登录,则进行openid登录
|
|
68
68
|
const result = await app.cloud.openIdLoginInWxApp();
|
|
69
|
+
cleanAccessPermissionCache?.()
|
|
69
70
|
return result
|
|
70
71
|
} else if (hasUnionIdLoginType) {
|
|
71
72
|
// 开启了unionId静默登录,则进行unionId登录
|
|
72
73
|
const result = await app.cloud.unionIdLoginInWxApp();
|
|
74
|
+
cleanAccessPermissionCache?.()
|
|
73
75
|
return result
|
|
74
76
|
}
|
|
75
77
|
else if (loginPage) {
|
|
@@ -88,10 +90,12 @@ export async function checkAuth(app, appId, $page) {
|
|
|
88
90
|
if (hasOpenIdLoginType) {
|
|
89
91
|
// openId静默登录
|
|
90
92
|
const result = await app.cloud.openIdLoginInWxApp();
|
|
93
|
+
cleanAccessPermissionCache?.()
|
|
91
94
|
return result
|
|
92
95
|
} else if (hasUnionIdLoginType) {
|
|
93
96
|
// 开启了unionId静默登录
|
|
94
97
|
const result = await app.cloud.unionIdLoginInWxApp();
|
|
98
|
+
cleanAccessPermissionCache?.()
|
|
95
99
|
return result
|
|
96
100
|
} else if (loginPage) {
|
|
97
101
|
try {
|
package/template/package.json
CHANGED
|
@@ -56,7 +56,9 @@
|
|
|
56
56
|
"html-webpack-plugin": "^4.5.2",
|
|
57
57
|
"ts-loader": "^8.3.0",
|
|
58
58
|
"typescript": "^4.4.4",
|
|
59
|
-
"
|
|
59
|
+
"veaury": "^2.4.2",
|
|
60
|
+
"vue-loader": "^17.4.2",
|
|
61
|
+
"vue-loader-for-vue2": "npm:vue-loader@15",
|
|
60
62
|
"vue-template-compiler": "2.6.14",
|
|
61
63
|
"webpack": "^4.47.0",
|
|
62
64
|
"webpack-dev-server": "^3.11.3",
|
|
@@ -5,7 +5,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
5
5
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
6
6
|
// const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
|
|
7
7
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
8
|
-
const { VueLoaderPlugin } = require('vue-loader');
|
|
9
8
|
const themeVars = require('./themeVars');
|
|
10
9
|
const getCSSModuleLocalIdent = require('./getCSSModuleLocalIdent');
|
|
11
10
|
const HappyPack = require('happypack');
|
|
@@ -25,6 +24,7 @@ module.exports = function (options) {
|
|
|
25
24
|
htmlTemplatePath,
|
|
26
25
|
definePlugin = {},
|
|
27
26
|
devtool = false,
|
|
27
|
+
vueVersion = 0,
|
|
28
28
|
} = options;
|
|
29
29
|
|
|
30
30
|
const babelLoader = {
|
|
@@ -126,9 +126,21 @@ module.exports = function (options) {
|
|
|
126
126
|
SSR: false,
|
|
127
127
|
WEBPACK_ENV: 'production',
|
|
128
128
|
}),
|
|
129
|
-
new VueLoaderPlugin(),
|
|
130
129
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
|
131
130
|
];
|
|
131
|
+
if (vueVersion === 2) {
|
|
132
|
+
const { VueLoaderPlugin } = require('vue-loader-for-vue2');
|
|
133
|
+
plugins.push(new VueLoaderPlugin());
|
|
134
|
+
} else if (vueVersion === 3) {
|
|
135
|
+
plugins.push(new (require('veaury/webpack/VeauryVuePlugin'))());
|
|
136
|
+
plugins.push(
|
|
137
|
+
new webpack.DefinePlugin({
|
|
138
|
+
__VUE_OPTIONS_API__: 'true',
|
|
139
|
+
__VUE_PROD_DEVTOOLS__: 'false',
|
|
140
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
143
|
+
}
|
|
132
144
|
|
|
133
145
|
const commonCSSLoaders = [
|
|
134
146
|
MiniCssExtractPlugin.loader,
|
|
@@ -144,6 +156,67 @@ module.exports = function (options) {
|
|
|
144
156
|
},
|
|
145
157
|
];
|
|
146
158
|
|
|
159
|
+
const rules = [
|
|
160
|
+
{
|
|
161
|
+
test: /\.tsx?$/,
|
|
162
|
+
exclude: /node_modules\/(?!@cloudbase\/weda-ui)|gsd-kbone-react/,
|
|
163
|
+
use: [`happypack/loader?id=${TS_LOADER_ID}`],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
test: /\.(js|jsx)$/,
|
|
167
|
+
exclude:
|
|
168
|
+
/node_modules\/(?!(@cloudbase\/weda-ui)|(@tcwd\/vuera)|(@tcwd\/weapps-core)|(@react-spring)|(@react-hookz))|gsd-kbone-react/,
|
|
169
|
+
use: ['happypack/loader?id=babel'],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
test: /node_modules\/@loadable\/component\/.*\.mjs$/,
|
|
173
|
+
include: /node_modules/,
|
|
174
|
+
type: 'javascript/auto',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
test: /\.(scss|sass)$/,
|
|
178
|
+
use: [
|
|
179
|
+
...commonCSSLoaders,
|
|
180
|
+
{
|
|
181
|
+
loader: 'sass-loader',
|
|
182
|
+
options: {
|
|
183
|
+
implementation: require('sass'),
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
test: /\.css$/,
|
|
190
|
+
use: [...commonCSSLoaders],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
test: /\.less$/,
|
|
194
|
+
use: [
|
|
195
|
+
...commonCSSLoaders,
|
|
196
|
+
{
|
|
197
|
+
loader: 'less-loader',
|
|
198
|
+
options: {
|
|
199
|
+
lessOptions: {
|
|
200
|
+
modifyVars: themeVars,
|
|
201
|
+
javascriptEnabled: true,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
test: /\.(jpe?g|png|gif|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
|
|
209
|
+
loader: 'base64-inline-loader',
|
|
210
|
+
},
|
|
211
|
+
];
|
|
212
|
+
|
|
213
|
+
if (vueVersion === 2) {
|
|
214
|
+
rules.push({
|
|
215
|
+
test: /\.vue$/,
|
|
216
|
+
loader: require.resolve('vue-loader-for-vue2'),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
147
220
|
return {
|
|
148
221
|
context,
|
|
149
222
|
entry,
|
|
@@ -168,63 +241,7 @@ module.exports = function (options) {
|
|
|
168
241
|
},
|
|
169
242
|
},
|
|
170
243
|
module: {
|
|
171
|
-
rules
|
|
172
|
-
{
|
|
173
|
-
test: /\.vue$/,
|
|
174
|
-
loader: require.resolve('vue-loader'),
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
test: /\.tsx?$/,
|
|
178
|
-
exclude: /node_modules\/(?!@cloudbase\/weda-ui)|gsd-kbone-react/,
|
|
179
|
-
use: [`happypack/loader?id=${TS_LOADER_ID}`],
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
test: /\.(js|jsx)$/,
|
|
183
|
-
exclude:
|
|
184
|
-
/node_modules\/(?!(@cloudbase\/weda-ui)|(@tcwd\/vuera)|(@tcwd\/weapps-core)|(@react-spring)|(@react-hookz))|gsd-kbone-react/,
|
|
185
|
-
use: ['happypack/loader?id=babel'],
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
test: /node_modules\/@loadable\/component\/.*\.mjs$/,
|
|
189
|
-
include: /node_modules/,
|
|
190
|
-
type: 'javascript/auto',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
test: /\.(scss|sass)$/,
|
|
194
|
-
use: [
|
|
195
|
-
...commonCSSLoaders,
|
|
196
|
-
{
|
|
197
|
-
loader: 'sass-loader',
|
|
198
|
-
options: {
|
|
199
|
-
implementation: require('sass'),
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
test: /\.css$/,
|
|
206
|
-
use: [...commonCSSLoaders],
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
test: /\.less$/,
|
|
210
|
-
use: [
|
|
211
|
-
...commonCSSLoaders,
|
|
212
|
-
{
|
|
213
|
-
loader: 'less-loader',
|
|
214
|
-
options: {
|
|
215
|
-
lessOptions: {
|
|
216
|
-
modifyVars: themeVars,
|
|
217
|
-
javascriptEnabled: true,
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
test: /\.(jpe?g|png|gif|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
|
|
225
|
-
loader: 'base64-inline-loader',
|
|
226
|
-
},
|
|
227
|
-
],
|
|
244
|
+
rules,
|
|
228
245
|
},
|
|
229
246
|
plugins,
|
|
230
247
|
optimization: {
|