bobp 0.6.0 → 0.8.0

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/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var X=Object.create;var E=Object.defineProperty,Z=Object.defineProperties,ee=Object.getOwnPropertyDescriptor,te=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,ne=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var T=(e,t,o)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,d=(e,t)=>{for(var o in t||(t={}))C.call(t,o)&&T(e,o,t[o]);if(b)for(var o of b(t))re.call(t,o)&&T(e,o,t[o]);return e},f=(e,t)=>Z(e,te(t));var ie=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oe(t))!C.call(e,i)&&i!==o&&E(e,i,{get:()=>t[i],enumerable:!(n=ee(t,i))||n.enumerable});return e};var S=(e,t,o)=>(o=e!=null?X(ne(e)):{},ie(t||!e||!e.__esModule?E(o,"default",{value:e,enumerable:!0}):o,e));var a=(e,t,o)=>new Promise((n,i)=>{var m=r=>{try{s(o.next(r))}catch(l){i(l)}},c=r=>{try{s(o.throw(r))}catch(l){i(l)}},s=r=>r.done?n(r.value):Promise.resolve(r.value).then(m,c);s((o=o.apply(e,t)).next())});var W=S(require("yargs")),q=require("yargs/helpers");var j=require("path"),I=require("fs"),L=require("canvas");var D=1280,P=640,F='"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',se=`700 80px ${F}`,ce=`300 48px ${F}`,k=1.2;function R({title:e,description:t,path:o}){let n=(0,L.createCanvas)(D,P),{width:i,height:m}=n,c=n.getContext("2d");c.fillStyle="#001220",c.fillRect(0,0,i,m),c.textAlign="center",c.textBaseline="top";let s=[{str:e,font:se,y:0,h:0,g:1.3},...t.split(`
3
- `).map(p=>({str:p,font:ce,y:0,h:0,g:k}))].map(p=>pe(c,p)),r=s[s.length-1].h;r-=r/k,r=s.reduce((p,V)=>p+V.h,-r),r=Math.ceil(r);let l=Math.floor((P-r)*.5);for(let p of s)ae(c,p,l),l+=p.h;let K=(0,j.join)(o,"cover.png"),Q=n.toBuffer("image/png");(0,I.writeFileSync)(K,Q)}function ae(e,t,o){e.fillStyle="white",e.font=t.font,e.fillText(t.str,D*.5,o+t.y)}function pe(e,t){e.font=t.font;let o=e.measureText(t.str),{actualBoundingBoxAscent:n,actualBoundingBoxDescent:i}=o,m=n+i;return f(d({},t),{y:n,h:m*t.g})}var g=require("fs"),u=require("path"),_=S(require("degit")),B=require("rimraf");function J(e){return a(this,null,function*(){yield me(e),le(e),de(e)})}function me(t){return a(this,arguments,function*({name:e}){return yield(0,_.default)("rdarida/template-electron#main").clone((0,u.resolve)(process.cwd(),e))})}function le({name:e,productName:t}){let o=(0,u.resolve)(process.cwd(),e,"package.json"),n=(0,g.readFileSync)(o,{encoding:"utf-8"}),i=f(d({},JSON.parse(n)),{name:e,productName:t,version:"0.0.0"});(0,g.writeFileSync)(o,JSON.stringify(i,null,2))}function de({name:e}){["package-lock.json"].forEach(t=>{let o=(0,u.resolve)(process.cwd(),e,t);(0,B.rimrafSync)(o)})}var h=require("path"),x=require("fs");var M=require("path"),y=(0,M.join)(__dirname,"..","templates");var fe=(0,h.join)(y,"license");function A({type:e,year:t,author:o,path:n}){let i=`${e}.txt`,m=(0,h.join)(fe,i),s=(0,x.readFileSync)(m,{encoding:"utf-8"}).replace("[year]",t).replace("[author]",o),r=(0,h.join)(n,"LICENSE");(0,x.writeFileSync)(r,s)}var v=require("path"),w=require("fs"),G=S(require("degit")),H=require("rimraf");function Y(e){return a(this,null,function*(){yield ge(e),ue(e),ye(e)})}function ge(t){return a(this,arguments,function*({name:e}){return yield(0,G.default)("rdarida/template-next#main").clone((0,v.resolve)(process.cwd(),e))})}function ue({name:e}){let t=(0,v.resolve)(process.cwd(),e,"package.json"),o=(0,w.readFileSync)(t,{encoding:"utf-8"}),n=f(d({},JSON.parse(o)),{name:e,version:"0.0.0"});(0,w.writeFileSync)(t,JSON.stringify(n,null,2))}function ye({name:e}){["package-lock.json"].forEach(t=>{let o=(0,v.resolve)(process.cwd(),e,t);(0,H.rimrafSync)(o)})}var N=require("path"),O=require("fs");var $=(0,N.join)(y,"prettier");function z(){let e=(0,O.readdirSync)($);for(let t of e){let o=(0,N.join)($,t),n=(0,N.join)(process.cwd(),`.${t}`);(0,O.copyFileSync)(o,n)}}function U(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,"")}(0,W.default)((0,q.hideBin)(process.argv)).scriptName("bobp").usage("$0 <cmd> [args]","Usage").demandCommand(1,"Need 1").command("cover <title> <description> [path]","Generates a PNG cover image (cover.png) in the current working directory",e=>e.positional("title",{demandOption:!0,describe:"Main title text displayed on the cover",type:"string"}).positional("description",{demandOption:!0,describe:"Description text displayed below the title",type:"string"}).positional("path",{default:process.cwd(),describe:"Output path for the generated cover image",type:"string"}),e=>R(e)).command("license <author> [year] [type] [path]","Generates a LICENSE file in the current working directory",e=>e.positional("author",{demandOption:!0,describe:"Author or copyright holder name",type:"string"}).positional("year",{default:new Date().getFullYear().toString(),describe:"Year to be inserted into the license text",type:"string"}).positional("type",{default:"mit",describe:'License type (e.g. "mit")',type:"string"}).positional("path",{default:process.cwd(),describe:"Output path for the generated LICENSE file",type:"string"}),e=>A(e)).command("electron <productName> [name]","Creates a new Electron project in the current working directory",e=>e.positional("productName",{demandOption:!0,describe:"Name of the application",type:"string"}).positional("name",{describe:"Name of the project directory and npm package",type:"string"}),o=>a(null,[o],function*({productName:e,name:t}){t=t||U(e),yield J({name:t,productName:e})})).command("next <name>","Creates a new Next.js project in the current working directory",e=>e.positional("name",{demandOption:!0,describe:"Name of the project directory and npm package",type:"string"}),e=>a(null,null,function*(){return yield Y(e)})).command("prettier","Copies Prettier configuration files into the current working directory",e=>e,()=>z()).help().strict().parse();
2
+ "use strict";var X=Object.create;var E=Object.defineProperty,Z=Object.defineProperties,tt=Object.getOwnPropertyDescriptor,et=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,nt=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable;var T=(t,e,o)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,d=(t,e)=>{for(var o in e||(e={}))C.call(e,o)&&T(t,o,e[o]);if(b)for(var o of b(e))rt.call(e,o)&&T(t,o,e[o]);return t},f=(t,e)=>Z(t,et(e));var it=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ot(e))!C.call(t,r)&&r!==o&&E(t,r,{get:()=>e[r],enumerable:!(n=tt(e,r))||n.enumerable});return t};var S=(t,e,o)=>(o=t!=null?X(nt(t)):{},it(e||!t||!t.__esModule?E(o,"default",{value:t,enumerable:!0}):o,t));var c=(t,e,o)=>new Promise((n,r)=>{var m=i=>{try{s(o.next(i))}catch(l){r(l)}},a=i=>{try{s(o.throw(i))}catch(l){r(l)}},s=i=>i.done?n(i.value):Promise.resolve(i.value).then(m,a);s((o=o.apply(t,e)).next())});var W=S(require("yargs")),q=require("yargs/helpers");var k=require("path"),I=require("fs"),L=require("canvas");var D=1280,P=640,F='"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',st=`700 80px ${F}`,at=`300 48px ${F}`,j=1.2;function R({title:t,description:e,path:o}){let n=(0,L.createCanvas)(D,P),{width:r,height:m}=n,a=n.getContext("2d");a.fillStyle="#001220",a.fillRect(0,0,r,m),a.textAlign="center",a.textBaseline="top";let s=[{str:t,font:st,y:0,h:0,g:1.3},...e.split(`
3
+ `).map(p=>({str:p,font:at,y:0,h:0,g:j}))].map(p=>pt(a,p)),i=s[s.length-1].h;i-=i/j,i=s.reduce((p,V)=>p+V.h,-i),i=Math.ceil(i);let l=Math.floor((P-i)*.5);for(let p of s)ct(a,p,l),l+=p.h;let K=(0,k.join)(o,"cover.png"),Q=n.toBuffer("image/png");(0,I.writeFileSync)(K,Q)}function ct(t,e,o){t.fillStyle="white",t.font=e.font,t.fillText(e.str,D*.5,o+e.y)}function pt(t,e){t.font=e.font;let o=t.measureText(e.str),{actualBoundingBoxAscent:n,actualBoundingBoxDescent:r}=o,m=n+r;return f(d({},e),{y:n,h:m*e.g})}var g=require("fs"),u=require("path"),_=S(require("degit")),B=require("rimraf");function J(t){return c(this,null,function*(){yield mt(t),lt(t),dt(t)})}function mt(e){return c(this,arguments,function*({name:t}){return yield(0,_.default)("rdarida/template-electron#main").clone((0,u.resolve)(process.cwd(),t))})}function lt({name:t,productName:e}){let o=(0,u.resolve)(process.cwd(),t,"package.json"),n=(0,g.readFileSync)(o,{encoding:"utf-8"}),r=f(d({},JSON.parse(n)),{name:t,productName:e,version:"0.0.0"});(0,g.writeFileSync)(o,JSON.stringify(r,null,2))}function dt({name:t}){["package-lock.json"].forEach(e=>{let o=(0,u.resolve)(process.cwd(),t,e);(0,B.rimrafSync)(o)})}var h=require("path"),x=require("fs");var M=require("path"),y=(0,M.join)(__dirname,"..","templates");var ft=(0,h.join)(y,"license");function A({type:t,year:e,author:o,path:n}){let r=`${t}.txt`,m=(0,h.join)(ft,r),s=(0,x.readFileSync)(m,{encoding:"utf-8"}).replace("[year]",e).replace("[author]",o),i=(0,h.join)(n,"LICENSE");(0,x.writeFileSync)(i,s)}var v=require("fs"),O=require("path"),G=S(require("degit")),H=require("rimraf");function Y(t){return c(this,null,function*(){yield gt(t),ut(t),yt(t)})}function gt(o){return c(this,arguments,function*({name:t,path:e}){return yield(0,G.default)("rdarida/template-next#main").clone((0,O.join)(e,t))})}function ut({name:t,path:e}){let o=(0,O.join)(e,t,"package.json"),n=(0,v.readFileSync)(o,{encoding:"utf-8"}),r=f(d({},JSON.parse(n)),{name:t,version:"0.0.0"});(0,v.writeFileSync)(o,JSON.stringify(r,null,2))}function yt({name:t,path:e}){["package-lock.json"].forEach(o=>{let n=(0,O.join)(e,t,o);(0,H.rimrafSync)(n)})}var N=require("path"),w=require("fs");var $=(0,N.join)(y,"prettier");function z({path:t}){let e=(0,w.readdirSync)($);for(let o of e){let n=(0,N.join)($,o),r=(0,N.join)(t,`.${o}`);(0,w.copyFileSync)(n,r)}}function U(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,"")}(0,W.default)((0,q.hideBin)(process.argv)).scriptName("bobp").usage("$0 <cmd> [args]","Usage").demandCommand(1,"Need 1").command("cover <title> <description> [path]","Generates a PNG cover image (cover.png) in the current working directory",t=>t.positional("title",{demandOption:!0,describe:"Main title text displayed on the cover",type:"string"}).positional("description",{demandOption:!0,describe:"Description text displayed below the title",type:"string"}).positional("path",{default:process.cwd(),describe:"Output path for the generated cover image",type:"string"}),t=>R(t)).command("license <author> [year] [type] [path]","Generates a LICENSE file in the current working directory",t=>t.positional("author",{demandOption:!0,describe:"Author or copyright holder name",type:"string"}).positional("year",{default:new Date().getFullYear().toString(),describe:"Year to be inserted into the license text",type:"string"}).positional("type",{default:"mit",describe:'License type (e.g. "mit")',type:"string"}).positional("path",{default:process.cwd(),describe:"Output path for the generated LICENSE file",type:"string"}),t=>A(t)).command("electron <productName> [name]","Creates a new Electron project in the current working directory",t=>t.positional("productName",{demandOption:!0,describe:"Name of the application",type:"string"}).positional("name",{describe:"Name of the project directory and npm package",type:"string"}),o=>c(null,[o],function*({productName:t,name:e}){e=e||U(t),yield J({name:e,productName:t})})).command("next <name> [path]","Creates a new Next.js project in the current working directory",t=>t.positional("name",{demandOption:!0,describe:"Name of the project directory and npm package",type:"string"}).positional("path",{default:process.cwd(),describe:"Output path for the generated Next.js project",type:"string"}),t=>c(null,null,function*(){return yield Y(t)})).command("prettier [path]","Copies Prettier configuration files into the current working directory",t=>t.positional("path",{default:process.cwd(),describe:"Output path for the generated Prettier configuration files",type:"string"}),t=>z(t)).help().strict().parse();
package/dist/index.d.ts CHANGED
@@ -69,6 +69,11 @@ declare function license({ type, year, author, path }: LicenseOptions): void;
69
69
  type NextOptions = {
70
70
  /** Name of the project directory and npm package */
71
71
  name: string;
72
+ /**
73
+ * Output path for the generated Next.js project
74
+ * (default: the current working directory)
75
+ */
76
+ path: string;
72
77
  };
73
78
  /**
74
79
  * Creates a new Next.js project from a
@@ -79,11 +84,18 @@ type NextOptions = {
79
84
  */
80
85
  declare function next(nextOptions: NextOptions): Promise<void>;
81
86
 
87
+ type PrettierOptions = {
88
+ /**
89
+ * Output path for the generated Prettier configuration files
90
+ * (default: the current working directory)
91
+ */
92
+ path: string;
93
+ };
82
94
  /**
83
95
  * Copies Prettier configuration files into the current working directory.
84
96
  */
85
- declare function prettier(): void;
97
+ declare function prettier({ path }: PrettierOptions): void;
86
98
 
87
99
  declare function normalize(name: string): string;
88
100
 
89
- export { type CoverOptions, type ElectronOptions, type LicenseOptions, type NextOptions, cover, electron, license, next, normalize, prettier };
101
+ export { type CoverOptions, type ElectronOptions, type LicenseOptions, type NextOptions, type PrettierOptions, cover, electron, license, next, normalize, prettier };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var G=Object.create;var g=Object.defineProperty,U=Object.defineProperties,W=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,Q=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var P=(t,e,o)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))O.call(e,o)&&P(t,o,e[o]);if(N)for(var o of N(e))V.call(e,o)&&P(t,o,e[o]);return t},l=(t,e)=>U(t,q(e));var X=(t,e)=>{for(var o in e)g(t,o,{get:e[o],enumerable:!0})},C=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of K(e))!O.call(t,i)&&i!==o&&g(t,i,{get:()=>e[i],enumerable:!(n=W(e,i))||n.enumerable});return t};var I=(t,e,o)=>(o=t!=null?G(Q(t)):{},C(e||!t||!t.__esModule?g(o,"default",{value:t,enumerable:!0}):o,t)),Z=t=>C(g({},"__esModule",{value:!0}),t);var d=(t,e,o)=>new Promise((n,i)=>{var p=r=>{try{s(o.next(r))}catch(f){i(f)}},c=r=>{try{s(o.throw(r))}catch(f){i(f)}},s=r=>r.done?n(r.value):Promise.resolve(r.value).then(p,c);s((o=o.apply(t,e)).next())});var yt={};X(yt,{cover:()=>ot,electron:()=>it,license:()=>ft,next:()=>mt,normalize:()=>xt,prettier:()=>ut});module.exports=Z(yt);var F=require("path"),j=require("fs"),k=require("canvas");var _=1280,R=640,L='"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',tt=`700 80px ${L}`,et=`300 48px ${L}`,D=1.2;function ot({title:t,description:e,path:o}){let n=(0,k.createCanvas)(_,R),{width:i,height:p}=n,c=n.getContext("2d");c.fillStyle="#001220",c.fillRect(0,0,i,p),c.textAlign="center",c.textBaseline="top";let s=[{str:t,font:tt,y:0,h:0,g:1.3},...e.split(`
2
- `).map(a=>({str:a,font:et,y:0,h:0,g:D}))].map(a=>rt(c,a)),r=s[s.length-1].h;r-=r/D,r=s.reduce((a,z)=>a+z.h,-r),r=Math.ceil(r);let f=Math.floor((R-r)*.5);for(let a of s)nt(c,a,f),f+=a.h;let $=(0,F.join)(o,"cover.png"),Y=n.toBuffer("image/png");(0,j.writeFileSync)($,Y)}function nt(t,e,o){t.fillStyle="white",t.font=e.font,t.fillText(e.str,_*.5,o+e.y)}function rt(t,e){t.font=e.font;let o=t.measureText(e.str),{actualBoundingBoxAscent:n,actualBoundingBoxDescent:i}=o,p=n+i;return l(m({},e),{y:n,h:p*e.g})}var u=require("fs"),x=require("path"),b=I(require("degit")),J=require("rimraf");function it(t){return d(this,null,function*(){yield st(t),ct(t),at(t)})}function st(e){return d(this,arguments,function*({name:t}){return yield(0,b.default)("rdarida/template-electron#main").clone((0,x.resolve)(process.cwd(),t))})}function ct({name:t,productName:e}){let o=(0,x.resolve)(process.cwd(),t,"package.json"),n=(0,u.readFileSync)(o,{encoding:"utf-8"}),i=l(m({},JSON.parse(n)),{name:t,productName:e,version:"0.0.0"});(0,u.writeFileSync)(o,JSON.stringify(i,null,2))}function at({name:t}){["package-lock.json"].forEach(e=>{let o=(0,x.resolve)(process.cwd(),t,e);(0,J.rimrafSync)(o)})}var h=require("path"),v=require("fs");var B=require("path"),y=(0,B.join)(__dirname,"..","templates");var pt=(0,h.join)(y,"license");function ft({type:t,year:e,author:o,path:n}){let i=`${t}.txt`,p=(0,h.join)(pt,i),s=(0,v.readFileSync)(p,{encoding:"utf-8"}).replace("[year]",e).replace("[author]",o),r=(0,h.join)(n,"LICENSE");(0,v.writeFileSync)(r,s)}var S=require("path"),T=require("fs"),H=I(require("degit")),M=require("rimraf");function mt(t){return d(this,null,function*(){yield lt(t),dt(t),gt(t)})}function lt(e){return d(this,arguments,function*({name:t}){return yield(0,H.default)("rdarida/template-next#main").clone((0,S.resolve)(process.cwd(),t))})}function dt({name:t}){let e=(0,S.resolve)(process.cwd(),t,"package.json"),o=(0,T.readFileSync)(e,{encoding:"utf-8"}),n=l(m({},JSON.parse(o)),{name:t,version:"0.0.0"});(0,T.writeFileSync)(e,JSON.stringify(n,null,2))}function gt({name:t}){["package-lock.json"].forEach(e=>{let o=(0,S.resolve)(process.cwd(),t,e);(0,M.rimrafSync)(o)})}var E=require("path"),w=require("fs");var A=(0,E.join)(y,"prettier");function ut(){let t=(0,w.readdirSync)(A);for(let e of t){let o=(0,E.join)(A,e),n=(0,E.join)(process.cwd(),`.${e}`);(0,w.copyFileSync)(o,n)}}function xt(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,"")}0&&(module.exports={cover,electron,license,next,normalize,prettier});
1
+ "use strict";var G=Object.create;var d=Object.defineProperty,U=Object.defineProperties,W=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,Q=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var O=(t,e,o)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))w.call(e,o)&&O(t,o,e[o]);if(P)for(var o of P(e))V.call(e,o)&&O(t,o,e[o]);return t},l=(t,e)=>U(t,q(e));var X=(t,e)=>{for(var o in e)d(t,o,{get:e[o],enumerable:!0})},C=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K(e))!w.call(t,r)&&r!==o&&d(t,r,{get:()=>e[r],enumerable:!(n=W(e,r))||n.enumerable});return t};var I=(t,e,o)=>(o=t!=null?G(Q(t)):{},C(e||!t||!t.__esModule?d(o,"default",{value:t,enumerable:!0}):o,t)),Z=t=>C(d({},"__esModule",{value:!0}),t);var g=(t,e,o)=>new Promise((n,r)=>{var p=i=>{try{s(o.next(i))}catch(f){r(f)}},c=i=>{try{s(o.throw(i))}catch(f){r(f)}},s=i=>i.done?n(i.value):Promise.resolve(i.value).then(p,c);s((o=o.apply(t,e)).next())});var yt={};X(yt,{cover:()=>ot,electron:()=>it,license:()=>ft,next:()=>mt,normalize:()=>xt,prettier:()=>ut});module.exports=Z(yt);var D=require("path"),F=require("fs"),k=require("canvas");var _=1280,R=640,L='"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',tt=`700 80px ${L}`,et=`300 48px ${L}`,j=1.2;function ot({title:t,description:e,path:o}){let n=(0,k.createCanvas)(_,R),{width:r,height:p}=n,c=n.getContext("2d");c.fillStyle="#001220",c.fillRect(0,0,r,p),c.textAlign="center",c.textBaseline="top";let s=[{str:t,font:tt,y:0,h:0,g:1.3},...e.split(`
2
+ `).map(a=>({str:a,font:et,y:0,h:0,g:j}))].map(a=>rt(c,a)),i=s[s.length-1].h;i-=i/j,i=s.reduce((a,z)=>a+z.h,-i),i=Math.ceil(i);let f=Math.floor((R-i)*.5);for(let a of s)nt(c,a,f),f+=a.h;let $=(0,D.join)(o,"cover.png"),Y=n.toBuffer("image/png");(0,F.writeFileSync)($,Y)}function nt(t,e,o){t.fillStyle="white",t.font=e.font,t.fillText(e.str,_*.5,o+e.y)}function rt(t,e){t.font=e.font;let o=t.measureText(e.str),{actualBoundingBoxAscent:n,actualBoundingBoxDescent:r}=o,p=n+r;return l(m({},e),{y:n,h:p*e.g})}var u=require("fs"),x=require("path"),b=I(require("degit")),J=require("rimraf");function it(t){return g(this,null,function*(){yield st(t),ct(t),at(t)})}function st(e){return g(this,arguments,function*({name:t}){return yield(0,b.default)("rdarida/template-electron#main").clone((0,x.resolve)(process.cwd(),t))})}function ct({name:t,productName:e}){let o=(0,x.resolve)(process.cwd(),t,"package.json"),n=(0,u.readFileSync)(o,{encoding:"utf-8"}),r=l(m({},JSON.parse(n)),{name:t,productName:e,version:"0.0.0"});(0,u.writeFileSync)(o,JSON.stringify(r,null,2))}function at({name:t}){["package-lock.json"].forEach(e=>{let o=(0,x.resolve)(process.cwd(),t,e);(0,J.rimrafSync)(o)})}var h=require("path"),v=require("fs");var B=require("path"),y=(0,B.join)(__dirname,"..","templates");var pt=(0,h.join)(y,"license");function ft({type:t,year:e,author:o,path:n}){let r=`${t}.txt`,p=(0,h.join)(pt,r),s=(0,v.readFileSync)(p,{encoding:"utf-8"}).replace("[year]",e).replace("[author]",o),i=(0,h.join)(n,"LICENSE");(0,v.writeFileSync)(i,s)}var S=require("fs"),T=require("path"),H=I(require("degit")),M=require("rimraf");function mt(t){return g(this,null,function*(){yield lt(t),gt(t),dt(t)})}function lt(o){return g(this,arguments,function*({name:t,path:e}){return yield(0,H.default)("rdarida/template-next#main").clone((0,T.join)(e,t))})}function gt({name:t,path:e}){let o=(0,T.join)(e,t,"package.json"),n=(0,S.readFileSync)(o,{encoding:"utf-8"}),r=l(m({},JSON.parse(n)),{name:t,version:"0.0.0"});(0,S.writeFileSync)(o,JSON.stringify(r,null,2))}function dt({name:t,path:e}){["package-lock.json"].forEach(o=>{let n=(0,T.join)(e,t,o);(0,M.rimrafSync)(n)})}var E=require("path"),N=require("fs");var A=(0,E.join)(y,"prettier");function ut({path:t}){let e=(0,N.readdirSync)(A);for(let o of e){let n=(0,E.join)(A,o),r=(0,E.join)(t,`.${o}`);(0,N.copyFileSync)(n,r)}}function xt(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,"")}0&&(module.exports={cover,electron,license,next,normalize,prettier});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bobp",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "How can I help you, Bobp?",
5
5
  "keywords": [],
6
6
  "license": "MIT",