Upgrade using base project bump

This commit is contained in:
Jérémy Munsch 2023-10-27 14:22:03 +02:00
parent 0f4fe5eaac
commit 3d959fd37c
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
8 changed files with 75 additions and 68 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
.git
*.md

View file

@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
ASSET_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null

View file

@ -34,6 +34,7 @@ class SecureHeaders
public function handle(Request $request, Closure $next): Response
{
// phpcs:enable
// * For Vite DEV
$host = \parse_url(\config('app.url'), \PHP_URL_HOST);
View::share('nonce', $nonce = Vite::useCspNonce());
// * For VueJS dev tool to execute
@ -54,8 +55,8 @@ class SecureHeaders
// * CKEDITOR Specific https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/csp.html
"connect-src 'self' " . implode(' ', [
// * VITE DEV
config('app.debug') ? "wss://vite.{$host}:4443" : '',
config('app.debug') ? "https://vite.{$host}:4443" : '',
config('app.debug') ? "wss://{$host}:4443" : '',
config('app.debug') ? "https://{$host}:4443" : '',
'https://yl.s-web.fr',
]) . ';',
"img-src * https://yl.s-web.fr data: blob:;",
@ -66,34 +67,31 @@ class SecureHeaders
]) . ';',
"font-src 'self' data: " . \implode(' ', [
// * VITE DEV
config('app.debug') ? "https://vite.{$host}:4443" : '',
config('app.debug') ? "https://{$host}:4443" : '',
'https://fonts.gstatic.com;'
]) . ';',
// ! Using CKEditor will must have unsafe-inline style
// phpcs:ignore Generic.Files.LineLength.TooLong
"style-src 'self' 'unsafe-inline' " . \implode(' ', [
// * VITE DEV
config('app.debug') ? "https://vite.{$host}:4443" : '',
'https://cdnjs.cloudflare.com',
// * File Manager
'https://fonts.googleapis.com',
'https://cdn.jsdelivr.net',
'https://use.fontawesome.com',
'https://fonts.googleapis.com'
'https://fonts.googleapis.com',
// * VITE DEV
config('app.debug') ? "https://{$host}:4443" : '',
]) . ';',
// ! If you dont use ckeditor use this
// "style-src 'self' 'nonce-$nonce';",
// phpcs:ignore Generic.Files.LineLength.TooLong
"script-src 'self' {$jsDev} " . \implode(' ', [
'https: blob:',
// * VITE DEV
config('app.debug') ? "https://vite.{$host}:4443" : '',
'https://www.googletagmanager.com',
'https://cdnjs.cloudflare.com',
'https://www.google.com/recaptcha/',
'https://www.gstatic.com/recaptcha/',
'https://yl.s-web.fr',
"$scheme://www.google-analytics.com",
// * VITE DEV
config('app.debug') ? "https://{$host}:4443" : '',
]) . ';'
];

56
package-lock.json generated
View file

@ -1,5 +1,5 @@
{
"name": "srcs",
"name": "agis",
"lockfileVersion": 3,
"requires": true,
"packages": {
@ -50,9 +50,9 @@
"toastify-js": "^1.12.0",
"ts-loader": "^9.3.1",
"typescript": "latest",
"typescript-eslint": "^0.0.1-alpha.0",
"typescript-eslint": "latest",
"vite": "^4.0.0",
"vite-plugin-babel": "^1.1.3",
"vite-plugin-babel": "latest",
"vite-plugin-checker": "latest",
"vite-plugin-eslint": "latest",
"vite-plugin-stylelint": "latest",
@ -2182,9 +2182,9 @@
}
},
"node_modules/@eslint-community/regexpp": {
"version": "4.9.1",
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz",
"integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==",
"version": "4.10.0",
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz",
"integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==",
"dev": true,
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
@ -2550,12 +2550,12 @@
"dev": true
},
"node_modules/@types/node": {
"version": "20.8.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.8.tgz",
"integrity": "sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==",
"version": "20.8.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz",
"integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==",
"dev": true,
"dependencies": {
"undici-types": "~5.25.1"
"undici-types": "~5.26.4"
}
},
"node_modules/@types/normalize-package-data": {
@ -3544,9 +3544,9 @@
"peer": true
},
"node_modules/acorn": {
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
"integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
"version": "8.11.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"dev": true,
"bin": {
"acorn": "bin/acorn"
@ -3829,9 +3829,9 @@
}
},
"node_modules/axios": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz",
"integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz",
"integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.15.0",
@ -4427,9 +4427,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.4.566",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.566.tgz",
"integrity": "sha512-mv+fAy27uOmTVlUULy15U3DVJ+jg+8iyKH1bpwboCRhtDC69GKf1PPTZvEIhCyDr81RFqfxZJYrbgp933a1vtg==",
"version": "1.4.568",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.568.tgz",
"integrity": "sha512-3TCOv8+BY6Ltpt1/CmGBMups2IdKOyfEmz4J8yIS4xLSeMm0Rf+psSaxLuswG9qMKt+XbNbmADybtXGpTFlbDg==",
"dev": true
},
"node_modules/emoji-regex": {
@ -4801,9 +4801,9 @@
}
},
"node_modules/eslint-plugin-vue": {
"version": "9.18.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.18.0.tgz",
"integrity": "sha512-yUM8a2OD/7Qs0PiugkRaxgz5KBRvzMvWShity2UvVFAN0yk8029mGpTdg/TNARPiYzp335mEwDHwcAR8tQNe4g==",
"version": "9.18.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.18.1.tgz",
"integrity": "sha512-7hZFlrEgg9NIzuVik2I9xSnJA5RsmOfueYgsUGUokEDLJ1LHtxO0Pl4duje1BriZ/jDWb+44tcIlC3yi0tdlZg==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
@ -7565,9 +7565,9 @@
}
},
"node_modules/sass": {
"version": "1.69.4",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.4.tgz",
"integrity": "sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==",
"version": "1.69.5",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz",
"integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==",
"dev": true,
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0",
@ -8926,9 +8926,9 @@
}
},
"node_modules/undici-types": {
"version": "5.25.3",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz",
"integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==",
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/unicode-canonical-property-names-ecmascript": {

View file

@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"vite": "vite --https --host vite.agis.test --port 4443 --clearScreen false",
"vite": "vite --clearScreen false",
"prod": "vite build --mode production",
"dev": "NODE_ENV=development vite build -d --mode development",
"watch": "NODE_ENV=development vite build --mode development --watch",
@ -57,16 +57,16 @@
"terser": "latest",
"toastify-js": "^1.12.0",
"ts-loader": "^9.3.1",
"typescript-eslint": "latest",
"typescript": "latest",
"typescript-eslint": "^0.0.1-alpha.0",
"vite": "^4.0.0",
"vite-plugin-babel": "^1.1.3",
"vite-plugin-babel": "latest",
"vite-plugin-checker": "latest",
"vite-plugin-eslint": "latest",
"vite-plugin-stylelint": "latest",
"vue": "latest",
"vite": "^4.0.0",
"vue-eslint-parser": "^9.1.0",
"vue-loader": "^16.8.3",
"vue": "latest",
"vue-tsc": "1.6.0"
}
}

View file

@ -95,15 +95,24 @@ export default defineComponent({
makeSuperBuild() {
const self = this,
ckeditor = this.$refs.ckeditor as HTMLElement,
wordCounter = this.$refs.wordCounter as HTMLElement;
// * Specific to Calliope
// verticalTopMenuOffset = document.querySelector(
// "body > div> .navbar"
// ) as HTMLElement | null;
wordCounter = this.$refs.wordCounter as HTMLElement,
// * Top Menu
verticalTopMenuOffset = document.querySelector(
"body > #top-navbar"
) as HTMLElement | null;
// if (!verticalTopMenuOffset) {
// throw new Error("Could not find bo Top menu navbar");
// }
if (!verticalTopMenuOffset) {
console.warn("Could not find bo #top-navbar");
}
const ui = verticalTopMenuOffset ? {
viewportOffset: {
top: verticalTopMenuOffset.getBoundingClientRect().height,
right: 0,
bottom: 0,
left: 0,
},
} : undefined;
// @ts-ignore
ClassicEditor.create(ckeditor, {
@ -128,29 +137,21 @@ export default defineComponent({
this.words = stats.words;
},
},
// ui: {
// viewportOffset: {
// top: verticalTopMenuOffset.getBoundingClientRect().height,
// right: 0,
// bottom: 0,
// left: 0,
// },
// },
ui: ui,
link: {
// Automatically add target="_blank" and rel="noopener noreferrer" to all external links.
addTargetToExternalLinks: true,
// Let the users control the "download" attribute of each link.
decorators: [
{
decorators: {
openInNewTab: {
mode: "manual",
label: "Ouvrir dans un nouvel onglet",
attributes: {
target: "_blank",
rel: "noopener noreferrer",
},
},
],
}
}
}
},
typing: {
transformations: {

View file

@ -1,4 +1,4 @@
<nav class="navbar navbar-expand-lg position-fixed fixed-top bg-body-secondary shadow-sm">
<nav class="navbar navbar-expand-lg position-fixed fixed-top bg-body-secondary shadow-sm" id="top-navbar">
<div class="container">
<a class="navbar-brand" data-bs-toggle="tooltip" data-bs-placement="bottom" href="{{ route('fo.homepage') }}"
title="{{ __('Accéder au front du projet') }}" target="_blank">

View file

@ -3,12 +3,14 @@ import vue from "@vitejs/plugin-vue";
import laravel from "laravel-vite-plugin";
import path from "path";
import postcssDiscard from "postcss-discard-comments";
import { defineConfig } from "vite";
import { defineConfig, loadEnv } from "vite";
import babel from "vite-plugin-babel";
import checker from "vite-plugin-checker";
import eslint from "vite-plugin-eslint";
import stylelint from "vite-plugin-stylelint";
const env = loadEnv("r", process.cwd(), "");
export default defineConfig({
build: {
rollupOptions: {
@ -105,6 +107,9 @@ export default defineConfig({
})
],
server: {
https: true,
host: new URL(env["APP_URL"]).hostname,
port: 4443,
watch: {
usePolling: true,
},