Compare commits
10 Commits
v0.1.1
...
dbbb2f7009
| Author | SHA1 | Date | |
|---|---|---|---|
| dbbb2f7009 | |||
| d0244eb6a3 | |||
| a2860478a9 | |||
| 33589d425a | |||
| 9b6a86fe0c | |||
| f520db7a9d | |||
| 3d7a2b2ef6 | |||
| ca2e660c05 | |||
| de126b0953 | |||
| 9495c4f004 |
34
.github/copilot-instructions.md
vendored
Normal file
34
.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# Copilot instructions (wp-headless)
|
||||
|
||||
## Overview
|
||||
- This project is a full WordPress install (core lives in `wp-admin/` + `wp-includes/`). Treat core files as upstream: **don’t implement features by editing WordPress core or plugins**.
|
||||
- Project-specific code lives in `wp-content/themes/moonshine/`:
|
||||
- “Headless” stack is assembled via custom theme and plugins:
|
||||
- `wp-content/themes/moonshine/` provides the WordPress PHP theme logic and Nuxt frontend.
|
||||
- `wp-content/plugins/wp-graphql/` provides the GraphQL endpoint (typically `/graphql`).
|
||||
- `wp-content/plugins/wpgraphql-acf/` exposes ACF fields in the GraphQL schema.
|
||||
- `wp-content/plugins/wp-graphql-headless-login/` provides GraphQL-based authentication flows.
|
||||
|
||||
## Where to make changes
|
||||
- **Changes should only be made in the Moonshine theme `wp-content/themes/moonshine/`**
|
||||
- WordPress PHP theme logic lives in `wp-content/themes/moonshine/includes/`.
|
||||
- Nuxt frontend (Nuxt 4): `wp-content/themes/moonshine/`
|
||||
- App entry & routes: `wp-content/themes/moonshine/app/` (catch-all route is `app/pages/[...uri].vue`).
|
||||
- Config: `wp-content/themes/moonshine/nuxt.config.ts`.
|
||||
- Package manager: **pnpm** (`pnpm-lock.yaml` is present).
|
||||
|
||||
## Developer workflows
|
||||
- **WP Headless** - WordPress Composer project (root folder):
|
||||
- Install PHP deps (also manages WP plugins/themes via Composer repos): `composer install`.
|
||||
- Update PHP deps / WordPress plugins: `composer update`.
|
||||
- Composer uses an internal Satis repo (`https://satis.ledevsimple.ca`) plus `wpackagist.org`.
|
||||
- PHP linting (phpcs):`composer lint`
|
||||
- PHP beautifier (phpcbf): `composer lintfix`
|
||||
- **Moonshine** - Headless WordPress theme based on Nuxt 4 (`wp-content/themes/moonshine/`):
|
||||
- Dev: `pnpm dev`
|
||||
- Build: `pnpm build`
|
||||
- Lint (autofix): `pnpm lint`
|
||||
|
||||
## Conventions to follow
|
||||
- Prefer adding project behavior via WordPress hooks/filters in the theme (`moonshine_*` functions) or via plugins—avoid editing WP core at all cost.
|
||||
- In the Nuxt app, prefer the repo’s ESLint/Tailwind conventions (VS Code settings treat `*.css` as TailwindCSS and support Nuxt UI `ui` attributes).
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,8 +2,10 @@
|
||||
/*
|
||||
!/.cpanel.yml
|
||||
!/.gitea
|
||||
!/.github
|
||||
!/.gitignore
|
||||
!/.vscode
|
||||
!/README.md
|
||||
!/composer.*
|
||||
!/phpcs.xml
|
||||
!/wp-content/
|
||||
|
||||
20
.vscode/settings.json
vendored
Normal file
20
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
6
README.md
Normal file
6
README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# WP Headless
|
||||
|
||||
Headless WordPress project boilerplate using Nuxt.
|
||||
|
||||
[✨ Release notes](/wp-content/themes/moonshine/CHANGELOG.md)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="wp-boilerplate">
|
||||
<rule ref="WebsimpleWP"/>
|
||||
<file>wp-content/themes/wp-boilerplate/</file>
|
||||
<file>wp-content/themes/moonshine/</file>
|
||||
</ruleset>
|
||||
|
||||
1
wp-content/themes/moonshine/.npmrc
Normal file
1
wp-content/themes/moonshine/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
shamefully-hoist=true
|
||||
@@ -8,8 +8,3 @@
|
||||
- Initial Moonshine theme - Headless WordPress theme based on Nuxt (b3134fe)
|
||||
- CHANGELOG generation using conventional commits (55e16ab)
|
||||
- ESLint configuration (e95bbfb)
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
- Pascal Martineau <pascal@lewebsimple.ca>
|
||||
|
||||
|
||||
2
wp-content/themes/moonshine/app/assets/css/_main.css
Normal file
2
wp-content/themes/moonshine/app/assets/css/_main.css
Normal file
@@ -0,0 +1,2 @@
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -0,0 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UFooter id="site-footer">
|
||||
<template #left>
|
||||
<SiteFooterCopyright />
|
||||
</template>
|
||||
<template #right>
|
||||
<SiteFooterCredits />
|
||||
</template>
|
||||
</UFooter>
|
||||
</template>
|
||||
@@ -0,0 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
const { data } = await useGraphQLQuery("GeneralSettings", undefined, { cache: { ttl: 0 } });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
© {{ new Date().getFullYear() }}
|
||||
<span v-if="data.generalSettings?.title">{{ data.generalSettings.title }}</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,6 @@
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
const title = "Moonshine";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UHeader :title="title" />
|
||||
</template>
|
||||
@@ -0,0 +1,6 @@
|
||||
query GeneralSettings {
|
||||
generalSettings {
|
||||
title
|
||||
description
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { fr } from "@nuxt/ui/locale";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="layout-default">
|
||||
<NuxtPage />
|
||||
</div>
|
||||
<UApp id="layout-default" :locale="fr">
|
||||
<SiteHeader />
|
||||
<UMain>
|
||||
<slot />
|
||||
</UMain>
|
||||
<SiteFooter />
|
||||
</UApp>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,5 @@
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="page-node-from-uri">
|
||||
<h1>Moonshine</h1>
|
||||
</div>
|
||||
<div id="page-node-from-uri" />
|
||||
</template>
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Core
|
||||
require_once __DIR__ . '/includes/core/theme-setup.php';
|
||||
|
||||
4
wp-content/themes/moonshine/graphql.config.json
Normal file
4
wp-content/themes/moonshine/graphql.config.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"schema": "./server/graphql/schema.graphql",
|
||||
"documents": "**/*.gql"
|
||||
}
|
||||
18
wp-content/themes/moonshine/includes/core/theme-setup.php
Normal file
18
wp-content/themes/moonshine/includes/core/theme-setup.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// Setup theme
|
||||
add_action( 'after_setup_theme', 'moonshine_after_setup_theme' );
|
||||
function moonshine_after_setup_theme() {
|
||||
// Load textdomain
|
||||
load_theme_textdomain( 'moonshine', get_theme_file_path( 'languages' ) );
|
||||
|
||||
// Theme features
|
||||
add_theme_support( 'custom-logo' );
|
||||
add_theme_support( 'editor-styles' );
|
||||
remove_theme_support( 'core-block-patterns' );
|
||||
|
||||
// Register menus
|
||||
register_nav_menu( 'main', __( "Main menu", 'moonshine' ) );
|
||||
|
||||
// Register sidebars
|
||||
}
|
||||
24
wp-content/themes/moonshine/languages/fr_CA.l10n.php
Normal file
24
wp-content/themes/moonshine/languages/fr_CA.l10n.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
return array(
|
||||
'project-id-version' => 'Moonshine',
|
||||
'report-msgid-bugs-to' => '',
|
||||
'pot-creation-date' => '2026-01-13 15:52+0000',
|
||||
'po-revision-date' => '2026-01-13 15:53+0000',
|
||||
'last-translator' => '',
|
||||
'language-team' => 'Français du Canada',
|
||||
'language' => 'fr_CA',
|
||||
'plural-forms' => 'nplurals=2; plural=n > 1;',
|
||||
'mime-version' => '1.0',
|
||||
'content-type' => 'text/plain; charset=UTF-8',
|
||||
'content-transfer-encoding' => '8bit',
|
||||
'x-generator' => 'Loco https://localise.biz/',
|
||||
'x-loco-version' => '2.8.1; wp-6.9; php-8.3.27',
|
||||
'x-domain' => 'moonshine',
|
||||
'messages' => array(
|
||||
'Headless WordPress theme based on Nuxt.' => 'Thème Wordpress headless basé sur Nuxt.',
|
||||
'https://websimple.com/' => 'https://websimple.com/',
|
||||
'Main menu' => 'Menu principal',
|
||||
'Moonshine' => 'Moonshine',
|
||||
'Pascal Martineau ' => 'Pascal Martineau ',
|
||||
),
|
||||
);
|
||||
BIN
wp-content/themes/moonshine/languages/fr_CA.mo
Normal file
BIN
wp-content/themes/moonshine/languages/fr_CA.mo
Normal file
Binary file not shown.
36
wp-content/themes/moonshine/languages/fr_CA.po
Normal file
36
wp-content/themes/moonshine/languages/fr_CA.po
Normal file
@@ -0,0 +1,36 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Moonshine\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-01-13 15:52+0000\n"
|
||||
"PO-Revision-Date: 2026-01-13 15:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Français du Canada\n"
|
||||
"Language: fr_CA\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Loco-Version: 2.8.1; wp-6.9; php-8.3.27\n"
|
||||
"X-Domain: moonshine"
|
||||
|
||||
#. Description of the theme
|
||||
msgid "Headless WordPress theme based on Nuxt."
|
||||
msgstr "Thème Wordpress headless basé sur Nuxt."
|
||||
|
||||
#. Author URI of the theme
|
||||
msgid "https://websimple.com/"
|
||||
msgstr "https://websimple.com/"
|
||||
|
||||
#: includes/core/theme-setup.php:15
|
||||
msgid "Main menu"
|
||||
msgstr "Menu principal"
|
||||
|
||||
#. Name of the theme
|
||||
msgid "Moonshine"
|
||||
msgstr "Moonshine"
|
||||
|
||||
#. Author of the theme
|
||||
msgid "Pascal Martineau "
|
||||
msgstr "Pascal Martineau "
|
||||
37
wp-content/themes/moonshine/languages/moonshine.pot
Normal file
37
wp-content/themes/moonshine/languages/moonshine.pot
Normal file
@@ -0,0 +1,37 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Moonshine\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-01-13 15:52+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: \n"
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Loco-Version: 2.8.1; wp-6.9; php-8.3.27\n"
|
||||
"X-Domain: moonshine"
|
||||
|
||||
#. Description of the theme
|
||||
msgid "Headless WordPress theme based on Nuxt."
|
||||
msgstr ""
|
||||
|
||||
#. Author URI of the theme
|
||||
msgid "https://websimple.com/"
|
||||
msgstr ""
|
||||
|
||||
#: includes/core/theme-setup.php:15
|
||||
msgid "Main menu"
|
||||
msgstr ""
|
||||
|
||||
#. Name of the theme
|
||||
msgid "Moonshine"
|
||||
msgstr ""
|
||||
|
||||
#. Author of the theme
|
||||
msgid "Pascal Martineau "
|
||||
msgstr ""
|
||||
@@ -2,11 +2,25 @@
|
||||
export default defineNuxtConfig({
|
||||
|
||||
modules: [
|
||||
"@lewebsimple/nuxt-graphql",
|
||||
"@nuxt/eslint",
|
||||
"@nuxt/ui",
|
||||
],
|
||||
|
||||
components: {
|
||||
dirs: [
|
||||
{ path: "~/components", pathPrefix: false },
|
||||
],
|
||||
},
|
||||
|
||||
devtools: { enabled: true },
|
||||
|
||||
css: ["~/assets/css/_main.css"],
|
||||
|
||||
ui: {
|
||||
colorMode: false,
|
||||
},
|
||||
|
||||
compatibilityDate: "2026-01-01",
|
||||
|
||||
eslint: {
|
||||
@@ -21,4 +35,13 @@ export default defineNuxtConfig({
|
||||
},
|
||||
},
|
||||
|
||||
graphql: {
|
||||
schemas: {
|
||||
wp: {
|
||||
type: "remote",
|
||||
url: `${process.env.NUXT_WP_URL || "https://wp-headless.ledevsimple.ca"}/graphql`,
|
||||
},
|
||||
},
|
||||
saveSdl: "server/graphql/schema.graphql",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -11,17 +11,24 @@
|
||||
"postinstall": "pnpm --sequential /postinstall:.*/",
|
||||
"postinstall:nuxt": "nuxt prepare",
|
||||
"preview": "nuxt preview",
|
||||
"release": "pnpm lint && changelogen --release --push"
|
||||
"release": "pnpm lint && pnpm typecheck && changelogen --noAuthors --release --push",
|
||||
"typecheck": "nuxt typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify-json/lucide": "^1.2.84",
|
||||
"@lewebsimple/nuxt-graphql": "^0.3.5",
|
||||
"@nuxt/ui": "4.3.0",
|
||||
"nuxt": "^4.2.2",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"vue": "^3.5.26",
|
||||
"vue-router": "^4.6.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxt/eslint": "^1.12.1",
|
||||
"changelogen": "^0.6.2",
|
||||
"eslint": "^9.39.2"
|
||||
"eslint": "^9.39.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vue-tsc": "^3.2.2"
|
||||
},
|
||||
"changelog": {
|
||||
"types": {
|
||||
|
||||
4810
wp-content/themes/moonshine/pnpm-lock.yaml
generated
4810
wp-content/themes/moonshine/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
13899
wp-content/themes/moonshine/server/graphql/schema.graphql
Normal file
13899
wp-content/themes/moonshine/server/graphql/schema.graphql
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user