create-twenty-app 2.3.1 → 2.4.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 CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const _9=require("chalk"),Sh=require("commander"),y9=require("fs-extra"),Qe=require("path"),wh=require("uuid"),b9=require("node:child_process"),S9=require("node:os"),kh=require("util"),Ih=require("child_process"),w9=require("inquirer"),k9=require("lodash.kebabcase"),fr=require("twenty-sdk/cli");require("lodash.camelcase");const ws=e=>e&&e.__esModule?e:{default:e};function xh(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,u.get?u:{enumerable:!0,get:()=>e[i]})}}return n.default=e,Object.freeze(n)}const ae=ws(_9),Ue=xh(y9),Jf=xh(Qe),Un=ws(w9),I9=ws(k9),x9="create-twenty-app",O9="2.3.1",Ko={name:x9,version:O9},E9="src",Vf=async({appName:e,appDisplayName:n,appDescription:i,appDirectory:u,onProgress:t})=>{t?.("Copying base template"),await Ue.copy(Qe.join(__dirname,"./constants/template"),u),t?.("Configuring dotfiles (.gitignore, .github)"),await A9({appDirectory:u}),t?.("Mirroring AGENTS.md to CLAUDE.md"),await N9({appDirectory:u}),await P9({appDirectory:u}),t?.("Generating unique application identifiers"),await T9({appDisplayName:n,appDescription:i,appDirectory:u}),t?.("Updating package.json"),await C9({appName:e,appDirectory:u})},A9=async({appDirectory:e})=>{const n=[{from:"gitignore",to:".gitignore"},{from:"github",to:".github"}];for(const{from:i,to:u}of n){const t=Qe.join(e,i);await Ue.pathExists(t)&&await Ue.rename(t,Qe.join(e,u))}},N9=async({appDirectory:e})=>{await Ue.copy(Qe.join(e,"AGENTS.md"),Qe.join(e,"CLAUDE.md"))},P9=async({appDirectory:e})=>{await Ue.ensureDir(Qe.join(e,"public"))},T9=async({appDisplayName:e,appDescription:n,appDirectory:i})=>{const u=Qe.join(i,E9,"constants","universal-identifiers.ts"),t=await Ue.readFile(u,"utf-8");await Ue.writeFile(u,t.replace("DISPLAY-NAME-TO-BE-GENERATED",e).replace("DESCRIPTION-TO-BE-GENERATED",n).replace(/UUID-TO-BE-GENERATED/g,()=>wh.v4()))},C9=async({appName:e,appDirectory:n})=>{const i=await Ue.readJson(Qe.join(n,"package.json"));i.name=e,i.dependencies["twenty-sdk"]=Ko.version,i.dependencies["twenty-client-sdk"]=Ko.version,await Ue.writeFile(Qe.join(n,"package.json"),JSON.stringify(i,null,2),"utf8")},ui="twentyhq",si="twenty",Oh="main",oa="packages/twenty-apps/examples",z9=`https://github.com/${ui}/${si}/tree/${Oh}/${oa}`,D9=async()=>{const e=await fetch(`https://api.github.com/repos/${ui}/${si}/releases/latest`,{headers:{Accept:"application/vnd.github.v3+json"}});return e.ok?(await e.json()).tag_name:Oh},Eh=async(e,n)=>{const i=`https://api.github.com/repos/${ui}/${si}/contents/${e}?ref=${n}`,u=await fetch(i,{headers:{Accept:"application/vnd.github.v3+json"}});if(!u.ok)return null;const t=await u.json();return Array.isArray(t)?t:null},U9=async e=>{const n=await Eh(oa,e);return n?n.filter(i=>i.type==="dir").map(i=>i.name):[]},R9=async(e,n)=>{const i=`${oa}/${e}`;if(await Eh(i,n)!==null)return;const t=await U9(n);throw new Error(`Example "${e}" not found.
2
+ "use strict";const _9=require("chalk"),Sh=require("commander"),y9=require("fs-extra"),Qe=require("path"),wh=require("uuid"),b9=require("node:child_process"),S9=require("node:os"),kh=require("util"),Ih=require("child_process"),w9=require("inquirer"),k9=require("lodash.kebabcase"),fr=require("twenty-sdk/cli");require("lodash.camelcase");const ws=e=>e&&e.__esModule?e:{default:e};function xh(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,u.get?u:{enumerable:!0,get:()=>e[i]})}}return n.default=e,Object.freeze(n)}const ae=ws(_9),Ue=xh(y9),Jf=xh(Qe),Un=ws(w9),I9=ws(k9),x9="create-twenty-app",O9="2.4.0",Ko={name:x9,version:O9},E9="src",Vf=async({appName:e,appDisplayName:n,appDescription:i,appDirectory:u,onProgress:t})=>{t?.("Copying base template"),await Ue.copy(Qe.join(__dirname,"./constants/template"),u),t?.("Configuring dotfiles (.gitignore, .github)"),await A9({appDirectory:u}),t?.("Mirroring AGENTS.md to CLAUDE.md"),await N9({appDirectory:u}),await P9({appDirectory:u}),t?.("Generating unique application identifiers"),await T9({appDisplayName:n,appDescription:i,appDirectory:u}),t?.("Updating package.json"),await C9({appName:e,appDirectory:u})},A9=async({appDirectory:e})=>{const n=[{from:"gitignore",to:".gitignore"},{from:"github",to:".github"}];for(const{from:i,to:u}of n){const t=Qe.join(e,i);await Ue.pathExists(t)&&await Ue.rename(t,Qe.join(e,u))}},N9=async({appDirectory:e})=>{await Ue.copy(Qe.join(e,"AGENTS.md"),Qe.join(e,"CLAUDE.md"))},P9=async({appDirectory:e})=>{await Ue.ensureDir(Qe.join(e,"public"))},T9=async({appDisplayName:e,appDescription:n,appDirectory:i})=>{const u=Qe.join(i,E9,"constants","universal-identifiers.ts"),t=await Ue.readFile(u,"utf-8");await Ue.writeFile(u,t.replace("DISPLAY-NAME-TO-BE-GENERATED",e).replace("DESCRIPTION-TO-BE-GENERATED",n).replace(/UUID-TO-BE-GENERATED/g,()=>wh.v4()))},C9=async({appName:e,appDirectory:n})=>{const i=await Ue.readJson(Qe.join(n,"package.json"));i.name=e,i.dependencies["twenty-sdk"]=Ko.version,i.dependencies["twenty-client-sdk"]=Ko.version,await Ue.writeFile(Qe.join(n,"package.json"),JSON.stringify(i,null,2),"utf8")},ui="twentyhq",si="twenty",Oh="main",oa="packages/twenty-apps/examples",z9=`https://github.com/${ui}/${si}/tree/${Oh}/${oa}`,D9=async()=>{const e=await fetch(`https://api.github.com/repos/${ui}/${si}/releases/latest`,{headers:{Accept:"application/vnd.github.v3+json"}});return e.ok?(await e.json()).tag_name:Oh},Eh=async(e,n)=>{const i=`https://api.github.com/repos/${ui}/${si}/contents/${e}?ref=${n}`,u=await fetch(i,{headers:{Accept:"application/vnd.github.v3+json"}});if(!u.ok)return null;const t=await u.json();return Array.isArray(t)?t:null},U9=async e=>{const n=await Eh(oa,e);return n?n.filter(i=>i.type==="dir").map(i=>i.name):[]},R9=async(e,n)=>{const i=`${oa}/${e}`;if(await Eh(i,n)!==null)return;const t=await U9(n);throw new Error(`Example "${e}" not found.
3
3
 
4
4
  `+(t.length>0?`Available examples:
5
5
  ${t.map(a=>` - ${a}`).join(`
package/dist/cli.mjs CHANGED
@@ -13,7 +13,7 @@ import Un from "inquirer";
13
13
  import y9 from "lodash.kebabcase";
14
14
  import { detectLocalServer as b9, serverStart as S9, checkDockerRunning as w9, containerExists as k9, authLoginOAuth as I9, ConfigService as x9 } from "twenty-sdk/cli";
15
15
  import "lodash.camelcase";
16
- const O9 = "create-twenty-app", E9 = "2.3.1", qo = {
16
+ const O9 = "create-twenty-app", E9 = "2.4.0", qo = {
17
17
  name: O9,
18
18
  version: E9
19
19
  }, A9 = "src", Kf = async ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-twenty-app",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Command-line interface to create Twenty application",
5
5
  "main": "dist/cli.cjs",
6
6
  "bin": "dist/cli.cjs",
@@ -36,7 +36,7 @@
36
36
  "lodash.camelcase": "^4.3.0",
37
37
  "lodash.kebabcase": "^4.1.1",
38
38
  "lodash.startcase": "^4.4.0",
39
- "twenty-sdk": "2.3.1",
39
+ "twenty-sdk": "2.4.0",
40
40
  "uuid": "^13.0.0"
41
41
  },
42
42
  "devDependencies": {