@vtj/coder 0.7.10 → 0.7.12

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
@@ -2,9 +2,9 @@
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.10
5
+ * @version 0.7.12
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const U="0.7.10",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.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}: {
8
8
  from: '${e.from||e.name}',
9
9
  default: ${u(e.default,!0,!1)}
10
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}: {
package/dist/index.mjs CHANGED
@@ -1,17 +1,19 @@
1
- import { dedupArray as v, toArray as q, camelCase as m, isPlainObject as D, template as F, cloneDeep as M } from "@vtj/base";
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";
2
2
  import { format as x } from "prettier/standalone";
3
- import * as Q from "prettier/plugins/html";
4
- import * as z from "prettier/plugins/babel";
5
- import * as G from "prettier/plugins/postcss";
6
- import * as H from "prettier/plugins/estree";
3
+ import * as z from "prettier/plugins/html";
4
+ import * as G from "prettier/plugins/babel";
5
+ import * as H from "prettier/plugins/postcss";
6
+ import * as U from "prettier/plugins/estree";
7
7
  /**!
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.10
11
+ * @version 0.7.12
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const ke = "0.7.10", k = {
14
+ const Ce = "0.7.12";
15
+ q();
16
+ const k = {
15
17
  arrowParens: "always",
16
18
  bracketSpacing: !0,
17
19
  bracketSameLine: !0,
@@ -35,21 +37,21 @@ async function N(t, e) {
35
37
  return e ? t : await x(t, {
36
38
  parser: "html",
37
39
  ...k,
38
- plugins: [Q]
40
+ plugins: [z]
39
41
  });
40
42
  }
41
- async function U(t, e) {
43
+ async function X(t, e) {
42
44
  return e ? t : await x(t, {
43
45
  parser: "babel-ts",
44
46
  ...k,
45
- plugins: [z, H]
47
+ plugins: [G, U]
46
48
  });
47
49
  }
48
- async function X(t, e) {
50
+ async function Y(t, e) {
49
51
  return e ? t : x(t, {
50
52
  parser: "scss",
51
53
  ...k,
52
- plugins: [G]
54
+ plugins: [H]
53
55
  });
54
56
  }
55
57
  function C(t) {
@@ -84,14 +86,14 @@ function R(t) {
84
86
  let e = t.trim();
85
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;
86
88
  }
87
- function Y(t = {}) {
89
+ function Z(t = {}) {
88
90
  return Object.entries(t).map(([e, r]) => `"${e}": ${p(r)}`);
89
91
  }
90
92
  function J(t = {}, e = !1) {
91
93
  const r = Object.keys(t);
92
94
  return e ? r.map((n) => "." + n) : r;
93
95
  }
94
- class Z {
96
+ class K {
95
97
  constructor(e, r) {
96
98
  this.dsl = e, this.dependencies = r, this.libraryRegex = this.collectLibrary(), this.walk(e), this.walkNodes(e), this.members = this.getLibraryMember();
97
99
  }
@@ -186,27 +188,27 @@ class Z {
186
188
  Array.isArray(e.nodes) && e.nodes.forEach((n) => r(n));
187
189
  }
188
190
  }
189
- function K(t = {}) {
191
+ function ee(t = {}) {
190
192
  return Object.entries(t).map(([e, r]) => {
191
193
  const n = p(r, !1);
192
194
  return `${e}:${n}`;
193
195
  });
194
196
  }
195
- function ee(t = []) {
197
+ function te(t = []) {
196
198
  return t.map((e) => `${e.name}: {
197
199
  from: '${e.from || e.name}',
198
200
  default: ${p(e.default, !0, !1)}
199
201
  }`);
200
202
  }
201
- function te(t = []) {
202
- const e = (r) => r ? `[${q(r).map((s) => s.replace(/\'|\"/gi, "")).join(",")}]` : void 0;
203
+ function re(t = []) {
204
+ const e = (r) => r ? `[${D(r).map((s) => s.replace(/\'|\"/gi, "")).join(",")}]` : void 0;
203
205
  return t.map((r) => typeof r == "string" ? `${r}: {}` : `${r.name}: {
204
206
  type:${e(r.type)},
205
207
  required: ${r.required},
206
208
  default: ${p(r.default, !0, !1)}
207
209
  }`);
208
210
  }
209
- function re(t = []) {
211
+ function ne(t = []) {
210
212
  return t.map((e) => `'${e}'`);
211
213
  }
212
214
  function g(t = {}, e = []) {
@@ -215,7 +217,7 @@ function g(t = {}, e = []) {
215
217
  return i = P(i, e), i.startsWith("async") ? `async ${r}${i.replace(/^async/, "")}` : `${r}${i}`;
216
218
  });
217
219
  }
218
- function ne(t = [], e = []) {
220
+ function se(t = [], e = []) {
219
221
  const r = t.reduce(
220
222
  (s, o) => (o.id && O(o.source) && (s[`watcher_${o.id}`] = o.source), s),
221
223
  {}
@@ -229,7 +231,7 @@ function ne(t = [], e = []) {
229
231
  watches: i
230
232
  };
231
233
  }
232
- function se(t = {}) {
234
+ function oe(t = {}) {
233
235
  return Object.values(t).map((e) => {
234
236
  const r = O(e.transform) && e.transform.value || "(res) => res";
235
237
  return `async ${e.name}(...args:any[]) {
@@ -240,21 +242,21 @@ function se(t = {}) {
240
242
  function L(t, e, r = [], n = {}, i) {
241
243
  const s = [];
242
244
  let o = {}, a = [], c = [];
243
- return oe(t).forEach((h) => {
245
+ return ie(t).forEach((h) => {
244
246
  const y = [];
245
247
  for (const u of h.children) {
246
248
  let { id: b, name: l, invisible: $, from: w } = u;
247
249
  if ($)
248
250
  continue;
249
- const A = ie(l, e, w);
250
- A && a.push(A), ae(w) && c.push({ id: w.id, name: l });
251
- const { props: W, events: B, handlers: T } = fe(
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(
252
254
  b,
253
255
  u.props,
254
256
  u.events,
255
257
  n,
256
258
  r
257
- ), V = me(u.directives).join(" "), f = u.children ? he(
259
+ ), V = de(u.directives).join(" "), f = u.children ? ye(
258
260
  u.children,
259
261
  r,
260
262
  e,
@@ -268,7 +270,7 @@ function L(t, e, r = [], n = {}, i) {
268
270
  `<${l} ${V} ${W} ${B}>${S.trim()}</${l}>`
269
271
  );
270
272
  }
271
- const j = ye(h.slot, y.join(`
273
+ const j = $e(h.slot, y.join(`
272
274
  `), i?.id);
273
275
  s.push(j);
274
276
  }), {
@@ -278,7 +280,7 @@ function L(t, e, r = [], n = {}, i) {
278
280
  importBlocks: v(c, "id")
279
281
  };
280
282
  }
281
- function oe(t = []) {
283
+ function ie(t = []) {
282
284
  const e = /* @__PURE__ */ new Map();
283
285
  for (const r of t) {
284
286
  const n = typeof r.slot == "string" ? r.slot : r.slot?.name, i = e.get(n);
@@ -286,7 +288,7 @@ function oe(t = []) {
286
288
  }
287
289
  return e;
288
290
  }
289
- function ie(t, e, r) {
291
+ function ae(t, e, r) {
290
292
  if (["slot", "component", "template"].includes(t))
291
293
  return null;
292
294
  const n = e.get(t);
@@ -296,25 +298,25 @@ function ie(t, e, r) {
296
298
  }
297
299
  return r || n ? t : null;
298
300
  }
299
- function ae(t) {
301
+ function ce(t) {
300
302
  return !!t && typeof t == "object" && t.type === "Schema";
301
303
  }
302
- function ce(t, e, r = []) {
304
+ function pe(t, e, r = []) {
303
305
  return typeof e == "string" ? `${t}="${e}"` : E(e) ? `:${t}="${p({
304
306
  ...e,
305
307
  value: P(e.value, r)
306
- })}"` : D(e) ? `:${t}='{${Y(
308
+ })}"` : M(e) ? `:${t}='{${Z(
307
309
  e
308
310
  ).join(", ")}}'` : `:${t}='${JSON.stringify(e)}'`;
309
311
  }
310
- function pe(t = {}, e = []) {
311
- return Object.entries(t).map(([r, n]) => ce(r, n, e));
312
+ function ue(t = {}, e = []) {
313
+ return Object.entries(t).map(([r, n]) => pe(r, n, e));
312
314
  }
313
- function ue(t, e, r, n) {
315
+ function le(t, e, r, n) {
314
316
  const i = J(e.modifiers, !0);
315
317
  return n && n.length > 0 ? `@${t}${i.join("")}="(...args:any[]) => ${r}"` : `@${t}${i.join("")}="${r}"`;
316
318
  }
317
- function le(t, e = {}, r = {}) {
319
+ function fe(t, e = {}, r = {}) {
318
320
  const n = {}, i = Array.from(r[t] || /* @__PURE__ */ new Set([])), s = i.length ? `({${i.join(", ")}}, args)` : "";
319
321
  return {
320
322
  binders: Object.entries(e).map(([a, c]) => {
@@ -324,22 +326,22 @@ function le(t, e = {}, r = {}) {
324
326
  value: `{
325
327
  return (${c.handler.value}).apply(this, args);
326
328
  }`
327
- } : c.handler, ue(a, c, d, i);
329
+ } : c.handler, le(a, c, d, i);
328
330
  }),
329
331
  handlers: n
330
332
  };
331
333
  }
332
- function fe(t, e = {}, r = {}, n = {}, i) {
333
- const { binders: s, handlers: o } = le(t, r, n);
334
+ function me(t, e = {}, r = {}, n = {}, i) {
335
+ const { binders: s, handlers: o } = fe(t, r, n);
334
336
  return {
335
- props: pe(e, i).join(" "),
337
+ props: ue(e, i).join(" "),
336
338
  handlers: o,
337
339
  binders: s,
338
340
  events: s.join(" ")
339
341
  };
340
342
  }
341
- function me(t = []) {
342
- const e = [], { vIf: r, vShow: n, vModels: i, vFor: s } = de(t);
343
+ function de(t = []) {
344
+ const e = [], { vIf: r, vShow: n, vModels: i, vFor: s } = he(t);
343
345
  if (r && e.push(`v-if="${p(r.value)}"`), n && e.push(`v-show="${p(n.value)}"`), i.forEach((o) => {
344
346
  const a = J(o.modifiers, !0), c = o.arg ? C(o.arg) ? `:[${p(o.arg)}]` : `:${o.arg}` : "";
345
347
  e.push(`v-model${c}${a}="${p(o.value)}"`);
@@ -349,7 +351,7 @@ function me(t = []) {
349
351
  }
350
352
  return e;
351
353
  }
352
- function de(t = []) {
354
+ function he(t = []) {
353
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");
354
356
  return {
355
357
  vIf: e,
@@ -359,7 +361,7 @@ function de(t = []) {
359
361
  vBind: i
360
362
  };
361
363
  }
362
- function he(t, e, r, n, i) {
364
+ function ye(t, e, r, n, i) {
363
365
  if (typeof t == "string")
364
366
  return t;
365
367
  if (C(t)) {
@@ -368,7 +370,7 @@ function he(t, e, r, n, i) {
368
370
  }
369
371
  return Array.isArray(t) ? L(t, r, e, n, i) : "";
370
372
  }
371
- function ye(t, e, r) {
373
+ function $e(t, e, r) {
372
374
  if (!t)
373
375
  return e;
374
376
  const n = typeof t == "string" ? { name: t, params: [] } : { params: [], ...t };
@@ -376,7 +378,7 @@ function ye(t, e, r) {
376
378
  ${e}
377
379
  </template>`;
378
380
  }
379
- function $e(t, e = [], r = [], n = {}) {
381
+ function ge(t, e = [], r = [], n = {}) {
380
382
  const i = {
381
383
  vue: ["defineComponent", "reactive"]
382
384
  };
@@ -390,8 +392,8 @@ function $e(t, e = [], r = [], n = {}) {
390
392
  ","
391
393
  )}} from '${s}';`).concat(r);
392
394
  }
393
- function ge(t, e) {
394
- const { dsl: r } = t, n = Object.keys(r.computed || {}), i = g(r.lifeCycles, n), s = g(r.computed, n), o = ne(r.watch, n), a = se(r.dataSources), { methods: c, nodes: d, components: h, importBlocks: y } = L(
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(
395
397
  r.nodes || [],
396
398
  e,
397
399
  n,
@@ -402,7 +404,7 @@ function ge(t, e) {
402
404
  ...r.methods || {}
403
405
  },
404
406
  n
405
- ), b = y.map(($) => `import ${$.name} from './${$.id}.vue';`), l = $e(
407
+ ), b = y.map(($) => `import ${$.name} from './${$.id}.vue';`), l = ge(
406
408
  e,
407
409
  h,
408
410
  b,
@@ -412,10 +414,10 @@ function ge(t, e) {
412
414
  id: r.id,
413
415
  version: r.__VERSION__,
414
416
  name: r.name,
415
- state: K(r.state).join(","),
416
- inject: ee(r.inject).join(","),
417
- props: te(r.props).join(","),
418
- emits: re(r.emits).join(","),
417
+ state: ee(r.state).join(","),
418
+ inject: te(r.inject).join(","),
419
+ props: re(r.props).join(","),
420
+ emits: ne(r.emits).join(","),
419
421
  watch: o.watches.join(","),
420
422
  lifeCycles: i.join(","),
421
423
  computed: j.join(","),
@@ -429,7 +431,7 @@ function ge(t, e) {
429
431
  css: r.css || ""
430
432
  };
431
433
  }
432
- const ve = `
434
+ const je = `
433
435
  <%= imports %>
434
436
  import { useProvider } from '@vtj/renderer';
435
437
  export default defineComponent({
@@ -455,7 +457,7 @@ export default defineComponent({
455
457
  <% if(methods) { %> methods: { <%= methods %> }, <% } %>
456
458
  <% if(watch) { %> watch: { <%= watch %> }, <% } %> <%= lifeCycles %>
457
459
  });
458
- `.replace(/(\n|\r|\t)/g, ""), je = `
460
+ `.replace(/(\n|\r|\t)/g, ""), be = `
459
461
  <template>
460
462
  <%= template %>
461
463
  </template>
@@ -465,16 +467,16 @@ export default defineComponent({
465
467
  <style lang="scss" scoped>
466
468
  <%= css %>
467
469
  </style>
468
- `, be = F(ve), we = F(je);
469
- async function Ce(t, e = /* @__PURE__ */ new Map(), r = [], n) {
470
- const i = new Z(M(t), r), s = ge(i, e), o = be(s), a = we({
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({
471
473
  template: s.template,
472
- css: await X(s.css, n),
473
- script: await U(o, n)
474
+ css: await Y(s.css, n),
475
+ script: await X(o, n)
474
476
  });
475
477
  return await N(a, n);
476
478
  }
477
- async function Oe(t) {
479
+ async function Ee(t) {
478
480
  const e = `
479
481
  <template>
480
482
  <div>
@@ -490,7 +492,7 @@ async function Oe(t) {
490
492
  return await N(e);
491
493
  }
492
494
  export {
493
- ke as VTJ_CODER_VERSION,
494
- Oe as createEmptyPage,
495
- Ce as generator
495
+ Ce as VTJ_CODER_VERSION,
496
+ Ee as createEmptyPage,
497
+ Oe as generator
496
498
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/coder",
3
3
  "private": false,
4
- "version": "0.7.10",
4
+ "version": "0.7.12",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vue-tsc && vite build",
@@ -10,12 +10,12 @@
10
10
  "coverage": "vitest run --coverage"
11
11
  },
12
12
  "dependencies": {
13
- "@vtj/base": "^0.7.3",
14
- "@vtj/core": "^0.7.10",
13
+ "@vtj/base": "^0.7.5",
14
+ "@vtj/core": "^0.7.12",
15
15
  "prettier": "~3.2.1"
16
16
  },
17
17
  "devDependencies": {
18
- "@vtj/cli": "^0.7.7"
18
+ "@vtj/cli": "^0.7.9"
19
19
  },
20
20
  "exports": {
21
21
  ".": {
@@ -31,7 +31,7 @@
31
31
  "dist",
32
32
  "types"
33
33
  ],
34
- "gitHead": "6c54f72d57ad363d1ed75a36f25aed10d6b6a262",
34
+ "gitHead": "e893df5593e0df19de9fdc35c486faef1a31f273",
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.10
5
+ * @version 0.7.12
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.7.10";
8
+ export declare const version = "0.7.12";