From 3a2d8f6aca135abb0ad150a9f4de712091cf54b6 Mon Sep 17 00:00:00 2001 From: mariaozamiz Date: Wed, 29 May 2024 09:36:36 +0200 Subject: [PATCH 1/4] chore: revert to original name --- scripts/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.ts b/scripts/run.ts index 2b6f336b2..22b30dc12 100644 --- a/scripts/run.ts +++ b/scripts/run.ts @@ -8,7 +8,7 @@ const variants = [ { type: "app", name: "core-app", - title: "MetaData Synchronization", + title: "MetaData Sync App", file: "metadata-synchronization", }, { From ac34fc9818442cf86556cccb44380241a6c5a5b8 Mon Sep 17 00:00:00 2001 From: mariaozamiz Date: Wed, 29 May 2024 09:52:00 +0200 Subject: [PATCH 2/4] chore: add function to update name in manifest.json file --- scripts/run.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/run.ts b/scripts/run.ts index 22b30dc12..5e6aff7ef 100644 --- a/scripts/run.ts +++ b/scripts/run.ts @@ -139,6 +139,7 @@ function build(args: BuildArgs): void { run(`react-scripts build && cp -r i18n icon.png build`); run(`d2-manifest package.json build/manifest.webapp -t ${manifestType} -n '${variant.title}'`); updateManifestNamespace(`build/manifest.webapp`, variant.file); + updateManifestJsonFile(`build/manifest.json`, variant.title); run(`rm -f ${fileName}`); run(`cd build && zip -r ../${fileName} *`); console.info(`Written: ${fileName}`); @@ -153,6 +154,14 @@ function updateManifestNamespace(manifestPath: string, variantFile: string) { } } +function updateManifestJsonFile(manifestJsonPath: string, variantTitle: string) { + if (fs.existsSync(manifestJsonPath)) { + const manifestJson = JSON.parse(fs.readFileSync(manifestJsonPath, "utf8")); + Object.assign(manifestJson, { name: variantTitle, short_name: variantTitle }); + fs.writeFileSync(manifestJsonPath, JSON.stringify(manifestJson, null, 2)); + } +} + /* Start server */ type StartServerArgs = { variant: string; port: number; verbose: boolean }; From dc752c1800df039428dcf06c9b1415bb20ef1f78 Mon Sep 17 00:00:00 2001 From: mariaozamiz Date: Wed, 29 May 2024 10:09:22 +0200 Subject: [PATCH 3/4] chore: add conditional so we only change the first package --- scripts/run.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/run.ts b/scripts/run.ts index 5e6aff7ef..ac35af635 100644 --- a/scripts/run.ts +++ b/scripts/run.ts @@ -138,8 +138,10 @@ function build(args: BuildArgs): void { run(`react-scripts build && cp -r i18n icon.png build`); run(`d2-manifest package.json build/manifest.webapp -t ${manifestType} -n '${variant.title}'`); + if (variant.file === "metadata-synchronization") { + updateManifestJsonFile(`build/manifest.json`, variant.title); + } updateManifestNamespace(`build/manifest.webapp`, variant.file); - updateManifestJsonFile(`build/manifest.json`, variant.title); run(`rm -f ${fileName}`); run(`cd build && zip -r ../${fileName} *`); console.info(`Written: ${fileName}`); From 90afc68cc8d9a0acf76b9ada535ac13ec584b09a Mon Sep 17 00:00:00 2001 From: Miquel Adell Date: Wed, 29 May 2024 13:47:16 +0200 Subject: [PATCH 4/4] change name --- scripts/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.ts b/scripts/run.ts index ac35af635..32cad24e6 100644 --- a/scripts/run.ts +++ b/scripts/run.ts @@ -8,7 +8,7 @@ const variants = [ { type: "app", name: "core-app", - title: "MetaData Sync App", + title: "MetaData Synchronization", file: "metadata-synchronization", }, {