create-twenty-app 0.9.0 → 1.22.0-canary.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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/constants/template/vitest.config.ts +1 -2
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const zA=require("chalk"),r_=require("commander"),UA=require("fs-extra"),Rn=require("path"),jA=require("uuid"),LA=require("node:child_process"),FA=require("node:os"),i_=require("util"),o_=require("child_process"),ZA=require("inquirer"),BA=require("lodash.kebabcase"),rc=require("twenty-sdk/cli");require("lodash.camelcase");const Th=e=>e&&e.__esModule?e:{default:e};function a_(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Xe=Th(zA),_t=a_(UA),zv=a_(Rn),ic=Th(ZA),WA=Th(BA),GA="create-twenty-app",qA="
|
|
2
|
+
"use strict";const zA=require("chalk"),r_=require("commander"),UA=require("fs-extra"),Rn=require("path"),jA=require("uuid"),LA=require("node:child_process"),FA=require("node:os"),i_=require("util"),o_=require("child_process"),ZA=require("inquirer"),BA=require("lodash.kebabcase"),rc=require("twenty-sdk/cli");require("lodash.camelcase");const Th=e=>e&&e.__esModule?e:{default:e};function a_(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Xe=Th(zA),_t=a_(UA),zv=a_(Rn),ic=Th(ZA),WA=Th(BA),GA="create-twenty-app",qA="1.22.0-canary.2",Hc={name:GA,version:qA},HA="src",Uv=async({appName:e,appDisplayName:t,appDescription:r,appDirectory:i})=>{console.log(Xe.default.gray("Generating application project...")),await _t.copy(Rn.join(__dirname,"./constants/template"),i),await KA({appDirectory:i}),await JA({appDisplayName:t,appDescription:r,appDirectory:i}),await VA({appName:e,appDirectory:i})},KA=async({appDirectory:e})=>{const t=[{from:"gitignore",to:".gitignore"},{from:"github",to:".github"}];for(const{from:r,to:i}of t){const n=Rn.join(e,r);await _t.pathExists(n)&&await _t.rename(n,Rn.join(e,i))}},JA=async({appDisplayName:e,appDescription:t,appDirectory:r})=>{const i=Rn.join(r,HA,"constants","universal-identifiers.ts"),n=await _t.readFile(i,"utf-8");await _t.writeFile(i,n.replace("DISPLAY-NAME-TO-BE-GENERATED",e).replace("DESCRIPTION-TO-BE-GENERATED",t).replace(/UUID-TO-BE-GENERATED/g,()=>jA.v4()))},VA=async({appName:e,appDirectory:t})=>{const r=await _t.readJson(Rn.join(t,"package.json"));r.name=e,r.dependencies["twenty-sdk"]=Hc.version,r.dependencies["twenty-client-sdk"]=Hc.version,await _t.writeFile(Rn.join(t,"package.json"),JSON.stringify(r,null,2),"utf8")},yu="twentyhq",_u="twenty",u_="main",hl="packages/twenty-apps/examples",YA=`https://github.com/${yu}/${_u}/tree/${u_}/${hl}`,XA=async()=>{const e=await fetch(`https://api.github.com/repos/${yu}/${_u}/releases/latest`,{headers:{Accept:"application/vnd.github.v3+json"}});return e.ok?(await e.json()).tag_name:u_},s_=async(e,t)=>{const r=`https://api.github.com/repos/${yu}/${_u}/contents/${e}?ref=${t}`,i=await fetch(r,{headers:{Accept:"application/vnd.github.v3+json"}});if(!i.ok)return null;const n=await i.json();return Array.isArray(n)?n:null},QA=async e=>{const t=await s_(hl,e);return t?t.filter(r=>r.type==="dir").map(r=>r.name):[]},eN=async(e,t)=>{const r=`${hl}/${e}`;if(await s_(r,t)!==null)return;const n=await QA(t);throw new Error(`Example "${e}" not found.
|
|
3
3
|
|
|
4
4
|
`+(n.length>0?`Available examples:
|
|
5
5
|
${n.map(a=>` - ${a}`).join(`
|
package/dist/cli.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import rc from "inquirer";
|
|
|
13
13
|
import jA from "lodash.kebabcase";
|
|
14
14
|
import { serverStart as LA, detectLocalServer as FA, authLoginOAuth as ZA, ConfigService as BA } from "twenty-sdk/cli";
|
|
15
15
|
import "lodash.camelcase";
|
|
16
|
-
const WA = "create-twenty-app", GA = "
|
|
16
|
+
const WA = "create-twenty-app", GA = "1.22.0-canary.2", Hc = {
|
|
17
17
|
name: WA,
|
|
18
18
|
version: GA
|
|
19
19
|
}, HA = "src", Dv = async ({
|
|
@@ -17,8 +17,7 @@ export default defineConfig({
|
|
|
17
17
|
TWENTY_API_URL: process.env.TWENTY_API_URL ?? 'http://localhost:2020',
|
|
18
18
|
TWENTY_API_KEY:
|
|
19
19
|
process.env.TWENTY_API_KEY ??
|
|
20
|
-
|
|
21
|
-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC05ZTNiLTQ2ZDQtYTU1Ni04OGI5ZGRjMmIwMzQiLCJ1c2VySWQiOiIyMDIwMjAyMC05ZTNiLTQ2ZDQtYTU1Ni04OGI5ZGRjMmIwMzQiLCJ3b3Jrc3BhY2VJZCI6IjIwMjAyMDIwLTFjMjUtNGQwMi1iZjI1LTZhZWNjZjdlYTQxOSIsIndvcmtzcGFjZU1lbWJlcklkIjoiMjAyMDIwMjAtMDY4Ny00YzQxLWI3MDctZWQxYmZjYTk3MmE3IiwidXNlcldvcmtzcGFjZUlkIjoiMjAyMDIwMjAtOWUzYi00NmQ0LWE1NTYtODhiOWRkYzJiMDM1IiwidHlwZSI6IkFDQ0VTUyIsImF1dGhQcm92aWRlciI6InBhc3N3b3JkIiwiaWF0IjoxNzUxMjgxNzA0LCJleHAiOjQ5MDQ4ODE3MDR9.9S4wc0MOr5iczsomlFxZdOHD1IRDS4dnRSwNVNpctF4',
|
|
20
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJ0eXBlIjoiQVBJX0tFWSIsIndvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjQ4OTE0NDk2MDAsImp0aSI6IjIwMjAyMDIwLWY0MDEtNGQ4YS1hNzMxLTY0ZDAwN2MyN2JhZCJ9.bfQjfyN0NEtTCLE_xPyNcwonDzlSXFoP8kdCQTdnuDc',
|
|
22
21
|
},
|
|
23
22
|
},
|
|
24
23
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-twenty-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.22.0-canary.2",
|
|
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": "
|
|
39
|
+
"twenty-sdk": "1.22.0-canary.2",
|
|
40
40
|
"uuid": "^13.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|