create-kofi-stack 1.2.12 → 1.2.14
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/index.js +138 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1877,47 +1877,74 @@ export default defineSchema({
|
|
|
1877
1877
|
await writeFile(path6.join(convexDir, "schema.ts"), content);
|
|
1878
1878
|
}
|
|
1879
1879
|
async function generateAuthTs(config, convexDir) {
|
|
1880
|
-
let content = `import {
|
|
1880
|
+
let content = `import { createClient, type GenericCtx } from '@convex-dev/better-auth'
|
|
1881
|
+
import { convex } from '@convex-dev/better-auth/plugins'
|
|
1882
|
+
import { betterAuth } from 'better-auth'
|
|
1881
1883
|
import { components } from './_generated/api'
|
|
1882
1884
|
import type { DataModel } from './_generated/dataModel'
|
|
1885
|
+
import { query } from './_generated/server'
|
|
1886
|
+
import authConfig from './auth.config'
|
|
1883
1887
|
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1888
|
+
const siteUrl = process.env.SITE_URL || process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'
|
|
1889
|
+
|
|
1890
|
+
// The component client has methods for integrating Convex with Better Auth
|
|
1891
|
+
export const authComponent = createClient<DataModel>(components.betterAuth)
|
|
1892
|
+
|
|
1893
|
+
// Create the Better Auth instance with Convex adapter
|
|
1894
|
+
export const createAuth = (ctx: GenericCtx<DataModel>) => {
|
|
1895
|
+
return betterAuth({
|
|
1896
|
+
baseURL: siteUrl,
|
|
1897
|
+
database: authComponent.adapter(ctx),
|
|
1898
|
+
emailAndPassword: {
|
|
1899
|
+
enabled: true,
|
|
1900
|
+
requireEmailVerification: false,
|
|
1901
|
+
},
|
|
1902
|
+
socialProviders: {
|
|
1903
|
+
google: {
|
|
1904
|
+
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
1905
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
1906
|
+
},`;
|
|
1893
1907
|
for (const provider of config.auth.providers) {
|
|
1894
1908
|
const envPrefix = provider.toUpperCase();
|
|
1895
1909
|
content += `
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1910
|
+
${provider}: {
|
|
1911
|
+
clientId: process.env.${envPrefix}_CLIENT_ID!,
|
|
1912
|
+
clientSecret: process.env.${envPrefix}_CLIENT_SECRET!,
|
|
1913
|
+
},`;
|
|
1900
1914
|
}
|
|
1901
1915
|
content += `
|
|
1902
|
-
|
|
1916
|
+
},`;
|
|
1903
1917
|
if (config.auth.organizations) {
|
|
1904
1918
|
content += `
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1919
|
+
organization: {
|
|
1920
|
+
enabled: true,
|
|
1921
|
+
},`;
|
|
1908
1922
|
}
|
|
1909
1923
|
content += `
|
|
1924
|
+
plugins: [
|
|
1925
|
+
convex({ authConfig }),
|
|
1926
|
+
],
|
|
1927
|
+
})
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
// Get the current authenticated user
|
|
1931
|
+
export const getCurrentUser = query({
|
|
1932
|
+
args: {},
|
|
1933
|
+
handler: async (ctx) => {
|
|
1934
|
+
return authComponent.getAuthUser(ctx)
|
|
1935
|
+
},
|
|
1910
1936
|
})
|
|
1911
1937
|
`;
|
|
1912
1938
|
await writeFile(path6.join(convexDir, "auth.ts"), content);
|
|
1913
1939
|
}
|
|
1914
1940
|
async function generateHttp(convexDir) {
|
|
1915
1941
|
const content = `import { httpRouter } from 'convex/server'
|
|
1916
|
-
import {
|
|
1942
|
+
import { authComponent } from './auth'
|
|
1917
1943
|
|
|
1918
1944
|
const http = httpRouter()
|
|
1919
1945
|
|
|
1920
|
-
|
|
1946
|
+
// Add Better Auth HTTP routes
|
|
1947
|
+
authComponent.addHttpRoutes(http)
|
|
1921
1948
|
|
|
1922
1949
|
export default http
|
|
1923
1950
|
`;
|
|
@@ -1990,7 +2017,8 @@ async function generateConvexPackageJson(convexDir) {
|
|
|
1990
2017
|
types: "./convex/index.ts",
|
|
1991
2018
|
dependencies: {
|
|
1992
2019
|
convex: "^1.25.0",
|
|
1993
|
-
"@convex-dev/better-auth": "^0.10.10"
|
|
2020
|
+
"@convex-dev/better-auth": "^0.10.10",
|
|
2021
|
+
"better-auth": "^1.4.9"
|
|
1994
2022
|
},
|
|
1995
2023
|
devDependencies: {
|
|
1996
2024
|
typescript: "^5.0.0"
|
|
@@ -3172,14 +3200,26 @@ async function generateUIPackage(config, targetDir) {
|
|
|
3172
3200
|
};
|
|
3173
3201
|
await writeJSON(path14.join(uiDir, "package.json"), packageJson2);
|
|
3174
3202
|
const tsConfig = {
|
|
3175
|
-
extends: "@repo/config-typescript/base.json",
|
|
3176
3203
|
compilerOptions: {
|
|
3204
|
+
target: "ES2020",
|
|
3205
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
3206
|
+
allowJs: true,
|
|
3207
|
+
skipLibCheck: true,
|
|
3208
|
+
strict: true,
|
|
3209
|
+
noEmit: true,
|
|
3210
|
+
esModuleInterop: true,
|
|
3211
|
+
module: "esnext",
|
|
3212
|
+
moduleResolution: "bundler",
|
|
3213
|
+
resolveJsonModule: true,
|
|
3214
|
+
isolatedModules: true,
|
|
3177
3215
|
jsx: "react-jsx",
|
|
3216
|
+
incremental: true,
|
|
3178
3217
|
paths: {
|
|
3179
3218
|
"@/*": ["./src/*"]
|
|
3180
3219
|
}
|
|
3181
3220
|
},
|
|
3182
|
-
include: ["src/**/*"]
|
|
3221
|
+
include: ["src/**/*"],
|
|
3222
|
+
exclude: ["node_modules"]
|
|
3183
3223
|
};
|
|
3184
3224
|
await writeJSON(path14.join(uiDir, "tsconfig.json"), tsConfig);
|
|
3185
3225
|
const style = `${config.shadcn.componentLibrary}-${config.shadcn.styleVariant}`;
|
|
@@ -4171,8 +4211,21 @@ export default withPayload(nextConfig)
|
|
|
4171
4211
|
}
|
|
4172
4212
|
async function generatePayloadTsConfig(marketingDir) {
|
|
4173
4213
|
const tsConfig = {
|
|
4174
|
-
extends: "@repo/config-typescript/nextjs.json",
|
|
4175
4214
|
compilerOptions: {
|
|
4215
|
+
target: "ES2017",
|
|
4216
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
4217
|
+
allowJs: true,
|
|
4218
|
+
skipLibCheck: true,
|
|
4219
|
+
strict: true,
|
|
4220
|
+
noEmit: true,
|
|
4221
|
+
esModuleInterop: true,
|
|
4222
|
+
module: "esnext",
|
|
4223
|
+
moduleResolution: "bundler",
|
|
4224
|
+
resolveJsonModule: true,
|
|
4225
|
+
isolatedModules: true,
|
|
4226
|
+
jsx: "preserve",
|
|
4227
|
+
incremental: true,
|
|
4228
|
+
plugins: [{ name: "next" }],
|
|
4176
4229
|
paths: {
|
|
4177
4230
|
"@/*": ["./src/*"]
|
|
4178
4231
|
}
|
|
@@ -4272,10 +4325,24 @@ export default withMDX(config)
|
|
|
4272
4325
|
}
|
|
4273
4326
|
async function generateFumadocsTsConfig(docsDir) {
|
|
4274
4327
|
const tsConfig = {
|
|
4275
|
-
extends: "@repo/config-typescript/nextjs.json",
|
|
4276
4328
|
compilerOptions: {
|
|
4329
|
+
target: "ES2020",
|
|
4330
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
4331
|
+
allowJs: true,
|
|
4332
|
+
skipLibCheck: true,
|
|
4333
|
+
strict: true,
|
|
4334
|
+
noEmit: true,
|
|
4335
|
+
esModuleInterop: true,
|
|
4336
|
+
module: "esnext",
|
|
4337
|
+
moduleResolution: "bundler",
|
|
4338
|
+
resolveJsonModule: true,
|
|
4339
|
+
isolatedModules: true,
|
|
4340
|
+
jsx: "preserve",
|
|
4341
|
+
incremental: true,
|
|
4342
|
+
plugins: [{ name: "next" }],
|
|
4277
4343
|
paths: {
|
|
4278
|
-
"@/*": ["./src/*"]
|
|
4344
|
+
"@/*": ["./src/*"],
|
|
4345
|
+
"@/.source": ["./.source/index.ts"]
|
|
4279
4346
|
}
|
|
4280
4347
|
},
|
|
4281
4348
|
include: [
|
|
@@ -4291,12 +4358,13 @@ async function generateFumadocsTsConfig(docsDir) {
|
|
|
4291
4358
|
await writeJSON(path16.join(docsDir, "tsconfig.json"), tsConfig);
|
|
4292
4359
|
}
|
|
4293
4360
|
async function generateFumadocsSource(docsDir) {
|
|
4294
|
-
const content = `import { docs } from '
|
|
4361
|
+
const content = `import { docs, meta } from '@/.source'
|
|
4295
4362
|
import { loader } from 'fumadocs-core/source'
|
|
4363
|
+
import { createMDXSource } from 'fumadocs-mdx'
|
|
4296
4364
|
|
|
4297
4365
|
export const source = loader({
|
|
4298
4366
|
baseUrl: '/docs',
|
|
4299
|
-
source: docs
|
|
4367
|
+
source: createMDXSource(docs, meta),
|
|
4300
4368
|
})
|
|
4301
4369
|
`;
|
|
4302
4370
|
await writeFile(path16.join(docsDir, "src/lib/source.ts"), content);
|
|
@@ -4419,7 +4487,7 @@ export default function HomePage() {
|
|
|
4419
4487
|
await writeFile(path16.join(docsDir, "src/app/global.css"), globalCssContent);
|
|
4420
4488
|
const sourceConfigContent = `import { defineDocs, defineConfig } from 'fumadocs-mdx/config'
|
|
4421
4489
|
|
|
4422
|
-
export const docs = defineDocs({
|
|
4490
|
+
export const { docs, meta } = defineDocs({
|
|
4423
4491
|
dir: 'content/docs',
|
|
4424
4492
|
})
|
|
4425
4493
|
|
|
@@ -4837,9 +4905,21 @@ async function generatePackageJson2(config, appDir) {
|
|
|
4837
4905
|
}
|
|
4838
4906
|
async function generateTsConfig2(appDir) {
|
|
4839
4907
|
const tsConfig = {
|
|
4840
|
-
extends: "@repo/config-typescript/nextjs.json",
|
|
4841
4908
|
compilerOptions: {
|
|
4909
|
+
target: "ES2017",
|
|
4910
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
4911
|
+
allowJs: true,
|
|
4912
|
+
skipLibCheck: true,
|
|
4913
|
+
strict: true,
|
|
4914
|
+
noEmit: true,
|
|
4915
|
+
esModuleInterop: true,
|
|
4916
|
+
module: "esnext",
|
|
4917
|
+
moduleResolution: "bundler",
|
|
4918
|
+
resolveJsonModule: true,
|
|
4919
|
+
isolatedModules: true,
|
|
4842
4920
|
jsx: "preserve",
|
|
4921
|
+
incremental: true,
|
|
4922
|
+
plugins: [{ name: "next" }],
|
|
4843
4923
|
paths: {
|
|
4844
4924
|
"@/*": ["./src/*"],
|
|
4845
4925
|
"@repo/ui": ["../../packages/ui/src"],
|
|
@@ -7023,8 +7103,21 @@ async function generateHuskyHooks(targetDir) {
|
|
|
7023
7103
|
}
|
|
7024
7104
|
async function updateWebTsConfig(webDir) {
|
|
7025
7105
|
const tsConfig = {
|
|
7026
|
-
extends: "@repo/config-typescript/nextjs.json",
|
|
7027
7106
|
compilerOptions: {
|
|
7107
|
+
target: "ES2017",
|
|
7108
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
7109
|
+
allowJs: true,
|
|
7110
|
+
skipLibCheck: true,
|
|
7111
|
+
strict: true,
|
|
7112
|
+
noEmit: true,
|
|
7113
|
+
esModuleInterop: true,
|
|
7114
|
+
module: "esnext",
|
|
7115
|
+
moduleResolution: "bundler",
|
|
7116
|
+
resolveJsonModule: true,
|
|
7117
|
+
isolatedModules: true,
|
|
7118
|
+
jsx: "preserve",
|
|
7119
|
+
incremental: true,
|
|
7120
|
+
plugins: [{ name: "next" }],
|
|
7028
7121
|
paths: {
|
|
7029
7122
|
"@/*": ["./src/*"]
|
|
7030
7123
|
}
|
|
@@ -7134,8 +7227,21 @@ export default function RootLayout({
|
|
|
7134
7227
|
globalsCss
|
|
7135
7228
|
);
|
|
7136
7229
|
const tsConfig = {
|
|
7137
|
-
extends: "@repo/config-typescript/nextjs.json",
|
|
7138
7230
|
compilerOptions: {
|
|
7231
|
+
target: "ES2017",
|
|
7232
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
7233
|
+
allowJs: true,
|
|
7234
|
+
skipLibCheck: true,
|
|
7235
|
+
strict: true,
|
|
7236
|
+
noEmit: true,
|
|
7237
|
+
esModuleInterop: true,
|
|
7238
|
+
module: "esnext",
|
|
7239
|
+
moduleResolution: "bundler",
|
|
7240
|
+
resolveJsonModule: true,
|
|
7241
|
+
isolatedModules: true,
|
|
7242
|
+
jsx: "preserve",
|
|
7243
|
+
incremental: true,
|
|
7244
|
+
plugins: [{ name: "next" }],
|
|
7139
7245
|
paths: {
|
|
7140
7246
|
"@/*": ["./src/*"]
|
|
7141
7247
|
}
|