feat: Replace eslint => oxlint + oxfmt
This commit is contained in:
5
.vscode/extensions.json
vendored
Normal file
5
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"oxc.oxc-vscode"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
.vscode/settings.json
vendored
17
.vscode/settings.json
vendored
@@ -1,11 +1,28 @@
|
|||||||
{
|
{
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||||
|
"editor.formatOnSave": true
|
||||||
|
},
|
||||||
|
"[vue]": {
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode"
|
||||||
|
},
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.oxc": "always"
|
||||||
|
},
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
"editor.quickSuggestions": {
|
"editor.quickSuggestions": {
|
||||||
"strings": "on"
|
"strings": "on"
|
||||||
},
|
},
|
||||||
|
"eslint.enable": false,
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.css": "tailwindcss"
|
"*.css": "tailwindcss"
|
||||||
},
|
},
|
||||||
"graphql-config.load.rootDir": "wp-content/themes/moonshine",
|
"graphql-config.load.rootDir": "wp-content/themes/moonshine",
|
||||||
|
"oxc.fmt.configPath": ".oxfmtrc.json",
|
||||||
|
"oxc.path.oxfmt": "wp-content/themes/moonshine/node_modules/.bin/oxfmt",
|
||||||
|
"oxc.path.oxlint": "wp-content/themes/moonshine/node_modules/.bin/oxlint",
|
||||||
|
"oxc.typeAware": true,
|
||||||
"tailwindCSS.classAttributes": [
|
"tailwindCSS.classAttributes": [
|
||||||
"class",
|
"class",
|
||||||
"ui"
|
"ui"
|
||||||
|
|||||||
25
wp-content/themes/moonshine/.oxfmtrc.json
Normal file
25
wp-content/themes/moonshine/.oxfmtrc.json
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"arrowParens": "always",
|
||||||
|
"indentStyle": "space",
|
||||||
|
"indentWidth": 2,
|
||||||
|
"quoteStyle": "double",
|
||||||
|
"semi": true,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"experimentalSortImports": {
|
||||||
|
"groups": [
|
||||||
|
["side-effect"],
|
||||||
|
["builtin"],
|
||||||
|
["external", "type-external"],
|
||||||
|
["internal", "type-internal"],
|
||||||
|
["parent", "type-parent"],
|
||||||
|
["sibling", "type-sibling"],
|
||||||
|
["index", "type-index"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"experimentalTailwindcss": {
|
||||||
|
"stylesheet": "./app/assets/css/_main.css",
|
||||||
|
"attributes": ["class", "className"],
|
||||||
|
"functions": ["clsx", "cn"],
|
||||||
|
"preserveWhitespace": true
|
||||||
|
}
|
||||||
|
}
|
||||||
17
wp-content/themes/moonshine/.oxlintrc.json
Normal file
17
wp-content/themes/moonshine/.oxlintrc.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": ["recommended"],
|
||||||
|
"plugins": ["vue"],
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"vue": {
|
||||||
|
"version": 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"vue/max-attributes-per-line": "off",
|
||||||
|
"vue/no-v-html": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -190,7 +190,6 @@
|
|||||||
|
|
||||||
## v0.1.1
|
## v0.1.1
|
||||||
|
|
||||||
|
|
||||||
### 🚀 Enhancements
|
### 🚀 Enhancements
|
||||||
|
|
||||||
- Initial Moonshine theme - Headless WordPress theme based on Nuxt (b3134fe)
|
- Initial Moonshine theme - Headless WordPress theme based on Nuxt (b3134fe)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Thème WordPress en headless basé sur Nuxt.
|
|||||||
## Variables d'environnement
|
## Variables d'environnement
|
||||||
|
|
||||||
| Nom | Description | Exemple | Requise |
|
| Nom | Description | Exemple | Requise |
|
||||||
|-----|-------------|---------|---------|
|
| --------------- | ------------------------ | ----------------------- | ------- |
|
||||||
| `NUXT_SITE_ENV` | Environnement | staging \| production | ➖ |
|
| `NUXT_SITE_ENV` | Environnement | staging \| production | ➖ |
|
||||||
| `NUXT_SITE_URL` | URL du frontend Nuxt | https://www.example.com | ➖ |
|
| `NUXT_SITE_URL` | URL du frontend Nuxt | https://www.example.com | ➖ |
|
||||||
| `NUXT_WP_URL` | URL du backend WordPress | https://wp.exemple.com | ✅ |
|
| `NUXT_WP_URL` | URL du backend WordPress | https://wp.exemple.com | ✅ |
|
||||||
|
|||||||
@@ -24,11 +24,7 @@
|
|||||||
"acfe_flexible_layouts_placeholder": 0,
|
"acfe_flexible_layouts_placeholder": 0,
|
||||||
"acfe_flexible_layouts_thumbnails": 0,
|
"acfe_flexible_layouts_thumbnails": 0,
|
||||||
"acfe_flexible_async": [],
|
"acfe_flexible_async": [],
|
||||||
"acfe_flexible_add_actions": [
|
"acfe_flexible_add_actions": ["copy", "title", "toggle"],
|
||||||
"copy",
|
|
||||||
"title",
|
|
||||||
"toggle"
|
|
||||||
],
|
|
||||||
"acfe_flexible_remove_button": [],
|
"acfe_flexible_remove_button": [],
|
||||||
"acfe_flexible_remove_top_actions": [],
|
"acfe_flexible_remove_top_actions": [],
|
||||||
"acfe_flexible_modal_edit": {
|
"acfe_flexible_modal_edit": {
|
||||||
@@ -100,9 +96,7 @@
|
|||||||
"min": "",
|
"min": "",
|
||||||
"max": "",
|
"max": "",
|
||||||
"acfe_flexible_modal_edit_size": "",
|
"acfe_flexible_modal_edit_size": "",
|
||||||
"acfe_flexible_settings": [
|
"acfe_flexible_settings": ["group_layout_contained"],
|
||||||
"group_layout_contained"
|
|
||||||
],
|
|
||||||
"acfe_flexible_settings_size": "large",
|
"acfe_flexible_settings_size": "large",
|
||||||
"acfe_flexible_render_template": false,
|
"acfe_flexible_render_template": false,
|
||||||
"acfe_flexible_render_style": false,
|
"acfe_flexible_render_style": false,
|
||||||
@@ -156,9 +150,7 @@
|
|||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"graphql_field_name": "media",
|
"graphql_field_name": "media",
|
||||||
"clone": [
|
"clone": ["group_abstract_media"],
|
||||||
"group_abstract_media"
|
|
||||||
],
|
|
||||||
"display": "seamless",
|
"display": "seamless",
|
||||||
"layout": "block",
|
"layout": "block",
|
||||||
"prefix_label": 0,
|
"prefix_label": 0,
|
||||||
@@ -231,16 +223,12 @@
|
|||||||
"style": "seamless",
|
"style": "seamless",
|
||||||
"label_placement": "top",
|
"label_placement": "top",
|
||||||
"instruction_placement": "label",
|
"instruction_placement": "label",
|
||||||
"hide_on_screen": [
|
"hide_on_screen": ["the_content"],
|
||||||
"the_content"
|
|
||||||
],
|
|
||||||
"active": true,
|
"active": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"acfe_autosync": [
|
"acfe_autosync": ["json"],
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"acfe_form": 0,
|
"acfe_form": 0,
|
||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_field_name": "GroupAbstractBuilder",
|
"graphql_field_name": "GroupAbstractBuilder",
|
||||||
|
|||||||
@@ -109,9 +109,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"acfe_autosync": [
|
"acfe_autosync": ["json"],
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"acfe_form": 0,
|
"acfe_form": 0,
|
||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_field_name": "GroupAbstractMedia",
|
"graphql_field_name": "GroupAbstractMedia",
|
||||||
|
|||||||
@@ -72,9 +72,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"acfe_autosync": [
|
"acfe_autosync": ["json"],
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"acfe_form": 0,
|
"acfe_form": 0,
|
||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_field_name": "GroupAbstractSocial",
|
"graphql_field_name": "GroupAbstractSocial",
|
||||||
|
|||||||
@@ -135,9 +135,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"acfe_autosync": [
|
"acfe_autosync": ["json"],
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"acfe_form": 0,
|
"acfe_form": 0,
|
||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_field_name": "GroupLayoutContained",
|
"graphql_field_name": "GroupLayoutContained",
|
||||||
|
|||||||
@@ -63,9 +63,7 @@
|
|||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"graphql_field_name": "social",
|
"graphql_field_name": "social",
|
||||||
"clone": [
|
"clone": ["group_abstract_social"],
|
||||||
"group_abstract_social"
|
|
||||||
],
|
|
||||||
"display": "seamless",
|
"display": "seamless",
|
||||||
"layout": "block",
|
"layout": "block",
|
||||||
"prefix_label": 0,
|
"prefix_label": 0,
|
||||||
@@ -144,9 +142,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"acfe_autosync": [
|
"acfe_autosync": ["json"],
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"acfe_form": 0,
|
"acfe_form": 0,
|
||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_field_name": "GroupSiteOptions",
|
"graphql_field_name": "GroupSiteOptions",
|
||||||
|
|||||||
@@ -17,9 +17,7 @@
|
|||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"graphql_field_name": "builder",
|
"graphql_field_name": "builder",
|
||||||
"clone": [
|
"clone": ["group_abstract_builder"],
|
||||||
"group_abstract_builder"
|
|
||||||
],
|
|
||||||
"display": "seamless",
|
"display": "seamless",
|
||||||
"layout": "block",
|
"layout": "block",
|
||||||
"prefix_label": 0,
|
"prefix_label": 0,
|
||||||
@@ -45,16 +43,12 @@
|
|||||||
"style": "seamless",
|
"style": "seamless",
|
||||||
"label_placement": "top",
|
"label_placement": "top",
|
||||||
"instruction_placement": "label",
|
"instruction_placement": "label",
|
||||||
"hide_on_screen": [
|
"hide_on_screen": ["the_content"],
|
||||||
"the_content"
|
|
||||||
],
|
|
||||||
"active": true,
|
"active": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"display_title": "",
|
"display_title": "",
|
||||||
"acfe_autosync": [
|
"acfe_autosync": ["json"],
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"acfe_form": 0,
|
"acfe_form": 0,
|
||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_field_name": "GroupPostPage",
|
"graphql_field_name": "GroupPostPage",
|
||||||
|
|||||||
@@ -8,13 +8,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Container sizes */
|
/* Container sizes */
|
||||||
@utility container { @apply mx-auto px-container max-w-(--breakpoint-2xl); }
|
@utility container {
|
||||||
@utility container-xl { @apply container max-w-(--breakpoint-xl); }
|
@apply mx-auto px-container max-w-(--breakpoint-2xl);
|
||||||
@utility container-lg { @apply container max-w-(--breakpoint-lg); }
|
}
|
||||||
@utility container-md { @apply container max-w-(--breakpoint-md); }
|
@utility container-xl {
|
||||||
@utility container-sm { @apply container max-w-(--breakpoint-sm); }
|
@apply container max-w-(--breakpoint-xl);
|
||||||
@utility container-fluid { @apply container max-w-screen; }
|
}
|
||||||
@utility container-none { @apply w-full max-w-screen; }
|
@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 */
|
/* Split containers */
|
||||||
:root {
|
:root {
|
||||||
@@ -42,6 +56,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@utility container-left { @apply ml-(--container-outside-margin) px-container;}
|
@utility container-left {
|
||||||
@utility container-right { @apply mr-(--container-outside-margin) px-container;}
|
@apply ml-(--container-outside-margin) px-container;
|
||||||
@utility container-half { width: calc(var(--container-width) / 2);}
|
}
|
||||||
|
@utility container-right {
|
||||||
|
@apply mr-(--container-outside-margin) px-container;
|
||||||
|
}
|
||||||
|
@utility container-half {
|
||||||
|
width: calc(var(--container-width) / 2);
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
@custom-variant links (& a:not([class*='link-']):not([class*='button-']));
|
@custom-variant links (& a:not([class*='link-']):not([class*='button-']));
|
||||||
|
|
||||||
/* Link styles */
|
/* Link styles */
|
||||||
@utility link-base { @apply cursor-pointer disabled-default transition; }
|
@utility link-base {
|
||||||
@utility link-underline { @apply link-base underline hover:decoration-primary; }
|
@apply cursor-pointer disabled-default transition;
|
||||||
@utility link-opacity { @apply link-base hover:opacity-80; }
|
}
|
||||||
|
@utility link-underline {
|
||||||
|
@apply link-base underline hover:decoration-primary;
|
||||||
|
}
|
||||||
|
@utility link-opacity {
|
||||||
|
@apply link-base hover:opacity-80;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,15 +1,25 @@
|
|||||||
@utility prose {
|
@utility prose {
|
||||||
/* Headings (allow class overrides) */
|
/* Headings (allow class overrides) */
|
||||||
h1:not([class*="heading-"]) { @apply heading-1; }
|
h1:not([class*="heading-"]) {
|
||||||
h2:not([class*="heading-"]) { @apply heading-2; }
|
@apply heading-1;
|
||||||
h3:not([class*="heading-"]) { @apply heading-3; }
|
}
|
||||||
h4:not([class*="heading-"]) { @apply heading-4; }
|
h2:not([class*="heading-"]) {
|
||||||
|
@apply heading-2;
|
||||||
|
}
|
||||||
|
h3:not([class*="heading-"]) {
|
||||||
|
@apply heading-3;
|
||||||
|
}
|
||||||
|
h4:not([class*="heading-"]) {
|
||||||
|
@apply heading-4;
|
||||||
|
}
|
||||||
|
|
||||||
/* Links */
|
/* Links */
|
||||||
@apply links:link-underline;
|
@apply links:link-underline;
|
||||||
|
|
||||||
/* Paragraphs */
|
/* Paragraphs */
|
||||||
p:not([class*="paragraph-"]) { @apply paragraph-base; }
|
p:not([class*="paragraph-"]) {
|
||||||
|
@apply paragraph-base;
|
||||||
|
}
|
||||||
|
|
||||||
/* Spacing */
|
/* Spacing */
|
||||||
@apply space-y-2;
|
@apply space-y-2;
|
||||||
|
|||||||
@@ -1,10 +1,24 @@
|
|||||||
/* Heading styles */
|
/* Heading styles */
|
||||||
@utility heading-base { @apply font-bold tracking-tight };
|
@utility heading-base {
|
||||||
@utility heading-1 { @apply heading-base text-4xl; }
|
@apply font-bold tracking-tight;
|
||||||
@utility heading-2 { @apply heading-base text-3xl; }
|
}
|
||||||
@utility heading-3 { @apply heading-base text-2xl; }
|
@utility heading-1 {
|
||||||
@utility heading-4 { @apply heading-base text-xl; }
|
@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 */
|
/* Paragraph styles */
|
||||||
@utility paragraph-base { @apply font-sans; }
|
@utility paragraph-base {
|
||||||
@utility paragraph-lead { @apply paragraph-base text-2xl; }
|
@apply font-sans;
|
||||||
|
}
|
||||||
|
@utility paragraph-lead {
|
||||||
|
@apply paragraph-base text-2xl;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { AcfLinkFragment } from "#graphql/operations";
|
import type { AcfLinkFragment } from "#graphql/operations";
|
||||||
import type { ButtonProps } from "@nuxt/ui";
|
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;
|
showLabel?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
fragment AcfMedia on GroupAbstractMedia_Fields {
|
fragment AcfMedia on GroupAbstractMedia_Fields {
|
||||||
image { node { ... AcfImage } }
|
image {
|
||||||
|
node {
|
||||||
|
...AcfImage
|
||||||
|
}
|
||||||
|
}
|
||||||
aspectRatio
|
aspectRatio
|
||||||
objectFit
|
objectFit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,14 @@ defineProps<{ social?: AcfSocialOutput }>();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="social?.profiles" class="flex gap-1.5">
|
<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" />
|
<UIcon :name="icon" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ const fields = [
|
|||||||
label: "Courriel",
|
label: "Courriel",
|
||||||
placeholder: "Entrez votre courriel",
|
placeholder: "Entrez votre courriel",
|
||||||
required: true,
|
required: true,
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: "password",
|
name: "password",
|
||||||
label: "Mot de passe",
|
label: "Mot de passe",
|
||||||
type: "password" as const,
|
type: "password" as const,
|
||||||
|
|||||||
@@ -5,12 +5,8 @@ const { logout } = useAuthConnexion();
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full space-y-6">
|
<div class="w-full space-y-6">
|
||||||
<div class="flex flex-col text-center">
|
<div class="flex flex-col text-center">
|
||||||
<div class="text-xl text-pretty font-semibold text-highlighted">
|
<div class="text-xl font-semibold text-pretty text-highlighted">Déconnexion</div>
|
||||||
Déconnexion
|
<div class="mt-1 text-base text-pretty text-muted">Veuillez confirmer la déconnexion.</div>
|
||||||
</div>
|
|
||||||
<div class="mt-1 text-base text-pretty text-muted">
|
|
||||||
Veuillez confirmer la déconnexion.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<UButton
|
<UButton
|
||||||
icon="i-lucide-log-out"
|
icon="i-lucide-log-out"
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full space-y-6">
|
<div class="w-full space-y-6">
|
||||||
<div class="flex flex-col text-center">
|
<div class="flex flex-col text-center">
|
||||||
<div class="text-xl text-pretty font-semibold text-highlighted">
|
<div class="text-xl font-semibold text-pretty text-highlighted">Redirection en cours</div>
|
||||||
Redirection en cours
|
<div class="mt-1 text-base text-pretty text-muted">Veuillez patienter...</div>
|
||||||
</div>
|
|
||||||
<div class="mt-1 text-base text-pretty text-muted">
|
|
||||||
Veuillez patienter...
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
fragment BuilderSections on GroupAbstractBuilder_Fields {
|
fragment BuilderSections on GroupAbstractBuilder_Fields {
|
||||||
sections {
|
sections {
|
||||||
__typename
|
__typename
|
||||||
... on GroupAbstractBuilderSectionsHeroSplitLayout { ... SectionHeroSplit }
|
... on GroupAbstractBuilderSectionsHeroSplitLayout {
|
||||||
... on GroupAbstractBuilderSectionsTextBlockLayout { ... SectionTextBlock }
|
...SectionHeroSplit
|
||||||
|
}
|
||||||
|
... on GroupAbstractBuilderSectionsTextBlockLayout {
|
||||||
|
...SectionTextBlock
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ fragment NodePage on Page {
|
|||||||
title
|
title
|
||||||
isFrontPage
|
isFrontPage
|
||||||
groupPostPage {
|
groupPostPage {
|
||||||
... BuilderSections
|
...BuilderSections
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ defineProps<NodePageFragment>();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="node-page">
|
<div id="node-page">
|
||||||
<h1 v-if="!isFrontPage" class="font-bold text-4xl">
|
<h1 v-if="!isFrontPage" class="text-4xl font-bold">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</h1>
|
</h1>
|
||||||
<BuilderSections :sections="groupPostPage?.sections || []" />
|
<BuilderSections :sections="groupPostPage?.sections || []" />
|
||||||
|
|||||||
@@ -3,4 +3,3 @@ fragment SectionHeroSplit on GroupAbstractBuilderSectionsHeroSplitLayout {
|
|||||||
reverse
|
reverse
|
||||||
...AcfMedia
|
...AcfMedia
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ const { data: siteOptions } = await useSiteOptions();
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<footer class="bg-accented links:link-prose">
|
<footer class="links:link-prose bg-accented">
|
||||||
<div class="container py-6">
|
<div class="container py-6">
|
||||||
<AcfSocial :social="parseAcfSocial(siteOptions)" />
|
<AcfSocial :social="parseAcfSocial(siteOptions)" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ const { connexionButton } = useAuthConnexion();
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bg-inverted text-inverted py-1.5">
|
<div class="bg-inverted py-1.5 text-inverted">
|
||||||
<div class="container flex flex-col sm:flex-row items-center gap-3">
|
<div class="container flex flex-col items-center gap-3 sm:flex-row">
|
||||||
<SiteFooterCopyright class="sm:mr-auto" />
|
<SiteFooterCopyright class="sm:mr-auto" />
|
||||||
<UButton v-bind="connexionButton" color="neutral" variant="link" />
|
<UButton v-bind="connexionButton" color="neutral" variant="link" />
|
||||||
<SiteFooterCredits />
|
<SiteFooterCredits />
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
Fait avec <UIcon name="i-lucide-heart" /> par
|
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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UHeader mode="slideover">
|
<UHeader mode="slideover">
|
||||||
<template #left>
|
<template #left>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export function useAuthConnexion() {
|
|||||||
const { isLoggedIn } = useAuth();
|
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;
|
||||||
|
|
||||||
// Helper: Redirect after login / logout
|
// Helper: Redirect after login / logout
|
||||||
async function redirectTo(to: string | undefined) {
|
async function redirectTo(to: string | undefined) {
|
||||||
@@ -30,13 +30,13 @@ export function useAuthConnexion() {
|
|||||||
duration: 3000,
|
duration: 3000,
|
||||||
});
|
});
|
||||||
await redirectTo(redirect);
|
await redirectTo(redirect);
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
console.log(error);
|
console.log(error);
|
||||||
toast.add({
|
toast.add({
|
||||||
title: "Erreur de connexion",
|
title: "Erreur de connexion",
|
||||||
color: "error",
|
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,
|
duration: 5000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -56,13 +56,15 @@ export function useAuthConnexion() {
|
|||||||
duration: 3000,
|
duration: 3000,
|
||||||
});
|
});
|
||||||
await redirectTo(redirect);
|
await redirectTo(redirect);
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
console.log(error);
|
console.log(error);
|
||||||
toast.add({
|
toast.add({
|
||||||
title: "Erreur de déconnexion",
|
title: "Erreur de déconnexion",
|
||||||
color: "error",
|
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,
|
duration: 5000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
export const useGeneralSettings = () => useAsyncGraphQLQuery("GeneralSettings", {}, {
|
export const useGeneralSettings = () =>
|
||||||
|
useAsyncGraphQLQuery(
|
||||||
|
"GeneralSettings",
|
||||||
|
{},
|
||||||
|
{
|
||||||
transform: ({ generalSettings }) => generalSettings,
|
transform: ({ generalSettings }) => generalSettings,
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
|
|||||||
try {
|
try {
|
||||||
const hrefUrl = new URL(href);
|
const hrefUrl = new URL(href);
|
||||||
return hrefUrl.hostname === siteUrl.hostname;
|
return hrefUrl.hostname === siteUrl.hostname;
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -25,8 +24,7 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
|
|||||||
if (hrefUrl.hostname === siteUrl.hostname) {
|
if (hrefUrl.hostname === siteUrl.hostname) {
|
||||||
return hrefUrl.pathname + hrefUrl.search + hrefUrl.hash;
|
return hrefUrl.pathname + hrefUrl.search + hrefUrl.hash;
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
// Invalid URL
|
// Invalid URL
|
||||||
}
|
}
|
||||||
return href;
|
return href;
|
||||||
@@ -39,7 +37,14 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
|
|||||||
if (!link) return;
|
if (!link) return;
|
||||||
const href = link.getAttribute("href");
|
const href = link.getAttribute("href");
|
||||||
if (!href) return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (isInternal(href)) {
|
if (isInternal(href)) {
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
|
|||||||
|
|
||||||
export function useResponsive() {
|
export function useResponsive() {
|
||||||
const { isMobileOrTablet } = useDevice();
|
const { isMobileOrTablet } = useDevice();
|
||||||
const breakpoints = useBreakpoints(breakpointsTailwind, { ssrWidth: isMobileOrTablet ? 375 : 1024 });
|
const breakpoints = useBreakpoints(breakpointsTailwind, {
|
||||||
|
ssrWidth: isMobileOrTablet ? 375 : 1024,
|
||||||
|
});
|
||||||
const isDesktop = breakpoints.greaterOrEqual("lg");
|
const isDesktop = breakpoints.greaterOrEqual("lg");
|
||||||
|
|
||||||
return { breakpoints, isDesktop };
|
return { breakpoints, isDesktop };
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
export const useSiteOptions = () => useAsyncGraphQLQuery("SiteOptions", {}, {
|
export const useSiteOptions = () =>
|
||||||
|
useAsyncGraphQLQuery(
|
||||||
|
"SiteOptions",
|
||||||
|
{},
|
||||||
|
{
|
||||||
transform: ({ siteOptions }) => siteOptions?.groupSiteOptions,
|
transform: ({ siteOptions }) => siteOptions?.groupSiteOptions,
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ fragment AuthUser on User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mutation AuthLogin($username: String!, $password: String!) {
|
mutation AuthLogin($username: String!, $password: String!) {
|
||||||
login( input: { provider: PASSWORD, credentials: { username: $username, password: $password }}) {
|
login(input: { provider: PASSWORD, credentials: { username: $username, password: $password } }) {
|
||||||
authToken
|
authToken
|
||||||
refreshToken
|
refreshToken
|
||||||
user {
|
user {
|
||||||
... AuthUser
|
...AuthUser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
mutation AuthRefreshToken($refreshToken: String!) {
|
mutation AuthRefreshToken($refreshToken: String!) {
|
||||||
refreshToken( input: { refreshToken: $refreshToken }) {
|
refreshToken(input: { refreshToken: $refreshToken }) {
|
||||||
authToken
|
authToken
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,6 @@ fragment GeneralSettings on GeneralSettings {
|
|||||||
|
|
||||||
query GeneralSettings {
|
query GeneralSettings {
|
||||||
generalSettings {
|
generalSettings {
|
||||||
... GeneralSettings
|
...GeneralSettings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ query NodeByUri($uri: String!) {
|
|||||||
nodeByUri(uri: $uri) {
|
nodeByUri(uri: $uri) {
|
||||||
__typename
|
__typename
|
||||||
... on Page {
|
... on Page {
|
||||||
... NodePage
|
...NodePage
|
||||||
}
|
}
|
||||||
... on NodeWithRankMathSeo {
|
... on NodeWithRankMathSeo {
|
||||||
... NodeSeo
|
...NodeSeo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
fragment SiteOptions on GroupSiteOptions {
|
fragment SiteOptions on GroupSiteOptions {
|
||||||
email
|
email
|
||||||
phoneNumber { ... AcfPhone }
|
phoneNumber {
|
||||||
|
...AcfPhone
|
||||||
|
}
|
||||||
...AcfSocial
|
...AcfSocial
|
||||||
links {
|
links {
|
||||||
contact { ... AcfLink}
|
contact {
|
||||||
|
...AcfLink
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query SiteOptions {
|
query SiteOptions {
|
||||||
siteOptions {
|
siteOptions {
|
||||||
groupSiteOptions {
|
groupSiteOptions {
|
||||||
... SiteOptions
|
...SiteOptions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,21 @@ const { path: uri } = useRoute();
|
|||||||
const { data, error } = await useAsyncGraphQLQuery("NodeByUri", { uri });
|
const { data, error } = await useAsyncGraphQLQuery("NodeByUri", { uri });
|
||||||
if (!data.value?.nodeByUri) {
|
if (!data.value?.nodeByUri) {
|
||||||
console.error("NodeByUri query error:", error.value);
|
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
|
// Dynamically resolve component based on node type
|
||||||
const componentName = `Node${data.value.nodeByUri.__typename}`;
|
const componentName = `Node${data.value.nodeByUri.__typename}`;
|
||||||
if (!useNuxtApp().vueApp.component(componentName)) {
|
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);
|
useNodeSeo(data.value.nodeByUri);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as z from "zod";
|
|
||||||
import type { AcfLinkFragment } from "#graphql/operations";
|
import type { AcfLinkFragment } from "#graphql/operations";
|
||||||
|
import * as z from "zod";
|
||||||
|
|
||||||
const acfLinkSchema = z.object({
|
const acfLinkSchema = z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
@@ -11,8 +11,7 @@ export type AcfLinkOutput = z.infer<typeof acfLinkSchema>;
|
|||||||
export function parseAcfLink(data?: Partial<AcfLinkFragment>) {
|
export function parseAcfLink(data?: Partial<AcfLinkFragment>) {
|
||||||
try {
|
try {
|
||||||
return acfLinkSchema.parse(data);
|
return acfLinkSchema.parse(data);
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ export const acfMediaSchema = z.object({
|
|||||||
export function parseAcfMedia(data?: Partial<AcfMediaFragment>) {
|
export function parseAcfMedia(data?: Partial<AcfMediaFragment>) {
|
||||||
try {
|
try {
|
||||||
return acfMediaSchema.parse(data);
|
return acfMediaSchema.parse(data);
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import * as z from "zod";
|
|
||||||
import type { AcfSocialFragment } from "#graphql/operations";
|
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({
|
const acfSocialSchema = z.object({
|
||||||
profiles: z.array(socialProfile),
|
profiles: z.array(socialProfile),
|
||||||
});
|
});
|
||||||
@@ -10,8 +12,7 @@ export type AcfSocialOutput = z.infer<typeof acfSocialSchema>;
|
|||||||
export function parseAcfSocial(data?: AcfSocialFragment) {
|
export function parseAcfSocial(data?: AcfSocialFragment) {
|
||||||
try {
|
try {
|
||||||
return acfSocialSchema.parse(data);
|
return acfSocialSchema.parse(data);
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -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",
|
|
||||||
} },
|
|
||||||
);
|
|
||||||
@@ -2,12 +2,16 @@ import { version } from "./package.json";
|
|||||||
|
|
||||||
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.`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const wpUrl = process.env.NUXT_WP_URL;
|
const wpUrl = process.env.NUXT_WP_URL;
|
||||||
if (!wpUrl) {
|
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;
|
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
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
"@lewebsimple/nuxt-graphql",
|
"@lewebsimple/nuxt-graphql",
|
||||||
"@nuxt/eslint",
|
|
||||||
"@nuxt/image",
|
"@nuxt/image",
|
||||||
"@nuxt/ui",
|
"@nuxt/ui",
|
||||||
"@nuxtjs/device",
|
"@nuxtjs/device",
|
||||||
@@ -28,9 +30,7 @@ export default defineNuxtConfig({
|
|||||||
],
|
],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
dirs: [
|
dirs: [{ path: "~/components", pathPrefix: false }],
|
||||||
{ path: "~/components", pathPrefix: false },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
@@ -68,18 +68,6 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
eslint: {
|
|
||||||
config: {
|
|
||||||
stylistic: {
|
|
||||||
arrowParens: true,
|
|
||||||
commaDangle: "always-multiline",
|
|
||||||
indent: 2,
|
|
||||||
quotes: "double",
|
|
||||||
semi: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
graphql: {
|
graphql: {
|
||||||
client: {
|
client: {
|
||||||
cache: {
|
cache: {
|
||||||
@@ -112,5 +100,4 @@ export default defineNuxtConfig({
|
|||||||
componentPrefix: "Svg",
|
componentPrefix: "Svg",
|
||||||
defaultImport: "component",
|
defaultImport: "component",
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "@lewebsimple/moonshine",
|
"name": "@lewebsimple/moonshine",
|
||||||
"description": "Headless WordPress theme based on Nuxt.",
|
|
||||||
"version": "0.1.13",
|
"version": "0.1.13",
|
||||||
"type": "module",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"description": "Headless WordPress theme based on Nuxt.",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm --sequential /build:.*/",
|
"build": "pnpm --sequential /build:.*/",
|
||||||
"build:nuxt": "nuxt build",
|
"build:nuxt": "nuxt build",
|
||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
"editor-style": "pnpx @tailwindcss/cli -i ./app/assets/css/_main.css -o ./editor-style.css --minify",
|
"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": "pnpm --sequential /postinstall:.*/",
|
||||||
"postinstall:wrangler-types": "wrangler types ./server/types/cloudflare.d.ts",
|
"postinstall:wrangler-types": "wrangler types ./server/types/cloudflare.d.ts",
|
||||||
"postinstall:nuxt": "nuxt prepare",
|
"postinstall:nuxt": "nuxt prepare",
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
"preview:build": "pnpm run build",
|
"preview:build": "pnpm run build",
|
||||||
"preview:wrangler-dev": "wrangler dev --port 3000",
|
"preview:wrangler-dev": "wrangler dev --port 3000",
|
||||||
"release": "pnpm --sequential /release:.*/",
|
"release": "pnpm --sequential /release:.*/",
|
||||||
"release:lint": "eslint .",
|
"release:lint": "oxlint .",
|
||||||
"release:typecheck": "nuxt typecheck",
|
"release:typecheck": "nuxt typecheck",
|
||||||
"release:changelogen": "changelogen --noAuthors --release --push"
|
"release:changelogen": "changelogen --noAuthors --release --push"
|
||||||
},
|
},
|
||||||
@@ -39,9 +40,9 @@
|
|||||||
"zod": "^4.3.6"
|
"zod": "^4.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxt/eslint": "^1.13.0",
|
|
||||||
"changelogen": "^0.6.2",
|
"changelogen": "^0.6.2",
|
||||||
"eslint": "^9.39.2",
|
"oxfmt": "^0.27.0",
|
||||||
|
"oxlint": "^1.42.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vue-tsc": "^3.2.4",
|
"vue-tsc": "^3.2.4",
|
||||||
"wrangler": "^4.61.1"
|
"wrangler": "^4.61.1"
|
||||||
|
|||||||
1406
wp-content/themes/moonshine/pnpm-lock.yaml
generated
1406
wp-content/themes/moonshine/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -5,17 +5,17 @@ export default defineEventHandler(async (event) => {
|
|||||||
if (!data?.login) {
|
if (!data?.login) {
|
||||||
throw new Error("INVALID_LOGIN");
|
throw new Error("INVALID_LOGIN");
|
||||||
}
|
}
|
||||||
if (!await handleLogin(event, data)) {
|
if (!(await handleLogin(event, data))) {
|
||||||
throw new Error("LOGIN_FAILED");
|
throw new Error("LOGIN_FAILED");
|
||||||
}
|
}
|
||||||
return { success: true, message: "Connexion réussie" };
|
return { success: true, message: "Connexion réussie" };
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
const messages = {
|
const messages = {
|
||||||
INVALID_LOGIN: "Identifiants invalides. Veuillez réessayer.",
|
INVALID_LOGIN: "Identifiants invalides. Veuillez réessayer.",
|
||||||
LOGIN_FAILED: "Une erreur est survenue lors de la connexion. Veuillez réessayer plus tard.",
|
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] };
|
return { success: false, message: messages[message as keyof typeof messages] };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ export default defineEventHandler(async (event) => {
|
|||||||
try {
|
try {
|
||||||
await handleLogout(event);
|
await handleLogout(event);
|
||||||
return { success: true, message: "Déconnexion réussie" };
|
return { success: true, message: "Déconnexion réussie" };
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
const message =
|
||||||
const message = error instanceof Error ? error.message : "Une erreur est survenue lors de la déconnexion.";
|
error instanceof Error ? error.message : "Une erreur est survenue lors de la déconnexion.";
|
||||||
return { success: false, message };
|
return { success: false, message };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,9 @@ export default defineRemoteExecutorHooks({
|
|||||||
onRequest(request) {
|
onRequest(request) {
|
||||||
// Attach the Authorization header if an authToken is present in the context
|
// Attach the Authorization header if an authToken is present in the context
|
||||||
if (request.context?.authToken) {
|
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}` },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import type { H3Event } from "h3";
|
|
||||||
import { jwtDecode } from "jwt-decode";
|
|
||||||
import type { User } from "#auth-utils";
|
import type { User } from "#auth-utils";
|
||||||
import type { AuthUserFragment, AuthLoginMutationResult } from "#graphql/operations";
|
import type { AuthUserFragment, AuthLoginMutationResult } from "#graphql/operations";
|
||||||
import { AuthRefreshTokenDocument } from "#graphql/operations";
|
import { AuthRefreshTokenDocument } from "#graphql/operations";
|
||||||
import type { ResultOf } from "#graphql/registry";
|
import type { ResultOf } from "#graphql/registry";
|
||||||
|
import type { H3Event } from "h3";
|
||||||
|
import { jwtDecode } from "jwt-decode";
|
||||||
|
|
||||||
// Handle login result and store user session
|
// Handle login result and store user session
|
||||||
export async function handleLogin(event: H3Event, loginResult: AuthLoginMutationResult) {
|
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 refreshPromise = (async () => {
|
||||||
const { wpUrl } = useRuntimeConfig();
|
const { wpUrl } = useRuntimeConfig();
|
||||||
const endpoint = `${wpUrl}/graphql`;
|
const endpoint = `${wpUrl}/graphql`;
|
||||||
const { data } = await executeGraphQLHTTP<ResultOf<"AuthRefreshToken">>({
|
const { data } = await executeGraphQLHTTP<ResultOf<"AuthRefreshToken">>(
|
||||||
|
{
|
||||||
query: AuthRefreshTokenDocument,
|
query: AuthRefreshTokenDocument,
|
||||||
variables: { refreshToken },
|
variables: { refreshToken },
|
||||||
}, { endpoint });
|
},
|
||||||
|
{ endpoint }
|
||||||
|
);
|
||||||
return data?.refreshToken?.authToken || undefined;
|
return data?.refreshToken?.authToken || undefined;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -91,8 +94,7 @@ export async function getAuthToken(event: H3Event): Promise<string | undefined>
|
|||||||
}
|
}
|
||||||
session.secure.authToken = newAuthToken;
|
session.secure.authToken = newAuthToken;
|
||||||
await setUserSession(event, session);
|
await setUserSession(event, session);
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
await clearUserSession(event);
|
await clearUserSession(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ declare module "#auth-utils" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { };
|
export {};
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
"$schema": "./node_modules/wrangler/config-schema.json",
|
"$schema": "./node_modules/wrangler/config-schema.json",
|
||||||
"main": "./output/server/index.mjs",
|
"main": "./output/server/index.mjs",
|
||||||
"compatibility_date": "2026-01-27",
|
"compatibility_date": "2026-01-27",
|
||||||
"compatibility_flags": [
|
"compatibility_flags": ["nodejs_compat"],
|
||||||
"nodejs_compat"
|
|
||||||
],
|
|
||||||
"observability": {
|
"observability": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user