create-twenty-app 0.3.0-alpha → 0.3.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.cjs +2 -2
- package/dist/cli.mjs +2 -2
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -59,7 +59,7 @@ export default defineApp({
|
|
|
59
59
|
description: '${y??""}',
|
|
60
60
|
functionRoleUniversalIdentifier: DEFAULT_FUNCTION_ROLE_UNIVERSAL_IDENTIFIER,
|
|
61
61
|
});
|
|
62
|
-
`;await wr.writeFile(qr.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",lint:"eslint","lint-fix":"eslint --fix"},dependencies:{"twenty-sdk":"0.3.0
|
|
62
|
+
`;await wr.writeFile(qr.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",lint:"eslint","lint-fix":"eslint --fix"},dependencies:{"twenty-sdk":"0.3.0"},devDependencies:{typescript:"^5.9.3","@types/node":"^24.7.2",eslint:"^9.32.0","typescript-eslint":"^8.50.0"}};await wr.writeFile(qr.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:{}};/**
|
|
63
63
|
* @license
|
|
64
64
|
* Lodash <https://lodash.com/>
|
|
65
65
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -94,4 +94,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
94
94
|
`))):N=h.stylize("[Circular]","special")),X(j)){if(un&&V.match(/^\d+$/))return N;j=JSON.stringify(""+V),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=h.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=h.stylize(j,"string"))}return j+": "+N}function pn(h,_,b){var q=h.reduce(function(V,un){return un.indexOf(`
|
|
95
95
|
`)>=0,V+un.replace(/\u001b\[\d\d?m/g,"").length+1},0);return q>60?b[0]+(_===""?"":_+`
|
|
96
96
|
`)+" "+h.join(`,
|
|
97
|
-
`)+" "+b[1]:b[0]+_+" "+h.join(", ")+" "+b[1]}a.types=C_();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 Zr(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h>"u"}a.isPrimitive=Zr,a.isBuffer=F_();function En(h){return Object.prototype.toString.call(h)}function Er(h){return h<10?"0"+h.toString(10):h.toString(10)}var mr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(){var h=new Date,_=[Er(h.getHours()),Er(h.getMinutes()),Er(h.getSeconds())].join(":");return[h.getDate(),mr[h.getMonth()],_].join(" ")}a.log=function(){console.log("%s - %s",kn(),a.format.apply(a,arguments))},a.inherits=B_(),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}),j=[],N=0;N<arguments.length;N++)j.push(arguments[N]);j.push(function(D,rn){D?V(D):q(rn)});try{_.apply(this,j)}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 Bn(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,j=function(){return V.apply(un,arguments)};h.apply(this,b).then(function(N){process.nextTick(j.bind(null,null,N))},function(N){process.nextTick(Qn.bind(null,N,j))})}return Object.setPrototypeOf(_,Object.getPrototypeOf(h)),Object.defineProperties(_,y(h)),_}a.callbackify=Bn}(ru)),ru}var nl=L_();const Yr=nl.promisify(Hs.exec),D_=async a=>{try{return await Yr("git rev-parse --is-inside-work-tree",{cwd:a}),!0}catch{}return!1},U_=async a=>{try{return await Yr("hg --cwd . root",{cwd:a}),!0}catch{}return!1},M_=async a=>{try{return await Yr("git config init.defaultBranch",{cwd:a}),!0}catch{}return!1},q_=async a=>{try{if(await Yr("git --version",{cwd:a}),await D_(a)||await U_(a))return!1;await Yr("git init",{cwd:a});try{return await M_(a)||await Yr("git checkout -b main",{cwd:a}),await Yr("git add -A",{cwd:a}),await Yr('git commit -m "Initial commit from Create Twenty App"',{cwd:a}),!0}catch{return wr.rm(qr.join(a,".git"),{recursive:!0,force:!0}),!1}}catch{return!1}},N_=nl.promisify(Hs.exec),W_=async a=>{try{await N_("yarn",{cwd:a})}catch(y){console.error(Mr.default.red("yarn install failed:"),y.stdout)}},Ns=process.env.INIT_CWD||process.cwd();class $_{async execute(y){try{const{appName:o,appDisplayName:S,appDirectory:R,appDescription:B}=await this.getAppInfos(y);await this.validateDirectory(R),this.logCreationInfo({appDirectory:R,appName:o}),await wr.ensureDir(R),await Hv({appName:o,appDisplayName:S,appDescription:B,appDirectory:R}),await W_(R),await q_(R),this.logSuccess(R)}catch(o){console.error(Mr.default.red("Initialization failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getAppInfos(y){const{name:o,displayName:S,description:R}=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=>Vv(C?.name??y)},{type:"input",name:"description",message:"Application description (optional):",default:""}]),E=(o??y).trim(),P=S.trim(),O=R.trim(),L=y?Ma.join(Ns,y):Ma.join(Ns,$v.default(E));return{appName:E,appDisplayName:P,appDirectory:L,appDescription:O}}async validateDirectory(y){if(!await wr.pathExists(y))return;if((await wr.readdir(y)).length>0)throw new Error(`Directory ${y} already exists and is not empty`)}logCreationInfo({appDirectory:y,appName:o}){console.log(Mr.default.blue("🎯 Creating Twenty Application")),console.log(Mr.default.gray(`📁 Directory: ${y}`)),console.log(Mr.default.gray(`📝 Name: ${o}`)),console.log("")}logSuccess(y){console.log(Mr.default.green("✅ Application created!")),console.log(""),console.log(Mr.default.blue("Next steps:")),console.log(`cd ${y.split("/").reverse()[0]??""}`),console.log("yarn auth")}}const G_="create-twenty-app",H_="0.3.0
|
|
97
|
+
`)+" "+b[1]:b[0]+_+" "+h.join(", ")+" "+b[1]}a.types=C_();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 Zr(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h>"u"}a.isPrimitive=Zr,a.isBuffer=F_();function En(h){return Object.prototype.toString.call(h)}function Er(h){return h<10?"0"+h.toString(10):h.toString(10)}var mr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(){var h=new Date,_=[Er(h.getHours()),Er(h.getMinutes()),Er(h.getSeconds())].join(":");return[h.getDate(),mr[h.getMonth()],_].join(" ")}a.log=function(){console.log("%s - %s",kn(),a.format.apply(a,arguments))},a.inherits=B_(),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}),j=[],N=0;N<arguments.length;N++)j.push(arguments[N]);j.push(function(D,rn){D?V(D):q(rn)});try{_.apply(this,j)}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 Bn(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,j=function(){return V.apply(un,arguments)};h.apply(this,b).then(function(N){process.nextTick(j.bind(null,null,N))},function(N){process.nextTick(Qn.bind(null,N,j))})}return Object.setPrototypeOf(_,Object.getPrototypeOf(h)),Object.defineProperties(_,y(h)),_}a.callbackify=Bn}(ru)),ru}var nl=L_();const Yr=nl.promisify(Hs.exec),D_=async a=>{try{return await Yr("git rev-parse --is-inside-work-tree",{cwd:a}),!0}catch{}return!1},U_=async a=>{try{return await Yr("hg --cwd . root",{cwd:a}),!0}catch{}return!1},M_=async a=>{try{return await Yr("git config init.defaultBranch",{cwd:a}),!0}catch{}return!1},q_=async a=>{try{if(await Yr("git --version",{cwd:a}),await D_(a)||await U_(a))return!1;await Yr("git init",{cwd:a});try{return await M_(a)||await Yr("git checkout -b main",{cwd:a}),await Yr("git add -A",{cwd:a}),await Yr('git commit -m "Initial commit from Create Twenty App"',{cwd:a}),!0}catch{return wr.rm(qr.join(a,".git"),{recursive:!0,force:!0}),!1}}catch{return!1}},N_=nl.promisify(Hs.exec),W_=async a=>{try{await N_("yarn",{cwd:a})}catch(y){console.error(Mr.default.red("yarn install failed:"),y.stdout)}},Ns=process.env.INIT_CWD||process.cwd();class $_{async execute(y){try{const{appName:o,appDisplayName:S,appDirectory:R,appDescription:B}=await this.getAppInfos(y);await this.validateDirectory(R),this.logCreationInfo({appDirectory:R,appName:o}),await wr.ensureDir(R),await Hv({appName:o,appDisplayName:S,appDescription:B,appDirectory:R}),await W_(R),await q_(R),this.logSuccess(R)}catch(o){console.error(Mr.default.red("Initialization failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getAppInfos(y){const{name:o,displayName:S,description:R}=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=>Vv(C?.name??y)},{type:"input",name:"description",message:"Application description (optional):",default:""}]),E=(o??y).trim(),P=S.trim(),O=R.trim(),L=y?Ma.join(Ns,y):Ma.join(Ns,$v.default(E));return{appName:E,appDisplayName:P,appDirectory:L,appDescription:O}}async validateDirectory(y){if(!await wr.pathExists(y))return;if((await wr.readdir(y)).length>0)throw new Error(`Directory ${y} already exists and is not empty`)}logCreationInfo({appDirectory:y,appName:o}){console.log(Mr.default.blue("🎯 Creating Twenty Application")),console.log(Mr.default.gray(`📁 Directory: ${y}`)),console.log(Mr.default.gray(`📝 Name: ${o}`)),console.log("")}logSuccess(y){console.log(Mr.default.green("✅ Application created!")),console.log(""),console.log(Mr.default.blue("Next steps:")),console.log(`cd ${y.split("/").reverse()[0]??""}`),console.log("yarn auth")}}const G_="create-twenty-app",H_="0.3.0",Ws={name:G_,version:H_},rl=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(Mr.default.red(`Invalid directory "${a}". Must contain only lowercase letters, numbers, and hyphens`)),process.exit(1)),await new $_().execute(a)});rl.exitOverride();try{rl.parse()}catch(a){a instanceof $s.CommanderError&&process.exit(a.exitCode),a instanceof Error&&(console.error(Mr.default.red("Error:"),a.message),process.exit(1))}
|
package/dist/cli.mjs
CHANGED
|
@@ -128,7 +128,7 @@ export default defineApp({
|
|
|
128
128
|
"lint-fix": "eslint --fix"
|
|
129
129
|
},
|
|
130
130
|
dependencies: {
|
|
131
|
-
"twenty-sdk": "0.3.0
|
|
131
|
+
"twenty-sdk": "0.3.0"
|
|
132
132
|
},
|
|
133
133
|
devDependencies: {
|
|
134
134
|
typescript: "^5.9.3",
|
|
@@ -5430,7 +5430,7 @@ class U_ {
|
|
|
5430
5430
|
console.log(Mr.green("✅ Application created!")), console.log(""), console.log(Mr.blue("Next steps:")), console.log(`cd ${y.split("/").reverse()[0] ?? ""}`), console.log("yarn auth");
|
|
5431
5431
|
}
|
|
5432
5432
|
}
|
|
5433
|
-
const M_ = "create-twenty-app", N_ = "0.3.0
|
|
5433
|
+
const M_ = "create-twenty-app", N_ = "0.3.0", qs = {
|
|
5434
5434
|
name: M_,
|
|
5435
5435
|
version: N_
|
|
5436
5436
|
}, Vs = new Bv(qs.name).description("CLI tool to initialize a new Twenty application").version(
|