@pro-laico/create-atomic-payload 0.1.4
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/bin/cli.js +159 -0
- package/package.json +29 -0
- package/template/.env.example +35 -0
- package/template/.gitattributes +2 -0
- package/template/.prettierrc.json +6 -0
- package/template/.vscode/extensions.json +3 -0
- package/template/.vscode/launch.json +24 -0
- package/template/.vscode/settings.json +86 -0
- package/template/.yarnrc +1 -0
- package/template/LICENSE.md +22 -0
- package/template/README.md +128 -0
- package/template/eslint.config.mjs +32 -0
- package/template/next-env.d.ts +6 -0
- package/template/next.config.ts +36 -0
- package/template/package.json +75 -0
- package/template/public/adminFavicon.svg +1 -0
- package/template/public/ogImage.webp +0 -0
- package/template/src/access/anyone.ts +3 -0
- package/template/src/access/authenticated.ts +7 -0
- package/template/src/access/authenticatedOrPublished.ts +6 -0
- package/template/src/app/(frontend)/[...slug]/page.tsx +48 -0
- package/template/src/app/(frontend)/layout.tsx +49 -0
- package/template/src/app/(frontend)/next/exit-preview/route.ts +7 -0
- package/template/src/app/(frontend)/next/preview/route.ts +45 -0
- package/template/src/app/(frontend)/next/seed/route.ts +31 -0
- package/template/src/app/(frontend)/not-found.tsx +93 -0
- package/template/src/app/(frontend)/page.tsx +5 -0
- package/template/src/app/(frontend)/sitemap.ts +14 -0
- package/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +24 -0
- package/template/src/app/(payload)/admin/[[...segments]]/page.tsx +24 -0
- package/template/src/app/(payload)/admin/importMap.js +85 -0
- package/template/src/app/(payload)/api/[...slug]/route.ts +19 -0
- package/template/src/app/(payload)/custom.scss +29 -0
- package/template/src/app/(payload)/layout.tsx +31 -0
- package/template/src/blocks/actions/blocks.ts +27 -0
- package/template/src/blocks/actions/cookieConsent/set/block.ts +17 -0
- package/template/src/blocks/actions/cookieConsent/set/filter.ts +3 -0
- package/template/src/blocks/actions/cookieConsent/set/options.ts +35 -0
- package/template/src/blocks/actions/cookieConsent/toDA/block.ts +14 -0
- package/template/src/blocks/actions/cookieConsent/toDA/filter.ts +3 -0
- package/template/src/blocks/actions/cookieConsent/toDA/options.ts +19 -0
- package/template/src/blocks/actions/dynamicStore/boolean/set/block.ts +15 -0
- package/template/src/blocks/actions/dynamicStore/boolean/set/filter.ts +4 -0
- package/template/src/blocks/actions/dynamicStore/boolean/set/options.ts +18 -0
- package/template/src/blocks/actions/dynamicStore/boolean/toDA/block.ts +10 -0
- package/template/src/blocks/actions/dynamicStore/boolean/toDA/filter.ts +3 -0
- package/template/src/blocks/actions/dynamicStore/boolean/toDA/options.ts +12 -0
- package/template/src/blocks/actions/dynamicStore/text/cycle/block.ts +41 -0
- package/template/src/blocks/actions/dynamicStore/text/cycle/filter.ts +4 -0
- package/template/src/blocks/actions/dynamicStore/text/cycle/options.ts +23 -0
- package/template/src/blocks/actions/dynamicStore/text/toDA/block.ts +10 -0
- package/template/src/blocks/actions/dynamicStore/text/toDA/filter.ts +3 -0
- package/template/src/blocks/actions/dynamicStore/text/toDA/options.ts +12 -0
- package/template/src/blocks/actions/filters.ts +27 -0
- package/template/src/blocks/actions/form/errorToDA/block.ts +18 -0
- package/template/src/blocks/actions/form/errorToDA/filter.ts +3 -0
- package/template/src/blocks/actions/form/errorToDA/options.ts +15 -0
- package/template/src/blocks/actions/form/reset/block.ts +18 -0
- package/template/src/blocks/actions/form/reset/filter.ts +3 -0
- package/template/src/blocks/actions/form/reset/options.ts +30 -0
- package/template/src/blocks/actions/form/statusToDA/block.ts +12 -0
- package/template/src/blocks/actions/form/statusToDA/filter.ts +3 -0
- package/template/src/blocks/actions/form/statusToDA/options.ts +15 -0
- package/template/src/blocks/actions/form/submit/block.ts +18 -0
- package/template/src/blocks/actions/form/submit/filter.ts +3 -0
- package/template/src/blocks/actions/form/submit/options.ts +35 -0
- package/template/src/blocks/actions/portal/set/block.ts +25 -0
- package/template/src/blocks/actions/portal/set/filter.ts +3 -0
- package/template/src/blocks/actions/portal/set/options.ts +43 -0
- package/template/src/blocks/actions/processor.ts +263 -0
- package/template/src/blocks/actions/theme/set/block.ts +10 -0
- package/template/src/blocks/actions/theme/set/filter.ts +3 -0
- package/template/src/blocks/actions/theme/set/options.ts +9 -0
- package/template/src/blocks/actions/zap.ts +4 -0
- package/template/src/blocks/children/atomic/block.ts +123 -0
- package/template/src/blocks/children/atomic/controlBar.ts +43 -0
- package/template/src/blocks/children/atomic/variants/button/typeField.ts +16 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/component.client.tsx +21 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/component.tsx +13 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/controlBar.ts +73 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/settings.ts +26 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/controlBar.ts +35 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/dialog/component.tsx +36 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/dialog/settings.ts +24 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/popover/component.tsx +41 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/popover/settings.ts +111 -0
- package/template/src/blocks/children/atomic/variants/button/variants/regular/component.client.tsx +19 -0
- package/template/src/blocks/children/atomic/variants/button/variants/regular/component.tsx +11 -0
- package/template/src/blocks/children/atomic/variants/form/component.tsx +18 -0
- package/template/src/blocks/children/atomic/variants/form/controlBar.ts +22 -0
- package/template/src/blocks/children/atomic/variants/form/settings.ts +20 -0
- package/template/src/blocks/children/atomic/variants/input/autoCompleteOptions.ts +51 -0
- package/template/src/blocks/children/atomic/variants/input/controlBar.ts +13 -0
- package/template/src/blocks/children/atomic/variants/input/settings.ts +35 -0
- package/template/src/blocks/children/atomic/variants/input/typeField.ts +23 -0
- package/template/src/blocks/children/atomic/variants/input/variants/checkBox/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/checkBox/component.tsx +6 -0
- package/template/src/blocks/children/atomic/variants/input/variants/checkBox/settings.ts +9 -0
- package/template/src/blocks/children/atomic/variants/input/variants/number/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/number/component.tsx +6 -0
- package/template/src/blocks/children/atomic/variants/input/variants/number/settings.ts +9 -0
- package/template/src/blocks/children/atomic/variants/input/variants/radio/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/radio/component.tsx +6 -0
- package/template/src/blocks/children/atomic/variants/input/variants/radio/settings.ts +9 -0
- package/template/src/blocks/children/atomic/variants/input/variants/text/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/text/component.tsx +7 -0
- package/template/src/blocks/children/atomic/variants/input/variants/text/settings.ts +12 -0
- package/template/src/blocks/children/atomic/variants/tag/component.client.tsx +17 -0
- package/template/src/blocks/children/atomic/variants/tag/component.tsx +13 -0
- package/template/src/blocks/children/atomic/variants/tag/controlBar.ts +6 -0
- package/template/src/blocks/children/atomic/variants/tag/settings.ts +9 -0
- package/template/src/blocks/children/blocks.ts +13 -0
- package/template/src/blocks/children/icon/block.ts +41 -0
- package/template/src/blocks/children/icon/component.tsx +17 -0
- package/template/src/blocks/children/image/block.ts +80 -0
- package/template/src/blocks/children/image/component.tsx +21 -0
- package/template/src/blocks/children/richText/block.ts +50 -0
- package/template/src/blocks/children/richText/component/converters/index.tsx +10 -0
- package/template/src/blocks/children/richText/component/converters/internalLink.tsx +8 -0
- package/template/src/blocks/children/richText/component/index.tsx +10 -0
- package/template/src/blocks/children/richText/component.tsx +7 -0
- package/template/src/blocks/children/richText/defaultLexical.ts +65 -0
- package/template/src/blocks/children/simpleText/block.ts +41 -0
- package/template/src/blocks/children/simpleText/component.client.tsx +18 -0
- package/template/src/blocks/children/simpleText/component.tsx +11 -0
- package/template/src/blocks/children/svg/block.ts +39 -0
- package/template/src/blocks/children/svg/component.tsx +6 -0
- package/template/src/blocks/children/video/block.ts +70 -0
- package/template/src/blocks/children/video/component.tsx +11 -0
- package/template/src/blocks/children/zap.ts +54 -0
- package/template/src/blocks/submitForm/form/rateLimiting/blocks.ts +5 -0
- package/template/src/blocks/submitForm/form/rateLimiting/functions.ts +1 -0
- package/template/src/blocks/submitForm/form/rateLimiting/simpleSlidingWindow/block.ts +23 -0
- package/template/src/blocks/submitForm/form/rateLimiting/simpleSlidingWindow/serverFunction.ts +46 -0
- package/template/src/blocks/submitForm/form/sanitation/blocks.ts +6 -0
- package/template/src/blocks/submitForm/form/sanitation/combineTwoFields/block.ts +19 -0
- package/template/src/blocks/submitForm/form/sanitation/combineTwoFields/serverFunction.ts +22 -0
- package/template/src/blocks/submitForm/form/sanitation/functions.ts +1 -0
- package/template/src/blocks/submitForm/form/validation/blocks.ts +6 -0
- package/template/src/blocks/submitForm/form/validation/functions.ts +1 -0
- package/template/src/blocks/submitForm/form/validation/isUnique/block.ts +19 -0
- package/template/src/blocks/submitForm/form/validation/isUnique/serverFunction.ts +40 -0
- package/template/src/blocks/submitForm/form/zap.ts +8 -0
- package/template/src/blocks/submitForm/formProcessor.ts +222 -0
- package/template/src/blocks/submitForm/input/sanitation/blocks.ts +5 -0
- package/template/src/blocks/submitForm/input/sanitation/functions.ts +1 -0
- package/template/src/blocks/submitForm/input/sanitation/trimText/block.ts +24 -0
- package/template/src/blocks/submitForm/input/sanitation/trimText/serverFunction.ts +63 -0
- package/template/src/blocks/submitForm/input/useOn.ts +8 -0
- package/template/src/blocks/submitForm/input/validation/blocks.ts +6 -0
- package/template/src/blocks/submitForm/input/validation/contains/block.ts +12 -0
- package/template/src/blocks/submitForm/input/validation/contains/serverFunction.ts +23 -0
- package/template/src/blocks/submitForm/input/validation/doesNotContain/block.ts +12 -0
- package/template/src/blocks/submitForm/input/validation/doesNotContain/serverFunction.ts +23 -0
- package/template/src/blocks/submitForm/input/validation/functions.ts +2 -0
- package/template/src/blocks/submitForm/input/zap.ts +6 -0
- package/template/src/blocks/submitForm/serverFunction.ts +42 -0
- package/template/src/collections/designSets/collection.ts +44 -0
- package/template/src/collections/designSets/defaults.ts +20 -0
- package/template/src/collections/designSets/tabs/animation.ts +71 -0
- package/template/src/collections/designSets/tabs/colors.ts +31 -0
- package/template/src/collections/designSets/tabs/fonts.ts +53 -0
- package/template/src/collections/designSets/tabs/miscellaneous.ts +22 -0
- package/template/src/collections/designSets/tabs/prose.ts +151 -0
- package/template/src/collections/designSets/tabs/settings.ts +52 -0
- package/template/src/collections/designSets/tabs/sizes.ts +30 -0
- package/template/src/collections/designSets/tabs/storage.ts +51 -0
- package/template/src/collections/designSets/tabs/variables.ts +28 -0
- package/template/src/collections/favicons.ts +11 -0
- package/template/src/collections/fonts/collection.ts +20 -0
- package/template/src/collections/fonts/script.ts +199 -0
- package/template/src/collections/footers/collection.ts +48 -0
- package/template/src/collections/footers/component.tsx +13 -0
- package/template/src/collections/headers/collection.ts +47 -0
- package/template/src/collections/headers/component.tsx +13 -0
- package/template/src/collections/iconSets/collection.ts +80 -0
- package/template/src/collections/iconSets/defaults.ts +81 -0
- package/template/src/collections/icons.ts +20 -0
- package/template/src/collections/images.ts +29 -0
- package/template/src/collections/index.ts +17 -0
- package/template/src/collections/muxVideos.ts +13 -0
- package/template/src/collections/pages/collection.ts +88 -0
- package/template/src/collections/pages/tabs/SEO.ts +70 -0
- package/template/src/collections/pages/tabs/settings.ts +17 -0
- package/template/src/collections/posthogProperty.ts +48 -0
- package/template/src/collections/shortcutSets/collection.ts +30 -0
- package/template/src/collections/shortcutSets/defaults.ts +1 -0
- package/template/src/collections/shortcutSets/protectedNames.ts +135 -0
- package/template/src/collections/shortcutSets/tabs/settings.ts +13 -0
- package/template/src/collections/shortcutSets/tabs/shortcuts.ts +70 -0
- package/template/src/collections/users.ts +11 -0
- package/template/src/collections/zap.ts +59 -0
- package/template/src/components/child/SSRProps.ts +381 -0
- package/template/src/components/child/renderChildren.tsx +148 -0
- package/template/src/components/livePreviewListener.tsx +10 -0
- package/template/src/components/providers/formProvider.tsx +11 -0
- package/template/src/components/providers/tracking/gtm.tsx +11 -0
- package/template/src/components/providers/tracking/index.tsx +46 -0
- package/template/src/components/providers/tracking/postHog.tsx +41 -0
- package/template/src/components/providers/tracking/vercel.tsx +10 -0
- package/template/src/components/toast/index.module.css +142 -0
- package/template/src/components/toast/index.tsx +55 -0
- package/template/src/endpoints/seed/backendForm.ts +48 -0
- package/template/src/endpoints/seed/designSet.ts +476 -0
- package/template/src/endpoints/seed/footer.ts +389 -0
- package/template/src/endpoints/seed/header.ts +3511 -0
- package/template/src/endpoints/seed/iconSet.ts +19 -0
- package/template/src/endpoints/seed/icons/assets/check.svg +4 -0
- package/template/src/endpoints/seed/icons/assets/close.svg +4 -0
- package/template/src/endpoints/seed/icons/assets/cookie.svg +7 -0
- package/template/src/endpoints/seed/icons/assets/github.svg +1 -0
- package/template/src/endpoints/seed/icons/assets/logo.svg +11 -0
- package/template/src/endpoints/seed/icons/assets/menu.svg +4 -0
- package/template/src/endpoints/seed/icons/assets/theme.svg +4 -0
- package/template/src/endpoints/seed/icons/check.ts +14 -0
- package/template/src/endpoints/seed/icons/close.ts +14 -0
- package/template/src/endpoints/seed/icons/cookie.ts +14 -0
- package/template/src/endpoints/seed/icons/github.ts +14 -0
- package/template/src/endpoints/seed/icons/index.ts +7 -0
- package/template/src/endpoints/seed/icons/logo.ts +14 -0
- package/template/src/endpoints/seed/icons/menu.ts +14 -0
- package/template/src/endpoints/seed/icons/theme.ts +14 -0
- package/template/src/endpoints/seed/index.ts +100 -0
- package/template/src/endpoints/seed/pages/home.ts +858 -0
- package/template/src/endpoints/seed/pages/index.ts +4 -0
- package/template/src/endpoints/seed/pages/notFoundPage.ts +287 -0
- package/template/src/endpoints/seed/pages/prose.ts +1436 -0
- package/template/src/endpoints/seed/pages/testing.ts +2181 -0
- package/template/src/endpoints/seed/shortcutSet.ts +187 -0
- package/template/src/endpoints/seed/siteMetaData.ts +10 -0
- package/template/src/fields/actions/changeKey.ts +12 -0
- package/template/src/fields/actions/index.ts +6 -0
- package/template/src/fields/actions/initialValueCheckbox.ts +14 -0
- package/template/src/fields/actions/keyText.ts +10 -0
- package/template/src/fields/actions/persisted.ts +14 -0
- package/template/src/fields/actions/setData.ts +20 -0
- package/template/src/fields/actions/strict/index.ts +3 -0
- package/template/src/fields/actions/strict/keySelect.ts +28 -0
- package/template/src/fields/actions/strict/listenSelect.ts +28 -0
- package/template/src/fields/actions/strict/performSelect.ts +30 -0
- package/template/src/fields/actions/strict/registry/cookieConsent.ts +14 -0
- package/template/src/fields/actions/strict/registry/index.ts +6 -0
- package/template/src/fields/actions/strict/registry/theme.ts +9 -0
- package/template/src/fields/active.ts +16 -0
- package/template/src/fields/apf/index.ts +69 -0
- package/template/src/fields/apf/storage.ts +38 -0
- package/template/src/fields/blocks/actions.ts +30 -0
- package/template/src/fields/blocks/backdropChildren.ts +11 -0
- package/template/src/fields/blocks/children.ts +15 -0
- package/template/src/fields/blocks/submitForm/form.ts +24 -0
- package/template/src/fields/blocks/submitForm/input.ts +25 -0
- package/template/src/fields/className.ts +26 -0
- package/template/src/fields/coloredEnd.ts +5 -0
- package/template/src/fields/defaultOpen.ts +14 -0
- package/template/src/fields/designSets/value.ts +80 -0
- package/template/src/fields/devMode.ts +11 -0
- package/template/src/fields/favicon.ts +18 -0
- package/template/src/fields/for.ts +11 -0
- package/template/src/fields/keepMounted.ts +11 -0
- package/template/src/fields/modal.ts +16 -0
- package/template/src/fields/slug.ts +35 -0
- package/template/src/fields/staticDataAttributes.ts +29 -0
- package/template/src/fields/tabs/block/children/actions.ts +49 -0
- package/template/src/fields/tabs/block/children/backdrop.ts +17 -0
- package/template/src/fields/tabs/block/children/settings.ts +45 -0
- package/template/src/fields/tabs/block/children/submitForm/form.ts +23 -0
- package/template/src/fields/tabs/block/children/submitForm/input.ts +14 -0
- package/template/src/fields/tabs/block/children/tracking.ts +25 -0
- package/template/src/fields/tabs/collection/storage.ts +55 -0
- package/template/src/fields/tagType.ts +32 -0
- package/template/src/fields/testPath.ts +3 -0
- package/template/src/fields/uniqueTitle.ts +8 -0
- package/template/src/fields/validationMessage.ts +13 -0
- package/template/src/globals/index.ts +8 -0
- package/template/src/globals/settings.ts +36 -0
- package/template/src/globals/siteMetaData.ts +29 -0
- package/template/src/globals/storage.ts +15 -0
- package/template/src/globals/tracking/global.ts +25 -0
- package/template/src/globals/tracking/tabs/gtm.ts +18 -0
- package/template/src/globals/tracking/tabs/postHog.ts +35 -0
- package/template/src/hooks/collection/atomicHook/atomicHook.ts +223 -0
- package/template/src/hooks/collection/atomicHook/processors/cssProcessor.ts +60 -0
- package/template/src/hooks/collection/atomicHook/processors/processDesignSet/generatePreflights.ts +36 -0
- package/template/src/hooks/collection/atomicHook/processors/processDesignSet/index.ts +176 -0
- package/template/src/hooks/collection/atomicHook/processors/unsetActive.ts +24 -0
- package/template/src/hooks/collection/formatSVG.ts +157 -0
- package/template/src/hooks/collection/revalidate.ts +53 -0
- package/template/src/hooks/collection/sanitizeCollection.ts +5 -0
- package/template/src/hooks/field/apf.ts +59 -0
- package/template/src/hooks/field/formatSlug.ts +23 -0
- package/template/src/hooks/field/href.ts +6 -0
- package/template/src/hooks/field/publishedAt.ts +5 -0
- package/template/src/hooks/frontEnd/atomicStore/create.ts +69 -0
- package/template/src/hooks/frontEnd/atomicStore/index.tsx +20 -0
- package/template/src/hooks/frontEnd/atomicStore/slices/base.ts +7 -0
- package/template/src/hooks/frontEnd/atomicStore/slices/consent.ts +76 -0
- package/template/src/hooks/frontEnd/atomicStore/slices/dynamic.ts +51 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/boolToDA/function.ts +14 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/boolToDA/zap.ts +12 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/cCToDA/function.ts +34 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/cCToDA/zap.ts +17 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/errorToDA/function.ts +22 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/errorToDA/zap.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/function.ts +20 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/statusToDA/function.ts +24 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/statusToDA/zap.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/textToDA/function.ts +21 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/textToDA/zap.ts +12 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/zap.ts +15 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/index.ts +2 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/cycleText/function.ts +30 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/cycleText/zap.ts +12 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/function.ts +21 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/resetForm/function.ts +7 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/resetForm/zap.ts +9 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setBool/function.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setBool/zap.ts +11 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setCCs/function.ts +33 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setCCs/zap.ts +14 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setThemes/function.ts +11 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setThemes/zap.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/submitForm/function.ts +32 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/submitForm/zap.ts +9 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/zap.ts +16 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/zap.ts +2 -0
- package/template/src/hooks/frontEnd/useActions/index.ts +6 -0
- package/template/src/hooks/frontEnd/useActions/useActionContext.ts +21 -0
- package/template/src/hooks/frontEnd/useActions/useButtonActions.ts +17 -0
- package/template/src/hooks/frontEnd/useActions/useDaToText.ts +34 -0
- package/template/src/hooks/frontEnd/useActions/useForm.ts +114 -0
- package/template/src/hooks/frontEnd/useActions/usePortal.ts +33 -0
- package/template/src/hooks/frontEnd/useActions/useToDa.ts +12 -0
- package/template/src/hooks/global/revalidate.ts +26 -0
- package/template/src/payload.config.ts +78 -0
- package/template/src/plugins/blurDataUrls.ts +8 -0
- package/template/src/plugins/formBuilder.ts +40 -0
- package/template/src/plugins/index.ts +17 -0
- package/template/src/plugins/muxVideo.ts +13 -0
- package/template/src/plugins/nestedDocs.ts +9 -0
- package/template/src/plugins/vercelBlobStorage.ts +8 -0
- package/template/src/ts/JSONSchema.ts +93 -0
- package/template/src/ts/declarations.ts +24 -0
- package/template/src/ts/types/actions.ts +175 -0
- package/template/src/ts/types/apf.ts +108 -0
- package/template/src/ts/types/cache.ts +166 -0
- package/template/src/ts/types/css.ts +14 -0
- package/template/src/ts/types/forms.ts +214 -0
- package/template/src/ts/types/frontEnd.ts +115 -0
- package/template/src/ts/types/index.ts +49 -0
- package/template/src/ts/types/payload-types.ts +3684 -0
- package/template/src/ts/zap/ap.ts +82 -0
- package/template/src/ts/zap/index.ts +4 -0
- package/template/src/ui/apf/controls.tsx +88 -0
- package/template/src/ui/apf/field.tsx +81 -0
- package/template/src/ui/apf/index.scss +59 -0
- package/template/src/ui/apf/label.tsx +23 -0
- package/template/src/ui/assets/Icon.tsx +21 -0
- package/template/src/ui/assets/Logo.tsx +21 -0
- package/template/src/ui/assets/atomicIcon.tsx +27 -0
- package/template/src/ui/assets/warningIcon.ts +6 -0
- package/template/src/ui/blocks/actionBlock.tsx +44 -0
- package/template/src/ui/blocks/inputBlock.tsx +24 -0
- package/template/src/ui/decorative/coloredEnd.tsx +16 -0
- package/template/src/ui/decorative/index.scss +46 -0
- package/template/src/ui/fields/iconSelect/index.tsx +19 -0
- package/template/src/ui/fields/slug/index.scss +12 -0
- package/template/src/ui/fields/slug/index.tsx +72 -0
- package/template/src/ui/index.ts +32 -0
- package/template/src/ui/root/beforeDashboard/index.scss +22 -0
- package/template/src/ui/root/beforeDashboard/index.tsx +39 -0
- package/template/src/ui/root/beforeDashboard/seedButton/index.scss +12 -0
- package/template/src/ui/root/beforeDashboard/seedButton/index.tsx +84 -0
- package/template/src/ui/root/siteTriggers/index.scss +22 -0
- package/template/src/ui/root/siteTriggers/index.tsx +94 -0
- package/template/src/ui/root/siteTriggers/triggerVercelDeploy.ts +37 -0
- package/template/src/ui/rowLabels/animation.tsx +27 -0
- package/template/src/ui/rowLabels/atomic/index.scss +62 -0
- package/template/src/ui/rowLabels/atomic/index.tsx +96 -0
- package/template/src/ui/rowLabels/color.tsx +33 -0
- package/template/src/ui/rowLabels/designToken.tsx +30 -0
- package/template/src/ui/rowLabels/icon.tsx +32 -0
- package/template/src/ui/rowLabels/shortcut/index.scss +21 -0
- package/template/src/ui/rowLabels/shortcut/index.tsx +30 -0
- package/template/src/ui/rowLabels/simpleText.tsx +41 -0
- package/template/src/utilities/deepMerge.ts +30 -0
- package/template/src/utilities/extractSVG.ts +9 -0
- package/template/src/utilities/format/toKebabCase.ts +79 -0
- package/template/src/utilities/format/toTitleCase.ts +47 -0
- package/template/src/utilities/formatDurationWithTokens.ts +56 -0
- package/template/src/utilities/generateMetaData.ts +45 -0
- package/template/src/utilities/generatePreviewPath.ts +43 -0
- package/template/src/utilities/get/cache/getAtomicActions.ts +48 -0
- package/template/src/utilities/get/cache/getAtomicClasses.ts +20 -0
- package/template/src/utilities/get/cache/getDesignSet.ts +15 -0
- package/template/src/utilities/get/cache/getFooter.ts +17 -0
- package/template/src/utilities/get/cache/getFormSubmissions.ts +17 -0
- package/template/src/utilities/get/cache/getForms.ts +43 -0
- package/template/src/utilities/get/cache/getHeader.ts +17 -0
- package/template/src/utilities/get/cache/getIcon.ts +51 -0
- package/template/src/utilities/get/cache/getImage.ts +20 -0
- package/template/src/utilities/get/cache/getPage.ts +35 -0
- package/template/src/utilities/get/cache/getPages.ts +24 -0
- package/template/src/utilities/get/cache/getShortcutSet.ts +17 -0
- package/template/src/utilities/get/cache/getSiteCSS.ts +17 -0
- package/template/src/utilities/get/cache/getSiteMetadata.ts +14 -0
- package/template/src/utilities/get/cache/getSitemap.ts +50 -0
- package/template/src/utilities/get/cache/getTracking.ts +14 -0
- package/template/src/utilities/get/cache/index.ts +129 -0
- package/template/src/utilities/get/cache/react.ts +5 -0
- package/template/src/utilities/get/getImageURL.ts +20 -0
- package/template/src/utilities/get/getMeUser.ts +22 -0
- package/template/src/utilities/get/getURL.ts +20 -0
- package/template/src/utilities/log/cache.ts +8 -0
- package/template/src/utilities/log/manual.ts +11 -0
- package/template/src/utilities/log/revalidation.ts +6 -0
- package/template/src/utilities/mergeTags.ts +7 -0
- package/template/src/utilities/propertyApplicatorUtility.ts +20 -0
- package/template/src/utilities/revalidateTag.ts +55 -0
- package/template/src/utilities/runAPF.ts +10 -0
- package/template/src/utilities/sanitizeData.ts +24 -0
- package/template/src/utilities/seedNestedRelationship.ts +5 -0
- package/template/tailwind.config.js +9 -0
- package/template/tsconfig.json +49 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import fs from 'fs'
|
|
6
|
+
import fsp from 'fs/promises'
|
|
7
|
+
import { execa } from 'execa'
|
|
8
|
+
import chalk from 'chalk'
|
|
9
|
+
import ora from 'ora'
|
|
10
|
+
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
12
|
+
|
|
13
|
+
async function getTemplatePath() {
|
|
14
|
+
// When published: template is bundled in package/template
|
|
15
|
+
const bundledPath = path.join(__dirname, '..', 'template')
|
|
16
|
+
if (fs.existsSync(path.join(bundledPath, 'package.json'))) {
|
|
17
|
+
return bundledPath
|
|
18
|
+
}
|
|
19
|
+
// When in monorepo: templates/atomic-payload is at ../../templates/atomic-payload
|
|
20
|
+
const monorepoPath = path.join(__dirname, '..', '..', '..', 'templates', 'atomic-payload')
|
|
21
|
+
if (fs.existsSync(path.join(monorepoPath, 'package.json'))) {
|
|
22
|
+
return monorepoPath
|
|
23
|
+
}
|
|
24
|
+
throw new Error('Template not found. Run from monorepo root or use published package.')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getProjectName() {
|
|
28
|
+
const arg = process.argv[2]
|
|
29
|
+
if (arg && arg !== '--help' && !arg.startsWith('-')) {
|
|
30
|
+
return arg
|
|
31
|
+
}
|
|
32
|
+
return 'my-atomic-payload'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function printBanner() {
|
|
36
|
+
const title = chalk.cyan.bold(' Atomic Payload')
|
|
37
|
+
const tagline = chalk.gray(' The Payload CMS starter where all you need to know is Tailwind')
|
|
38
|
+
const line = chalk.cyan(' ─────────────────────────────────────────')
|
|
39
|
+
console.log()
|
|
40
|
+
console.log(title)
|
|
41
|
+
console.log(tagline)
|
|
42
|
+
console.log(line)
|
|
43
|
+
console.log()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function printHelp() {
|
|
47
|
+
console.log(`
|
|
48
|
+
${chalk.cyan.bold('create-atomic-payload')} - Scaffold a new Atomic Payload project
|
|
49
|
+
|
|
50
|
+
${chalk.gray('Usage:')}
|
|
51
|
+
npx @pro-laico/create-atomic-payload ${chalk.dim('[project-name]')}
|
|
52
|
+
|
|
53
|
+
${chalk.gray('Options:')}
|
|
54
|
+
--help, -h Show this help message
|
|
55
|
+
|
|
56
|
+
${chalk.gray('Examples:')}
|
|
57
|
+
npx @pro-laico/create-atomic-payload
|
|
58
|
+
npx @pro-laico/create-atomic-payload my-website
|
|
59
|
+
`)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function printNextSteps(projectName) {
|
|
63
|
+
const steps = [
|
|
64
|
+
`cd ${projectName}`,
|
|
65
|
+
'cp .env.example .env',
|
|
66
|
+
'# Edit .env with your MongoDB URI, Payload secret, etc.',
|
|
67
|
+
'pnpm dev',
|
|
68
|
+
]
|
|
69
|
+
const maxLen = Math.max(...steps.map((s) => s.length), 40)
|
|
70
|
+
const line = '─'.repeat(maxLen + 2)
|
|
71
|
+
|
|
72
|
+
console.log()
|
|
73
|
+
console.log(chalk.green.bold(' ✓ Created ') + chalk.green(projectName))
|
|
74
|
+
console.log()
|
|
75
|
+
console.log(chalk.gray(' Next steps:'))
|
|
76
|
+
console.log(chalk.cyan(' ╭' + line + '╮'))
|
|
77
|
+
for (const step of steps) {
|
|
78
|
+
const padding = ' '.repeat(Math.max(0, maxLen - step.length))
|
|
79
|
+
const styled = step.startsWith('#') ? chalk.gray(step) : chalk.cyan(step)
|
|
80
|
+
console.log(chalk.cyan(' │ ') + styled + padding + chalk.cyan(' │'))
|
|
81
|
+
}
|
|
82
|
+
console.log(chalk.cyan(' ╰' + line + '╯'))
|
|
83
|
+
console.log()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function main() {
|
|
87
|
+
const args = process.argv.slice(2)
|
|
88
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
89
|
+
printBanner()
|
|
90
|
+
printHelp()
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const projectName = getProjectName()
|
|
95
|
+
|
|
96
|
+
if (!/^[a-z0-9-]+$/.test(projectName)) {
|
|
97
|
+
console.error(chalk.red(' ✗ Project name must use only lowercase letters, numbers, and hyphens'))
|
|
98
|
+
process.exit(1)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
printBanner()
|
|
102
|
+
|
|
103
|
+
const targetDir = path.resolve(process.cwd(), projectName)
|
|
104
|
+
const targetExists = fs.existsSync(targetDir)
|
|
105
|
+
|
|
106
|
+
if (targetExists) {
|
|
107
|
+
console.error(chalk.red(` ✗ Directory "${projectName}" already exists. Remove it or choose a different name.`))
|
|
108
|
+
process.exit(1)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const templatePath = await getTemplatePath()
|
|
112
|
+
const copySpinner = ora({ text: 'Copying template...', color: 'cyan' }).start()
|
|
113
|
+
const startCopy = Date.now()
|
|
114
|
+
|
|
115
|
+
await fsp.mkdir(path.dirname(targetDir), { recursive: true })
|
|
116
|
+
await fsp.cp(templatePath, targetDir, {
|
|
117
|
+
recursive: true,
|
|
118
|
+
filter: (src) => {
|
|
119
|
+
const name = path.basename(src)
|
|
120
|
+
return !['node_modules', '.next', '.git', '.env'].includes(name) && !name.endsWith('.tsbuildinfo')
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
copySpinner.succeed(`Template copied in ${((Date.now() - startCopy) / 1000).toFixed(1)}s`)
|
|
125
|
+
|
|
126
|
+
const installSpinner = ora({ text: 'Installing dependencies with pnpm...', color: 'cyan' }).start()
|
|
127
|
+
try {
|
|
128
|
+
await execa('pnpm', ['install'], { cwd: targetDir, stdio: 'pipe' })
|
|
129
|
+
installSpinner.succeed('Dependencies installed')
|
|
130
|
+
} catch (err) {
|
|
131
|
+
installSpinner.fail('Failed to install dependencies')
|
|
132
|
+
throw err
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Rebuild sharp to ensure native binary is built for current platform (fixes Windows/OneDrive issues)
|
|
136
|
+
const sharpSpinner = ora({ text: 'Building sharp (image processing)...', color: 'cyan' }).start()
|
|
137
|
+
try {
|
|
138
|
+
await execa('pnpm', ['rebuild', 'sharp'], { cwd: targetDir, stdio: 'pipe' })
|
|
139
|
+
sharpSpinner.succeed('Sharp ready')
|
|
140
|
+
} catch (err) {
|
|
141
|
+
sharpSpinner.warn('Sharp rebuild skipped (run "pnpm rebuild sharp" if images fail)')
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const fontsSpinner = ora({ text: 'Downloading fonts...', color: 'cyan' }).start()
|
|
145
|
+
try {
|
|
146
|
+
await execa('pnpm', ['download:fonts'], { cwd: targetDir, stdio: 'pipe' })
|
|
147
|
+
fontsSpinner.succeed('Fonts ready')
|
|
148
|
+
} catch (err) {
|
|
149
|
+
fontsSpinner.fail('Font download failed')
|
|
150
|
+
throw err
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
printNextSteps(projectName)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
main().catch((err) => {
|
|
157
|
+
console.error(chalk.red('\n ✗ ' + err.message))
|
|
158
|
+
process.exit(1)
|
|
159
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pro-laico/create-atomic-payload",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.1.4",
|
|
7
|
+
"description": "Scaffold a new Atomic Payload project - the Payload CMS starter where all you need to know is Tailwind.",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"bin": {
|
|
11
|
+
"create-atomic-payload": "bin/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin",
|
|
15
|
+
"template"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"prepack": "node scripts/copy-template.js",
|
|
19
|
+
"create": "node bin/cli.js"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"chalk": "^5.3.0",
|
|
23
|
+
"execa": "^9.5.2",
|
|
24
|
+
"ora": "^8.1.1"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Mongo DB connection string
|
|
2
|
+
MONGODB_URI=
|
|
3
|
+
# Vercel Blob Read Write Secret
|
|
4
|
+
BLOB_READ_WRITE_TOKEN=
|
|
5
|
+
|
|
6
|
+
# Used to encrypt JWT tokens
|
|
7
|
+
PAYLOAD_SECRET=
|
|
8
|
+
# Used to validate preview requests
|
|
9
|
+
PREVIEW_SECRET=
|
|
10
|
+
|
|
11
|
+
# Script User Login
|
|
12
|
+
SCRIPT_USER_EMAIL=
|
|
13
|
+
SCRIPT_USER_PASSWORD=
|
|
14
|
+
|
|
15
|
+
# Used to configure CORS, format links and more. No trailing slash
|
|
16
|
+
NEXT_PUBLIC_SERVER_URL=http://localhost:3000
|
|
17
|
+
# Live Site URL
|
|
18
|
+
LIVE_SITE_URL='https://<project-name>.vercel.app'
|
|
19
|
+
|
|
20
|
+
#Vercel Deploy Webhook. Used to rebuild the website from admin ui.
|
|
21
|
+
VERCEL_DEPLOY_WEBHOOK_URL=
|
|
22
|
+
|
|
23
|
+
#Mux Secrets. For mux video block component.
|
|
24
|
+
MUX_TOKEN_ID=
|
|
25
|
+
MUX_TOKEN_SECRET=
|
|
26
|
+
MUX_WEBHOOK_SIGNING_SECRET=
|
|
27
|
+
|
|
28
|
+
RESEND_API_KEY=
|
|
29
|
+
|
|
30
|
+
#Set to true to use bundle analyzer
|
|
31
|
+
ANALYZE=false
|
|
32
|
+
#Manage whether or not to log cached getters and more. (true / false)
|
|
33
|
+
LOGS=false
|
|
34
|
+
#Set whether or not to include the seed functionality. (true / false)
|
|
35
|
+
INCLUDE_SEED=true
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Next.js: debug full stack",
|
|
9
|
+
"type": "node",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
|
|
12
|
+
"runtimeArgs": ["--inspect"],
|
|
13
|
+
"skipFiles": ["<node_internals>/**"],
|
|
14
|
+
"serverReadyAction": {
|
|
15
|
+
"action": "debugWithChrome",
|
|
16
|
+
"killOnServerStop": true,
|
|
17
|
+
"pattern": "- Local:.+(https?://.+)",
|
|
18
|
+
"uriFormat": "%s",
|
|
19
|
+
"webRoot": "${workspaceFolder}"
|
|
20
|
+
},
|
|
21
|
+
"cwd": "${workspaceFolder}"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"npm.packageManager": "pnpm",
|
|
3
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
4
|
+
"[typescript]": {
|
|
5
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
6
|
+
"editor.formatOnSave": true,
|
|
7
|
+
"editor.codeActionsOnSave": {
|
|
8
|
+
"source.fixAll.eslint": "explicit"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"[typescriptreact]": {
|
|
12
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
13
|
+
"editor.formatOnSave": true,
|
|
14
|
+
"editor.codeActionsOnSave": {
|
|
15
|
+
"source.fixAll.eslint": "explicit"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"[javascript]": {
|
|
19
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
20
|
+
"editor.formatOnSave": true,
|
|
21
|
+
"editor.codeActionsOnSave": {
|
|
22
|
+
"source.fixAll.eslint": "explicit"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"[json]": {
|
|
26
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
27
|
+
"editor.formatOnSave": true
|
|
28
|
+
},
|
|
29
|
+
"[jsonc]": {
|
|
30
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
31
|
+
"editor.formatOnSave": true
|
|
32
|
+
},
|
|
33
|
+
"editor.formatOnSaveMode": "file",
|
|
34
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
35
|
+
"[javascript][typescript][typescriptreact]": {
|
|
36
|
+
"editor.codeActionsOnSave": {
|
|
37
|
+
"source.fixAll.eslint": "explicit"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"tailwindCSS.includeLanguages": {
|
|
41
|
+
"typescript": "javascript",
|
|
42
|
+
"typescriptreact": "javascript"
|
|
43
|
+
},
|
|
44
|
+
"tailwindCSS.experimental.classRegex": [
|
|
45
|
+
["className\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", "([^\"'`]*)"],
|
|
46
|
+
["className\\s*=\\s*\\{([^}]*)\\}", "([^}]*)"],
|
|
47
|
+
["class\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", "([^\"'`]*)"],
|
|
48
|
+
["class\\s*=\\s*\\{([^}]*)\\}", "([^}]*)"]
|
|
49
|
+
],
|
|
50
|
+
"tailwindCSS.suggestions": true,
|
|
51
|
+
"todo-tree.general.tags": ["TODO:", "KNOWN ISSUE:", "Pre Commit Check:", "BUG:"],
|
|
52
|
+
"todo-tree.highlights.defaultHighlight": {
|
|
53
|
+
"icon": "checklist",
|
|
54
|
+
"iconColour": "#82aaff",
|
|
55
|
+
"foreground": "#82aaff",
|
|
56
|
+
"background": "#002b3d",
|
|
57
|
+
"type": "text",
|
|
58
|
+
"opacity": 50
|
|
59
|
+
},
|
|
60
|
+
"todo-tree.highlights.customHighlight": {
|
|
61
|
+
"KNOWN ISSUE:": {
|
|
62
|
+
"icon": "calendar",
|
|
63
|
+
"iconColour": "#ffc94d",
|
|
64
|
+
"foreground": "#ffc94d",
|
|
65
|
+
"background": "#3b2a00",
|
|
66
|
+
"type": "text",
|
|
67
|
+
"opacity": 50
|
|
68
|
+
},
|
|
69
|
+
"Pre Commit Check:": {
|
|
70
|
+
"icon": "check",
|
|
71
|
+
"iconColour": "#ff7733",
|
|
72
|
+
"foreground": "#ff7733",
|
|
73
|
+
"background": "#331400",
|
|
74
|
+
"type": "text",
|
|
75
|
+
"opacity": 50
|
|
76
|
+
},
|
|
77
|
+
"BUG:": {
|
|
78
|
+
"icon": "bug",
|
|
79
|
+
"iconColour": "#ff4d6d",
|
|
80
|
+
"foreground": "#ff4d6d",
|
|
81
|
+
"background": "#3b000d",
|
|
82
|
+
"type": "text",
|
|
83
|
+
"opacity": 50
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
package/template/.yarnrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--install.ignore-engines true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 Pro Laico LLC, Inc. <contact@prolaico.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
> [!IMPORTANT]
|
|
2
|
+
> Our [Discord](https://discord.gg/EPHgjrQBxY) is the best place to get quick answers to questions.
|
|
3
|
+
>
|
|
4
|
+
> For documentation check out [Atomic Payload](https://atomicpayload.com).
|
|
5
|
+
>
|
|
6
|
+
> We are also looking for contributors!
|
|
7
|
+
|
|
8
|
+
# Template Setup
|
|
9
|
+
|
|
10
|
+
This guide covers environment setup, deployment, and optional integrations (Mux, Resend) for your Atomic Payload project. Use it whether you created a project with `npx create-atomic-payload` or are developing from the monorepo template folder.
|
|
11
|
+
|
|
12
|
+
> **Developing the monorepo?** See [MONOREPO.md](../../MONOREPO.md) in the repo root for structure, local dev, and plugin instructions.
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
1. **Get Required Connections**
|
|
17
|
+
- Obtain a `MONGODB_URI` (Set up through Vercel to get a free tier cluster(`Storage → Create Database → MongoDB Atlas`)).
|
|
18
|
+
- Create a Blob store in Vercel (`Storage → Create Database → Blob`) and copy the `BLOB_READ_WRITE_TOKEN` from .env.local.
|
|
19
|
+
|
|
20
|
+
2. **Configure your project**
|
|
21
|
+
- Copy `.env.example` to `.env`.
|
|
22
|
+
- Add the MongoDB URI and Blob token.
|
|
23
|
+
- Generate and add the Payload and Preview secrets.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Mongo DB connection string
|
|
27
|
+
MONGODB_URI="mongodb+srv://<username>:<password>@<cluster-name>.mongodb.net/my_database?retryWrites=true&w=majority"
|
|
28
|
+
# Vercel Blob Read Write Secret
|
|
29
|
+
BLOB_READ_WRITE_TOKEN="vercel_blob_rw_laogivGHAOSNeoFS_KJAGsjmeHSkaLQUVhUSHmfPGIXCbHe"
|
|
30
|
+
|
|
31
|
+
# Used to encrypt JWT tokens
|
|
32
|
+
PAYLOAD_SECRET=524AFEAC8E77853C6AC1C2EBCB266
|
|
33
|
+
# Used to validate preview requests
|
|
34
|
+
PREVIEW_SECRET=77E41879964C5D1C251661663DCD3
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. **Install and run**
|
|
38
|
+
- Paste and run the code below into your terminal. Which installs dependencies, runs the font download script to generate a blank definition file (even if it says it failed, it generates the file as blank), and then starts the dev server.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm i
|
|
42
|
+
pnpm download:fonts
|
|
43
|
+
pnpm dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Open `http://localhost:3000/admin` and create the first admin user.
|
|
47
|
+
|
|
48
|
+
4. **Update environment variables**
|
|
49
|
+
- Add the created admin email and password to `.env` as:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Script User Login
|
|
53
|
+
SCRIPT_USER_EMAIL="chad@atomicpayload.com"
|
|
54
|
+
SCRIPT_USER_PASSWORD="Password123"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
5. **Deploy to Vercel**
|
|
58
|
+
- Create a new project in Vercel by importing your repo. But before hitting create:
|
|
59
|
+
- In your local `.env`, update:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
LIVE_SITE_URL='https://<project-name>.vercel.app'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Copy all environment variables above and including LIVE_SITE_URL to the Vercel project settings.
|
|
66
|
+
- In the Vercel environment variables edit NEXT_PUBLIC_SERVER_URL to the LIVE_SITE_URL
|
|
67
|
+
- Trigger a deploy and wait for the build to complete.
|
|
68
|
+
|
|
69
|
+
You now have a working version of Atomic Payload. It is recommended to go to the main admin dashboard on the site and seed the database with some data. Just keep in mind this will override existing data, and therefore you should comment out the beforeDashboard custom component from `src/payload.config.ts` once seeded.
|
|
70
|
+
|
|
71
|
+
# Additional Setup
|
|
72
|
+
|
|
73
|
+
### Vercel Rebuild Webhook
|
|
74
|
+
|
|
75
|
+
Trigger a rebuild of your deployment using a vercel webhook. Mainly used when updating fonts.
|
|
76
|
+
|
|
77
|
+
1. Get Hook URL
|
|
78
|
+
- Go to your projects dashboard then (`Settings → Git → Deploy Hooks`).
|
|
79
|
+
- Add a name and select the branch to rebuild (usually `main`).
|
|
80
|
+
- Copy the hook URL and add it to your Vercel env. Example:
|
|
81
|
+
```bash
|
|
82
|
+
VERCEL_DEPLOY_WEBHOOK_URL=https://api.vercel.com/v1/integrations/deploy/prj_55B6CE7961E311671658DBFD8B59C
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Mux Setup
|
|
86
|
+
|
|
87
|
+
Upload and serve video all through the Payload admin dashboard.
|
|
88
|
+
|
|
89
|
+
1. Account Setup
|
|
90
|
+
- Create a Mux Account
|
|
91
|
+
- Create a new environment
|
|
92
|
+
- Set it to **Production** and configure access controls
|
|
93
|
+
|
|
94
|
+
2. Setup Mux Token
|
|
95
|
+
- In Mux, go to (`Settings → Access Tokens`).
|
|
96
|
+
- Create a new token.
|
|
97
|
+
- Select **Payload Admin** and enable all permissions.
|
|
98
|
+
- Copy the **Token ID** to `MUX_TOKEN_ID`.
|
|
99
|
+
- Copy the **Secret Key** to `MUX_TOKEN_SECRET`.
|
|
100
|
+
|
|
101
|
+
3. Setup Mux Webhook
|
|
102
|
+
- In Mux, go to (`Settings → Webhooks`):
|
|
103
|
+
- Add a webhook for your live site with the route `/api/mux/webhook`. e.g: `<live-site-url>/api/mux/webhook`
|
|
104
|
+
- Copy the generated secret to `MUX_WEBHOOK_SIGNING_SECRET`
|
|
105
|
+
|
|
106
|
+
#### Example:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
#Mux Secrets. For mux video block component.
|
|
110
|
+
MUX_TOKEN_ID=bd47f2c1e-5a8b-4f92-9b3e-2c1d7a6f4e91
|
|
111
|
+
MUX_TOKEN_SECRET=K9ZpY1cE8M7R0xBqW3uT4nD2JH6OaLwFhVQ5S/ImsPjGkUoXyAetCzNrbf0d+8lH
|
|
112
|
+
MUX_WEBHOOK_SIGNING_SECRET=7k4qv9xrmhsj2p1d8zf6bwl0ntgy5cqe
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Resend Setup
|
|
116
|
+
|
|
117
|
+
Send emails programmatically upon form submissions using Resend.
|
|
118
|
+
|
|
119
|
+
1. Get An API Key
|
|
120
|
+
- In the Resend Dashboard Go To API Keys
|
|
121
|
+
- Create and name a new API key then copy to `RESEND_API_KEY`
|
|
122
|
+
```bash
|
|
123
|
+
RESEND_API_KEY=qR8_LpWzNy_7vKDmHT2JXsFo9BbUyRcAeLQ
|
|
124
|
+
```
|
|
125
|
+
2. Handle For The Sender Domain
|
|
126
|
+
- Go To Domains And Create a New Domain (Use a purchased domain, and preferably set as a subdomain such as `notifications.atomicpayload.com`)
|
|
127
|
+
- Go Through Resend Setup Instructions
|
|
128
|
+
- In your repo, at `src/payload.config.ts` uncomment all code related to the resendAdapter and modify to fit your implementation.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
|
|
2
|
+
import nextTypescript from "eslint-config-next/typescript";
|
|
3
|
+
import { dirname } from 'path'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
7
|
+
const __dirname = dirname(__filename)
|
|
8
|
+
|
|
9
|
+
const eslintConfig = [{
|
|
10
|
+
ignores: ['node_modules/**', '.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
|
|
11
|
+
}, ...nextCoreWebVitals, ...nextTypescript, {
|
|
12
|
+
rules: {
|
|
13
|
+
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
14
|
+
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
15
|
+
'@typescript-eslint/no-explicit-any': 'off', // Set to warn if you are hunting for the any type
|
|
16
|
+
'import/no-unresolved': ['error', { caseSensitive: true }],
|
|
17
|
+
'@typescript-eslint/no-unused-vars': [
|
|
18
|
+
'warn',
|
|
19
|
+
{
|
|
20
|
+
vars: 'all',
|
|
21
|
+
args: 'none', // Don't warn about unused function parameters. Set to 'after-used' for normal behavior
|
|
22
|
+
ignoreRestSiblings: true, // This allows unused destructured variables. Set to false for normal behavior
|
|
23
|
+
argsIgnorePattern: '^_',
|
|
24
|
+
varsIgnorePattern: '^_',
|
|
25
|
+
destructuredArrayIgnorePattern: '^_',
|
|
26
|
+
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
}, { ignores: ['.next/'] }]
|
|
31
|
+
|
|
32
|
+
export default eslintConfig
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import { existsSync } from 'fs'
|
|
3
|
+
import type { NextConfig } from 'next'
|
|
4
|
+
import bundleAnalyzer from '@next/bundle-analyzer'
|
|
5
|
+
import { withPayload } from '@payloadcms/next/withPayload'
|
|
6
|
+
|
|
7
|
+
const NEXT_PUBLIC_SERVER_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL
|
|
8
|
+
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
|
9
|
+
: process.env.__NEXT_PRIVATE_ORIGIN || 'http://localhost:3000'
|
|
10
|
+
|
|
11
|
+
// In monorepo, Next.js needs the workspace root to resolve packages
|
|
12
|
+
const monorepoRoot = path.resolve(__dirname, '../..')
|
|
13
|
+
const isMonorepo = existsSync(path.join(monorepoRoot, 'pnpm-workspace.yaml'))
|
|
14
|
+
|
|
15
|
+
const nextConfig: NextConfig = {
|
|
16
|
+
reactStrictMode: true,
|
|
17
|
+
//KNOWN ISSUE: Payload server actions/hooks currently send large payloads, so we need to increase the body size limit.
|
|
18
|
+
experimental: { serverActions: { bodySizeLimit: '5mb' } },
|
|
19
|
+
turbopack: {
|
|
20
|
+
root: isMonorepo ? monorepoRoot : __dirname,
|
|
21
|
+
resolveExtensions: ['.ts', '.tsx', '.js', '.mjs', '.json'],
|
|
22
|
+
},
|
|
23
|
+
images: {
|
|
24
|
+
remotePatterns: [
|
|
25
|
+
...[NEXT_PUBLIC_SERVER_URL].map((item) => {
|
|
26
|
+
const { hostname, protocol } = new URL(item)
|
|
27
|
+
|
|
28
|
+
return { hostname, protocol: protocol.replace(':', '') as 'http' | 'https' }
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === 'true' })
|
|
35
|
+
|
|
36
|
+
export default withBundleAnalyzer(withPayload(nextConfig, { devBundleServerPackages: false }))
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "atomic-payload",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "The Payload CMS Starter Where All You Need To Know Is Tailwind.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"lint": "pnpm exec eslint .",
|
|
9
|
+
"payload": "payload",
|
|
10
|
+
"start": "next start",
|
|
11
|
+
"build": "next build",
|
|
12
|
+
"dev": "next dev",
|
|
13
|
+
"prebuild": "pnpm download:fonts",
|
|
14
|
+
"download:fonts": "pnpm exec tsx src/collections/fonts/script.ts",
|
|
15
|
+
"generate:types": "cross-env NODE_OPTIONS=\"--conditions=react-server\" payload generate:types",
|
|
16
|
+
"generate:importmap": "cross-env NODE_OPTIONS=\"--conditions=react-server\" payload generate:importmap"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@base-ui-components/react": "1.0.0-rc.0",
|
|
20
|
+
"@mux/blurup": "^1.0.2",
|
|
21
|
+
"@mux/mux-video-react": "^0.25.3",
|
|
22
|
+
"@next/bundle-analyzer": "^16.1.6",
|
|
23
|
+
"@next/third-parties": "^16.1.6",
|
|
24
|
+
"@oversightstudio/blur-data-urls": "^1.0.4",
|
|
25
|
+
"@oversightstudio/mux-video": "^1.4.0",
|
|
26
|
+
"@payloadcms/db-mongodb": "^3.79.0",
|
|
27
|
+
"@payloadcms/email-resend": "^3.79.0",
|
|
28
|
+
"@payloadcms/live-preview-react": "^3.79.0",
|
|
29
|
+
"@payloadcms/next": "^3.79.0",
|
|
30
|
+
"@payloadcms/plugin-form-builder": "^3.79.0",
|
|
31
|
+
"@payloadcms/plugin-nested-docs": "^3.79.0",
|
|
32
|
+
"@payloadcms/richtext-lexical": "^3.79.0",
|
|
33
|
+
"@payloadcms/sdk": "^3.79.0",
|
|
34
|
+
"@payloadcms/storage-vercel-blob": "^3.79.0",
|
|
35
|
+
"@payloadcms/ui": "^3.79.0",
|
|
36
|
+
"@vercel/analytics": "^1.6.1",
|
|
37
|
+
"cross-env": "^10.1.0",
|
|
38
|
+
"dayjs": "^1.11.19",
|
|
39
|
+
"dotenv": "^17.3.1",
|
|
40
|
+
"next": "^16.1.6",
|
|
41
|
+
"next-themes": "^0.4.6",
|
|
42
|
+
"payload": "^3.79.0",
|
|
43
|
+
"posthog-js": "^1.360.0",
|
|
44
|
+
"react": "^19.2.4",
|
|
45
|
+
"react-dom": "^19.2.4",
|
|
46
|
+
"server-only": "^0.0.1",
|
|
47
|
+
"sharp": "^0.32.6",
|
|
48
|
+
"svg-path-bbox": "^2.1.0",
|
|
49
|
+
"svgo": "^3.3.3",
|
|
50
|
+
"traverse": "^0.6.11",
|
|
51
|
+
"zod": "4.1.11",
|
|
52
|
+
"zustand": "^5.0.11"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/json-schema": "^7.0.15",
|
|
56
|
+
"@types/node": "^22.19.15",
|
|
57
|
+
"@types/react": "^19.2.14",
|
|
58
|
+
"@types/react-dom": "^19.2.3",
|
|
59
|
+
"@types/traverse": "^0.6.37",
|
|
60
|
+
"eslint": "^9.39.4",
|
|
61
|
+
"eslint-config-next": "^16.1.6",
|
|
62
|
+
"prettier": "^3.8.1",
|
|
63
|
+
"tsx": "^4.21.0",
|
|
64
|
+
"typescript": "5.8.3",
|
|
65
|
+
"unocss": "^66.6.6"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": "24.x"
|
|
69
|
+
},
|
|
70
|
+
"pnpm": {
|
|
71
|
+
"onlyBuiltDependencies": [
|
|
72
|
+
"sharp"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128pt" height="128pt" viewBox="0 0 128 128"><path fill="#2bff74" d="m78.914 57.711-1.453 6.258v-.004a14.339 14.339 0 0 0 10.082-2.895l-4.54-4.539a8.378 8.378 0 0 1-4.089 1.18zM40.215 122l38.484-9.164V92.539l-34.102 19.234zM15.164 49.301 6 87.785l10.227-4.383L35.46 49.3zM70.297 48.922a8.3 8.3 0 0 1 1.172-3.926l-4.54-4.539a14.6 14.6 0 0 0-2.952 8.844c0 .328 0 .66.035 1zM86.465 5.133A36.428 36.428 0 0 0 78.633 6L122 49.367A36.331 36.331 0 0 0 86.465 5.133z"/><path fill="#2ecc70" d="M54.762 23.648 20.324 84.695l10 10L51.972 73.05a2.108 2.108 0 0 1 2.977 0c.82.824.82 2.152 0 2.977L33.3 97.672l10 10 61.05-34.434a36.424 36.424 0 0 0 16.302-19.266L74.028 7.347a36.427 36.427 0 0 0-19.266 16.3zM103.938 49.3a25.243 25.243 0 0 1-25.239 25.239 25.23 25.23 0 0 1-17.844-7.395 25.228 25.228 0 0 1 0-35.692 25.241 25.241 0 0 1 17.844-7.39 25.281 25.281 0 0 1 17.84 7.398 25.279 25.279 0 0 1 7.399 17.84z"/><path fill="#2ecc70" d="M78.699 70.332a21.02 21.02 0 0 0 14.871-6.16 21.028 21.028 0 0 0 0-29.742c-3.941-3.946-9.293-6.16-14.871-6.16s-10.926 2.214-14.871 6.16a21.02 21.02 0 0 0-6.16 14.87 21.048 21.048 0 0 0 6.168 14.864 21.05 21.05 0 0 0 14.863 6.168zm13.398-7.676h.004a18.813 18.813 0 0 1-13.402 5.57 19.11 19.11 0 0 1-4.266-.496 2.081 2.081 0 0 1-1.312-.937 2.105 2.105 0 0 1-.266-1.59l2.38-10.242a2.111 2.111 0 0 1 2.522-1.574 4.111 4.111 0 0 0 3.93-1.129c.395-.398.93-.625 1.492-.625a1.91 1.91 0 0 1 1.493.613l7.437 7.438c.82.82.82 2.152 0 2.972zm-14.023-19.96 2.383-10.243.004-.004c.125-.543.46-1.015.937-1.308a2.077 2.077 0 0 1 1.586-.262 18.994 18.994 0 0 1 14.188 14.32 2.102 2.102 0 0 1-1.602 2.508L85.293 49.95l.004.004a2.098 2.098 0 0 1-2.5-1.59 4.214 4.214 0 0 0-3.133-3.144 2.116 2.116 0 0 1-1.312-.938 2.094 2.094 0 0 1-.262-1.586zm-1.488 6.6.004-.003a2.051 2.051 0 0 1 1.644-2.106 2.15 2.15 0 0 1 1.977.586c.508.52.718 1.262.55 1.97a2.283 2.283 0 0 1-2.07 1.66 2.193 2.193 0 0 1-2.09-2.11zM65.332 35.9l.004-.004c.82-.82 2.148-.82 2.968 0l7.438 7.437a2.095 2.095 0 0 1 0 2.98 4.181 4.181 0 0 0-1.25 2.99c0 .288.031.577.086.859a2.1 2.1 0 0 1-1.598 2.484l-10.27 2.242a2.103 2.103 0 0 1-2.508-1.613 19.114 19.114 0 0 1-.422-3.973 18.8 18.8 0 0 1 5.563-13.41z"/><path fill="#2ecc70" d="m86.164 45.457 6.293-1.375a14.823 14.823 0 0 0-8.398-8.48l-1.457 6.265a8.47 8.47 0 0 1 3.562 3.59z"/></svg>
|
|
Binary file
|