create-tauri-ui 0.2.0 → 0.2.1

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.
Files changed (36) hide show
  1. package/README.md +5 -3
  2. package/dist/index.mjs +3 -3
  3. package/package.json +54 -54
  4. package/templates/.shared/src-tauri/Cargo.lock +3701 -3701
  5. package/templates/.shared/src-tauri/Cargo.toml +36 -36
  6. package/templates/.shared/src-tauri/tauri.conf.json +79 -79
  7. package/templates/next/components.json +15 -15
  8. package/templates/next/next.config.js +14 -14
  9. package/templates/next/package.json +83 -83
  10. package/templates/next/src/app/layout.tsx +47 -47
  11. package/templates/next/src/components/menu.tsx +259 -259
  12. package/templates/next/src/lib/utils.ts +6 -6
  13. package/templates/next/src/styles/globals.css +85 -85
  14. package/templates/next/src-tauri/Cargo.lock +3701 -3701
  15. package/templates/next/src-tauri/Cargo.toml +36 -36
  16. package/templates/next/src-tauri/tauri.conf.json +79 -79
  17. package/templates/next/tailwind.config.js +77 -77
  18. package/templates/next/tsconfig.json +34 -34
  19. package/templates/sveltekit/package.json +84 -84
  20. package/templates/sveltekit/src-tauri/Cargo.lock +3701 -3701
  21. package/templates/sveltekit/src-tauri/Cargo.toml +36 -36
  22. package/templates/sveltekit/src-tauri/tauri.conf.json +79 -79
  23. package/templates/vite/components.json +15 -15
  24. package/templates/vite/package.json +76 -76
  25. package/templates/vite/pnpm-lock.yaml +5110 -5110
  26. package/templates/vite/src-tauri/Cargo.lock +3701 -3701
  27. package/templates/vite/src-tauri/Cargo.toml +36 -36
  28. package/templates/vite/src-tauri/tauri.conf.json +79 -79
  29. package/templates/viteuno/components.json +15 -15
  30. package/templates/viteuno/package.json +73 -73
  31. package/templates/viteuno/pnpm-lock.yaml +5298 -5298
  32. package/templates/viteuno/preset.shadcn.ts +160 -160
  33. package/templates/viteuno/src-tauri/Cargo.lock +3701 -3701
  34. package/templates/viteuno/src-tauri/Cargo.toml +36 -36
  35. package/templates/viteuno/src-tauri/tauri.conf.json +79 -79
  36. package/templates/viteuno/uno.config.ts +111 -111
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Tauri UI
4
4
 
5
- Tauri UI Template is a starting point for building modern desktop applications with web technologies. [shadcn/ui](https://github.com/shadcn/ui), [Tauri](https://github.com/tauri-apps/tauri).
5
+ Create modern Tauri desktop apps in just a few simple steps. Tauri UI Templates is a starting point for building modern desktop applications with web technologies with using [shadcn/ui](https://github.com/shadcn/ui), [Tauri](https://github.com/tauri-apps/tauri).
6
6
 
7
7
  > _You can download pre-built final bundles from the [Releases](https://github.com/agmmnn/tauri-ui/releases) section._
8
8
 
@@ -40,7 +40,7 @@ pnpm create tauri-ui my-tauri-app --template sveltekit
40
40
 
41
41
  </details>
42
42
 
43
- ![](/others/Animation.gif)
43
+ ![cli](https://github.com/agmmnn/tauri-ui/assets/16024979/e678e09b-37ac-4281-95ef-fdca63e5742d)
44
44
  You can use `.` for the project name to scaffold in the current directory.
45
45
 
46
46
  <details>
@@ -74,7 +74,9 @@ pnpm tauri build
74
74
 
75
75
  ## Update Components
76
76
 
77
- Note that **shadcn/ui** [is not a library](https://ui.shadcn.com/docs#faqs), therefore you will need to update the components manually. To do so, you can [download](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fshadcn%2Fui%2Ftree%2Fmain%2Fapps%2Fwww%2Fcomponents%2Fui) the _[shadcn/ui/.../components/ui](https://github.com/shadcn/ui/tree/main/apps/www/components/ui)_ directory and paste it into _src/components/ui_.
77
+ ```
78
+ npx shadcn-ui@latest add [component] --overwrite
79
+ ```
78
80
 
79
81
  ## Acknowledgements
80
82
 
package/dist/index.mjs CHANGED
@@ -45,8 +45,8 @@ Instructions:
45
45
  Filtered results for: ${this.inputValue?this.inputValue:j.gray("Enter something to filter")}
46
46
  `}renderOption(t,e,i){let n;return e.disabled?n=t===i?j.gray().underline(e.title):j.strikethrough().gray(e.title):n=t===i?j.cyan().underline(e.title):e.title,(e.selected?j.green(B.radioOn):B.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(j.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ai.hide),super.render();let t=[Wt.symbol(this.done,this.aborted),j.bold(this.msg),Wt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Gt(t,this.out.columns)}}var di=ci;const Kt=C,fi=F,{style:Zt,clear:pi}=E,{erase:mi,cursor:qt}=T;class gi extends fi{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
47
47
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
48
- `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(qt.hide):this.out.write(pi(this.outputText,this.out.columns)),super.render(),this.outputText=[Zt.symbol(this.done,this.aborted),Kt.bold(this.msg),Zt.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Kt.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(mi.line+qt.to(0)+this.outputText))}}var bi=gi,vi={TextPrompt:Be,SelectPrompt:Ke,TogglePrompt:ts,DatePrompt:ks,NumberPrompt:Ks,MultiselectPrompt:Bt,AutocompletePrompt:hi,AutocompleteMultiselectPrompt:di,ConfirmPrompt:bi};(function(s){const t=s,e=vi,i=r=>r;function n(r,l,b={}){return new Promise((h,D)=>{const m=new e[r](l),a=b.onAbort||i,c=b.onSubmit||i,v=b.onExit||i;m.on("state",l.onState||i),m.on("submit",O=>h(c(O))),m.on("exit",O=>h(v(O))),m.on("abort",O=>D(a(O)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:b=>b.split(l).map(h=>h.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(b=>b.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(Mt);const mt=Mt,wi=["suggest","format","onState","validate","onRender","type"],Xt=()=>{};async function L(s=[],{onSubmit:t=Xt,onCancel:e=Xt}={}){const i={},n=L._override||{};s=[].concat(s);let o,r,l,b,h,D;const m=async(a,c,v=!1)=>{if(!(!v&&a.validate&&a.validate(c)!==!0))return a.format?await a.format(c,i):c};for(r of s)if({name:b,type:h}=r,typeof h=="function"&&(h=await h(o,{...i},r),r.type=h),!!h){for(let a in r){if(wi.includes(a))continue;let c=r[a];r[a]=typeof c=="function"?await c(o,{...i},D):c}if(D=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:b,type:h}=r,mt[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(n[r.name]!==void 0&&(o=await m(r,n[r.name]),o!==void 0)){i[b]=o;continue}try{o=L._injected?yi(L._injected,r.initial):await mt[h](r),i[b]=o=await m(r,o,!0),l=await t(r,o,i)}catch{l=!await e(r,i)}if(l)return i}return i}function yi(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function $i(s){L._injected=(L._injected||[]).concat(s)}function xi(s){L._override=Object.assign({},s)}var Si=Object.assign(L,{prompt:L,prompts:mt,inject:$i,override:xi});const Oi=xt(Si);let H=!0;const U=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Z=0;if(U.process&&U.process.env&&U.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,NO_COLOR:e,TERM:i,COLORTERM:n}=U.process.env;t||e||s==="0"?H=!1:s==="1"||s==="2"||s==="3"?H=!0:i==="dumb"?H=!1:"CI"in U.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in U.process.env)?H=!0:H=process.stdout.isTTY,H&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Z=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?Z=2:Z=1)}let Qt={enabled:H,supportLevel:Z};function it(s,t,e=1){const i=`\x1B[${s}m`,n=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Qt.enabled&&Qt.supportLevel>=e?i+(""+r).replace(o,i)+n:""+r}const rt=it(0,0),te=it(31,39),nt=it(34,39),Mi=it(90,39);function ee(s){return s?.trim().replace(/\/+$/g,"")}const Pi=["node_modules","src-tauri/target","src-tauri\\target"];function gt(s,t){x.statSync(s).isDirectory()?Pi.some(e=>s.includes(e))||Ci(s,t):x.copyFileSync(s,t)}function se(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function Ti(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ci(s,t){x.mkdirSync(t,{recursive:!0});for(const e of x.readdirSync(s)){const i=S.resolve(s,e),n=S.resolve(t,e);gt(i,n)}}function Di(s){const t=x.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Ei(s){if(x.existsSync(s))for(const t of x.readdirSync(s))t!==".git"&&x.rmSync(S.resolve(s,t),{recursive:!0,force:!0})}function Ii(s){if(!s)return;const t=s.split(" ")[0].split("/");return{name:t[0],version:t[1]}}const bt=ce(process.argv.slice(2),{string:["_"]}),vt=process.cwd(),ie=[{name:"vite",display:"\u26A1Vite + React",color:nt},{name:"next",display:"\u25B2 Next.js",color:nt},{name:"viteuno",display:"\u26A1Vite + UnoCSS ",color:nt},{name:"sveltekit",display:"\u26A1Vite + SvelteKit",color:nt}],re=ie.map(s=>s.name),ne=[{title:"Windows (x64)",value:"windows-latest"},{title:"macOS (x64)",value:"macos-latest"},{title:"Linux (x64)",value:"ubuntu-latest"}],oe=ne.map(s=>s.value),_i={_gitignore:".gitignore"},wt="tauri-ui";async function Ri(){const s=ee(bt._[0]),t=bt.selectedTemplate||bt.t;let e=s||wt;const i=()=>e==="."?S.basename(S.resolve()):e,n=await Oi([{type:s?null:"text",name:"projectName",message:rt("Project name:"),initial:wt,onState:d=>{e=ee(d.value)||wt}},{type:()=>!x.existsSync(e)||Di(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing templateFiles and continue?"},{type:(d,{overwrite:y})=>{if(y===!1)throw new Error(te("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>se(i())?null:"text",name:"packageName",message:rt("Package name:"),initial:()=>Ti(i()),validate:d=>se(d)||"Invalid package.json name"},{type:t&&re.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!re.includes(t)?rt(`"${t}" isn't a valid selectedTemplate . Please choose from below: `):rt("Select a framework:"),initial:0,choices:ie.map(d=>{const y=d.color;return{title:y(d.display||d.name),value:d}})},{type:"multiselect",name:"releaseOS",message:"Target operating systems for the Tauri Github Action",choices:ne.map(d=>({title:d.title,value:d.value,selected:!0})),instructions:!1,hint:"- Space to select/deselect. Press Enter to submit"}],{onCancel:()=>{throw new Error(te("\u2716")+" Operation cancelled")}}),{framework:o,overwrite:r,packageName:l,releaseOS:b}=n,h=S.join(vt,e);r?Ei(h):x.existsSync(h)||x.mkdirSync(h,{recursive:!0});let D=o?.name||t;const m=Ii(process.env.npm_config_user_agent),a=m?m.name:"npm";console.log(`
49
- Scaffolding project in ${Mi(h)}`);const c=S.resolve($t(import.meta.url),"../../templates/",D),v=S.resolve($t(import.meta.url),"../../templates/.shared"),O=(d,y)=>{const q=S.join(h,_i[d]??d);y?x.writeFileSync(q,y):gt(S.join(c,d),q)},z=x.readdirSync(c);for(const d of z.filter(y=>y!=="package.json"||"tauri.conf.json"))O(d);const M=x.readdirSync(v);for(const d of M){const y=S.join(v,d),q=S.join(h,d);gt(y,q)}const V=JSON.parse(x.readFileSync(S.join(c,"package.json"),"utf-8"));V.name=l||i(),O("package.json",JSON.stringify(V,null,2)+`
48
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(qt.hide):this.out.write(pi(this.outputText,this.out.columns)),super.render(),this.outputText=[Zt.symbol(this.done,this.aborted),Kt.bold(this.msg),Zt.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Kt.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(mi.line+qt.to(0)+this.outputText))}}var bi=gi,vi={TextPrompt:Be,SelectPrompt:Ke,TogglePrompt:ts,DatePrompt:ks,NumberPrompt:Ks,MultiselectPrompt:Bt,AutocompletePrompt:hi,AutocompleteMultiselectPrompt:di,ConfirmPrompt:bi};(function(s){const t=s,e=vi,i=r=>r;function n(r,l,b={}){return new Promise((h,D)=>{const m=new e[r](l),a=b.onAbort||i,c=b.onSubmit||i,v=b.onExit||i;m.on("state",l.onState||i),m.on("submit",O=>h(c(O))),m.on("exit",O=>h(v(O))),m.on("abort",O=>D(a(O)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:b=>b.split(l).map(h=>h.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(b=>b.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(Mt);const mt=Mt,wi=["suggest","format","onState","validate","onRender","type"],Xt=()=>{};async function L(s=[],{onSubmit:t=Xt,onCancel:e=Xt}={}){const i={},n=L._override||{};s=[].concat(s);let o,r,l,b,h,D;const m=async(a,c,v=!1)=>{if(!(!v&&a.validate&&a.validate(c)!==!0))return a.format?await a.format(c,i):c};for(r of s)if({name:b,type:h}=r,typeof h=="function"&&(h=await h(o,{...i},r),r.type=h),!!h){for(let a in r){if(wi.includes(a))continue;let c=r[a];r[a]=typeof c=="function"?await c(o,{...i},D):c}if(D=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:b,type:h}=r,mt[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(n[r.name]!==void 0&&(o=await m(r,n[r.name]),o!==void 0)){i[b]=o;continue}try{o=L._injected?yi(L._injected,r.initial):await mt[h](r),i[b]=o=await m(r,o,!0),l=await t(r,o,i)}catch{l=!await e(r,i)}if(l)return i}return i}function yi(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function $i(s){L._injected=(L._injected||[]).concat(s)}function xi(s){L._override=Object.assign({},s)}var Si=Object.assign(L,{prompt:L,prompts:mt,inject:$i,override:xi});const Oi=xt(Si);let H=!0;const U=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Z=0;if(U.process&&U.process.env&&U.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,NO_COLOR:e,TERM:i,COLORTERM:n}=U.process.env;t||e||s==="0"?H=!1:s==="1"||s==="2"||s==="3"?H=!0:i==="dumb"?H=!1:"CI"in U.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in U.process.env)?H=!0:H=process.stdout.isTTY,H&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Z=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?Z=2:Z=1)}let Qt={enabled:H,supportLevel:Z};function it(s,t,e=1){const i=`\x1B[${s}m`,n=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Qt.enabled&&Qt.supportLevel>=e?i+(""+r).replace(o,i)+n:""+r}const rt=it(0,0),te=it(31,39),nt=it(34,39),Mi=it(90,39);function ee(s){return s?.trim().replace(/\/+$/g,"")}function gt(s,t){x.statSync(s).isDirectory()?Ti(s,t):x.copyFileSync(s,t)}function se(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function Pi(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ti(s,t){x.mkdirSync(t,{recursive:!0});for(const e of x.readdirSync(s)){const i=S.resolve(s,e),n=S.resolve(t,e);gt(i,n)}}function Ci(s){const t=x.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Di(s){if(x.existsSync(s))for(const t of x.readdirSync(s))t!==".git"&&x.rmSync(S.resolve(s,t),{recursive:!0,force:!0})}function Ei(s){if(!s)return;const t=s.split(" ")[0].split("/");return{name:t[0],version:t[1]}}const bt=ce(process.argv.slice(2),{string:["_"]}),vt=process.cwd(),ie=[{name:"vite",display:"\u26A1Vite + React",color:nt},{name:"next",display:"\u25B2 Next.js",color:nt},{name:"viteuno",display:"\u26A1Vite + UnoCSS ",color:nt},{name:"sveltekit",display:"\u26A1Vite + SvelteKit",color:nt}],re=ie.map(s=>s.name),ne=[{title:"Windows (x64)",value:"windows-latest"},{title:"macOS (x64)",value:"macos-latest"},{title:"Linux (x64)",value:"ubuntu-latest"}],oe=ne.map(s=>s.value),Ii={_gitignore:".gitignore"},wt="tauri-ui";async function _i(){const s=ee(bt._[0]),t=bt.selectedTemplate||bt.t;let e=s||wt;const i=()=>e==="."?S.basename(S.resolve()):e,n=await Oi([{type:s?null:"text",name:"projectName",message:rt("Project name:"),initial:wt,onState:d=>{e=ee(d.value)||wt}},{type:()=>!x.existsSync(e)||Ci(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing templateFiles and continue?"},{type:(d,{overwrite:y})=>{if(y===!1)throw new Error(te("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>se(i())?null:"text",name:"packageName",message:rt("Package name:"),initial:()=>Pi(i()),validate:d=>se(d)||"Invalid package.json name"},{type:t&&re.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!re.includes(t)?rt(`"${t}" isn't a valid selectedTemplate . Please choose from below: `):rt("Select a framework:"),initial:0,choices:ie.map(d=>{const y=d.color;return{title:y(d.display||d.name),value:d}})},{type:"multiselect",name:"releaseOS",message:"Target operating systems for the Tauri Github Action",choices:ne.map(d=>({title:d.title,value:d.value,selected:!0})),instructions:!1,hint:"- Space to select/deselect. Press Enter to submit"}],{onCancel:()=>{throw new Error(te("\u2716")+" Operation cancelled")}}),{framework:o,overwrite:r,packageName:l,releaseOS:b}=n,h=S.join(vt,e);r?Di(h):x.existsSync(h)||x.mkdirSync(h,{recursive:!0});let D=o?.name||t;const m=Ei(process.env.npm_config_user_agent),a=m?m.name:"npm";console.log(`
49
+ Scaffolding project in ${Mi(h)}`);const c=S.resolve($t(import.meta.url),"../../templates/",D),v=S.resolve($t(import.meta.url),"../../templates/.shared"),O=(d,y)=>{const q=S.join(h,Ii[d]??d);y?x.writeFileSync(q,y):gt(S.join(c,d),q)},z=x.readdirSync(c);for(const d of z.filter(y=>y!=="package.json"||"tauri.conf.json"))O(d);const M=x.readdirSync(v);for(const d of M){const y=S.join(v,d),q=S.join(h,d);gt(y,q)}const V=JSON.parse(x.readFileSync(S.join(c,"package.json"),"utf-8"));V.name=l||i(),O("package.json",JSON.stringify(V,null,2)+`
50
50
  `);const $=JSON.parse(x.readFileSync(S.join(c,"/src-tauri/tauri.conf.json"),"utf-8"));$.tauri.windows[0].title=l||i(),$.package.productName=l||i(),O("/src-tauri/tauri.conf.json",JSON.stringify($,null,2)+`
51
51
  `);const u=S.join(v,"/src-tauri/Cargo.toml"),w=x.readFileSync(u,"utf-8").replace(/name\s*=\s*"tauri-ui"/,`name = "${l||i()}"`);O("/src-tauri/Cargo.toml",w);const P=S.join(v,".github/workflows/release.yml"),f=x.readFileSync(P,"utf-8").replace("platform: [macos-latest, ubuntu-latest, windows-latest]",`platform: [${b.join(", ")}]`+(b.length<oe.length?` # ${oe.filter(d=>!b.includes(d)).join(", ")}`:""));O(".github/workflows/release.yml",f);const _=S.relative(vt,h);switch(console.log(`
52
- Done. Now run:`),h!==vt&&console.log(` cd ${_.includes(" ")?`"${_}"`:_}`),a){case"yarn":console.log(" yarn"),console.log(" yarn tauri dev");break;case"pnpm":console.log(" pnpm i"),console.log(" pnpm tauri dev");break;default:console.log(` ${a} install`),console.log(` ${a} run tauri dev`);break}console.log()}Ri().catch(s=>{console.error(s)});
52
+ Done. Now run:`),h!==vt&&console.log(` cd ${_.includes(" ")?`"${_}"`:_}`),a){case"yarn":console.log(" yarn"),console.log(" yarn tauri dev");break;case"pnpm":console.log(" pnpm i"),console.log(" pnpm tauri dev");break;default:console.log(` ${a} install`),console.log(` ${a} run tauri dev`);break}console.log()}_i().catch(s=>{console.error(s)});
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "create-tauri-ui",
3
- "version": "0.2.0",
4
- "description": "🦀 Create modern Tauri desktop apps in just a few simple steps.",
5
- "main": "index.js",
6
- "author": "agmmnn",
7
- "license": "MIT",
8
- "type": "module",
9
- "scripts": {
10
- "dev": "unbuild --stub",
11
- "build": "unbuild",
12
- "start": "unbuild --stub && node index.js",
13
- "typecheck": "tsc --noEmit",
14
- "prepublishOnly": "npm run build",
15
- "format": "npx prettier --write . --ignore-path .gitignore ",
16
- "taze": "taze minor -r -w -i false -I",
17
- "taze:major": "taze major -r -w -i false -I",
18
- "updatesub": "git submodule update --init --recursive --remote"
19
- },
20
- "bin": {
21
- "create-tauri-ui": "index.js"
22
- },
23
- "files": [
24
- "index.js",
25
- "templates",
26
- "dist"
27
- ],
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/agmmnn/tauri-ui.git"
31
- },
32
- "bugs": {
33
- "url": "https://github.com/agmmnn/tauri-ui/issues"
34
- },
35
- "homepage": "https://github.com/agmmnn/tauri-ui",
36
- "dependencies": {
37
- "@clack/core": "^0.3.2",
38
- "@clack/prompts": "^0.6.3",
39
- "picocolors": "^1.0.0",
40
- "sisteransi": "^1.0.5",
41
- "zod": "^3.21.4"
42
- },
43
- "devDependencies": {
44
- "@types/minimist": "^1.2.2",
45
- "@types/node": "^20.4.1",
46
- "@types/prompts": "^2.4.4",
47
- "commander": "^11.0.0",
48
- "kolorist": "^1.8.0",
49
- "minimist": "^1.2.8",
50
- "prompts": "^2.4.2",
51
- "typescript": "^5.1.6",
52
- "unbuild": "^1.2.1"
53
- }
54
- }
1
+ {
2
+ "name": "create-tauri-ui",
3
+ "version": "0.2.1",
4
+ "description": "🦀 Create modern Tauri desktop apps in just a few simple steps.",
5
+ "main": "index.js",
6
+ "author": "agmmnn",
7
+ "license": "MIT",
8
+ "type": "module",
9
+ "scripts": {
10
+ "dev": "unbuild --stub",
11
+ "build": "unbuild",
12
+ "start": "unbuild --stub && node index.js",
13
+ "typecheck": "tsc --noEmit",
14
+ "prepublishOnly": "npm run build",
15
+ "format": "npx prettier --write . --ignore-path .gitignore ",
16
+ "taze": "taze minor -r -w -i false -I",
17
+ "taze:major": "taze major -r -w -i false -I",
18
+ "updatesub": "git submodule update --init --recursive --remote"
19
+ },
20
+ "bin": {
21
+ "create-tauri-ui": "index.js"
22
+ },
23
+ "files": [
24
+ "index.js",
25
+ "templates",
26
+ "dist"
27
+ ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/agmmnn/tauri-ui.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/agmmnn/tauri-ui/issues"
34
+ },
35
+ "homepage": "https://github.com/agmmnn/tauri-ui",
36
+ "dependencies": {
37
+ "@clack/core": "^0.3.2",
38
+ "@clack/prompts": "^0.6.3",
39
+ "picocolors": "^1.0.0",
40
+ "sisteransi": "^1.0.5",
41
+ "zod": "^3.21.4"
42
+ },
43
+ "devDependencies": {
44
+ "@types/minimist": "^1.2.2",
45
+ "@types/node": "^20.4.1",
46
+ "@types/prompts": "^2.4.4",
47
+ "commander": "^11.0.0",
48
+ "kolorist": "^1.8.0",
49
+ "minimist": "^1.2.8",
50
+ "prompts": "^2.4.2",
51
+ "typescript": "^5.1.6",
52
+ "unbuild": "^1.2.1"
53
+ }
54
+ }