@socialgouv/fiches-vdd-types 2.789.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.
@@ -10,7 +10,7 @@ jobs:
10
10
  fetch:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
14
14
 
15
15
  - name: Set up Node.js
16
16
  uses: actions/setup-node@v3
@@ -9,8 +9,7 @@ jobs:
9
9
  fetch:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v2
13
-
12
+ - uses: actions/checkout@v4
14
13
  - name: Set up Node.js
15
14
  uses: actions/setup-node@v3
16
15
  with:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
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
+
1
15
  # [2.789.0](https://github.com/SocialGouv/fiches-vdd/compare/v2.788.0...v2.789.0) (2023-08-31)
2
16
 
3
17
 
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
- fiches.forEach((fiche) => {
44
- const fileName = `./data/${type}/${fiche.id}.json`;
45
- try {
46
- fs.writeFileSync(fileName, JSON.stringify(fiche, null, 2));
47
- } catch (err) {
48
- writeSpinner.warn(`Error saving "${fileName}": ${err.message}`);
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@socialgouv/fiches-vdd-types",
3
3
  "description": "Fiches vos droits et démarches au format JSON",
4
- "version": "2.789.0",
4
+ "version": "2.790.0",
5
5
  "repository": "https://github.com/SocialGouv/fiches-vdd.git",
6
6
  "main": "index.js",
7
7
  "license": "MIT",