From 3e372ef8608c1e24c46a55c9bfe3a91b6f657130 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Thu, 15 May 2025 14:35:19 +0200 Subject: [PATCH 1/2] fix(Assets): exclude `-fetch` assets --- packages/main/scripts/generateI18n.mjs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/main/scripts/generateI18n.mjs b/packages/main/scripts/generateI18n.mjs index f276ef0bef5..d6fda03931c 100644 --- a/packages/main/scripts/generateI18n.mjs +++ b/packages/main/scripts/generateI18n.mjs @@ -54,18 +54,14 @@ spawnSync('npx', ['prettier', '--write', path.resolve(SRC_I18N_PROPERTIES, 'i18n stdio: [0, 1, 2], }); -// generate Assets.js and Assets-static.js +// generate Assets.js const jsonImports = await readdir(TARGET_I18N_JSON_IMPORTS); const assets = [`import '@ui5/webcomponents/dist/Assets.js';`, `import '@ui5/webcomponents-fiori/dist/Assets.js';`]; -const assetsStatic = [ - `import '@ui5/webcomponents/dist/Assets-static.js';`, - `import '@ui5/webcomponents-fiori/dist/Assets-static.js';`, -]; for (const file of jsonImports) { - if (file.includes('-static')) { - assetsStatic.push(`import './json-imports/${file}';`); + if (file.includes('-fetch')) { + //todo: add to Assets-fetch.js } else { assets.push(`import './json-imports/${file}';`); } @@ -75,7 +71,3 @@ await writeFile( path.resolve(DIST_DIR, 'Assets.js'), await prettier.format(assets.join('\n'), { ...prettierConfig, parser: 'babel' }), ); -await writeFile( - path.resolve(DIST_DIR, 'Assets-static.js'), - await prettier.format(assetsStatic.join('\n'), { ...prettierConfig, parser: 'babel' }), -); From 8fdf66703630e2d7357b79263ad82b80a5341a08 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Thu, 15 May 2025 14:48:16 +0200 Subject: [PATCH 2/2] feat(Assets): add `Assets-fetch.js` --- packages/main/scripts/generateI18n.mjs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/main/scripts/generateI18n.mjs b/packages/main/scripts/generateI18n.mjs index d6fda03931c..574b4491067 100644 --- a/packages/main/scripts/generateI18n.mjs +++ b/packages/main/scripts/generateI18n.mjs @@ -54,14 +54,19 @@ spawnSync('npx', ['prettier', '--write', path.resolve(SRC_I18N_PROPERTIES, 'i18n stdio: [0, 1, 2], }); -// generate Assets.js +// generate Assets.js and Assets-fetch.js const jsonImports = await readdir(TARGET_I18N_JSON_IMPORTS); const assets = [`import '@ui5/webcomponents/dist/Assets.js';`, `import '@ui5/webcomponents-fiori/dist/Assets.js';`]; +const assetsFetch = [ + `import '@ui5/webcomponents/dist/Assets-fetch.js';`, + //todo: currently the fiori package doesn't include `Assets-fetch` - clarify if this is intended + // `import '@ui5/webcomponents-fiori/dist/Assets-fetch.js';`, +]; for (const file of jsonImports) { if (file.includes('-fetch')) { - //todo: add to Assets-fetch.js + assetsFetch.push(`import './json-imports/${file}';`); } else { assets.push(`import './json-imports/${file}';`); } @@ -71,3 +76,8 @@ await writeFile( path.resolve(DIST_DIR, 'Assets.js'), await prettier.format(assets.join('\n'), { ...prettierConfig, parser: 'babel' }), ); + +await writeFile( + path.resolve(DIST_DIR, 'Assets-fetch.js'), + await prettier.format(assetsFetch.join('\n'), { ...prettierConfig, parser: 'babel' }), +);