@winner-fed/winner-deploy 4.3.2 → 4.3.3

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/TYPE.md ADDED
@@ -0,0 +1,249 @@
1
+ # 模板变量说明
2
+
3
+ ## 模板变量配置说明
4
+
5
+ 目前,模板变量控件支持以下类型
6
+
7
+ - input - 普通文本输入框。
8
+ - select - 单选下拉框。
9
+ - switch - 开关组件。
10
+ - smallfile - 文件上传控件,仅支持小于 2M 的文件,文件内容以 base64 转码后的字符串存储。
11
+ - switchForm - 开关表单,通过控件 switch 控制下面表单的显示
12
+ - complexSelect - 复杂单选框,通过控件 select 控制下面显示哪个表单
13
+ - table - 表格控件,table 类型的模板配置目前只支持 Array<Object> 类型配置项,比如 APPS。
14
+ - division - 分栏折叠控件,division 分栏组件将界面上众多的组件分栏并给出每一栏目的标头。该控件仅用于界面展示控制由于其不具有 name 属性故其子元素取值方式保持原有不变,举例 division 包含子控件 b 其取值变量为 b)。分区组件,用于界面控制,作为分栏使用,对参数使用没意义。
15
+ - password - 密码输入框,密码框输入值将被加密保存,数据加密处理。
16
+ - hidden - 隐藏输入框,默认值输入框,不显示给用户,用于存储系统级别的配置参数。
17
+
18
+ ### input(输入框)
19
+
20
+ 配置如下所示
21
+
22
+ ```js
23
+ variables: [
24
+ {
25
+ type: 'input', // 控件类型,这里是 input 控件
26
+ label: 'input', // 左侧的 label 标签
27
+ tooltip: ' Input 输入框 测试 ', // 控件下面的提示框
28
+ name: 'INPUT', // 变量绑定,跟 sysconfig.js 或者 config.local.js 文件下的 window.LOCAL_CONFIG 属性字段的 key 相对应
29
+ default: '输入框的默认值' // input 的默认值
30
+ }
31
+ ];
32
+ ```
33
+
34
+ ### select(单选框)
35
+
36
+ 配置如下所示
37
+
38
+ ```js
39
+ variables: [
40
+ {
41
+ type: 'select', // 控件类型 这里是 单选框
42
+ label: 'select', // 左侧的 label 标签
43
+ options: 'A:A;B:B;C:C', // 单选框选项, 值:标签 为一组,标签和值用 ":" 分开,每一组选项用 ";" 分开
44
+ tooltip: 'select 单选框 测试', // 控件下面的提示框
45
+ name: 'SELECT', // 变量绑定,跟 sysconfig.js 或者 config.local.js 文件下的 window.LOCAL_CONFIG 属性字段的 key 相对应
46
+ default: 'A' // 默认值,这里默认选项值为 A
47
+ }
48
+ ];
49
+ ```
50
+
51
+ ### switch(开关)
52
+
53
+ 配置如下所示
54
+
55
+ ```js
56
+ variables: [
57
+ {
58
+ type: 'switch', // 控件类型 这里是开关
59
+ label: 'switch', // 左侧的 label 标签
60
+ tooltip: 'switch 开关 测试', // 控件下面的提示框
61
+ name: 'SWITCH', // 变量绑定,跟 sysconfig.js 或者 config.local.js 文件下的 window.LOCAL_CONFIG 属性字段的 key 相对应
62
+ options: 'true:是;false:否', // 开关选项选项, 值:标签为一组,标签和值用 ":" 分开,只有两者,true和 false
63
+ default: 'true' // 默认值
64
+ }
65
+ ];
66
+ ```
67
+
68
+ ### switchForm(开关表单)
69
+
70
+ 配置如下所示
71
+
72
+ ```js
73
+ variables: [
74
+ {
75
+ type: 'switchForm', // 控件类型
76
+ label: 'switchForm', // 左侧的 label 标签
77
+ tooltip: 'switchForm 开关表单 测试', // 控件下面的提示框
78
+ name: 'SWITCH_FORM', // 变量绑定,跟 sysconfig.js 或者 config.local.js 文件下的 window.LOCAL_CONFIG 属性字段的 key 相对应
79
+ children: [
80
+ //!!! 开关表单下面的表单元素
81
+ {
82
+ type: 'mselect',
83
+ label: 'switchForm mselect',
84
+ options: 'A:A;B:B;C:C;D:D',
85
+ tooltip: 'switchForm mselect 开关表单 多选框 测试',
86
+ name: 'SWITCH_FORM_MSELECT',
87
+ default: 'A,B'
88
+ }
89
+ ]
90
+ }
91
+ ];
92
+ ```
93
+
94
+ ### complexSelect
95
+
96
+ 配置如下所示
97
+
98
+ ```js
99
+ variables: [
100
+ {
101
+ type: 'complexSelect',
102
+ label: 'complexSelect',
103
+ tooltip: '复杂选择器 测试 注意,一次只能一个表单填写的值有效,当保存一个表单填写的值后其他的值会 “制空”',
104
+ options: 'A:第一个表单;B:第二个表单', // 单选框选项
105
+ name: 'ComplexSelect',
106
+ children: [
107
+ {
108
+ type: 'form',
109
+ name: 'A', // 下拉框对应选项的值,如果单选框选择的值为 A,则会显示这表单
110
+ children: [
111
+ // ...
112
+ ]
113
+ },
114
+ {
115
+ type: 'form',
116
+ name: 'B', // 下拉框对应选项的值,如果单选框选择的值为 B,则会显示这表单
117
+ children: [
118
+ // ...
119
+ ]
120
+ }
121
+ ]
122
+ }
123
+ ];
124
+ ```
125
+
126
+ ### table
127
+
128
+ 配置如下所示
129
+
130
+ ```js
131
+ variables: [
132
+ {
133
+ type: 'table', // 控件类型
134
+ label: 'table', // 左侧 标签名
135
+ tooltip: 'table 表格 测试 使用 frameLayout - app', // 下面控件的提示语
136
+ name: 'TABLES',
137
+ columns: [
138
+ {
139
+ type: 'input', // 类型
140
+ label: '应用名称', // 标签名
141
+ name: 'name', // 模板变量绑定名
142
+ default: 'foo' // 默认值
143
+ },
144
+ {
145
+ type: 'input',
146
+ label: '应用入口',
147
+ name: 'entry',
148
+ default: '//192.168.194.101:8010/omc/index.html'
149
+ },
150
+ {
151
+ type: 'input',
152
+ label: '挂载容器',
153
+ name: 'container',
154
+ default: '#subapp-container'
155
+ },
156
+ {
157
+ type: 'input',
158
+ label: '激活条件',
159
+ name: 'activeWhen',
160
+ default: ''
161
+ },
162
+ {
163
+ type: 'input',
164
+ label: '路由前缀',
165
+ name: 'urlPrefix',
166
+ default: '/foo/#'
167
+ }
168
+ ]
169
+ }
170
+ ];
171
+ ```
172
+
173
+ ### division
174
+
175
+ 配置如下所示
176
+
177
+ ```js
178
+ variables: [
179
+ {
180
+ type: 'division',
181
+ label: '中银证券分享页配置参数',
182
+ name: 'bocichiaShareSetting',
183
+ fold: false,
184
+ children: [
185
+ {
186
+ type: 'input',
187
+ label: '用户中心',
188
+ name: 'API_BIND',
189
+ default: 'https://zygjdev.winner123.cn/g/hsxone.uic/v'
190
+ },
191
+ {
192
+ type: 'input',
193
+ label: '用户中心(boc)',
194
+ name: 'API_BIND_BOC',
195
+ default: 'https://zygjdev.winner123.cn/g/hsxone.uic.boc/v'
196
+ },
197
+ {
198
+ type: 'input',
199
+ label: '权益中心',
200
+ name: 'API_HOME',
201
+ default: 'https://zygjdev.winner123.cn/g/hsxone.ric.member/v'
202
+ },
203
+ {
204
+ type: 'input',
205
+ label: '是否启用调试工具',
206
+ name: 'IS_OPEN_VCONSOLE',
207
+ default: 'false'
208
+ }
209
+ ]
210
+ }
211
+ ];
212
+ ```
213
+
214
+ ### password(密码输入框)
215
+
216
+ 配置如下所示
217
+
218
+ ```js
219
+ variables: [
220
+ {
221
+ type: 'password', // 控件类型,这里是密码输入框
222
+ label: '数据库密码', // 左侧的 label 标签
223
+ tooltip: '数据库连接密码', // 控件下面的提示框
224
+ name: 'DB_PASSWORD', // 变量绑定,跟 sysconfig.js 或者 config.local.js 文件下的 window.LOCAL_CONFIG 属性字段的 key 相对应
225
+ required: true, // 是否必填
226
+ default: '' // 默认值
227
+ }
228
+ ];
229
+ ```
230
+
231
+ ### hidden(隐藏输入框)
232
+
233
+ 配置如下所示
234
+
235
+ ```js
236
+ variables: [
237
+ {
238
+ type: 'hidden', // 控件类型,这里是隐藏输入框
239
+ label: '应用版本号', // 左侧的 label 标签(虽然隐藏,但仍需要设置)
240
+ tooltip: '应用内部版本号,用于系统识别', // 控件下面的提示框
241
+ name: 'APP_VERSION', // 变量绑定,跟 sysconfig.js 或者 config.local.js 文件下的 window.LOCAL_CONFIG 属性字段的 key 相对应
242
+ default: '1.0.0' // 默认值
243
+ }
244
+ ];
245
+ ```
246
+
247
+ ## more
248
+
249
+ 更多内容可参考 see 平台的 [Deploy 帮助手册](http://rdcdocs.hundsun.com/pages/viewpage.action?pageId=39243038)
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /** build time: Fri Jul 04 2025 16:18:17 GMT+0800 (中国标准时间), build version 4.3.2 **/
1
+ /** build time: Fri Jul 04 2025 16:33:17 GMT+0800 (China Standard Time), build version 4.3.3 **/
2
2
  var $e=Object.create;var R=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames,Y=Object.getOwnPropertySymbols,be=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;var ee=(o,e,n)=>e in o?R(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,K=(o,e)=>{for(var n in e||(e={}))te.call(e,n)&&ee(o,n,e[n]);if(Y)for(var n of Y(e))Oe.call(e,n)&&ee(o,n,e[n]);return o};var ke=(o,e)=>{for(var n in e)R(o,n,{get:e[n],enumerable:!0})},ne=(o,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xe(e))!te.call(o,s)&&s!==n&&R(o,s,{get:()=>e[s],enumerable:!(i=he(e,s))||i.enumerable});return o};var S=(o,e,n)=>(n=o!=null?$e(be(o)):{},ne(e||!o||!o.__esModule?R(n,"default",{value:o,enumerable:!0}):n,o)),Te=o=>ne(R({},"__esModule",{value:!0}),o);var Fe={};ke(Fe,{generateSeePackageZip:()=>Ae});module.exports=Te(Fe);var ge=S(require("chalk"),1),de=S(require("path"),1),O=S(require("fs-extra"),1);var $=S(require("fs-extra"),1),Z=require("rimraf");var Q=S(require("path"),1),M=S(require("fs-extra"),1),re=S(require("archiver"),1),J=S(require("xml"),1);var q=process.cwd(),L=function(e){let n={"&quot;":'"',"&apos;":"'","&lt;":"<","&gt;":">"},i=/(&quot;)|(&apos;)|(&lt;)|(&gt;)/g;return e&&e.replace?e.replace(i,function(s){return n[s]}):e},j=function(e,n){let i=n||"",s=Q.default.resolve(q,e,i,"sysconfig.js");return M.default.pathExistsSync(s)},U=function(e){let n=Q.default.resolve(q,e,"config.local.js");return M.default.pathExistsSync(n)},D=function(e,n,i,s){let r=Q.default.join(q,n);n!=="/"&&M.default.ensureDirSync(r);let t=M.default.createWriteStream(`${n==="/"?".":r}/${e}.zip`);t.on("close",function(){setTimeout(function(){s&&s()})});let l=(0,re.default)("zip",{zlib:{level:9}});l.on("error",function(c){console.error(),console.error(c.stack||c),c.details&&console.error(c.details)}),l.pipe(t),l.directory(i,!1),l.finalize()},C=function(e,n,i){let{type:s,label:r,name:t,tooltip:l="",visible:c="true",required:p="false",fixed:y="false",fold:f="false",options:a="",validate:m="",upgrade:u="false"}=e,k=e.default;if(i==="form"){let T=(0,J.default)({form:[{_attr:{name:t,tooltip:l,visible:c,required:p,fixed:y,fold:f,options:a,validate:m,upgrade:u}},n]});return L(T)}let g=s==="complexSelect"?{default:e.default}:{},P=(0,J.default)({field:[{_attr:K({type:s,label:r,name:t,tooltip:l,visible:c,required:p,fixed:y,fold:f,options:a,validate:m,upgrade:u},g)},n||k]});return L(P)},oe=function(e){let i=e.children.map(s=>{let t=s.children.map(l=>C(l)).join("");return C(s,t,"form")}).join("");return C(e,i)},V=function o(e,n,i="",s=""){for(let r=0;r<e.length;r++){let t=e[r];if(t.type==="complexSelect"?(t.fullName=`${t.name}`,t.fullPath=`${t.type}`):(t.fullName=`${i===""?"":i+"."}${t.name}`,t.fullPath=`${s===""?"":s+"-"}${t.type}`),n(t))return t;if(t.children&&t.children.length>0){let l=o(t.children,n,t.fullName,t.fullPath);if(l)return l}}return null};function ie(o="python"){return o==="python"?"py":"sh"}var N=S(require("fs-extra"),1),se=S(require("path"),1),w=S(require("lodash.template"),1),le=S(require("xml"),1),ce=S(require("@babel/core"),1);var Pe=["input","editor","select","switch","smallfile","table","mselect","switchForm","complexSelect","division","password","hidden"],E=o=>se.default.resolve(__dirname,`../templates/see/${o}`),z=o=>{let e=o.type;if(!Pe.includes(e))return"";let{label:n,name:i,tooltip:s="",visible:r="true",required:t="false",fixed:l="false",fold:c="false",options:p="",validate:y="",upgrade:f="false"}=o,a=o.default;if(e==="table"){let k=o.keys||[];a=(o.columns||k).map(P=>z(P)).join(`
3
3
  `)}else if(e==="switchForm"||e==="division")a=o.children.map(g=>z(g)).join(`
4
4
  `);else{if(e==="complexSelect")return oe(o);e==="editor"?a=typeof a=="object"?[JSON.stringify(a)]:[a]:a=[a]}let m=e==="switchForm"?{default:o.default}:{},u=(0,le.default)({field:[{_attr:K({type:e,label:n,name:i,tooltip:s,visible:r,required:t,fixed:l,fold:c,options:p,validate:y,upgrade:f},m)},...Array.isArray(a)?a:[a]]});return L(u)},ae=function({system:e,type:n,name:i,appType:s,appName:r,group:t,version:l,configFileName:c="config.local",variables:p=[],description:y,scriptsType:f="python"}){let a=N.default.readFileSync(E(`${f}/deploy.xml`)).toString();return(0,w.default)(a,{interpolate:/{{([\s\S]+?)}}/g})({system:e,type:n,name:i,appName:r,appType:s,group:t,version:l,configFileName:c,variables:p.map(m=>z(m)).join(`
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** build time: Fri Jul 04 2025 16:18:17 GMT+0800 (中国标准时间), build version 4.3.2 **/
1
+ /** build time: Fri Jul 04 2025 16:33:17 GMT+0800 (China Standard Time), build version 4.3.3 **/
2
2
  var ae=Object.defineProperty;var q=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var Z=(i,t,n)=>t in i?ae(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,M=(i,t)=>{for(var n in t||(t={}))pe.call(t,n)&&Z(i,n,t[n]);if(q)for(var n of q(t))fe.call(t,n)&&Z(i,n,t[n]);return i};var B=(i=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(i,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):i)(function(i){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});import Se from"chalk";import $e from"path";import k from"fs-extra";import $ from"fs-extra";import{rimraf as re}from"rimraf";import V from"path";import E from"fs-extra";import me from"archiver";import W from"xml";var z=process.cwd(),X=function(t){let n={"&quot;":'"',"&apos;":"'","&lt;":"<","&gt;":">"},o=/(&quot;)|(&apos;)|(&lt;)|(&gt;)/g;return t&&t.replace?t.replace(o,function(c){return n[c]}):t},F=function(t,n){let o=n||"",c=V.resolve(z,t,o,"sysconfig.js");return E.pathExistsSync(c)},K=function(t){let n=V.resolve(z,t,"config.local.js");return E.pathExistsSync(n)},j=function(t,n,o,c){let r=V.join(z,n);n!=="/"&&E.ensureDirSync(r);let e=E.createWriteStream(`${n==="/"?".":r}/${t}.zip`);e.on("close",function(){setTimeout(function(){c&&c()})});let s=me("zip",{zlib:{level:9}});s.on("error",function(l){console.error(),console.error(l.stack||l),l.details&&console.error(l.details)}),s.pipe(e),s.directory(o,!1),s.finalize()},U=function(t,n,o){let{type:c,label:r,name:e,tooltip:s="",visible:l="true",required:p="false",fixed:y="false",fold:f="false",options:a="",validate:m="",upgrade:u="false"}=t,x=t.default;if(o==="form"){let b=W({form:[{_attr:{name:e,tooltip:s,visible:l,required:p,fixed:y,fold:f,options:a,validate:m,upgrade:u}},n]});return X(b)}let g=c==="complexSelect"?{default:t.default}:{},T=W({field:[{_attr:M({type:c,label:r,name:e,tooltip:s,visible:l,required:p,fixed:y,fold:f,options:a,validate:m,upgrade:u},g)},n||x]});return X(T)},G=function(t){let o=t.children.map(c=>{let e=c.children.map(s=>U(s)).join("");return U(c,e,"form")}).join("");return U(t,o)},L=function i(t,n,o="",c=""){for(let r=0;r<t.length;r++){let e=t[r];if(e.type==="complexSelect"?(e.fullName=`${e.name}`,e.fullPath=`${e.type}`):(e.fullName=`${o===""?"":o+"."}${e.name}`,e.fullPath=`${c===""?"":c+"-"}${e.type}`),n(e))return e;if(e.children&&e.children.length>0){let s=i(e.children,n,e.fullName,e.fullPath);if(s)return s}}return null};function H(i="python"){return i==="python"?"py":"sh"}import N from"fs-extra";import ue from"path";import w from"lodash.template";import ye from"xml";import ge from"@babel/core";var de=["input","editor","select","switch","smallfile","table","mselect","switchForm","complexSelect","division","password","hidden"],I=i=>ue.resolve(__dirname,`../templates/see/${i}`),Q=i=>{let t=i.type;if(!de.includes(t))return"";let{label:n,name:o,tooltip:c="",visible:r="true",required:e="false",fixed:s="false",fold:l="false",options:p="",validate:y="",upgrade:f="false"}=i,a=i.default;if(t==="table"){let x=i.keys||[];a=(i.columns||x).map(T=>Q(T)).join(`
3
3
  `)}else if(t==="switchForm"||t==="division")a=i.children.map(g=>Q(g)).join(`
4
4
  `);else{if(t==="complexSelect")return G(i);t==="editor"?a=typeof a=="object"?[JSON.stringify(a)]:[a]:a=[a]}let m=t==="switchForm"?{default:i.default}:{},u=ye({field:[{_attr:M({type:t,label:n,name:o,tooltip:c,visible:r,required:e,fixed:s,fold:l,options:p,validate:y,upgrade:f},m)},...Array.isArray(a)?a:[a]]});return X(u)},Y=function({system:t,type:n,name:o,appType:c,appName:r,group:e,version:s,configFileName:l="config.local",variables:p=[],description:y,scriptsType:f="python"}){let a=N.readFileSync(I(`${f}/deploy.xml`)).toString();return w(a,{interpolate:/{{([\s\S]+?)}}/g})({system:t,type:n,name:o,appName:r,appType:c,group:e,version:s,configFileName:l,variables:p.map(m=>Q(m)).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winner-fed/winner-deploy",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "description": "Generate a publication deployed by the See platform",
5
5
  "keywords": [
6
6
  "winner",
@@ -32,7 +32,8 @@
32
32
  "sideEffects": false,
33
33
  "files": [
34
34
  "dist",
35
- "templates"
35
+ "templates",
36
+ "TYPE.md"
36
37
  ],
37
38
  "dependencies": {
38
39
  "@babel/core": "catalog:",