Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit fcc8549

Browse files
committed
made it possible to skip configurations for prod, always generate readable copy to have better diffs, added thumbnail.jpg for live element demos
1 parent 90d0e33 commit fcc8549

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

communicators/Live element demos/info.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"skipProd": true,
23
"name": "Live elements demo",
34
"author": "Benjamin Klaus",
45
"website": "https://github.com/klues",
24.6 KB
Loading

live_metadata_beta.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

live_readable/live_metadata_beta.json.readable.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
"url": "communicators/Communication in hospital - Dachverband AT/Communication_hospital_Dachverband_AT.grd.json"
218218
},
219219
{
220+
"skipProd": true,
220221
"name": {
221222
"en": "CommuniKate 20"
222223
},
@@ -581,6 +582,7 @@
581582
"url": "communicators/Grammar demos/grammar-demos.grd.json"
582583
},
583584
{
585+
"skipProd": true,
584586
"name": "Live elements demo",
585587
"author": "Benjamin Klaus",
586588
"website": "https://github.com/klues",
@@ -606,6 +608,7 @@
606608
"url": "communicators/Live element demos/live-element-demos.grd.json"
607609
},
608610
{
611+
"skipProd": true,
609612
"name": {
610613
"en": "Quick Core 112"
611614
},
@@ -636,6 +639,7 @@
636639
]
637640
},
638641
{
642+
"skipProd": true,
639643
"name": {
640644
"en": "Quick Core 24"
641645
},
@@ -666,6 +670,7 @@
666670
]
667671
},
668672
{
673+
"skipProd": true,
669674
"name": {
670675
"en": "Quick Core 40"
671676
},
@@ -696,6 +701,7 @@
696701
]
697702
},
698703
{
704+
"skipProd": true,
699705
"name": {
700706
"en": "Quick Core 60"
701707
},
@@ -726,6 +732,7 @@
726732
]
727733
},
728734
{
735+
"skipProd": true,
729736
"name": {
730737
"en": "Quick Core 84"
731738
},
@@ -782,6 +789,7 @@
782789
"url": "communicators/Quick_Say20/Quick_Say_20_EN.grd.json"
783790
},
784791
{
792+
"skipProd": true,
785793
"name": {
786794
"en": "Sequoia 15"
787795
},
@@ -812,6 +820,7 @@
812820
]
813821
},
814822
{
823+
"skipProd": true,
815824
"name": {
816825
"en": "Vocal Flair 112"
817826
},
@@ -842,6 +851,7 @@
842851
]
843852
},
844853
{
854+
"skipProd": true,
845855
"name": {
846856
"en": "Vocal Flair 24"
847857
},
@@ -872,6 +882,7 @@
872882
]
873883
},
874884
{
885+
"skipProd": true,
875886
"name": {
876887
"en": "Vocal Flair 40"
877888
},
@@ -902,6 +913,7 @@
902913
]
903914
},
904915
{
916+
"skipProd": true,
905917
"name": {
906918
"en": "Vocal Flair 60"
907919
},
@@ -932,6 +944,7 @@
932944
]
933945
},
934946
{
947+
"skipProd": true,
935948
"name": {
936949
"en": "Vocal Flair 84"
937950
},
@@ -962,6 +975,7 @@
962975
]
963976
},
964977
{
978+
"skipProd": true,
965979
"name": {
966980
"en": "Vocal Flair 84 - With Keyboard"
967981
},

scripts/generateMetadata.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ const BASE_FOLDER_BOARDS = "boards"
66
const startPathCommunicators = path.join(__dirname, "..", BASE_FOLDER_COMM);
77
const startPathBoards = path.join(__dirname, "..", BASE_FOLDER_BOARDS);
88
const INFO_FILENAME = "info.json";
9-
const OUTPUT_FILENAME = process.argv[2] && process.argv[2] === "beta" ? "live_metadata_beta.json" : "live_metadata.json";
9+
const IS_BETA = process.argv[2] && process.argv[2] === "beta";
10+
const IS_PROD = !IS_BETA;
11+
const OUTPUT_FILENAME = IS_BETA ? "live_metadata_beta.json" : "live_metadata.json";
1012
const THUMBNAIL_FILENAME = "thumbnail";
13+
const READABLE_FOLDER = "live_readable";
14+
const READABLE_SUFFIX = ".readable.json";
1115

1216
let rootFoldersCommunicators = fs.readdirSync(startPathCommunicators, {withFileTypes: true}).filter(e => e.isDirectory());
1317
let rootFoldersBoards = fs.readdirSync(startPathBoards, {withFileTypes: true}).filter(e => e.isDirectory());
@@ -30,6 +34,7 @@ async function main() {
3034
}
3135
metadataObjects = metadataObjects.filter(o => !!o);
3236
fs.writeFileSync(path.join(__dirname, "..", OUTPUT_FILENAME), JSON.stringify(metadataObjects));
37+
fs.writeFileSync(path.join(__dirname, "..", READABLE_FOLDER, OUTPUT_FILENAME + READABLE_SUFFIX), JSON.stringify(metadataObjects, null, 2));
3338
console.log(`Successfully written ${metadataObjects.length} elements to ${OUTPUT_FILENAME}!`)
3439
}
3540

@@ -61,6 +66,9 @@ async function folderToMetadata(folder, options = {}) {
6166
let infoContentString = fs.readFileSync(path.join(infoFile.path, infoFile.name), 'utf-8');
6267
infoContent = JSON.parse(infoContentString);
6368
}
69+
if (infoContent.skip || (infoContent.skipProd && IS_PROD)) {
70+
return null;
71+
}
6472
Object.assign(infoContent, options.defaultProps);
6573
if (grdFiles.length > 1) {
6674
console.warn(`more than 1 .grd / .obz file in "${folder.name}"!`);

scripts/generatePredefinedActions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const BASE_FOLDER = "predefined_mappings"
55
const baseFolderPath = path.join(__dirname, "..", BASE_FOLDER);
66
const i18nPath = path.join(baseFolderPath, "i18n");
77
const I18N_FILENAME = "i18n.en.json";
8+
const READABLE_FOLDER = "live_readable";
9+
const READABLE_SUFFIX = ".readable.json";
810

911
let i18nContent = fs.readFileSync(path.join(i18nPath, I18N_FILENAME), 'utf-8');
1012
if (i18nContent) {
@@ -86,6 +88,7 @@ async function processData(startPath, outputFilename) {
8688
}
8789

8890
fs.writeFileSync(path.join(__dirname, "..", outputFilename), JSON.stringify(jsonObjects));
91+
fs.writeFileSync(path.join(__dirname, "..", READABLE_FOLDER, outputFilename + READABLE_SUFFIX), JSON.stringify(jsonObjects, null, 2));
8992
console.log(`Successfully written ${jsonObjects.length} elements to ${outputFilename}!`)
9093
return i18nStrings;
9194
}

0 commit comments

Comments
 (0)