kofi-stack-template-generator 2.0.10 → 2.0.12

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.
Files changed (49) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/dist/index.js +273 -0
  3. package/package.json +1 -1
  4. package/src/templates.generated.ts +46 -2
  5. package/templates/marketing/nextjs/next.config.ts.hbs +7 -0
  6. package/templates/marketing/nextjs/package.json.hbs +29 -0
  7. package/templates/marketing/nextjs/postcss.config.mjs.hbs +5 -0
  8. package/templates/marketing/nextjs/src/app/globals.css.hbs +18 -0
  9. package/templates/marketing/nextjs/src/app/layout.tsx.hbs +32 -0
  10. package/templates/marketing/nextjs/src/app/page.tsx.hbs +127 -0
  11. package/templates/marketing/nextjs/tsconfig.json.hbs +23 -0
  12. package/templates/marketing/payload/_env.example.hbs +18 -0
  13. package/templates/marketing/payload/_env.local.hbs +18 -0
  14. package/templates/marketing/payload/next.config.ts.hbs +11 -0
  15. package/templates/marketing/payload/package.json.hbs +39 -0
  16. package/templates/marketing/payload/postcss.config.mjs.hbs +5 -0
  17. package/templates/marketing/payload/src/app/(frontend)/layout.tsx.hbs +7 -0
  18. package/templates/marketing/payload/src/app/(frontend)/page.tsx.hbs +83 -0
  19. package/templates/marketing/payload/src/app/(payload)/admin/[[...segments]]/not-found.tsx.hbs +17 -0
  20. package/templates/marketing/payload/src/app/(payload)/admin/[[...segments]]/page.tsx.hbs +17 -0
  21. package/templates/marketing/payload/src/app/(payload)/api/[...slug]/route.ts.hbs +9 -0
  22. package/templates/marketing/payload/src/app/(payload)/api/graphql/route.ts.hbs +5 -0
  23. package/templates/marketing/payload/src/app/(payload)/api/graphql-playground/route.ts.hbs +5 -0
  24. package/templates/marketing/payload/src/app/(payload)/custom.scss.hbs +1 -0
  25. package/templates/marketing/payload/src/app/(payload)/importMap.js.hbs +1 -0
  26. package/templates/marketing/payload/src/app/(payload)/layout.tsx.hbs +18 -0
  27. package/templates/marketing/payload/src/app/globals.css.hbs +11 -0
  28. package/templates/marketing/payload/src/app/layout.tsx.hbs +19 -0
  29. package/templates/marketing/payload/src/blocks/Benefits.ts.hbs +34 -0
  30. package/templates/marketing/payload/src/blocks/CTA.ts.hbs +39 -0
  31. package/templates/marketing/payload/src/blocks/Content.ts.hbs +9 -0
  32. package/templates/marketing/payload/src/blocks/FAQ.ts.hbs +18 -0
  33. package/templates/marketing/payload/src/blocks/Features.ts.hbs +32 -0
  34. package/templates/marketing/payload/src/blocks/Hero.ts.hbs +40 -0
  35. package/templates/marketing/payload/src/blocks/LogoBanner.ts.hbs +17 -0
  36. package/templates/marketing/payload/src/blocks/Pricing.ts.hbs +37 -0
  37. package/templates/marketing/payload/src/blocks/Testimonials.ts.hbs +21 -0
  38. package/templates/marketing/payload/src/blocks/index.ts.hbs +9 -0
  39. package/templates/marketing/payload/src/collections/Media.ts.hbs +44 -0
  40. package/templates/marketing/payload/src/collections/Pages.ts.hbs +66 -0
  41. package/templates/marketing/payload/src/collections/Posts.ts.hbs +65 -0
  42. package/templates/marketing/payload/src/collections/Users.ts.hbs +25 -0
  43. package/templates/marketing/payload/src/collections/index.ts.hbs +4 -0
  44. package/templates/marketing/payload/src/globals/Navigation.ts.hbs +51 -0
  45. package/templates/marketing/payload/src/globals/SiteSettings.ts.hbs +49 -0
  46. package/templates/marketing/payload/src/globals/index.ts.hbs +2 -0
  47. package/templates/marketing/payload/src/payload.config.ts.hbs +61 -0
  48. package/templates/marketing/payload/tsconfig.json.hbs +23 -0
  49. package/.turbo/turbo-typecheck.log +0 -4
@@ -0,0 +1,40 @@
1
+ import type { Block } from 'payload'
2
+
3
+ export const HeroBlock: Block = {
4
+ slug: 'hero',
5
+ labels: { singular: 'Hero', plural: 'Heroes' },
6
+ fields: [
7
+ {
8
+ name: 'heading',
9
+ type: 'text',
10
+ required: true,
11
+ },
12
+ {
13
+ name: 'subheading',
14
+ type: 'textarea',
15
+ },
16
+ {
17
+ name: 'image',
18
+ type: 'upload',
19
+ relationTo: 'media',
20
+ },
21
+ {
22
+ name: 'buttons',
23
+ type: 'array',
24
+ maxRows: 2,
25
+ fields: [
26
+ { name: 'label', type: 'text', required: true },
27
+ { name: 'url', type: 'text', required: true },
28
+ {
29
+ name: 'variant',
30
+ type: 'select',
31
+ options: [
32
+ { label: 'Primary', value: 'primary' },
33
+ { label: 'Secondary', value: 'secondary' },
34
+ ],
35
+ defaultValue: 'primary',
36
+ },
37
+ ],
38
+ },
39
+ ],
40
+ }
@@ -0,0 +1,17 @@
1
+ import type { Block } from 'payload'
2
+
3
+ export const LogoBannerBlock: Block = {
4
+ slug: 'logoBanner',
5
+ labels: { singular: 'Logo Banner', plural: 'Logo Banners' },
6
+ fields: [
7
+ { name: 'heading', type: 'text' },
8
+ {
9
+ name: 'logos',
10
+ type: 'array',
11
+ fields: [
12
+ { name: 'name', type: 'text', required: true },
13
+ { name: 'logo', type: 'upload', relationTo: 'media' },
14
+ ],
15
+ },
16
+ ],
17
+ }
@@ -0,0 +1,37 @@
1
+ import type { Block } from 'payload'
2
+
3
+ export const PricingBlock: Block = {
4
+ slug: 'pricing',
5
+ labels: { singular: 'Pricing', plural: 'Pricing' },
6
+ fields: [
7
+ { name: 'heading', type: 'text' },
8
+ { name: 'subheading', type: 'textarea' },
9
+ {
10
+ name: 'plans',
11
+ type: 'array',
12
+ fields: [
13
+ { name: 'name', type: 'text', required: true },
14
+ { name: 'price', type: 'text', required: true },
15
+ { name: 'period', type: 'text', defaultValue: '/month' },
16
+ { name: 'description', type: 'textarea' },
17
+ { name: 'featured', type: 'checkbox', defaultValue: false },
18
+ {
19
+ name: 'features',
20
+ type: 'array',
21
+ fields: [
22
+ { name: 'feature', type: 'text', required: true },
23
+ { name: 'included', type: 'checkbox', defaultValue: true },
24
+ ],
25
+ },
26
+ {
27
+ name: 'cta',
28
+ type: 'group',
29
+ fields: [
30
+ { name: 'label', type: 'text' },
31
+ { name: 'url', type: 'text' },
32
+ ],
33
+ },
34
+ ],
35
+ },
36
+ ],
37
+ }
@@ -0,0 +1,21 @@
1
+ import type { Block } from 'payload'
2
+
3
+ export const TestimonialsBlock: Block = {
4
+ slug: 'testimonials',
5
+ labels: { singular: 'Testimonials', plural: 'Testimonials' },
6
+ fields: [
7
+ { name: 'heading', type: 'text' },
8
+ { name: 'subheading', type: 'textarea' },
9
+ {
10
+ name: 'testimonials',
11
+ type: 'array',
12
+ fields: [
13
+ { name: 'quote', type: 'textarea', required: true },
14
+ { name: 'author', type: 'text', required: true },
15
+ { name: 'role', type: 'text' },
16
+ { name: 'company', type: 'text' },
17
+ { name: 'image', type: 'upload', relationTo: 'media' },
18
+ ],
19
+ },
20
+ ],
21
+ }
@@ -0,0 +1,9 @@
1
+ export { HeroBlock } from './Hero'
2
+ export { LogoBannerBlock } from './LogoBanner'
3
+ export { FeaturesBlock } from './Features'
4
+ export { BenefitsBlock } from './Benefits'
5
+ export { PricingBlock } from './Pricing'
6
+ export { TestimonialsBlock } from './Testimonials'
7
+ export { FAQBlock } from './FAQ'
8
+ export { ContentBlock } from './Content'
9
+ export { CTABlock } from './CTA'
@@ -0,0 +1,44 @@
1
+ import type { CollectionConfig } from 'payload'
2
+
3
+ export const Media: CollectionConfig = {
4
+ slug: 'media',
5
+ access: {
6
+ read: () => true,
7
+ },
8
+ upload: {
9
+ staticDir: 'media',
10
+ imageSizes: [
11
+ {
12
+ name: 'thumbnail',
13
+ width: 400,
14
+ height: 300,
15
+ position: 'centre',
16
+ },
17
+ {
18
+ name: 'card',
19
+ width: 768,
20
+ height: 432,
21
+ position: 'centre',
22
+ },
23
+ {
24
+ name: 'hero',
25
+ width: 1920,
26
+ height: 1080,
27
+ position: 'centre',
28
+ },
29
+ ],
30
+ adminThumbnail: 'thumbnail',
31
+ mimeTypes: ['image/*'],
32
+ },
33
+ fields: [
34
+ {
35
+ name: 'alt',
36
+ type: 'text',
37
+ required: true,
38
+ },
39
+ {
40
+ name: 'caption',
41
+ type: 'text',
42
+ },
43
+ ],
44
+ }
@@ -0,0 +1,66 @@
1
+ import type { CollectionConfig } from 'payload'
2
+ import {
3
+ HeroBlock,
4
+ LogoBannerBlock,
5
+ FeaturesBlock,
6
+ BenefitsBlock,
7
+ PricingBlock,
8
+ TestimonialsBlock,
9
+ FAQBlock,
10
+ ContentBlock,
11
+ CTABlock,
12
+ } from '../blocks'
13
+
14
+ export const Pages: CollectionConfig = {
15
+ slug: 'pages',
16
+ admin: {
17
+ useAsTitle: 'title',
18
+ defaultColumns: ['title', 'slug', 'status', 'updatedAt'],
19
+ },
20
+ access: {
21
+ read: () => true,
22
+ },
23
+ fields: [
24
+ {
25
+ name: 'title',
26
+ type: 'text',
27
+ required: true,
28
+ },
29
+ {
30
+ name: 'slug',
31
+ type: 'text',
32
+ required: true,
33
+ unique: true,
34
+ admin: {
35
+ position: 'sidebar',
36
+ },
37
+ },
38
+ {
39
+ name: 'status',
40
+ type: 'select',
41
+ options: [
42
+ { label: 'Draft', value: 'draft' },
43
+ { label: 'Published', value: 'published' },
44
+ ],
45
+ defaultValue: 'draft',
46
+ admin: {
47
+ position: 'sidebar',
48
+ },
49
+ },
50
+ {
51
+ name: 'layout',
52
+ type: 'blocks',
53
+ blocks: [
54
+ HeroBlock,
55
+ LogoBannerBlock,
56
+ FeaturesBlock,
57
+ BenefitsBlock,
58
+ PricingBlock,
59
+ TestimonialsBlock,
60
+ FAQBlock,
61
+ ContentBlock,
62
+ CTABlock,
63
+ ],
64
+ },
65
+ ],
66
+ }
@@ -0,0 +1,65 @@
1
+ import type { CollectionConfig } from 'payload'
2
+
3
+ export const Posts: CollectionConfig = {
4
+ slug: 'posts',
5
+ admin: {
6
+ useAsTitle: 'title',
7
+ defaultColumns: ['title', 'author', 'status', 'publishedAt'],
8
+ },
9
+ access: {
10
+ read: () => true,
11
+ },
12
+ fields: [
13
+ {
14
+ name: 'title',
15
+ type: 'text',
16
+ required: true,
17
+ },
18
+ {
19
+ name: 'slug',
20
+ type: 'text',
21
+ required: true,
22
+ unique: true,
23
+ },
24
+ {
25
+ name: 'excerpt',
26
+ type: 'textarea',
27
+ },
28
+ {
29
+ name: 'content',
30
+ type: 'richText',
31
+ },
32
+ {
33
+ name: 'featuredImage',
34
+ type: 'upload',
35
+ relationTo: 'media',
36
+ },
37
+ {
38
+ name: 'author',
39
+ type: 'relationship',
40
+ relationTo: 'users',
41
+ admin: {
42
+ position: 'sidebar',
43
+ },
44
+ },
45
+ {
46
+ name: 'status',
47
+ type: 'select',
48
+ options: [
49
+ { label: 'Draft', value: 'draft' },
50
+ { label: 'Published', value: 'published' },
51
+ ],
52
+ defaultValue: 'draft',
53
+ admin: {
54
+ position: 'sidebar',
55
+ },
56
+ },
57
+ {
58
+ name: 'publishedAt',
59
+ type: 'date',
60
+ admin: {
61
+ position: 'sidebar',
62
+ },
63
+ },
64
+ ],
65
+ }
@@ -0,0 +1,25 @@
1
+ import type { CollectionConfig } from 'payload'
2
+
3
+ export const Users: CollectionConfig = {
4
+ slug: 'users',
5
+ admin: {
6
+ useAsTitle: 'email',
7
+ },
8
+ auth: true,
9
+ fields: [
10
+ {
11
+ name: 'name',
12
+ type: 'text',
13
+ },
14
+ {
15
+ name: 'role',
16
+ type: 'select',
17
+ options: [
18
+ { label: 'Admin', value: 'admin' },
19
+ { label: 'Editor', value: 'editor' },
20
+ ],
21
+ defaultValue: 'editor',
22
+ required: true,
23
+ },
24
+ ],
25
+ }
@@ -0,0 +1,4 @@
1
+ export { Users } from './Users'
2
+ export { Media } from './Media'
3
+ export { Pages } from './Pages'
4
+ export { Posts } from './Posts'
@@ -0,0 +1,51 @@
1
+ import type { GlobalConfig } from 'payload'
2
+
3
+ export const Navigation: GlobalConfig = {
4
+ slug: 'navigation',
5
+ access: {
6
+ read: () => true,
7
+ },
8
+ fields: [
9
+ {
10
+ name: 'items',
11
+ type: 'array',
12
+ fields: [
13
+ {
14
+ name: 'label',
15
+ type: 'text',
16
+ required: true,
17
+ },
18
+ {
19
+ name: 'link',
20
+ type: 'group',
21
+ fields: [
22
+ {
23
+ name: 'type',
24
+ type: 'radio',
25
+ options: [
26
+ { label: 'Internal', value: 'internal' },
27
+ { label: 'External', value: 'external' },
28
+ ],
29
+ defaultValue: 'internal',
30
+ },
31
+ {
32
+ name: 'page',
33
+ type: 'relationship',
34
+ relationTo: 'pages',
35
+ admin: {
36
+ condition: (_, siblingData) => siblingData?.type === 'internal',
37
+ },
38
+ },
39
+ {
40
+ name: 'url',
41
+ type: 'text',
42
+ admin: {
43
+ condition: (_, siblingData) => siblingData?.type === 'external',
44
+ },
45
+ },
46
+ ],
47
+ },
48
+ ],
49
+ },
50
+ ],
51
+ }
@@ -0,0 +1,49 @@
1
+ import type { GlobalConfig } from 'payload'
2
+
3
+ export const SiteSettings: GlobalConfig = {
4
+ slug: 'site-settings',
5
+ access: {
6
+ read: () => true,
7
+ },
8
+ fields: [
9
+ {
10
+ name: 'siteName',
11
+ type: 'text',
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'siteDescription',
16
+ type: 'textarea',
17
+ },
18
+ {
19
+ name: 'logo',
20
+ type: 'upload',
21
+ relationTo: 'media',
22
+ },
23
+ {
24
+ name: 'favicon',
25
+ type: 'upload',
26
+ relationTo: 'media',
27
+ },
28
+ {
29
+ name: 'socialLinks',
30
+ type: 'array',
31
+ fields: [
32
+ {
33
+ name: 'platform',
34
+ type: 'select',
35
+ options: [
36
+ { label: 'Twitter', value: 'twitter' },
37
+ { label: 'GitHub', value: 'github' },
38
+ { label: 'LinkedIn', value: 'linkedin' },
39
+ { label: 'Discord', value: 'discord' },
40
+ ],
41
+ },
42
+ {
43
+ name: 'url',
44
+ type: 'text',
45
+ },
46
+ ],
47
+ },
48
+ ],
49
+ }
@@ -0,0 +1,2 @@
1
+ export { SiteSettings } from './SiteSettings'
2
+ export { Navigation } from './Navigation'
@@ -0,0 +1,61 @@
1
+ import path from 'path'
2
+ import { fileURLToPath } from 'url'
3
+ import { buildConfig } from 'payload'
4
+ import { postgresAdapter } from '@payloadcms/db-postgres'
5
+ import { lexicalEditor } from '@payloadcms/richtext-lexical'
6
+ import { s3Storage } from '@payloadcms/storage-s3'
7
+ import { seoPlugin } from '@payloadcms/plugin-seo'
8
+
9
+ import { Pages } from './collections/Pages'
10
+ import { Media } from './collections/Media'
11
+ import { Users } from './collections/Users'
12
+ import { Posts } from './collections/Posts'
13
+ import { SiteSettings } from './globals/SiteSettings'
14
+ import { Navigation } from './globals/Navigation'
15
+
16
+ const __filename = fileURLToPath(import.meta.url)
17
+ const __dirname = path.dirname(__filename)
18
+
19
+ export default buildConfig({
20
+ admin: {
21
+ user: Users.slug,
22
+ importMap: {
23
+ baseDir: path.resolve(__dirname),
24
+ },
25
+ },
26
+ db: postgresAdapter({
27
+ pool: {
28
+ connectionString: process.env.DATABASE_URL,
29
+ },
30
+ }),
31
+ editor: lexicalEditor(),
32
+ collections: [Users, Media, Pages, Posts],
33
+ globals: [SiteSettings, Navigation],
34
+ plugins: [
35
+ s3Storage({
36
+ collections: {
37
+ media: true,
38
+ },
39
+ bucket: process.env.S3_BUCKET!,
40
+ config: {
41
+ credentials: {
42
+ accessKeyId: process.env.S3_ACCESS_KEY_ID!,
43
+ secretAccessKey: process.env.S3_SECRET_ACCESS_KEY!,
44
+ },
45
+ region: process.env.S3_REGION!,
46
+ endpoint: process.env.S3_ENDPOINT!,
47
+ forcePathStyle: true,
48
+ },
49
+ }),
50
+ seoPlugin({
51
+ collections: ['pages', 'posts'],
52
+ uploadsCollection: 'media',
53
+ generateTitle: ({ doc }) => `${doc?.title ?? ''} | {{projectName}}`,
54
+ generateDescription: ({ doc }) => doc?.excerpt ?? '',
55
+ }),
56
+ ],
57
+ secret: process.env.PAYLOAD_SECRET!,
58
+ typescript: {
59
+ outputFile: path.resolve(__dirname, 'payload-types.ts'),
60
+ },
61
+ })
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [{ "name": "next" }],
17
+ "paths": {
18
+ "@/*": ["./src/*"]
19
+ }
20
+ },
21
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
22
+ "exclude": ["node_modules"]
23
+ }
@@ -1,4 +0,0 @@
1
-
2
- > kofi-stack-template-generator@2.0.5 typecheck /Users/theodenanyoh/Documents/Krumalabs/create-kofi-stack-v2/packages/template-generator
3
- > tsc --noEmit
4
-