create-lx2-app 0.11.3-beta.8a00b3e → 0.11.3
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/LICENSE.md +20 -0
- package/dist/index.js +1 -1
- package/package.json +98 -98
- package/template/base/package.json +3 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Lasse Lammers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import Ye from"path";import{execa as Rt}from"execa";import Qe from"fs-extra";imp
|
|
|
3
3
|
/ __| _ \\ __| /_\\_ _| __| | | __ __|_ ) /_\\ | _ \\ _ \\
|
|
4
4
|
| (__| / _| / _ \\| | | _| | |__\\ \\ / / / / _ \\| _/ _/
|
|
5
5
|
\\___|_|_\\___/_/ \\_\\_| |___| |____/_\\_\\/___| /_/ \\_\\_| |_|
|
|
6
|
-
`,O="my-lx2-app",J="create-lx2-app";var b=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":"npm":"npm"};import P from"path";import V from"fs-extra";var oe={"next-auth":"^5.0.0-beta.25","@auth/prisma-adapter":"^2.11.1","@auth/drizzle-adapter":"^1.11.1","better-auth":"^1.4.1","better-sqlite3":"^12.4.6","@types/better-sqlite3":"^7.6.13",prisma:"^7.0.0","@prisma/client":"^7.0.0","drizzle-orm":"^0.44.7","drizzle-kit":"^0.31.7","@libsql/client":"^0.15.15",mysql2:"^3.15.3",postgres:"^3.4.7","@t3-oss/env-nextjs":"^0.13.8",zod:"^4.1.13",prettier:"^3.6.2","prettier-plugin-tailwindcss":"^0.7.1","@ianvs/prettier-plugin-sort-imports":"^4.7.0",eslint:"^9.39.1","eslint-config-next":"^16.0.4","@eslint/eslintrc":"^3.3.1","@biomejs/biome":"^2.3.7",typescript:"^5.9.3","@types/node":"^24.
|
|
6
|
+
`,O="my-lx2-app",J="create-lx2-app";var b=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":"npm":"npm"};import P from"path";import V from"fs-extra";var oe={"next-auth":"^5.0.0-beta.25","@auth/prisma-adapter":"^2.11.1","@auth/drizzle-adapter":"^1.11.1","better-auth":"^1.4.1","better-sqlite3":"^12.4.6","@types/better-sqlite3":"^7.6.13",prisma:"^7.0.0","@prisma/client":"^7.0.0","drizzle-orm":"^0.44.7","drizzle-kit":"^0.31.7","@libsql/client":"^0.15.15",mysql2:"^3.15.3",postgres:"^3.4.7","@t3-oss/env-nextjs":"^0.13.8",zod:"^4.1.13",prettier:"^3.6.2","prettier-plugin-tailwindcss":"^0.7.1","@ianvs/prettier-plugin-sort-imports":"^4.7.0",eslint:"^9.39.1","eslint-config-next":"^16.0.4","@eslint/eslintrc":"^3.3.1","@biomejs/biome":"^2.3.7",typescript:"^5.9.3","@types/node":"^24.10.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3",payload:"^3.64.0","@payloadcms/next":"^3.64.0","@payloadcms/payload-cloud":"^3.64.0","@payloadcms/richtext-lexical":"^3.64.0","@payloadcms/db-vercel-postgres":"^3.64.0","@payloadcms/db-sqlite":"^3.64.0",graphql:"^16.12.0",sharp:"^0.34.5"};import re from"path";import le from"fs-extra";import ot from"sort-package-json";var u=e=>{let{dependencies:s,devMode:a,projectDir:i}=e,t=le.readJsonSync(re.join(i,"package.json"));s.forEach(o=>{let r=oe[o];a&&t.devDependencies?t.devDependencies[o]=r:t.dependencies&&(t.dependencies[o]=r)});let n=ot(t);le.writeJsonSync(re.join(i,"package.json"),n,{spaces:2})};var pe=({projectDir:e,packages:s})=>{let a=s?.prisma.inUse,i=s?.drizzle.inUse,t=["next-auth"];a&&t.push("@auth/prisma-adapter"),i&&t.push("@auth/drizzle-adapter"),u({projectDir:e,dependencies:t,devMode:!1});let n=P.join(c,"template/packages"),o="src/app/api/auth/[...nextauth]/route.ts",r=P.join(n,o),p=P.join(e,o),d=P.join(n,"src/server/auth/config",a?"authjs-with-prisma.ts":i?"authjs-with-drizzle.ts":"authjs.ts"),m=P.join(e,"src/server/auth/config.ts"),f=P.join(n,"src/server/auth/authjs.ts"),h=P.join(e,"src/server/auth/index.ts");V.copySync(r,p),V.copySync(d,m),V.copySync(f,h)};import x from"path";import R from"fs-extra";import rt from"path";import ce from"fs-extra";import{sortPackageJson as lt}from"sort-package-json";function v(e){let{scripts:s,projectDir:a}=e,i=rt.join(a,"package.json"),t=ce.readJSONSync(i);t.scripts={...t.scripts,...s};let n=lt(t);ce.writeJSONSync(i,n,{spaces:2})}var de=({projectDir:e,packages:s,databaseProvider:a})=>{let i=s?.prisma.inUse,t=s?.drizzle.inUse,n=["better-auth"],o=[];(!i||!t)&&n.push("better-sqlite3"),(!i||!t)&&o.push("@types/better-sqlite3"),u({projectDir:e,dependencies:n,devMode:!1}),u({projectDir:e,dependencies:o,devMode:!0});let r=x.join(c,"template/packages"),p=x.join(r,"src/app/api/auth/[...betterauth]/route.ts"),d=x.join(e,"src/app/api/auth/[...all]/route.ts"),m=x.join(r,"src/server/auth",i?"better-auth-with-prisma.ts":t?"better-auth-with-drizzle.ts":"better-auth.ts"),f=R.readFileSync(m,"utf-8");(i||t)&&a!=="sqlite"&&(f=f.replace('provider: "sqlite",',`provider: "${{mysql:"mysql",postgresql:t?"pg":"postgresql"}[a]}",`));let h=x.join(e,"src/server/auth/index.ts");R.mkdirSync(x.dirname(h),{recursive:!0}),R.writeFileSync(h,f);let y=x.join(r,"src/lib/auth/better-auth-client.ts"),T=x.join(e,"src/lib/auth/client.ts");v({projectDir:e,scripts:{"auth:generate":"npx @better-auth/cli@latest generate --config ./src/server/auth/index.ts --yes",...!i&&!t&&{"auth:migrate":"npx @better-auth/cli@latest migrate --config ./src/server/auth/index.ts --yes"}}}),R.copySync(p,d),R.copySync(y,T)};import H from"path";import pt from"fs-extra";var me=({projectDir:e})=>{u({projectDir:e,dependencies:["@biomejs/biome"],devMode:!0});let s=H.join(c,"template/packages"),a=H.join(s,"config/biome.jsonc"),i=H.join(e,"biome.jsonc");pt.copyFileSync(a,i),v({projectDir:e,scripts:{"lint:unsafe":"biome check --write --unsafe .","lint:write":"biome check --write .",lint:"biome check .",format:"biome format --write ."}})};import S from"path";import _ from"fs-extra";var fe=({projectDir:e,packages:s,scopedAppName:a,databaseProvider:i})=>{let t=s?.authjs.inUse,n=s?.betterAuth.inUse;u({projectDir:e,dependencies:["drizzle-kit"],devMode:!0}),u({projectDir:e,dependencies:["drizzle-orm",{sqlite:"@libsql/client",mysql:"mysql2",postgresql:"postgres"}[i]],devMode:!1});let o=S.join(c,"template/packages"),r=S.join(o,"config/drizzle",{sqlite:"with-sqlite",mysql:"with-mysql",postgresql:"with-postgresql"}[i]+".ts"),p=S.join(e,"drizzle.config.ts"),d=S.join(o,"src/server/db/schema-drizzle",t?`with-authjs-${i}.ts`:n?`with-better-auth-${i}.ts`:`base-${i}.ts`),m=S.join(e,"src/server/db/schema.ts"),f=_.readFileSync(d,"utf-8");f=f.replace("project1_${name}",`${a}_\${name}`);let h=_.readFileSync(r,"utf-8");h=h.replace("project1_*",`${a}_*`);let y=S.join(o,`src/server/db/index-drizzle/with-${i}.ts`),T=S.join(e,"src/server/db/index.ts");v({projectDir:e,scripts:{"db:generate":"drizzle-kit generate","db:migrate":"drizzle-kit migrate","db:push":"drizzle-kit push","db:studio":"drizzle-kit studio"}}),_.copySync(r,p),_.mkdirSync(S.dirname(m),{recursive:!0}),_.writeFileSync(m,f),_.writeFileSync(p,h),_.copySync(y,T)};import $ from"path";import K from"fs-extra";var ue=({projectDir:e,scopedAppName:s,packages:a,databaseProvider:i})=>{let t=a?.envVariables.inUse,n=a?.authjs.inUse,o=a?.betterAuth.inUse,r=a?.prisma.inUse,p=a?.drizzle.inUse,d=a?.payload.inUse,m=[];t&&(m.push("@t3-oss/env-nextjs"),m.push("zod")),u({projectDir:e,dependencies:m,devMode:!1});let f=r||p||d,h=ct(!!n,!!o,!!r,!!p,!!d,s,i),y="";if(f?n?y="with-authjs-db.js":o?y="with-better-auth-db.js":d?y="with-payload.js":y="with-db.js":n?y="with-authjs.js":o&&(y="with-better-auth.js"),y!==""){let tt=$.join(c,"template/packages/src/env",y),st=$.join(e,"src/env.ts");K.copyFileSync(tt,st)}let T=$.join(e,".env"),Xe=$.join(e,".env.example"),Ze=dt+h,W=Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString("base64"),et=h.replace('AUTH_SECRET=""',`AUTH_SECRET="${W}" # Generated by create-lx2-app`).replace('BETTER_AUTH_SECRET=""',`BETTER_AUTH_SECRET="${W}" # Generated by create-lx2-app`).replace('PAYLOAD_SECRET=""',`PAYLOAD_SECRET="${W}" # Generated by create-lx2-app`);K.writeFileSync(T,et,"utf-8"),K.writeFileSync(Xe,Ze,"utf-8")};function ct(e,s,a,i,t,n,o){let r=`
|
|
7
7
|
# When adding additional environment variables, the schema in "/src/env.ts"
|
|
8
8
|
# should be updated accordingly.
|
|
9
9
|
`.trim().concat(`
|
package/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
2
|
+
"name": "create-lx2-app",
|
|
3
|
+
"version": "0.11.3",
|
|
4
|
+
"description": "The Most Opinionated Way to Build Next.js Apps",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/slickyeet/create-lx2-app",
|
|
9
|
+
"directory": "cli"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"create-lx2-app",
|
|
13
|
+
"lx2-app",
|
|
14
|
+
"typescript",
|
|
15
|
+
"next.js",
|
|
16
|
+
"tailwind"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"exports": "./dist/index.js",
|
|
20
|
+
"bin": {
|
|
21
|
+
"create-lx2-app": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"template",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"package.json"
|
|
29
|
+
],
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@inquirer/prompts": "^8.0.1",
|
|
35
|
+
"chalk": "^5.6.2",
|
|
36
|
+
"commander": "^14.0.2",
|
|
37
|
+
"execa": "^9.6.0",
|
|
38
|
+
"fs-extra": "^11.3.2",
|
|
39
|
+
"gradient-string": "^3.0.0",
|
|
40
|
+
"ora": "^9.0.0",
|
|
41
|
+
"sort-package-json": "^3.4.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@auth/drizzle-adapter": "^1.11.1",
|
|
45
|
+
"@auth/prisma-adapter": "^2.11.1",
|
|
46
|
+
"@biomejs/biome": "^2.3.7",
|
|
47
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
48
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
49
|
+
"@libsql/client": "^0.15.15",
|
|
50
|
+
"@payloadcms/db-sqlite": "^3.64.0",
|
|
51
|
+
"@payloadcms/db-vercel-postgres": "^3.64.0",
|
|
52
|
+
"@payloadcms/next": "^3.64.0",
|
|
53
|
+
"@payloadcms/payload-cloud": "^3.64.0",
|
|
54
|
+
"@payloadcms/richtext-lexical": "^3.64.0",
|
|
55
|
+
"@prisma/client": "^7.0.0",
|
|
56
|
+
"@t3-oss/env-nextjs": "^0.13.8",
|
|
57
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
58
|
+
"@types/fs-extra": "^11.0.4",
|
|
59
|
+
"@types/node": "^24.10.2",
|
|
60
|
+
"@types/react": "^19.2.7",
|
|
61
|
+
"@types/react-dom": "^19.2.3",
|
|
62
|
+
"better-auth": "^1.4.1",
|
|
63
|
+
"better-sqlite3": "^12.4.6",
|
|
64
|
+
"drizzle-kit": "^0.31.7",
|
|
65
|
+
"drizzle-orm": "^0.44.7",
|
|
66
|
+
"eslint": "^9.39.1",
|
|
67
|
+
"eslint-config-next": "^16.0.4",
|
|
68
|
+
"graphql": "^16.12.0",
|
|
69
|
+
"mysql2": "^3.15.3",
|
|
70
|
+
"next": "^16.0.8",
|
|
71
|
+
"next-auth": "^5.0.0-beta.25",
|
|
72
|
+
"payload": "^3.64.0",
|
|
73
|
+
"postgres": "^3.4.7",
|
|
74
|
+
"prettier": "^3.6.2",
|
|
75
|
+
"prettier-plugin-tailwindcss": "^0.7.1",
|
|
76
|
+
"prisma": "^7.0.0",
|
|
77
|
+
"react": "^19.2.1",
|
|
78
|
+
"react-dom": "^19.2.1",
|
|
79
|
+
"sharp": "^0.34.5",
|
|
80
|
+
"tailwindcss": "^4.1.17",
|
|
81
|
+
"tsup": "^8.5.1",
|
|
82
|
+
"type-fest": "^5.2.0",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
84
|
+
"zod": "^4.1.13"
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"dev": "tsup --watch",
|
|
88
|
+
"build": "tsup",
|
|
89
|
+
"start": "node dist/index.js",
|
|
90
|
+
"format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write",
|
|
91
|
+
"format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --check",
|
|
92
|
+
"typecheck": "tsc",
|
|
93
|
+
"clean": "rm -rf dist .turbo node_modules",
|
|
94
|
+
"link": "pnpm run build && npm link",
|
|
95
|
+
"release": "changeset version",
|
|
96
|
+
"pub:beta": "pnpm run build && npm publish --tag beta",
|
|
97
|
+
"pub:release": "pnpm run build && npm publish"
|
|
98
|
+
}
|
|
99
|
+
}
|