21 Commits

Author SHA1 Message Date
58dbcdd25a chore(release): v0.1.13
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 57s
2026-02-01 21:17:39 -05:00
8ae6dafb62 feat: TinyMCE list style
Some checks failed
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Has been cancelled
2026-02-01 21:17:21 -05:00
faf39ca182 fix: wrangler.json needed for wrangler types before build
All checks were successful
Deployment / wordpress (push) Successful in 7s
Deployment / nuxt (push) Successful in 1m2s
2026-02-01 21:09:51 -05:00
8d350bb092 chore(release): v0.1.12
Some checks failed
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Failing after 9s
2026-01-30 16:31:44 -05:00
4338028c60 feat: Event context type for Cloudflare environment
Some checks failed
Deployment / wordpress (push) Successful in 5s
Deployment / nuxt (push) Has been cancelled
2026-01-30 16:31:29 -05:00
ab563a7b37 feat: parseAcfMedia
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 1m1s
2026-01-30 15:50:06 -05:00
2cfc1a0047 feat: parseAcfLink 2026-01-30 15:43:49 -05:00
98e8d971e8 feat: showLabel 2026-01-30 15:43:37 -05:00
87be06ecea feat: connexionButton 2026-01-30 15:39:32 -05:00
28f6e1ae7c fix: UApp in app.vue 2026-01-30 15:39:19 -05:00
27380290e1 chore(release): v0.1.11
All checks were successful
Deployment / wordpress (push) Successful in 5s
Deployment / nuxt (push) Successful in 56s
2026-01-30 14:38:25 -05:00
7e44554767 chore: Update deps
Some checks failed
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Has been cancelled
2026-01-30 14:38:11 -05:00
9c3dceef84 fix: ENABLE_CLOUDFLARE_IMAGE
All checks were successful
Deployment / wordpress (push) Successful in 5s
Deployment / nuxt (push) Successful in 53s
2026-01-30 14:35:21 -05:00
ba8d8e00a8 chore: Update README.md
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 59s
2026-01-30 14:29:26 -05:00
8f037b5950 fix: wrangler project name
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 57s
2026-01-30 14:13:21 -05:00
291fa6eaa4 fix: Cloudflare image provider only in production 2026-01-30 12:20:30 -05:00
4079e4ecfb minor: configure image formats in nuxt.config.ts 2026-01-30 12:10:30 -05:00
eea020b136 fix: remove unneeded wrangler main / assets 2026-01-30 11:51:03 -05:00
5161bff624 minor: typo in component name 2026-01-30 11:50:37 -05:00
3199835e83 feat: AcfSocial / parseAcfSocial 2026-01-30 11:45:39 -05:00
6dd13ead91 feat: mapSocialIcon 2026-01-30 11:18:10 -05:00
36 changed files with 731 additions and 340 deletions

View File

@@ -3,4 +3,3 @@
Headless WordPress project boilerplate using Nuxt. Headless WordPress project boilerplate using Nuxt.
[✨  Release notes](/wp-content/themes/moonshine/CHANGELOG.md) [✨  Release notes](/wp-content/themes/moonshine/CHANGELOG.md)

View File

@@ -25,3 +25,4 @@ logs
# Wrangler files # Wrangler files
.wrangler .wrangler
server/types/cloudflare.d.ts

View File

@@ -1,5 +1,49 @@
# Changelog # Changelog
## v0.1.13
[compare changes](https://gitea.websimple.com/wp-sites/wp-headless/compare/v0.1.12...v0.1.13)
### 🚀 Enhancements
- TinyMCE list style (8ae6daf)
### 🩹 Fixes
- Wrangler.json needed for wrangler types before build (faf39ca)
## v0.1.12
[compare changes](https://gitea.websimple.com/wp-sites/wp-headless/compare/v0.1.11...v0.1.12)
### 🚀 Enhancements
- ConnexionButton (87be06e)
- ShowLabel (98e8d97)
- ParseAcfLink (2cfc1a0)
- ParseAcfMedia (ab563a7)
- Event context type for Cloudflare environment (4338028)
### 🩹 Fixes
- UApp in app.vue (28f6e1a)
## v0.1.11
[compare changes](https://gitea.websimple.com/wp-sites/wp-headless/compare/v0.1.10...v0.1.11)
### 🚀 Enhancements
- MapSocialIcon (6dd13ea)
- AcfSocial / parseAcfSocial (3199835)
### 🩹 Fixes
- Remove unneeded wrangler main / assets (eea020b)
- Cloudflare image provider only in production (291fa6e)
- Wrangler project name (8f037b5)
- ENABLE_CLOUDFLARE_IMAGE (9c3dcee)
## v0.1.10 ## v0.1.10
[compare changes](https://gitea.websimple.com/templates/wp-headless/compare/v0.1.9...v0.1.10) [compare changes](https://gitea.websimple.com/templates/wp-headless/compare/v0.1.9...v0.1.10)

View File

@@ -6,7 +6,14 @@ Thème WordPress en headless basé sur Nuxt.
| Nom | Description | Exemple | Requise | | Nom | Description | Exemple | Requise |
|-----|-------------|---------|---------| |-----|-------------|---------|---------|
| `NUXT_SESSION_PASSWORD` | Clé secrète pour l'authentification | `date \| md5sum` | ✅ |
| `NUXT_WP_URL` | URL du backend WordPress | https://wp.exemple.com | ✅ |
| `NUXT_SITE_URL` | URL du frontend Nuxt | https://www.example.com | |
| `NUXT_SITE_ENV` | Environnement | staging \| production | | | `NUXT_SITE_ENV` | Environnement | staging \| production | |
| `NUXT_SITE_URL` | URL du frontend Nuxt | https://www.example.com | |
| `NUXT_WP_URL` | URL du backend WordPress | https://wp.exemple.com | ✅ |
## Secrets
Configurer les secrets nécessaires au projet:
```sh
pnpm wrangler secret put NUXT_SESSION_PASSWORD
```

View File

@@ -0,0 +1,86 @@
{
"key": "group_abstract_social",
"title": "Abstract - Social",
"fields": [
{
"key": "field_6855a1d643408",
"label": "Médias sociaux",
"name": "profiles",
"aria-label": "",
"type": "repeater",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"acfe_repeater_stylised_button": 0,
"layout": "table",
"pagination": 0,
"min": 0,
"max": 0,
"collapsed": "",
"button_label": "Ajouter un élément",
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "profiles",
"graphql_non_null": 1,
"rows_per_page": 20,
"sub_fields": [
{
"key": "field_6855a7e143409",
"label": "URL",
"name": "url",
"aria-label": "",
"type": "url",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"allow_in_bindings": 0,
"placeholder": "",
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "url",
"graphql_non_null": 1,
"parent_repeater": "field_6855a1d643408"
}
]
}
],
"location": [
[
{
"param": "abstract"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "seamless",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": "",
"show_in_rest": 0,
"display_title": "",
"acfe_autosync": [
"json"
],
"acfe_form": 0,
"show_in_graphql": 1,
"graphql_field_name": "GroupAbstractSocial",
"map_graphql_types_from_location_rules": 0,
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1769788591
}

View File

@@ -48,6 +48,34 @@
"graphql_field_name": "phoneNumber", "graphql_field_name": "phoneNumber",
"graphql_non_null": 1 "graphql_non_null": 1
}, },
{
"key": "field_697cd4c5fc56a",
"label": "Médias sociaux",
"name": "social",
"aria-label": "",
"type": "clone",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"graphql_field_name": "social",
"clone": [
"group_abstract_social"
],
"display": "seamless",
"layout": "block",
"prefix_label": 0,
"prefix_name": 0,
"acfe_seamless_style": 0,
"acfe_clone_modal": 0,
"acfe_clone_modal_close": 0,
"acfe_clone_modal_button": "",
"acfe_clone_modal_size": "large"
},
{ {
"key": "field_697cc921234cc", "key": "field_697cc921234cc",
"label": "Liens globaux", "label": "Liens globaux",
@@ -126,5 +154,5 @@
"graphql_types": "", "graphql_types": "",
"acfe_meta": "", "acfe_meta": "",
"acfe_note": "", "acfe_note": "",
"modified": 1769785750 "modified": 1769788698
} }

View File

@@ -1,9 +1,13 @@
<script setup lang="ts">
import { fr } from "@nuxt/ui/locale";
</script>
<template> <template>
<div> <UApp :locale="fr">
<NuxtRouteAnnouncer /> <NuxtRouteAnnouncer />
<NuxtLoadingIndicator /> <NuxtLoadingIndicator />
<NuxtLayout> <NuxtLayout>
<NuxtPage /> <NuxtPage />
</NuxtLayout> </NuxtLayout>
</div> </UApp>
</template> </template>

View File

@@ -4,6 +4,7 @@
@import "./a11y.css"; @import "./a11y.css";
@import "./containers.css"; @import "./containers.css";
@import "./links.css"; @import "./links.css";
@import "./lists.css";
@import "./prose.css"; @import "./prose.css";
@import "./typography.css"; @import "./typography.css";

View File

@@ -0,0 +1,3 @@
@utility list-horizontal {
@apply list-none flex flex-wrap items-center gap-3;
}

View File

@@ -12,7 +12,6 @@ defineProps<{ image?: AcfImageFragment }>();
:width="image.mediaDetails?.width" :width="image.mediaDetails?.width"
:height="image.mediaDetails?.height" :height="image.mediaDetails?.height"
:style="{ objectPosition: image.objectPosition || 'center' }" :style="{ objectPosition: image.objectPosition || 'center' }"
format="avif,webp"
placeholder placeholder
/> />
</template> </template>

View File

@@ -4,9 +4,10 @@ import type { ButtonProps } from "@nuxt/ui";
type AcfLinkButtonProps = & Omit<ButtonProps, "to" | "target" | "href"> & { type AcfLinkButtonProps = & Omit<ButtonProps, "to" | "target" | "href"> & {
link?: AcfLinkFragment; link?: AcfLinkFragment;
showLabel?: boolean;
}; };
const { link, ...buttonProps } = defineProps<AcfLinkButtonProps>(); const { link, showLabel, ...buttonProps } = defineProps<AcfLinkButtonProps>();
</script> </script>
<template> <template>
@@ -18,6 +19,6 @@ const { link, ...buttonProps } = defineProps<AcfLinkButtonProps>();
:external="link.target === '_blank'" :external="link.target === '_blank'"
:rel="link.target === '_blank' ? 'noopener noreferrer' : undefined" :rel="link.target === '_blank' ? 'noopener noreferrer' : undefined"
> >
<slot>{{ link.title }}</slot> <slot>{{ showLabel ? link.title : "" }}</slot>
</UButton> </UButton>
</template> </template>

View File

@@ -1,9 +1,5 @@
fragment AcfMedia on GroupAbstractMedia_Fields { fragment AcfMedia on GroupAbstractMedia_Fields {
image { image { node { ... AcfImage } }
node {
...AcfImage
}
}
aspectRatio aspectRatio
objectFit objectFit
} }

View File

@@ -0,0 +1,5 @@
fragment AcfSocial on GroupAbstractSocial_Fields {
profiles {
url
}
}

View File

@@ -0,0 +1,11 @@
<script setup lang="ts">
defineProps<{ social?: AcfSocialOutput }>();
</script>
<template>
<div v-if="social?.profiles" class="flex gap-1.5">
<a v-for="({ url, icon }, key) in social.profiles" :key="key" :href="url" target="_blank" rel="noopener noreferrer" class="flex">
<UIcon :name="icon" />
</a>
</div>
</template>

View File

@@ -1,20 +0,0 @@
<script setup lang="ts">
const { isLoggedIn } = useAuth();
const attrs = computed(() => {
return isLoggedIn.value
? {
label: "Déconnexion",
icon: "i-lucide-log-out",
}
: {
label: "Connexion",
icon: "i-lucide-log-in",
};
});
</script>
<template>
<AuthState>
<UButton to="/connexion" v-bind="attrs" color="neutral" />
</AuthState>
</template>

View File

@@ -34,7 +34,7 @@ const classes = tvSectionHeroSplit({
<section :class="classes.base()"> <section :class="classes.base()">
<div :class="classes.container()"> <div :class="classes.container()">
<UiProse :content="content" :class="classes.content()" /> <UiProse :content="content" :class="classes.content()" />
<AcfMedia :media="$props" :class="classes.media()" /> <AcfMedia :media="parseAcfMedia(props)" :class="classes.media()" />
</div> </div>
</section> </section>
</template> </template>

View File

@@ -1,13 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
const { data: siteOptions } = await useSiteOptions();
</script> </script>
<template> <template>
<UFooter id="site-footer"> <footer class="bg-accented links:link-prose">
<template #left> <div class="container py-6">
<SiteFooterCopyright /> <AcfSocial :social="parseAcfSocial(siteOptions)" />
</template> </div>
<template #right> <SiteFooterBottom />
<SiteFooterCredits /> </footer>
</template>
</UFooter>
</template> </template>

View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
const { connexionButton } = useAuthConnexion();
</script>
<template>
<div class="bg-inverted text-inverted py-1.5">
<div class="container flex flex-col sm:flex-row items-center gap-3">
<SiteFooterCopyright class="sm:mr-auto" />
<UButton v-bind="connexionButton" color="neutral" variant="link" />
<SiteFooterCredits />
</div>
</div>
</template>

View File

@@ -8,8 +8,5 @@
<SvgSiteLogo class="h-12 w-auto" /> <SvgSiteLogo class="h-12 w-auto" />
</NuxtLink> </NuxtLink>
</template> </template>
<template #right>
<AuthConnexionButton />
</template>
</UHeader> </UHeader>
</template> </template>

View File

@@ -2,5 +2,6 @@ export function useAuth() {
const { loggedIn: isLoggedIn, session } = useUserSession(); const { loggedIn: isLoggedIn, session } = useUserSession();
const hasRole = (role: string) => session.value?.user?.roles?.includes(role) || false; const hasRole = (role: string) => session.value?.user?.roles?.includes(role) || false;
const isAdmin = computed(() => hasRole("administrator")); const isAdmin = computed(() => hasRole("administrator"));
return { isLoggedIn, hasRole, isAdmin }; return { isLoggedIn, hasRole, isAdmin };
} }

View File

@@ -3,6 +3,7 @@ import type { FormSubmitEvent } from "@nuxt/ui";
const isRedirecting = ref(false); const isRedirecting = ref(false);
export function useAuthConnexion() { export function useAuthConnexion() {
const { isLoggedIn } = useAuth();
const toast = useToast(); const toast = useToast();
const { fetch: refreshUserSession } = useUserSession(); const { fetch: refreshUserSession } = useUserSession();
const routeRedirect = useRoute().query.redirect as string || undefined; const routeRedirect = useRoute().query.redirect as string || undefined;
@@ -67,5 +68,12 @@ export function useAuthConnexion() {
} }
} }
return { isRedirecting, login, logout }; // Dynamic connexion link
const connexionButton = computed(() => ({
label: isLoggedIn.value ? "Déconnexion" : "Connexion",
icon: isLoggedIn.value ? "i-lucide-log-out" : "i-lucide-log-in",
to: "/connexion",
}));
return { isRedirecting, login, logout, connexionButton };
} }

View File

@@ -1,6 +1,7 @@
fragment SiteOptions on GroupSiteOptions { fragment SiteOptions on GroupSiteOptions {
email email
phoneNumber { ... AcfPhone } phoneNumber { ... AcfPhone }
...AcfSocial
links { links {
contact { ... AcfLink} contact { ... AcfLink}
} }

View File

@@ -1,13 +1,9 @@
<script setup lang="ts">
import { fr } from "@nuxt/ui/locale";
</script>
<template> <template>
<UApp id="layout-default" :locale="fr"> <div id="layout-default">
<SiteHeader /> <SiteHeader />
<UMain> <UMain>
<slot /> <slot />
</UMain> </UMain>
<SiteFooter /> <SiteFooter />
</UApp> </div>
</template> </template>

View File

@@ -0,0 +1,18 @@
import * as z from "zod";
import type { AcfLinkFragment } from "#graphql/operations";
const acfLinkSchema = z.object({
title: z.string(),
url: z.string(),
target: z.string().optional().default(""),
});
export type AcfLinkOutput = z.infer<typeof acfLinkSchema>;
export function parseAcfLink(data?: Partial<AcfLinkFragment>) {
try {
return acfLinkSchema.parse(data);
}
catch {
return undefined;
}
}

View File

@@ -0,0 +1,29 @@
import type { AcfMediaFragment } from "#graphql/operations";
import * as z from "zod";
export const acfImageSchema = z.object({
src: z.url(),
alt: z.string(),
mediaDetails: z.object({
width: z.number(),
height: z.number(),
}),
objectPosition: z.string().optional().default("center"),
});
export const acfMediaSchema = z.object({
image: z.object({
node: acfImageSchema,
}),
aspectRatio: z.enum(["square", "video", "portrait", "auto"]).optional().default("auto"),
objectFit: z.enum(["cover", "contain"]).optional().default("cover"),
});
export function parseAcfMedia(data?: Partial<AcfMediaFragment>) {
try {
return acfMediaSchema.parse(data);
}
catch {
return undefined;
}
}

View File

@@ -0,0 +1,32 @@
import * as z from "zod";
import type { AcfSocialFragment } from "#graphql/operations";
const socialProfile = z.object({ url: z.url() }).transform(({ url }) => ({ url, icon: getSocialIcon(url) }));
const acfSocialSchema = z.object({
profiles: z.array(socialProfile),
});
export type AcfSocialOutput = z.infer<typeof acfSocialSchema>;
export function parseAcfSocial(data?: AcfSocialFragment) {
try {
return acfSocialSchema.parse(data);
}
catch {
return undefined;
}
}
const socialIconMap = {
"facebook.com": "i-cib-facebook-f",
"twitter.com": "i-cib-twitter",
"x.com": "i-cib-twitter",
"instagram.com": "i-cib-instagram",
"youtube.com": "i-cib-youtube",
"linkedin.com": "i-cib-linkedin",
"tiktok.com": "i-cib-tiktok",
};
function getSocialIcon(url: string): string {
const domain = new URL(url).hostname.toLowerCase().replace(/^www\./, "");
return socialIconMap[domain as keyof typeof socialIconMap] ?? "i-lucide-globe";
}

File diff suppressed because one or more lines are too long

View File

@@ -50,6 +50,16 @@ function moonshine_tiny_mce_before_init( $settings ) {
), ),
), ),
), ),
array(
'title' => __( "List styles", 'moonshine' ),
'items' => array(// List styles
array(
'title' => "Liste horizontale",
'selector' => 'ul,ol',
'classes' => 'list-horizontal',
),
),
),
array( array(
'title' => __( "Heading styles", 'moonshine' ), 'title' => __( "Heading styles", 'moonshine' ),
'items' => array(// Heading styles 'items' => array(// Heading styles

View File

@@ -1,6 +1,6 @@
<?php <?php
// Override TermConnection query args // Override term connection query args
add_filter( 'graphql_term_object_connection_query_args', 'moonshine_graphql_term_object_connection_query_args', 10, 3 ); add_filter( 'graphql_term_object_connection_query_args', 'moonshine_graphql_term_object_connection_query_args', 10, 3 );
function moonshine_graphql_term_object_connection_query_args( $query_args, $source, $args ) { function moonshine_graphql_term_object_connection_query_args( $query_args, $source, $args ) {
// Sort by 'order' meta value instead of legacy 'term_order' field // Sort by 'order' meta value instead of legacy 'term_order' field

View File

@@ -1,2 +1,29 @@
<?php <?php
return ['project-id-version'=>'Moonshine','report-msgid-bugs-to'=>'','pot-creation-date'=>'2026-01-13 15:52+0000','po-revision-date'=>'2026-01-29 02:55+0000','last-translator'=>'','language-team'=>'Français du Canada','language'=>'fr_CA','plural-forms'=>'nplurals=2; plural=n > 1;','mime-version'=>'1.0','content-type'=>'text/plain; charset=UTF-8','content-transfer-encoding'=>'8bit','x-generator'=>'Loco https://localise.biz/','x-loco-version'=>'2.8.1; wp-6.9; php-8.3.27','x-domain'=>'moonshine','messages'=>['Heading styles'=>'Styles de titres','Headless WordPress theme based on Nuxt.'=>'Thème Wordpress headless basé sur Nuxt.','https://websimple.com/'=>'https://websimple.com/','Inline styles'=>'Styles de caractères','Link styles'=>'Styles de liens','Main menu'=>'Menu principal','Moonshine'=>'Moonshine','Paragraph styles'=>'Styles de paragraphes','Pascal Martineau '=>'Pascal Martineau ','Semi-bold'=>'Semi-gras']]; return array(
'project-id-version' => 'Moonshine',
'report-msgid-bugs-to' => '',
'pot-creation-date' => '2026-01-13 15:52+0000',
'po-revision-date' => '2026-01-29 02:55+0000',
'last-translator' => '',
'language-team' => 'Français du Canada',
'language' => 'fr_CA',
'plural-forms' => 'nplurals=2; plural=n > 1;',
'mime-version' => '1.0',
'content-type' => 'text/plain; charset=UTF-8',
'content-transfer-encoding' => '8bit',
'x-generator' => 'Loco https://localise.biz/',
'x-loco-version' => '2.8.1; wp-6.9; php-8.3.27',
'x-domain' => 'moonshine',
'messages' => array(
'Heading styles' => 'Styles de titres',
'Headless WordPress theme based on Nuxt.' => 'Thème Wordpress headless basé sur Nuxt.',
'https://websimple.com/' => 'https://websimple.com/',
'Inline styles' => 'Styles de caractères',
'Link styles' => 'Styles de liens',
'Main menu' => 'Menu principal',
'Moonshine' => 'Moonshine',
'Paragraph styles' => 'Styles de paragraphes',
'Pascal Martineau ' => 'Pascal Martineau ',
'Semi-bold' => 'Semi-gras',
),
);

View File

@@ -1,7 +1,5 @@
import { version } from "./package.json"; import { version } from "./package.json";
const isDev = process.env.NODE_ENV !== "production";
const siteUrl = process.env.NUXT_SITE_URL; const siteUrl = process.env.NUXT_SITE_URL;
if (!siteUrl) { if (!siteUrl) {
throw new Error(`NUXT_SITE_URL is not defined. Make sure to set it in your build environment variables.`); throw new Error(`NUXT_SITE_URL is not defined. Make sure to set it in your build environment variables.`);
@@ -13,6 +11,8 @@ if (!wpUrl) {
} }
const wpDomain = new URL(wpUrl).hostname; const wpDomain = new URL(wpUrl).hostname;
const enableCloudflareImages = Boolean(process.env.ENABLE_CLOUDFLARE_IMAGES);
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
@@ -57,26 +57,13 @@ export default defineNuxtConfig({
preset: "cloudflare_module", preset: "cloudflare_module",
cloudflare: { cloudflare: {
deployConfig: true, deployConfig: true,
nodeCompat: true,
wrangler: { wrangler: {
// Project name name: "wp-headless",
name: "moonshine",
// Cloudflare Workers settings
compatibility_date: "2026-01-27",
main: "./.output/server/index.mjs",
observability: { enabled: true },
preview_urls: false,
// Environment variables
vars: { vars: {
NODE_ENV: "staging", NODE_ENV: "staging",
NUXT_SITE_URL: siteUrl, NUXT_SITE_URL: siteUrl,
NUXT_WP_URL: wpUrl, NUXT_WP_URL: wpUrl,
}, },
// Bindings
assets: {
binding: "ASSETS",
directory: "./.output/public/",
},
}, },
}, },
}, },
@@ -108,8 +95,10 @@ export default defineNuxtConfig({
}, },
image: { image: {
...isDev ? {} : { provider: "cloudflare", cloudflare: { baseURL: "/" } }, provider: enableCloudflareImages ? "cloudflare" : "none",
cloudflare: { baseURL: `${siteUrl}/` },
domains: [wpDomain], domains: [wpDomain],
format: ["avif", "webp"],
}, },
robots: { robots: {
@@ -123,4 +112,5 @@ export default defineNuxtConfig({
componentPrefix: "Svg", componentPrefix: "Svg",
defaultImport: "component", defaultImport: "component",
}, },
}); });

View File

@@ -1,22 +1,30 @@
{ {
"name": "@lewebsimple/moonshine", "name": "@lewebsimple/moonshine",
"description": "Headless WordPress theme based on Nuxt.", "description": "Headless WordPress theme based on Nuxt.",
"version": "0.1.10", "version": "0.1.13",
"type": "module", "type": "module",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "nuxt build", "build": "pnpm --sequential /build:.*/",
"editor-style": "pnpx @tailwindcss/cli -i ./app/assets/css/_main.css -o ./editor-style.css --minify", "build:nuxt": "nuxt build",
"dev": "nuxt dev", "dev": "nuxt dev",
"lint": "eslint --fix .", "editor-style": "pnpx @tailwindcss/cli -i ./app/assets/css/_main.css -o ./editor-style.css --minify",
"postinstall": "nuxt prepare", "lint": "eslint . --fix",
"preview": "pnpm run build && wrangler dev --port 3000", "postinstall": "pnpm --sequential /postinstall:.*/",
"release": "pnpm lint && changelogen --noAuthors --release --push", "postinstall:wrangler-types": "wrangler types ./server/types/cloudflare.d.ts",
"typecheck": "nuxt typecheck" "postinstall:nuxt": "nuxt prepare",
"preview": "pnpm --sequential /preview:.*/",
"preview:build": "pnpm run build",
"preview:wrangler-dev": "wrangler dev --port 3000",
"release": "pnpm --sequential /release:.*/",
"release:lint": "eslint .",
"release:typecheck": "nuxt typecheck",
"release:changelogen": "changelogen --noAuthors --release --push"
}, },
"dependencies": { "dependencies": {
"@iconify-json/cib": "^1.2.3",
"@iconify-json/lucide": "^1.2.87", "@iconify-json/lucide": "^1.2.87",
"@lewebsimple/nuxt-graphql": "^0.6.7", "@lewebsimple/nuxt-graphql": "^0.6.8",
"@nuxt/image": "^2.0.0", "@nuxt/image": "^2.0.0",
"@nuxt/ui": "4.3.0", "@nuxt/ui": "4.3.0",
"@nuxtjs/device": "4.0.0", "@nuxtjs/device": "4.0.0",

File diff suppressed because it is too large Load Diff

View File

@@ -3639,6 +3639,58 @@ interface GroupAbstractMedia_Fields implements AcfFieldGroup & AcfFieldGroupFiel
objectFit: String! objectFit: String!
} }
"""
The &quot;GroupAbstractSocial&quot; Field Group. Added to the Schema by &quot;WPGraphQL for ACF&quot;.
"""
type GroupAbstractSocial implements AcfFieldGroup & AcfFieldGroupFields & GroupAbstractSocial_Fields {
"""The name of the field group"""
fieldGroupName: String @deprecated(reason: "Use __typename instead")
"""
Field of the &quot;repeater&quot; Field Type added to the schema as part of the &quot;GroupAbstractSocial&quot; Field Group
"""
profiles: [GroupAbstractSocialProfiles]!
}
"""
The &quot;GroupAbstractSocialProfiles&quot; Field Group. Added to the Schema by &quot;WPGraphQL for ACF&quot;.
"""
type GroupAbstractSocialProfiles implements AcfFieldGroup & AcfFieldGroupFields & GroupAbstractSocialProfiles_Fields {
"""The name of the field group"""
fieldGroupName: String @deprecated(reason: "Use __typename instead")
"""
Field of the &quot;url&quot; Field Type added to the schema as part of the &quot;GroupAbstractSocialProfiles&quot; Field Group
"""
url: String!
}
"""
Interface representing fields of the ACF &quot;GroupAbstractSocialProfiles&quot; Field Group
"""
interface GroupAbstractSocialProfiles_Fields implements AcfFieldGroup & AcfFieldGroupFields {
"""The name of the field group"""
fieldGroupName: String @deprecated(reason: "Use __typename instead")
"""
Field of the &quot;url&quot; Field Type added to the schema as part of the &quot;GroupAbstractSocialProfiles&quot; Field Group
"""
url: String!
}
"""
Interface representing fields of the ACF &quot;GroupAbstractSocial&quot; Field Group
"""
interface GroupAbstractSocial_Fields implements AcfFieldGroup & AcfFieldGroupFields {
"""The name of the field group"""
fieldGroupName: String @deprecated(reason: "Use __typename instead")
"""
Field of the &quot;repeater&quot; Field Type added to the schema as part of the &quot;GroupAbstractSocial&quot; Field Group
"""
profiles: [GroupAbstractSocialProfiles]!
}
""" """
The &quot;GroupLayoutContained&quot; Field Group. Added to the Schema by &quot;WPGraphQL for ACF&quot;. The &quot;GroupLayoutContained&quot; Field Group. Added to the Schema by &quot;WPGraphQL for ACF&quot;.
""" """
@@ -3714,7 +3766,7 @@ interface GroupPostPage_Fields implements AcfFieldGroup & AcfFieldGroupFields &
""" """
The &quot;GroupSiteOptions&quot; Field Group. Added to the Schema by &quot;WPGraphQL for ACF&quot;. The &quot;GroupSiteOptions&quot; Field Group. Added to the Schema by &quot;WPGraphQL for ACF&quot;.
""" """
type GroupSiteOptions implements AcfFieldGroup & AcfFieldGroupFields & GroupSiteOptions_Fields { type GroupSiteOptions implements AcfFieldGroup & AcfFieldGroupFields & GroupAbstractSocial_Fields & GroupSiteOptions_Fields {
""" """
Field of the &quot;email&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group Field of the &quot;email&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group
""" """
@@ -3732,6 +3784,11 @@ type GroupSiteOptions implements AcfFieldGroup & AcfFieldGroupFields & GroupSite
Field of the &quot;phone&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group Field of the &quot;phone&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group
""" """
phoneNumber: AcfPhone! phoneNumber: AcfPhone!
"""
Field of the &quot;repeater&quot; Field Type added to the schema as part of the &quot;GroupAbstractSocial&quot; Field Group
"""
profiles: [GroupAbstractSocialProfiles]!
} }
""" """
@@ -3763,7 +3820,7 @@ interface GroupSiteOptionsLinks_Fields implements AcfFieldGroup & AcfFieldGroupF
""" """
Interface representing fields of the ACF &quot;GroupSiteOptions&quot; Field Group Interface representing fields of the ACF &quot;GroupSiteOptions&quot; Field Group
""" """
interface GroupSiteOptions_Fields implements AcfFieldGroup & AcfFieldGroupFields { interface GroupSiteOptions_Fields implements AcfFieldGroup & AcfFieldGroupFields & GroupAbstractSocial_Fields {
""" """
Field of the &quot;email&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group Field of the &quot;email&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group
""" """
@@ -3781,6 +3838,11 @@ interface GroupSiteOptions_Fields implements AcfFieldGroup & AcfFieldGroupFields
Field of the &quot;phone&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group Field of the &quot;phone&quot; Field Type added to the schema as part of the &quot;GroupSiteOptions&quot; Field Group
""" """
phoneNumber: AcfPhone! phoneNumber: AcfPhone!
"""
Field of the &quot;repeater&quot; Field Type added to the schema as part of the &quot;GroupAbstractSocial&quot; Field Group
"""
profiles: [GroupAbstractSocialProfiles]!
} }
""" """

View File

@@ -0,0 +1,9 @@
import "h3";
declare module "h3" {
interface H3EventContext {
cloudflare: {
env: Cloudflare.Env;
};
}
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "./node_modules/wrangler/config-schema.json",
"main": "./output/server/index.mjs",
"compatibility_date": "2026-01-27",
"compatibility_flags": [
"nodejs_compat"
],
"observability": {
"enabled": true
},
"preview_urls": false,
"assets": {
"binding": "ASSETS",
"directory": "../public"
}
}