From f5cc43229939aa31d32e44ddb4f07cbee37c7d1d Mon Sep 17 00:00:00 2001 From: Nayden Naydenov Date: Thu, 13 Mar 2025 15:18:06 +0200 Subject: [PATCH] chore: usage of build scripts --- packages/base/package-scripts.cjs | 4 +- packages/theming/css-vars-usage.json | 83 ++++++++++++++++++++-------- packages/theming/package-scripts.cjs | 13 +++-- packages/theming/package.json | 3 +- 4 files changed, 71 insertions(+), 32 deletions(-) diff --git a/packages/base/package-scripts.cjs b/packages/base/package-scripts.cjs index 481d1f11a8e8..85fe857d4084 100644 --- a/packages/base/package-scripts.cjs +++ b/packages/base/package-scripts.cjs @@ -49,8 +49,8 @@ const scripts = { }, generateAPI: { default: "nps generateAPI.generateCEM generateAPI.validateCEM", - generateCEM: `cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs" --dev`, - validateCEM: `node "${LIB}/cem/validate.js" --dev`, + generateCEM: `cross-env UI5_CEM_MODE='dev' cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs"`, + validateCEM: `cross-env UI5_CEM_MODE='dev' node "${LIB}/cem/validate.js"`, }, watch: { default: 'concurrently "nps watch.src" "nps watch.styles"', diff --git a/packages/theming/css-vars-usage.json b/packages/theming/css-vars-usage.json index f96f985cf7f7..b543270c5716 100644 --- a/packages/theming/css-vars-usage.json +++ b/packages/theming/css-vars-usage.json @@ -12,34 +12,46 @@ "--sapActiveColor", "--sapAvatar_1_Background", "--sapAvatar_1_BorderColor", + "--sapAvatar_1_Hover_Background", "--sapAvatar_1_TextColor", "--sapAvatar_2_Background", "--sapAvatar_2_BorderColor", + "--sapAvatar_2_Hover_Background", "--sapAvatar_2_TextColor", "--sapAvatar_3_Background", "--sapAvatar_3_BorderColor", + "--sapAvatar_3_Hover_Background", "--sapAvatar_3_TextColor", "--sapAvatar_4_Background", "--sapAvatar_4_BorderColor", + "--sapAvatar_4_Hover_Background", "--sapAvatar_4_TextColor", "--sapAvatar_5_Background", "--sapAvatar_5_BorderColor", + "--sapAvatar_5_Hover_Background", "--sapAvatar_5_TextColor", "--sapAvatar_6_Background", "--sapAvatar_6_BorderColor", + "--sapAvatar_6_Hover_Background", "--sapAvatar_6_TextColor", "--sapAvatar_7_Background", "--sapAvatar_7_BorderColor", + "--sapAvatar_7_Hover_Background", "--sapAvatar_7_TextColor", "--sapAvatar_8_Background", "--sapAvatar_8_BorderColor", + "--sapAvatar_8_Hover_Background", "--sapAvatar_8_TextColor", "--sapAvatar_9_Background", "--sapAvatar_9_BorderColor", + "--sapAvatar_9_Hover_Background", "--sapAvatar_9_TextColor", "--sapAvatar_10_Background", "--sapAvatar_10_BorderColor", + "--sapAvatar_10_Hover_Background", "--sapAvatar_10_TextColor", + "--sapAvatar_Lite_Background", + "--sapAvatar_Lite_BorderColor", "--sapBackgroundColor", "--sapBaseColor", "--sapBlockLayer_Background", @@ -91,7 +103,6 @@ "--sapButton_Emphasized_Active_TextColor", "--sapButton_Emphasized_Background", "--sapButton_Emphasized_BorderColor", - "--sapButton_Emphasized_FontWeight", "--sapButton_Emphasized_Hover_Background", "--sapButton_Emphasized_Hover_BorderColor", "--sapButton_Emphasized_Hover_TextColor", @@ -163,6 +174,7 @@ "--sapButton_Reject_Selected_Hover_BorderColor", "--sapButton_Reject_Selected_TextColor", "--sapButton_Reject_TextColor", + "--sapButton_Segment_BorderCornerRadius", "--sapButton_Selected_Background", "--sapButton_Selected_BorderColor", "--sapButton_Selected_Hover_Background", @@ -197,6 +209,7 @@ "--sapButton_Track_Selected_Hover_BorderColor", "--sapButton_Track_Selected_TextColor", "--sapContent_BadgeBackground", + "--sapContent_BadgeBorderColor", "--sapContent_BadgeTextColor", "--sapContent_BusyColor", "--sapContent_ContentColor", @@ -214,7 +227,6 @@ "--sapContent_FocusWidth", "--sapContent_ForegroundBorderColor", "--sapContent_ForegroundColor", - "--sapContent_ForegroundTextColor", "--sapContent_HeaderShadow", "--sapContent_HelpColor", "--sapContent_IconColor", @@ -232,6 +244,7 @@ "--sapContent_Informative_Shadow", "--sapContent_Interaction_Shadow", "--sapContent_LabelColor", + "--sapContent_Lite_Shadow", "--sapContent_MeasureIndicatorColor", "--sapContent_Negative_Shadow", "--sapContent_NonInteractiveIconColor", @@ -286,11 +299,17 @@ "--sapField_InvalidBorderWidth", "--sapField_InvalidColor", "--sapField_InvalidShadow", + "--sapField_Picker_BorderWidth", "--sapField_PlaceholderTextColor", "--sapField_ReadOnly_Background", "--sapField_ReadOnly_BackgroundStyle", "--sapField_ReadOnly_BorderColor", "--sapField_RequiredColor", + "--sapField_Selector_Hover_Background", + "--sapField_Selector_Hover_InformationBackground", + "--sapField_Selector_Hover_InvalidBackground", + "--sapField_Selector_Hover_SuccessBackground", + "--sapField_Selector_Hover_WarningBackground", "--sapField_Shadow", "--sapField_SuccessBackground", "--sapField_SuccessBackgroundStyle", @@ -315,16 +334,17 @@ "--sapFontLargeSize", "--sapFontMediumSize", "--sapFontSemiboldDuplexFamily", + "--sapFontSemiboldFamily", "--sapFontSize", "--sapFontSmallSize", + "--sapGroup_BorderCornerRadius", "--sapGroup_ContentBackground", "--sapGroup_ContentBorderColor", "--sapGroup_Title_FontSize", "--sapGroup_TitleBackground", "--sapGroup_TitleBorderColor", + "--sapGroup_TitleBorderWidth", "--sapGroup_TitleTextColor", - "--sapHC_ReducedBackground", - "--sapHC_ReducedForeground", "--sapHighlightColor", "--sapIllus_AccentColor", "--sapIllus_BackgroundColor", @@ -454,16 +474,6 @@ "--sapLegend_CurrentDateTime", "--sapLegend_NonWorkingBackground", "--sapLegend_WorkingBackground", - "--sapLegendBackgroundColor1", - "--sapLegendBackgroundColor2", - "--sapLegendBackgroundColor3", - "--sapLegendBackgroundColor5", - "--sapLegendBackgroundColor6", - "--sapLegendBackgroundColor7", - "--sapLegendBackgroundColor9", - "--sapLegendBackgroundColor10", - "--sapLegendBackgroundColor18", - "--sapLegendBackgroundColor20", "--sapLegendColor1", "--sapLegendColor2", "--sapLegendColor3", @@ -508,10 +518,10 @@ "--sapList_Hover_SelectionBackground", "--sapList_SelectionBackgroundColor", "--sapList_SelectionBorderColor", - "--sapList_TableGroupHeaderBackground", - "--sapList_TableGroupHeaderBorderColor", "--sapList_TableGroupHeaderTextColor", "--sapList_TextColor", + "--sapMessage_BorderWidth", + "--sapMessage_Button_Hover_Background", "--sapMessage_ErrorBorderColor", "--sapMessage_InformationBorderColor", "--sapMessage_SuccessBorderColor", @@ -550,18 +560,13 @@ "--sapProgress_PositiveBackground", "--sapProgress_TextColor", "--sapProgress_Value_Background", - "--sapProgress_Value_BorderColor", "--sapProgress_Value_CriticalBackground", - "--sapProgress_Value_CriticalBorderColor", "--sapProgress_Value_CriticalTextColor", "--sapProgress_Value_InformationBackground", - "--sapProgress_Value_InformationBorderColor", "--sapProgress_Value_InformationTextColor", "--sapProgress_Value_NegativeBackground", - "--sapProgress_Value_NegativeBorderColor", "--sapProgress_Value_NegativeTextColor", "--sapProgress_Value_PositiveBackground", - "--sapProgress_Value_PositiveBorderColor", "--sapProgress_Value_PositiveTextColor", "--sapScrollBar_Dimension", "--sapScrollBar_FaceColor", @@ -570,11 +575,14 @@ "--sapSelectedColor", "--sapShell_Active_Background", "--sapShell_Active_TextColor", + "--sapShell_Assistant_ForegroundColor", "--sapShell_Background", "--sapShell_Hover_Background", "--sapShell_InteractiveBackground", "--sapShell_InteractiveBorderColor", "--sapShell_InteractiveTextColor", + "--sapShell_Shadow", + "--sapShell_SubBrand_TextColor", "--sapShell_TextColor", "--sapShellColor", "--sapSlider_Active_RangeHandleBackground", @@ -588,6 +596,38 @@ "--sapSlider_Selected_BorderColor", "--sapSuccessBackground", "--sapSuccessBorderColor", + "--sapTab_Background", + "--sapTab_Critical_ForegroundColor", + "--sapTab_Critical_IconColor", + "--sapTab_Critical_Selected_Background", + "--sapTab_Critical_Selected_IconColor", + "--sapTab_Critical_Selected_TextColor", + "--sapTab_Critical_TextColor", + "--sapTab_ForegroundColor", + "--sapTab_IconColor", + "--sapTab_Negative_ForegroundColor", + "--sapTab_Negative_IconColor", + "--sapTab_Negative_Selected_Background", + "--sapTab_Negative_Selected_IconColor", + "--sapTab_Negative_Selected_TextColor", + "--sapTab_Negative_TextColor", + "--sapTab_Neutral_ForegroundColor", + "--sapTab_Neutral_IconColor", + "--sapTab_Neutral_Selected_Background", + "--sapTab_Neutral_Selected_IconColor", + "--sapTab_Neutral_Selected_TextColor", + "--sapTab_Neutral_TextColor", + "--sapTab_Positive_ForegroundColor", + "--sapTab_Positive_IconColor", + "--sapTab_Positive_Selected_Background", + "--sapTab_Positive_Selected_IconColor", + "--sapTab_Positive_Selected_TextColor", + "--sapTab_Positive_TextColor", + "--sapTab_Selected_Background", + "--sapTab_Selected_IconColor", + "--sapTab_Selected_Indicator_Dimension", + "--sapTab_Selected_TextColor", + "--sapTab_TextColor", "--sapTextColor", "--sapTile_Active_Background", "--sapTile_Background", @@ -599,7 +639,6 @@ "--sapTile_SeparatorColor", "--sapTile_TextColor", "--sapTile_TitleTextColor", - "--sapToolbar_Background", "--sapToolbar_SeparatorColor", "--sapWarningBackground", "--sapWarningBorderColor" diff --git a/packages/theming/package-scripts.cjs b/packages/theming/package-scripts.cjs index b83810bb2e8b..ec1fe4636b89 100644 --- a/packages/theming/package-scripts.cjs +++ b/packages/theming/package-scripts.cjs @@ -1,11 +1,12 @@ -const resolve = require("resolve"); -const assets = require('@ui5/webcomponents-tools/assets-meta.js'); const path = require('path'); -const jsonImportsScript = resolve.sync("@ui5/webcomponents-tools/lib/generate-json-imports/themes.js"); -const generateReportScript = resolve.sync("@ui5/webcomponents-theming/lib/generate-css-vars-usage-report/index.js"); -const LIB = path.join(__dirname, `../tools/lib/`); +const CURRENT_LIB = path.join(__dirname, `./lib/`); +const TOOLS_LIB = path.join(__dirname, `../tools/lib/`); + +const jsonImportsScript = path.join(TOOLS_LIB, "./generate-json-imports/themes.js"); +const generateReportScript = path.join(CURRENT_LIB, "./generate-css-vars-usage-report/index.js"); + module.exports = { scripts: { @@ -15,7 +16,7 @@ module.exports = { default: `cross-env UI5_TS=true nps clean build.src build.postcss build.jsonImports build.typescript generateReport`, src: `copy-and-watch "src/**/*.{json}" dist/`, typescript: "tsc", - postcss: `node "${LIB}/css-processors/css-processor-themes.mjs"`, + postcss: `node "${TOOLS_LIB}/css-processors/css-processor-themes.mjs"`, jsonImports: `node "${jsonImportsScript}" dist/generated/assets/themes src/generated/json-imports`, }, generateReport: `node "${generateReportScript}"`, diff --git a/packages/theming/package.json b/packages/theming/package.json index c37809689b83..d4599851f3c4 100644 --- a/packages/theming/package.json +++ b/packages/theming/package.json @@ -39,8 +39,7 @@ "json-beautify": "^1.1.1", "nps": "^5.10.0", "postcss": "^8.4.5", - "postcss-import": "^14.0.2", - "resolve": "^1.20.0" + "postcss-import": "^14.0.2" }, "resolutions": {} }