@vtj/coder 0.12.59 → 0.12.61
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/dist/index.cjs +35 -35
- package/dist/index.mjs +258 -242
- package/package.json +2 -2
- package/types/generator.d.ts +10 -1
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@vtj/base"),D=require("prettier/standalone"),K=require("prettier/plugins/html"),ee=require("prettier/plugins/babel"),te=require("prettier/plugins/postcss"),se=require("prettier/plugins/estree");function F(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const ne=F(K),q=F(ee),M=F(te),U=F(se);/**!
|
|
2
2
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/coder
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.12.
|
|
5
|
+
* @version 0.12.61
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const re="0.12.
|
|
7
|
+
*/const re="0.12.61";/**!
|
|
8
8
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
|
9
9
|
* @name @vtj/core
|
|
10
10
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
11
|
-
* @version 0.12.
|
|
11
|
+
* @version 0.12.61
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
|
-
*/const ie=["slot","template","component","img","div","p","h1","h2","h3","span","a"];
|
|
13
|
+
*/const ie=["slot","template","component","img","div","p","h1","h2","h3","span","a"];f.mitt();const T={arrowParens:"always",bracketSpacing:!0,bracketSameLine:!0,endOfLine:"lf",htmlWhitespaceSensitivity:"css",insertPragma:!1,jsxBracketSameLine:!0,jsxSingleQuote:!0,printWidth:80,proseWrap:"preserve",quoteProps:"as-needed",requirePragma:!1,semi:!0,singleQuote:!0,tabWidth:2,trailingComma:"none",useTabs:!1,vueIndentScriptAndStyle:!0};async function B(t,e){return e?t:await D.format(t,{parser:"vue",...T,plugins:[ne,q,U,M]})}async function V(t,e){if(e)return t;try{return(await D.format(t,{parser:"babel-ts",...T,plugins:[q,U]})).replace(/;\n$/gi,"")}catch(s){return console.warn(s),t}}async function N(t,e){return e?t:D.format(t,{parser:"scss",...T,plugins:[M]})}function k(t){return t&&t.type==="JSExpression"}function I(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function j(t){return k(t)||I(t)}function H(t){return t.replace(new RegExp("this.","g"),"")}function R(t){return t.replace(/this\.context\??\./g,"")}function d(t,e=!0,s=!0,n=[]){let r=j(t)?t.value.trim().replace(/\"/g,"'").replace(/;$/,""):e?JSON.stringify(t):t;return r=w(r,n),s?H(R(r)):R(r)}function w(t,e=[]){let s=t;for(const n of e)s=s.replace(new RegExp(`this.${n}.value`,"g"),`this.${n}`);return s}function Q(t){let e=t.trim().replace(/;$/,"");if(e=/^\((\(|async|function)/.test(e)?e.substring(1,e.length-1):e,e.startsWith("{"))return e;if(e.startsWith("async function"))e=e.replace(/^async function/,"async");else if(e.startsWith("function"))e=e.replace(/^function/,"");else{const r=/^(async\s)?\([\w]*\)\s+\=\>\s([\w\W]+)/,i=e.match(r);i&&i[2]&&(i[2].startsWith("{")||(e=e.replace(i[2],`{ return ${i[2]} }`))),e=e.replace("=>","")}return e}function oe(t={}){return Object.entries(t).map(([e,s])=>`"${e}": ${d(s)}`)}function z(t={},e=!1){const s=Object.keys(t);return e?s.map(n=>"."+n):s}function ae(t){let e="";for(var s in t)if(t.hasOwnProperty(s)){var n=t[s];e+=s+": "+n+";"}return e}function ce(t=[],e=[]){return t.filter(s=>!e.includes(s))}function W(t){return f.base64(JSON.stringify(t))}class le{constructor(e,s){this.dsl=e,this.dependencies=s,this.libraryRegex=this.collectLibrary(),this.walk(e),this.walkNodes(e),this.members=this.getLibraryMember()}imports={};context={};style={};members=[];urlSchemas={};blockPlugins={};libraryRegex=[];collectLibrary(){return this.dependencies.filter(e=>!!e.library).map(e=>new RegExp(`(this.\\$libs.${e.library}.([\\w]+))`,"g"))}collectImport(e){const s=e.split(".");if(s.length===4){const n=s.pop(),r=s.join(".")+".",i=s.pop();if(n&&i){const o=this.dependencies.find(a=>a.library===i)?.package;o&&(this.imports[o]||(this.imports[o]=new Set)).add(n)}return{name:n,path:r,library:i}}return null}replaceLibraryPath(e){const{libraryRegex:s}=this;let n=e.value;for(const r of s){const i=e.value?.match(r)||[];for(const o of i){const a=this.collectImport(o);if(a){const m=a.path.replace(/\$/g,"\\$");n=n.replace(new RegExp(m,"g"),"")}}}return n}walk(e){const s=n=>{if(!n||typeof n!="object")return;if(Array.isArray(n)){for(let i of n)s(i);return}const r=Object.values(n);for(const i of r)j(i)?i.value=this.replaceLibraryPath(i):s(i)};s(e)}getLibraryMember(e=[]){let s=[...e];const n={...this.imports};delete n["uni-h5"],delete n["@dcloudio/uni-h5"],delete n["uni-ui"],delete n["@dcloudio/uni-ui"];for(const r of Object.values(n))s=s.concat(Array.from(r));return f.dedupArray(s)}collectContext(e,s){const n=new Set(s?.id?this.context[s.id]:[]),r=(e.directives||[]).find(a=>a.name==="vFor");let i=new Set(Array.from(n));if(r){const{item:a="item",index:m="index"}=r.iterator||{};i=new Set([a,m,...Array.from(i)])}const o=e.slot;if(o){const a=typeof o=="string"?[]:o.params||[],m=a.length?a:[`scope_${s?.id}`];i=new Set([...m,...Array.from(i)])}this.context[e.id]=i}collectStyle(e){e.id&&e.props?.style&&Object.keys(e.props.style).length&&!j(e.props.style)&&(this.style[`.${e.name}_${e.id}`]=e.props.style)}collectUrlSchema(e){typeof e.from=="object"&&e.from.type==="UrlSchema"&&(this.urlSchemas[e.name]=e.from)}collectBlockPlugin(e){typeof e.from=="object"&&e.from.type==="Plugin"&&(this.blockPlugins[e.name]=e.from)}walkNodes(e){const s=(n,r)=>{this.collectContext(n,r),this.collectStyle(n),this.collectUrlSchema(n),this.collectBlockPlugin(n),Array.isArray(n.children)&&n.children.forEach(i=>s(i,n))};Array.isArray(e.nodes)&&e.nodes.forEach(n=>s(n))}}function ue(t={}){return Object.entries(t).map(([e,s])=>{const n=d(s,!1);return`${e}:${n}`})}function pe(t=[]){return t.map(e=>`${e.name}: {
|
|
14
14
|
from: '${e.from||e.name}',
|
|
15
15
|
default: ${d(e.default,!0,!1)}
|
|
16
|
-
}`)}function fe(t=[]){const e=
|
|
17
|
-
type:${e(
|
|
18
|
-
required: ${d(!!
|
|
19
|
-
default: ${d(
|
|
20
|
-
}`))}function me(t=[]){return t.map(e=>`'${typeof e=="string"?e:e.name}'`)}function A(t={},e=[]){return Object.entries(t).map(([n
|
|
16
|
+
}`)}function fe(t=[]){const e=s=>s?`[${f.toArray(s).map(i=>i.replace(/\'|\"/gi,"")).join(",")}]`:void 0;return t.map(s=>typeof s=="string"?`${s}: {}`:(j(s.default)&&!s.default.value&&(s.default.value="undefined"),`${s.name}: {
|
|
17
|
+
type:${e(s.type)},
|
|
18
|
+
required: ${d(!!s.required,!0,!1)},
|
|
19
|
+
default: ${d(s.default,!0,!1)}
|
|
20
|
+
}`))}function me(t=[]){return t.map(e=>`'${typeof e=="string"?e:e.name}'`)}function A(t={},e=[]){return Object.entries(t).map(([s,n])=>{let r=Q(d(n,!1,!1));return r=w(r,e),r.startsWith("async")?`async ${s}${r.replace(/^async/,"")}`:`${s}${r}`})}function he(t=[],e=[]){const s=t.reduce((i,o)=>(o.id&&I(o.source)&&(i[`watcher_${o.id}`]=o.source),i),{}),n=A(s,e),r=t.map(i=>`watcher_${i.id}: {
|
|
21
21
|
deep: ${i.deep},
|
|
22
22
|
immediate:${i.immediate},
|
|
23
23
|
handler${Q(i.handler.value)}
|
|
24
|
-
}`);return{computed:
|
|
25
|
-
// DataSource: ${
|
|
26
|
-
const mock = this.provider.createMock(${
|
|
24
|
+
}`);return{computed:n,watches:r}}function de(t={}){return Object.values(t).map(e=>{if(e.type==="mock"){const s=I(e.mockTemplate)&&e.mockTemplate.value||"(params) => ({})";return`async ${e.name}(...args) {
|
|
25
|
+
// DataSource: ${W(e)}
|
|
26
|
+
const mock = this.provider.createMock(${s});
|
|
27
27
|
return await mock.apply(this, args);
|
|
28
|
-
}`}else{const
|
|
29
|
-
// DataSource: ${
|
|
30
|
-
return await this.provider.apis['${e.ref}'].apply(this, args).then(${
|
|
31
|
-
}`}})}const
|
|
32
|
-
`),Object.assign(o,S?.methods||{}),
|
|
33
|
-
`+
|
|
34
|
-
`),r?.id);i.push(p)}),{nodes:i,methods:o,directives:
|
|
35
|
-
return (${
|
|
36
|
-
}`}:
|
|
28
|
+
}`}else{const s=I(e.transform)&&e.transform.value||"(res) => res";return`async ${e.name}(...args) {
|
|
29
|
+
// DataSource: ${W(e)}
|
|
30
|
+
return await this.provider.apis['${e.ref}'].apply(this, args).then(${s});
|
|
31
|
+
}`}})}const ge=["img","input","br","hr","area","base","col","embed","link","meta","param","source","track","wbr"],J=["vIf","vElseIf","vElse","vShow","vModel","vFor","vBind","vHtml"];function G(t,e,s=[],n={},r){const i=[];let o={},a=[];const m=[];let u=[];return ve(t).forEach(c=>{const v=[];for(const h of c.children){let{id:g,name:$,invisible:b,from:y}=h;if(b)continue;const C=$e($,e,y);C&&a.push(C),X(y)&&u.push({id:y.id,name:$});const{props:P,events:O,handlers:E}=we(h,g,h.props,h.events,n,s),L=Ce(h.directives,s,m).join(" "),S=h.children?Oe(h.children,s,e,n,h):"";Object.assign(o,E);let x="";typeof S=="string"?x=S:(x=(S?.nodes||[]).join(`
|
|
32
|
+
`),Object.assign(o,S?.methods||{}),a=a.concat(S?.components||[]),u=u.concat(S?.importBlocks||[]));const _=["@dcloudio/uni-h5","@dcloudio/uni-ui"].includes(y||e.get($)?.package)?f.kebabCase($):Y(y)||Z(y)?"component":$;v.push(ge.includes(_)?`<${_} ${L} ${P} ${O} />`:`<${_} ${L} ${P} ${O}>${x?`
|
|
33
|
+
`+x.trim():""}</${_}>`)}const p=Ee(c.slot,v.join(`
|
|
34
|
+
`),r?.id);i.push(p)}),{nodes:i,methods:o,directives:ye(m),components:f.dedupArray(a),importBlocks:f.dedupArray(u,"id")}}function ye(t){return f.dedupArray(t).map(e=>`${e.startsWith("v")?e.substring(1):e}:${e}`)}function ve(t=[]){const e=new Map;for(const s of t){const n=typeof s.slot=="string"?s.slot:s.slot?.name,r=e.get(n);r?r.children.push(s):e.set(n,{slot:s.slot,children:[s]})}return e}function $e(t,e,s){if(ie.includes(t))return null;const n=e.get(t);if(n&&n.alias){const r=n.parent?`${n.parent}.${n.alias}`:n.alias;return`${t}: ${r}`}return X(s)||n?t:null}function X(t){return!!t&&typeof t=="object"&&t.type==="Schema"}function Y(t){return typeof t=="object"&&t.type==="UrlSchema"}function Z(t){return typeof t=="object"&&t.type==="Plugin"}function be(t,e,s=[]){return t==="style"?j(e)?`:style="${d({...e,value:w(e.value,s)})}"`:"":t==="__class"&&j(e)?`:class="${d({...e,value:w(e.value,s)})}"`:typeof e=="string"?`${t}="${e}"`:j(e)?`:${t}="${d({...e,value:w(e.value,s)})}"`:f.isPlainObject(e)?`:${t}='{${oe(e).join(", ")}}'`:`:${t}='${JSON.stringify(e)}'`}function je(t,e={},s=[]){if(!!Object.keys(e.style||{}).length){const i=`${t.name}_${t.id}`;e.class?typeof e.class=="string"?e.class=[e.class,i].join(" "):(e.__class=e.class,e.class=i):e.class=i,j(e.style)||delete e.style}const r=t.from;return(Y(r)||Z(r))&&(e.is={type:"JSExpression",value:t.name}),Object.entries(e).map(([i,o])=>be(i,o,s))}function Se(t,e,s,n,r){const i=z(e.modifiers,!0);return r?`@${t}${i.join("")}="${s}"`:n&&n.length>0?`@${t}${i.join("")}="(...args:any[]) => ${s}"`:`@${t}${i.join("")}="${s}"`}function ke(t,e={},s={}){const n={},r=Array.from(s[t]||new Set([])),i=r.length?`({${r.join(", ")}}, args)`:"";return{binders:Object.entries(e).map(([a,m])=>{const u=m.handler.value.startsWith("this."),l=u?H(m.handler.value):`${f.camelCase(a)}_${t}${i}`;return u||(n[l]=r.length?{type:"JSFunction",value:`{
|
|
35
|
+
return (${m.handler.value}).apply(this, args);
|
|
36
|
+
}`}:m.handler),Se(a,m,l,r,u)}),handlers:n}}function we(t,e,s={},n={},r={},i){const{binders:o,handlers:a}=ke(e,n,r);return{props:je(t,s,i).join(" "),handlers:a,binders:o,events:o.join(" ")}}function Ce(t=[],e=[],s=[]){const n=[],{vIf:r,vElse:i,vElseIf:o,vShow:a,vModels:m,vFor:u,vBind:l,vHtml:c,customDirectives:v}=Pe(t);if(r&&n.push(`v-if="${d(r.value,!0,!0,e)}"`),o&&n.push(`v-else-if="${d(o.value,!0,!0,e)}"`),i&&n.push("v-else"),a&&n.push(`v-show="${d(a.value,!0,!0,e)}"`),l&&n.push(`v-bind="${d(l.value,!0,!0,e)}"`),m.forEach(p=>{const h=z(p.modifiers,!0),g=p.arg?k(p.arg)?`:[${d(p.arg,!0,!0,e)}]`:`:${p.arg}`:"";n.push(`v-model${g}${h}="${d(p.value,!0,!0,e)}"`)}),u){const{item:p,index:h}={item:"item",index:"index",...u.iterator};n.push(`v-for="(${p}, ${h}) in ${d(u.value,!0,!0,e)}"`)}return c&&n.push(`v-html="${d(c.value,!0,!0,e)}"`),v&&v.length&&v.forEach(p=>{if(!p.name)return;let h="",g="";k(p.name)?(g=d(p.name,!0,!0,e),s.push(g)):g=p.name;const $=g?.startsWith("v")?f.kebabCase(g):f.kebabCase("v-"+g);if(h+=$,p.arg&&(k(p.arg)?h+=`:[${d(p.name,!0,!0,e)}]`:h+=`:${p.arg}`),p.modifiers){const b=Object.keys(p.modifiers);b.length&&(h+=b.map(y=>"."+y))}p.value?n.push(`${h}="${d(p.value,!0,!0,e)}"`):n.push(h)}),n}function Pe(t=[]){const e=t.filter(c=>J.includes(c.name)),s=t.filter(c=>!J.includes(c.name)),n=e.find(c=>f.camelCase(c.name)==="vIf"),r=e.find(c=>f.camelCase(c.name)==="vElseIf"),i=e.find(c=>f.camelCase(c.name)==="vElse"),o=e.find(c=>f.camelCase(c.name)==="vFor"),a=e.find(c=>f.camelCase(c.name)==="vShow"),m=e.find(c=>f.camelCase(c.name)==="vBind"),u=e.find(c=>f.camelCase(c.name)==="vHtml"),l=e.filter(c=>f.camelCase(c.name)==="vModel");return{vIf:n,vElseIf:r,vElse:i,vFor:o,vShow:a,vModels:l,vBind:m,vHtml:u,customDirectives:s}}function Oe(t,e,s,n,r){return typeof t=="string"?t:k(t)?`{{ ${d(t,!1,!0,e)} }}`:Array.isArray(t)?G(t,s,e,n,r):""}function Ee(t,e,s){if(!t)return e;const n=typeof t=="string"?{name:t,params:[]}:{params:[],...t};return`<template ${`#${n.name}="${n.params?.length>0?`{${n.params?.join(",")}}`:`scope_${s}`}"`}>
|
|
37
37
|
${e}
|
|
38
|
-
</template>`}function
|
|
39
|
-
${
|
|
40
|
-
${
|
|
38
|
+
</template>`}function xe(t,e=[],s=[],n={},r="web"){const i=["@dcloudio/uni-h5","uni-h5","@dcloudio/uni-ui","uni-ui"],o={vue:["defineComponent","reactive"]},a=[];for(const u of e){const l=t.get(u.split(":")[0]);if(l&&l.package){const c=o[l.package]??(o[l.package]=[]),v=l.parent||(l.alias||"").split(".")[0]||l.name;c.push(v),r==="uniapp"&&i.includes(l.package)&&a.push(v)}}for(const[u,l]of Object.entries(n))(o[u]??(o[u]=[])).push(...Array.from(l)),r==="uniapp"&&i.includes(u)&&a.push(...Array.from(l));return{imports:Object.entries(o).filter(([u,l])=>r==="uniapp"?!i.includes(u)&&!!l.length:!!l.length).map(([u,l])=>`import { ${f.dedupArray(l).join(",")}} from '${u}';`).concat(s),uniComponents:a}}function _e(t={}){const e=[];for(const[s,n]of Object.entries(t))e.push(`
|
|
39
|
+
${s} {
|
|
40
|
+
${ae(n)}
|
|
41
41
|
}
|
|
42
42
|
`);return e.join(`
|
|
43
|
-
`)}function Ae(t={}){const e=[];return Object.entries(t).forEach(([n
|
|
44
|
-
`+
|
|
45
|
-
`),components:
|
|
46
|
-
`),css:
|
|
43
|
+
`)}function Ae(t={}){const e=[];return Object.entries(t).forEach(([s,n])=>{e.push(`const ${s} = provider.defineUrlSchemaComponent('${n.url}');`)}),e}function Ie(t={}){const e=[];return Object.entries(t).forEach(([s,n])=>{e.push(`const ${s} = provider.definePluginComponent(${JSON.stringify(n)});`)}),e}function Fe(t,e,s="web"){const{dsl:n}=t,r=Object.keys(n.computed||{}),i=A(n.lifeCycles,r),o=A(n.computed,r),a=he(n.watch,r),m=de(n.dataSources),{methods:u,nodes:l,components:c,importBlocks:v,directives:p}=G(n.nodes||[],e,r,t.context),h=[...o,...a.computed],g=A({...u,...n.methods||{}},r),$=v.map(E=>`import ${E.name} from './${E.id}.vue';`);let{imports:b,uniComponents:y}=xe(e,c,$,t.imports,s);const C=Object.keys({...t.urlSchemas,...t.blockPlugins}),P=Ae(t.urlSchemas),O=Ie(t.blockPlugins);return{id:n.id,version:n.__VERSION__,name:n.name,state:ue(n.state).join(","),inject:pe(n.inject).join(","),props:fe(n.props).join(","),emits:me(n.emits).join(","),watch:a.watches.join(","),lifeCycles:i.join(","),computed:h.join(","),methods:[...m,...g].join(","),imports:`
|
|
44
|
+
`+b.join(`
|
|
45
|
+
`),components:ce(c,y).join(","),directives:p.join(","),returns:t.members.join(","),template:l.join(`
|
|
46
|
+
`),css:n.css||"",style:_e(t.style),urlSchemas:P.join(`
|
|
47
47
|
`),blockPlugins:O.join(`
|
|
48
|
-
`),asyncComponents:C.join(","),uniComponents:
|
|
48
|
+
`),asyncComponents:C.join(","),uniComponents:y,renderer:s==="uniapp"?"@vtj/uni-app":"@vtj/renderer"}}const Ne=`
|
|
49
49
|
// @ts-nocheck
|
|
50
50
|
|
|
51
51
|
<%= imports %>
|
|
@@ -77,18 +77,18 @@ export default defineComponent({
|
|
|
77
77
|
<% if(methods) { %> methods: { <%= methods %> }, <% } %>
|
|
78
78
|
<% if(watch) { %> watch: { <%= watch %> }, <% } %> <%= lifeCycles %>
|
|
79
79
|
});
|
|
80
|
-
`.replace(/(\n|\r|\t)/g,""),
|
|
80
|
+
`.replace(/(\n|\r|\t)/g,""),De=`
|
|
81
81
|
<template>
|
|
82
82
|
<%= template %>
|
|
83
83
|
</template>
|
|
84
|
-
<script lang="
|
|
84
|
+
<script lang="<%= scriptLang %>">
|
|
85
85
|
<%= script %>
|
|
86
86
|
<\/script>
|
|
87
|
-
<style lang="
|
|
87
|
+
<style lang="<%= styleLang %>" scoped>
|
|
88
88
|
<%= css %>
|
|
89
89
|
<%= style %>
|
|
90
90
|
</style>
|
|
91
|
-
`,
|
|
91
|
+
`,Te=f.template(Ne),Be=f.template(De);async function Le(t,e=new Map,s=[],n="web",r){const i=t,o=typeof i.dsl=="object"&&arguments.length===1?i:{dsl:t,componentMap:e,dependencies:s,platform:n,formatterDisabled:r},{dsl:a,componentMap:m=new Map,dependencies:u=[],platform:l="web",formatterDisabled:c=!1,ts:v=!0,scss:p=!1}=o,h=new le(f.cloneDeep(a),u),g=Fe(h,m,l),$=Te(g),b=Be({template:g.template,css:await N(g.css,c),script:await V($,c),style:await N(g.style,c),scriptLang:v?"ts":"js",styleLang:p?"scss":"css"});return await B(b,c).catch(y=>(y.content=b,Promise.reject(y)))}async function Re(t){const e=`
|
|
92
92
|
<template>
|
|
93
93
|
<div>
|
|
94
94
|
<h3>源码模式页面</h3>
|
|
@@ -99,4 +99,4 @@ export default defineComponent({
|
|
|
99
99
|
<\/script>
|
|
100
100
|
<style scoped lang="scss">
|
|
101
101
|
</style>
|
|
102
|
-
`;return await
|
|
102
|
+
`;return await B(e)}exports.VTJ_CODER_VERSION=re;exports.createEmptyPage=Re;exports.cssFormatter=N;exports.generator=Le;exports.tsFormatter=V;exports.vueFormatter=B;
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { mitt as ee, base64 as te, dedupArray as C, toArray as
|
|
1
|
+
import { mitt as ee, base64 as te, dedupArray as C, toArray as se, kebabCase as F, camelCase as b, isPlainObject as ne, template as U, cloneDeep as re } from "@vtj/base";
|
|
2
2
|
import { format as B } from "prettier/standalone";
|
|
3
3
|
import * as ie from "prettier/plugins/html";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
4
|
+
import * as M from "prettier/plugins/babel";
|
|
5
|
+
import * as V from "prettier/plugins/postcss";
|
|
6
|
+
import * as H from "prettier/plugins/estree";
|
|
7
7
|
/**!
|
|
8
8
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
|
9
9
|
* @name @vtj/coder
|
|
10
10
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
11
|
-
* @version 0.12.
|
|
11
|
+
* @version 0.12.61
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
13
|
*/
|
|
14
|
-
const Ue = "0.12.
|
|
14
|
+
const Ue = "0.12.61";
|
|
15
15
|
/**!
|
|
16
16
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
|
17
17
|
* @name @vtj/core
|
|
18
18
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
19
|
-
* @version 0.12.
|
|
19
|
+
* @version 0.12.61
|
|
20
20
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
21
21
|
*/
|
|
22
22
|
const oe = [
|
|
@@ -33,7 +33,7 @@ const oe = [
|
|
|
33
33
|
"a"
|
|
34
34
|
];
|
|
35
35
|
ee();
|
|
36
|
-
const
|
|
36
|
+
const D = {
|
|
37
37
|
arrowParens: "always",
|
|
38
38
|
bracketSpacing: !0,
|
|
39
39
|
bracketSameLine: !0,
|
|
@@ -53,11 +53,11 @@ const T = {
|
|
|
53
53
|
useTabs: !1,
|
|
54
54
|
vueIndentScriptAndStyle: !0
|
|
55
55
|
};
|
|
56
|
-
async function
|
|
56
|
+
async function q(t, e) {
|
|
57
57
|
return e ? t : await B(t, {
|
|
58
58
|
parser: "vue",
|
|
59
|
-
...
|
|
60
|
-
plugins: [ie,
|
|
59
|
+
...D,
|
|
60
|
+
plugins: [ie, M, H, V]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
async function ce(t, e) {
|
|
@@ -65,18 +65,18 @@ async function ce(t, e) {
|
|
|
65
65
|
try {
|
|
66
66
|
return (await B(t, {
|
|
67
67
|
parser: "babel-ts",
|
|
68
|
-
...
|
|
69
|
-
plugins: [
|
|
68
|
+
...D,
|
|
69
|
+
plugins: [M, H]
|
|
70
70
|
})).replace(/;\n$/gi, "");
|
|
71
|
-
} catch (
|
|
72
|
-
return console.warn(
|
|
71
|
+
} catch (s) {
|
|
72
|
+
return console.warn(s), t;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
async function
|
|
75
|
+
async function L(t, e) {
|
|
76
76
|
return e ? t : B(t, {
|
|
77
77
|
parser: "scss",
|
|
78
|
-
...
|
|
79
|
-
plugins: [
|
|
78
|
+
...D,
|
|
79
|
+
plugins: [V]
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
function k(t) {
|
|
@@ -85,27 +85,27 @@ function k(t) {
|
|
|
85
85
|
function N(t) {
|
|
86
86
|
return typeof t == "object" && t && t.type === "JSFunction";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function j(t) {
|
|
89
89
|
return k(t) || N(t);
|
|
90
90
|
}
|
|
91
91
|
function Q(t) {
|
|
92
92
|
return t.replace(new RegExp("this.", "g"), "");
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function R(t) {
|
|
95
95
|
return t.replace(/this\.context\??\./g, "");
|
|
96
96
|
}
|
|
97
|
-
function h(t, e = !0,
|
|
98
|
-
let r =
|
|
99
|
-
return r = w(r,
|
|
97
|
+
function h(t, e = !0, s = !0, n = []) {
|
|
98
|
+
let r = j(t) ? t.value.trim().replace(/\"/g, "'").replace(/;$/, "") : e ? JSON.stringify(t) : t;
|
|
99
|
+
return r = w(r, n), s ? Q(R(r)) : R(r);
|
|
100
100
|
}
|
|
101
101
|
function w(t, e = []) {
|
|
102
|
-
let
|
|
103
|
-
for (const
|
|
104
|
-
|
|
105
|
-
new RegExp(`this.${
|
|
106
|
-
`this.${
|
|
102
|
+
let s = t;
|
|
103
|
+
for (const n of e)
|
|
104
|
+
s = s.replace(
|
|
105
|
+
new RegExp(`this.${n}.value`, "g"),
|
|
106
|
+
`this.${n}`
|
|
107
107
|
);
|
|
108
|
-
return
|
|
108
|
+
return s;
|
|
109
109
|
}
|
|
110
110
|
function G(t) {
|
|
111
111
|
let e = t.trim().replace(/;$/, "");
|
|
@@ -121,30 +121,30 @@ function G(t) {
|
|
|
121
121
|
return e;
|
|
122
122
|
}
|
|
123
123
|
function ae(t = {}) {
|
|
124
|
-
return Object.entries(t).map(([e,
|
|
124
|
+
return Object.entries(t).map(([e, s]) => `"${e}": ${h(s)}`);
|
|
125
125
|
}
|
|
126
126
|
function X(t = {}, e = !1) {
|
|
127
|
-
const
|
|
128
|
-
return e ?
|
|
127
|
+
const s = Object.keys(t);
|
|
128
|
+
return e ? s.map((n) => "." + n) : s;
|
|
129
129
|
}
|
|
130
130
|
function le(t) {
|
|
131
131
|
let e = "";
|
|
132
|
-
for (var
|
|
133
|
-
if (t.hasOwnProperty(
|
|
134
|
-
var
|
|
135
|
-
e +=
|
|
132
|
+
for (var s in t)
|
|
133
|
+
if (t.hasOwnProperty(s)) {
|
|
134
|
+
var n = t[s];
|
|
135
|
+
e += s + ": " + n + ";";
|
|
136
136
|
}
|
|
137
137
|
return e;
|
|
138
138
|
}
|
|
139
139
|
function ue(t = [], e = []) {
|
|
140
|
-
return t.filter((
|
|
140
|
+
return t.filter((s) => !e.includes(s));
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function W(t) {
|
|
143
143
|
return te(JSON.stringify(t));
|
|
144
144
|
}
|
|
145
145
|
class pe {
|
|
146
|
-
constructor(e,
|
|
147
|
-
this.dsl = e, this.dependencies =
|
|
146
|
+
constructor(e, s) {
|
|
147
|
+
this.dsl = e, this.dependencies = s, this.libraryRegex = this.collectLibrary(), this.walk(e), this.walkNodes(e), this.members = this.getLibraryMember();
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* { 'element-plus': ['ElButton', 'ElInput' ...] }
|
|
@@ -165,17 +165,17 @@ class pe {
|
|
|
165
165
|
* @returns ex: { name: 'ElButton', path: 'this.$libs.ElementPlus.', library: 'ElementPlus' }
|
|
166
166
|
*/
|
|
167
167
|
collectImport(e) {
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
168
|
+
const s = e.split(".");
|
|
169
|
+
if (s.length === 4) {
|
|
170
|
+
const n = s.pop(), r = s.join(".") + ".", i = s.pop();
|
|
171
|
+
if (n && i) {
|
|
172
172
|
const o = this.dependencies.find(
|
|
173
173
|
(c) => c.library === i
|
|
174
174
|
)?.package;
|
|
175
|
-
o && (this.imports[o] || (this.imports[o] = /* @__PURE__ */ new Set())).add(
|
|
175
|
+
o && (this.imports[o] || (this.imports[o] = /* @__PURE__ */ new Set())).add(n);
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
178
|
-
name:
|
|
178
|
+
name: n,
|
|
179
179
|
path: r,
|
|
180
180
|
library: i
|
|
181
181
|
};
|
|
@@ -184,58 +184,58 @@ class pe {
|
|
|
184
184
|
}
|
|
185
185
|
// 代码中包含依赖库的引用,需要从代码中移除
|
|
186
186
|
replaceLibraryPath(e) {
|
|
187
|
-
const { libraryRegex:
|
|
188
|
-
let
|
|
189
|
-
for (const r of
|
|
187
|
+
const { libraryRegex: s } = this;
|
|
188
|
+
let n = e.value;
|
|
189
|
+
for (const r of s) {
|
|
190
190
|
const i = e.value?.match(r) || [];
|
|
191
191
|
for (const o of i) {
|
|
192
192
|
const c = this.collectImport(o);
|
|
193
193
|
if (c) {
|
|
194
194
|
const f = c.path.replace(/\$/g, "\\$");
|
|
195
|
-
|
|
195
|
+
n = n.replace(new RegExp(f, "g"), "");
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
return
|
|
199
|
+
return n;
|
|
200
200
|
}
|
|
201
201
|
walk(e) {
|
|
202
|
-
const
|
|
203
|
-
if (!
|
|
204
|
-
if (Array.isArray(
|
|
205
|
-
for (let i of
|
|
206
|
-
|
|
202
|
+
const s = (n) => {
|
|
203
|
+
if (!n || typeof n != "object") return;
|
|
204
|
+
if (Array.isArray(n)) {
|
|
205
|
+
for (let i of n)
|
|
206
|
+
s(i);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
const r = Object.values(
|
|
209
|
+
const r = Object.values(n);
|
|
210
210
|
for (const i of r)
|
|
211
|
-
|
|
211
|
+
j(i) ? i.value = this.replaceLibraryPath(i) : s(i);
|
|
212
212
|
};
|
|
213
|
-
|
|
213
|
+
s(e);
|
|
214
214
|
}
|
|
215
215
|
getLibraryMember(e = []) {
|
|
216
|
-
let
|
|
217
|
-
const
|
|
218
|
-
delete
|
|
219
|
-
for (const r of Object.values(
|
|
220
|
-
|
|
221
|
-
return C(
|
|
216
|
+
let s = [...e];
|
|
217
|
+
const n = { ...this.imports };
|
|
218
|
+
delete n["uni-h5"], delete n["@dcloudio/uni-h5"], delete n["uni-ui"], delete n["@dcloudio/uni-ui"];
|
|
219
|
+
for (const r of Object.values(n))
|
|
220
|
+
s = s.concat(Array.from(r));
|
|
221
|
+
return C(s);
|
|
222
222
|
}
|
|
223
|
-
collectContext(e,
|
|
224
|
-
const
|
|
225
|
-
let i = new Set(Array.from(
|
|
223
|
+
collectContext(e, s) {
|
|
224
|
+
const n = new Set(s?.id ? this.context[s.id] : []), r = (e.directives || []).find((c) => c.name === "vFor");
|
|
225
|
+
let i = new Set(Array.from(n));
|
|
226
226
|
if (r) {
|
|
227
227
|
const { item: c = "item", index: f = "index" } = r.iterator || {};
|
|
228
228
|
i = /* @__PURE__ */ new Set([c, f, ...Array.from(i)]);
|
|
229
229
|
}
|
|
230
230
|
const o = e.slot;
|
|
231
231
|
if (o) {
|
|
232
|
-
const c = typeof o == "string" ? [] : o.params || [], f = c.length ? c : [`scope_${
|
|
232
|
+
const c = typeof o == "string" ? [] : o.params || [], f = c.length ? c : [`scope_${s?.id}`];
|
|
233
233
|
i = /* @__PURE__ */ new Set([...f, ...Array.from(i)]);
|
|
234
234
|
}
|
|
235
235
|
this.context[e.id] = i;
|
|
236
236
|
}
|
|
237
237
|
collectStyle(e) {
|
|
238
|
-
e.id && e.props?.style && Object.keys(e.props.style).length && !
|
|
238
|
+
e.id && e.props?.style && Object.keys(e.props.style).length && !j(e.props.style) && (this.style[`.${e.name}_${e.id}`] = e.props.style);
|
|
239
239
|
}
|
|
240
240
|
collectUrlSchema(e) {
|
|
241
241
|
typeof e.from == "object" && e.from.type === "UrlSchema" && (this.urlSchemas[e.name] = e.from);
|
|
@@ -244,16 +244,16 @@ class pe {
|
|
|
244
244
|
typeof e.from == "object" && e.from.type === "Plugin" && (this.blockPlugins[e.name] = e.from);
|
|
245
245
|
}
|
|
246
246
|
walkNodes(e) {
|
|
247
|
-
const
|
|
248
|
-
this.collectContext(
|
|
247
|
+
const s = (n, r) => {
|
|
248
|
+
this.collectContext(n, r), this.collectStyle(n), this.collectUrlSchema(n), this.collectBlockPlugin(n), Array.isArray(n.children) && n.children.forEach((i) => s(i, n));
|
|
249
249
|
};
|
|
250
|
-
Array.isArray(e.nodes) && e.nodes.forEach((
|
|
250
|
+
Array.isArray(e.nodes) && e.nodes.forEach((n) => s(n));
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
function fe(t = {}) {
|
|
254
|
-
return Object.entries(t).map(([e,
|
|
255
|
-
const
|
|
256
|
-
return `${e}:${
|
|
254
|
+
return Object.entries(t).map(([e, s]) => {
|
|
255
|
+
const n = h(s, !1);
|
|
256
|
+
return `${e}:${n}`;
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
function me(t = []) {
|
|
@@ -263,50 +263,50 @@ function me(t = []) {
|
|
|
263
263
|
}`);
|
|
264
264
|
}
|
|
265
265
|
function he(t = []) {
|
|
266
|
-
const e = (
|
|
267
|
-
return t.map((
|
|
268
|
-
type:${e(
|
|
269
|
-
required: ${h(!!
|
|
270
|
-
default: ${h(
|
|
266
|
+
const e = (s) => s ? `[${se(s).map((i) => i.replace(/\'|\"/gi, "")).join(",")}]` : void 0;
|
|
267
|
+
return t.map((s) => typeof s == "string" ? `${s}: {}` : (j(s.default) && !s.default.value && (s.default.value = "undefined"), `${s.name}: {
|
|
268
|
+
type:${e(s.type)},
|
|
269
|
+
required: ${h(!!s.required, !0, !1)},
|
|
270
|
+
default: ${h(s.default, !0, !1)}
|
|
271
271
|
}`));
|
|
272
272
|
}
|
|
273
273
|
function de(t = []) {
|
|
274
274
|
return t.map((e) => `'${typeof e == "string" ? e : e.name}'`);
|
|
275
275
|
}
|
|
276
276
|
function A(t = {}, e = []) {
|
|
277
|
-
return Object.entries(t).map(([
|
|
278
|
-
let r = G(h(
|
|
279
|
-
return r = w(r, e), r.startsWith("async") ? `async ${
|
|
277
|
+
return Object.entries(t).map(([s, n]) => {
|
|
278
|
+
let r = G(h(n, !1, !1));
|
|
279
|
+
return r = w(r, e), r.startsWith("async") ? `async ${s}${r.replace(/^async/, "")}` : `${s}${r}`;
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
const
|
|
282
|
+
function ge(t = [], e = []) {
|
|
283
|
+
const s = t.reduce(
|
|
284
284
|
(i, o) => (o.id && N(o.source) && (i[`watcher_${o.id}`] = o.source), i),
|
|
285
285
|
{}
|
|
286
|
-
),
|
|
286
|
+
), n = A(s, e), r = t.map((i) => `watcher_${i.id}: {
|
|
287
287
|
deep: ${i.deep},
|
|
288
288
|
immediate:${i.immediate},
|
|
289
289
|
handler${G(i.handler.value)}
|
|
290
290
|
}`);
|
|
291
291
|
return {
|
|
292
|
-
computed:
|
|
292
|
+
computed: n,
|
|
293
293
|
watches: r
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function ye(t = {}) {
|
|
297
297
|
return Object.values(t).map((e) => {
|
|
298
298
|
if (e.type === "mock") {
|
|
299
|
-
const
|
|
299
|
+
const s = N(e.mockTemplate) && e.mockTemplate.value || "(params) => ({})";
|
|
300
300
|
return `async ${e.name}(...args) {
|
|
301
|
-
// DataSource: ${
|
|
302
|
-
const mock = this.provider.createMock(${
|
|
301
|
+
// DataSource: ${W(e)}
|
|
302
|
+
const mock = this.provider.createMock(${s});
|
|
303
303
|
return await mock.apply(this, args);
|
|
304
304
|
}`;
|
|
305
305
|
} else {
|
|
306
|
-
const
|
|
306
|
+
const s = N(e.transform) && e.transform.value || "(res) => res";
|
|
307
307
|
return `async ${e.name}(...args) {
|
|
308
|
-
// DataSource: ${
|
|
309
|
-
return await this.provider.apis['${e.ref}'].apply(this, args).then(${
|
|
308
|
+
// DataSource: ${W(e)}
|
|
309
|
+
return await this.provider.apis['${e.ref}'].apply(this, args).then(${s});
|
|
310
310
|
}`;
|
|
311
311
|
}
|
|
312
312
|
});
|
|
@@ -326,7 +326,7 @@ const $e = [
|
|
|
326
326
|
"source",
|
|
327
327
|
"track",
|
|
328
328
|
"wbr"
|
|
329
|
-
],
|
|
329
|
+
], J = [
|
|
330
330
|
"vIf",
|
|
331
331
|
"vElseIf",
|
|
332
332
|
"vElse",
|
|
@@ -336,46 +336,46 @@ const $e = [
|
|
|
336
336
|
"vBind",
|
|
337
337
|
"vHtml"
|
|
338
338
|
];
|
|
339
|
-
function z(t, e,
|
|
339
|
+
function z(t, e, s = [], n = {}, r) {
|
|
340
340
|
const i = [];
|
|
341
341
|
let o = {}, c = [];
|
|
342
342
|
const f = [];
|
|
343
|
-
let
|
|
343
|
+
let u = [];
|
|
344
344
|
return be(t).forEach((a) => {
|
|
345
345
|
const y = [];
|
|
346
346
|
for (const m of a.children) {
|
|
347
|
-
let { id: d, name: $, invisible:
|
|
348
|
-
if (
|
|
347
|
+
let { id: d, name: $, invisible: v, from: g } = m;
|
|
348
|
+
if (v)
|
|
349
349
|
continue;
|
|
350
350
|
const E = je($, e, g);
|
|
351
|
-
E && c.push(E), Y(g) &&
|
|
352
|
-
const { props:
|
|
351
|
+
E && c.push(E), Y(g) && u.push({ id: g.id, name: $ });
|
|
352
|
+
const { props: O, events: P, handlers: x } = Ee(
|
|
353
353
|
m,
|
|
354
354
|
d,
|
|
355
355
|
m.props,
|
|
356
356
|
m.events,
|
|
357
|
-
s,
|
|
358
|
-
n
|
|
359
|
-
), R = Pe(
|
|
360
|
-
m.directives,
|
|
361
357
|
n,
|
|
358
|
+
s
|
|
359
|
+
), T = Oe(
|
|
360
|
+
m.directives,
|
|
361
|
+
s,
|
|
362
362
|
f
|
|
363
363
|
).join(" "), S = m.children ? xe(
|
|
364
364
|
m.children,
|
|
365
|
-
n,
|
|
366
|
-
e,
|
|
367
365
|
s,
|
|
366
|
+
e,
|
|
367
|
+
n,
|
|
368
368
|
m
|
|
369
369
|
) : "";
|
|
370
370
|
Object.assign(o, x);
|
|
371
371
|
let _ = "";
|
|
372
372
|
typeof S == "string" ? _ = S : (_ = (S?.nodes || []).join(`
|
|
373
|
-
`), Object.assign(o, S?.methods || {}), c = c.concat(S?.components || []),
|
|
373
|
+
`), Object.assign(o, S?.methods || {}), c = c.concat(S?.components || []), u = u.concat(S?.importBlocks || []));
|
|
374
374
|
const I = ["@dcloudio/uni-h5", "@dcloudio/uni-ui"].includes(
|
|
375
375
|
g || e.get($)?.package
|
|
376
376
|
) ? F($) : Z(g) || K(g) ? "component" : $;
|
|
377
377
|
y.push(
|
|
378
|
-
$e.includes(I) ? `<${I} ${
|
|
378
|
+
$e.includes(I) ? `<${I} ${T} ${O} ${P} />` : `<${I} ${T} ${O} ${P}>${_ ? `
|
|
379
379
|
` + _.trim() : ""}</${I}>`
|
|
380
380
|
);
|
|
381
381
|
}
|
|
@@ -387,7 +387,7 @@ function z(t, e, n = [], s = {}, r) {
|
|
|
387
387
|
methods: o,
|
|
388
388
|
directives: ve(f),
|
|
389
389
|
components: C(c),
|
|
390
|
-
importBlocks: C(
|
|
390
|
+
importBlocks: C(u, "id")
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
393
|
function ve(t) {
|
|
@@ -395,20 +395,20 @@ function ve(t) {
|
|
|
395
395
|
}
|
|
396
396
|
function be(t = []) {
|
|
397
397
|
const e = /* @__PURE__ */ new Map();
|
|
398
|
-
for (const
|
|
399
|
-
const
|
|
400
|
-
r ? r.children.push(
|
|
398
|
+
for (const s of t) {
|
|
399
|
+
const n = typeof s.slot == "string" ? s.slot : s.slot?.name, r = e.get(n);
|
|
400
|
+
r ? r.children.push(s) : e.set(n, { slot: s.slot, children: [s] });
|
|
401
401
|
}
|
|
402
402
|
return e;
|
|
403
403
|
}
|
|
404
|
-
function je(t, e,
|
|
404
|
+
function je(t, e, s) {
|
|
405
405
|
if (oe.includes(t)) return null;
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
408
|
-
const r =
|
|
406
|
+
const n = e.get(t);
|
|
407
|
+
if (n && n.alias) {
|
|
408
|
+
const r = n.parent ? `${n.parent}.${n.alias}` : n.alias;
|
|
409
409
|
return `${t}: ${r}`;
|
|
410
410
|
}
|
|
411
|
-
return Y(
|
|
411
|
+
return Y(s) || n ? t : null;
|
|
412
412
|
}
|
|
413
413
|
function Y(t) {
|
|
414
414
|
return !!t && typeof t == "object" && t.type === "Schema";
|
|
@@ -419,149 +419,149 @@ function Z(t) {
|
|
|
419
419
|
function K(t) {
|
|
420
420
|
return typeof t == "object" && t.type === "Plugin";
|
|
421
421
|
}
|
|
422
|
-
function Se(t, e,
|
|
423
|
-
return t === "style" ?
|
|
422
|
+
function Se(t, e, s = []) {
|
|
423
|
+
return t === "style" ? j(e) ? `:style="${h({
|
|
424
424
|
...e,
|
|
425
|
-
value: w(e.value,
|
|
426
|
-
})}"` : "" : t === "__class" &&
|
|
425
|
+
value: w(e.value, s)
|
|
426
|
+
})}"` : "" : t === "__class" && j(e) ? `:class="${h({
|
|
427
427
|
...e,
|
|
428
|
-
value: w(e.value,
|
|
429
|
-
})}"` : typeof e == "string" ? `${t}="${e}"` :
|
|
428
|
+
value: w(e.value, s)
|
|
429
|
+
})}"` : typeof e == "string" ? `${t}="${e}"` : j(e) ? `:${t}="${h({
|
|
430
430
|
...e,
|
|
431
|
-
value: w(e.value,
|
|
432
|
-
})}"` :
|
|
431
|
+
value: w(e.value, s)
|
|
432
|
+
})}"` : ne(e) ? `:${t}='{${ae(
|
|
433
433
|
e
|
|
434
434
|
).join(", ")}}'` : `:${t}='${JSON.stringify(e)}'`;
|
|
435
435
|
}
|
|
436
|
-
function ke(t, e = {},
|
|
436
|
+
function ke(t, e = {}, s = []) {
|
|
437
437
|
if (!!Object.keys(e.style || {}).length) {
|
|
438
438
|
const i = `${t.name}_${t.id}`;
|
|
439
|
-
e.class ? typeof e.class == "string" ? e.class = [e.class, i].join(" ") : (e.__class = e.class, e.class = i) : e.class = i,
|
|
439
|
+
e.class ? typeof e.class == "string" ? e.class = [e.class, i].join(" ") : (e.__class = e.class, e.class = i) : e.class = i, j(e.style) || delete e.style;
|
|
440
440
|
}
|
|
441
441
|
const r = t.from;
|
|
442
442
|
return (Z(r) || K(r)) && (e.is = {
|
|
443
443
|
type: "JSExpression",
|
|
444
444
|
value: t.name
|
|
445
|
-
}), Object.entries(e).map(([i, o]) => Se(i, o,
|
|
445
|
+
}), Object.entries(e).map(([i, o]) => Se(i, o, s));
|
|
446
446
|
}
|
|
447
|
-
function we(t, e,
|
|
447
|
+
function we(t, e, s, n, r) {
|
|
448
448
|
const i = X(e.modifiers, !0);
|
|
449
|
-
return r ? `@${t}${i.join("")}="${
|
|
449
|
+
return r ? `@${t}${i.join("")}="${s}"` : n && n.length > 0 ? `@${t}${i.join("")}="(...args:any[]) => ${s}"` : `@${t}${i.join("")}="${s}"`;
|
|
450
450
|
}
|
|
451
|
-
function Ce(t, e = {},
|
|
452
|
-
const
|
|
451
|
+
function Ce(t, e = {}, s = {}) {
|
|
452
|
+
const n = {}, r = Array.from(s[t] || /* @__PURE__ */ new Set([])), i = r.length ? `({${r.join(", ")}}, args)` : "";
|
|
453
453
|
return {
|
|
454
454
|
binders: Object.entries(e).map(([c, f]) => {
|
|
455
|
-
const
|
|
456
|
-
return
|
|
455
|
+
const u = f.handler.value.startsWith("this."), l = u ? Q(f.handler.value) : `${b(c)}_${t}${i}`;
|
|
456
|
+
return u || (n[l] = r.length ? {
|
|
457
457
|
type: "JSFunction",
|
|
458
458
|
value: `{
|
|
459
459
|
return (${f.handler.value}).apply(this, args);
|
|
460
460
|
}`
|
|
461
|
-
} : f.handler), we(c, f,
|
|
461
|
+
} : f.handler), we(c, f, l, r, u);
|
|
462
462
|
}),
|
|
463
|
-
handlers:
|
|
463
|
+
handlers: n
|
|
464
464
|
};
|
|
465
465
|
}
|
|
466
|
-
function Ee(t, e,
|
|
467
|
-
const { binders: o, handlers: c } = Ce(e,
|
|
466
|
+
function Ee(t, e, s = {}, n = {}, r = {}, i) {
|
|
467
|
+
const { binders: o, handlers: c } = Ce(e, n, r);
|
|
468
468
|
return {
|
|
469
|
-
props: ke(t,
|
|
469
|
+
props: ke(t, s, i).join(" "),
|
|
470
470
|
handlers: c,
|
|
471
471
|
binders: o,
|
|
472
472
|
events: o.join(" ")
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
|
-
function
|
|
476
|
-
const
|
|
475
|
+
function Oe(t = [], e = [], s = []) {
|
|
476
|
+
const n = [], {
|
|
477
477
|
vIf: r,
|
|
478
478
|
vElse: i,
|
|
479
479
|
vElseIf: o,
|
|
480
480
|
vShow: c,
|
|
481
481
|
vModels: f,
|
|
482
|
-
vFor:
|
|
483
|
-
vBind:
|
|
482
|
+
vFor: u,
|
|
483
|
+
vBind: l,
|
|
484
484
|
vHtml: a,
|
|
485
485
|
customDirectives: y
|
|
486
|
-
} =
|
|
487
|
-
if (r &&
|
|
486
|
+
} = Pe(t);
|
|
487
|
+
if (r && n.push(`v-if="${h(r.value, !0, !0, e)}"`), o && n.push(
|
|
488
488
|
`v-else-if="${h(o.value, !0, !0, e)}"`
|
|
489
|
-
), i &&
|
|
489
|
+
), i && n.push("v-else"), c && n.push(
|
|
490
490
|
`v-show="${h(c.value, !0, !0, e)}"`
|
|
491
|
-
),
|
|
492
|
-
`v-bind="${h(
|
|
491
|
+
), l && n.push(
|
|
492
|
+
`v-bind="${h(l.value, !0, !0, e)}"`
|
|
493
493
|
), f.forEach((p) => {
|
|
494
494
|
const m = X(p.modifiers, !0), d = p.arg ? k(p.arg) ? `:[${h(p.arg, !0, !0, e)}]` : `:${p.arg}` : "";
|
|
495
|
-
|
|
495
|
+
n.push(
|
|
496
496
|
`v-model${d}${m}="${h(p.value, !0, !0, e)}"`
|
|
497
497
|
);
|
|
498
|
-
}),
|
|
499
|
-
const { item: p, index: m } = { item: "item", index: "index", ...
|
|
500
|
-
|
|
501
|
-
`v-for="(${p}, ${m}) in ${h(
|
|
498
|
+
}), u) {
|
|
499
|
+
const { item: p, index: m } = { item: "item", index: "index", ...u.iterator };
|
|
500
|
+
n.push(
|
|
501
|
+
`v-for="(${p}, ${m}) in ${h(u.value, !0, !0, e)}"`
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
|
-
return a &&
|
|
504
|
+
return a && n.push(
|
|
505
505
|
`v-html="${h(a.value, !0, !0, e)}"`
|
|
506
506
|
), y && y.length && y.forEach((p) => {
|
|
507
507
|
if (!p.name) return;
|
|
508
508
|
let m = "", d = "";
|
|
509
|
-
k(p.name) ? (d = h(p.name, !0, !0, e),
|
|
509
|
+
k(p.name) ? (d = h(p.name, !0, !0, e), s.push(d)) : d = p.name;
|
|
510
510
|
const $ = d?.startsWith("v") ? F(d) : F("v-" + d);
|
|
511
511
|
if (m += $, p.arg && (k(p.arg) ? m += `:[${h(p.name, !0, !0, e)}]` : m += `:${p.arg}`), p.modifiers) {
|
|
512
|
-
const
|
|
513
|
-
|
|
512
|
+
const v = Object.keys(p.modifiers);
|
|
513
|
+
v.length && (m += v.map((g) => "." + g));
|
|
514
514
|
}
|
|
515
|
-
p.value ?
|
|
515
|
+
p.value ? n.push(
|
|
516
516
|
`${m}="${h(p.value, !0, !0, e)}"`
|
|
517
|
-
) :
|
|
518
|
-
}),
|
|
517
|
+
) : n.push(m);
|
|
518
|
+
}), n;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function Pe(t = []) {
|
|
521
521
|
const e = t.filter(
|
|
522
|
-
(a) =>
|
|
523
|
-
),
|
|
524
|
-
(a) => !
|
|
525
|
-
),
|
|
526
|
-
(a) =>
|
|
522
|
+
(a) => J.includes(a.name)
|
|
523
|
+
), s = t.filter(
|
|
524
|
+
(a) => !J.includes(a.name)
|
|
525
|
+
), n = e.find(
|
|
526
|
+
(a) => b(a.name) === "vIf"
|
|
527
527
|
), r = e.find(
|
|
528
|
-
(a) =>
|
|
528
|
+
(a) => b(a.name) === "vElseIf"
|
|
529
529
|
), i = e.find(
|
|
530
|
-
(a) =>
|
|
530
|
+
(a) => b(a.name) === "vElse"
|
|
531
531
|
), o = e.find(
|
|
532
|
-
(a) =>
|
|
532
|
+
(a) => b(a.name) === "vFor"
|
|
533
533
|
), c = e.find(
|
|
534
|
-
(a) =>
|
|
534
|
+
(a) => b(a.name) === "vShow"
|
|
535
535
|
), f = e.find(
|
|
536
|
-
(a) =>
|
|
537
|
-
),
|
|
538
|
-
(a) =>
|
|
539
|
-
),
|
|
540
|
-
(a) =>
|
|
536
|
+
(a) => b(a.name) === "vBind"
|
|
537
|
+
), u = e.find(
|
|
538
|
+
(a) => b(a.name) === "vHtml"
|
|
539
|
+
), l = e.filter(
|
|
540
|
+
(a) => b(a.name) === "vModel"
|
|
541
541
|
);
|
|
542
542
|
return {
|
|
543
|
-
vIf:
|
|
543
|
+
vIf: n,
|
|
544
544
|
vElseIf: r,
|
|
545
545
|
vElse: i,
|
|
546
546
|
vFor: o,
|
|
547
547
|
vShow: c,
|
|
548
|
-
vModels:
|
|
548
|
+
vModels: l,
|
|
549
549
|
vBind: f,
|
|
550
|
-
vHtml:
|
|
551
|
-
customDirectives:
|
|
550
|
+
vHtml: u,
|
|
551
|
+
customDirectives: s
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
|
-
function xe(t, e,
|
|
555
|
-
return typeof t == "string" ? t : k(t) ? `{{ ${h(t, !1, !0, e)} }}` : Array.isArray(t) ? z(t,
|
|
554
|
+
function xe(t, e, s, n, r) {
|
|
555
|
+
return typeof t == "string" ? t : k(t) ? `{{ ${h(t, !1, !0, e)} }}` : Array.isArray(t) ? z(t, s, e, n, r) : "";
|
|
556
556
|
}
|
|
557
|
-
function _e(t, e,
|
|
557
|
+
function _e(t, e, s) {
|
|
558
558
|
if (!t) return e;
|
|
559
|
-
const
|
|
560
|
-
return `<template ${`#${
|
|
559
|
+
const n = typeof t == "string" ? { name: t, params: [] } : { params: [], ...t };
|
|
560
|
+
return `<template ${`#${n.name}="${n.params?.length > 0 ? `{${n.params?.join(",")}}` : `scope_${s}`}"`}>
|
|
561
561
|
${e}
|
|
562
562
|
</template>`;
|
|
563
563
|
}
|
|
564
|
-
function Ie(t, e = [],
|
|
564
|
+
function Ie(t, e = [], s = [], n = {}, r = "web") {
|
|
565
565
|
const i = [
|
|
566
566
|
"@dcloudio/uni-h5",
|
|
567
567
|
"uni-h5",
|
|
@@ -570,28 +570,28 @@ function Ie(t, e = [], n = [], s = {}, r = "web") {
|
|
|
570
570
|
], o = {
|
|
571
571
|
vue: ["defineComponent", "reactive"]
|
|
572
572
|
}, c = [];
|
|
573
|
-
for (const
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
576
|
-
const a = o[
|
|
577
|
-
a.push(y), r === "uniapp" && i.includes(
|
|
573
|
+
for (const u of e) {
|
|
574
|
+
const l = t.get(u.split(":")[0]);
|
|
575
|
+
if (l && l.package) {
|
|
576
|
+
const a = o[l.package] ?? (o[l.package] = []), y = l.parent || (l.alias || "").split(".")[0] || l.name;
|
|
577
|
+
a.push(y), r === "uniapp" && i.includes(l.package) && c.push(y);
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
for (const [
|
|
581
|
-
(o[
|
|
580
|
+
for (const [u, l] of Object.entries(n))
|
|
581
|
+
(o[u] ?? (o[u] = [])).push(...Array.from(l)), r === "uniapp" && i.includes(u) && c.push(...Array.from(l));
|
|
582
582
|
return {
|
|
583
|
-
imports: Object.entries(o).filter(([
|
|
583
|
+
imports: Object.entries(o).filter(([u, l]) => r === "uniapp" ? !i.includes(u) && !!l.length : !!l.length).map(([u, l]) => `import { ${C(l).join(
|
|
584
584
|
","
|
|
585
|
-
)}} from '${
|
|
585
|
+
)}} from '${u}';`).concat(s),
|
|
586
586
|
uniComponents: c
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
function Ae(t = {}) {
|
|
590
590
|
const e = [];
|
|
591
|
-
for (const [
|
|
591
|
+
for (const [s, n] of Object.entries(t))
|
|
592
592
|
e.push(`
|
|
593
|
-
${
|
|
594
|
-
${le(
|
|
593
|
+
${s} {
|
|
594
|
+
${le(n)}
|
|
595
595
|
}
|
|
596
596
|
`);
|
|
597
597
|
return e.join(`
|
|
@@ -599,76 +599,76 @@ function Ae(t = {}) {
|
|
|
599
599
|
}
|
|
600
600
|
function Ne(t = {}) {
|
|
601
601
|
const e = [];
|
|
602
|
-
return Object.entries(t).forEach(([
|
|
602
|
+
return Object.entries(t).forEach(([s, n]) => {
|
|
603
603
|
e.push(
|
|
604
|
-
`const ${
|
|
604
|
+
`const ${s} = provider.defineUrlSchemaComponent('${n.url}');`
|
|
605
605
|
);
|
|
606
606
|
}), e;
|
|
607
607
|
}
|
|
608
608
|
function Fe(t = {}) {
|
|
609
609
|
const e = [];
|
|
610
|
-
return Object.entries(t).forEach(([
|
|
610
|
+
return Object.entries(t).forEach(([s, n]) => {
|
|
611
611
|
e.push(
|
|
612
|
-
`const ${
|
|
612
|
+
`const ${s} = provider.definePluginComponent(${JSON.stringify(n)});`
|
|
613
613
|
);
|
|
614
614
|
}), e;
|
|
615
615
|
}
|
|
616
|
-
function Be(t, e,
|
|
617
|
-
const { dsl:
|
|
618
|
-
|
|
616
|
+
function Be(t, e, s = "web") {
|
|
617
|
+
const { dsl: n } = t, r = Object.keys(n.computed || {}), i = A(n.lifeCycles, r), o = A(n.computed, r), c = ge(n.watch, r), f = ye(n.dataSources), { methods: u, nodes: l, components: a, importBlocks: y, directives: p } = z(
|
|
618
|
+
n.nodes || [],
|
|
619
619
|
e,
|
|
620
620
|
r,
|
|
621
621
|
t.context
|
|
622
622
|
), m = [...o, ...c.computed], d = A(
|
|
623
623
|
{
|
|
624
|
-
...
|
|
625
|
-
...
|
|
624
|
+
...u,
|
|
625
|
+
...n.methods || {}
|
|
626
626
|
},
|
|
627
627
|
r
|
|
628
628
|
), $ = y.map((x) => `import ${x.name} from './${x.id}.vue';`);
|
|
629
|
-
let { imports:
|
|
629
|
+
let { imports: v, uniComponents: g } = Ie(
|
|
630
630
|
e,
|
|
631
631
|
a,
|
|
632
632
|
$,
|
|
633
633
|
t.imports,
|
|
634
|
-
|
|
634
|
+
s
|
|
635
635
|
);
|
|
636
636
|
const E = Object.keys({
|
|
637
637
|
...t.urlSchemas,
|
|
638
638
|
...t.blockPlugins
|
|
639
|
-
}),
|
|
639
|
+
}), O = Ne(t.urlSchemas), P = Fe(t.blockPlugins);
|
|
640
640
|
return {
|
|
641
|
-
id:
|
|
642
|
-
version:
|
|
643
|
-
name:
|
|
644
|
-
state: fe(
|
|
645
|
-
inject: me(
|
|
646
|
-
props: he(
|
|
647
|
-
emits: de(
|
|
641
|
+
id: n.id,
|
|
642
|
+
version: n.__VERSION__,
|
|
643
|
+
name: n.name,
|
|
644
|
+
state: fe(n.state).join(","),
|
|
645
|
+
inject: me(n.inject).join(","),
|
|
646
|
+
props: he(n.props).join(","),
|
|
647
|
+
emits: de(n.emits).join(","),
|
|
648
648
|
watch: c.watches.join(","),
|
|
649
649
|
lifeCycles: i.join(","),
|
|
650
650
|
computed: m.join(","),
|
|
651
651
|
methods: [...f, ...d].join(","),
|
|
652
652
|
imports: `
|
|
653
|
-
` +
|
|
653
|
+
` + v.join(`
|
|
654
654
|
`),
|
|
655
655
|
components: ue(a, g).join(","),
|
|
656
656
|
directives: p.join(","),
|
|
657
657
|
returns: t.members.join(","),
|
|
658
|
-
template:
|
|
658
|
+
template: l.join(`
|
|
659
659
|
`),
|
|
660
|
-
css:
|
|
660
|
+
css: n.css || "",
|
|
661
661
|
style: Ae(t.style),
|
|
662
|
-
urlSchemas:
|
|
662
|
+
urlSchemas: O.join(`
|
|
663
663
|
`),
|
|
664
|
-
blockPlugins:
|
|
664
|
+
blockPlugins: P.join(`
|
|
665
665
|
`),
|
|
666
666
|
asyncComponents: E.join(","),
|
|
667
667
|
uniComponents: g,
|
|
668
|
-
renderer:
|
|
668
|
+
renderer: s === "uniapp" ? "@vtj/uni-app" : "@vtj/renderer"
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
const
|
|
671
|
+
const De = `
|
|
672
672
|
// @ts-nocheck
|
|
673
673
|
|
|
674
674
|
<%= imports %>
|
|
@@ -700,28 +700,44 @@ export default defineComponent({
|
|
|
700
700
|
<% if(methods) { %> methods: { <%= methods %> }, <% } %>
|
|
701
701
|
<% if(watch) { %> watch: { <%= watch %> }, <% } %> <%= lifeCycles %>
|
|
702
702
|
});
|
|
703
|
-
`.replace(/(\n|\r|\t)/g, ""),
|
|
703
|
+
`.replace(/(\n|\r|\t)/g, ""), Te = `
|
|
704
704
|
<template>
|
|
705
705
|
<%= template %>
|
|
706
706
|
</template>
|
|
707
|
-
<script lang="
|
|
707
|
+
<script lang="<%= scriptLang %>">
|
|
708
708
|
<%= script %>
|
|
709
709
|
<\/script>
|
|
710
|
-
<style lang="
|
|
710
|
+
<style lang="<%= styleLang %>" scoped>
|
|
711
711
|
<%= css %>
|
|
712
712
|
<%= style %>
|
|
713
713
|
</style>
|
|
714
|
-
`,
|
|
715
|
-
async function
|
|
716
|
-
const i =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
714
|
+
`, Le = U(De), Re = U(Te);
|
|
715
|
+
async function Me(t, e = /* @__PURE__ */ new Map(), s = [], n = "web", r) {
|
|
716
|
+
const i = t, o = typeof i.dsl == "object" && arguments.length === 1 ? i : {
|
|
717
|
+
dsl: t,
|
|
718
|
+
componentMap: e,
|
|
719
|
+
dependencies: s,
|
|
720
|
+
platform: n,
|
|
721
|
+
formatterDisabled: r
|
|
722
|
+
}, {
|
|
723
|
+
dsl: c,
|
|
724
|
+
componentMap: f = /* @__PURE__ */ new Map(),
|
|
725
|
+
dependencies: u = [],
|
|
726
|
+
platform: l = "web",
|
|
727
|
+
formatterDisabled: a = !1,
|
|
728
|
+
ts: y = !0,
|
|
729
|
+
scss: p = !1
|
|
730
|
+
} = o, m = new pe(re(c), u), d = Be(m, f, l), $ = Le(d), v = Re({
|
|
731
|
+
template: d.template,
|
|
732
|
+
css: await L(d.css, a),
|
|
733
|
+
script: await ce($, a),
|
|
734
|
+
style: await L(d.style, a),
|
|
735
|
+
scriptLang: y ? "ts" : "js",
|
|
736
|
+
styleLang: p ? "scss" : "css"
|
|
721
737
|
});
|
|
722
|
-
return await
|
|
738
|
+
return await q(v, a).catch((g) => (g.content = v, Promise.reject(g)));
|
|
723
739
|
}
|
|
724
|
-
async function
|
|
740
|
+
async function Ve(t) {
|
|
725
741
|
const e = `
|
|
726
742
|
<template>
|
|
727
743
|
<div>
|
|
@@ -734,13 +750,13 @@ async function He(t) {
|
|
|
734
750
|
<style scoped lang="scss">
|
|
735
751
|
</style>
|
|
736
752
|
`;
|
|
737
|
-
return await
|
|
753
|
+
return await q(e);
|
|
738
754
|
}
|
|
739
755
|
export {
|
|
740
756
|
Ue as VTJ_CODER_VERSION,
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
757
|
+
Ve as createEmptyPage,
|
|
758
|
+
L as cssFormatter,
|
|
759
|
+
Me as generator,
|
|
744
760
|
ce as tsFormatter,
|
|
745
|
-
|
|
761
|
+
q as vueFormatter
|
|
746
762
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/coder",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.61",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"低代码引擎",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"prettier": "~3.6.0",
|
|
25
25
|
"@vtj/base": "~0.12.2",
|
|
26
|
-
"@vtj/core": "~0.12.
|
|
26
|
+
"@vtj/core": "~0.12.61"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@vtj/cli": "~0.12.8"
|
package/types/generator.d.ts
CHANGED
|
@@ -6,5 +6,14 @@ import { BlockSchema, MaterialDescription, Dependencie, PageFile, PlatformType }
|
|
|
6
6
|
* 3. Parser 解析 dsl,提取 token
|
|
7
7
|
* 4. Compiled token 注入模板生成代码文件字符串
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export interface GeneratorOptions {
|
|
10
|
+
dsl: BlockSchema;
|
|
11
|
+
componentMap?: Map<string, MaterialDescription>;
|
|
12
|
+
dependencies?: Dependencie[];
|
|
13
|
+
platform?: PlatformType;
|
|
14
|
+
formatterDisabled?: boolean;
|
|
15
|
+
ts?: boolean;
|
|
16
|
+
scss?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function generator(_dsl: BlockSchema | GeneratorOptions, _componentMap?: Map<string, MaterialDescription>, _dependencies?: Dependencie[], _platform?: PlatformType, _formatterDisabled?: boolean): Promise<string>;
|
|
10
19
|
export declare function createEmptyPage(file: PageFile): Promise<string>;
|
package/types/version.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/coder
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.12.
|
|
5
|
+
* @version 0.12.60
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.12.
|
|
8
|
+
export declare const version = "0.12.60";
|