From deb840e9bd1406e40c63348e80efa058ec6e998b Mon Sep 17 00:00:00 2001 From: Enzo Marioni Date: Thu, 1 Oct 2026 17:01:27 +0200 Subject: [PATCH] Adopte @avalon-vanguard/config : Prettier, tsconfig, .editorconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .npmrc : le scope @avalon-vanguard pointe vers le registre npm de Gitea (lecture anonyme, aucune ligne _authToken). - devDependency @avalon-vanguard/config ^1.0.0 (résolu depuis git.avalonvanguard.com). - .prettierrc : "@avalon-vanguard/config/prettier/angular" (mêmes printWidth 100, singleQuote et parser angular pour *.html ; les défauts de Prettier 3 deviennent explicites). - tsconfig.json étend @avalon-vanguard/config/tsconfig/angular.json ; files et references restent ici. Les sous-configs (app, spec, worker, e2e, etl) étendent toujours ../tsconfig.json, sans changement. - .editorconfig : copie du fichier du paquet (seuls trois commentaires s'ajoutent). Aucun changement de résultat, vérifié depuis un `npm ci` propre de chaque côté (Node 24.15, rm -rf dist .angular/cache) contre main 822c699 : - `ng build` de production : les 33 fichiers de dist/ ont le même sha256. - `prettier --check .` : sortie identique (les mêmes 135 fichiers déjà signalés). - etl, e2e et worker typecheck, tsc app et spec : propres avant et après ; `tsc --showConfig` sémantiquement identique pour les 5 projets. - `ng test` : 729 tests sur 41 fichiers, tous verts des deux côtés. - `playwright test --list` : identique (17 tests, 8 fichiers). - node_modules : seul @avalon-vanguard/config s'ajoute. Note : index.html embarque la CSS de Google Fonts téléchargée au moment du build ; deux builds de main à quelques minutes d'écart peuvent donc différer sur ce seul fichier. Les deux builds comparés ici ont été faits à la suite. Co-Authored-By: Claude Opus 5.5 (1M context) --- .editorconfig | 2 ++ .npmrc | 1 + .prettierrc | 13 +------------ package-lock.json | 33 +++++++++++++++++++++++++++++++++ package.json | 1 + tsconfig.json | 19 ++----------------- 6 files changed, 40 insertions(+), 29 deletions(-) create mode 100644 .npmrc diff --git a/.editorconfig b/.editorconfig index f166060..0ae9cb6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,6 @@ # Editor configuration, see https://editorconfig.org +# Source: @avalon-vanguard/config. EditorConfig cannot extend a file, so each repo commits a copy: +# cp node_modules/@avalon-vanguard/config/.editorconfig .editorconfig root = true [*] diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..6283358 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@avalon-vanguard:registry=https://git.avalonvanguard.com/api/packages/avalon-vanguard/npm/ diff --git a/.prettierrc b/.prettierrc index d6c16d7..c27a4e7 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,12 +1 @@ -{ - "printWidth": 100, - "singleQuote": true, - "overrides": [ - { - "files": "*.html", - "options": { - "parser": "angular" - } - } - ] -} +"@avalon-vanguard/config/prettier/angular" diff --git a/package-lock.json b/package-lock.json index 154767b..5081f97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@angular/build": "^22.0.6", "@angular/cli": "^22.0.6", "@angular/compiler-cli": "^22.0.0", + "@avalon-vanguard/config": "^1.0.0", "@playwright/test": "^1.61.1", "@tailwindcss/postcss": "^4.3.2", "@types/node": "^26.1.1", @@ -1149,6 +1150,38 @@ "dev": true, "license": "MIT" }, + "node_modules/@avalon-vanguard/config": { + "version": "1.0.0", + "resolved": "https://git.avalonvanguard.com/api/packages/avalon-vanguard/npm/%40avalon-vanguard%2Fconfig/-/1.0.0/config-1.0.0.tgz", + "integrity": "sha512-ySojd0OONRb9N9KT4CJeyLf5GUrfRP8jxfPTMRv3HUk7gld4VuzZd16lW774SfLkMBMOUYVVf9SKBMO+JATTTA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@eslint/js": "^10.0.0", + "angular-eslint": "^22.0.0", + "eslint": "^10.0.0", + "prettier": "^3.0.0", + "typescript": "^6.0.0", + "typescript-eslint": "^8.0.0" + }, + "peerDependenciesMeta": { + "@eslint/js": { + "optional": true + }, + "angular-eslint": { + "optional": true + }, + "eslint": { + "optional": true + }, + "prettier": { + "optional": true + }, + "typescript-eslint": { + "optional": true + } + } + }, "node_modules/@babel/helper-annotate-as-pure": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-8.0.0.tgz", diff --git a/package.json b/package.json index 6f6cc1d..35c5b02 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@angular/build": "^22.0.6", "@angular/cli": "^22.0.6", "@angular/compiler-cli": "^22.0.0", + "@avalon-vanguard/config": "^1.0.0", "@playwright/test": "^1.61.1", "@tailwindcss/postcss": "^4.3.2", "@types/node": "^26.1.1", diff --git a/tsconfig.json b/tsconfig.json index 7516612..80d7992 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,9 @@ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ +/* Compiler and Angular options come from @avalon-vanguard/config (tsconfig/angular.json). */ { + "extends": "@avalon-vanguard/config/tsconfig/angular.json", "compileOnSave": false, - "compilerOptions": { - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "skipLibCheck": true, - "isolatedModules": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "ES2022", - "module": "preserve" - }, - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true - }, "files": [], "references": [ {