@likewatt/models 1.0.104 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -5
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,9 +1,122 @@
|
|
|
1
1
|
# @likewatt/models
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Package privé contenant les modèles TypeScript partagés pour les applications Likewatt.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @likewatt/models
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Ce package exporte les modèles de données TypeScript utilisés dans l'écosystème Likewatt, incluant :
|
|
14
|
+
|
|
15
|
+
- **Entités principales** : `Site`, `Scenario`, `User`, `License`, `CollectiveSite`, `Invitation`, `ScenarioDefaultValue`
|
|
16
|
+
- **Entités TypeORM** : `Analysis`, `Optimization`, `WebhookOutput`, historiques (Co2, Enedis, FCR, Okwind, Pvgis, Spot, Tempo)
|
|
17
|
+
- **Modèles internes** : Paramètres énergétiques (batteries, PV, éolien, hydrogène, stockage thermique, etc.)
|
|
18
|
+
- **Types frontend** : Types TypeScript pour l'interface utilisateur
|
|
19
|
+
- **Énumérations** : Types énumérés partagés
|
|
20
|
+
|
|
21
|
+
## Structure
|
|
22
|
+
|
|
23
|
+
- `src/core/` : Entités principales et modèles internes
|
|
24
|
+
- `src/frontend/` : Types TypeScript pour le frontend
|
|
25
|
+
- `dist/` : Build compilé (CommonJS)
|
|
26
|
+
|
|
27
|
+
## Technologies
|
|
28
|
+
|
|
29
|
+
- TypeScript 5.x
|
|
30
|
+
- TypeORM 0.3.x
|
|
31
|
+
- Mongoose 8.x
|
|
32
|
+
- NestJS decorators (Swagger, Mongoose)
|
|
33
|
+
- Class Validator
|
|
34
|
+
|
|
35
|
+
## Scripts disponibles
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run build # Compile le projet TypeScript
|
|
39
|
+
npm run format # Formate le code avec Prettier
|
|
40
|
+
npm run lint # Lint et fixe le code avec ESLint
|
|
41
|
+
npm run lint:quick # Lint sans auto-fix
|
|
42
|
+
npm run release # Crée une release automatique (conventional commits)
|
|
43
|
+
npm run release:minor # Crée une release minor
|
|
44
|
+
npm run release:major # Crée une release major
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Convention de commit
|
|
48
|
+
|
|
49
|
+
Le projet utilise **Husky** et **Commitlint** pour enforcer les conventions de commit.
|
|
50
|
+
|
|
51
|
+
### Format requis
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
<type>(<scope>): <subject>
|
|
55
|
+
|
|
56
|
+
<body>
|
|
57
|
+
|
|
58
|
+
<footer>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Types autorisés
|
|
62
|
+
|
|
63
|
+
- `feat`: Nouvelle fonctionnalité
|
|
64
|
+
- `fix`: Correction de bug
|
|
65
|
+
- `docs`: Documentation
|
|
66
|
+
- `style`: Formatage, point-virgules manquants, etc.
|
|
67
|
+
- `refactor`: Refactoring du code
|
|
68
|
+
- `perf`: Amélioration des performances
|
|
69
|
+
- `test`: Ajout de tests
|
|
70
|
+
- `build`: Changements du système de build
|
|
71
|
+
- `ci`: Changements CI/CD
|
|
72
|
+
- `chore`: Tâches de maintenance
|
|
73
|
+
- `revert`: Revert d'un commit précédent
|
|
74
|
+
|
|
75
|
+
### Exemples
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
feat(user): add authentication endpoint
|
|
79
|
+
fix(scenario): correct energy calculation
|
|
80
|
+
docs(readme): update installation instructions
|
|
81
|
+
refactor(battery): simplify params validation
|
|
82
|
+
ci(pipeline): add automatic versioning
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Impact sur le versioning
|
|
86
|
+
|
|
87
|
+
- `feat`: incrémente la version **minor** (1.0.0 → 1.1.0)
|
|
88
|
+
- `fix`: incrémente la version **patch** (1.0.0 → 1.0.1)
|
|
89
|
+
- `BREAKING CHANGE` dans le footer : incrémente la version **major** (1.0.0 → 2.0.0)
|
|
90
|
+
|
|
91
|
+
## Release et versioning
|
|
92
|
+
|
|
93
|
+
Le package utilise `standard-version` pour le versioning sémantique basé sur les commits conventionnels.
|
|
94
|
+
|
|
95
|
+
### Release automatique
|
|
96
|
+
|
|
97
|
+
Chaque push sur la branche `main` déclenche automatiquement :
|
|
98
|
+
1. Installation des dépendances
|
|
99
|
+
2. Build du projet
|
|
100
|
+
3. Analyse des commits pour déterminer le type de version (patch/minor/major)
|
|
101
|
+
4. Génération du CHANGELOG
|
|
102
|
+
5. Publication sur le registry NPM privé
|
|
103
|
+
|
|
104
|
+
### Release manuelle
|
|
105
|
+
|
|
106
|
+
Via Bitbucket Pipelines, possibilité de forcer un type de release :
|
|
107
|
+
- `patch` : Correctifs (1.0.0 → 1.0.1)
|
|
108
|
+
- `minor` : Nouvelles fonctionnalités (1.0.0 → 1.1.0)
|
|
109
|
+
- `major` : Breaking changes (1.0.0 → 2.0.0)
|
|
110
|
+
- `prepatch`, `preminor`, `premajor`, `prerelease` : Versions de pré-release
|
|
111
|
+
|
|
112
|
+
## Configuration
|
|
113
|
+
|
|
114
|
+
- **Compilation** : ES2019, CommonJS, avec decorators experimentaux
|
|
115
|
+
- **Output** : `dist/index.js` (main), `dist/index.d.ts` (types)
|
|
116
|
+
- **Registry** : NPM privé Likewatt
|
|
117
|
+
|
|
118
|
+
## Confidentialité
|
|
119
|
+
|
|
120
|
+
Ce package est privé et ne doit pas être partagé en dehors de Likewatt.
|
|
5
121
|
|
|
6
|
-
# Release
|
|
7
122
|
|
|
8
|
-
This package uses CI/CD to deploy automatic new versions when a commit is pushed to the `main` branch.
|
|
9
|
-
The changelogs is also automatically generated.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likewatt/models",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
|
-
"prepare": "
|
|
8
|
+
"prepare": "husky",
|
|
9
9
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
10
10
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
11
11
|
"lint:quick": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
@@ -13,11 +13,19 @@
|
|
|
13
13
|
"release:minor": "standard-version --release-as minor",
|
|
14
14
|
"release:major": "standard-version --release-as major"
|
|
15
15
|
},
|
|
16
|
+
"standard-version": {
|
|
17
|
+
"skip": {
|
|
18
|
+
"changelog": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
16
21
|
"files": [
|
|
17
22
|
"dist"
|
|
18
23
|
],
|
|
19
24
|
"devDependencies": {
|
|
25
|
+
"@commitlint/cli": "^20.1.0",
|
|
26
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
20
27
|
"@types/node": "^22.15.17",
|
|
28
|
+
"husky": "^9.1.7",
|
|
21
29
|
"standard-version": "^9.5.0",
|
|
22
30
|
"typescript": "^5.0.0"
|
|
23
31
|
},
|