@vtj/coder 0.8.100 → 0.8.101
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 +11 -11
- package/dist/index.mjs +31 -29
- package/package.json +3 -3
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/coder
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.8.
|
|
5
|
+
* @version 0.8.101
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const ee="0.8.
|
|
7
|
+
*/const ee="0.8.101";/**!
|
|
8
8
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
9
9
|
* @name @vtj/core
|
|
10
10
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
11
|
-
* @version 0.8.
|
|
11
|
+
* @version 0.8.101
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
13
|
*/const te=["slot","template","component","img","div","p","h1","h2","h3","span","a"];l.mitt();const _={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 q(t,e){return e?t:await x.format(t,{parser:"vue",..._,plugins:[K,I,T,J]})}async function ne(t,e){return e?t:await x.format(t,{parser:"babel-ts",..._,plugins:[I,T]})}async function R(t,e){return e?t:x.format(t,{parser:"scss",..._,plugins:[J]})}function E(t){return t&&t.type==="JSExpression"}function A(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function $(t){return E(t)||A(t)}function L(t){return t.replace(new RegExp("this.","g"),"")}function W(t){return t.replace(/this\.context\??\./g,"")}function u(t,e=!0,n=!0,r=[]){let i=$(t)?t.value:e?JSON.stringify(t):t;return i=w(i,r),n?L(W(i)):W(i)}function w(t,e=[]){let n=t;for(const r of e)n=n.replace(new RegExp(`this.${r}.value`,"g"),`this.${r}`);return n}function U(t){let e=t.trim();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 i=/^(async\s)?\([\w]*\)\s+\=\>\s([\w\W]+)/,s=e.match(i);s&&s[2]&&(s[2].startsWith("{")||(e=e.replace(s[2],`{ return ${s[2]} }`))),e=e.replace("=>","")}return e}function re(t={}){return Object.entries(t).map(([e,n])=>`"${e}": ${u(n)}`)}function V(t={},e=!1){const n=Object.keys(t);return e?n.map(r=>"."+r):n}function se(t){let e="";for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e+=n+": "+r+";"}return e}class ie{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(),i=n.join(".")+".",s=n.pop();if(r&&s){const o=this.dependencies.find(a=>a.library===s)?.package;o&&(this.imports[o]||(this.imports[o]=new Set)).add(r)}return{name:r,path:i,library:s}}return null}replaceLibraryPath(e){const{libraryRegex:n}=this;let r=e.value;for(const i of n){const s=e.value.match(i)||[];for(const o of s){const a=this.collectImport(o);if(a){const c=a.path.replace(/\$/g,"\\$");r=r.replace(new RegExp(c,"g"),"")}}}return r}walk(e){const n=r=>{if(!r||typeof r!="object")return;if(Array.isArray(r)){for(let s of r)n(s);return}const i=Object.values(r);for(const s of i)$(s)?s.value=this.replaceLibraryPath(s):n(s)};n(e)}getLibraryMember(e=[]){let n=[...e];for(const r of Object.values(this.imports))n=n.concat(Array.from(r));return l.dedupArray(n)}collectContext(e,n){const r=new Set(n?.id?this.context[n.id]:[]),i=(e.directives||[]).find(a=>a.name==="vFor");let s=new Set(Array.from(r));if(i){const{item:a="item",index:c="index"}=i.iterator||{};s=new Set([a,c,...Array.from(s)])}const o=e.slot;if(o){const a=typeof o=="string"?[]:o.params||[],c=a.length?a:[`scope_${n?.id}`];s=new Set([...c,...Array.from(s)])}this.context[e.id]=s}collectStyle(e){e.id&&e.props?.style&&Object.keys(e.props.style).length&&(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,i)=>{this.collectContext(r,i),this.collectStyle(r),this.collectUrlSchema(r),this.collectBlockPlugin(r),Array.isArray(r.children)&&r.children.forEach(s=>n(s,r))};Array.isArray(e.nodes)&&e.nodes.forEach(r=>n(r))}}function oe(t={}){return Object.entries(t).map(([e,n])=>{const r=u(n,!1);return`${e}:${r}`})}function ae(t=[]){return t.map(e=>`${e.name}: {
|
|
14
14
|
from: '${e.from||e.name}',
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
handler${U(s.handler.value)}
|
|
24
24
|
}`);return{computed:r,watches:i}}function pe(t={}){return Object.values(t).map(e=>{const n=A(e.transform)&&e.transform.value||"(res) => res";return`async ${e.name}(...args:any[]) {
|
|
25
25
|
return await this.provider.apis['${e.ref}'].apply(this, args).then(${n});
|
|
26
|
-
}`})}function M(t,e,n=[],r={},i){const s=[];let o={},a=[],c=[];return fe(t).forEach(
|
|
27
|
-
`),Object.assign(o,y?.methods||{}),a=a.concat(y?.components||[]),c=c.concat(y?.importBlocks||[]));const B=z(d)||Q(d)?"component":h;b.push(h==="img"?`<${h} ${N} ${g} ${F} />`:`<${B} ${N} ${g} ${F}>${
|
|
28
|
-
`+
|
|
29
|
-
`),i?.id);s.push(P)}),{nodes:s,methods:o,components:l.dedupArray(a),importBlocks:l.dedupArray(c,"id")}}function fe(t=[]){const e=new Map;for(const n of t){const r=typeof n.slot=="string"?n.slot:n.slot?.name,i=e.get(r);i?i.children.push(n):e.set(r,{slot:n.slot,children:[n]})}return e}function me(t,e,n){if(te.includes(t))return null;const r=e.get(t);if(r&&r.alias){const i=r.parent?`${r.parent}.${r.alias}`:r.alias;return`${t}: ${i}`}return D(n)||r?t:null}function D(t){return!!t&&typeof t=="object"&&t.type==="Schema"}function z(t){return typeof t=="object"&&t.type==="UrlSchema"}function Q(t){return typeof t=="object"&&t.type==="Plugin"}function he(t,e,n=[]){return t==="style"?"":t==="__class"&&$(e)?`:class="${u({...e,value:w(e.value,n)})}"`:typeof e=="string"?`${t}="${e}"`:$(e)?`:${t}="${u({...e,value:w(e.value,n)})}"`:l.isPlainObject(e)?`:${t}='{${re(e).join(", ")}}'`:`:${t}='${JSON.stringify(e)}'`}function de(t,e={},n=[]){if(!!Object.keys(e.style||{}).length){const s=`${t.name}_${t.id}`;e.class?typeof e.class=="string"?e.class=[e.class,s].join(" "):(e.__class=e.class,e.class=s):(e.class=s,delete e.style)}const i=t.from;return(z(i)||Q(i))&&(e.is={type:"JSExpression",value:t.name}),Object.entries(e).map(([s,o])=>he(s,o,n))}function ye(t,e,n,r,i){const s=V(e.modifiers,!0);return i?`@${t}${s.join("")}="${n}"`:r&&r.length>0?`@${t}${s.join("")}="(...args:any[]) => ${n}"`:`@${t}${s.join("")}="${n}"`}function ge(t,e={},n={}){const r={},i=Array.from(n[t]||new Set([])),s=i.length?`({${i.join(", ")}}, args)`:"";return{binders:Object.entries(e).map(([a,c])=>{const
|
|
26
|
+
}`})}function M(t,e,n=[],r={},i){const s=[];let o={},a=[],c=[];return fe(t).forEach(f=>{const b=[];for(const m of f.children){let{id:O,name:h,invisible:C,from:d}=m;if(C)continue;const v=me(h,e,d);v&&a.push(v),D(d)&&c.push({id:d.id,name:h});const{props:g,events:F,handlers:G}=$e(m,O,m.props,m.events,r,n),N=be(m.directives,n).join(" "),y=m.children?je(m.children,n,e,r,m):"";Object.assign(o,G);let j="";typeof y=="string"?j=y:(j=(y?.nodes||[]).join(`
|
|
27
|
+
`),Object.assign(o,y?.methods||{}),a=a.concat(y?.components||[]),c=c.concat(y?.importBlocks||[]));const B=z(d)||Q(d)?"component":h;b.push(h==="img"?`<${h} ${N} ${g} ${F} />`:`<${B} ${N} ${g} ${F}>${j?`
|
|
28
|
+
`+j.trim():""}</${B}>`)}const P=Se(f.slot,b.join(`
|
|
29
|
+
`),i?.id);s.push(P)}),{nodes:s,methods:o,components:l.dedupArray(a),importBlocks:l.dedupArray(c,"id")}}function fe(t=[]){const e=new Map;for(const n of t){const r=typeof n.slot=="string"?n.slot:n.slot?.name,i=e.get(r);i?i.children.push(n):e.set(r,{slot:n.slot,children:[n]})}return e}function me(t,e,n){if(te.includes(t))return null;const r=e.get(t);if(r&&r.alias){const i=r.parent?`${r.parent}.${r.alias}`:r.alias;return`${t}: ${i}`}return D(n)||r?t:null}function D(t){return!!t&&typeof t=="object"&&t.type==="Schema"}function z(t){return typeof t=="object"&&t.type==="UrlSchema"}function Q(t){return typeof t=="object"&&t.type==="Plugin"}function he(t,e,n=[]){return t==="style"?"":t==="__class"&&$(e)?`:class="${u({...e,value:w(e.value,n)})}"`:typeof e=="string"?`${t}="${e}"`:$(e)?`:${t}="${u({...e,value:w(e.value,n)})}"`:l.isPlainObject(e)?`:${t}='{${re(e).join(", ")}}'`:`:${t}='${JSON.stringify(e)}'`}function de(t,e={},n=[]){if(!!Object.keys(e.style||{}).length){const s=`${t.name}_${t.id}`;e.class?typeof e.class=="string"?e.class=[e.class,s].join(" "):(e.__class=e.class,e.class=s):(e.class=s,delete e.style)}const i=t.from;return(z(i)||Q(i))&&(e.is={type:"JSExpression",value:t.name}),Object.entries(e).map(([s,o])=>he(s,o,n))}function ye(t,e,n,r,i){const s=V(e.modifiers,!0);return i?`@${t}${s.join("")}="${n}"`:r&&r.length>0?`@${t}${s.join("")}="(...args:any[]) => ${n}"`:`@${t}${s.join("")}="${n}"`}function ge(t,e={},n={}){const r={},i=Array.from(n[t]||new Set([])),s=i.length?`({${i.join(", ")}}, args)`:"";return{binders:Object.entries(e).map(([a,c])=>{const p=c.handler.value.startsWith("this."),f=p?L(c.handler.value):`${l.camelCase(a)}_${t}${s}`;return p||(r[f]=i.length?{type:"JSFunction",value:`{
|
|
30
30
|
return (${c.handler.value}).apply(this, args);
|
|
31
|
-
}`}:c.handler),ye(a,c,
|
|
31
|
+
}`}:c.handler),ye(a,c,f,i,p)}),handlers:r}}function $e(t,e,n={},r={},i={},s){const{binders:o,handlers:a}=ge(e,r,i);return{props:de(t,n,s).join(" "),handlers:a,binders:o,events:o.join(" ")}}function be(t=[],e=[]){const n=[],{vIf:r,vShow:i,vModels:s,vFor:o,vBind:a}=ve(t);if(r&&n.push(`v-if="${u(r.value,!0,!0,e)}"`),i&&n.push(`v-show="${u(i.value,!0,!0,e)}"`),a&&n.push(`v-bind="${u(a.value,!0,!0,e)}"`),s.forEach(c=>{const p=V(c.modifiers,!0),f=c.arg?E(c.arg)?`:[${u(c.arg,!0,!0,e)}]`:`:${c.arg}`:"";n.push(`v-model${f}${p}="${u(c.value,!0,!0,e)}"`)}),o){const{item:c,index:p}={item:"item",index:"index",...o.iterator};n.push(`v-for="(${c}, ${p}) in ${u(o.value,!0,!0,e)}"`)}return n}function ve(t=[]){const e=t.find(o=>l.camelCase(o.name)==="vIf"),n=t.find(o=>l.camelCase(o.name)==="vFor"),r=t.find(o=>l.camelCase(o.name)==="vShow"),i=t.find(o=>l.camelCase(o.name)==="vBind"),s=t.filter(o=>l.camelCase(o.name)==="vModel");return{vIf:e,vFor:n,vShow:r,vModels:s,vBind:i}}function je(t,e,n,r,i){return typeof t=="string"?t:E(t)?`{{ ${u(t,!1,!0,e)} }}`:Array.isArray(t)?M(t,n,e,r,i):""}function Se(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}`}"`}>
|
|
32
32
|
${e}
|
|
33
33
|
</template>`}function we(t,e=[],n=[],r={}){const i={vue:["defineComponent","reactive"]};for(const s of e){const o=t.get(s.split(":")[0]);o&&o.package&&(i[o.package]??(i[o.package]=[])).push(o.parent||(o.alias||"").split(".")[0]||o.name)}for(const[s,o]of Object.entries(r))(i[s]??(i[s]=[])).push(...Array.from(o));return Object.entries(i).filter(([s,o])=>!!o.length).map(([s,o])=>`import { ${l.dedupArray(o).join(",")}} from '${s}';`).concat(n)}function ke(t={}){const e=[];for(const[n,r]of Object.entries(t))e.push(`
|
|
34
34
|
${n} {
|
|
35
35
|
${se(r)}
|
|
36
36
|
}
|
|
37
37
|
`);return e.join(`
|
|
38
|
-
`)}function Pe(t={}){const e=[];return Object.entries(t).forEach(([n,r])=>{e.push(`const ${n} = provider.defineUrlSchemaComponent('${r.url}');`)}),e}function Oe(t={}){const e=[];return Object.entries(t).forEach(([n,r])=>{e.push(`const ${n} = provider.definePluginComponent(${JSON.stringify(r)});`)}),e}function Ce(t,e){const{dsl:n}=t,r=Object.keys(n.computed||{}),i=S(n.lifeCycles,r),s=S(n.computed,r),o=ue(n.watch,r),a=pe(n.dataSources),{methods:c,nodes:
|
|
39
|
-
`),components:
|
|
38
|
+
`)}function Pe(t={}){const e=[];return Object.entries(t).forEach(([n,r])=>{e.push(`const ${n} = provider.defineUrlSchemaComponent('${r.url}');`)}),e}function Oe(t={}){const e=[];return Object.entries(t).forEach(([n,r])=>{e.push(`const ${n} = provider.definePluginComponent(${JSON.stringify(r)});`)}),e}function Ce(t,e){const{dsl:n}=t,r=Object.keys(n.computed||{}),i=S(n.lifeCycles,r),s=S(n.computed,r),o=ue(n.watch,r),a=pe(n.dataSources),{methods:c,nodes:p,components:f,importBlocks:b}=M(n.nodes||[],e,r,t.context),P=[...s,...o.computed],m=S({...c,...n.methods||{}},r),O=b.map(g=>`import ${g.name} from './${g.id}.vue';`),h=we(e,f,O,t.imports),C=Object.keys({...t.urlSchemas,...t.blockPlugins}),d=Pe(t.urlSchemas),v=Oe(t.blockPlugins);return{id:n.id,version:n.__VERSION__,name:n.name,state:oe(n.state).join(","),inject:ae(n.inject).join(","),props:ce(n.props).join(","),emits:le(n.emits).join(","),watch:o.watches.join(","),lifeCycles:i.join(","),computed:P.join(","),methods:[...a,...m].join(","),imports:h.join(`
|
|
39
|
+
`),components:f.join(","),returns:t.members.join(","),template:p.join(`
|
|
40
40
|
`),css:n.css||"",style:ke(t.style),urlSchemas:d.join(`
|
|
41
|
-
`),blockPlugins:
|
|
41
|
+
`),blockPlugins:v.join(`
|
|
42
42
|
`),asyncComponents:C.join(",")}}const xe=`
|
|
43
43
|
<%= imports %>
|
|
44
44
|
import { useProvider } from '@vtj/renderer';
|
package/dist/index.mjs
CHANGED
|
@@ -8,15 +8,15 @@ import * as T from "prettier/plugins/estree";
|
|
|
8
8
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
9
9
|
* @name @vtj/coder
|
|
10
10
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
11
|
-
* @version 0.8.
|
|
11
|
+
* @version 0.8.101
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
13
|
*/
|
|
14
|
-
const Bt = "0.8.
|
|
14
|
+
const Bt = "0.8.101";
|
|
15
15
|
/**!
|
|
16
16
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
17
17
|
* @name @vtj/core
|
|
18
18
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
19
|
-
* @version 0.8.
|
|
19
|
+
* @version 0.8.101
|
|
20
20
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
21
21
|
*/
|
|
22
22
|
const et = [
|
|
@@ -291,29 +291,29 @@ function pt(e = {}) {
|
|
|
291
291
|
function D(e, t, n = [], s = {}, i) {
|
|
292
292
|
const r = [];
|
|
293
293
|
let o = {}, c = [], a = [];
|
|
294
|
-
return ft(e).forEach((
|
|
294
|
+
return ft(e).forEach((p) => {
|
|
295
295
|
const v = [];
|
|
296
|
-
for (const
|
|
297
|
-
let { id: x, name: m, invisible: O, from: h } =
|
|
296
|
+
for (const f of p.children) {
|
|
297
|
+
let { id: x, name: m, invisible: O, from: h } = f;
|
|
298
298
|
if (O)
|
|
299
299
|
continue;
|
|
300
300
|
const b = mt(m, t, h);
|
|
301
301
|
b && c.push(b), Q(h) && a.push({ id: h.id, name: m });
|
|
302
302
|
const { props: g, events: F, handlers: H } = $t(
|
|
303
|
-
|
|
303
|
+
f,
|
|
304
304
|
x,
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
f.props,
|
|
306
|
+
f.events,
|
|
307
307
|
s,
|
|
308
308
|
n
|
|
309
|
-
), N = vt(
|
|
309
|
+
), N = vt(f.directives, n).join(
|
|
310
310
|
" "
|
|
311
|
-
), d =
|
|
312
|
-
|
|
311
|
+
), d = f.children ? jt(
|
|
312
|
+
f.children,
|
|
313
313
|
n,
|
|
314
314
|
t,
|
|
315
315
|
s,
|
|
316
|
-
|
|
316
|
+
f
|
|
317
317
|
) : "";
|
|
318
318
|
Object.assign(o, H);
|
|
319
319
|
let j = "";
|
|
@@ -325,7 +325,7 @@ function D(e, t, n = [], s = {}, i) {
|
|
|
325
325
|
` + j.trim() : ""}</${B}>`
|
|
326
326
|
);
|
|
327
327
|
}
|
|
328
|
-
const P = St(
|
|
328
|
+
const P = St(p.slot, v.join(`
|
|
329
329
|
`), i?.id);
|
|
330
330
|
r.push(P);
|
|
331
331
|
}), {
|
|
@@ -391,13 +391,13 @@ function gt(e, t = {}, n = {}) {
|
|
|
391
391
|
const s = {}, i = Array.from(n[e] || /* @__PURE__ */ new Set([])), r = i.length ? `({${i.join(", ")}}, args)` : "";
|
|
392
392
|
return {
|
|
393
393
|
binders: Object.entries(t).map(([c, a]) => {
|
|
394
|
-
const
|
|
395
|
-
return
|
|
394
|
+
const u = a.handler.value.startsWith("this."), p = u ? V(a.handler.value) : `${y(c)}_${e}${r}`;
|
|
395
|
+
return u || (s[p] = i.length ? {
|
|
396
396
|
type: "JSFunction",
|
|
397
397
|
value: `{
|
|
398
398
|
return (${a.handler.value}).apply(this, args);
|
|
399
399
|
}`
|
|
400
|
-
} : a.handler), yt(c, a,
|
|
400
|
+
} : a.handler), yt(c, a, p, i, u);
|
|
401
401
|
}),
|
|
402
402
|
handlers: s
|
|
403
403
|
};
|
|
@@ -412,18 +412,20 @@ function $t(e, t, n = {}, s = {}, i = {}, r) {
|
|
|
412
412
|
};
|
|
413
413
|
}
|
|
414
414
|
function vt(e = [], t = []) {
|
|
415
|
-
const n = [], { vIf: s, vShow: i, vModels: r, vFor: o } = bt(e);
|
|
415
|
+
const n = [], { vIf: s, vShow: i, vModels: r, vFor: o, vBind: c } = bt(e);
|
|
416
416
|
if (s && n.push(`v-if="${l(s.value, !0, !0, t)}"`), i && n.push(
|
|
417
417
|
`v-show="${l(i.value, !0, !0, t)}"`
|
|
418
|
-
),
|
|
419
|
-
|
|
418
|
+
), c && n.push(
|
|
419
|
+
`v-bind="${l(c.value, !0, !0, t)}"`
|
|
420
|
+
), r.forEach((a) => {
|
|
421
|
+
const u = M(a.modifiers, !0), p = a.arg ? _(a.arg) ? `:[${l(a.arg, !0, !0, t)}]` : `:${a.arg}` : "";
|
|
420
422
|
n.push(
|
|
421
|
-
`v-model${p}${
|
|
423
|
+
`v-model${p}${u}="${l(a.value, !0, !0, t)}"`
|
|
422
424
|
);
|
|
423
425
|
}), o) {
|
|
424
|
-
const { item:
|
|
426
|
+
const { item: a, index: u } = { item: "item", index: "index", ...o.iterator };
|
|
425
427
|
n.push(
|
|
426
|
-
`v-for="(${
|
|
428
|
+
`v-for="(${a}, ${u}) in ${l(o.value, !0, !0, t)}"`
|
|
427
429
|
);
|
|
428
430
|
}
|
|
429
431
|
return n;
|
|
@@ -490,12 +492,12 @@ function xt(e = {}) {
|
|
|
490
492
|
}), t;
|
|
491
493
|
}
|
|
492
494
|
function Ot(e, t) {
|
|
493
|
-
const { dsl: n } = e, s = Object.keys(n.computed || {}), i = S(n.lifeCycles, s), r = S(n.computed, s), o = ut(n.watch, s), c = pt(n.dataSources), { methods: a, nodes:
|
|
495
|
+
const { dsl: n } = e, s = Object.keys(n.computed || {}), i = S(n.lifeCycles, s), r = S(n.computed, s), o = ut(n.watch, s), c = pt(n.dataSources), { methods: a, nodes: u, components: p, importBlocks: v } = D(
|
|
494
496
|
n.nodes || [],
|
|
495
497
|
t,
|
|
496
498
|
s,
|
|
497
499
|
e.context
|
|
498
|
-
), P = [...r, ...o.computed],
|
|
500
|
+
), P = [...r, ...o.computed], f = S(
|
|
499
501
|
{
|
|
500
502
|
...a,
|
|
501
503
|
...n.methods || {}
|
|
@@ -503,7 +505,7 @@ function Ot(e, t) {
|
|
|
503
505
|
s
|
|
504
506
|
), x = v.map((g) => `import ${g.name} from './${g.id}.vue';`), m = wt(
|
|
505
507
|
t,
|
|
506
|
-
|
|
508
|
+
p,
|
|
507
509
|
x,
|
|
508
510
|
e.imports
|
|
509
511
|
), O = Object.keys({
|
|
@@ -521,12 +523,12 @@ function Ot(e, t) {
|
|
|
521
523
|
watch: o.watches.join(","),
|
|
522
524
|
lifeCycles: i.join(","),
|
|
523
525
|
computed: P.join(","),
|
|
524
|
-
methods: [...c, ...
|
|
526
|
+
methods: [...c, ...f].join(","),
|
|
525
527
|
imports: m.join(`
|
|
526
528
|
`),
|
|
527
|
-
components:
|
|
529
|
+
components: p.join(","),
|
|
528
530
|
returns: e.members.join(","),
|
|
529
|
-
template:
|
|
531
|
+
template: u.join(`
|
|
530
532
|
`),
|
|
531
533
|
css: n.css || "",
|
|
532
534
|
style: kt(e.style),
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/coder",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.101",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"prettier": "~3.3.0",
|
|
8
|
-
"@vtj/
|
|
9
|
-
"@vtj/
|
|
8
|
+
"@vtj/core": "~0.8.101",
|
|
9
|
+
"@vtj/base": "~0.8.10"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@vtj/cli": "~0.8.24"
|
package/types/version.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/coder
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.8.
|
|
5
|
+
* @version 0.8.100
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.8.
|
|
8
|
+
export declare const version = "0.8.100";
|