@socialgouv/fiches-vdd-types 2.788.0 → 2.790.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/.github/workflows/fetch-test.yml +1 -1
- package/.github/workflows/fetch.yml +1 -2
- package/CHANGELOG.md +21 -0
- package/fetch.js +21 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [2.790.0](https://github.com/SocialGouv/fiches-vdd/compare/v2.789.0...v2.790.0) (2023-09-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **alert:** enable lfs on the repository ([dc01028](https://github.com/SocialGouv/fiches-vdd/commit/dc01028df3a5a83ea34d702d30db9df731ca7f64))
|
|
7
|
+
* **data:** don't save file over 100MB due to git limitation ([64a3e43](https://github.com/SocialGouv/fiches-vdd/commit/64a3e439724fb7c6f4b7aa3bc51cc9a22e964740))
|
|
8
|
+
* **data:** don't save file over 100MB due to git limitation ([c01d034](https://github.com/SocialGouv/fiches-vdd/commit/c01d0340d069a2e91def0419832bc190d34b711e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **data:** 20230906_1249 update ([2824ecd](https://github.com/SocialGouv/fiches-vdd/commit/2824ecd783a9660732952a3cb3f1227fcc0e7dfa))
|
|
14
|
+
|
|
15
|
+
# [2.789.0](https://github.com/SocialGouv/fiches-vdd/compare/v2.788.0...v2.789.0) (2023-08-31)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **data:** 20230831_0413 update ([ef2b1f5](https://github.com/SocialGouv/fiches-vdd/commit/ef2b1f52ce67bfd2bb3251f79288a766bcb84618))
|
|
21
|
+
|
|
1
22
|
# [2.788.0](https://github.com/SocialGouv/fiches-vdd/compare/v2.787.0...v2.788.0) (2023-08-30)
|
|
2
23
|
|
|
3
24
|
|
package/fetch.js
CHANGED
|
@@ -40,16 +40,28 @@ const fetchAll = async () => {
|
|
|
40
40
|
fs.mkdirSync(`./data/${type}`, { recursive: true });
|
|
41
41
|
const fiches = await getDatasetJson(type, url);
|
|
42
42
|
const writeSpinner = ora(`Writing "${type}" fiches`).start();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const fichesIdArray = fiches
|
|
44
|
+
.map((fiche) => {
|
|
45
|
+
const fileName = `./data/${type}/${fiche.id}.json`;
|
|
46
|
+
const fileContent = JSON.stringify(fiche, null, 2);
|
|
47
|
+
if (fileContent.length > 100000000) {
|
|
48
|
+
writeSpinner.warn(
|
|
49
|
+
`Error saving "${fileName}": Size is too big ${
|
|
50
|
+
fileContent.length / 1000000
|
|
51
|
+
}MB (git limitation is 100MB). If you need this file, please consider using git-lfs or compression.`
|
|
52
|
+
);
|
|
53
|
+
return undefined;
|
|
54
|
+
} else {
|
|
55
|
+
try {
|
|
56
|
+
fs.writeFileSync(fileName, fileContent);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
writeSpinner.warn(`Error saving "${fileName}": ${err.message}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return fiche.id;
|
|
62
|
+
})
|
|
63
|
+
.filter((ficheId) => ficheId !== undefined);
|
|
51
64
|
const indexName = `./data/${type}/index.json`;
|
|
52
|
-
const fichesIdArray = fiches.map((fiche) => fiche.id);
|
|
53
65
|
try {
|
|
54
66
|
fs.writeFileSync(indexName, JSON.stringify(fichesIdArray, null, 2));
|
|
55
67
|
} catch (err) {
|
package/package.json
CHANGED