create-velto 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-velto",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Zebing Fu",
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "scripts": {
25
25
  "dev": "tsup --watch",
26
- "build": "tsup"
26
+ "build": "tsup",
27
+ "release": "pnpm run build && pnpm publish"
27
28
  }
28
29
  }
@@ -0,0 +1,5 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var K="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",J="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Z="checked,disabled,readonly,required,multiple,autofocus,selected,hidden,controls,loop,muted,autoplay,playsinline,novalidate,formnovalidate,open,itemscope,default,inert,nomodule,ismap,allowfullscreen";function x(e,t){const r=Object.create(null),n=e.split(",");for(let o=0;o<n.length;o++)r[n[o]]=!0;return o=>!!r[o.toLowerCase()]}x(K);x(J);var X=x(Z),E=e=>typeof e=="string",I=e=>typeof e=="function",_=Array.isArray,R=e=>e!==null&&typeof e=="object",O=e=>Object.prototype.toString.call(e),Y=e=>O(e)==="[object Map]",ee=e=>O(e)==="[object Set]",te=e=>O(e)==="[object Object]",re=e=>e.replace(/-(\w)/g,(t,r)=>r?r.toUpperCase():""),ne=e=>e.charAt(0).toUpperCase()+e.slice(1),oe=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),ie=e=>/^on[^a-z]/.test(e);function A(e,t){try{return e(...t??[])}catch(r){console.log(r)}return null}function se(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>!t.includes(r)))}var le=()=>new Set,v,M=!1,ce=class{constructor(e,t=null){this.fn=e,this.scheduler=t,this.active=!0}run(){let e=M,t=v;try{return M=!0,v=this,this.fn()}finally{v=t,M=e}}destroy(){this.active=!1,this.run(),this.active=!0}},C=!1,h=0,d=[],ae=Promise.resolve();function ue(e){let t=0;const r=d.some((n,o)=>(n.id<e.id&&(t=o+1),n.id===e.id&&n.ref===e.ref));(!d.length||!r)&&d.splice(t,0,e),fe()}function fe(){C||(C=!0,ae.then(de))}function de(){C=!1;try{for(h=0;h<d.length;h++){const e=d[h];e&&A(e)}}finally{h=0,d.length=0}}function pe(e,t){const r=t.dep;e&&r.add(e)}function me(e,t){t==null||t.forEach(r=>{r.scheduler&&(r.scheduler.ref=e,ue(r.scheduler))})}var q;q="__isRef";var he=class{constructor(e){this[q]=!0,this.dep=le(),this._value=e}get value(){return pe(v,this),this._value}setValue(e){this._value=e,me(this,this.dep)}};function ge(e){return new he(e)}var be=e=>E(e)?e:e==null?"":_(e)||R(e)&&(e.toString===Object.prototype.toString||!I(e.toString))?JSON.stringify(e,ye,2):String(e),ye=(e,t)=>Y(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[n,o])=>(r[`${n} =>`]=o,r),{})}:ee(t)?{[`Set(${t.size})`]:[...t.values()]}:R(t)&&!_(t)&&!te(t)?String(t):t;function $(e){const t=e;return t.__isRender=!0,t}function ve(e){return I(e)&&e.__isRender}function _e(e){return E(e)?document.querySelector(e):e}var u=(e,t)=>{const r=t==null?void 0:t[e];r&&(_(r)?r.forEach(n=>A(n)):A(r))},Se=0;function j(e,t){return{uid:Se++,type:e,props:t,template:void 0,target:void 0,anchor:void 0,isCreated:!1,isMounted:!1,created:null,beforeMount:null,mounted:null,beforeUpdate:null,updated:null,beforeDestroy:null,destroyed:null}}function G(e,t){var a,p;const r=se(t,["ref"]);let n=j(e,r);t.ref&&((p=(a=t.ref)==null?void 0:a.setValue)==null||p.call(a,n));const o=()=>{if(n.isMounted)s.active?(u("beforeUpdate",n),n.template.update(),u("updated",n)):(u("beforeDestroy",n),n.template.destroy(),n=j(e,n.props),u("destroyed",n));else{if(!n.isCreated){const l=n.type(n.props);n.template=l(),n.isCreated=!0,u("created",n)}u("beforeMount",n),n.template.mount(n.target,n.anchor),n.isMounted=!0,u("mounted",n)}},i=()=>{s.run()};i.id=n.uid;const s=new ce(o,i);return{mount(l,y){n.target=l,n.anchor=y,s.run()},destroy(){s.destroy()}}}var H=typeof document<"u"?document:null,g=(e,t,r)=>{if(r)return U(e,t,r);e.appendChild(t)},U=(e,t,r)=>{e.insertBefore(t,r||null)},f=e=>{const t=e.parentNode;t&&t.removeChild(e)},Me=(e,t,r)=>H.createElement(e,void 0),b=e=>H.createTextNode(e);function Le(e,t,r){t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}function Ae(e,t){if(!t)return e.removeAttribute("style");const r=e.style;if(E(t))r.cssText=t;else for(const n in t)N(r,n,t[n])}function N(e,t,r){if(_(r))r.forEach(n=>N(e,t,n));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const n=Ce(e,t),o=/\s*!important$/;o.test(r)?e.setProperty(oe(n),r.replace(o,""),"important"):e[n]=r}}var L={};function Ce(e,t){const r=["Webkit","Moz","ms"],n=L[t];if(n)return n;let o=re(t);if(o!=="filter"&&o in e)return L[t]=o;o=ne(o);for(let i=0;i<r.length;i++){const s=r[i]+o;if(s in e)return L[t]=s}return t}var V=new WeakMap;function xe(e,t,r,n){let o=V.get(e);o||(o={},V.set(e,o));const i=o[t];if(i===r)return;const s=t.slice(2).toLocaleLowerCase();r?(Ee(e,s,r,n),o[t]=r):i&&(Oe(e,s,i,n),delete o[t])}function Ee(e,t,r,n){e.addEventListener(t,r,n)}function Oe(e,t,r,n){e.removeEventListener(t,r,n)}var k="http://www.w3.org/1999/xlink";function Te(e,t,r,n){if(n&&t.startsWith("xlink:"))r==null?e.removeAttributeNS(k,t.slice(6,t.length)):e.setAttributeNS(k,t,r);else{const o=X(t);r==null||o&&!(r||r==="")?e.removeAttribute(t):e.setAttribute(t,o?"":r)}}var P=(e,t,r,n=!1)=>{var o;t==="ref"?(o=r==null?void 0:r.setValue)==null||o.call(r,e):t==="innerHTML"?e.innerHTML=`${r}`:t==="textContent"?e.textContent=`${r}`:t==="class"?Le(e,r,n):t==="style"?Ae(e,r):ie(t)?xe(e,t,r):Te(e,t,r,n)};function c(e,t){const r=Me(e);return{el:r,mount:(n,o)=>{g(n,r,o);for(let i in t)P(r,i,t[i])},update(n){for(let o in n)n[o]!==(t==null?void 0:t[o])&&P(r,o,n[o]);t=n},destroy(){f(r)}}}function B(e){if(ve(e))return e();let t,r,n;const o=i=>{const s=be(i);n?n.nodeValue=s:(n=b(s),U(t,n,r))};return{mount:(i,s)=>{t=i,r=s,o(e)},update(i){e!==i&&o(i),e=i},destroy:()=>{n&&(f(n),n=void 0)}}}function we(e,t,r={}){const n=_e(t);n&&(n.innerHTML="",G(e,r).mount(n))}const je="_helloworld_1bhaq_1",D={helloworld:je};function Ve(e={}){const t=ge(0);return $(()=>{const r=c("div",{class:D.helloworld}),n=c("h1",{}),o=B(e.msg),i=c("p",{}),s=c("a",{href:"https://vitejs.dev/guide/features.html",target:"_blank"}),a=b(`
2
+ Vite Docs
3
+ `),p=b(`
4
+ |
5
+ `),l=c("a",{href:"https://github.com/zebing/velto",target:"_blank"}),y=b("Velto Docs"),T=()=>t.setValue(t.value+1),m=c("button",{type:"button",onClick:T}),w=b("count is: "),S=B(t.value);return{mount(W,Q){r.mount(W,Q),n.mount(r.el),o.mount(n.el),i.mount(r.el),s.mount(i.el),g(s.el,a),g(i.el,p),l.mount(i.el),g(l.el,y),m.mount(r.el),g(m.el,w),S.mount(m.el)},update(){r.update({class:D.helloworld}),o.update(e.msg),s.update({href:"https://vitejs.dev/guide/features.html",target:"_blank"}),l.update({href:"https://github.com/zebing/velto",target:"_blank"}),m.update({type:"button",onClick:T}),S.update(t.value)},destroy(){r.destroy(),n.destroy(),o.destroy(),i.destroy(),s.destroy(),f(a),f(p),l.destroy(),f(y),m.destroy(),f(w),S.destroy()}}})}const ke="_app_wbx23_1",z={app:ke},F="/assets/logo-MlQBdkOK.jpg";function Pe(){return $(()=>{const e=c("div",{class:z.app}),t=c("img",{alt:"Velto logo",src:F}),r=G(Ve,{msg:"Hello Velto + Vite"});return{mount(n,o){e.mount(n,o),t.mount(e.el),r.mount(e.el)},update(){e.update({class:z.app}),t.update({alt:"Velto logo",src:F})},destroy(){e.destroy(),t.destroy(),r.destroy()}}})}we(Pe,document.getElementById("app"));
@@ -0,0 +1 @@
1
+ ._helloworld_1bhaq_1 a{color:#42b983}._app_wbx23_1{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/velto.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Velto App</title>
8
+ <script type="module" crossorigin src="/assets/index-C-yN1vdv.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-JR5T8woj.css">
10
+ </head>
11
+ <body>
12
+ <div id="app"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,15 @@
1
+ <?xml
2
+ version="1.0" encoding="UTF-8" standalone="no"?>
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
5
+ <image id="image0" width="16" height="16" x="0" y="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
6
+ AAB1MAAA6mAAADqYAAAXcJy6UTwAAACcUExURf////7///r+9vz++v///v3//eH9x7z7g/3+/Mvy
7
+ 3sbx3Nj15/D948D8irH9bcT8k/7+/3PeqSPMd2bboMz8otf8tdn15yLNeSLNeGXboP7+/rr8gLD9
8
+ ben91vb977L9b83y3iDNeOT9zsD8iVjYmNH9q7H9bNL9q/7//r/v1/3+/ovjsLL8cLH9bvb+7+D4
9
+ 3s38pM37pNL8rP/+/pgGaiUAAAABYktHRACIBR1IAAAAB3RJTUUH6QUBAjkvKxJscgAAAHJJREFU
10
+ GNNjYCABMDIxI3NZWNnYOaAynFxc3Aw8vHz8jBABAUEhIWEBET4+UZhqMXEJSSlpPhlZuGnCEpJy
11
+ fHzyTHADFRSFlWT4lKXgAlIqwqpqfOoaCDs1JZX5+JSQHKGlrcOnq4fsLH0DQyNjUryFDABZsAcE
12
+ QxSv+AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wNS0wMVQwMjo1Nzo0NiswMDowMMO6tKkAAAAl
13
+ dEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDUtMDFUMDI6NTc6NDYrMDA6MDCy5wwVAAAAKHRFWHRkYXRl
14
+ OnRpbWVzdGFtcAAyMDI1LTA1LTAxVDAyOjU3OjQ3KzAwOjAwQ4UmfgAAAABJRU5ErkJggg=="/>
15
+ </svg>
@@ -2,12 +2,12 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" href="/favicon.ico" />
5
+ <link rel="icon" type="image/svg+xml" href="/velto.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Velto App</title>
8
- <script type="module" src="/src/index.js"></script>
9
8
  </head>
10
9
  <body>
11
10
  <div id="app"></div>
11
+ <script type="module" src="/src/index.js"></script>
12
12
  </body>
13
13
  </html>
@@ -10,13 +10,14 @@
10
10
  },
11
11
  "keywords": [],
12
12
  "author": "",
13
- "license": "ISC",
13
+ "license": "MIT",
14
14
  "dependencies": {
15
- "@velto/runtime": "1.0.0-beta.4"
15
+ "@velto/runtime": "1.0.0-beta.5"
16
16
  },
17
17
  "devDependencies": {
18
- "@velto/babel-plugin-velto": "1.0.0-beta.4",
18
+ "@velto/babel-plugin-velto": "1.0.0-beta.5",
19
19
  "sass": "^1.86.3",
20
- "vite": "^6.2.6"
20
+ "vite": "^6.2.6",
21
+ "vite-plugin-velto": "^1.0.2"
21
22
  }
22
23
  }
@@ -0,0 +1,15 @@
1
+ <?xml
2
+ version="1.0" encoding="UTF-8" standalone="no"?>
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
5
+ <image id="image0" width="16" height="16" x="0" y="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
6
+ AAB1MAAA6mAAADqYAAAXcJy6UTwAAACcUExURf////7///r+9vz++v///v3//eH9x7z7g/3+/Mvy
7
+ 3sbx3Nj15/D948D8irH9bcT8k/7+/3PeqSPMd2bboMz8otf8tdn15yLNeSLNeGXboP7+/rr8gLD9
8
+ ben91vb977L9b83y3iDNeOT9zsD8iVjYmNH9q7H9bNL9q/7//r/v1/3+/ovjsLL8cLH9bvb+7+D4
9
+ 3s38pM37pNL8rP/+/pgGaiUAAAABYktHRACIBR1IAAAAB3RJTUUH6QUBAjkvKxJscgAAAHJJREFU
10
+ GNNjYCABMDIxI3NZWNnYOaAynFxc3Aw8vHz8jBABAUEhIWEBET4+UZhqMXEJSSlpPhlZuGnCEpJy
11
+ fHzyTHADFRSFlWT4lKXgAlIqwqpqfOoaCDs1JZX5+JSQHKGlrcOnq4fsLH0DQyNjUryFDABZsAcE
12
+ QxSv+AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wNS0wMVQwMjo1Nzo0NiswMDowMMO6tKkAAAAl
13
+ dEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDUtMDFUMDI6NTc6NDYrMDA6MDCy5wwVAAAAKHRFWHRkYXRl
14
+ OnRpbWVzdGFtcAAyMDI1LTA1LTAxVDAyOjU3OjQ3KzAwOjAwQ4UmfgAAAABJRU5ErkJggg=="/>
15
+ </svg>
@@ -1,11 +1,12 @@
1
1
  import HelloWorld from './components/HelloWorld';
2
2
  import styles from './styles.module.scss';
3
+ import Image from './assets/logo.jpg';
3
4
 
4
5
  export default function App() {
5
6
 
6
7
  return (
7
8
  <div class={styles.app}>
8
- <img alt="Velto logo" src="./assets/logo.jpg" />
9
+ <img alt="Velto logo" src={Image} />
9
10
  <HelloWorld msg="Hello Velto + Vite" />
10
11
  </div>
11
12
  )
@@ -13,7 +13,7 @@ export default function Test(props = {}) {
13
13
  Vite Docs
14
14
  </a>
15
15
  |
16
- <a href="https://github.com/zebing/velto" target="_blank">Velto Docs</a>
16
+ <a href="https://veltojs.github.io/docs/" target="_blank">Velto Docs</a>
17
17
  </p>
18
18
 
19
19
  <button type="button" onClick={() => count.setValue(count.value + 1)}>count is: {count.value}</button>
@@ -1,37 +1,6 @@
1
- import { transformAsync, BabelFileResult } from '@babel/core';
2
- import velto from '@velto/babel-plugin-velto';
3
1
  import { defineConfig } from 'vite';
2
+ import vitePluginLite from 'vite-plugin-velto';
4
3
 
5
4
  export default defineConfig({
6
5
  plugins: [vitePluginLite()],
7
6
  })
8
-
9
- function vitePluginLite() {
10
-
11
- let projectRoot = process.cwd();
12
-
13
- return {
14
- name: 'vite-plugin-velto',
15
- enforce: 'pre',
16
-
17
- async transform(source, id) {
18
- if (!(/\.js[x]?$/i.test(id))) {
19
- return null;
20
- }
21
-
22
- id = id.replace(/\?.+$/, '');
23
-
24
- const { code, map } = await transformAsync(source, {
25
- root: projectRoot,
26
- filename: id,
27
- sourceFileName: id,
28
- presets: [],
29
- plugins: [velto],
30
- ast: false,
31
- sourceMaps: true,
32
- });
33
-
34
- return { code: code ?? undefined, map };
35
- },
36
- };
37
- }
@@ -0,0 +1 @@
1
+ ._helloworld_1bhaq_1 a{color:#42b983}._app_wbx23_1{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}
@@ -0,0 +1,5 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var K="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",J="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Z="checked,disabled,readonly,required,multiple,autofocus,selected,hidden,controls,loop,muted,autoplay,playsinline,novalidate,formnovalidate,open,itemscope,default,inert,nomodule,ismap,allowfullscreen";function x(e,t){const r=Object.create(null),n=e.split(",");for(let o=0;o<n.length;o++)r[n[o]]=!0;return o=>!!r[o.toLowerCase()]}x(K);x(J);var X=x(Z),E=e=>typeof e=="string",I=e=>typeof e=="function",_=Array.isArray,R=e=>e!==null&&typeof e=="object",O=e=>Object.prototype.toString.call(e),Y=e=>O(e)==="[object Map]",ee=e=>O(e)==="[object Set]",te=e=>O(e)==="[object Object]",re=e=>e.replace(/-(\w)/g,(t,r)=>r?r.toUpperCase():""),ne=e=>e.charAt(0).toUpperCase()+e.slice(1),oe=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),ie=e=>/^on[^a-z]/.test(e);function A(e,t){try{return e(...t??[])}catch(r){console.log(r)}return null}function se(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>!t.includes(r)))}var le=()=>new Set,v,M=!1,ce=class{constructor(e,t=null){this.fn=e,this.scheduler=t,this.active=!0}run(){let e=M,t=v;try{return M=!0,v=this,this.fn()}finally{v=t,M=e}}destroy(){this.active=!1,this.run(),this.active=!0}},C=!1,h=0,d=[],ae=Promise.resolve();function ue(e){let t=0;const r=d.some((n,o)=>(n.id<e.id&&(t=o+1),n.id===e.id&&n.ref===e.ref));(!d.length||!r)&&d.splice(t,0,e),fe()}function fe(){C||(C=!0,ae.then(de))}function de(){C=!1;try{for(h=0;h<d.length;h++){const e=d[h];e&&A(e)}}finally{h=0,d.length=0}}function pe(e,t){const r=t.dep;e&&r.add(e)}function me(e,t){t==null||t.forEach(r=>{r.scheduler&&(r.scheduler.ref=e,ue(r.scheduler))})}var q;q="__isRef";var he=class{constructor(e){this[q]=!0,this.dep=le(),this._value=e}get value(){return pe(v,this),this._value}setValue(e){this._value=e,me(this,this.dep)}};function ge(e){return new he(e)}var be=e=>E(e)?e:e==null?"":_(e)||R(e)&&(e.toString===Object.prototype.toString||!I(e.toString))?JSON.stringify(e,ye,2):String(e),ye=(e,t)=>Y(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[n,o])=>(r[`${n} =>`]=o,r),{})}:ee(t)?{[`Set(${t.size})`]:[...t.values()]}:R(t)&&!_(t)&&!te(t)?String(t):t;function $(e){const t=e;return t.__isRender=!0,t}function ve(e){return I(e)&&e.__isRender}function _e(e){return E(e)?document.querySelector(e):e}var u=(e,t)=>{const r=t==null?void 0:t[e];r&&(_(r)?r.forEach(n=>A(n)):A(r))},Se=0;function j(e,t){return{uid:Se++,type:e,props:t,template:void 0,target:void 0,anchor:void 0,isCreated:!1,isMounted:!1,created:null,beforeMount:null,mounted:null,beforeUpdate:null,updated:null,beforeDestroy:null,destroyed:null}}function G(e,t){var a,p;const r=se(t,["ref"]);let n=j(e,r);t.ref&&((p=(a=t.ref)==null?void 0:a.setValue)==null||p.call(a,n));const o=()=>{if(n.isMounted)s.active?(u("beforeUpdate",n),n.template.update(),u("updated",n)):(u("beforeDestroy",n),n.template.destroy(),n=j(e,n.props),u("destroyed",n));else{if(!n.isCreated){const l=n.type(n.props);n.template=l(),n.isCreated=!0,u("created",n)}u("beforeMount",n),n.template.mount(n.target,n.anchor),n.isMounted=!0,u("mounted",n)}},i=()=>{s.run()};i.id=n.uid;const s=new ce(o,i);return{mount(l,y){n.target=l,n.anchor=y,s.run()},destroy(){s.destroy()}}}var H=typeof document<"u"?document:null,g=(e,t,r)=>{if(r)return U(e,t,r);e.appendChild(t)},U=(e,t,r)=>{e.insertBefore(t,r||null)},f=e=>{const t=e.parentNode;t&&t.removeChild(e)},Me=(e,t,r)=>H.createElement(e,void 0),b=e=>H.createTextNode(e);function Le(e,t,r){t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}function Ae(e,t){if(!t)return e.removeAttribute("style");const r=e.style;if(E(t))r.cssText=t;else for(const n in t)N(r,n,t[n])}function N(e,t,r){if(_(r))r.forEach(n=>N(e,t,n));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const n=Ce(e,t),o=/\s*!important$/;o.test(r)?e.setProperty(oe(n),r.replace(o,""),"important"):e[n]=r}}var L={};function Ce(e,t){const r=["Webkit","Moz","ms"],n=L[t];if(n)return n;let o=re(t);if(o!=="filter"&&o in e)return L[t]=o;o=ne(o);for(let i=0;i<r.length;i++){const s=r[i]+o;if(s in e)return L[t]=s}return t}var V=new WeakMap;function xe(e,t,r,n){let o=V.get(e);o||(o={},V.set(e,o));const i=o[t];if(i===r)return;const s=t.slice(2).toLocaleLowerCase();r?(Ee(e,s,r,n),o[t]=r):i&&(Oe(e,s,i,n),delete o[t])}function Ee(e,t,r,n){e.addEventListener(t,r,n)}function Oe(e,t,r,n){e.removeEventListener(t,r,n)}var k="http://www.w3.org/1999/xlink";function Te(e,t,r,n){if(n&&t.startsWith("xlink:"))r==null?e.removeAttributeNS(k,t.slice(6,t.length)):e.setAttributeNS(k,t,r);else{const o=X(t);r==null||o&&!(r||r==="")?e.removeAttribute(t):e.setAttribute(t,o?"":r)}}var P=(e,t,r,n=!1)=>{var o;t==="ref"?(o=r==null?void 0:r.setValue)==null||o.call(r,e):t==="innerHTML"?e.innerHTML=`${r}`:t==="textContent"?e.textContent=`${r}`:t==="class"?Le(e,r,n):t==="style"?Ae(e,r):ie(t)?xe(e,t,r):Te(e,t,r,n)};function c(e,t){const r=Me(e);return{el:r,mount:(n,o)=>{g(n,r,o);for(let i in t)P(r,i,t[i])},update(n){for(let o in n)n[o]!==(t==null?void 0:t[o])&&P(r,o,n[o]);t=n},destroy(){f(r)}}}function B(e){if(ve(e))return e();let t,r,n;const o=i=>{const s=be(i);n?n.nodeValue=s:(n=b(s),U(t,n,r))};return{mount:(i,s)=>{t=i,r=s,o(e)},update(i){e!==i&&o(i),e=i},destroy:()=>{n&&(f(n),n=void 0)}}}function we(e,t,r={}){const n=_e(t);n&&(n.innerHTML="",G(e,r).mount(n))}const je="_helloworld_1bhaq_1",D={helloworld:je};function Ve(e){const t=ge(0);return $(()=>{const r=c("div",{class:D.helloworld}),n=c("h1",{}),o=B(e.msg),i=c("p",{}),s=c("a",{href:"https://vitejs.dev/guide/features.html",target:"_blank"}),a=b(`
2
+ Vite Docs
3
+ `),p=b(`
4
+ |
5
+ `),l=c("a",{href:"https://github.com/zebing/velto",target:"_blank"}),y=b("Velto Docs"),T=()=>t.setValue(t.value+1),m=c("button",{type:"button",onClick:T}),w=b("count is: "),S=B(t.value);return{mount(W,Q){r.mount(W,Q),n.mount(r.el),o.mount(n.el),i.mount(r.el),s.mount(i.el),g(s.el,a),g(i.el,p),l.mount(i.el),g(l.el,y),m.mount(r.el),g(m.el,w),S.mount(m.el)},update(){r.update({class:D.helloworld}),o.update(e.msg),s.update({href:"https://vitejs.dev/guide/features.html",target:"_blank"}),l.update({href:"https://github.com/zebing/velto",target:"_blank"}),m.update({type:"button",onClick:T}),S.update(t.value)},destroy(){r.destroy(),n.destroy(),o.destroy(),i.destroy(),s.destroy(),f(a),f(p),l.destroy(),f(y),m.destroy(),f(w),S.destroy()}}})}const ke="_app_wbx23_1",z={app:ke},F="/assets/logo-MlQBdkOK.jpg";function Pe(){return $(()=>{const e=c("div",{class:z.app}),t=c("img",{alt:"Velto logo",src:F}),r=G(Ve,{msg:"Hello Velto + Vite"});return{mount(n,o){e.mount(n,o),t.mount(e.el),r.mount(e.el)},update(){e.update({class:z.app}),t.update({alt:"Velto logo",src:F})},destroy(){e.destroy(),t.destroy(),r.destroy()}}})}we(Pe,document.getElementById("app"));
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/velto.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Velto App</title>
8
+ <script type="module" crossorigin src="/assets/index-anXbbEZI.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-JR5T8woj.css">
10
+ </head>
11
+ <body>
12
+ <div id="app"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,15 @@
1
+ <?xml
2
+ version="1.0" encoding="UTF-8" standalone="no"?>
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
5
+ <image id="image0" width="16" height="16" x="0" y="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
6
+ AAB1MAAA6mAAADqYAAAXcJy6UTwAAACcUExURf////7///r+9vz++v///v3//eH9x7z7g/3+/Mvy
7
+ 3sbx3Nj15/D948D8irH9bcT8k/7+/3PeqSPMd2bboMz8otf8tdn15yLNeSLNeGXboP7+/rr8gLD9
8
+ ben91vb977L9b83y3iDNeOT9zsD8iVjYmNH9q7H9bNL9q/7//r/v1/3+/ovjsLL8cLH9bvb+7+D4
9
+ 3s38pM37pNL8rP/+/pgGaiUAAAABYktHRACIBR1IAAAAB3RJTUUH6QUBAjkvKxJscgAAAHJJREFU
10
+ GNNjYCABMDIxI3NZWNnYOaAynFxc3Aw8vHz8jBABAUEhIWEBET4+UZhqMXEJSSlpPhlZuGnCEpJy
11
+ fHzyTHADFRSFlWT4lKXgAlIqwqpqfOoaCDs1JZX5+JSQHKGlrcOnq4fsLH0DQyNjUryFDABZsAcE
12
+ QxSv+AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wNS0wMVQwMjo1Nzo0NiswMDowMMO6tKkAAAAl
13
+ dEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDUtMDFUMDI6NTc6NDYrMDA6MDCy5wwVAAAAKHRFWHRkYXRl
14
+ OnRpbWVzdGFtcAAyMDI1LTA1LTAxVDAyOjU3OjQ3KzAwOjAwQ4UmfgAAAABJRU5ErkJggg=="/>
15
+ </svg>
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" href="/favicon.ico" />
5
+ <link rel="icon" type="image/svg+xml" href="/velto.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Velto App</title>
8
8
  <script type="module" src="/src/index.ts"></script>
@@ -12,14 +12,15 @@
12
12
  "author": "",
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
- "@velto/runtime": "1.0.0-beta.4"
15
+ "@velto/runtime": "1.0.0-beta.5"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/preset-typescript": "^7.27.0",
19
19
  "@types/babel__core": "^7.20.5",
20
- "@velto/babel-plugin-velto": "1.0.0-beta.4",
20
+ "@velto/babel-plugin-velto": "1.0.0-beta.5",
21
21
  "sass": "^1.86.3",
22
22
  "typescript": "^5.8.3",
23
- "vite": "^6.2.6"
23
+ "vite": "^6.2.6",
24
+ "vite-plugin-velto": "^1.0.2"
24
25
  }
25
26
  }
@@ -0,0 +1,15 @@
1
+ <?xml
2
+ version="1.0" encoding="UTF-8" standalone="no"?>
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
5
+ <image id="image0" width="16" height="16" x="0" y="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
6
+ AAB1MAAA6mAAADqYAAAXcJy6UTwAAACcUExURf////7///r+9vz++v///v3//eH9x7z7g/3+/Mvy
7
+ 3sbx3Nj15/D948D8irH9bcT8k/7+/3PeqSPMd2bboMz8otf8tdn15yLNeSLNeGXboP7+/rr8gLD9
8
+ ben91vb977L9b83y3iDNeOT9zsD8iVjYmNH9q7H9bNL9q/7//r/v1/3+/ovjsLL8cLH9bvb+7+D4
9
+ 3s38pM37pNL8rP/+/pgGaiUAAAABYktHRACIBR1IAAAAB3RJTUUH6QUBAjkvKxJscgAAAHJJREFU
10
+ GNNjYCABMDIxI3NZWNnYOaAynFxc3Aw8vHz8jBABAUEhIWEBET4+UZhqMXEJSSlpPhlZuGnCEpJy
11
+ fHzyTHADFRSFlWT4lKXgAlIqwqpqfOoaCDs1JZX5+JSQHKGlrcOnq4fsLH0DQyNjUryFDABZsAcE
12
+ QxSv+AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wNS0wMVQwMjo1Nzo0NiswMDowMMO6tKkAAAAl
13
+ dEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDUtMDFUMDI6NTc6NDYrMDA6MDCy5wwVAAAAKHRFWHRkYXRl
14
+ OnRpbWVzdGFtcAAyMDI1LTA1LTAxVDAyOjU3OjQ3KzAwOjAwQ4UmfgAAAABJRU5ErkJggg=="/>
15
+ </svg>
@@ -1,11 +1,12 @@
1
1
  import HelloWorld from './components/HelloWorld';
2
2
  import styles from './styles.module.scss';
3
+ import Image from './assets/logo.jpg';
3
4
 
4
5
  export default function App() {
5
6
 
6
7
  return (
7
8
  <div class={styles.app}>
8
- <img alt="Velto logo" src="./assets/logo.jpg" />
9
+ <img alt="Velto logo" src={Image} />
9
10
  <HelloWorld msg="Hello Velto + Vite" />
10
11
  </div>
11
12
  )
@@ -13,7 +13,7 @@ export default function Test(props: { msg: string }) {
13
13
  Vite Docs
14
14
  </a>
15
15
  |
16
- <a href="https://github.com/zebing/velto" target="_blank">Velto Docs</a>
16
+ <a href="https://veltojs.github.io/docs/" target="_blank">Velto Docs</a>
17
17
  </p>
18
18
 
19
19
  <button type="button" onClick={() => count.setValue(count.value + 1)}>count is: {count.value}</button>
@@ -1 +1,6 @@
1
1
  declare module '*.scss';
2
+
3
+ declare module '*.jpg' {
4
+ const src: string;
5
+ export default src;
6
+ }
@@ -1,37 +1,6 @@
1
- import { transformAsync, BabelFileResult } from '@babel/core';
2
- import velto from '@velto/babel-plugin-velto';
3
1
  import { defineConfig } from 'vite';
2
+ import vitePluginLite from 'vite-plugin-velto';
4
3
 
5
4
  export default defineConfig({
6
5
  plugins: [vitePluginLite()],
7
6
  })
8
-
9
- function vitePluginLite() {
10
-
11
- let projectRoot = process.cwd();
12
-
13
- return {
14
- name: 'vite-plugin-velto',
15
- enforce: 'pre',
16
-
17
- async transform(source, id) {
18
- if (!(/\.ts[x]?$/i.test(id))) {
19
- return null;
20
- }
21
-
22
- id = id.replace(/\?.+$/, '');
23
-
24
- const { code, map } = await transformAsync(source, {
25
- root: projectRoot,
26
- filename: id,
27
- sourceFileName: id,
28
- presets: ['@babel/preset-typescript'],
29
- plugins: [velto],
30
- ast: false,
31
- sourceMaps: true,
32
- });
33
-
34
- return { code: code ?? undefined, map };
35
- },
36
- };
37
- }