wip avec résolution de conflits

This commit is contained in:
gcch 2026-02-27 14:38:50 +01:00
commit ef19ba2b72
208 changed files with 178625 additions and 192002 deletions

61
cfg/eslint.config.ts Executable file
View file

@ -0,0 +1,61 @@
import js from "@eslint/js";
import oxlint from "eslint-plugin-oxlint";
import perfectionist from "eslint-plugin-perfectionist";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
js.configs.recommended,
perfectionist.configs["recommended-natural"],
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
oxlint.configs["flat/recommended"],
{
files: ["*.js", "web/app/themes/haiku-atelier-2024/src/**/*.ts"],
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
...globals.es2020,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
/* Utilise Array<T> plutôt que T[]. */
"@typescript-eslint/array-type": [
"error",
{
default: "generic",
readonly: "generic",
},
],
/* L'usage d'interfaces ou de types doit être à la discrétion du développeur. */
"@typescript-eslint/consistent-type-definitions": "off",
/* Désactive cette règle pour les fonctions fléchées pour rendre le code moins verbeux. */
"@typescript-eslint/no-confusing-void-expression": [
"error",
{
ignoreArrowShorthand: true,
ignoreVoidOperator: false,
},
],
/* Chiant avec certaines Promises. */
"@typescript-eslint/no-misused-promises": "off",
/* Cette règle empêche l'usage de génériques précisant les types de retour de fonctions. */
"@typescript-eslint/no-unnecessary-type-parameters": "off",
// Pour utiliser LogTape.
"@typescript-eslint/no-unused-expressions": "off",
/* Cette règle est doublon avec les règles noUnused* de TypeScript. */
"@typescript-eslint/no-unused-vars": "off",
/* Cette règle empêche de lever des erreurs génériques (p.ex. `E extends Error`). */
"@typescript-eslint/only-throw-error": "off",
/* Cette règle empêche le style fonctionnel « point free ». */
"@typescript-eslint/unbound-method": "off",
/* Cette règle interdit l'usage de fonctions vides sauf pour les fonctions fléchées. */
"no-empty-function": ["error", { allow: ["arrowFunctions"] }],
},
},
);

83
cfg/playwright.config.ts Normal file
View file

@ -0,0 +1,83 @@
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
// Définis un délai d'exécution.
timeout: 30000,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "list",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "https://haikuatelier.gcch.local",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
clientCertificates: [
{
origin: "https://haikuatelier.gcch.local",
certPath: "./containers/data/certs/_wildcard.gcch.local.pem",
keyPath: "./containers/data/certs/_wildcard.gcch.local-key.pem",
},
],
ignoreHTTPSErrors: true,
},
/* Configure projects for major browsers */
projects: [
{
name: "desktop-chromium-1920",
use: { ...devices["Desktop Chrome"], viewport: { width: 1920, height: 1080 } },
},
// {
// name: "desktop-chromium-1536",
// use: { ...devices["Desktop Chrome"], viewport: { width: 1536, height: 864 } },
// },
// {
// name: "desktop-chromium-1366",
// use: { ...devices["Desktop Chrome"], viewport: { width: 1366, height: 768 } },
// },
{
name: "desktop-firefox-1920",
use: { ...devices["Desktop Firefox"], viewport: { width: 1920, height: 1080 } },
},
// {
// name: "desktop-firefox-1536",
// use: { ...devices["Desktop Firefox"], viewport: { width: 1536, height: 864 } },
// },
// {
// name: "desktop-firefox-1366",
// use: { ...devices["Desktop Firefox"], viewport: { width: 1366, height: 768 } },
// },
// {
// name: "tablet-chromium-portrait",
// use: { ...devices["Galaxy Tab S9"] },
// },
// {
// name: "tablet-chromium-landscape",
// use: { ...devices["Galaxy Tab S9 landscape"] },
// },
// {
// name: "mobile-chromium-portrait",
// use: { ...devices["Pixel 7"] },
// },
// {
// name: "mobile-chromium-landscape",
// use: { ...devices["Pixel 7 landscape"] },
// },
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://localhost:3000',
// reuseExistingServer: !process.env.CI,
// },
});

7
cfg/prettier.config.ts Executable file
View file

@ -0,0 +1,7 @@
import { configClassique } from "@gcch/configuration-prettier";
const config = {
...configClassique,
};
export default config;

37
cfg/prettierignore Executable file
View file

@ -0,0 +1,37 @@
# Tout ce qui est traité par dprint
*.css
*.html
*.js
*.md
*.mjs
*.mts
*.php
*.scss
*.ts
*.xml
*.yaml
*.yml
!package.json
# Cache
.cache
# Tout sauf le thème
**/vendor
**/web/app/languages
**/web/app/mu-plugins
**/web/app/plugins
**/web/app/themes/haiku-atelier-2024/assets
**/web/app/themes/twentytwentyfour
**/web/app/uploads
**/web/wp
# Dépendances
composer.lock
bun.lock
# Jujutsu
.jj/
# Zed
.zed/

40
cfg/stylelint.config.ts Executable file
View file

@ -0,0 +1,40 @@
// @ts-expect-error -- La dépendance ne dispose pas de types.
import { propertyGroups } from "stylelint-config-clean-order";
/** @type {string[][]} */
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Impossible de typer correctement avec JSDoc.
const groupesProprietes = Array.from(/** @type {GroupeProprietes} */ propertyGroups);
/** @import { StylelintConfigCleanOrderPropertyGroup } from "./lib/stylelint" */
/** @type {Array<StylelintConfigCleanOrderPropertyGroup>} */
const ordreProprietes = groupesProprietes.map((properties) => ({
emptyLineBefore: "never",
noEmptyLineBetween: true,
properties,
}));
/** @type {import("stylelint").Config} */
export default {
extends: ["stylelint-config-standard-scss", "stylelint-config-sass-guidelines", "stylelint-config-clean-order"],
plugins: ["stylelint-declaration-block-no-ignored-properties"],
rules: {
"@stylistic/function-parentheses-space-inside": null,
"@stylistic/selector-list-comma-newline-after": null,
"@stylistic/string-quotes": null,
"custom-property-pattern": null,
"declaration-block-no-duplicate-custom-properties": true,
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"max-nesting-depth": null,
"no-descending-specificity": null,
"no-duplicate-selectors": [true, { disallowInList: false }],
"order/properties-order": [ordreProprietes, { severity: "error", unspecified: "bottomAlphabetical" }],
"plugin/declaration-block-no-ignored-properties": true,
"selector-class-pattern": null,
"selector-id-pattern": null,
"selector-max-compound-selectors": null,
"selector-max-id": null,
"selector-no-qualifying-type": null,
},
};

49
cfg/vite.config.ts Executable file
View file

@ -0,0 +1,49 @@
import type { PathsOutput } from "fdir";
import { fdir } from "fdir";
import process from "node:process";
import { defineConfig, loadEnv } from "vite";
const SLUG_THEME = "haiku-atelier-2024";
const SRC_TYPESCRIPT_PATHS: Promise<PathsOutput> = new fdir()
.withBasePath()
.filter((path, isDirectory) => !isDirectory && !path.endsWith("d.ts"))
.withMaxDepth(0)
.crawl(`web/app/themes/${SLUG_THEME}/src/scripts`)
.withPromise();
const PATHS = await SRC_TYPESCRIPT_PATHS;
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "VITE");
return {
base: "/",
cacheDir: ".cache/vite",
build: {
assetsDir: ".",
cssMinify: "lightningcss",
emptyOutDir: true,
manifest: true,
minify: env["VITE_MODE"] === "production",
outDir: "./web/app/themes/haiku-atelier-2024/assets/js",
reportCompressedSize: true,
rollupOptions: {
input: PATHS,
output: {
assetFileNames: "[hash].[extname]",
chunkFileNames: "[hash].js",
entryFileNames: "[name].js",
minify: env["VITE_MODE"] === "production",
},
treeshake: true,
},
sourcemap: env["VITE_MODE"] === "development",
target: "es2020",
write: true,
},
css: {
devSourcemap: true,
transformer: "lightningcss",
},
mode: env["VITE_MODE"] ?? "production",
};
});