@vtj/coder 0.12.0-alpha.0 → 0.12.0-alpha.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.
- package/dist/index.cjs +16 -16
- package/dist/index.mjs +5 -5
- package/package.json +4 -4
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@vtj/base"),T=require("prettier/standalone"),Z=require("prettier/plugins/html"),K=require("prettier/plugins/babel"),ee=require("prettier/plugins/postcss"),te=require("prettier/plugins/estree");function F(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@vtj/base"),T=require("prettier/standalone"),Z=require("prettier/plugins/html"),K=require("prettier/plugins/babel"),ee=require("prettier/plugins/postcss"),te=require("prettier/plugins/estree");function F(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const ne=F(Z),D=F(K),L=F(ee),U=F(te);/**!
|
|
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.0-alpha.
|
|
5
|
+
* @version 0.12.0-alpha.2
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const
|
|
7
|
+
*/const re="0.12.0-alpha.2";/**!
|
|
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.0-alpha.
|
|
11
|
+
* @version 0.12.0-alpha.2
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
|
-
*/const
|
|
13
|
+
*/const se=["slot","template","component","img","div","p","h1","h2","h3","span","a"];f.mitt();const B={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 R(t,e){return e?t:await T.format(t,{parser:"vue",...B,plugins:[ne,D,U,L]})}async function M(t,e){if(e)return t;try{return(await T.format(t,{parser:"babel-ts",...B,plugins:[D,U]})).replace(/;\n$/gi,"")}catch(n){return console.warn(n),t}}async function I(t,e){return e?t:T.format(t,{parser:"scss",...B,plugins:[L]})}function S(t){return t&&t.type==="JSExpression"}function A(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function v(t){return S(t)||A(t)}function V(t){return t.replace(new RegExp("this.","g"),"")}function J(t){return t.replace(/this\.context\??\./g,"")}function m(t,e=!0,n=!0,r=[]){let s=v(t)?t.value.trim().replace(/\"/g,"'").replace(/;$/,""):e?JSON.stringify(t):t;return s=k(s,r),n?V(J(s)):J(s)}function k(t,e=[]){let n=t;for(const r of e)n=n.replace(new RegExp(`this.${r}.value`,"g"),`this.${r}`);return n}function H(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 s=/^(async\s)?\([\w]*\)\s+\=\>\s([\w\W]+)/,i=e.match(s);i&&i[2]&&(i[2].startsWith("{")||(e=e.replace(i[2],`{ return ${i[2]} }`))),e=e.replace("=>","")}return e}function ie(t={}){return Object.entries(t).map(([e,n])=>`"${e}": ${m(n)}`)}function Q(t={},e=!1){const n=Object.keys(t);return e?n.map(r=>"."+r):n}function oe(t){let e="";for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e+=n+": "+r+";"}return e}function ce(t=[],e=[]){return t.filter(n=>!e.includes(n))}class ae{constructor(e,n){this.dsl=e,this.dependencies=n,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 n=e.split(".");if(n.length===4){const r=n.pop(),s=n.join(".")+".",i=n.pop();if(r&&i){const c=this.dependencies.find(a=>a.library===i)?.package;c&&(this.imports[c]||(this.imports[c]=new Set)).add(r)}return{name:r,path:s,library:i}}return null}replaceLibraryPath(e){const{libraryRegex:n}=this;let r=e.value;for(const s of n){const i=e.value?.match(s)||[];for(const c of i){const a=this.collectImport(c);if(a){const p=a.path.replace(/\$/g,"\\$");r=r.replace(new RegExp(p,"g"),"")}}}return r}walk(e){const n=r=>{if(!r||typeof r!="object")return;if(Array.isArray(r)){for(let i of r)n(i);return}const s=Object.values(r);for(const i of s)v(i)?i.value=this.replaceLibraryPath(i):n(i)};n(e)}getLibraryMember(e=[]){let n=[...e];const r={...this.imports};delete r["uni-h5"],delete r["@dcloudio/uni-h5"],delete r["uni-ui"],delete r["@dcloudio/uni-ui"];for(const s of Object.values(r))n=n.concat(Array.from(s));return f.dedupArray(n)}collectContext(e,n){const r=new Set(n?.id?this.context[n.id]:[]),s=(e.directives||[]).find(a=>a.name==="vFor");let i=new Set(Array.from(r));if(s){const{item:a="item",index:p="index"}=s.iterator||{};i=new Set([a,p,...Array.from(i)])}const c=e.slot;if(c){const a=typeof c=="string"?[]:c.params||[],p=a.length?a:[`scope_${n?.id}`];i=new Set([...p,...Array.from(i)])}this.context[e.id]=i}collectStyle(e){e.id&&e.props?.style&&Object.keys(e.props.style).length&&!v(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 n=(r,s)=>{this.collectContext(r,s),this.collectStyle(r),this.collectUrlSchema(r),this.collectBlockPlugin(r),Array.isArray(r.children)&&r.children.forEach(i=>n(i,r))};Array.isArray(e.nodes)&&e.nodes.forEach(r=>n(r))}}function ue(t={}){return Object.entries(t).map(([e,n])=>{const r=m(n,!1);return`${e}:${r}`})}function le(t=[]){return t.map(e=>`${e.name}: {
|
|
14
14
|
from: '${e.from||e.name}',
|
|
15
15
|
default: ${m(e.default,!0,!1)}
|
|
16
16
|
}`)}function pe(t=[]){const e=n=>n?`[${f.toArray(n).map(i=>i.replace(/\'|\"/gi,"")).join(",")}]`:void 0;return t.map(n=>typeof n=="string"?`${n}: {}`:(v(n.default)&&!n.default.value&&(n.default.value="undefined"),`${n.name}: {
|
|
17
17
|
type:${e(n.type)},
|
|
18
18
|
required: ${m(!!n.required,!0,!1)},
|
|
19
19
|
default: ${m(n.default,!0,!1)}
|
|
20
|
-
}`))}function fe(t=[]){return t.map(e=>`'${typeof e=="string"?e:e.name}'`)}function E(t={},e=[]){return Object.entries(t).map(([n,
|
|
20
|
+
}`))}function fe(t=[]){return t.map(e=>`'${typeof e=="string"?e:e.name}'`)}function E(t={},e=[]){return Object.entries(t).map(([n,r])=>{let s=H(m(r,!1,!1));return s=k(s,e),s.startsWith("async")?`async ${n}${s.replace(/^async/,"")}`:`${n}${s}`})}function me(t=[],e=[]){const n=t.reduce((i,c)=>(c.id&&A(c.source)&&(i[`watcher_${c.id}`]=c.source),i),{}),r=E(n,e),s=t.map(i=>`watcher_${i.id}: {
|
|
21
21
|
deep: ${i.deep},
|
|
22
22
|
immediate:${i.immediate},
|
|
23
23
|
handler${H(i.handler.value)}
|
|
24
|
-
}`);return{computed:
|
|
24
|
+
}`);return{computed:r,watches:s}}function he(t={}){return Object.values(t).map(e=>{if(e.type==="mock"){const n=A(e.mockTemplate)&&e.mockTemplate.value||"(params) => ({})";return`async ${e.name}(...args:any[]) {
|
|
25
25
|
const mock = this.provider.createMock(${n})
|
|
26
26
|
return await mock.apply(this, args);
|
|
27
27
|
}`}else{const n=A(e.transform)&&e.transform.value||"(res) => res";return`async ${e.name}(...args:any[]) {
|
|
28
28
|
return await this.provider.apis['${e.ref}'].apply(this, args).then(${n});
|
|
29
|
-
}`}})}const de=["img","input","br","hr","area","base","col","embed","link","meta","param","source","track","wbr"],q=["vIf","vShow","vModel","vFor","vBind","vHtml"];function z(t,e,n=[],
|
|
29
|
+
}`}})}const de=["img","input","br","hr","area","base","col","embed","link","meta","param","source","track","wbr"],q=["vIf","vShow","vModel","vFor","vBind","vHtml"];function z(t,e,n=[],r={},s){const i=[];let c={},a=[];const p=[];let o=[];return ge(t).forEach(u=>{const h=[];for(const y of u.children){let{id:b,name:$,invisible:N,from:g}=y;if(N)continue;const w=$e($,e,g);w&&a.push(w),G(g)&&o.push({id:g.id,name:$});const{props:C,events:P,handlers:O}=ke(y,b,y.props,y.events,r,n),W=we(y.directives,n,p).join(" "),j=y.children?Pe(y.children,n,e,r,y):"";Object.assign(c,O);let _="";typeof j=="string"?_=j:(_=(j?.nodes||[]).join(`
|
|
30
30
|
`),Object.assign(c,j?.methods||{}),a=a.concat(j?.components||[]),o=o.concat(j?.importBlocks||[]));const x=["@dcloudio/uni-h5","@dcloudio/uni-ui"].includes(g)?f.kebabCase($):X(g)||Y(g)?"component":$;h.push(de.includes(x)?`<${x} ${W} ${C} ${P} />`:`<${x} ${W} ${C} ${P}>${_?`
|
|
31
31
|
`+_.trim():""}</${x}>`)}const d=Oe(u.slot,h.join(`
|
|
32
|
-
`),
|
|
32
|
+
`),s?.id);i.push(d)}),{nodes:i,methods:c,directives:ye(p),components:f.dedupArray(a),importBlocks:f.dedupArray(o,"id")}}function ye(t){return f.dedupArray(t).map(e=>`${e.startsWith("v")?e.substring(1):e}:${e}`)}function ge(t=[]){const e=new Map;for(const n of t){const r=typeof n.slot=="string"?n.slot:n.slot?.name,s=e.get(r);s?s.children.push(n):e.set(r,{slot:n.slot,children:[n]})}return e}function $e(t,e,n){if(se.includes(t))return null;const r=e.get(t);if(r&&r.alias){const s=r.parent?`${r.parent}.${r.alias}`:r.alias;return`${t}: ${s}`}return G(n)||r?t:null}function G(t){return!!t&&typeof t=="object"&&t.type==="Schema"}function X(t){return typeof t=="object"&&t.type==="UrlSchema"}function Y(t){return typeof t=="object"&&t.type==="Plugin"}function ve(t,e,n=[]){return t==="style"?v(e)?`:style="${m({...e,value:k(e.value,n)})}"`:"":t==="__class"&&v(e)?`:class="${m({...e,value:k(e.value,n)})}"`:typeof e=="string"?`${t}="${e}"`:v(e)?`:${t}="${m({...e,value:k(e.value,n)})}"`:f.isPlainObject(e)?`:${t}='{${ie(e).join(", ")}}'`:`:${t}='${JSON.stringify(e)}'`}function be(t,e={},n=[]){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,v(e.style)||delete e.style}const s=t.from;return(X(s)||Y(s))&&(e.is={type:"JSExpression",value:t.name}),Object.entries(e).map(([i,c])=>ve(i,c,n))}function je(t,e,n,r,s){const i=Q(e.modifiers,!0);return s?`@${t}${i.join("")}="${n}"`:r&&r.length>0?`@${t}${i.join("")}="(...args:any[]) => ${n}"`:`@${t}${i.join("")}="${n}"`}function Se(t,e={},n={}){const r={},s=Array.from(n[t]||new Set([])),i=s.length?`({${s.join(", ")}}, args)`:"";return{binders:Object.entries(e).map(([a,p])=>{const o=p.handler.value.startsWith("this."),l=o?V(p.handler.value):`${f.camelCase(a)}_${t}${i}`;return o||(r[l]=s.length?{type:"JSFunction",value:`{
|
|
33
33
|
return (${p.handler.value}).apply(this, args);
|
|
34
|
-
}`}:p.handler),je(a,p,l,
|
|
34
|
+
}`}:p.handler),je(a,p,l,s,o)}),handlers:r}}function ke(t,e,n={},r={},s={},i){const{binders:c,handlers:a}=Se(e,r,s);return{props:be(t,n,i).join(" "),handlers:a,binders:c,events:c.join(" ")}}function we(t=[],e=[],n=[]){const r=[],{vIf:s,vShow:i,vModels:c,vFor:a,vBind:p,vHtml:o,customDirectives:l}=Ce(t);if(s&&r.push(`v-if="${m(s.value,!0,!0,e)}"`),i&&r.push(`v-show="${m(i.value,!0,!0,e)}"`),p&&r.push(`v-bind="${m(p.value,!0,!0,e)}"`),c.forEach(u=>{const h=Q(u.modifiers,!0),d=u.arg?S(u.arg)?`:[${m(u.arg,!0,!0,e)}]`:`:${u.arg}`:"";r.push(`v-model${d}${h}="${m(u.value,!0,!0,e)}"`)}),a){const{item:u,index:h}={item:"item",index:"index",...a.iterator};r.push(`v-for="(${u}, ${h}) in ${m(a.value,!0,!0,e)}"`)}return o&&r.push(`v-html="${m(o.value,!0,!0,e)}"`),l&&l.length&&l.forEach(u=>{if(!u.name)return;let h="",d="";S(u.name)?(d=m(u.name,!0,!0,e),n.push(d)):d=u.name;const y=d?.startsWith("v")?f.kebabCase(d):f.kebabCase("v-"+d);if(h+=y,u.arg&&(S(u.arg)?h+=`:[${m(u.name,!0,!0,e)}]`:h+=`:${u.arg}`),u.modifiers){const b=Object.keys(u.modifiers);b.length&&(h+=b.map($=>"."+$))}u.value?r.push(`${h}="${m(u.value,!0,!0,e)}"`):r.push(h)}),r}function Ce(t=[]){const e=t.filter(o=>q.includes(o.name)),n=t.filter(o=>!q.includes(o.name)),r=e.find(o=>f.camelCase(o.name)==="vIf"),s=e.find(o=>f.camelCase(o.name)==="vFor"),i=e.find(o=>f.camelCase(o.name)==="vShow"),c=e.find(o=>f.camelCase(o.name)==="vBind"),a=e.find(o=>f.camelCase(o.name)==="vHtml"),p=e.filter(o=>f.camelCase(o.name)==="vModel");return{vIf:r,vFor:s,vShow:i,vModels:p,vBind:c,vHtml:a,customDirectives:n}}function Pe(t,e,n,r,s){return typeof t=="string"?t:S(t)?`{{ ${m(t,!1,!0,e)} }}`:Array.isArray(t)?z(t,n,e,r,s):""}function Oe(t,e,n){if(!t)return e;const r=typeof t=="string"?{name:t,params:[]}:{params:[],...t};return`<template ${`#${r.name}="${r.params?.length>0?`{${r.params?.join(",")}}`:`scope_${n}`}"`}>
|
|
35
35
|
${e}
|
|
36
|
-
</template>`}function _e(t,e=[],n=[],
|
|
36
|
+
</template>`}function _e(t,e=[],n=[],r={},s="web"){const i=["@dcloudio/uni-h5","uni-h5","@dcloudio/uni-ui","uni-ui"],c={vue:["defineComponent","reactive"]},a=[];for(const o of e){const l=t.get(o.split(":")[0]);if(l&&l.package){const u=c[l.package]??(c[l.package]=[]),h=l.parent||(l.alias||"").split(".")[0]||l.name;u.push(h),s==="uniapp"&&i.includes(l.package)&&a.push(h)}}for(const[o,l]of Object.entries(r))(c[o]??(c[o]=[])).push(...Array.from(l)),s==="uniapp"&&i.includes(o)&&a.push(...Array.from(l));return{imports:Object.entries(c).filter(([o,l])=>s==="uniapp"?!i.includes(o)&&!!l.length:!!l.length).map(([o,l])=>`import { ${f.dedupArray(l).join(",")}} from '${o}';`).concat(n),uniComponents:a}}function xe(t={}){const e=[];for(const[n,r]of Object.entries(t))e.push(`
|
|
37
37
|
${n} {
|
|
38
|
-
${oe(
|
|
38
|
+
${oe(r)}
|
|
39
39
|
}
|
|
40
40
|
`);return e.join(`
|
|
41
|
-
`)}function Ee(t={}){const e=[];return Object.entries(t).forEach(([n,
|
|
41
|
+
`)}function Ee(t={}){const e=[];return Object.entries(t).forEach(([n,r])=>{e.push(`const ${n} = provider.defineUrlSchemaComponent('${r.url}');`)}),e}function Ae(t={}){const e=[];return Object.entries(t).forEach(([n,r])=>{e.push(`const ${n} = provider.definePluginComponent(${JSON.stringify(r)});`)}),e}function Fe(t,e,n="web"){const{dsl:r}=t,s=Object.keys(r.computed||{}),i=E(r.lifeCycles,s),c=E(r.computed,s),a=me(r.watch,s),p=he(r.dataSources),{methods:o,nodes:l,components:u,importBlocks:h,directives:d}=z(r.nodes||[],e,s,t.context),y=[...c,...a.computed],b=E({...o,...r.methods||{}},s),$=h.map(O=>`import ${O.name} from './${O.id}.vue';`);let{imports:N,uniComponents:g}=_e(e,u,$,t.imports,n);const w=Object.keys({...t.urlSchemas,...t.blockPlugins}),C=Ee(t.urlSchemas),P=Ae(t.blockPlugins);return{id:r.id,version:r.__VERSION__,name:r.name,state:ue(r.state).join(","),inject:le(r.inject).join(","),props:pe(r.props).join(","),emits:fe(r.emits).join(","),watch:a.watches.join(","),lifeCycles:i.join(","),computed:y.join(","),methods:[...p,...b].join(","),imports:`
|
|
42
42
|
`+N.join(`
|
|
43
43
|
`),components:ce(u,g).join(","),directives:d.join(","),returns:t.members.join(","),template:l.join(`
|
|
44
|
-
`),css:
|
|
44
|
+
`),css:r.css||"",style:xe(t.style),urlSchemas:C.join(`
|
|
45
45
|
`),blockPlugins:P.join(`
|
|
46
46
|
`),asyncComponents:w.join(","),uniComponents:g,renderer:n==="uniapp"?"@vtj/uni-app":"@vtj/renderer"}}const Ne=`
|
|
47
47
|
// @ts-nocheck
|
|
@@ -86,7 +86,7 @@ export default defineComponent({
|
|
|
86
86
|
<%= css %>
|
|
87
87
|
<%= style %>
|
|
88
88
|
</style>
|
|
89
|
-
`,Te=f.template(Ne),Be=f.template(Ie);async function Re(t,e=new Map,n=[],
|
|
89
|
+
`,Te=f.template(Ne),Be=f.template(Ie);async function Re(t,e=new Map,n=[],r="web",s){const i=new ae(f.cloneDeep(t),n),c=Fe(i,e,r),a=Te(c),p=Be({template:c.template,css:await I(c.css,s),script:await M(a,s),style:await I(c.style,s)});return await R(p,s).catch(o=>(o.content=p,Promise.reject(o)))}async function We(t){const e=`
|
|
90
90
|
<template>
|
|
91
91
|
<div>
|
|
92
92
|
<h3>源码模式页面</h3>
|
|
@@ -97,4 +97,4 @@ export default defineComponent({
|
|
|
97
97
|
<\/script>
|
|
98
98
|
<style scoped lang="scss">
|
|
99
99
|
</style>
|
|
100
|
-
`;return await R(e)}exports.VTJ_CODER_VERSION=
|
|
100
|
+
`;return await R(e)}exports.VTJ_CODER_VERSION=re;exports.createEmptyPage=We;exports.cssFormatter=I;exports.generator=Re;exports.tsFormatter=M;exports.vueFormatter=R;
|
package/dist/index.mjs
CHANGED
|
@@ -8,15 +8,15 @@ import * as H from "prettier/plugins/estree";
|
|
|
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.0-alpha.
|
|
11
|
+
* @version 0.12.0-alpha.2
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
13
|
*/
|
|
14
|
-
const Le = "0.12.0-alpha.
|
|
14
|
+
const Le = "0.12.0-alpha.2";
|
|
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.0-alpha.
|
|
19
|
+
* @version 0.12.0-alpha.2
|
|
20
20
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
21
21
|
*/
|
|
22
22
|
const re = [
|
|
@@ -95,7 +95,7 @@ function J(t) {
|
|
|
95
95
|
return t.replace(/this\.context\??\./g, "");
|
|
96
96
|
}
|
|
97
97
|
function f(t, e = !0, n = !0, s = []) {
|
|
98
|
-
let r = $(t) ? t.value.replace(/\"/g, "'") : e ? JSON.stringify(t) : t;
|
|
98
|
+
let r = $(t) ? t.value.trim().replace(/\"/g, "'").replace(/;$/, "") : e ? JSON.stringify(t) : t;
|
|
99
99
|
return r = k(r, s), n ? q(J(r)) : J(r);
|
|
100
100
|
}
|
|
101
101
|
function k(t, e = []) {
|
|
@@ -108,7 +108,7 @@ function k(t, e = []) {
|
|
|
108
108
|
return n;
|
|
109
109
|
}
|
|
110
110
|
function Q(t) {
|
|
111
|
-
let e = t.trim();
|
|
111
|
+
let e = t.trim().replace(/;$/, "");
|
|
112
112
|
if (e = /^\((\(|async|function)/.test(e) ? e.substring(1, e.length - 1) : e, e.startsWith("{")) return e;
|
|
113
113
|
if (e.startsWith("async function"))
|
|
114
114
|
e = e.replace(/^async function/, "async");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/coder",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.12.0-alpha.
|
|
4
|
+
"version": "0.12.0-alpha.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"低代码引擎",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"prettier": "~3.5.0",
|
|
25
|
-
"@vtj/
|
|
26
|
-
"@vtj/
|
|
25
|
+
"@vtj/core": "~0.12.0-alpha.2",
|
|
26
|
+
"@vtj/base": "~0.12.0-alpha.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@vtj/cli": "~0.12.0-alpha.
|
|
29
|
+
"@vtj/cli": "~0.12.0-alpha.1"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
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.
|
|
5
|
+
* @version 0.12.0-alpha.1
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.
|
|
8
|
+
export declare const version = "0.12.0-alpha.1";
|