diff --git a/packages/localization/lib/copy-and-strip-cldr/index.js b/packages/localization/lib/copy-and-strip-cldr/index.js deleted file mode 100644 index ee4ef9103564..000000000000 --- a/packages/localization/lib/copy-and-strip-cldr/index.js +++ /dev/null @@ -1,49 +0,0 @@ -import fs from "fs/promises"; -import path from "path"; - -const copyAndStripCLDR = async () => { - const inputDir = process.argv[2]; - const outputDir = process.argv[3]; - - await fs.mkdir(outputDir, { recursive: true }); - const files = await fs.readdir(inputDir); - const promises = files.map(async fileName => { - if (!fileName.endsWith("json")) { - return; // skip the license .txt file - } - - const inputFilePath = path.join(inputDir, fileName); - const fileContent = `${await fs.readFile(inputFilePath, "utf8")}`; - let fileContentObject = JSON.parse(fileContent); - fileContentObject = removeFields(fileContentObject); - const fileContentReduced = JSON.stringify(fileContentObject, null, 2); - - const outputFilePath = path.join(outputDir, fileName); - return fs.writeFile(outputFilePath, fileContentReduced); - }); - return Promise.all(promises); -} - -const removeFields = object => { - // remove all fields related to listPattern - for (const field in object) { - if (field.includes("listPattern")) { - delete object[field]; - } - } - - // remove all deny-listed fields - [ - "territories", - "scripts", - "timezoneNames", - ].forEach(field => { - delete object[field]; - }); - - return object; -} - -copyAndStripCLDR().then(() => { - console.log("CLDR files copied and reduced in size."); -}); diff --git a/packages/localization/package-scripts.cjs b/packages/localization/package-scripts.cjs index 5fb3281bdd61..1be843d2503e 100644 --- a/packages/localization/package-scripts.cjs +++ b/packages/localization/package-scripts.cjs @@ -18,7 +18,7 @@ const scripts = { typescript: "tsc --build", copy: { "used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`, - cldr: `node ./lib/copy-and-strip-cldr/index.js "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/" dist/generated/assets/cldr/`, + cldr: `copy-and-watch "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*" dist/generated/assets/cldr/`, overlay: `copy-and-watch "overlay/**/*.js" dist/`, }, };