Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 14 additions & 8 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import node from '@astrojs/node'
import tailwind from '@astrojs/tailwind'
import { defineConfig } from 'astro/config'
import tailwind from "@astrojs/tailwind"
import node from "@astrojs/node"
import routing from './hooks/routing'

// const faviconHook = {
Expand All @@ -18,7 +18,7 @@ import routing from './hooks/routing'
export default defineConfig({
// Use the NodeJS adapter
adapter: node({
mode: "standalone"
mode: 'standalone'
}),

// some settings to the build output
Expand All @@ -33,6 +33,14 @@ export default defineConfig({
// Compress the HTML output
compressHTML: true,

// Redirections des anciennes URLs (v1 -> v2)
redirects: {
'/categorie/allDays': '/categorie/alldays',
'/categorie/cycle/protegeMain': '/categorie/cycle/protege-main',
'/product/produit': '/produit/nettoyant',
'/product/config': '/categorie/alldays'
},

// Customizable depending on goal
output: 'server',

Expand All @@ -45,7 +53,7 @@ export default defineConfig({
},

// the site url
site: 'https://example.com',
site: 'https://trouve-ta-piece.fr',

// the Output server
server: {
Expand All @@ -66,7 +74,5 @@ export default defineConfig({
usePolling: !!(process.env.USE_POLLING ?? process.env.WSL_DISTRO_NAME)
}
}
},


})
}
})
16 changes: 14 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,21 @@
"formatter": {
"semicolons": "asNeeded",
"quoteStyle": "single",
"trailingComma": "none",
"trailingCommas": "none",
"lineWidth": 200,
"bracketSameLine": true
}
}
},
"overrides": [
{
"include": ["**/*.astro"],
"linter": {
"rules": {
"style": {
"useFilenamingConvention": "off"
}
}
}
}
]
}
6 changes: 2 additions & 4 deletions e2e/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect, test } from '@playwright/test'

test('has title', async ({ page }) => {
await page.goto('/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Dzeio/);
await page.goto('/')
await expect(page).toHaveTitle(/Trouve ta pièce/)
})
28 changes: 15 additions & 13 deletions hooks/routing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AstroIntegration } from 'astro'
import fs from 'node:fs/promises'
import type { AstroIntegration } from 'astro'

const baseFile = `
import { objectLoop } from '@dzeio/object-util'
Expand Down Expand Up @@ -60,7 +60,6 @@ async function updateRoutes(output: string, routes: Array<string>) {
await fs.writeFile(output, file)
}


/**
* format the path back to an url usable by the app
*
Expand Down Expand Up @@ -134,19 +133,22 @@ const integration: () => AstroIntegration = () => ({
outputFile = srcFolder + 'route.ts'

// get the files list
const files = (await Promise.all([
await getFiles(pagesFolder).then((ev) => ev.map((it) => formatPath(pagesFolder, it))),
await getFiles(publicFolder).then((ev) => ev.map((it) => formatPath(publicFolder, it, false)))
])).flat()
const files = (
await Promise.all([
await getFiles(pagesFolder).then((ev) => ev.map((it) => formatPath(pagesFolder, it))),
await getFiles(publicFolder).then((ev) => ev.map((it) => formatPath(publicFolder, it, false)))
])
).flat()
await updateRoutes(outputFile, files)
},
'astro:server:setup': async ({ server }) => {

// get the files list
const files = (await Promise.all([
await getFiles(pagesFolder).then((ev) => ev.map((it) => formatPath(pagesFolder, it))),
await getFiles(publicFolder).then((ev) => ev.map((it) => formatPath(publicFolder, it, false)))
])).flat()
const files = (
await Promise.all([
await getFiles(pagesFolder).then((ev) => ev.map((it) => formatPath(pagesFolder, it))),
await getFiles(publicFolder).then((ev) => ev.map((it) => formatPath(publicFolder, it, false)))
])
).flat()

// watch FS changes for new files to add them to the route list
server.watcher.on('add', (path) => {
Expand All @@ -158,7 +160,7 @@ const integration: () => AstroIntegration = () => ({

let removeExtension = true
let folder = pagesFolder
if(path.startsWith(publicFolder)) {
if (path.startsWith(publicFolder)) {
removeExtension = false
folder = publicFolder
} else if (!path.startsWith(folder)) {
Expand All @@ -178,7 +180,7 @@ const integration: () => AstroIntegration = () => ({
path = path.replace(/\\/g, '/')
let removeExtension = true
let folder = pagesFolder
if(path.startsWith(publicFolder)) {
if (path.startsWith(publicFolder)) {
removeExtension = false
folder = publicFolder
}
Expand Down
18 changes: 9 additions & 9 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ http {
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;

# Security headers (note: temporarely unvailable "prefetch-src 'self'; ")
add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'none'; form-action 'self'; manifest-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src data: 'self'; font-src 'self'; connect-src 'self'; base-uri 'self';";
add_header X-Frame-Options "DENY";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
add_header Referrer-Policy "no-referrer";
add_header Permissions-Policy "geolocation=(), microphone=(), interest-cohort=()";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Download-Options "noopen";
# Security headers (gardés alignés avec src/middleware/securityHeaders.ts)
add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; manifest-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data:; font-src 'self' https://fonts.gstatic.com data:; connect-src 'self'; upgrade-insecure-requests;" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "geolocation=(), camera=(), microphone=(), browsing-topics=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Download-Options "noopen" always;

location / {
try_files $uri $uri.html $uri/index.html /$uri /$uri/index.html /index.html;
Expand Down
35 changes: 21 additions & 14 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,39 @@ export default defineConfig({
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined as any,
reporter: process.env.CI ? 'list' : [['html', {
outputFolder: './playwright/report',
open: 'never'
}]],
workers: process.env.CI ? 1 : (undefined as any),
reporter: process.env.CI
? 'list'
: [
[
'html',
{
outputFolder: './playwright/report',
open: 'never'
}
]
],
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
trace: 'on-first-retry'
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
name: 'firefox',
use: { ...devices['Desktop Firefox'] }
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
name: 'webkit',
use: { ...devices['Desktop Safari'] }
}

/* Test against mobile viewports. */
// {
Expand All @@ -58,5 +65,5 @@ export default defineConfig({
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],
]
})
6 changes: 2 additions & 4 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
User-agent: *
Disallow: /private/
Disallow: /temp/
Allow: /public/
Allow: /favicon.ico
Allow: /
Disallow: /api/

Sitemap: https://trouve-ta-piece.fr/sitemap.xml
Binary file added src/assets/fonts/oswald-variable-latin.woff2
Binary file not shown.
Binary file added src/assets/fonts/outfit-variable-latin.woff2
Binary file not shown.
22 changes: 22 additions & 0 deletions src/assets/images/2fast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/50mhr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/50mk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/70airsal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/70airsalfonte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/70bida.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/80brk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/80most.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/90bida.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/accessoire.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/admiita.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/airsal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/airsalxtrem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/alesage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/antivol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/antoine.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/appli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/ardv2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/arriere.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/artekk2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/astuce.avif
Binary file not shown.
Binary file added src/assets/images/autocollant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/autosol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/baatop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/barre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/barreAlu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/images/bg.svg

Large diffs are not rendered by default.

Binary file added src/assets/images/bida.png
Binary file added src/assets/images/bks.png
Binary file added src/assets/images/blouson.jpg
Binary file added src/assets/images/boite.jpg
Binary file added src/assets/images/boite.png
Binary file added src/assets/images/bottes.jpg
Binary file added src/assets/images/bottes.webp
Binary file added src/assets/images/bougie.png
Binary file added src/assets/images/brk.png
Binary file added src/assets/images/brosse.png
Binary file added src/assets/images/burette.png
Binary file added src/assets/images/cacheAllumage.png
Binary file added src/assets/images/cagoule.png
Binary file added src/assets/images/caisse.png
Binary file added src/assets/images/cale-pied.png
Binary file added src/assets/images/camera.jpg
Binary file added src/assets/images/carbone.png
Binary file added src/assets/images/carbu.png
Binary file added src/assets/images/carbupolini.png
Binary file added src/assets/images/cardo.png
Binary file added src/assets/images/casque.jpg
Binary file added src/assets/images/chaine.png
Binary file added src/assets/images/charlie.jpg
Binary file added src/assets/images/cligno-progressif.png
Binary file added src/assets/images/cligno.jpg
Binary file added src/assets/images/clutch.png
Binary file added src/assets/images/cnc.jpg
Binary file added src/assets/images/combi.jpg
Binary file added src/assets/images/combi.png
Binary file added src/assets/images/cover.png
Binary file added src/assets/images/cuir.png
Binary file added src/assets/images/cylindre2fast.png
Binary file added src/assets/images/dayuan.png
Binary file added src/assets/images/deco.png
Binary file added src/assets/images/detail.png
Binary file added src/assets/images/detailing.png
Binary file added src/assets/images/disque.png
Binary file added src/assets/images/doppler.png
6 changes: 6 additions & 0 deletions src/assets/images/double.svg
Binary file added src/assets/images/dremel.png
Binary file added src/assets/images/dynamo.png
Binary file added src/assets/images/embro.png
Binary file added src/assets/images/entretien.jpg
Binary file added src/assets/images/equipement-search.png
Binary file added src/assets/images/equipement.webp
Binary file added src/assets/images/etrier.webp
Binary file added src/assets/images/evomosa.png
Binary file added src/assets/images/exc.png
Binary file added src/assets/images/extracteur.png
Binary file added src/assets/images/fast.png
Binary file added src/assets/images/fastCyl.png
28 changes: 28 additions & 0 deletions src/assets/images/favIcon.svg
Binary file added src/assets/images/feu.jpeg
Binary file added src/assets/images/fixation-moto.png
Binary file added src/assets/images/flacon.png
Binary file added src/assets/images/flush.webp
Binary file added src/assets/images/fraise.png
Binary file added src/assets/images/freinage.jpg
Binary file added src/assets/images/full9.png
Binary file added src/assets/images/gant.jpg
Binary file added src/assets/images/gonfleur.png
Binary file added src/assets/images/graisse.png
Binary file added src/assets/images/greluma.png
Binary file added src/assets/images/grille.png
Binary file added src/assets/images/guidon.png
Binary file added src/assets/images/gxs.jpg
Binary file added src/assets/images/holshot.webp
Binary file added src/assets/images/housse.png
Binary file added src/assets/images/inertie.png
Binary file added src/assets/images/jfg.png
Binary file added src/assets/images/k1.png
Binary file added src/assets/images/kit-nettoyage.png
Binary file added src/assets/images/leve-moto-pliable.png
Binary file added src/assets/images/leve-moto.png
Binary file added src/assets/images/lmr.png
Loading
Loading