@vtj/coder 0.7.12 → 0.7.14

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 CHANGED
@@ -1,31 +1,37 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@vtj/base"),C=require("prettier/standalone"),B=require("prettier/plugins/html"),V=require("prettier/plugins/babel"),D=require("prettier/plugins/postcss"),M=require("prettier/plugins/estree");function v(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Q=v(B),z=v(V),G=v(D),H=v(M);/**!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@vtj/base"),k=require("prettier/standalone"),L=require("prettier/plugins/html"),M=require("prettier/plugins/babel"),V=require("prettier/plugins/postcss"),D=require("prettier/plugins/estree");function b(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Q=b(L),z=b(M),G=b(V),H=b(D);/**!
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.7.12
5
+ * @version 0.7.14
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const U="0.7.12";p.mitt();const O={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 F(t,e){return e?t:await C.format(t,{parser:"html",...O,plugins:[Q]})}async function X(t,e){return e?t:await C.format(t,{parser:"babel-ts",...O,plugins:[z,H]})}async function Y(t,e){return e?t:C.format(t,{parser:"scss",...O,plugins:[G]})}function k(t){return t&&t.type==="JSExpression"}function x(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function P(t){return k(t)||x(t)}function N(t){return t.replace(new RegExp("this.","g"),"")}function E(t){return t.replace(new RegExp("this.context.","g"),"")}function u(t,e=!0,r=!0){const n=P(t)?t.value:e?JSON.stringify(t):t;return r?N(E(n)):E(n)}function _(t,e=[]){let r=t;for(const n of e)r=r.replace(new RegExp(`this.${n}.value`,"g"),`this.${n}`);return r}function I(t){let e=t.trim();return e.startsWith("{")||(e.startsWith("async function")?e=e.replace(/^async function/,"async"):e.startsWith("function")?e=e.replace(/^function/,""):e=e.replace("=>","")),e}function Z(t={}){return Object.entries(t).map(([e,r])=>`"${e}": ${u(r)}`)}function R(t={},e=!1){const r=Object.keys(t);return e?r.map(n=>"."+n):r}class K{constructor(e,r){this.dsl=e,this.dependencies=r,this.libraryRegex=this.collectLibrary(),this.walk(e),this.walkNodes(e),this.members=this.getLibraryMember()}imports={};context={};members=[];libraryRegex=[];collectLibrary(){return this.dependencies.filter(e=>!!e.library).map(e=>new RegExp(`(this.\\$libs.${e.library}.([\\w]+))`,"g"))}collectImport(e){const r=e.split(".");if(r.length===4){const n=r.pop(),i=r.join(".")+".",s=r.pop();if(n&&s){const o=this.dependencies.find(a=>a.library===s)?.package;o&&(this.imports[o]||(this.imports[o]=new Set)).add(n)}return{name:n,path:i,library:s}}return null}replaceLibraryPath(e){const{libraryRegex:r}=this;let n=e.value;for(const i of r){const s=e.value.match(i)||[];for(const o of s){const a=this.collectImport(o);if(a){const c=a.path.replace(/\$/g,"\\$");n=n.replace(new RegExp(c,"g"),"")}}}return n}walk(e){const r=n=>{if(!n||typeof n!="object")return;if(Array.isArray(n)){for(let s of n)r(s);return}const i=Object.values(n);for(const s of i)P(s)?s.value=this.replaceLibraryPath(s):r(s)};r(e)}getLibraryMember(e=[]){let r=[...e];for(const n of Object.values(this.imports))r=r.concat(Array.from(n));return p.dedupArray(r)}collectContext(e,r){const n=new Set(r?.id?this.context[r.id]:[]),i=(e.directives||[]).find(a=>a.name==="vFor");let s=new Set(Array.from(n));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_${r?.id}`];s=new Set([...c,...Array.from(s)])}this.context[e.id]=s}walkNodes(e){const r=(n,i)=>{this.collectContext(n,i),Array.isArray(n.children)&&n.children.forEach(s=>r(s,n))};Array.isArray(e.nodes)&&e.nodes.forEach(n=>r(n))}}function ee(t={}){return Object.entries(t).map(([e,r])=>{const n=u(r,!1);return`${e}:${n}`})}function te(t=[]){return t.map(e=>`${e.name}: {
7
+ */const U="0.7.14";/**!
8
+ * Copyright (c) 2024, VTJ.PRO All rights reserved.
9
+ * @name @vtj/core
10
+ * @author CHC chenhuachun1549@dingtalk.com
11
+ * @version 0.7.14
12
+ * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
+ */const X=["slot","template","component","img","div","p","h1","h2","h3","span","a"];p.mitt();const x={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 I(t,e){return e?t:await k.format(t,{parser:"html",...x,plugins:[Q]})}async function Y(t,e){return e?t:await k.format(t,{parser:"babel-ts",...x,plugins:[z,H]})}async function Z(t,e){return e?t:k.format(t,{parser:"scss",...x,plugins:[G]})}function C(t){return t&&t.type==="JSExpression"}function O(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function P(t){return C(t)||O(t)}function _(t){return t.replace(new RegExp("this.","g"),"")}function W(t){return t.replace(/this\.context\??\./g,"")}function u(t,e=!0,r=!0){const n=P(t)?t.value:e?JSON.stringify(t):t;return r?_(W(n)):W(n)}function A(t,e=[]){let r=t;for(const n of e)r=r.replace(new RegExp(`this.${n}.value`,"g"),`this.${n}`);return r}function q(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 K(t={}){return Object.entries(t).map(([e,r])=>`"${e}": ${u(r)}`)}function B(t={},e=!1){const r=Object.keys(t);return e?r.map(n=>"."+n):r}class ee{constructor(e,r){this.dsl=e,this.dependencies=r,this.libraryRegex=this.collectLibrary(),this.walk(e),this.walkNodes(e),this.members=this.getLibraryMember()}imports={};context={};members=[];libraryRegex=[];collectLibrary(){return this.dependencies.filter(e=>!!e.library).map(e=>new RegExp(`(this.\\$libs.${e.library}.([\\w]+))`,"g"))}collectImport(e){const r=e.split(".");if(r.length===4){const n=r.pop(),i=r.join(".")+".",s=r.pop();if(n&&s){const o=this.dependencies.find(a=>a.library===s)?.package;o&&(this.imports[o]||(this.imports[o]=new Set)).add(n)}return{name:n,path:i,library:s}}return null}replaceLibraryPath(e){const{libraryRegex:r}=this;let n=e.value;for(const i of r){const s=e.value.match(i)||[];for(const o of s){const a=this.collectImport(o);if(a){const c=a.path.replace(/\$/g,"\\$");n=n.replace(new RegExp(c,"g"),"")}}}return n}walk(e){const r=n=>{if(!n||typeof n!="object")return;if(Array.isArray(n)){for(let s of n)r(s);return}const i=Object.values(n);for(const s of i)P(s)?s.value=this.replaceLibraryPath(s):r(s)};r(e)}getLibraryMember(e=[]){let r=[...e];for(const n of Object.values(this.imports))r=r.concat(Array.from(n));return p.dedupArray(r)}collectContext(e,r){const n=new Set(r?.id?this.context[r.id]:[]),i=(e.directives||[]).find(a=>a.name==="vFor");let s=new Set(Array.from(n));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_${r?.id}`];s=new Set([...c,...Array.from(s)])}this.context[e.id]=s}walkNodes(e){const r=(n,i)=>{this.collectContext(n,i),Array.isArray(n.children)&&n.children.forEach(s=>r(s,n))};Array.isArray(e.nodes)&&e.nodes.forEach(n=>r(n))}}function te(t={}){return Object.entries(t).map(([e,r])=>{const n=u(r,!1);return`${e}:${n}`})}function re(t=[]){return t.map(e=>`${e.name}: {
8
14
  from: '${e.from||e.name}',
9
15
  default: ${u(e.default,!0,!1)}
10
- }`)}function re(t=[]){const e=r=>r?`[${p.toArray(r).map(s=>s.replace(/\'|\"/gi,"")).join(",")}]`:void 0;return t.map(r=>typeof r=="string"?`${r}: {}`:`${r.name}: {
16
+ }`)}function ne(t=[]){const e=r=>r?`[${p.toArray(r).map(s=>s.replace(/\'|\"/gi,"")).join(",")}]`:void 0;return t.map(r=>typeof r=="string"?`${r}: {}`:`${r.name}: {
11
17
  type:${e(r.type)},
12
18
  required: ${r.required},
13
19
  default: ${u(r.default,!0,!1)}
14
- }`)}function ne(t=[]){return t.map(e=>`'${e}'`)}function $(t={},e=[]){return Object.entries(t).map(([r,n])=>{let i=I(u(n,!1,!1));return i=_(i,e),i.startsWith("async")?`async ${r}${i.replace(/^async/,"")}`:`${r}${i}`})}function se(t=[],e=[]){const r=t.reduce((s,o)=>(o.id&&x(o.source)&&(s[`watcher_${o.id}`]=o.source),s),{}),n=$(r,e),i=t.map(s=>`watcher_${s.id}: {
20
+ }`)}function se(t=[]){return t.map(e=>`'${e}'`)}function $(t={},e=[]){return Object.entries(t).map(([r,n])=>{let i=q(u(n,!1,!1));return i=A(i,e),i.startsWith("async")?`async ${r}${i.replace(/^async/,"")}`:`${r}${i}`})}function oe(t=[],e=[]){const r=t.reduce((s,o)=>(o.id&&O(o.source)&&(s[`watcher_${o.id}`]=o.source),s),{}),n=$(r,e),i=t.map(s=>`watcher_${s.id}: {
15
21
  deep: ${s.deep},
16
22
  immediate:${s.immediate},
17
- handler${I(s.handler.value)}
18
- }`);return{computed:n,watches:i}}function oe(t={}){return Object.values(t).map(e=>{const r=x(e.transform)&&e.transform.value||"(res) => res";return`async ${e.name}(...args:any[]) {
23
+ handler${q(s.handler.value)}
24
+ }`);return{computed:n,watches:i}}function ie(t={}){return Object.values(t).map(e=>{const r=O(e.transform)&&e.transform.value||"(res) => res";return`async ${e.name}(...args:any[]) {
19
25
  return await this.provider.apis.${e.ref}.apply(this, args).then(${r});
20
- }`})}function q(t,e,r=[],n={},i){const s=[];let o={},a=[],c=[];return ie(t).forEach(h=>{const y=[];for(const l of h.children){let{id:j,name:f,invisible:g,from:w}=l;if(g)continue;const A=ae(f,e,w);A&&a.push(A),ce(w)&&c.push({id:w.id,name:f});const{props:T,events:J,handlers:L}=me(j,l.props,l.events,n,r),W=de(l.directives).join(" "),m=l.children?ye(l.children,r,e,n,l):"";Object.assign(o,L);let S="";typeof m=="string"?S=m:(S=(m?.nodes||[]).join(`
21
- `),Object.assign(o,m?.methods||{}),a=a.concat(m?.components||[]),c=c.concat(m?.importBlocks||[])),y.push(`<${f} ${W} ${T} ${J}>${S.trim()}</${f}>`)}const b=ge(h.slot,y.join(`
22
- `),i?.id);s.push(b)}),{nodes:s,methods:o,components:p.dedupArray(a),importBlocks:p.dedupArray(c,"id")}}function ie(t=[]){const e=new Map;for(const r of t){const n=typeof r.slot=="string"?r.slot:r.slot?.name,i=e.get(n);i?i.children.push(r):e.set(n,{slot:r.slot,children:[r]})}return e}function ae(t,e,r){if(["slot","component","template"].includes(t))return null;const n=e.get(t);if(n&&n.alias){const i=n.parent?`${n.parent}.${n.alias}`:n.alias;return`${t}: ${i}`}return r||n?t:null}function ce(t){return!!t&&typeof t=="object"&&t.type==="Schema"}function pe(t,e,r=[]){return typeof e=="string"?`${t}="${e}"`:P(e)?`:${t}="${u({...e,value:_(e.value,r)})}"`:p.isPlainObject(e)?`:${t}='{${Z(e).join(", ")}}'`:`:${t}='${JSON.stringify(e)}'`}function ue(t={},e=[]){return Object.entries(t).map(([r,n])=>pe(r,n,e))}function le(t,e,r,n){const i=R(e.modifiers,!0);return n&&n.length>0?`@${t}${i.join("")}="(...args:any[]) => ${r}"`:`@${t}${i.join("")}="${r}"`}function fe(t,e={},r={}){const n={},i=Array.from(r[t]||new Set([])),s=i.length?`({${i.join(", ")}}, args)`:"";return{binders:Object.entries(e).map(([a,c])=>{const d=`${p.camelCase(a)}_handler_${t}${s}`;return n[d]=i.length?{type:"JSFunction",value:`{
26
+ }`})}function T(t,e,r=[],n={},i){const s=[];let o={},a=[],c=[];return ae(t).forEach(f=>{const g=[];for(const l of f.children){let{id:j,name:m,invisible:y,from:w}=l;if(y)continue;const E=ce(m,e,w);E&&a.push(E),pe(w)&&c.push({id:w.id,name:m});const{props:F,events:N,handlers:J}=de(j,l.props,l.events,n,r),R=he(l.directives).join(" "),d=l.children?ye(l.children,r,e,n,l):"";Object.assign(o,J);let S="";typeof d=="string"?S=d:(S=(d?.nodes||[]).join(`
27
+ `),Object.assign(o,d?.methods||{}),a=a.concat(d?.components||[]),c=c.concat(d?.importBlocks||[])),g.push(m==="img"?`<${m} ${R} ${F} ${N} />`:`<${m} ${R} ${F} ${N}>${S.trim()}</${m}>`)}const v=$e(f.slot,g.join(`
28
+ `),i?.id);s.push(v)}),{nodes:s,methods:o,components:p.dedupArray(a),importBlocks:p.dedupArray(c,"id")}}function ae(t=[]){const e=new Map;for(const r of t){const n=typeof r.slot=="string"?r.slot:r.slot?.name,i=e.get(n);i?i.children.push(r):e.set(n,{slot:r.slot,children:[r]})}return e}function ce(t,e,r){if(X.includes(t))return null;const n=e.get(t);if(n&&n.alias){const i=n.parent?`${n.parent}.${n.alias}`:n.alias;return`${t}: ${i}`}return r||n?t:null}function pe(t){return!!t&&typeof t=="object"&&t.type==="Schema"}function ue(t,e,r=[]){return typeof e=="string"?`${t}="${e}"`:P(e)?`:${t}="${u({...e,value:A(e.value,r)})}"`:p.isPlainObject(e)?`:${t}='{${K(e).join(", ")}}'`:`:${t}='${JSON.stringify(e)}'`}function le(t={},e=[]){return Object.entries(t).map(([r,n])=>ue(r,n,e))}function fe(t,e,r,n){const i=B(e.modifiers,!0);return n&&n.length>0?`@${t}${i.join("")}="(...args:any[]) => ${r}"`:`@${t}${i.join("")}="${r}"`}function me(t,e={},r={}){const n={},i=Array.from(r[t]||new Set([])),s=i.length?`({${i.join(", ")}}, args)`:"";return{binders:Object.entries(e).map(([a,c])=>{const h=c.handler.value.startsWith("this."),f=h?_(c.handler.value):`${p.camelCase(a)}_handler_${t}${s}`;return h||(n[f]=i.length?{type:"JSFunction",value:`{
23
29
  return (${c.handler.value}).apply(this, args);
24
- }`}:c.handler,le(a,c,d,i)}),handlers:n}}function me(t,e={},r={},n={},i){const{binders:s,handlers:o}=fe(t,r,n);return{props:ue(e,i).join(" "),handlers:o,binders:s,events:s.join(" ")}}function de(t=[]){const e=[],{vIf:r,vShow:n,vModels:i,vFor:s}=he(t);if(r&&e.push(`v-if="${u(r.value)}"`),n&&e.push(`v-show="${u(n.value)}"`),i.forEach(o=>{const a=R(o.modifiers,!0),c=o.arg?k(o.arg)?`:[${u(o.arg)}]`:`:${o.arg}`:"";e.push(`v-model${c}${a}="${u(o.value)}"`)}),s){const{item:o,index:a}={item:"item",index:"index",...s.iterator};e.push(`v-for="(${o}, ${a}) in ${u(s.value)}"`)}return e}function he(t=[]){const e=t.find(o=>p.camelCase(o.name)==="vIf"),r=t.find(o=>p.camelCase(o.name)==="vFor"),n=t.find(o=>p.camelCase(o.name)==="vShow"),i=t.find(o=>p.camelCase(o.name)==="vBind"),s=t.filter(o=>p.camelCase(o.name)==="vModel");return{vIf:e,vFor:r,vShow:n,vModels:s,vBind:i}}function ye(t,e,r,n,i){if(typeof t=="string")return t;if(k(t)){let s=u(t,!1);return s=_(s,e),s=N(s),`{{ ${s} }}`}return Array.isArray(t)?q(t,r,e,n,i):""}function ge(t,e,r){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_${r}`}"`}>
30
+ }`}:c.handler),fe(a,c,f,i)}),handlers:n}}function de(t,e={},r={},n={},i){const{binders:s,handlers:o}=me(t,r,n);return{props:le(e,i).join(" "),handlers:o,binders:s,events:s.join(" ")}}function he(t=[]){const e=[],{vIf:r,vShow:n,vModels:i,vFor:s}=ge(t);if(r&&e.push(`v-if="${u(r.value)}"`),n&&e.push(`v-show="${u(n.value)}"`),i.forEach(o=>{const a=B(o.modifiers,!0),c=o.arg?C(o.arg)?`:[${u(o.arg)}]`:`:${o.arg}`:"";e.push(`v-model${c}${a}="${u(o.value)}"`)}),s){const{item:o,index:a}={item:"item",index:"index",...s.iterator};e.push(`v-for="(${o}, ${a}) in ${u(s.value)}"`)}return e}function ge(t=[]){const e=t.find(o=>p.camelCase(o.name)==="vIf"),r=t.find(o=>p.camelCase(o.name)==="vFor"),n=t.find(o=>p.camelCase(o.name)==="vShow"),i=t.find(o=>p.camelCase(o.name)==="vBind"),s=t.filter(o=>p.camelCase(o.name)==="vModel");return{vIf:e,vFor:r,vShow:n,vModels:s,vBind:i}}function ye(t,e,r,n,i){if(typeof t=="string")return t;if(C(t)){let s=u(t,!1);return s=A(s,e),s=_(s),`{{ ${s} }}`}return Array.isArray(t)?T(t,r,e,n,i):""}function $e(t,e,r){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_${r}`}"`}>
25
31
  ${e}
26
- </template>`}function $e(t,e=[],r=[],n={}){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(n))(i[s]??(i[s]=[])).push(...Array.from(o));return Object.entries(i).filter(([s,o])=>!!o.length).map(([s,o])=>`import { ${p.dedupArray(o).join(",")}} from '${s}';`).concat(r)}function ve(t,e){const{dsl:r}=t,n=Object.keys(r.computed||{}),i=$(r.lifeCycles,n),s=$(r.computed,n),o=se(r.watch,n),a=oe(r.dataSources),{methods:c,nodes:d,components:h,importBlocks:y}=q(r.nodes||[],e,n,t.context),b=[...s,...o.computed],l=$({...c,...r.methods||{}},n),j=y.map(g=>`import ${g.name} from './${g.id}.vue';`),f=$e(e,h,j,t.imports);return{id:r.id,version:r.__VERSION__,name:r.name,state:ee(r.state).join(","),inject:te(r.inject).join(","),props:re(r.props).join(","),emits:ne(r.emits).join(","),watch:o.watches.join(","),lifeCycles:i.join(","),computed:b.join(","),methods:[...a,...l].join(","),imports:f.join(`
27
- `),components:h.join(","),returns:t.members.join(","),template:d.join(`
28
- `),css:r.css||""}}const be=`
32
+ </template>`}function be(t,e=[],r=[],n={}){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(n))(i[s]??(i[s]=[])).push(...Array.from(o));return Object.entries(i).filter(([s,o])=>!!o.length).map(([s,o])=>`import { ${p.dedupArray(o).join(",")}} from '${s}';`).concat(r)}function ve(t,e){const{dsl:r}=t,n=Object.keys(r.computed||{}),i=$(r.lifeCycles,n),s=$(r.computed,n),o=oe(r.watch,n),a=ie(r.dataSources),{methods:c,nodes:h,components:f,importBlocks:g}=T(r.nodes||[],e,n,t.context),v=[...s,...o.computed],l=$({...c,...r.methods||{}},n),j=g.map(y=>`import ${y.name} from './${y.id}.vue';`),m=be(e,f,j,t.imports);return{id:r.id,version:r.__VERSION__,name:r.name,state:te(r.state).join(","),inject:re(r.inject).join(","),props:ne(r.props).join(","),emits:se(r.emits).join(","),watch:o.watches.join(","),lifeCycles:i.join(","),computed:v.join(","),methods:[...a,...l].join(","),imports:m.join(`
33
+ `),components:f.join(","),returns:t.members.join(","),template:h.join(`
34
+ `),css:r.css||""}}const je=`
29
35
  <%= imports %>
30
36
  import { useProvider } from '@vtj/renderer';
31
37
  export default defineComponent({
@@ -51,7 +57,7 @@ export default defineComponent({
51
57
  <% if(methods) { %> methods: { <%= methods %> }, <% } %>
52
58
  <% if(watch) { %> watch: { <%= watch %> }, <% } %> <%= lifeCycles %>
53
59
  });
54
- `.replace(/(\n|\r|\t)/g,""),je=`
60
+ `.replace(/(\n|\r|\t)/g,""),we=`
55
61
  <template>
56
62
  <%= template %>
57
63
  </template>
@@ -61,7 +67,7 @@ export default defineComponent({
61
67
  <style lang="scss" scoped>
62
68
  <%= css %>
63
69
  </style>
64
- `,we=p.template(be),Se=p.template(je);async function Ce(t,e=new Map,r=[],n){const i=new K(p.cloneDeep(t),r),s=ve(i,e),o=we(s),a=Se({template:s.template,css:await Y(s.css,n),script:await X(o,n)});return await F(a,n)}async function Oe(t){const e=`
70
+ `,Se=p.template(je),ke=p.template(we);async function xe(t,e=new Map,r=[],n){const i=new ee(p.cloneDeep(t),r),s=ve(i,e),o=Se(s),a=ke({template:s.template,css:await Z(s.css,n),script:await Y(o,n)});return await I(a,n)}async function Ce(t){const e=`
65
71
  <template>
66
72
  <div>
67
73
  <h3>源码模式页面</h3>
@@ -72,4 +78,4 @@ export default defineComponent({
72
78
  <\/script>
73
79
  <style scoped lang="scss">
74
80
  </style>
75
- `;return await F(e)}exports.VTJ_CODER_VERSION=U;exports.createEmptyPage=Oe;exports.generator=Ce;
81
+ `;return await I(e)}exports.VTJ_CODER_VERSION=U;exports.createEmptyPage=Ce;exports.generator=xe;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { mitt as q, dedupArray as v, toArray as D, camelCase as m, isPlainObject as M, template as F, cloneDeep as Q } from "@vtj/base";
1
+ import { mitt as q, dedupArray as v, toArray as M, camelCase as d, isPlainObject as D, template as I, cloneDeep as Q } from "@vtj/base";
2
2
  import { format as x } from "prettier/standalone";
3
3
  import * as z from "prettier/plugins/html";
4
4
  import * as G from "prettier/plugins/babel";
@@ -8,10 +8,30 @@ import * as U 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.7.12
11
+ * @version 0.7.14
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const Ce = "0.7.12";
14
+ const Oe = "0.7.14";
15
+ /**!
16
+ * Copyright (c) 2024, VTJ.PRO All rights reserved.
17
+ * @name @vtj/core
18
+ * @author CHC chenhuachun1549@dingtalk.com
19
+ * @version 0.7.14
20
+ * @license <a href="https://vtj.pro/license.html">MIT License</a>
21
+ */
22
+ const X = [
23
+ "slot",
24
+ "template",
25
+ "component",
26
+ "img",
27
+ "div",
28
+ "p",
29
+ "h1",
30
+ "h2",
31
+ "h3",
32
+ "span",
33
+ "a"
34
+ ];
15
35
  q();
16
36
  const k = {
17
37
  arrowParens: "always",
@@ -33,21 +53,21 @@ const k = {
33
53
  useTabs: !1,
34
54
  vueIndentScriptAndStyle: !0
35
55
  };
36
- async function N(t, e) {
56
+ async function B(t, e) {
37
57
  return e ? t : await x(t, {
38
58
  parser: "html",
39
59
  ...k,
40
60
  plugins: [z]
41
61
  });
42
62
  }
43
- async function X(t, e) {
63
+ async function Y(t, e) {
44
64
  return e ? t : await x(t, {
45
65
  parser: "babel-ts",
46
66
  ...k,
47
67
  plugins: [G, U]
48
68
  });
49
69
  }
50
- async function Y(t, e) {
70
+ async function Z(t, e) {
51
71
  return e ? t : x(t, {
52
72
  parser: "scss",
53
73
  ...k,
@@ -63,17 +83,17 @@ function O(t) {
63
83
  function E(t) {
64
84
  return C(t) || O(t);
65
85
  }
66
- function I(t) {
86
+ function P(t) {
67
87
  return t.replace(new RegExp("this.", "g"), "");
68
88
  }
69
- function _(t) {
70
- return t.replace(new RegExp("this.context.", "g"), "");
89
+ function W(t) {
90
+ return t.replace(/this\.context\??\./g, "");
71
91
  }
72
92
  function p(t, e = !0, r = !0) {
73
93
  const n = E(t) ? t.value : e ? JSON.stringify(t) : t;
74
- return r ? I(_(n)) : _(n);
94
+ return r ? P(W(n)) : W(n);
75
95
  }
76
- function P(t, e = []) {
96
+ function A(t, e = []) {
77
97
  let r = t;
78
98
  for (const n of e)
79
99
  r = r.replace(
@@ -82,18 +102,28 @@ function P(t, e = []) {
82
102
  );
83
103
  return r;
84
104
  }
85
- function R(t) {
105
+ function J(t) {
86
106
  let e = t.trim();
87
- return e.startsWith("{") || (e.startsWith("async function") ? e = e.replace(/^async function/, "async") : e.startsWith("function") ? e = e.replace(/^function/, "") : e = e.replace("=>", "")), e;
107
+ if (e = /^\((\(|async|function)/.test(e) ? e.substring(1, e.length - 1) : e, e.startsWith("{"))
108
+ return e;
109
+ if (e.startsWith("async function"))
110
+ e = e.replace(/^async function/, "async");
111
+ else if (e.startsWith("function"))
112
+ e = e.replace(/^function/, "");
113
+ else {
114
+ const i = /^(async\s)?\([\w]*\)\s+\=\>\s([\w\W]+)/, s = e.match(i);
115
+ s && s[2] && (s[2].startsWith("{") || (e = e.replace(s[2], `{ return ${s[2]} }`))), e = e.replace("=>", "");
116
+ }
117
+ return e;
88
118
  }
89
- function Z(t = {}) {
119
+ function K(t = {}) {
90
120
  return Object.entries(t).map(([e, r]) => `"${e}": ${p(r)}`);
91
121
  }
92
- function J(t = {}, e = !1) {
122
+ function L(t = {}, e = !1) {
93
123
  const r = Object.keys(t);
94
124
  return e ? r.map((n) => "." + n) : r;
95
125
  }
96
- class K {
126
+ class ee {
97
127
  constructor(e, r) {
98
128
  this.dsl = e, this.dependencies = r, this.libraryRegex = this.collectLibrary(), this.walk(e), this.walkNodes(e), this.members = this.getLibraryMember();
99
129
  }
@@ -188,50 +218,50 @@ class K {
188
218
  Array.isArray(e.nodes) && e.nodes.forEach((n) => r(n));
189
219
  }
190
220
  }
191
- function ee(t = {}) {
221
+ function te(t = {}) {
192
222
  return Object.entries(t).map(([e, r]) => {
193
223
  const n = p(r, !1);
194
224
  return `${e}:${n}`;
195
225
  });
196
226
  }
197
- function te(t = []) {
227
+ function re(t = []) {
198
228
  return t.map((e) => `${e.name}: {
199
229
  from: '${e.from || e.name}',
200
230
  default: ${p(e.default, !0, !1)}
201
231
  }`);
202
232
  }
203
- function re(t = []) {
204
- const e = (r) => r ? `[${D(r).map((s) => s.replace(/\'|\"/gi, "")).join(",")}]` : void 0;
233
+ function ne(t = []) {
234
+ const e = (r) => r ? `[${M(r).map((s) => s.replace(/\'|\"/gi, "")).join(",")}]` : void 0;
205
235
  return t.map((r) => typeof r == "string" ? `${r}: {}` : `${r.name}: {
206
236
  type:${e(r.type)},
207
237
  required: ${r.required},
208
238
  default: ${p(r.default, !0, !1)}
209
239
  }`);
210
240
  }
211
- function ne(t = []) {
241
+ function se(t = []) {
212
242
  return t.map((e) => `'${e}'`);
213
243
  }
214
- function g(t = {}, e = []) {
244
+ function y(t = {}, e = []) {
215
245
  return Object.entries(t).map(([r, n]) => {
216
- let i = R(p(n, !1, !1));
217
- return i = P(i, e), i.startsWith("async") ? `async ${r}${i.replace(/^async/, "")}` : `${r}${i}`;
246
+ let i = J(p(n, !1, !1));
247
+ return i = A(i, e), i.startsWith("async") ? `async ${r}${i.replace(/^async/, "")}` : `${r}${i}`;
218
248
  });
219
249
  }
220
- function se(t = [], e = []) {
250
+ function oe(t = [], e = []) {
221
251
  const r = t.reduce(
222
252
  (s, o) => (o.id && O(o.source) && (s[`watcher_${o.id}`] = o.source), s),
223
253
  {}
224
- ), n = g(r, e), i = t.map((s) => `watcher_${s.id}: {
254
+ ), n = y(r, e), i = t.map((s) => `watcher_${s.id}: {
225
255
  deep: ${s.deep},
226
256
  immediate:${s.immediate},
227
- handler${R(s.handler.value)}
257
+ handler${J(s.handler.value)}
228
258
  }`);
229
259
  return {
230
260
  computed: n,
231
261
  watches: i
232
262
  };
233
263
  }
234
- function oe(t = {}) {
264
+ function ie(t = {}) {
235
265
  return Object.values(t).map((e) => {
236
266
  const r = O(e.transform) && e.transform.value || "(res) => res";
237
267
  return `async ${e.name}(...args:any[]) {
@@ -239,40 +269,40 @@ function oe(t = {}) {
239
269
  }`;
240
270
  });
241
271
  }
242
- function L(t, e, r = [], n = {}, i) {
272
+ function T(t, e, r = [], n = {}, i) {
243
273
  const s = [];
244
274
  let o = {}, a = [], c = [];
245
- return ie(t).forEach((h) => {
246
- const y = [];
247
- for (const u of h.children) {
248
- let { id: b, name: l, invisible: $, from: w } = u;
249
- if ($)
275
+ return ae(t).forEach((l) => {
276
+ const $ = [];
277
+ for (const u of l.children) {
278
+ let { id: j, name: f, invisible: g, from: w } = u;
279
+ if (g)
250
280
  continue;
251
- const A = ae(l, e, w);
252
- A && a.push(A), ce(w) && c.push({ id: w.id, name: l });
253
- const { props: W, events: B, handlers: T } = me(
254
- b,
281
+ const _ = ce(f, e, w);
282
+ _ && a.push(_), pe(w) && c.push({ id: w.id, name: f });
283
+ const { props: F, events: N, handlers: V } = de(
284
+ j,
255
285
  u.props,
256
286
  u.events,
257
287
  n,
258
288
  r
259
- ), V = de(u.directives).join(" "), f = u.children ? ye(
289
+ ), R = he(u.directives).join(" "), m = u.children ? ge(
260
290
  u.children,
261
291
  r,
262
292
  e,
263
293
  n,
264
294
  u
265
295
  ) : "";
266
- Object.assign(o, T);
296
+ Object.assign(o, V);
267
297
  let S = "";
268
- typeof f == "string" ? S = f : (S = (f?.nodes || []).join(`
269
- `), Object.assign(o, f?.methods || {}), a = a.concat(f?.components || []), c = c.concat(f?.importBlocks || [])), y.push(
270
- `<${l} ${V} ${W} ${B}>${S.trim()}</${l}>`
298
+ typeof m == "string" ? S = m : (S = (m?.nodes || []).join(`
299
+ `), Object.assign(o, m?.methods || {}), a = a.concat(m?.components || []), c = c.concat(m?.importBlocks || [])), $.push(
300
+ f === "img" ? `<${f} ${R} ${F} ${N} />` : `<${f} ${R} ${F} ${N}>${S.trim()}</${f}>`
271
301
  );
272
302
  }
273
- const j = $e(h.slot, y.join(`
303
+ const b = ye(l.slot, $.join(`
274
304
  `), i?.id);
275
- s.push(j);
305
+ s.push(b);
276
306
  }), {
277
307
  nodes: s,
278
308
  methods: o,
@@ -280,7 +310,7 @@ function L(t, e, r = [], n = {}, i) {
280
310
  importBlocks: v(c, "id")
281
311
  };
282
312
  }
283
- function ie(t = []) {
313
+ function ae(t = []) {
284
314
  const e = /* @__PURE__ */ new Map();
285
315
  for (const r of t) {
286
316
  const n = typeof r.slot == "string" ? r.slot : r.slot?.name, i = e.get(n);
@@ -288,8 +318,8 @@ function ie(t = []) {
288
318
  }
289
319
  return e;
290
320
  }
291
- function ae(t, e, r) {
292
- if (["slot", "component", "template"].includes(t))
321
+ function ce(t, e, r) {
322
+ if (X.includes(t))
293
323
  return null;
294
324
  const n = e.get(t);
295
325
  if (n && n.alias) {
@@ -298,52 +328,52 @@ function ae(t, e, r) {
298
328
  }
299
329
  return r || n ? t : null;
300
330
  }
301
- function ce(t) {
331
+ function pe(t) {
302
332
  return !!t && typeof t == "object" && t.type === "Schema";
303
333
  }
304
- function pe(t, e, r = []) {
334
+ function ue(t, e, r = []) {
305
335
  return typeof e == "string" ? `${t}="${e}"` : E(e) ? `:${t}="${p({
306
336
  ...e,
307
- value: P(e.value, r)
308
- })}"` : M(e) ? `:${t}='{${Z(
337
+ value: A(e.value, r)
338
+ })}"` : D(e) ? `:${t}='{${K(
309
339
  e
310
340
  ).join(", ")}}'` : `:${t}='${JSON.stringify(e)}'`;
311
341
  }
312
- function ue(t = {}, e = []) {
313
- return Object.entries(t).map(([r, n]) => pe(r, n, e));
342
+ function le(t = {}, e = []) {
343
+ return Object.entries(t).map(([r, n]) => ue(r, n, e));
314
344
  }
315
- function le(t, e, r, n) {
316
- const i = J(e.modifiers, !0);
345
+ function fe(t, e, r, n) {
346
+ const i = L(e.modifiers, !0);
317
347
  return n && n.length > 0 ? `@${t}${i.join("")}="(...args:any[]) => ${r}"` : `@${t}${i.join("")}="${r}"`;
318
348
  }
319
- function fe(t, e = {}, r = {}) {
349
+ function me(t, e = {}, r = {}) {
320
350
  const n = {}, i = Array.from(r[t] || /* @__PURE__ */ new Set([])), s = i.length ? `({${i.join(", ")}}, args)` : "";
321
351
  return {
322
352
  binders: Object.entries(e).map(([a, c]) => {
323
- const d = `${m(a)}_handler_${t}${s}`;
324
- return n[d] = i.length ? {
353
+ const h = c.handler.value.startsWith("this."), l = h ? P(c.handler.value) : `${d(a)}_handler_${t}${s}`;
354
+ return h || (n[l] = i.length ? {
325
355
  type: "JSFunction",
326
356
  value: `{
327
357
  return (${c.handler.value}).apply(this, args);
328
358
  }`
329
- } : c.handler, le(a, c, d, i);
359
+ } : c.handler), fe(a, c, l, i);
330
360
  }),
331
361
  handlers: n
332
362
  };
333
363
  }
334
- function me(t, e = {}, r = {}, n = {}, i) {
335
- const { binders: s, handlers: o } = fe(t, r, n);
364
+ function de(t, e = {}, r = {}, n = {}, i) {
365
+ const { binders: s, handlers: o } = me(t, r, n);
336
366
  return {
337
- props: ue(e, i).join(" "),
367
+ props: le(e, i).join(" "),
338
368
  handlers: o,
339
369
  binders: s,
340
370
  events: s.join(" ")
341
371
  };
342
372
  }
343
- function de(t = []) {
344
- const e = [], { vIf: r, vShow: n, vModels: i, vFor: s } = he(t);
373
+ function he(t = []) {
374
+ const e = [], { vIf: r, vShow: n, vModels: i, vFor: s } = $e(t);
345
375
  if (r && e.push(`v-if="${p(r.value)}"`), n && e.push(`v-show="${p(n.value)}"`), i.forEach((o) => {
346
- const a = J(o.modifiers, !0), c = o.arg ? C(o.arg) ? `:[${p(o.arg)}]` : `:${o.arg}` : "";
376
+ const a = L(o.modifiers, !0), c = o.arg ? C(o.arg) ? `:[${p(o.arg)}]` : `:${o.arg}` : "";
347
377
  e.push(`v-model${c}${a}="${p(o.value)}"`);
348
378
  }), s) {
349
379
  const { item: o, index: a } = { item: "item", index: "index", ...s.iterator };
@@ -351,8 +381,8 @@ function de(t = []) {
351
381
  }
352
382
  return e;
353
383
  }
354
- function he(t = []) {
355
- const e = t.find((o) => m(o.name) === "vIf"), r = t.find((o) => m(o.name) === "vFor"), n = t.find((o) => m(o.name) === "vShow"), i = t.find((o) => m(o.name) === "vBind"), s = t.filter((o) => m(o.name) === "vModel");
384
+ function $e(t = []) {
385
+ const e = t.find((o) => d(o.name) === "vIf"), r = t.find((o) => d(o.name) === "vFor"), n = t.find((o) => d(o.name) === "vShow"), i = t.find((o) => d(o.name) === "vBind"), s = t.filter((o) => d(o.name) === "vModel");
356
386
  return {
357
387
  vIf: e,
358
388
  vFor: r,
@@ -361,16 +391,16 @@ function he(t = []) {
361
391
  vBind: i
362
392
  };
363
393
  }
364
- function ye(t, e, r, n, i) {
394
+ function ge(t, e, r, n, i) {
365
395
  if (typeof t == "string")
366
396
  return t;
367
397
  if (C(t)) {
368
398
  let s = p(t, !1);
369
- return s = P(s, e), s = I(s), `{{ ${s} }}`;
399
+ return s = A(s, e), s = P(s), `{{ ${s} }}`;
370
400
  }
371
- return Array.isArray(t) ? L(t, r, e, n, i) : "";
401
+ return Array.isArray(t) ? T(t, r, e, n, i) : "";
372
402
  }
373
- function $e(t, e, r) {
403
+ function ye(t, e, r) {
374
404
  if (!t)
375
405
  return e;
376
406
  const n = typeof t == "string" ? { name: t, params: [] } : { params: [], ...t };
@@ -378,7 +408,7 @@ function $e(t, e, r) {
378
408
  ${e}
379
409
  </template>`;
380
410
  }
381
- function ge(t, e = [], r = [], n = {}) {
411
+ function ve(t, e = [], r = [], n = {}) {
382
412
  const i = {
383
413
  vue: ["defineComponent", "reactive"]
384
414
  };
@@ -392,41 +422,41 @@ function ge(t, e = [], r = [], n = {}) {
392
422
  ","
393
423
  )}} from '${s}';`).concat(r);
394
424
  }
395
- function ve(t, e) {
396
- const { dsl: r } = t, n = Object.keys(r.computed || {}), i = g(r.lifeCycles, n), s = g(r.computed, n), o = se(r.watch, n), a = oe(r.dataSources), { methods: c, nodes: d, components: h, importBlocks: y } = L(
425
+ function be(t, e) {
426
+ const { dsl: r } = t, n = Object.keys(r.computed || {}), i = y(r.lifeCycles, n), s = y(r.computed, n), o = oe(r.watch, n), a = ie(r.dataSources), { methods: c, nodes: h, components: l, importBlocks: $ } = T(
397
427
  r.nodes || [],
398
428
  e,
399
429
  n,
400
430
  t.context
401
- ), j = [...s, ...o.computed], u = g(
431
+ ), b = [...s, ...o.computed], u = y(
402
432
  {
403
433
  ...c,
404
434
  ...r.methods || {}
405
435
  },
406
436
  n
407
- ), b = y.map(($) => `import ${$.name} from './${$.id}.vue';`), l = ge(
437
+ ), j = $.map((g) => `import ${g.name} from './${g.id}.vue';`), f = ve(
408
438
  e,
409
- h,
410
- b,
439
+ l,
440
+ j,
411
441
  t.imports
412
442
  );
413
443
  return {
414
444
  id: r.id,
415
445
  version: r.__VERSION__,
416
446
  name: r.name,
417
- state: ee(r.state).join(","),
418
- inject: te(r.inject).join(","),
419
- props: re(r.props).join(","),
420
- emits: ne(r.emits).join(","),
447
+ state: te(r.state).join(","),
448
+ inject: re(r.inject).join(","),
449
+ props: ne(r.props).join(","),
450
+ emits: se(r.emits).join(","),
421
451
  watch: o.watches.join(","),
422
452
  lifeCycles: i.join(","),
423
- computed: j.join(","),
453
+ computed: b.join(","),
424
454
  methods: [...a, ...u].join(","),
425
- imports: l.join(`
455
+ imports: f.join(`
426
456
  `),
427
- components: h.join(","),
457
+ components: l.join(","),
428
458
  returns: t.members.join(","),
429
- template: d.join(`
459
+ template: h.join(`
430
460
  `),
431
461
  css: r.css || ""
432
462
  };
@@ -457,7 +487,7 @@ export default defineComponent({
457
487
  <% if(methods) { %> methods: { <%= methods %> }, <% } %>
458
488
  <% if(watch) { %> watch: { <%= watch %> }, <% } %> <%= lifeCycles %>
459
489
  });
460
- `.replace(/(\n|\r|\t)/g, ""), be = `
490
+ `.replace(/(\n|\r|\t)/g, ""), we = `
461
491
  <template>
462
492
  <%= template %>
463
493
  </template>
@@ -467,16 +497,16 @@ export default defineComponent({
467
497
  <style lang="scss" scoped>
468
498
  <%= css %>
469
499
  </style>
470
- `, we = F(je), Se = F(be);
471
- async function Oe(t, e = /* @__PURE__ */ new Map(), r = [], n) {
472
- const i = new K(Q(t), r), s = ve(i, e), o = we(s), a = Se({
500
+ `, Se = I(je), xe = I(we);
501
+ async function Ee(t, e = /* @__PURE__ */ new Map(), r = [], n) {
502
+ const i = new ee(Q(t), r), s = be(i, e), o = Se(s), a = xe({
473
503
  template: s.template,
474
- css: await Y(s.css, n),
475
- script: await X(o, n)
504
+ css: await Z(s.css, n),
505
+ script: await Y(o, n)
476
506
  });
477
- return await N(a, n);
507
+ return await B(a, n);
478
508
  }
479
- async function Ee(t) {
509
+ async function Pe(t) {
480
510
  const e = `
481
511
  <template>
482
512
  <div>
@@ -489,10 +519,10 @@ async function Ee(t) {
489
519
  <style scoped lang="scss">
490
520
  </style>
491
521
  `;
492
- return await N(e);
522
+ return await B(e);
493
523
  }
494
524
  export {
495
- Ce as VTJ_CODER_VERSION,
496
- Ee as createEmptyPage,
497
- Oe as generator
525
+ Oe as VTJ_CODER_VERSION,
526
+ Pe as createEmptyPage,
527
+ Ee as generator
498
528
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/coder",
3
3
  "private": false,
4
- "version": "0.7.12",
4
+ "version": "0.7.14",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vue-tsc && vite build",
@@ -11,11 +11,11 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@vtj/base": "^0.7.5",
14
- "@vtj/core": "^0.7.12",
14
+ "@vtj/core": "^0.7.14",
15
15
  "prettier": "~3.2.1"
16
16
  },
17
17
  "devDependencies": {
18
- "@vtj/cli": "^0.7.9"
18
+ "@vtj/cli": "^0.7.10"
19
19
  },
20
20
  "exports": {
21
21
  ".": {
@@ -31,7 +31,7 @@
31
31
  "dist",
32
32
  "types"
33
33
  ],
34
- "gitHead": "e893df5593e0df19de9fdc35c486faef1a31f273",
34
+ "gitHead": "8e69e3eea31f488f318f28013b7ef3df02ee8174",
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  }
@@ -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.7.12
5
+ * @version 0.7.13
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.7.12";
8
+ export declare const version = "0.7.13";