create-twenty-app 2.4.2 → 2.5.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 v9=require("chalk"),_p=require("commander"),$9=require("fs-extra"),Qe=require("path"),yp=require("uuid"),ys=require("node:child_process"),_9=require("node:os"),bp=require("util"),Sp=require("child_process"),y9=require("lodash.kebabcase"),Ut=require("twenty-sdk/cli");require("lodash.camelcase");const wp=e=>e&&e.__esModule?e:{default:e};function kp(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 se=wp(v9),Ue=kp($9),Hf=kp(Qe),b9=wp(y9),S9="create-twenty-app",w9="2.4.2",qo={name:S9,version:w9},k9="src",qf=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 I9({appDirectory:u}),t?.("Mirroring AGENTS.md to CLAUDE.md"),await x9({appDirectory:u}),await O9({appDirectory:u}),t?.("Generating unique application identifiers"),await E9({appDisplayName:n,appDescription:i,appDirectory:u}),t?.("Updating package.json"),await A9({appName:e,appDirectory:u})},I9=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))}},x9=async({appDirectory:e})=>{await Ue.copy(Qe.join(e,"AGENTS.md"),Qe.join(e,"CLAUDE.md"))},O9=async({appDirectory:e})=>{await Ue.ensureDir(Qe.join(e,"public"))},E9=async({appDisplayName:e,appDescription:n,appDirectory:i})=>{const u=Qe.join(i,k9,"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,()=>yp.v4()))},A9=async({appName:e,appDirectory:n})=>{const i=await Ue.readJson(Qe.join(n,"package.json"));i.name=e,i.dependencies["twenty-sdk"]=qo.version,i.dependencies["twenty-client-sdk"]=qo.version,await Ue.writeFile(Qe.join(n,"package.json"),JSON.stringify(i,null,2),"utf8")},ai="twentyhq",ui="twenty",Ip="main",ra="packages/twenty-apps/examples",N9=`https://github.com/${ai}/${ui}/tree/${Ip}/${ra}`,P9=async()=>{const e=await fetch(`https://api.github.com/repos/${ai}/${ui}/releases/latest`,{headers:{Accept:"application/vnd.github.v3+json"}});return e.ok?(await e.json()).tag_name:Ip},xp=async(e,n)=>{const i=`https://api.github.com/repos/${ai}/${ui}/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},T9=async e=>{const n=await xp(ra,e);return n?n.filter(i=>i.type==="dir").map(i=>i.name):[]},C9=async(e,n)=>{const i=`${ra}/${e}`;if(await xp(i,n)!==null)return;const t=await T9(n);throw new Error(`Example "${e}" not found.
2
+ "use strict";const v9=require("chalk"),_p=require("commander"),$9=require("fs-extra"),Qe=require("path"),yp=require("uuid"),ys=require("node:child_process"),_9=require("node:os"),bp=require("util"),Sp=require("child_process"),y9=require("lodash.kebabcase"),Ut=require("twenty-sdk/cli");require("lodash.camelcase");const wp=e=>e&&e.__esModule?e:{default:e};function kp(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 se=wp(v9),Ue=kp($9),Hf=kp(Qe),b9=wp(y9),S9="create-twenty-app",w9="2.5.0",qo={name:S9,version:w9},k9="src",qf=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 I9({appDirectory:u}),t?.("Mirroring AGENTS.md to CLAUDE.md"),await x9({appDirectory:u}),await O9({appDirectory:u}),t?.("Generating unique application identifiers"),await E9({appDisplayName:n,appDescription:i,appDirectory:u}),t?.("Updating package.json"),await A9({appName:e,appDirectory:u})},I9=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))}},x9=async({appDirectory:e})=>{await Ue.copy(Qe.join(e,"AGENTS.md"),Qe.join(e,"CLAUDE.md"))},O9=async({appDirectory:e})=>{await Ue.ensureDir(Qe.join(e,"public"))},E9=async({appDisplayName:e,appDescription:n,appDirectory:i})=>{const u=Qe.join(i,k9,"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,()=>yp.v4()))},A9=async({appName:e,appDirectory:n})=>{const i=await Ue.readJson(Qe.join(n,"package.json"));i.name=e,i.dependencies["twenty-sdk"]=qo.version,i.dependencies["twenty-client-sdk"]=qo.version,await Ue.writeFile(Qe.join(n,"package.json"),JSON.stringify(i,null,2),"utf8")},ai="twentyhq",ui="twenty",Ip="main",ra="packages/twenty-apps/examples",N9=`https://github.com/${ai}/${ui}/tree/${Ip}/${ra}`,P9=async()=>{const e=await fetch(`https://api.github.com/repos/${ai}/${ui}/releases/latest`,{headers:{Accept:"application/vnd.github.v3+json"}});return e.ok?(await e.json()).tag_name:Ip},xp=async(e,n)=>{const i=`https://api.github.com/repos/${ai}/${ui}/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},T9=async e=>{const n=await xp(ra,e);return n?n.filter(i=>i.type==="dir").map(i=>i.name):[]},C9=async(e,n)=>{const i=`${ra}/${e}`;if(await xp(i,n)!==null)return;const t=await T9(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
@@ -12,7 +12,7 @@ import { exec as wp } from "child_process";
12
12
  import b9 from "lodash.kebabcase";
13
13
  import { DEV_API_URL as Hf, checkDockerRunning as qf, serverStart as S9, authLogin as w9, DEV_API_KEY as k9, ConfigService as qu, authLoginOAuth as I9 } from "twenty-sdk/cli";
14
14
  import "lodash.camelcase";
15
- const x9 = "create-twenty-app", O9 = "2.4.2", Ho = {
15
+ const x9 = "create-twenty-app", O9 = "2.5.0", Ho = {
16
16
  name: x9,
17
17
  version: O9
18
18
  }, E9 = "src", Kf = async ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-twenty-app",
3
- "version": "2.4.2",
3
+ "version": "2.5.0",
4
4
  "description": "Command-line interface to create Twenty application",
5
5
  "main": "dist/cli.cjs",
6
6
  "bin": "dist/cli.cjs",
@@ -35,7 +35,7 @@
35
35
  "lodash.camelcase": "^4.3.0",
36
36
  "lodash.kebabcase": "^4.1.1",
37
37
  "lodash.startcase": "^4.4.0",
38
- "twenty-sdk": "2.4.2",
38
+ "twenty-sdk": "2.5.0",
39
39
  "uuid": "^13.0.0"
40
40
  },
41
41
  "devDependencies": {