commit 29231b0638cf6cdee8bd0022466ffa5f8f3decf2 Author: gcch Date: Wed Oct 1 16:24:22 2025 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c24728 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.cache +node_modules diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..cac079b --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +.cache +bun.lock +dist +node_modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..2da80f4 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# modele-projet-typescript + +Modèle pour un projet TypeScript. diff --git a/cspell.json b/cspell.json new file mode 100644 index 0000000..c5b0b0f --- /dev/null +++ b/cspell.json @@ -0,0 +1,4 @@ +{ + "dictionaries": ["fr-fr", "en-gb"], + "words": ["Navigateur", "tsdown", "Descriptionless"] +} diff --git a/dprint.json b/dprint.json new file mode 100644 index 0000000..cb429a3 --- /dev/null +++ b/dprint.json @@ -0,0 +1,3 @@ +{ + "extends": "node_modules/@gcch/configuration-dprint/dprint.json" +} diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..2fbf4a8 --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,4 @@ +import { configTypescriptNavigateur } from "@gcch/configuration-eslint"; +import { defineConfig } from "eslint/config"; + +export default defineConfig([...configTypescriptNavigateur]); diff --git a/justfile b/justfile new file mode 100644 index 0000000..509e4bf --- /dev/null +++ b/justfile @@ -0,0 +1,32 @@ +set shell := ["/usr/bin/fish", "-c"] + +# Formate le code. +formate: + bun prettier --cache --cache-location ".cache/prettiercache" --ignore-unknown --parallel-workers 8 --write . + dprint fmt + +# Met à jour les dépendances NPM. +maj-dependances: + bun update + +# Analyse le code TypeScript avec ESLint. +analyse-code: + bun eslint + +# Analyse le code mort et les dépendances inutilisées du projet. +analyse-code-mort: + -bun knip + -bun knip --production + +# Compile le projet. +compile: + bun tsdown --attw --publint + +# Nettoie le dosiser de compilation. +nettoie: + rm -rfv dist + +# Publie le paquet sur le registre local. +publie: + just compile + npm publish --registry http://localhost:4873 diff --git a/knip.config.ts b/knip.config.ts new file mode 100644 index 0000000..67f866c --- /dev/null +++ b/knip.config.ts @@ -0,0 +1,9 @@ +import type { KnipConfig } from "knip"; + +const config: Readonly = { + // Knip ne peut pas analyser le fichier de configuration dprint. + ignoreDependencies: ["@gcch/configuration-dprint"], + project: ["**/*.{js,ts}"], +}; + +export default config; diff --git a/package.json b/package.json new file mode 100644 index 0000000..df5a516 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "@gcch/modele-projet-typescript", + "version": "0.0.1", + "type": "module", + "description": "Modèle pour un projet TypeScript.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "module": "./dist/index.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "dependencies": {}, + "devDependencies": { + "@arethetypeswrong/core": "^0.18.2", + "@gcch/configuration-dprint": "^0.0.1", + "@gcch/configuration-eslint": "^0.0.4", + "@gcch/configuration-prettier": "^0.0.7", + "eslint": "^9.36.0", + "knip": "^5.64.1", + "prettier": "^4.0.0-alpha.12", + "prettier-plugin-curly": "^0.3.2", + "prettier-plugin-jsdoc": "^1.3.3", + "prettier-plugin-sh": "^0.18.0", + "publint": "^0.3.13", + "tsdown": "^0.15.6", + "typescript": "^6.0.0-dev.20251001" + }, + "trustedDependencies": [ + "oxc-resolver" + ] +} diff --git a/prettier.config.ts b/prettier.config.ts new file mode 100644 index 0000000..cc3fd77 --- /dev/null +++ b/prettier.config.ts @@ -0,0 +1,5 @@ +import { configClassique } from "@gcch/configuration-prettier"; + +export default { + ...configClassique, +}; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..2a5e4b8 --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +console.log("Hello via Bun!"); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..de0042c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,51 @@ +{ + "compilerOptions": { + "allowArbitraryExtensions": true, + "allowImportingTsExtensions": true, + "allowJs": true, + "allowSyntheticDefaultImports": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "alwaysStrict": true, + "checkJs": true, + "downlevelIteration": false, + "erasableSyntaxOnly": true, + "esModuleInterop": true, + "exactOptionalPropertyTypes": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"], + "module": "ESNext", + "moduleDetection": "force", + "moduleResolution": "Bundler", + "noEmit": true, + "noErrorTruncation": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noPropertyAccessFromIndexSignature": true, + "noStrictGenericChecks": false, + "noUncheckedIndexedAccess": true, + "noUncheckedSideEffectImports": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "skipLibCheck": false, + "strict": true, + "strictBindCallApply": true, + "strictBuiltinIteratorReturn": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "suppressExcessPropertyErrors": false, + "suppressImplicitAnyIndexErrors": false, + "target": "ESNext", + "types": ["node"], + "useDefineForClassFields": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true + }, + "exclude": ["dist"], + "include": ["**/*.js", "**/*.ts"] +} diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 0000000..26e5a33 --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "tsdown"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["./src/index.ts"], + minify: true, + platform: "node", + sourcemap: false, + target: "esnext", + treeshake: true, +});