create-twenty-app 2.0.0 → 2.1.0-canary.1
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/.oxlintrc.json +19 -1
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const wI=require("chalk"),Ov=require("commander"),SI=require("fs-extra"),Ut=require("path"),kI=require("uuid"),II=require("node:child_process"),EI=require("node:os"),xv=require("util"),Nv=require("child_process"),OI=require("inquirer"),xI=require("lodash.kebabcase"),Vu=require("twenty-sdk/cli");require("lodash.camelcase");const gf=e=>e&&e.__esModule?e:{default:e};function Pv(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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Pe=gf(wI),He=Pv(SI),gm=Pv(Ut),Xu=gf(OI),NI=gf(xI),PI="create-twenty-app",AI="2.0.
|
|
2
|
+
"use strict";const wI=require("chalk"),Ov=require("commander"),SI=require("fs-extra"),Ut=require("path"),kI=require("uuid"),II=require("node:child_process"),EI=require("node:os"),xv=require("util"),Nv=require("child_process"),OI=require("inquirer"),xI=require("lodash.kebabcase"),Vu=require("twenty-sdk/cli");require("lodash.camelcase");const gf=e=>e&&e.__esModule?e:{default:e};function Pv(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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Pe=gf(wI),He=Pv(SI),gm=Pv(Ut),Xu=gf(OI),NI=gf(xI),PI="create-twenty-app",AI="2.1.0-canary.1",Ls={name:PI,version:AI},TI="src",vm=async({appName:e,appDisplayName:t,appDescription:r,appDirectory:o})=>{console.log(Pe.default.gray("Generating application project...")),await He.copy(Ut.join(__dirname,"./constants/template"),o),await CI({appDirectory:o}),await MI({appDirectory:o}),await DI({appDisplayName:t,appDescription:r,appDirectory:o}),await zI({appName:e,appDirectory:o})},CI=async({appDirectory:e})=>{const t=[{from:"gitignore",to:".gitignore"},{from:"github",to:".github"}];for(const{from:r,to:o}of t){const n=Ut.join(e,r);await He.pathExists(n)&&await He.rename(n,Ut.join(e,o))}},MI=async({appDirectory:e})=>{await He.ensureDir(Ut.join(e,"public"))},DI=async({appDisplayName:e,appDescription:t,appDirectory:r})=>{const o=Ut.join(r,TI,"constants","universal-identifiers.ts"),n=await He.readFile(o,"utf-8");await He.writeFile(o,n.replace("DISPLAY-NAME-TO-BE-GENERATED",e).replace("DESCRIPTION-TO-BE-GENERATED",t).replace(/UUID-TO-BE-GENERATED/g,()=>kI.v4()))},zI=async({appName:e,appDirectory:t})=>{const r=await He.readJson(Ut.join(t,"package.json"));r.name=e,r.dependencies["twenty-sdk"]=Ls.version,r.dependencies["twenty-client-sdk"]=Ls.version,await He.writeFile(Ut.join(t,"package.json"),JSON.stringify(r,null,2),"utf8")},ma="twentyhq",ga="twenty",Av="main",ac="packages/twenty-apps/examples",RI=`https://github.com/${ma}/${ga}/tree/${Av}/${ac}`,UI=async()=>{const e=await fetch(`https://api.github.com/repos/${ma}/${ga}/releases/latest`,{headers:{Accept:"application/vnd.github.v3+json"}});return e.ok?(await e.json()).tag_name:Av},Tv=async(e,t)=>{const r=`https://api.github.com/repos/${ma}/${ga}/contents/${e}?ref=${t}`,o=await fetch(r,{headers:{Accept:"application/vnd.github.v3+json"}});if(!o.ok)return null;const n=await o.json();return Array.isArray(n)?n:null},LI=async e=>{const t=await Tv(ac,e);return t?t.filter(r=>r.type==="dir").map(r=>r.name):[]},jI=async(e,t)=>{const r=`${ac}/${e}`;if(await Tv(r,t)!==null)return;const n=await LI(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 Vu from "inquirer";
|
|
|
13
13
|
import Ik from "lodash.kebabcase";
|
|
14
14
|
import { serverStart as kk, detectLocalServer as Ek, authLoginOAuth as Ok, ConfigService as xk } from "twenty-sdk/cli";
|
|
15
15
|
import "lodash.camelcase";
|
|
16
|
-
const Nk = "create-twenty-app", Pk = "2.0.
|
|
16
|
+
const Nk = "create-twenty-app", Pk = "2.1.0-canary.1", Us = {
|
|
17
17
|
name: Nk,
|
|
18
18
|
version: Pk
|
|
19
19
|
}, Ak = "src", mm = async ({
|
|
@@ -15,5 +15,23 @@
|
|
|
15
15
|
}
|
|
16
16
|
],
|
|
17
17
|
"typescript/no-explicit-any": "off"
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"overrides": [
|
|
20
|
+
{
|
|
21
|
+
"files": ["**/*.logic-function.ts", "**/logic-functions/**/*.ts"],
|
|
22
|
+
"rules": {
|
|
23
|
+
"no-restricted-imports": [
|
|
24
|
+
"error",
|
|
25
|
+
{
|
|
26
|
+
"patterns": [
|
|
27
|
+
{
|
|
28
|
+
"group": ["twenty-shared", "twenty-shared/*"],
|
|
29
|
+
"message": "Logic functions must not import from twenty-shared directly. Import runtime types and helpers from `twenty-sdk/logic-function` instead so the logic-function bundle stays minimal."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
19
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-twenty-app",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-canary.1",
|
|
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.0.
|
|
39
|
+
"twenty-sdk": "2.1.0-canary.1",
|
|
40
40
|
"uuid": "^13.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|