14 Commits

Author SHA1 Message Date
b0c5e4c20f fix: Abstract social profiles should not be non-null
All checks were successful
Deployment / wordpress (push) Successful in 9s
Deployment / nuxt (push) Successful in 1m7s
2026-02-11 09:53:31 -05:00
2304d855b7 minor: site footer, auth connextion, input w-full 2026-02-11 09:26:21 -05:00
b45d3a02f0 chore: update deps 2026-02-11 09:25:29 -05:00
e9d6ca2f96 feat: UiLoadMore 2026-02-11 09:24:41 -05:00
fc6168e5a4 feat: auth middleware 2026-02-11 09:24:19 -05:00
3ec98fdc2d feat: useLayoutWrapper 2026-02-11 09:24:05 -05:00
71a48de945 feat: project.code-workspace 2026-02-11 09:11:11 -05:00
289b777cad chore: update plugins 2026-02-11 09:05:46 -05:00
18306c28b9 chore: update plugins / deps
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 1m0s
2026-02-04 21:53:39 -05:00
36e7d8ad8b chore: update oxlint / oxfmt settings 2026-02-04 13:31:08 -05:00
fdf32bbc78 feat: VSCode launch configurations 2026-02-03 09:19:08 -05:00
2c44d8137c chore: update deps
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 57s
2026-02-03 08:03:05 -05:00
db831700f0 fix: Wrangler config
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 56s
2026-02-01 22:47:21 -05:00
9bb09b89d9 feat: Replace eslint => oxlint + oxfmt
All checks were successful
Deployment / wordpress (push) Successful in 6s
Deployment / nuxt (push) Successful in 58s
2026-02-01 22:06:16 -05:00
85 changed files with 4961 additions and 20205 deletions

1
.gitignore vendored
View File

@@ -8,6 +8,7 @@
!/README.md
!/composer.*
!/phpcs.xml
!/project.code-workspace
!/wp-content/
/wp-content/*

20
.vscode/settings.json vendored
View File

@@ -1,20 +0,0 @@
{
"editor.quickSuggestions": {
"strings": "on"
},
"files.associations": {
"*.css": "tailwindcss"
},
"graphql-config.load.rootDir": "wp-content/themes/moonshine",
"tailwindCSS.classAttributes": [
"class",
"ui"
],
"tailwindCSS.experimental.classRegex": [
[
"ui:\\s*{([^)]*)\\s*}",
"(?:'|\"|`)([^']*)(?:'|\"|`)"
]
],
"typescript.tsdk": "wp-content/themes/moonshine/node_modules/typescript/lib"
}

44
composer.lock generated
View File

@@ -315,17 +315,17 @@
},
{
"name": "lewebsimple/acf-phone",
"version": "v3.1.0",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/lewebsimple/acf-phone.git",
"reference": "cf4c6440e0c2cdf7e422423bb629014204e721bf"
"reference": "f9cb86eacb26eb92a40eb5e4366cff3e58e01f47"
},
"dist": {
"type": "zip",
"url": "https://satis.ledevsimple.ca/dist/lewebsimple/acf-phone/lewebsimple-acf-phone-cf4c6440e0c2cdf7e422423bb629014204e721bf-zip-439080.zip",
"reference": "cf4c6440e0c2cdf7e422423bb629014204e721bf",
"shasum": "f9d7cbcf27985656245285e5bc035578621f1a69"
"url": "https://satis.ledevsimple.ca/dist/lewebsimple/acf-phone/lewebsimple-acf-phone-f9cb86eacb26eb92a40eb5e4366cff3e58e01f47-zip-606a09.zip",
"reference": "f9cb86eacb26eb92a40eb5e4366cff3e58e01f47",
"shasum": "2bbbc7d7f917e278d7d913bcb9da07a30f4662e6"
},
"require-dev": {
"lewebsimple/wp-phpcs-ruleset": "*",
@@ -345,10 +345,10 @@
]
},
"support": {
"source": "https://github.com/lewebsimple/acf-phone/tree/v3.1.0",
"source": "https://github.com/lewebsimple/acf-phone/tree/v3.1.1",
"issues": "https://github.com/lewebsimple/acf-phone/issues"
},
"time": "2026-01-30T15:01:34+00:00"
"time": "2026-02-10T17:56:38+00:00"
},
{
"name": "lewebsimple/advanced-custom-fields-pro",
@@ -369,20 +369,20 @@
},
{
"name": "lewebsimple/kaliroots",
"version": "v0.9.18",
"version": "v0.9.19",
"source": {
"type": "git",
"url": "ssh://git@gitea.websimple.com:222/wp-themes/kaliroots.git",
"reference": "720554dff6ea45216b52187b7e8d5b87200d55a4"
"reference": "40789468328e126cec9bd2f85a6a9923663a8d91"
},
"dist": {
"type": "zip",
"url": "https://satis.ledevsimple.ca/dist/lewebsimple/kaliroots/lewebsimple-kaliroots-v0.9.18-77d6cf.zip",
"reference": "720554dff6ea45216b52187b7e8d5b87200d55a4",
"shasum": "fd6aea0ef1bc160bc183eb7239cc9adf2fd88169"
"url": "https://satis.ledevsimple.ca/dist/lewebsimple/kaliroots/lewebsimple-kaliroots-v0.9.19-12b0b3.zip",
"reference": "40789468328e126cec9bd2f85a6a9923663a8d91",
"shasum": "0a4cadbbc7719ee7de94b5cff4b2bb9c436f6416"
},
"type": "wordpress-theme",
"time": "2025-10-10T12:11:22+00:00"
"time": "2026-02-09T15:07:56+00:00"
},
{
"name": "lewebsimple/wp-graphql-headless-login",
@@ -457,15 +457,15 @@
},
{
"name": "wpackagist-plugin/media-focus-point",
"version": "2.0.4",
"version": "2.0.5",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/media-focus-point/",
"reference": "tags/2.0.4"
"reference": "tags/2.0.5"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/media-focus-point.2.0.4.zip"
"url": "https://downloads.wordpress.org/plugin/media-focus-point.2.0.5.zip"
},
"require": {
"composer/installers": "^1.0 || ^2.0"
@@ -475,15 +475,15 @@
},
{
"name": "wpackagist-plugin/seo-by-rank-math",
"version": "1.0.263",
"version": "1.0.264",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/seo-by-rank-math/",
"reference": "tags/1.0.263"
"reference": "tags/1.0.264"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/seo-by-rank-math.1.0.263.zip"
"url": "https://downloads.wordpress.org/plugin/seo-by-rank-math.1.0.264.zip"
},
"require": {
"composer/installers": "^1.0 || ^2.0"
@@ -493,15 +493,15 @@
},
{
"name": "wpackagist-plugin/wp-graphql",
"version": "2.7.0",
"version": "2.8.0",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/wp-graphql/",
"reference": "tags/2.7.0"
"reference": "tags/2.8.0"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/wp-graphql.2.7.0.zip"
"url": "https://downloads.wordpress.org/plugin/wp-graphql.2.8.0.zip"
},
"require": {
"composer/installers": "^1.0 || ^2.0"

30
project.code-workspace Normal file
View File

@@ -0,0 +1,30 @@
{
"folders": [
{
"name": "Nuxt",
"path": "wp-content/themes/moonshine"
},
{
"name": "WordPress",
"path": "."
}
],
"settings": {
"files.associations": {
"*.css": "tailwindcss"
},
"editor.quickSuggestions": {
"strings": "on"
},
"tailwindCSS.classAttributes": [
"class",
"ui"
],
"tailwindCSS.experimental.classRegex": [
[
"ui:\\s*{([^)]*)\\s*}",
"(?:'|\"|`)([^']*)(?:'|\"|`)"
]
]
}
}

View File

@@ -0,0 +1,19 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"experimentalSortImports": {
"groups": [
["side-effect"],
["builtin"],
["external", "type-external"],
["internal", "type-internal"],
["parent", "type-parent"],
["sibling", "type-sibling"],
["index", "type-index"]
]
},
"experimentalTailwindcss": {
"attributes": ["class"],
"functions": ["tv"],
"stylesheet": "./app/assets/css/_main.css"
}
}

View File

@@ -0,0 +1,22 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {},
"env": {
"builtin": true,
"browser": true,
"node": true
},
"globals": {},
"ignorePatterns": [],
"plugins": ["import", "vue"],
"rules": {
"vue/define-emits-declaration": ["error", "type-based"],
"vue/define-props-declaration": ["error", "type-based"],
"vue/require-typed-ref": "error"
},
"settings": {
"vitest": {
"typecheck": false
}
}
}

View File

@@ -0,0 +1,3 @@
{
"recommendations": ["oxc.oxc-vscode"]
}

View File

@@ -0,0 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Nuxt server",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/nuxt/bin/nuxt.mjs",
"runtimeArgs": ["--inspect"],
"args": ["dev"],
"autoAttachChildProcesses": true,
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"]
},
{
"name": "Nuxt client",
"type": "chrome",
"request": "launch",
"sourceMaps": true,
"trace": false,
"url": "http://localhost:3000",
"userDataDir": "${env:HOME}/.vscode/chromium-profile"
}
]
}

View File

@@ -0,0 +1,35 @@
{
"[css]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[json]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[postcss]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[scss]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[vue]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.quickSuggestions": {
"strings": "on"
},
"eslint.enable": false
}

View File

@@ -190,7 +190,6 @@
## v0.1.1
### 🚀 Enhancements
- Initial Moonshine theme - Headless WordPress theme based on Nuxt (b3134fe)

View File

@@ -5,7 +5,7 @@ Thème WordPress en headless basé sur Nuxt.
## Variables d'environnement
| Nom | Description | Exemple | Requise |
|-----|-------------|---------|---------|
| --------------- | ------------------------ | ----------------------- | ------- |
| `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 | ✅ |

View File

@@ -24,11 +24,7 @@
"acfe_flexible_layouts_placeholder": 0,
"acfe_flexible_layouts_thumbnails": 0,
"acfe_flexible_async": [],
"acfe_flexible_add_actions": [
"copy",
"title",
"toggle"
],
"acfe_flexible_add_actions": ["copy", "title", "toggle"],
"acfe_flexible_remove_button": [],
"acfe_flexible_remove_top_actions": [],
"acfe_flexible_modal_edit": {
@@ -101,7 +97,9 @@
"max": "",
"acfe_flexible_modal_edit_size": "",
"acfe_flexible_settings": [
"group_layout_contained"
"group_layout_colored",
"group_layout_contained",
"group_layout_padded"
],
"acfe_flexible_settings_size": "large",
"acfe_flexible_render_template": false,
@@ -156,9 +154,7 @@
"id": ""
},
"graphql_field_name": "media",
"clone": [
"group_abstract_media"
],
"clone": ["group_abstract_media"],
"display": "seamless",
"layout": "block",
"prefix_label": 0,
@@ -198,7 +194,7 @@
"min": "",
"max": "",
"acfe_flexible_modal_edit_size": "",
"acfe_flexible_settings": "",
"acfe_flexible_settings": ["group_layout_colored", "group_layout_padded"],
"acfe_flexible_settings_size": "large",
"acfe_flexible_render_template": false,
"acfe_flexible_render_style": false,
@@ -231,16 +227,12 @@
"style": "seamless",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": [
"the_content"
],
"hide_on_screen": ["the_content"],
"active": true,
"description": "",
"show_in_rest": 0,
"display_title": "",
"acfe_autosync": [
"json"
],
"acfe_autosync": ["json"],
"acfe_form": 0,
"show_in_graphql": 1,
"graphql_field_name": "GroupAbstractBuilder",
@@ -248,5 +240,5 @@
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1769779666
"modified": 1770740697
}

View File

@@ -109,9 +109,7 @@
"description": "",
"show_in_rest": 0,
"display_title": "",
"acfe_autosync": [
"json"
],
"acfe_autosync": ["json"],
"acfe_form": 0,
"show_in_graphql": 1,
"graphql_field_name": "GroupAbstractMedia",

View File

@@ -26,7 +26,7 @@
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "profiles",
"graphql_non_null": 1,
"graphql_non_null": 0,
"rows_per_page": 20,
"sub_fields": [
{
@@ -82,5 +82,5 @@
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1769788591
"modified": 1770821599
}

View File

@@ -0,0 +1,64 @@
{
"key": "group_layout_colored",
"title": "Layout - Colored",
"fields": [
{
"key": "field_693c8c945ce51",
"label": "Variante de couleur",
"name": "color",
"aria-label": "",
"type": "button_group",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"default": "Par défaut",
"muted": "Atténué",
"elevated": "Surélevé",
"accented": "Accentué",
"inverted": "Inversé",
"primary": "Couleur principale"
},
"default_value": "default",
"return_format": "value",
"allow_null": 0,
"allow_in_bindings": 0,
"layout": "horizontal",
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "color",
"graphql_non_null": 1
}
],
"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": "GroupLayoutColored",
"map_graphql_types_from_location_rules": 0,
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1770132035
}

View File

@@ -4,10 +4,10 @@
"fields": [
{
"key": "field_68dc29d78941c",
"label": "Conteneur",
"label": "Largeur du contenu",
"name": "container",
"aria-label": "",
"type": "select",
"type": "button_group",
"instructions": "",
"required": 1,
"conditional_logic": 0,
@@ -21,101 +21,17 @@
"xl": "1280px",
"lg": "1024px",
"fluid": "Largeur fluide",
"none": "Pleine largeur"
"fullbleed": "Pleine largeur"
},
"default_value": "default",
"return_format": "value",
"multiple": 0,
"max": "",
"prepend": "",
"append": "",
"required_message": "",
"allow_null": 0,
"allow_in_bindings": 0,
"ui": 0,
"layout": "horizontal",
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "container",
"graphql_non_null": 1,
"ajax": 0,
"placeholder": "",
"create_options": 0,
"save_options": 0,
"allow_custom": 0,
"search_placeholder": "",
"min": ""
},
{
"key": "field_693c8c3b5ce50",
"label": "Espacement vertical",
"name": "vertical_padding",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"sm": "Petit (12px)",
"md": "Medium (24px)",
"lg": "Grand (48px)"
},
"default_value": "md",
"return_format": "value",
"multiple": 0,
"allow_null": 0,
"allow_in_bindings": 0,
"ui": 0,
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "verticalPadding",
"graphql_non_null": 1,
"ajax": 0,
"placeholder": "",
"create_options": 0,
"save_options": 0,
"allow_custom": 0,
"search_placeholder": ""
},
{
"key": "field_693c8c945ce51",
"label": "Couleur d'arrière-plan",
"name": "bg_color",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"default": "Par défaut",
"muted": "Atténué",
"inverted": "Inversé"
},
"default_value": "default",
"return_format": "value",
"multiple": 0,
"allow_null": 0,
"allow_in_bindings": 0,
"ui": 0,
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "bgColor",
"graphql_non_null": 1,
"ajax": 0,
"placeholder": "",
"create_options": 0,
"save_options": 0,
"allow_custom": 0,
"search_placeholder": ""
"graphql_non_null": 1
}
],
"location": [
@@ -135,9 +51,7 @@
"description": "",
"show_in_rest": 0,
"display_title": "",
"acfe_autosync": [
"json"
],
"acfe_autosync": ["json"],
"acfe_form": 0,
"show_in_graphql": 1,
"graphql_field_name": "GroupLayoutContained",
@@ -145,5 +59,5 @@
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1768358794
"modified": 1770740626
}

View File

@@ -0,0 +1,62 @@
{
"key": "group_layout_padded",
"title": "Layout - Padded",
"fields": [
{
"key": "field_693c8c3b5ce50",
"label": "Espacement intérieur vertical",
"name": "vertical_padding",
"aria-label": "",
"type": "button_group",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"none": "Aucun",
"sm": "Petit (12px)",
"md": "Medium (24px)",
"lg": "Grand (48px)"
},
"default_value": "md",
"return_format": "value",
"allow_null": 0,
"allow_in_bindings": 0,
"layout": "horizontal",
"show_in_graphql": 1,
"graphql_description": "",
"graphql_field_name": "verticalPadding",
"graphql_non_null": 1
}
],
"location": [
[
{
"param": "abstract"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "left",
"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": "GroupLayoutPadded",
"map_graphql_types_from_location_rules": 0,
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1770740636
}

View File

@@ -4,7 +4,7 @@
"fields": [
{
"key": "field_697220310aaaf",
"label": "Email",
"label": "Courriel",
"name": "email",
"aria-label": "",
"type": "email",
@@ -28,7 +28,7 @@
},
{
"key": "field_697cbf414fdd5",
"label": "Phone number",
"label": "Numéro de téléphone",
"name": "phone_number",
"aria-label": "",
"type": "phone",
@@ -55,7 +55,7 @@
"aria-label": "",
"type": "clone",
"instructions": "",
"required": 1,
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
@@ -97,6 +97,9 @@
"graphql_description": "",
"graphql_field_name": "links",
"graphql_non_null": 0,
"acfe_group_modal_close": 0,
"acfe_group_modal_button": "",
"acfe_group_modal_size": "large",
"sub_fields": [
{
"key": "field_697cc93e234cd",
@@ -119,10 +122,7 @@
"graphql_field_name": "contact",
"graphql_non_null": 1
}
],
"acfe_group_modal_close": 0,
"acfe_group_modal_button": "",
"acfe_group_modal_size": "large"
]
}
],
"location": [
@@ -154,5 +154,5 @@
"graphql_types": "",
"acfe_meta": "",
"acfe_note": "",
"modified": 1769788698
"modified": 1770820358
}

View File

@@ -17,9 +17,7 @@
"id": ""
},
"graphql_field_name": "builder",
"clone": [
"group_abstract_builder"
],
"clone": ["group_abstract_builder"],
"display": "seamless",
"layout": "block",
"prefix_label": 0,
@@ -45,16 +43,12 @@
"style": "seamless",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": [
"the_content"
],
"hide_on_screen": ["the_content"],
"active": true,
"description": "",
"show_in_rest": 0,
"display_title": "",
"acfe_autosync": [
"json"
],
"acfe_autosync": ["json"],
"acfe_form": 0,
"show_in_graphql": 1,
"graphql_field_name": "GroupPostPage",

View File

@@ -9,5 +9,15 @@ export default defineAppConfig({
base: "cursor-pointer",
},
},
input: {
slots: {
root: "w-full",
},
},
textarea: {
slots: {
root: "w-full",
},
},
},
});

View File

@@ -8,13 +8,27 @@
}
/* Container sizes */
@utility container { @apply mx-auto px-container max-w-(--breakpoint-2xl); }
@utility container-xl { @apply container max-w-(--breakpoint-xl); }
@utility container-lg { @apply container max-w-(--breakpoint-lg); }
@utility container-md { @apply container max-w-(--breakpoint-md); }
@utility container-sm { @apply container max-w-(--breakpoint-sm); }
@utility container-fluid { @apply container max-w-screen; }
@utility container-none { @apply w-full max-w-screen; }
@utility container {
@apply mx-auto px-container max-w-(--breakpoint-2xl);
}
@utility container-xl {
@apply container max-w-(--breakpoint-xl);
}
@utility container-lg {
@apply container max-w-(--breakpoint-lg);
}
@utility container-md {
@apply container max-w-(--breakpoint-md);
}
@utility container-sm {
@apply container max-w-(--breakpoint-sm);
}
@utility container-fluid {
@apply container max-w-screen;
}
@utility container-none {
@apply w-full max-w-screen;
}
/* Split containers */
:root {
@@ -42,6 +56,12 @@
}
}
@utility container-left { @apply ml-(--container-outside-margin) px-container;}
@utility container-right { @apply mr-(--container-outside-margin) px-container;}
@utility container-half { width: calc(var(--container-width) / 2);}
@utility container-left {
@apply ml-(--container-outside-margin) px-container;
}
@utility container-right {
@apply mr-(--container-outside-margin) px-container;
}
@utility container-half {
width: calc(var(--container-width) / 2);
}

View File

@@ -2,6 +2,12 @@
@custom-variant links (& a:not([class*='link-']):not([class*='button-']));
/* Link styles */
@utility link-base { @apply cursor-pointer disabled-default transition; }
@utility link-underline { @apply link-base underline hover:decoration-primary; }
@utility link-opacity { @apply link-base hover:opacity-80; }
@utility link-base {
@apply cursor-pointer disabled-default transition;
}
@utility link-underline {
@apply link-base underline hover:decoration-primary;
}
@utility link-opacity {
@apply link-base hover:opacity-80;
}

View File

@@ -1,15 +1,25 @@
@utility prose {
/* Headings (allow class overrides) */
h1:not([class*="heading-"]) { @apply heading-1; }
h2:not([class*="heading-"]) { @apply heading-2; }
h3:not([class*="heading-"]) { @apply heading-3; }
h4:not([class*="heading-"]) { @apply heading-4; }
h1:not([class*="heading-"]) {
@apply heading-1;
}
h2:not([class*="heading-"]) {
@apply heading-2;
}
h3:not([class*="heading-"]) {
@apply heading-3;
}
h4:not([class*="heading-"]) {
@apply heading-4;
}
/* Links */
@apply links:link-underline;
/* Paragraphs */
p:not([class*="paragraph-"]) { @apply paragraph-base; }
p:not([class*="paragraph-"]) {
@apply paragraph-base;
}
/* Spacing */
@apply space-y-2;

View File

@@ -1,10 +1,24 @@
/* Heading styles */
@utility heading-base { @apply font-bold tracking-tight };
@utility heading-1 { @apply heading-base text-4xl; }
@utility heading-2 { @apply heading-base text-3xl; }
@utility heading-3 { @apply heading-base text-2xl; }
@utility heading-4 { @apply heading-base text-xl; }
@utility heading-base {
@apply font-bold tracking-tight;
}
@utility heading-1 {
@apply heading-base text-4xl;
}
@utility heading-2 {
@apply heading-base text-3xl;
}
@utility heading-3 {
@apply heading-base text-2xl;
}
@utility heading-4 {
@apply heading-base text-xl;
}
/* Paragraph styles */
@utility paragraph-base { @apply font-sans; }
@utility paragraph-lead { @apply paragraph-base text-2xl; }
@utility paragraph-base {
@apply font-sans;
}
@utility paragraph-lead {
@apply paragraph-base text-2xl;
}

View File

@@ -2,7 +2,7 @@
import type { AcfLinkFragment } from "#graphql/operations";
import type { ButtonProps } from "@nuxt/ui";
type AcfLinkButtonProps = & Omit<ButtonProps, "to" | "target" | "href"> & {
type AcfLinkButtonProps = Omit<ButtonProps, "to" | "target" | "href"> & {
link?: AcfLinkFragment;
showLabel?: boolean;
};

View File

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

View File

@@ -4,7 +4,14 @@ defineProps<{ social?: AcfSocialOutput }>();
<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">
<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>

View File

@@ -7,7 +7,8 @@ const fields = [
label: "Courriel",
placeholder: "Entrez votre courriel",
required: true,
}, {
},
{
name: "password",
label: "Mot de passe",
type: "password" as const,

View File

@@ -5,12 +5,8 @@ const { logout } = useAuthConnexion();
<template>
<div class="w-full space-y-6">
<div class="flex flex-col text-center">
<div class="text-xl text-pretty font-semibold text-highlighted">
Déconnexion
</div>
<div class="mt-1 text-base text-pretty text-muted">
Veuillez confirmer la déconnexion.
</div>
<div class="text-xl font-semibold text-pretty text-highlighted">Déconnexion</div>
<div class="mt-1 text-base text-pretty text-muted">Veuillez confirmer la déconnexion.</div>
</div>
<UButton
icon="i-lucide-log-out"

View File

@@ -1,12 +1,8 @@
<template>
<div class="w-full space-y-6">
<div class="flex flex-col text-center">
<div class="text-xl text-pretty font-semibold text-highlighted">
Redirection en cours
</div>
<div class="mt-1 text-base text-pretty text-muted">
Veuillez patienter...
</div>
<div class="text-xl font-semibold text-pretty text-highlighted">Redirection en cours</div>
<div class="mt-1 text-base text-pretty text-muted">Veuillez patienter...</div>
</div>
</div>
</template>

View File

@@ -1,7 +1,11 @@
fragment BuilderSections on GroupAbstractBuilder_Fields {
sections {
__typename
... on GroupAbstractBuilderSectionsHeroSplitLayout { ... SectionHeroSplit }
... on GroupAbstractBuilderSectionsTextBlockLayout { ... SectionTextBlock }
... on GroupAbstractBuilderSectionsHeroSplitLayout {
...SectionHeroSplit
}
... on GroupAbstractBuilderSectionsTextBlockLayout {
...SectionTextBlock
}
}
}

View File

@@ -0,0 +1,3 @@
fragment LayoutColored on GroupLayoutColored_Fields {
color
}

View File

@@ -1,5 +1,3 @@
fragment LayoutContained on GroupLayoutContained_Fields {
container
verticalPadding
bgColor
}

View File

@@ -1,50 +0,0 @@
<script setup lang="ts">
import type { LayoutContainedFragment } from "#graphql/operations";
import { tv, type VariantProps } from "tailwind-variants";
const props = defineProps<LayoutContainedFragment>();
const layoutWrapperVariants = tv({
slots: {
base: "",
inner: "",
},
variants: {
container: {
default: { inner: "container" },
lg: { inner: "container-lg" },
xl: { inner: "container-xl" },
fluid: { inner: "container-fluid" },
none: { inner: "container-none" },
},
verticalPadding: {
sm: { base: "py-3" },
md: { base: "py-6" },
lg: { base: "py-12" },
},
bgColor: {
default: { base: "bg-default" },
muted: { base: "bg-muted" },
inverted: { base: "bg-inverted text-inverted" },
},
},
defaultVariants: {
container: "default",
verticalPadding: "md",
bgColor: "default",
},
});
const { base, inner } = layoutWrapperVariants({
container: props.container[0],
verticalPadding: props.verticalPadding[0],
bgColor: props.bgColor[0],
} as VariantProps<typeof layoutWrapperVariants>);
</script>
<template>
<section :class="base()">
<div :class="inner()">
<slot />
</div>
</section>
</template>

View File

@@ -0,0 +1,3 @@
fragment LayoutPadded on GroupLayoutPadded_Fields {
verticalPadding
}

View File

@@ -0,0 +1,12 @@
<script setup lang="ts">
const props = defineProps<{ layoutSettings?: LayoutSettings }>();
const { base, inner } = useLayoutWrapper(props.layoutSettings);
</script>
<template>
<section :class="base()">
<div :class="inner()">
<slot />
</div>
</section>
</template>

View File

@@ -6,9 +6,7 @@ defineProps<NodePageFragment>();
<template>
<div id="node-page">
<h1 v-if="!isFrontPage" class="font-bold text-4xl">
{{ title }}
</h1>
<PageHeader v-if="!isFrontPage" :title="title"></PageHeader>
<BuilderSections :sections="groupPostPage?.sections || []" />
</div>
</template>

View File

@@ -0,0 +1,15 @@
<script setup lang="ts">
defineProps<{
title?: string;
}>();
</script>
<template>
<header v-if="title" class="bg-accented py-6">
<div class="container">
<h1 class="heading-1">
{{ title }}
</h1>
</div>
</header>
</template>

View File

@@ -1,11 +1,13 @@
<script setup lang="ts">
const { isLoggedIn } = useAuth();
const { isRedirecting } = useAuthConnexion();
const layoutSettings: LayoutWrapperProps = {
container: "lg",
};
</script>
<template>
<section data-section-name="auth-connexion" class="py-12">
<div class="container-sm">
<LayoutWrapper data-section-name="auth-connexion" :layout-settings="layoutSettings">
<AuthState>
<AuthRedirecting v-if="isRedirecting" />
<template v-else>
@@ -13,6 +15,5 @@ const { isRedirecting } = useAuthConnexion();
<AuthLoginForm v-else />
</template>
</AuthState>
</div>
</section>
</LayoutWrapper>
</template>

View File

@@ -2,5 +2,8 @@ fragment SectionHeroSplit on GroupAbstractBuilderSectionsHeroSplitLayout {
content
reverse
...AcfMedia
layoutSettings {
...LayoutColored
...LayoutPadded
}
}

View File

@@ -3,9 +3,9 @@ import { tv, type VariantProps } from "tailwind-variants";
import type { SectionHeroSplitFragment } from "#graphql/operations";
const tvSectionHeroSplit = tv({
extend: tvLayoutWrapper,
slots: {
base: "py-6",
container: "container flex flex-col gap-6 items-center",
container: "container flex flex-col items-center gap-6",
content: "flex-1",
media: "w-full basis-1/2",
},
@@ -27,6 +27,7 @@ const tvSectionHeroSplit = tv({
const props = defineProps<SectionHeroSplitFragment>();
const classes = tvSectionHeroSplit({
reverse: props.reverse,
...props.layoutSettings,
} as VariantProps<typeof tvSectionHeroSplit>);
</script>

View File

@@ -1,6 +1,8 @@
fragment SectionTextBlock on GroupAbstractBuilderSectionsTextBlockLayout {
content
layoutSettings {
...LayoutColored
...LayoutContained
...LayoutPadded
}
}

View File

@@ -5,7 +5,7 @@ defineProps<SectionTextBlockFragment>();
</script>
<template>
<LayoutContained data-section-type="text-block" v-bind="layoutSettings!">
<LayoutWrapper data-section-type="text-block" :layout-settings="layoutSettings">
<UiProse :content="content" />
</LayoutContained>
</LayoutWrapper>
</template>

View File

@@ -3,7 +3,7 @@ const { data: siteOptions } = await useSiteOptions();
</script>
<template>
<footer class="bg-accented links:link-prose">
<footer class="links:link-prose bg-accented">
<div class="container py-6">
<AcfSocial :social="parseAcfSocial(siteOptions)" />
</div>

View File

@@ -3,10 +3,17 @@ 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">
<div class="bg-inverted py-1.5 text-inverted">
<div class="container flex flex-col items-center gap-3 sm:flex-row">
<SiteFooterCopyright class="sm:mr-auto" />
<UButton v-bind="connexionButton" color="neutral" variant="link" />
<AuthState>
<AcfLinkButton
:link="connexionButton.link"
:icon="connexionButton.icon"
color="neutral"
variant="link"
/>
</AuthState>
<SiteFooterCredits />
</div>
</div>

View File

@@ -1,6 +1,12 @@
<template>
<div class="flex items-center gap-1">
Fait avec <UIcon name="i-lucide-heart" /> par
<ULink href="https://websimple.com" target="_blank" external title="Site web développé par Websimple">Websimple</ULink>
<ULink
href="https://websimple.com"
target="_blank"
external
title="Site web développé par Websimple"
>Websimple</ULink
>
</div>
</template>

View File

@@ -1,6 +1,3 @@
<script setup lang="ts">
</script>
<template>
<UHeader mode="slideover">
<template #left>

View File

@@ -0,0 +1,10 @@
<script setup lang="ts">
defineProps<{ hasNextPage: boolean; isLoadingMore: boolean }>();
defineEmits<{ loadMore: [] }>();
</script>
<template>
<div v-if="hasNextPage" class="flex justify-center">
<UButton @click="$emit('loadMore')" :loading="isLoadingMore"> En voir plus </UButton>
</div>
</template>

View File

@@ -6,7 +6,7 @@ export function useAuthConnexion() {
const { isLoggedIn } = useAuth();
const toast = useToast();
const { fetch: refreshUserSession } = useUserSession();
const routeRedirect = useRoute().query.redirect as string || undefined;
const routeRedirect = (useRoute().query.redirect as string) || undefined;
// Helper: Redirect after login / logout
async function redirectTo(to: string | undefined) {
@@ -30,13 +30,13 @@ export function useAuthConnexion() {
duration: 3000,
});
await redirectTo(redirect);
}
catch (error) {
} catch (error) {
console.log(error);
toast.add({
title: "Erreur de connexion",
color: "error",
description: error instanceof Error ? error.message : "Une erreur est survenue lors de la connexion.",
description:
error instanceof Error ? error.message : "Une erreur est survenue lors de la connexion.",
duration: 5000,
});
}
@@ -56,23 +56,27 @@ export function useAuthConnexion() {
duration: 3000,
});
await redirectTo(redirect);
}
catch (error) {
} catch (error) {
console.log(error);
toast.add({
title: "Erreur de déconnexion",
color: "error",
description: error instanceof Error ? error.message : "Une erreur est survenue lors de la déconnexion.",
description:
error instanceof Error
? error.message
: "Une erreur est survenue lors de la déconnexion.",
duration: 5000,
});
}
}
// Dynamic connexion link
// Dynamic connexion link / icon
const connexionButton = computed(() => ({
label: isLoggedIn.value ? "Déconnexion" : "Connexion",
link: parseAcfLink({
title: isLoggedIn.value ? "Déconnexion" : "Connexion",
url: "/connexion",
}),
icon: isLoggedIn.value ? "i-lucide-log-out" : "i-lucide-log-in",
to: "/connexion",
}));
return { isRedirecting, login, logout, connexionButton };

View File

@@ -1,3 +1,8 @@
export const useGeneralSettings = () => useAsyncGraphQLQuery("GeneralSettings", {}, {
export const useGeneralSettings = () =>
useAsyncGraphQLQuery(
"GeneralSettings",
{},
{
transform: ({ generalSettings }) => generalSettings,
});
}
);

View File

@@ -0,0 +1,64 @@
import { tv, type VariantProps } from "tailwind-variants";
import * as z from "zod";
// Tailwind Variants for LayoutWrapper
export const tvLayoutWrapper = tv({
slots: {
base: "",
inner: "",
},
variants: {
// LayoutColored
color: {
default: { base: "bg-default" },
muted: { base: "bg-muted" },
elevated: { base: "bg-elevated" },
accented: { base: "bg-accented" },
inverted: { base: "bg-inverted text-inverted" },
primary: { base: "bg-primary text-inverted" },
},
// LayoutContained
container: {
default: { inner: "container" },
xl: { inner: "container-xl" },
lg: { inner: "container-lg" },
fluid: { inner: "container-fluid" },
fullbleed: { inner: "container-fullbleed" },
},
// LayoutPadded
verticalPadding: {
sm: { base: "py-3" },
md: { base: "py-6" },
lg: { base: "py-12" },
none: {},
},
},
defaultVariants: {
color: "default",
container: "default",
verticalPadding: "md",
},
});
export type LayoutWrapperProps = VariantProps<typeof tvLayoutWrapper>;
// Zod schemas for validating layout settings
const colorEnum = z.enum(["default", "muted", "elevated", "accented", "inverted", "primary"]);
const containerEnum = z.enum(["default", "xl", "lg", "fluid", "fullbleed"]);
const verticalPaddingEnum = z.enum(["sm", "md", "lg", "none"]);
const layoutSettingsSchema = z.object({
color: z.string().pipe(colorEnum).optional(),
container: z.string().pipe(containerEnum).optional(),
verticalPadding: z.string().pipe(verticalPaddingEnum).optional(),
});
export type LayoutSettings = z.input<typeof layoutSettingsSchema>;
export function useLayoutWrapper(input?: LayoutSettings) {
try {
return tvLayoutWrapper(layoutSettingsSchema.parse(input));
} catch {
return tvLayoutWrapper();
}
}

View File

@@ -11,8 +11,7 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
try {
const hrefUrl = new URL(href);
return hrefUrl.hostname === siteUrl.hostname;
}
catch {
} catch {
return false;
}
};
@@ -25,8 +24,7 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
if (hrefUrl.hostname === siteUrl.hostname) {
return hrefUrl.pathname + hrefUrl.search + hrefUrl.hash;
}
}
catch {
} catch {
// Invalid URL
}
return href;
@@ -39,7 +37,14 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
if (!link) return;
const href = link.getAttribute("href");
if (!href) return;
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || link.target === "_blank" || link.hasAttribute("download")) {
if (
e.metaKey ||
e.ctrlKey ||
e.shiftKey ||
e.altKey ||
link.target === "_blank" ||
link.hasAttribute("download")
) {
return;
}
if (isInternal(href)) {

View File

@@ -2,7 +2,9 @@ import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
export function useResponsive() {
const { isMobileOrTablet } = useDevice();
const breakpoints = useBreakpoints(breakpointsTailwind, { ssrWidth: isMobileOrTablet ? 375 : 1024 });
const breakpoints = useBreakpoints(breakpointsTailwind, {
ssrWidth: isMobileOrTablet ? 375 : 1024,
});
const isDesktop = breakpoints.greaterOrEqual("lg");
return { breakpoints, isDesktop };

View File

@@ -1,3 +1,8 @@
export const useSiteOptions = () => useAsyncGraphQLQuery("SiteOptions", {}, {
export const useSiteOptions = () =>
useAsyncGraphQLQuery(
"SiteOptions",
{},
{
transform: ({ siteOptions }) => siteOptions?.groupSiteOptions,
});
}
);

View File

@@ -0,0 +1,4 @@
fragment PageInfo on WPPageInfo {
hasNextPage
endCursor
}

View File

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

View File

@@ -0,0 +1,18 @@
export default defineNuxtRouteMiddleware((to) => {
const { hasRole, isLoggedIn } = useAuth();
if (!isLoggedIn.value) {
return navigateTo({ path: "/connexion", query: { redirect: to.fullPath } });
}
if (!hasRole(to.meta.hasRole || "")) {
return abortNavigation({
statusCode: 403,
message: "Vous n'avez pas les permissions requises pour accéder à cette page.",
});
}
});
declare module "#app" {
interface PageMeta {
hasRole?: string;
}
}

View File

@@ -0,0 +1,12 @@
export default defineNuxtRouteMiddleware((to) => {
const { isAdmin, isLoggedIn } = useAuth();
if (!isLoggedIn.value) {
return navigateTo({ path: "/connexion", query: { redirect: to.fullPath } });
}
if (!isAdmin.value) {
return abortNavigation({
statusCode: 403,
message: "Vous n'avez pas les permissions requises pour accéder à cette page.",
});
}
});

View File

@@ -0,0 +1,6 @@
export default defineNuxtRouteMiddleware((to) => {
const { isLoggedIn } = useAuth();
if (!isLoggedIn.value) {
return navigateTo({ path: "/connexion", query: { redirect: to.fullPath } });
}
});

View File

@@ -0,0 +1,6 @@
export default defineNuxtRouteMiddleware((to) => {
const { isLoggedIn } = useAuth();
if (isLoggedIn.value) {
return navigateTo({ path: "/connexion", query: { redirect: to.fullPath } });
}
});

View File

@@ -4,13 +4,21 @@ const { path: uri } = useRoute();
const { data, error } = await useAsyncGraphQLQuery("NodeByUri", { uri });
if (!data.value?.nodeByUri) {
console.error("NodeByUri query error:", error.value);
throw createError({ statusCode: 404, message: `La page demandée est introuvable: ${uri}`, fatal: true });
throw createError({
statusCode: 404,
message: `La page demandée est introuvable: ${uri}`,
fatal: true,
});
}
// Dynamically resolve component based on node type
const componentName = `Node${data.value.nodeByUri.__typename}`;
if (!useNuxtApp().vueApp.component(componentName)) {
throw createError({ statusCode: 404, message: `La page demandée ne peut pas être affichée correctement: ${componentName}`, fatal: true });
throw createError({
statusCode: 404,
message: `La page demandée ne peut pas être affichée correctement: ${componentName}`,
fatal: true,
});
}
useNodeSeo(data.value.nodeByUri);

View File

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

View File

@@ -22,8 +22,7 @@ export const acfMediaSchema = z.object({
export function parseAcfMedia(data?: Partial<AcfMediaFragment>) {
try {
return acfMediaSchema.parse(data);
}
catch {
} catch {
return undefined;
}
}

View File

@@ -1,7 +1,9 @@
import * as z from "zod";
import type { AcfSocialFragment } from "#graphql/operations";
import * as z from "zod";
const socialProfile = z.object({ url: z.url() }).transform(({ url }) => ({ url, icon: getSocialIcon(url) }));
const socialProfile = z
.object({ url: z.url() })
.transform(({ url }) => ({ url, icon: getSocialIcon(url) }));
const acfSocialSchema = z.object({
profiles: z.array(socialProfile),
});
@@ -10,8 +12,7 @@ export type AcfSocialOutput = z.infer<typeof acfSocialSchema>;
export function parseAcfSocial(data?: AcfSocialFragment) {
try {
return acfSocialSchema.parse(data);
}
catch {
} catch {
return undefined;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +0,0 @@
// @ts-check
import withNuxt from "./.nuxt/eslint.config.mjs";
export default withNuxt({ rules: {
"vue/max-attributes-per-line": "off",
"vue/no-v-html": "off",
} },
);

View File

@@ -1,4 +1,4 @@
{
"schema": "./server/graphql/schema.graphql",
"schema": "./.nuxt/graphql/schema.gql",
"documents": "**/*.gql"
}

View File

@@ -2,12 +2,16 @@ import { version } from "./package.json";
const siteUrl = process.env.NUXT_SITE_URL;
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.`,
);
}
const wpUrl = process.env.NUXT_WP_URL;
if (!wpUrl) {
throw new Error(`NUXT_WP_URL is not defined. Make sure to set it in your build environment variables.`);
throw new Error(
`NUXT_WP_URL is not defined. Make sure to set it in your build environment variables.`,
);
}
const wpDomain = new URL(wpUrl).hostname;
@@ -15,10 +19,8 @@ const enableCloudflareImages = Boolean(process.env.ENABLE_CLOUDFLARE_IMAGES);
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
"@lewebsimple/nuxt-graphql",
"@nuxt/eslint",
"@nuxt/image",
"@nuxt/ui",
"@nuxtjs/device",
@@ -28,9 +30,7 @@ export default defineNuxtConfig({
],
components: {
dirs: [
{ path: "~/components", pathPrefix: false },
],
dirs: [{ path: "~/components", pathPrefix: false }],
},
devtools: { enabled: true },
@@ -56,9 +56,7 @@ export default defineNuxtConfig({
nitro: {
preset: "cloudflare_module",
cloudflare: {
deployConfig: true,
wrangler: {
name: "wp-headless",
vars: {
NODE_ENV: "staging",
NUXT_SITE_URL: siteUrl,
@@ -68,18 +66,6 @@ export default defineNuxtConfig({
},
},
eslint: {
config: {
stylistic: {
arrowParens: true,
commaDangle: "always-multiline",
indent: 2,
quotes: "double",
semi: true,
},
},
},
graphql: {
client: {
cache: {
@@ -92,6 +78,7 @@ export default defineNuxtConfig({
wp: { type: "remote", endpoint: `${wpUrl}/graphql`, hooks: ["server/graphql/wp-hooks"] },
},
},
saveSDL: ".nuxt/graphql/schema.gql",
},
image: {
@@ -112,5 +99,4 @@ export default defineNuxtConfig({
componentPrefix: "Svg",
defaultImport: "component",
},
});

View File

@@ -1,15 +1,16 @@
{
"name": "@lewebsimple/moonshine",
"description": "Headless WordPress theme based on Nuxt.",
"version": "0.1.13",
"type": "module",
"private": true,
"description": "Headless WordPress theme based on Nuxt.",
"type": "module",
"scripts": {
"build": "pnpm --sequential /build:.*/",
"build:nuxt": "nuxt build",
"dev": "nuxt dev",
"editor-style": "pnpx @tailwindcss/cli -i ./app/assets/css/_main.css -o ./editor-style.css --minify",
"lint": "eslint . --fix",
"format": "oxfmt .",
"lint": "oxlint . --fix",
"postinstall": "pnpm --sequential /postinstall:.*/",
"postinstall:wrangler-types": "wrangler types ./server/types/cloudflare.d.ts",
"postinstall:nuxt": "nuxt prepare",
@@ -17,34 +18,34 @@
"preview:build": "pnpm run build",
"preview:wrangler-dev": "wrangler dev --port 3000",
"release": "pnpm --sequential /release:.*/",
"release:lint": "eslint .",
"release:lint": "oxlint .",
"release:typecheck": "nuxt typecheck",
"release:changelogen": "changelogen --noAuthors --release --push"
},
"dependencies": {
"@iconify-json/cib": "^1.2.3",
"@iconify-json/lucide": "^1.2.87",
"@lewebsimple/nuxt-graphql": "^0.6.8",
"@iconify-json/lucide": "^1.2.90",
"@lewebsimple/nuxt-graphql": "^0.6.10",
"@nuxt/image": "^2.0.0",
"@nuxt/ui": "4.3.0",
"@nuxtjs/device": "4.0.0",
"@nuxtjs/seo": "^3.4.0",
"jwt-decode": "^4.0.0",
"nuxt": "^4.3.0",
"nuxt": "^4.3.1",
"nuxt-auth-utils": "^0.5.28",
"nuxt-svgo": "^4.2.6",
"tailwindcss": "^4.1.18",
"vue": "^3.5.27",
"vue": "^3.5.28",
"vue-router": "^4.6.4",
"zod": "^4.3.6"
},
"devDependencies": {
"@nuxt/eslint": "^1.13.0",
"changelogen": "^0.6.2",
"eslint": "^9.39.2",
"oxfmt": "^0.28.0",
"oxlint": "^1.46.0",
"typescript": "^5.9.3",
"vue-tsc": "^3.2.4",
"wrangler": "^4.61.1"
"wrangler": "^4.64.0"
},
"pnpm": {
"overrides": {

File diff suppressed because it is too large Load Diff

View File

@@ -5,17 +5,17 @@ export default defineEventHandler(async (event) => {
if (!data?.login) {
throw new Error("INVALID_LOGIN");
}
if (!await handleLogin(event, data)) {
if (!(await handleLogin(event, data))) {
throw new Error("LOGIN_FAILED");
}
return { success: true, message: "Connexion réussie" };
}
catch (error) {
} catch (error) {
const messages = {
INVALID_LOGIN: "Identifiants invalides. Veuillez réessayer.",
LOGIN_FAILED: "Une erreur est survenue lors de la connexion. Veuillez réessayer plus tard.",
};
const message = (error instanceof Error && error.message in messages) ? error.message : "LOGIN_FAILED";
const message =
error instanceof Error && error.message in messages ? error.message : "LOGIN_FAILED";
return { success: false, message: messages[message as keyof typeof messages] };
}
});

View File

@@ -4,9 +4,9 @@ export default defineEventHandler(async (event) => {
try {
await handleLogout(event);
return { success: true, message: "Déconnexion réussie" };
}
catch (error) {
const message = error instanceof Error ? error.message : "Une erreur est survenue lors de la déconnexion.";
} catch (error) {
const message =
error instanceof Error ? error.message : "Une erreur est survenue lors de la déconnexion.";
return { success: false, message };
}
});

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,9 @@ export default defineRemoteExecutorHooks({
onRequest(request) {
// Attach the Authorization header if an authToken is present in the context
if (request.context?.authToken) {
request.extensions = defu(request.extensions, { headers: { Authorization: `Bearer ${request.context.authToken}` } });
request.extensions = defu(request.extensions, {
headers: { Authorization: `Bearer ${request.context.authToken}` },
});
}
},
});

View File

@@ -1,9 +1,9 @@
import type { H3Event } from "h3";
import { jwtDecode } from "jwt-decode";
import type { User } from "#auth-utils";
import type { AuthUserFragment, AuthLoginMutationResult } from "#graphql/operations";
import { AuthRefreshTokenDocument } from "#graphql/operations";
import type { ResultOf } from "#graphql/registry";
import type { H3Event } from "h3";
import { jwtDecode } from "jwt-decode";
// Handle login result and store user session
export async function handleLogin(event: H3Event, loginResult: AuthLoginMutationResult) {
@@ -54,10 +54,13 @@ export async function refreshAuthToken(refreshToken: string): Promise<string | u
const refreshPromise = (async () => {
const { wpUrl } = useRuntimeConfig();
const endpoint = `${wpUrl}/graphql`;
const { data } = await executeGraphQLHTTP<ResultOf<"AuthRefreshToken">>({
const { data } = await executeGraphQLHTTP<ResultOf<"AuthRefreshToken">>(
{
query: AuthRefreshTokenDocument,
variables: { refreshToken },
}, { endpoint });
},
{ endpoint },
);
return data?.refreshToken?.authToken || undefined;
})();
@@ -91,8 +94,7 @@ export async function getAuthToken(event: H3Event): Promise<string | undefined>
}
session.secure.authToken = newAuthToken;
await setUserSession(event, session);
}
catch {
} catch {
await clearUserSession(event);
return;
}

View File

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