create-twenty-app 0.2.0 → 0.2.2

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.cjs CHANGED
@@ -45,7 +45,7 @@ const config: ApplicationConfig = {
45
45
  };
46
46
 
47
47
  export default config;
48
- `;await Mr.writeFile(ue.join(o,"application.config.ts"),S)},Kv=async({appName:a,appDirectory:y})=>{const o={name:a,version:"0.1.0",license:"MIT",engines:{node:"^24.5.0",npm:"please-use-yarn",yarn:">=4.0.2"},packageManager:"yarn@4.9.2",scripts:{"create-entity":"twenty app add",dev:"twenty app dev",generate:"twenty app generate",sync:"twenty app sync",logs:"twenty app logs",uninstall:"twenty app uninstall",help:"twenty help",auth:"twenty auth login"},dependencies:{"twenty-sdk":"0.2.0"},devDependencies:{"@types/node":"^24.7.2",typescript:"^5.9.3"}};await Mr.writeFile(ue.join(y,"package.json"),JSON.stringify(o,null,2),"utf8")};var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},We={exports:{}};/**
48
+ `;await Mr.writeFile(ue.join(o,"application.config.ts"),S)},Kv=async({appName:a,appDirectory:y})=>{const o={name:a,version:"0.1.0",license:"MIT",engines:{node:"^24.5.0",npm:"please-use-yarn",yarn:">=4.0.2"},packageManager:"yarn@4.9.2",scripts:{"create-entity":"twenty app add",dev:"twenty app dev",generate:"twenty app generate",sync:"twenty app sync",logs:"twenty app logs",uninstall:"twenty app uninstall",help:"twenty help",auth:"twenty auth login"},dependencies:{"twenty-sdk":"0.2.2"},devDependencies:{"@types/node":"^24.7.2",typescript:"^5.9.3"}};await Mr.writeFile(ue.join(y,"package.json"),JSON.stringify(o,null,2),"utf8")};var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},We={exports:{}};/**
49
49
  * @license
50
50
  * Lodash <https://lodash.com/>
51
51
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -80,4 +80,4 @@ function print() { __p += __j.call(arguments, '') }
80
80
  `))):N=h.stylize("[Circular]","special")),X(z)){if(un&&V.match(/^\d+$/))return N;z=JSON.stringify(""+V),z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(z=z.slice(1,-1),z=h.stylize(z,"name")):(z=z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),z=h.stylize(z,"string"))}return z+": "+N}function pn(h,_,b){var q=h.reduce(function(V,un){return un.indexOf(`
81
81
  `)>=0,V+un.replace(/\u001b\[\d\d?m/g,"").length+1},0);return q>60?b[0]+(_===""?"":_+`
82
82
  `)+" "+h.join(`,
83
- `)+" "+b[1]:b[0]+_+" "+h.join(", ")+" "+b[1]}a.types=T_();function G(h){return Array.isArray(h)}a.isArray=G;function H(h){return typeof h=="boolean"}a.isBoolean=H;function nn(h){return h===null}a.isNull=nn;function M(h){return h==null}a.isNullOrUndefined=M;function an(h){return typeof h=="number"}a.isNumber=an;function Rn(h){return typeof h=="string"}a.isString=Rn;function Mn(h){return typeof h=="symbol"}a.isSymbol=Mn;function X(h){return h===void 0}a.isUndefined=X;function Gn(h){return Jn(h)&&En(h)==="[object RegExp]"}a.isRegExp=Gn,a.types.isRegExp=Gn;function Jn(h){return typeof h=="object"&&h!==null}a.isObject=Jn;function yr(h){return Jn(h)&&En(h)==="[object Date]"}a.isDate=yr,a.types.isDate=yr;function Hn(h){return Jn(h)&&(En(h)==="[object Error]"||h instanceof Error)}a.isError=Hn,a.types.isNativeError=Hn;function Cn(h){return typeof h=="function"}a.isFunction=Cn;function Yr(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h>"u"}a.isPrimitive=Yr,a.isBuffer=x_();function En(h){return Object.prototype.toString.call(h)}function Rr(h){return h<10?"0"+h.toString(10):h.toString(10)}var wr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(){var h=new Date,_=[Rr(h.getHours()),Rr(h.getMinutes()),Rr(h.getSeconds())].join(":");return[h.getDate(),wr[h.getMonth()],_].join(" ")}a.log=function(){console.log("%s - %s",kn(),a.format.apply(a,arguments))},a.inherits=C_(),a._extend=function(h,_){if(!_||!Jn(_))return h;for(var b=Object.keys(_),q=b.length;q--;)h[b[q]]=_[b[q]];return h};function bn(h,_){return Object.prototype.hasOwnProperty.call(h,_)}var qn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;a.promisify=function(_){if(typeof _!="function")throw new TypeError('The "original" argument must be of type Function');if(qn&&_[qn]){var b=_[qn];if(typeof b!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(b,qn,{value:b,enumerable:!1,writable:!1,configurable:!0}),b}function b(){for(var q,V,un=new Promise(function(D,rn){q=D,V=rn}),z=[],N=0;N<arguments.length;N++)z.push(arguments[N]);z.push(function(D,rn){D?V(D):q(rn)});try{_.apply(this,z)}catch(D){V(D)}return un}return Object.setPrototypeOf(b,Object.getPrototypeOf(_)),qn&&Object.defineProperty(b,qn,{value:b,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(b,y(_))},a.promisify.custom=qn;function Qn(h,_){if(!h){var b=new Error("Promise was rejected with a falsy value");b.reason=h,h=b}return _(h)}function Fn(h){if(typeof h!="function")throw new TypeError('The "original" argument must be of type Function');function _(){for(var b=[],q=0;q<arguments.length;q++)b.push(arguments[q]);var V=b.pop();if(typeof V!="function")throw new TypeError("The last argument must be of type Function");var un=this,z=function(){return V.apply(un,arguments)};h.apply(this,b).then(function(N){process.nextTick(z.bind(null,null,N))},function(N){process.nextTick(Qn.bind(null,N,z))})}return Object.setPrototypeOf(_,Object.getPrototypeOf(h)),Object.defineProperties(_,y(h)),_}a.callbackify=Fn}(ru)),ru}var Qs=B_();const kr=Qs.promisify(Gs.exec),F_=async a=>{try{return await kr("git rev-parse --is-inside-work-tree",{cwd:a}),!0}catch{}return!1},L_=async a=>{try{return await kr("hg --cwd . root",{cwd:a}),!0}catch{}return!1},D_=async a=>{try{return await kr("git config init.defaultBranch",{cwd:a}),!0}catch{}return!1},U_=async a=>{try{if(await kr("git --version",{cwd:a}),await F_(a)||await L_(a))return!1;await kr("git init",{cwd:a});try{return await D_(a)||await kr("git checkout -b main",{cwd:a}),await kr("git add -A",{cwd:a}),await kr('git commit -m "Initial commit from Create Twenty App"',{cwd:a}),!0}catch{return Mr.rm(ue.join(a,".git"),{recursive:!0,force:!0}),!1}}catch{return!1}},M_=Qs.promisify(Gs.exec),q_=async a=>{try{await M_("yarn",{cwd:a})}catch(y){console.error(Ur.default.red("yarn install failed:"),y.stdout)}},Ns=process.env.INIT_CWD||process.cwd();class N_{async execute(y){try{const{appName:o,appDisplayName:S,appDirectory:I,appDescription:F}=await this.getAppInfos(y);await this.validateDirectory(I),this.logCreationInfo({appDirectory:I,appName:o}),await Mr.ensureDir(I),await Gv({appName:o,appDisplayName:S,appDescription:F,appDirectory:I}),await q_(I),await U_(I),this.logSuccess(I)}catch(o){console.error(Ur.default.red("Initialization failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getAppInfos(y){const{name:o,displayName:S,description:I}=await Wv.default.prompt([{type:"input",name:"name",message:"Application name:",when:()=>!y,default:"my-awesome-app",validate:C=>C.length===0?"Application name is required":!0},{type:"input",name:"displayName",message:"Application display name:",default:C=>Zv(C?.name??y)},{type:"input",name:"description",message:"Application description (optional):",default:""}]),R=(o??y).trim(),P=S.trim(),O=I.trim(),L=y?Ma.join(Ns,y):Ma.join(Ns,$v.default(R));return{appName:R,appDisplayName:P,appDirectory:L,appDescription:O}}async validateDirectory(y){if(!await Mr.pathExists(y))return;if((await Mr.readdir(y)).length>0)throw new Error(`Directory ${y} already exists and is not empty`)}logCreationInfo({appDirectory:y,appName:o}){console.log(Ur.default.blue("🎯 Creating Twenty Application")),console.log(Ur.default.gray(`📁 Directory: ${y}`)),console.log(Ur.default.gray(`📝 Name: ${o}`)),console.log("")}logSuccess(y){console.log(Ur.default.green("✅ Application created!")),console.log(""),console.log(Ur.default.blue("Next steps:")),console.log(`cd ${y.split("/").reverse()[0]??""}`),console.log("yarn auth")}}const W_="create-twenty-app",$_="0.2.0",Ws={name:W_,version:$_},nl=new $s.Command(Ws.name).description("CLI tool to initialize a new Twenty application").version(Ws.version,"-v, --version","Output the current version of create-twenty-app.").argument("[directory]").helpOption("-h, --help","Display this help message.").action(async a=>{a&&!/^[a-z0-9-]+$/.test(a)&&(console.error(Ur.default.red(`Invalid directory "${a}". Must contain only lowercase letters, numbers, and hyphens`)),process.exit(1)),await new N_().execute(a)});nl.exitOverride();try{nl.parse()}catch(a){a instanceof $s.CommanderError&&process.exit(a.exitCode),a instanceof Error&&(console.error(Ur.default.red("Error:"),a.message),process.exit(1))}
83
+ `)+" "+b[1]:b[0]+_+" "+h.join(", ")+" "+b[1]}a.types=T_();function G(h){return Array.isArray(h)}a.isArray=G;function H(h){return typeof h=="boolean"}a.isBoolean=H;function nn(h){return h===null}a.isNull=nn;function M(h){return h==null}a.isNullOrUndefined=M;function an(h){return typeof h=="number"}a.isNumber=an;function Rn(h){return typeof h=="string"}a.isString=Rn;function Mn(h){return typeof h=="symbol"}a.isSymbol=Mn;function X(h){return h===void 0}a.isUndefined=X;function Gn(h){return Jn(h)&&En(h)==="[object RegExp]"}a.isRegExp=Gn,a.types.isRegExp=Gn;function Jn(h){return typeof h=="object"&&h!==null}a.isObject=Jn;function yr(h){return Jn(h)&&En(h)==="[object Date]"}a.isDate=yr,a.types.isDate=yr;function Hn(h){return Jn(h)&&(En(h)==="[object Error]"||h instanceof Error)}a.isError=Hn,a.types.isNativeError=Hn;function Cn(h){return typeof h=="function"}a.isFunction=Cn;function Yr(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h>"u"}a.isPrimitive=Yr,a.isBuffer=x_();function En(h){return Object.prototype.toString.call(h)}function Rr(h){return h<10?"0"+h.toString(10):h.toString(10)}var wr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(){var h=new Date,_=[Rr(h.getHours()),Rr(h.getMinutes()),Rr(h.getSeconds())].join(":");return[h.getDate(),wr[h.getMonth()],_].join(" ")}a.log=function(){console.log("%s - %s",kn(),a.format.apply(a,arguments))},a.inherits=C_(),a._extend=function(h,_){if(!_||!Jn(_))return h;for(var b=Object.keys(_),q=b.length;q--;)h[b[q]]=_[b[q]];return h};function bn(h,_){return Object.prototype.hasOwnProperty.call(h,_)}var qn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;a.promisify=function(_){if(typeof _!="function")throw new TypeError('The "original" argument must be of type Function');if(qn&&_[qn]){var b=_[qn];if(typeof b!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(b,qn,{value:b,enumerable:!1,writable:!1,configurable:!0}),b}function b(){for(var q,V,un=new Promise(function(D,rn){q=D,V=rn}),z=[],N=0;N<arguments.length;N++)z.push(arguments[N]);z.push(function(D,rn){D?V(D):q(rn)});try{_.apply(this,z)}catch(D){V(D)}return un}return Object.setPrototypeOf(b,Object.getPrototypeOf(_)),qn&&Object.defineProperty(b,qn,{value:b,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(b,y(_))},a.promisify.custom=qn;function Qn(h,_){if(!h){var b=new Error("Promise was rejected with a falsy value");b.reason=h,h=b}return _(h)}function Fn(h){if(typeof h!="function")throw new TypeError('The "original" argument must be of type Function');function _(){for(var b=[],q=0;q<arguments.length;q++)b.push(arguments[q]);var V=b.pop();if(typeof V!="function")throw new TypeError("The last argument must be of type Function");var un=this,z=function(){return V.apply(un,arguments)};h.apply(this,b).then(function(N){process.nextTick(z.bind(null,null,N))},function(N){process.nextTick(Qn.bind(null,N,z))})}return Object.setPrototypeOf(_,Object.getPrototypeOf(h)),Object.defineProperties(_,y(h)),_}a.callbackify=Fn}(ru)),ru}var Qs=B_();const kr=Qs.promisify(Gs.exec),F_=async a=>{try{return await kr("git rev-parse --is-inside-work-tree",{cwd:a}),!0}catch{}return!1},L_=async a=>{try{return await kr("hg --cwd . root",{cwd:a}),!0}catch{}return!1},D_=async a=>{try{return await kr("git config init.defaultBranch",{cwd:a}),!0}catch{}return!1},U_=async a=>{try{if(await kr("git --version",{cwd:a}),await F_(a)||await L_(a))return!1;await kr("git init",{cwd:a});try{return await D_(a)||await kr("git checkout -b main",{cwd:a}),await kr("git add -A",{cwd:a}),await kr('git commit -m "Initial commit from Create Twenty App"',{cwd:a}),!0}catch{return Mr.rm(ue.join(a,".git"),{recursive:!0,force:!0}),!1}}catch{return!1}},M_=Qs.promisify(Gs.exec),q_=async a=>{try{await M_("yarn",{cwd:a})}catch(y){console.error(Ur.default.red("yarn install failed:"),y.stdout)}},Ns=process.env.INIT_CWD||process.cwd();class N_{async execute(y){try{const{appName:o,appDisplayName:S,appDirectory:I,appDescription:F}=await this.getAppInfos(y);await this.validateDirectory(I),this.logCreationInfo({appDirectory:I,appName:o}),await Mr.ensureDir(I),await Gv({appName:o,appDisplayName:S,appDescription:F,appDirectory:I}),await q_(I),await U_(I),this.logSuccess(I)}catch(o){console.error(Ur.default.red("Initialization failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getAppInfos(y){const{name:o,displayName:S,description:I}=await Wv.default.prompt([{type:"input",name:"name",message:"Application name:",when:()=>!y,default:"my-awesome-app",validate:C=>C.length===0?"Application name is required":!0},{type:"input",name:"displayName",message:"Application display name:",default:C=>Zv(C?.name??y)},{type:"input",name:"description",message:"Application description (optional):",default:""}]),R=(o??y).trim(),P=S.trim(),O=I.trim(),L=y?Ma.join(Ns,y):Ma.join(Ns,$v.default(R));return{appName:R,appDisplayName:P,appDirectory:L,appDescription:O}}async validateDirectory(y){if(!await Mr.pathExists(y))return;if((await Mr.readdir(y)).length>0)throw new Error(`Directory ${y} already exists and is not empty`)}logCreationInfo({appDirectory:y,appName:o}){console.log(Ur.default.blue("🎯 Creating Twenty Application")),console.log(Ur.default.gray(`📁 Directory: ${y}`)),console.log(Ur.default.gray(`📝 Name: ${o}`)),console.log("")}logSuccess(y){console.log(Ur.default.green("✅ Application created!")),console.log(""),console.log(Ur.default.blue("Next steps:")),console.log(`cd ${y.split("/").reverse()[0]??""}`),console.log("yarn auth")}}const W_="create-twenty-app",$_="0.2.2",Ws={name:W_,version:$_},nl=new $s.Command(Ws.name).description("CLI tool to initialize a new Twenty application").version(Ws.version,"-v, --version","Output the current version of create-twenty-app.").argument("[directory]").helpOption("-h, --help","Display this help message.").action(async a=>{a&&!/^[a-z0-9-]+$/.test(a)&&(console.error(Ur.default.red(`Invalid directory "${a}". Must contain only lowercase letters, numbers, and hyphens`)),process.exit(1)),await new N_().execute(a)});nl.exitOverride();try{nl.parse()}catch(a){a instanceof $s.CommanderError&&process.exit(a.exitCode),a instanceof Error&&(console.error(Ur.default.red("Error:"),a.message),process.exit(1))}
package/dist/cli.mjs CHANGED
@@ -101,7 +101,7 @@ export default config;
101
101
  auth: "twenty auth login"
102
102
  },
103
103
  dependencies: {
104
- "twenty-sdk": "0.2.0"
104
+ "twenty-sdk": "0.2.2"
105
105
  },
106
106
  devDependencies: {
107
107
  "@types/node": "^24.7.2",
@@ -5401,7 +5401,7 @@ class L_ {
5401
5401
  console.log(Ur.green("✅ Application created!")), console.log(""), console.log(Ur.blue("Next steps:")), console.log(`cd ${d.split("/").reverse()[0] ?? ""}`), console.log("yarn auth");
5402
5402
  }
5403
5403
  }
5404
- const D_ = "create-twenty-app", U_ = "0.2.0", Ns = {
5404
+ const D_ = "create-twenty-app", U_ = "0.2.2", Ns = {
5405
5405
  name: D_,
5406
5406
  version: U_
5407
5407
  }, Xs = new Bv(Ns.name).description("CLI tool to initialize a new Twenty application").version(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-twenty-app",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Command-line interface to create Twenty application",
5
5
  "main": "dist/cli.cjs",
6
6
  "bin": "dist/cli.cjs",