@ucm-kit/adapter-typescript 0.1.28 → 0.1.30
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 +1 -1
- package/package.json +2 -2
- package/src/generation.mjs +10 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ two capabilities without making
|
|
|
6
6
|
TypeScript compiler, a 23 MB dependency no other consumer should pay for.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npm install --save-dev @ucm-kit/adapter-typescript@0.1.
|
|
9
|
+
npm install --save-dev @ucm-kit/adapter-typescript@0.1.30 @ucm-kit/cli@0.1.37
|
|
10
10
|
npx ucm-typescript
|
|
11
11
|
npx --no-install ucm check
|
|
12
12
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucm-kit/adapter-typescript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "Adaptateur TypeScript UCM : parité statique des composants et génération des types dérivés des contrats.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test": "node scripts/run-tests.cjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ucm-kit/core": "0.1.
|
|
38
|
+
"@ucm-kit/core": "0.1.33",
|
|
39
39
|
"typescript": ">=5.5.0 <6"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/generation.mjs
CHANGED
|
@@ -72,7 +72,16 @@ export function genererTypes(racine = process.cwd(), { dossierSortie = "src/gene
|
|
|
72
72
|
const generes = [];
|
|
73
73
|
const omis = [];
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
let contrats;
|
|
76
|
+
try {
|
|
77
|
+
contrats = trouverContrats(join(racine, configuration.components));
|
|
78
|
+
} catch (erreurDeLecture) {
|
|
79
|
+
// Un repository neuf n'a pas de dossier de contrats avant son premier export.
|
|
80
|
+
if (erreurDeLecture?.code !== "ENOENT") throw erreurDeLecture;
|
|
81
|
+
contrats = [];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
for (const chemin of contrats) {
|
|
76
85
|
let contrat;
|
|
77
86
|
try {
|
|
78
87
|
contrat = JSON.parse(readFileSync(chemin, "utf8").replace(/^/, ""));
|