@vtj/coder 0.13.7 → 0.13.8
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 +19 -19
- package/package.json +2 -2
- package/types/parser/functions.d.ts +1 -1
- package/types/parser/watch.d.ts +1 -1
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,34 +2,34 @@
|
|
|
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.13.
|
|
5
|
+
* @version 0.13.8
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const re="0.13.
|
|
7
|
+
*/const re="0.13.8";/**!
|
|
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.13.
|
|
11
|
+
* @version 0.13.8
|
|
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"];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
|
|
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 L(t){return t.replace(/this\.context\??\./g,"")}function d(t,e=!0,s=!0,n=[]){let i=j(t)?t.value.trim().replace(/;$/,""):e?JSON.stringify(t):t;return i=w(i,n),s?H(L(i)):L(i)}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 i=/^(async\s)?\([\w]*\)\s+\=\>\s([\w\W]+)/,r=e.match(i);r&&r[2]&&(r[2].startsWith("{")||(e=e.replace(r[2],`{ return ${r[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 R(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(),i=s.join(".")+".",r=s.pop();if(n&&r){const o=this.dependencies.find(a=>a.library===r)?.package;o&&(this.imports[o]||(this.imports[o]=new Set)).add(n)}return{name:n,path:i,library:r}}return null}replaceLibraryPath(e){const{libraryRegex:s}=this;let n=e.value;for(const i of s){const r=e.value?.match(i)||[];for(const o of r){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 r of n)s(r);return}const i=Object.values(n);for(const r of i)j(r)?r.value=this.replaceLibraryPath(r):s(r)};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 i of Object.values(n))s=s.concat(Array.from(i));return f.dedupArray(s)}collectContext(e,s){const n=new Set(s?.id?this.context[s.id]:[]),i=(e.directives||[]).find(a=>a.name==="vFor");let r=new Set(Array.from(n));if(i){const{item:a="item",index:m="index"}=i.iterator||{};r=new Set([a,m,...Array.from(r)])}const o=e.slot;if(o){const a=typeof o=="string"?[]:o.params||[],m=a.length?a:[`scope_${s?.id}`];r=new Set([...m,...Array.from(r)])}this.context[e.id]=r}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,i)=>{this.collectContext(n,i),this.collectStyle(n),this.collectUrlSchema(n),this.collectBlockPlugin(n),Array.isArray(n.children)&&n.children.forEach(r=>s(r,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
16
|
}`)}function fe(t=[]){const e=s=>s?`[${f.toArray(s).map(r=>r.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
17
|
type:${e(s.type)},
|
|
18
18
|
required: ${d(!!s.required,!0,!1)},
|
|
19
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 i=Q(d(n,!1,!1));return i=w(i,e),i.startsWith("async")?`async ${s}${i.replace(/^async/,"")}
|
|
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 i=Q(d(n,!1,!1));return i=w(i,e)?.trim(),i.startsWith("async")?`async ${s}${i.replace(/^async/,"")}`:i.startsWith("(")||i.startsWith("{")?`${s}${i}`:null}).filter(s=>!!s)}function he(t=[],e=[]){const s=t.reduce((r,o)=>(o.id&&I(o.source)&&(r[`watcher_${o.id}`]=o.source),r),{}),n=A(s,e),i=t.map(r=>r.handler&&r.handler.value?`watcher_${r.id}: {
|
|
21
21
|
deep: ${r.deep},
|
|
22
22
|
immediate:${r.immediate},
|
|
23
23
|
handler${Q(r.handler.value)}
|
|
24
24
|
}`:null).filter(r=>!!r);return{computed:n,watches:i}}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: ${
|
|
25
|
+
// DataSource: ${R(e)}
|
|
26
26
|
const mock = this.provider.createMock(${s});
|
|
27
27
|
return await mock.apply(this, args);
|
|
28
28
|
}`}else{const s=I(e.transform)&&e.transform.value||"(res) => res";return`async ${e.name}(...args) {
|
|
29
|
-
// DataSource: ${
|
|
29
|
+
// DataSource: ${R(e)}
|
|
30
30
|
return await this.provider.apis['${e.ref}'].apply(this, args).then(${s});
|
|
31
|
-
}`}})}const ye=["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={},i){const r=[];let o={},a=[];const m=[];let u=[];return ve(t).forEach(c=>{const v=[];for(const h of c.children){let{id:y,name:$,invisible:b,from:g}=h;if(b)continue;const C=$e($,e,g);C&&a.push(C),X(g)&&u.push({id:g.id,name:$});const{props:P,events:O,handlers:E}=we(h,y,h.props,h.events,n,s),
|
|
32
|
-
`),Object.assign(o,S?.methods||{}),a=a.concat(S?.components||[]),u=u.concat(S?.importBlocks||[]));const _=["@dcloudio/uni-h5","@dcloudio/uni-ui"].includes(g||e.get($)?.package)?f.kebabCase($):Y(g)||Z(g)?"component":$;v.push(ye.includes(_)?`<${_} ${
|
|
31
|
+
}`}})}const ye=["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={},i){const r=[];let o={},a=[];const m=[];let u=[];return ve(t).forEach(c=>{const v=[];for(const h of c.children){let{id:y,name:$,invisible:b,from:g}=h;if(b)continue;const C=$e($,e,g);C&&a.push(C),X(g)&&u.push({id:g.id,name:$});const{props:P,events:O,handlers:E}=we(h,y,h.props,h.events,n,s),W=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(g||e.get($)?.package)?f.kebabCase($):Y(g)||Z(g)?"component":$;v.push(ye.includes(_)?`<${_} ${W} ${P} ${O} />`:`<${_} ${W} ${P} ${O}>${x?`
|
|
33
33
|
`+x.trim():""}</${_}>`)}const p=Ee(c.slot,v.join(`
|
|
34
34
|
`),i?.id);r.push(p)}),{nodes:r,methods:o,directives:ge(m),components:f.dedupArray(a),importBlocks:f.dedupArray(u,"id")}}function ge(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,i=e.get(n);i?i.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 i=n.parent?`${n.parent}.${n.alias}`:n.alias;return`${t}: ${i}`}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 r=`${t.name}_${t.id}`;e.class?typeof e.class=="string"?e.class=[e.class,r].join(" "):(e.__class=e.class,e.class=r):e.class=r,j(e.style)||delete e.style}const i=t.from;return(Y(i)||Z(i))&&(e.is={type:"JSExpression",value:t.name}),Object.entries(e).map(([r,o])=>be(r,o,s))}function Se(t,e,s,n,i){const r=z(e.modifiers,!0);return i?`@${t}${r.join("")}="${s}"`:n&&n.length>0?`@${t}${r.join("")}="(...args:any[]) => ${s}"`:`@${t}${r.join("")}="${s}"`}function ke(t,e={},s={}){const n={},i=Array.from(s[t]||new Set([])),r=i.length?`({${i.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}${r}`;return u||(n[l]=i.length?{type:"JSFunction",value:`{
|
|
35
35
|
return (${m.handler.value}).apply(this, args);
|
|
@@ -88,7 +88,7 @@ export default defineComponent({
|
|
|
88
88
|
<%= css %>
|
|
89
89
|
<%= style %>
|
|
90
90
|
</style>
|
|
91
|
-
`,Te=f.template(Ne),Be=f.template(De);async function
|
|
91
|
+
`,Te=f.template(Ne),Be=f.template(De);async function We(t,e=new Map,s=[],n="web",i){const r=t,o=typeof r.dsl=="object"&&arguments.length===1?r:{dsl:t,componentMap:e,dependencies:s,platform:n,formatterDisabled:i},{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),y=Fe(h,m,l),$=Te(y),b=Be({template:y.template,css:await N(y.css,c),script:await V($,c),style:await N(y.style,c),scriptLang:v?"ts":"js",styleLang:p?"scss":"css"});return await B(b,c).catch(g=>(g.content=b,Promise.reject(g)))}async function Le(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 B(e)}exports.VTJ_CODER_VERSION=re;exports.createEmptyPage=
|
|
102
|
+
`;return await B(e)}exports.VTJ_CODER_VERSION=re;exports.createEmptyPage=Le;exports.cssFormatter=N;exports.generator=We;exports.tsFormatter=V;exports.vueFormatter=B;
|
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.13.
|
|
11
|
+
* @version 0.13.8
|
|
12
12
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
13
13
|
*/
|
|
14
|
-
const Ue = "0.13.
|
|
14
|
+
const Ue = "0.13.8";
|
|
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.13.
|
|
19
|
+
* @version 0.13.8
|
|
20
20
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
21
21
|
*/
|
|
22
22
|
const oe = [
|
|
@@ -72,7 +72,7 @@ async function ce(t, e) {
|
|
|
72
72
|
return console.warn(s), t;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
async function
|
|
75
|
+
async function T(t, e) {
|
|
76
76
|
return e ? t : B(t, {
|
|
77
77
|
parser: "scss",
|
|
78
78
|
...D,
|
|
@@ -91,12 +91,12 @@ function j(t) {
|
|
|
91
91
|
function Q(t) {
|
|
92
92
|
return t.replace(new RegExp("this.", "g"), "");
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function L(t) {
|
|
95
95
|
return t.replace(/this\.context\??\./g, "");
|
|
96
96
|
}
|
|
97
97
|
function h(t, e = !0, s = !0, n = []) {
|
|
98
98
|
let i = j(t) ? t.value.trim().replace(/;$/, "") : e ? JSON.stringify(t) : t;
|
|
99
|
-
return i = w(i, n), s ? Q(
|
|
99
|
+
return i = w(i, n), s ? Q(L(i)) : L(i);
|
|
100
100
|
}
|
|
101
101
|
function w(t = "", e = []) {
|
|
102
102
|
let s = t;
|
|
@@ -139,7 +139,7 @@ function le(t) {
|
|
|
139
139
|
function ue(t = [], e = []) {
|
|
140
140
|
return t.filter((s) => !e.includes(s));
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function R(t) {
|
|
143
143
|
return te(JSON.stringify(t));
|
|
144
144
|
}
|
|
145
145
|
class pe {
|
|
@@ -276,8 +276,8 @@ function de(t = []) {
|
|
|
276
276
|
function A(t = {}, e = []) {
|
|
277
277
|
return Object.entries(t).map(([s, n]) => {
|
|
278
278
|
let i = G(h(n, !1, !1));
|
|
279
|
-
return i = w(i, e), i.startsWith("async") ? `async ${s}${i.replace(/^async/, "")}` : `${s}${i}
|
|
280
|
-
});
|
|
279
|
+
return i = w(i, e)?.trim(), i.startsWith("async") ? `async ${s}${i.replace(/^async/, "")}` : i.startsWith("(") || i.startsWith("{") ? `${s}${i}` : null;
|
|
280
|
+
}).filter((s) => !!s);
|
|
281
281
|
}
|
|
282
282
|
function ge(t = [], e = []) {
|
|
283
283
|
const s = t.reduce(
|
|
@@ -298,14 +298,14 @@ function ye(t = {}) {
|
|
|
298
298
|
if (e.type === "mock") {
|
|
299
299
|
const s = N(e.mockTemplate) && e.mockTemplate.value || "(params) => ({})";
|
|
300
300
|
return `async ${e.name}(...args) {
|
|
301
|
-
// DataSource: ${
|
|
301
|
+
// DataSource: ${R(e)}
|
|
302
302
|
const mock = this.provider.createMock(${s});
|
|
303
303
|
return await mock.apply(this, args);
|
|
304
304
|
}`;
|
|
305
305
|
} else {
|
|
306
306
|
const s = N(e.transform) && e.transform.value || "(res) => res";
|
|
307
307
|
return `async ${e.name}(...args) {
|
|
308
|
-
// DataSource: ${
|
|
308
|
+
// DataSource: ${R(e)}
|
|
309
309
|
return await this.provider.apis['${e.ref}'].apply(this, args).then(${s});
|
|
310
310
|
}`;
|
|
311
311
|
}
|
|
@@ -356,7 +356,7 @@ function z(t, e, s = [], n = {}, i) {
|
|
|
356
356
|
m.events,
|
|
357
357
|
n,
|
|
358
358
|
s
|
|
359
|
-
),
|
|
359
|
+
), W = Oe(
|
|
360
360
|
m.directives,
|
|
361
361
|
s,
|
|
362
362
|
f
|
|
@@ -375,7 +375,7 @@ function z(t, e, s = [], n = {}, i) {
|
|
|
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} ${W} ${O} ${P} />` : `<${I} ${W} ${O} ${P}>${_ ? `
|
|
379
379
|
` + _.trim() : ""}</${I}>`
|
|
380
380
|
);
|
|
381
381
|
}
|
|
@@ -700,7 +700,7 @@ 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, ""), We = `
|
|
704
704
|
<template>
|
|
705
705
|
<%= template %>
|
|
706
706
|
</template>
|
|
@@ -711,7 +711,7 @@ export default defineComponent({
|
|
|
711
711
|
<%= css %>
|
|
712
712
|
<%= style %>
|
|
713
713
|
</style>
|
|
714
|
-
`,
|
|
714
|
+
`, Te = U(De), Le = U(We);
|
|
715
715
|
async function Me(t, e = /* @__PURE__ */ new Map(), s = [], n = "web", i) {
|
|
716
716
|
const r = t, o = typeof r.dsl == "object" && arguments.length === 1 ? r : {
|
|
717
717
|
dsl: t,
|
|
@@ -727,11 +727,11 @@ async function Me(t, e = /* @__PURE__ */ new Map(), s = [], n = "web", i) {
|
|
|
727
727
|
formatterDisabled: a = !1,
|
|
728
728
|
ts: y = !0,
|
|
729
729
|
scss: p = !1
|
|
730
|
-
} = o, m = new pe(re(c), u), d = Be(m, f, l), $ =
|
|
730
|
+
} = o, m = new pe(re(c), u), d = Be(m, f, l), $ = Te(d), v = Le({
|
|
731
731
|
template: d.template,
|
|
732
|
-
css: await
|
|
732
|
+
css: await T(d.css, a),
|
|
733
733
|
script: await ce($, a),
|
|
734
|
-
style: await
|
|
734
|
+
style: await T(d.style, a),
|
|
735
735
|
scriptLang: y ? "ts" : "js",
|
|
736
736
|
styleLang: p ? "scss" : "css"
|
|
737
737
|
});
|
|
@@ -755,7 +755,7 @@ async function Ve(t) {
|
|
|
755
755
|
export {
|
|
756
756
|
Ue as VTJ_CODER_VERSION,
|
|
757
757
|
Ve as createEmptyPage,
|
|
758
|
-
|
|
758
|
+
T as cssFormatter,
|
|
759
759
|
Me as generator,
|
|
760
760
|
ce as tsFormatter,
|
|
761
761
|
q as vueFormatter
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/coder",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.8",
|
|
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.13.
|
|
26
|
+
"@vtj/core": "~0.13.8"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@vtj/cli": "~0.12.10"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { JSFunction } from '@vtj/core';
|
|
2
|
-
export declare function parseFunctionMap(map?: Record<string, JSFunction>, computedKeys?: string[]): string[];
|
|
2
|
+
export declare function parseFunctionMap(map?: Record<string, JSFunction>, computedKeys?: string[]): (string | null)[];
|
package/types/parser/watch.d.ts
CHANGED
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.13.
|
|
5
|
+
* @version 0.13.7
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.13.
|
|
8
|
+
export declare const version = "0.13.7";
|