This commit is contained in:
gcch 2025-10-01 16:24:22 +02:00
commit 29231b0638
13 changed files with 165 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.cache
node_modules

4
.prettierignore Normal file
View file

@ -0,0 +1,4 @@
.cache
bun.lock
dist
node_modules

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# modele-projet-typescript
Modèle pour un projet TypeScript.

4
cspell.json Normal file
View file

@ -0,0 +1,4 @@
{
"dictionaries": ["fr-fr", "en-gb"],
"words": ["Navigateur", "tsdown", "Descriptionless"]
}

3
dprint.json Normal file
View file

@ -0,0 +1,3 @@
{
"extends": "node_modules/@gcch/configuration-dprint/dprint.json"
}

4
eslint.config.ts Normal file
View file

@ -0,0 +1,4 @@
import { configTypescriptNavigateur } from "@gcch/configuration-eslint";
import { defineConfig } from "eslint/config";
export default defineConfig([...configTypescriptNavigateur]);

32
justfile Normal file
View file

@ -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

9
knip.config.ts Normal file
View file

@ -0,0 +1,9 @@
import type { KnipConfig } from "knip";
const config: Readonly<KnipConfig> = {
// Knip ne peut pas analyser le fichier de configuration dprint.
ignoreDependencies: ["@gcch/configuration-dprint"],
project: ["**/*.{js,ts}"],
};
export default config;

35
package.json Normal file
View file

@ -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"
]
}

5
prettier.config.ts Normal file
View file

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

1
src/index.ts Normal file
View file

@ -0,0 +1 @@
console.log("Hello via Bun!");

51
tsconfig.json Normal file
View file

@ -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"]
}

12
tsdown.config.ts Normal file
View file

@ -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,
});