kofi-stack-template-generator 2.0.4 → 2.0.6
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/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-typecheck.log +4 -0
- package/dist/index.js +11 -11
- package/package.json +1 -1
- package/src/generator.ts +9 -10
- package/src/templates.generated.ts +3 -3
- package/templates/convex/package.json.hbs +1 -0
- package/templates/monorepo/package.json.hbs +5 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> kofi-stack-template-generator@2.0.
|
|
2
|
+
> kofi-stack-template-generator@2.0.6 build /Users/theodenanyoh/Documents/Krumalabs/create-kofi-stack-v2/packages/template-generator
|
|
3
3
|
> pnpm run prebuild && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> kofi-stack-template-generator@2.0.
|
|
6
|
+
> kofi-stack-template-generator@2.0.6 prebuild /Users/theodenanyoh/Documents/Krumalabs/create-kofi-stack-v2/packages/template-generator
|
|
7
7
|
> node scripts/generate-templates.js
|
|
8
8
|
|
|
9
9
|
Generating templates.generated.ts...
|
|
@@ -13,8 +13,8 @@ CLI Using tsconfig: tsconfig.json
|
|
|
13
13
|
CLI tsup v8.5.1
|
|
14
14
|
CLI Target: es2022
|
|
15
15
|
ESM Build start
|
|
16
|
-
ESM dist/index.js
|
|
17
|
-
ESM ⚡️ Build success in
|
|
16
|
+
ESM dist/index.js 40.04 KB
|
|
17
|
+
ESM ⚡️ Build success in 12ms
|
|
18
18
|
DTS Build start
|
|
19
|
-
DTS ⚡️ Build success in
|
|
19
|
+
DTS ⚡️ Build success in 428ms
|
|
20
20
|
DTS dist/index.d.ts 2.96 KB
|
package/dist/index.js
CHANGED
|
@@ -263,6 +263,7 @@ var EMBEDDED_TEMPLATES = {
|
|
|
263
263
|
},
|
|
264
264
|
"scripts": {
|
|
265
265
|
"dev": "convex dev",
|
|
266
|
+
"dev:setup": "convex dev --configure --until-success",
|
|
266
267
|
"deploy": "convex deploy"
|
|
267
268
|
},
|
|
268
269
|
"dependencies": {
|
|
@@ -291,7 +292,7 @@ var EMBEDDED_TEMPLATES = {
|
|
|
291
292
|
}{{/if}}
|
|
292
293
|
`,
|
|
293
294
|
"integrations/posthog/src/components/providers/posthog-provider.tsx.hbs": "'use client'\n\nimport posthog from 'posthog-js'\nimport { PostHogProvider as PHProvider } from 'posthog-js/react'\nimport { useEffect } from 'react'\n\nexport function PostHogProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://app.posthog.com',\n person_profiles: 'identified_only',\n capture_pageview: false, // We capture pageviews manually\n })\n }, [])\n\n return <PHProvider client={posthog}>{children}</PHProvider>\n}\n",
|
|
294
|
-
"monorepo/package.json.hbs": '{\n "name": "{{projectName}}",\n "version": "0.1.0",\n "private": true,\n "scripts": {\n "dev": "node scripts/dev.mjs",\n "dev:turbo": "turbo dev",\n "build": "turbo build",\n "lint": "turbo lint",\n "lint:fix": "turbo lint:fix",\n "format": "turbo format",\n "typecheck": "turbo typecheck",\n "test": "turbo test",\n "test:e2e": "turbo test:e2e",\n "clean": "turbo clean && rm -rf node_modules",\n "prepare": "husky"
|
|
295
|
+
"monorepo/package.json.hbs": '{\n "name": "{{projectName}}",\n "version": "0.1.0",\n "private": true,\n "scripts": {\n "dev": "node scripts/dev.mjs",\n "dev:all": "turbo dev",\n "dev:web": "turbo -F @repo/web dev",\n "dev:backend": "turbo -F @repo/backend dev",\n "dev:setup": "turbo -F @repo/backend dev:setup",\n "build": "turbo build",\n "lint": "turbo lint",\n "lint:fix": "turbo lint:fix",\n "format": "turbo format",\n "typecheck": "turbo typecheck",\n "test": "turbo test",\n "test:e2e": "turbo test:e2e",\n "clean": "turbo clean && rm -rf node_modules",\n "prepare": "husky"\n },\n "devDependencies": {\n "turbo": "^2.0.0",\n "husky": "^9.0.0",\n "lint-staged": "^15.0.0"\n },\n "packageManager": "pnpm@9.0.0",\n "lint-staged": {\n "*.{js,ts,jsx,tsx}": ["biome check --apply"],\n "*.{json,md}": ["biome format --write"]\n }\n}\n',
|
|
295
296
|
"monorepo/pnpm-workspace.yaml.hbs": 'packages:\n - "apps/*"\n - "packages/*"\n',
|
|
296
297
|
"monorepo/turbo.json.hbs": '{\n "$schema": "https://turbo.build/schema.json",\n "ui": "tui",\n "tasks": {\n "build": {\n "dependsOn": ["^build"],\n "inputs": ["$TURBO_DEFAULT$", ".env*"],\n "outputs": [".next/**", "!.next/cache/**", "dist/**"]\n },\n "lint": {\n "dependsOn": ["^lint"],\n "inputs": ["$TURBO_DEFAULT$"]\n },\n "lint:fix": {\n "dependsOn": ["^lint:fix"],\n "inputs": ["$TURBO_DEFAULT$"]\n },\n "format": {\n "dependsOn": ["^format"],\n "inputs": ["$TURBO_DEFAULT$"]\n },\n "typecheck": {\n "dependsOn": ["^typecheck"],\n "inputs": ["$TURBO_DEFAULT$"]\n },\n "dev": {\n "cache": false,\n "persistent": true\n },\n "test": {\n "dependsOn": ["^build"],\n "inputs": ["$TURBO_DEFAULT$"]\n },\n "test:e2e": {\n "dependsOn": ["build"],\n "inputs": ["$TURBO_DEFAULT$"]\n },\n "clean": {\n "cache": false\n }\n }\n}\n',
|
|
297
298
|
"packages/config-biome/biome.json.hbs": '{\n "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",\n "extends": ["../../biome.json"]\n}\n',
|
|
@@ -617,30 +618,29 @@ function startDevServers() {
|
|
|
617
618
|
if (!localEnv.CONVEX_DEPLOYMENT) {
|
|
618
619
|
console.log('\u26A0\uFE0F Convex not configured. Run: pnpm dev:setup\\n')
|
|
619
620
|
console.log('Starting Next.js only...\\n')
|
|
620
|
-
spawn('pnpm', ['${isMonorepo ? "dev:
|
|
621
|
+
spawn('pnpm', ['${isMonorepo ? "dev:web" : "dev:next"}'], {
|
|
621
622
|
cwd: rootDir, stdio: 'inherit', shell: true
|
|
622
623
|
})
|
|
623
624
|
return
|
|
624
625
|
}
|
|
625
626
|
|
|
626
627
|
console.log('\u{1F680} Starting development servers...\\n')
|
|
627
|
-
|
|
628
|
-
const nextProcess = spawn('pnpm', ['${isMonorepo ? "dev:turbo" : "dev:next"}'], {
|
|
628
|
+
spawn('pnpm', ['${isMonorepo ? "dev:all" : "dev:next"}'], {
|
|
629
629
|
cwd: rootDir, stdio: 'inherit', shell: true
|
|
630
|
-
})
|
|
630
|
+
})${isMonorepo ? "" : `
|
|
631
631
|
|
|
632
632
|
const convexProcess = spawn('npx', ['convex', 'dev'], {
|
|
633
633
|
cwd: webAppDir, stdio: 'inherit', shell: true
|
|
634
634
|
})
|
|
635
635
|
|
|
636
|
-
|
|
637
|
-
nextProcess.kill()
|
|
636
|
+
process.on('SIGINT', () => {
|
|
638
637
|
convexProcess.kill()
|
|
639
638
|
process.exit(0)
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
639
|
+
})
|
|
640
|
+
process.on('SIGTERM', () => {
|
|
641
|
+
convexProcess.kill()
|
|
642
|
+
process.exit(0)
|
|
643
|
+
})`}
|
|
644
644
|
}
|
|
645
645
|
|
|
646
646
|
async function main() {
|
package/package.json
CHANGED
package/src/generator.ts
CHANGED
|
@@ -256,30 +256,29 @@ function startDevServers() {
|
|
|
256
256
|
if (!localEnv.CONVEX_DEPLOYMENT) {
|
|
257
257
|
console.log('⚠️ Convex not configured. Run: pnpm dev:setup\\n')
|
|
258
258
|
console.log('Starting Next.js only...\\n')
|
|
259
|
-
spawn('pnpm', ['${isMonorepo ? 'dev:
|
|
259
|
+
spawn('pnpm', ['${isMonorepo ? 'dev:web' : 'dev:next'}'], {
|
|
260
260
|
cwd: rootDir, stdio: 'inherit', shell: true
|
|
261
261
|
})
|
|
262
262
|
return
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
console.log('🚀 Starting development servers...\\n')
|
|
266
|
-
|
|
267
|
-
const nextProcess = spawn('pnpm', ['${isMonorepo ? 'dev:turbo' : 'dev:next'}'], {
|
|
266
|
+
spawn('pnpm', ['${isMonorepo ? 'dev:all' : 'dev:next'}'], {
|
|
268
267
|
cwd: rootDir, stdio: 'inherit', shell: true
|
|
269
|
-
})
|
|
268
|
+
})${isMonorepo ? '' : `
|
|
270
269
|
|
|
271
270
|
const convexProcess = spawn('npx', ['convex', 'dev'], {
|
|
272
271
|
cwd: webAppDir, stdio: 'inherit', shell: true
|
|
273
272
|
})
|
|
274
273
|
|
|
275
|
-
|
|
276
|
-
nextProcess.kill()
|
|
274
|
+
process.on('SIGINT', () => {
|
|
277
275
|
convexProcess.kill()
|
|
278
276
|
process.exit(0)
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
})
|
|
278
|
+
process.on('SIGTERM', () => {
|
|
279
|
+
convexProcess.kill()
|
|
280
|
+
process.exit(0)
|
|
281
|
+
})`}
|
|
283
282
|
}
|
|
284
283
|
|
|
285
284
|
async function main() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Auto-generated file. Do not edit manually.
|
|
2
2
|
// Run 'pnpm prebuild' to regenerate.
|
|
3
|
-
// Generated: 2026-01-13T22:
|
|
3
|
+
// Generated: 2026-01-13T22:44:11.613Z
|
|
4
4
|
// Template count: 34
|
|
5
5
|
|
|
6
6
|
export const EMBEDDED_TEMPLATES: Record<string, string> = {
|
|
@@ -11,10 +11,10 @@ export const EMBEDDED_TEMPLATES: Record<string, string> = {
|
|
|
11
11
|
"convex/convex/http.ts.hbs": "import { httpRouter } from 'convex/server'\nimport { auth } from './auth'\n\nconst http = httpRouter()\n\nauth.addHttpRoutes(http)\n\nexport default http\n",
|
|
12
12
|
"convex/convex/schema.ts.hbs": "import { defineSchema, defineTable } from 'convex/server'\nimport { authTables } from '@convex-dev/auth/server'\nimport { v } from 'convex/values'\n\nexport default defineSchema({\n ...authTables,\n // Add your custom tables here\n // Example:\n // posts: defineTable({\n // title: v.string(),\n // content: v.string(),\n // authorId: v.id('users'),\n // createdAt: v.number(),\n // }).index('by_author', ['authorId']),\n})\n",
|
|
13
13
|
"convex/convex/users.ts.hbs": "import { query } from './_generated/server'\nimport { auth } from './auth'\n\nexport const current = query({\n args: {},\n handler: async (ctx) => {\n const userId = await auth.getUserId(ctx)\n if (!userId) return null\n\n const user = await ctx.db.get(userId)\n return user\n },\n})\n",
|
|
14
|
-
"convex/package.json.hbs": "{{#if (eq structure 'monorepo')}}{\n \"name\": \"@repo/backend\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"main\": \"./convex/_generated/api.js\",\n \"types\": \"./convex/_generated/api.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./convex/_generated/api.js\",\n \"types\": \"./convex/_generated/api.d.ts\"\n }\n },\n \"scripts\": {\n \"dev\": \"convex dev\",\n \"deploy\": \"convex deploy\"\n },\n \"dependencies\": {\n \"convex\": \"^1.25.0\",\n \"@convex-dev/auth\": \"^0.0.90\",\n \"@auth/core\": \"^0.37.0\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.0.0\"\n }\n}{{/if}}\n",
|
|
14
|
+
"convex/package.json.hbs": "{{#if (eq structure 'monorepo')}}{\n \"name\": \"@repo/backend\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"main\": \"./convex/_generated/api.js\",\n \"types\": \"./convex/_generated/api.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./convex/_generated/api.js\",\n \"types\": \"./convex/_generated/api.d.ts\"\n }\n },\n \"scripts\": {\n \"dev\": \"convex dev\",\n \"dev:setup\": \"convex dev --configure --until-success\",\n \"deploy\": \"convex deploy\"\n },\n \"dependencies\": {\n \"convex\": \"^1.25.0\",\n \"@convex-dev/auth\": \"^0.0.90\",\n \"@auth/core\": \"^0.37.0\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.0.0\"\n }\n}{{/if}}\n",
|
|
15
15
|
"convex/tsconfig.json.hbs": "{{#if (eq structure 'monorepo')}}{\n \"compilerOptions\": {\n \"target\": \"ESNext\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true,\n \"noEmit\": true,\n \"outDir\": \"dist\"\n },\n \"include\": [\"convex/**/*.ts\"],\n \"exclude\": [\"node_modules\"]\n}{{/if}}\n",
|
|
16
16
|
"integrations/posthog/src/components/providers/posthog-provider.tsx.hbs": "'use client'\n\nimport posthog from 'posthog-js'\nimport { PostHogProvider as PHProvider } from 'posthog-js/react'\nimport { useEffect } from 'react'\n\nexport function PostHogProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://app.posthog.com',\n person_profiles: 'identified_only',\n capture_pageview: false, // We capture pageviews manually\n })\n }, [])\n\n return <PHProvider client={posthog}>{children}</PHProvider>\n}\n",
|
|
17
|
-
"monorepo/package.json.hbs": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"scripts\": {\n \"dev\": \"node scripts/dev.mjs\",\n \"dev:turbo\": \"turbo dev\",\n \"build\": \"turbo build\",\n \"lint\": \"turbo lint\",\n \"lint:fix\": \"turbo lint:fix\",\n \"format\": \"turbo format\",\n \"typecheck\": \"turbo typecheck\",\n \"test\": \"turbo test\",\n \"test:e2e\": \"turbo test:e2e\",\n \"clean\": \"turbo clean && rm -rf node_modules\",\n \"prepare\": \"husky\"
|
|
17
|
+
"monorepo/package.json.hbs": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"scripts\": {\n \"dev\": \"node scripts/dev.mjs\",\n \"dev:all\": \"turbo dev\",\n \"dev:web\": \"turbo -F @repo/web dev\",\n \"dev:backend\": \"turbo -F @repo/backend dev\",\n \"dev:setup\": \"turbo -F @repo/backend dev:setup\",\n \"build\": \"turbo build\",\n \"lint\": \"turbo lint\",\n \"lint:fix\": \"turbo lint:fix\",\n \"format\": \"turbo format\",\n \"typecheck\": \"turbo typecheck\",\n \"test\": \"turbo test\",\n \"test:e2e\": \"turbo test:e2e\",\n \"clean\": \"turbo clean && rm -rf node_modules\",\n \"prepare\": \"husky\"\n },\n \"devDependencies\": {\n \"turbo\": \"^2.0.0\",\n \"husky\": \"^9.0.0\",\n \"lint-staged\": \"^15.0.0\"\n },\n \"packageManager\": \"pnpm@9.0.0\",\n \"lint-staged\": {\n \"*.{js,ts,jsx,tsx}\": [\"biome check --apply\"],\n \"*.{json,md}\": [\"biome format --write\"]\n }\n}\n",
|
|
18
18
|
"monorepo/pnpm-workspace.yaml.hbs": "packages:\n - \"apps/*\"\n - \"packages/*\"\n",
|
|
19
19
|
"monorepo/turbo.json.hbs": "{\n \"$schema\": \"https://turbo.build/schema.json\",\n \"ui\": \"tui\",\n \"tasks\": {\n \"build\": {\n \"dependsOn\": [\"^build\"],\n \"inputs\": [\"$TURBO_DEFAULT$\", \".env*\"],\n \"outputs\": [\".next/**\", \"!.next/cache/**\", \"dist/**\"]\n },\n \"lint\": {\n \"dependsOn\": [\"^lint\"],\n \"inputs\": [\"$TURBO_DEFAULT$\"]\n },\n \"lint:fix\": {\n \"dependsOn\": [\"^lint:fix\"],\n \"inputs\": [\"$TURBO_DEFAULT$\"]\n },\n \"format\": {\n \"dependsOn\": [\"^format\"],\n \"inputs\": [\"$TURBO_DEFAULT$\"]\n },\n \"typecheck\": {\n \"dependsOn\": [\"^typecheck\"],\n \"inputs\": [\"$TURBO_DEFAULT$\"]\n },\n \"dev\": {\n \"cache\": false,\n \"persistent\": true\n },\n \"test\": {\n \"dependsOn\": [\"^build\"],\n \"inputs\": [\"$TURBO_DEFAULT$\"]\n },\n \"test:e2e\": {\n \"dependsOn\": [\"build\"],\n \"inputs\": [\"$TURBO_DEFAULT$\"]\n },\n \"clean\": {\n \"cache\": false\n }\n }\n}\n",
|
|
20
20
|
"packages/config-biome/biome.json.hbs": "{\n \"$schema\": \"https://biomejs.dev/schemas/1.9.4/schema.json\",\n \"extends\": [\"../../biome.json\"]\n}\n",
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "node scripts/dev.mjs",
|
|
7
|
-
"dev:
|
|
7
|
+
"dev:all": "turbo dev",
|
|
8
|
+
"dev:web": "turbo -F @repo/web dev",
|
|
9
|
+
"dev:backend": "turbo -F @repo/backend dev",
|
|
10
|
+
"dev:setup": "turbo -F @repo/backend dev:setup",
|
|
8
11
|
"build": "turbo build",
|
|
9
12
|
"lint": "turbo lint",
|
|
10
13
|
"lint:fix": "turbo lint:fix",
|
|
@@ -13,8 +16,7 @@
|
|
|
13
16
|
"test": "turbo test",
|
|
14
17
|
"test:e2e": "turbo test:e2e",
|
|
15
18
|
"clean": "turbo clean && rm -rf node_modules",
|
|
16
|
-
"prepare": "husky"
|
|
17
|
-
"setup:convex": "node apps/web/scripts/setup-convex.mjs"
|
|
19
|
+
"prepare": "husky"
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
|
20
22
|
"turbo": "^2.0.0",
|