From cdabb9585da48e7f7a7103047335087e5d72a381 Mon Sep 17 00:00:00 2001 From: Emre Cevik Date: Mon, 16 Sep 2024 11:55:59 +0200 Subject: [PATCH 001/122] Change themes 03 (#2331) * fix: update themes * fix: update theme names and adjust manual test * changeset * feedback * feedback documentation --------- Co-authored-by: Davis Voicescuks --- .changeset/fast-nails-live.md | 5 + .../src/components/ThemeSelectorCallout.scss | 12 +- .../src/components/ThemeSelectorCallout.tsx | 29 +- .../control-property-editor/src/index.css | 955 ++++++++++-------- .../control-property-editor/src/index.tsx | 5 - .../control-property-editor/src/use-theme.ts | 19 + .../test/unit/toolbar/ThemeSelector.test.tsx | 14 +- 7 files changed, 552 insertions(+), 487 deletions(-) create mode 100644 .changeset/fast-nails-live.md create mode 100644 packages/control-property-editor/src/use-theme.ts diff --git a/.changeset/fast-nails-live.md b/.changeset/fast-nails-live.md new file mode 100644 index 0000000000..956aefcf11 --- /dev/null +++ b/.changeset/fast-nails-live.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/control-property-editor': patch +--- + +updated color variables for themes diff --git a/packages/control-property-editor/src/components/ThemeSelectorCallout.scss b/packages/control-property-editor/src/components/ThemeSelectorCallout.scss index 15cfa173ff..2de4dd26c2 100644 --- a/packages/control-property-editor/src/components/ThemeSelectorCallout.scss +++ b/packages/control-property-editor/src/components/ThemeSelectorCallout.scss @@ -1,18 +1,18 @@ -#theme-light { +#theme-light-modern { border-radius: 50%; width: 14px; height: 14px; background: #ffffff; } -#theme-dark { +#theme-dark-modern { border-radius: 50%; width: 14px; height: 14px; background-color: #3c3c3c; } -#theme-high-contrast { +#theme-high-contrast-black { border-radius: 50%; width: 14px; height: 14px; @@ -46,16 +46,16 @@ background-color: var(--vscode-progressBar-background); } -div#theme-light { +div#theme-light-modern { margin-left: 3px; margin-bottom: 3px; margin-top: 3px; } -div#theme-dark { +div#theme-dark-modern { margin-left: 3px; margin-top: 3px; } -div#theme-high-contrast { +div#theme-high-contrast-black { margin-left: 3px; margin-top: 3px; } diff --git a/packages/control-property-editor/src/components/ThemeSelectorCallout.tsx b/packages/control-property-editor/src/components/ThemeSelectorCallout.tsx index 64cad4e78f..940418efde 100644 --- a/packages/control-property-editor/src/components/ThemeSelectorCallout.tsx +++ b/packages/control-property-editor/src/components/ThemeSelectorCallout.tsx @@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next'; import './ThemeSelectorCallout.scss'; import { IconName } from '../icons'; - -export type ThemeName = 'dark' | 'light' | 'high contrast'; +import { useTheme } from '../use-theme'; +import type { ThemeName } from '../use-theme'; /** * React element for theme selector. @@ -17,35 +17,24 @@ export type ThemeName = 'dark' | 'light' | 'high contrast'; export function ThemeSelectorCallout(): ReactElement { const { t } = useTranslation(); const [isCalloutVisible, setValue] = useState(false); - const theme = localStorage.getItem('theme') ?? 'dark'; - const [currentTheme, setTheme] = useState(theme); + const [theme, setTheme] = useTheme(); const buttonId = useId('callout-button'); const initialFocusRoot = useRef(null); - - /** - * - * @param newTheme - ThemeName - */ - function updateTheme(newTheme: ThemeName): void { - setTheme(newTheme); - localStorage.setItem('theme', newTheme); - setThemeOnDocument(newTheme); - } interface ThemeButtonProps { - name: string; + name: ThemeName; tooltip: string; } const themes: ThemeButtonProps[] = [ { - name: 'light', + name: 'light modern', tooltip: 'LIGHT_THEME_NAME' }, { - name: 'dark', + name: 'dark modern', tooltip: 'DARK_THEME_NAME' }, { - name: 'high contrast', + name: 'high contrast black', tooltip: 'HIGH_CONTRAST_THEME_NAME' } ]; @@ -59,7 +48,7 @@ export function ThemeSelectorCallout(): ReactElement { function createThemeButton(themeButtonProps: ThemeButtonProps): ReactElement { const { name, tooltip } = themeButtonProps; const nameSlug = name.replace(/ /g, '-'); - const isCurrentTheme = currentTheme === name; + const isCurrentTheme = theme === name; return (
{ - updateTheme(name as ThemeName); + setTheme(name); }}>
diff --git a/packages/control-property-editor/src/index.css b/packages/control-property-editor/src/index.css index 2a82b7668e..a524717989 100644 --- a/packages/control-property-editor/src/index.css +++ b/packages/control-property-editor/src/index.css @@ -22,7 +22,7 @@ code { font-family: var(--vscode-font-family); } -html[data-theme='dark'] { +html[data-theme='dark modern'] { --vscode-font-family: "Segoe WPC", "Segoe UI", sans-serif; --vscode-font-weight: normal; --vscode-font-size: 13px; @@ -31,32 +31,32 @@ html[data-theme='dark'] { --vscode-editor-font-size: 14px; --vscode-foreground: #cccccc; --vscode-disabledForeground: rgba(204, 204, 204, 0.5); - --vscode-errorForeground: #f48771; - --vscode-descriptionForeground: rgba(204, 204, 204, 0.7); - --vscode-icon-foreground: #c5c5c5; - --vscode-focusBorder: #007fd4; - --vscode-textLink-foreground: #3794ff; - --vscode-textLink-activeForeground: #3794ff; - --vscode-textSeparator-foreground: rgba(255, 255, 255, 0.18); - --vscode-textPreformat-foreground: #d7ba7d; - --vscode-textPreformat-background: rgba(255, 255, 255, 0.1); - --vscode-textBlockQuote-background: #222222; - --vscode-textBlockQuote-border: rgba(0, 122, 204, 0.5); - --vscode-textCodeBlock-background: rgba(10, 10, 10, 0.4); - --vscode-sash-hoverBorder: #007fd4; - --vscode-badge-background: #4d4d4d; - --vscode-badge-foreground: #ffffff; + --vscode-errorForeground: #f85149; + --vscode-descriptionForeground: #9d9d9d; + --vscode-icon-foreground: #cccccc; + --vscode-focusBorder: #0078d4; + --vscode-textLink-foreground: #4daafc; + --vscode-textLink-activeForeground: #4daafc; + --vscode-textSeparator-foreground: #21262d; + --vscode-textPreformat-foreground: #d0d0d0; + --vscode-textPreformat-background: #3c3c3c; + --vscode-textBlockQuote-background: #2b2b2b; + --vscode-textBlockQuote-border: #616161; + --vscode-textCodeBlock-background: #2b2b2b; + --vscode-sash-hoverBorder: #0078d4; + --vscode-badge-background: #616161; + --vscode-badge-foreground: #f8f8f8; --vscode-scrollbar-shadow: #000000; --vscode-scrollbarSlider-background: rgba(121, 121, 121, 0.4); --vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7); --vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, 0.4); - --vscode-progressBar-background: #0e70c0; - --vscode-editor-background: #1e1e1e; - --vscode-editor-foreground: #d4d4d4; - --vscode-editorStickyScroll-background: #1e1e1e; + --vscode-progressBar-background: #0078d4; + --vscode-editor-background: #1f1f1f; + --vscode-editor-foreground: #cccccc; + --vscode-editorStickyScroll-background: #1f1f1f; --vscode-editorStickyScrollHover-background: #2a2d2e; --vscode-editorStickyScroll-shadow: #000000; - --vscode-editorWidget-background: #252526; + --vscode-editorWidget-background: #202020; --vscode-editorWidget-foreground: #cccccc; --vscode-editorWidget-border: #454545; --vscode-editorError-foreground: #f14c4c; @@ -67,20 +67,20 @@ html[data-theme='dark'] { --vscode-editor-selectionBackground: #264f78; --vscode-editor-inactiveSelectionBackground: #3a3d41; --vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, 0.15); - --vscode-editor-findMatchBackground: #515c6a; + --vscode-editor-findMatchBackground: #9e6a03; --vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, 0.33); --vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, 0.4); --vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, 0.25); - --vscode-editorHoverWidget-background: #252526; + --vscode-editorHoverWidget-background: #202020; --vscode-editorHoverWidget-foreground: #cccccc; --vscode-editorHoverWidget-border: #454545; - --vscode-editorHoverWidget-statusBarBackground: #2c2c2d; + --vscode-editorHoverWidget-statusBarBackground: #262626; --vscode-editorInlayHint-foreground: #969696; - --vscode-editorInlayHint-background: rgba(77, 77, 77, 0.1); + --vscode-editorInlayHint-background: rgba(97, 97, 97, 0.1); --vscode-editorInlayHint-typeForeground: #969696; - --vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, 0.1); + --vscode-editorInlayHint-typeBackground: rgba(97, 97, 97, 0.1); --vscode-editorInlayHint-parameterForeground: #969696; - --vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, 0.1); + --vscode-editorInlayHint-parameterBackground: rgba(97, 97, 97, 0.1); --vscode-editorLightBulb-foreground: #ffcc00; --vscode-editorLightBulbAutoFix-foreground: #75beff; --vscode-editorLightBulbAi-foreground: #ffcc00; @@ -91,18 +91,18 @@ html[data-theme='dark'] { --vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, 0.2); --vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, 0.2); --vscode-diffEditor-diagonalFill: rgba(204, 204, 204, 0.2); - --vscode-diffEditor-unchangedRegionBackground: #252526; + --vscode-diffEditor-unchangedRegionBackground: #181818; --vscode-diffEditor-unchangedRegionForeground: #cccccc; --vscode-diffEditor-unchangedCodeBackground: rgba(116, 116, 116, 0.16); --vscode-widget-shadow: rgba(0, 0, 0, 0.36); - --vscode-widget-border: #303031; + --vscode-widget-border: #313131; --vscode-toolbar-hoverBackground: rgba(90, 93, 94, 0.31); --vscode-toolbar-activeBackground: rgba(99, 102, 103, 0.31); --vscode-breadcrumb-foreground: rgba(204, 204, 204, 0.8); - --vscode-breadcrumb-background: #1e1e1e; + --vscode-breadcrumb-background: #1f1f1f; --vscode-breadcrumb-focusForeground: #e0e0e0; --vscode-breadcrumb-activeSelectionForeground: #e0e0e0; - --vscode-breadcrumbPicker-background: #252526; + --vscode-breadcrumbPicker-background: #202020; --vscode-merge-currentHeaderBackground: rgba(64, 200, 174, 0.5); --vscode-merge-currentContentBackground: rgba(64, 200, 174, 0.2); --vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, 0.5); @@ -117,52 +117,55 @@ html[data-theme='dark'] { --vscode-problemsErrorIcon-foreground: #f14c4c; --vscode-problemsWarningIcon-foreground: #cca700; --vscode-problemsInfoIcon-foreground: #3794ff; - --vscode-input-background: #3c3c3c; + --vscode-input-background: #313131; --vscode-input-foreground: #cccccc; - --vscode-inputOption-activeBorder: #007acc; + --vscode-input-border: #3c3c3c; + --vscode-inputOption-activeBorder: #2488db; --vscode-inputOption-hoverBackground: rgba(90, 93, 94, 0.5); - --vscode-inputOption-activeBackground: rgba(0, 127, 212, 0.4); + --vscode-inputOption-activeBackground: rgba(36, 137, 219, 0.51); --vscode-inputOption-activeForeground: #ffffff; - --vscode-input-placeholderForeground: #a6a6a6; + --vscode-input-placeholderForeground: #989898; --vscode-inputValidation-infoBackground: #063b49; --vscode-inputValidation-infoBorder: #007acc; --vscode-inputValidation-warningBackground: #352a05; --vscode-inputValidation-warningBorder: #b89500; --vscode-inputValidation-errorBackground: #5a1d1d; --vscode-inputValidation-errorBorder: #be1100; - --vscode-dropdown-background: #3c3c3c; - --vscode-dropdown-foreground: #f0f0f0; + --vscode-dropdown-background: #313131; + --vscode-dropdown-listBackground: #1f1f1f; + --vscode-dropdown-foreground: #cccccc; --vscode-dropdown-border: #3c3c3c; --vscode-button-foreground: #ffffff; --vscode-button-separator: rgba(255, 255, 255, 0.4); - --vscode-button-background: #0e639c; - --vscode-button-hoverBackground: #1177bb; - --vscode-button-secondaryForeground: #ffffff; - --vscode-button-secondaryBackground: #3a3d41; - --vscode-button-secondaryHoverBackground: #45494e; - --vscode-checkbox-background: #3c3c3c; - --vscode-checkbox-selectBackground: #252526; - --vscode-checkbox-foreground: #f0f0f0; - --vscode-checkbox-border: #6b6b6b; - --vscode-checkbox-selectBorder: #c5c5c5; + --vscode-button-background: #0078d4; + --vscode-button-hoverBackground: #026ec1; + --vscode-button-border: rgba(255, 255, 255, 0.07); + --vscode-button-secondaryForeground: #cccccc; + --vscode-button-secondaryBackground: #313131; + --vscode-button-secondaryHoverBackground: #3c3c3c; + --vscode-checkbox-background: #313131; + --vscode-checkbox-selectBackground: #202020; + --vscode-checkbox-foreground: #cccccc; + --vscode-checkbox-border: #3c3c3c; + --vscode-checkbox-selectBorder: #cccccc; --vscode-keybindingLabel-background: rgba(128, 128, 128, 0.17); --vscode-keybindingLabel-foreground: #cccccc; --vscode-keybindingLabel-border: rgba(51, 51, 51, 0.6); --vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, 0.6); - --vscode-list-focusOutline: #007fd4; + --vscode-list-focusOutline: #0078d4; --vscode-list-activeSelectionBackground: #04395e; --vscode-list-activeSelectionForeground: #ffffff; --vscode-list-activeSelectionIconForeground: #ffffff; --vscode-list-inactiveSelectionBackground: #37373d; --vscode-list-hoverBackground: #2a2d2e; --vscode-list-dropBackground: #383b3d; - --vscode-list-dropBetweenBackground: #c5c5c5; + --vscode-list-dropBetweenBackground: #cccccc; --vscode-list-highlightForeground: #2aaaff; --vscode-list-focusHighlightForeground: #2aaaff; --vscode-list-invalidItemForeground: #b89500; --vscode-list-errorForeground: #f88070; --vscode-list-warningForeground: #cca700; - --vscode-listFilterWidget-background: #252526; + --vscode-listFilterWidget-background: #202020; --vscode-listFilterWidget-outline: rgba(0, 0, 0, 0); --vscode-listFilterWidget-noMatchesOutline: #be1100; --vscode-listFilterWidget-shadow: rgba(0, 0, 0, 0.36); @@ -174,9 +177,9 @@ html[data-theme='dark'] { --vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, 0.04); --vscode-menu-border: #454545; --vscode-menu-foreground: #cccccc; - --vscode-menu-background: #252526; + --vscode-menu-background: #1f1f1f; --vscode-menu-selectionForeground: #ffffff; - --vscode-menu-selectionBackground: #04395e; + --vscode-menu-selectionBackground: #0078d4; --vscode-menu-separatorBackground: #454545; --vscode-minimap-findMatchHighlight: #d18616; --vscode-minimap-selectionOccurrenceHighlight: #676767; @@ -196,18 +199,18 @@ html[data-theme='dark'] { --vscode-charts-orange: #d18616; --vscode-charts-green: #89d185; --vscode-charts-purple: #b180d7; - --vscode-quickInput-background: #252526; + --vscode-quickInput-background: #222222; --vscode-quickInput-foreground: #cccccc; --vscode-quickInputTitle-background: rgba(255, 255, 255, 0.1); --vscode-pickerGroup-foreground: #3794ff; - --vscode-pickerGroup-border: #3f3f46; + --vscode-pickerGroup-border: #3c3c3c; --vscode-quickInputList-focusForeground: #ffffff; --vscode-quickInputList-focusIconForeground: #ffffff; --vscode-quickInputList-focusBackground: #04395e; --vscode-search-resultsInfoForeground: rgba(204, 204, 204, 0.65); --vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, 0.22); --vscode-multiDiffEditor-headerBackground: #262626; - --vscode-multiDiffEditor-border: rgba(204, 204, 204, 0.2); + --vscode-multiDiffEditor-border: #2b2b2b; --vscode-symbolIcon-arrayForeground: #cccccc; --vscode-symbolIcon-booleanForeground: #cccccc; --vscode-symbolIcon-classForeground: #ee9d28; @@ -250,7 +253,7 @@ html[data-theme='dark'] { --vscode-editorMultiCursor-primary\.foreground: #aeafad; --vscode-editorMultiCursor-secondary\.foreground: #aeafad; --vscode-editorWhitespace-foreground: rgba(227, 228, 226, 0.16); - --vscode-editorLineNumber-foreground: #858585; + --vscode-editorLineNumber-foreground: #6e7681; --vscode-editorIndentGuide-background: rgba(227, 228, 226, 0.16); --vscode-editorIndentGuide-activeBackground: rgba(227, 228, 226, 0.16); --vscode-editorIndentGuide-background1: #404040; @@ -266,13 +269,13 @@ html[data-theme='dark'] { --vscode-editorIndentGuide-activeBackground5: rgba(0, 0, 0, 0); --vscode-editorIndentGuide-activeBackground6: rgba(0, 0, 0, 0); --vscode-editorActiveLineNumber-foreground: #c6c6c6; - --vscode-editorLineNumber-activeForeground: #c6c6c6; + --vscode-editorLineNumber-activeForeground: #cccccc; --vscode-editorRuler-foreground: #5a5a5a; --vscode-editorCodeLens-foreground: #999999; --vscode-editorBracketMatch-background: rgba(0, 100, 0, 0.1); --vscode-editorBracketMatch-border: #888888; - --vscode-editorOverviewRuler-border: rgba(127, 127, 127, 0.3); - --vscode-editorGutter-background: #1e1e1e; + --vscode-editorOverviewRuler-border: #010409; + --vscode-editorGutter-background: #1f1f1f; --vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, 0.67); --vscode-editorGhostText-foreground: rgba(255, 255, 255, 0.34); --vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, 0.6); @@ -304,7 +307,7 @@ html[data-theme='dark'] { --vscode-diffEditor-unchangedRegionShadow: #000000; --vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0; --vscode-editor-foldBackground: rgba(38, 79, 120, 0.3); - --vscode-editorGutter-foldingControlForeground: #c5c5c5; + --vscode-editorGutter-foldingControlForeground: #cccccc; --vscode-editor-linkedEditingBackground: rgba(255, 0, 0, 0.3); --vscode-editor-wordHighlightBackground: rgba(87, 87, 87, 0.72); --vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, 0.72); @@ -316,99 +319,113 @@ html[data-theme='dark'] { --vscode-peekViewTitleLabel-foreground: #ffffff; --vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, 0.7); --vscode-peekView-border: #3794ff; - --vscode-peekViewResult-background: #252526; + --vscode-peekViewResult-background: #1f1f1f; --vscode-peekViewResult-lineForeground: #bbbbbb; --vscode-peekViewResult-fileForeground: #ffffff; --vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, 0.2); --vscode-peekViewResult-selectionForeground: #ffffff; - --vscode-peekViewEditor-background: #001f33; - --vscode-peekViewEditorGutter-background: #001f33; - --vscode-peekViewEditorStickyScroll-background: #001f33; - --vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, 0.3); - --vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, 0.6); + --vscode-peekViewEditor-background: #1f1f1f; + --vscode-peekViewEditorGutter-background: #1f1f1f; + --vscode-peekViewEditorStickyScroll-background: #1f1f1f; + --vscode-peekViewResult-matchHighlightBackground: rgba(187, 128, 9, 0.4); + --vscode-peekViewEditor-matchHighlightBackground: rgba(187, 128, 9, 0.4); --vscode-editorMarkerNavigationError-background: #f14c4c; --vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, 0.1); --vscode-editorMarkerNavigationWarning-background: #cca700; --vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, 0.1); --vscode-editorMarkerNavigationInfo-background: #3794ff; --vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, 0.1); - --vscode-editorMarkerNavigation-background: #1e1e1e; - --vscode-editorSuggestWidget-background: #252526; + --vscode-editorMarkerNavigation-background: #1f1f1f; + --vscode-editorSuggestWidget-background: #202020; --vscode-editorSuggestWidget-border: #454545; - --vscode-editorSuggestWidget-foreground: #d4d4d4; + --vscode-editorSuggestWidget-foreground: #cccccc; --vscode-editorSuggestWidget-selectedForeground: #ffffff; --vscode-editorSuggestWidget-selectedIconForeground: #ffffff; --vscode-editorSuggestWidget-selectedBackground: #04395e; --vscode-editorSuggestWidget-highlightForeground: #2aaaff; --vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff; - --vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, 0.5); - --vscode-editorWatermark-foreground: rgba(212, 212, 212, 0.6); - --vscode-tab-activeBackground: #1e1e1e; - --vscode-tab-unfocusedActiveBackground: #1e1e1e; - --vscode-tab-inactiveBackground: #2d2d2d; - --vscode-tab-unfocusedInactiveBackground: #2d2d2d; + --vscode-editorSuggestWidgetStatus-foreground: rgba(204, 204, 204, 0.5); + --vscode-editorWatermark-foreground: rgba(204, 204, 204, 0.6); + --vscode-tab-activeBackground: #1f1f1f; + --vscode-tab-unfocusedActiveBackground: #1f1f1f; + --vscode-tab-inactiveBackground: #181818; + --vscode-tab-unfocusedInactiveBackground: #181818; --vscode-tab-activeForeground: #ffffff; - --vscode-tab-inactiveForeground: rgba(255, 255, 255, 0.5); + --vscode-tab-inactiveForeground: #9d9d9d; --vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, 0.5); - --vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, 0.25); - --vscode-tab-border: #252526; + --vscode-tab-unfocusedInactiveForeground: rgba(157, 157, 157, 0.5); + --vscode-tab-hoverBackground: #1f1f1f; + --vscode-tab-unfocusedHoverBackground: #1f1f1f; + --vscode-tab-border: #2b2b2b; --vscode-tab-lastPinnedBorder: rgba(204, 204, 204, 0.2); + --vscode-tab-activeBorder: #1f1f1f; + --vscode-tab-unfocusedActiveBorder: #1f1f1f; + --vscode-tab-activeBorderTop: #0078d4; + --vscode-tab-unfocusedActiveBorderTop: #2b2b2b; + --vscode-tab-selectedBorderTop: #6caddf; + --vscode-tab-selectedBackground: #222222; + --vscode-tab-selectedForeground: rgba(255, 255, 255, 0.63); --vscode-tab-dragAndDropBorder: #ffffff; --vscode-tab-activeModifiedBorder: #3399cc; --vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, 0.5); --vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, 0.5); --vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, 0.25); - --vscode-editorPane-background: #1e1e1e; - --vscode-editorGroupHeader-tabsBackground: #252526; - --vscode-editorGroupHeader-noTabsBackground: #1e1e1e; - --vscode-editorGroup-border: #444444; + --vscode-editorPane-background: #1f1f1f; + --vscode-editorGroupHeader-tabsBackground: #181818; + --vscode-editorGroupHeader-tabsBorder: #2b2b2b; + --vscode-editorGroupHeader-noTabsBackground: #1f1f1f; + --vscode-editorGroup-border: rgba(255, 255, 255, 0.09); --vscode-editorGroup-dropBackground: rgba(83, 89, 93, 0.5); --vscode-editorGroup-dropIntoPromptForeground: #cccccc; - --vscode-editorGroup-dropIntoPromptBackground: #252526; - --vscode-sideBySideEditor-horizontalBorder: #444444; - --vscode-sideBySideEditor-verticalBorder: #444444; - --vscode-panel-background: #1e1e1e; - --vscode-panel-border: rgba(128, 128, 128, 0.35); - --vscode-panelTitle-activeForeground: #e7e7e7; - --vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, 0.6); - --vscode-panelTitle-activeBorder: #e7e7e7; - --vscode-panel-dropBorder: #e7e7e7; + --vscode-editorGroup-dropIntoPromptBackground: #202020; + --vscode-sideBySideEditor-horizontalBorder: rgba(255, 255, 255, 0.09); + --vscode-sideBySideEditor-verticalBorder: rgba(255, 255, 255, 0.09); + --vscode-panel-background: #181818; + --vscode-panel-border: #2b2b2b; + --vscode-panelTitle-activeForeground: #cccccc; + --vscode-panelTitle-inactiveForeground: #9d9d9d; + --vscode-panelTitle-activeBorder: #0078d4; + --vscode-panelInput-border: #2b2b2b; + --vscode-panel-dropBorder: #cccccc; --vscode-panelSection-dropBackground: rgba(83, 89, 93, 0.5); --vscode-panelSectionHeader-background: rgba(128, 128, 128, 0.2); - --vscode-panelSection-border: rgba(128, 128, 128, 0.35); - --vscode-panelStickyScroll-background: #1e1e1e; + --vscode-panelSection-border: #2b2b2b; + --vscode-panelStickyScroll-background: #181818; --vscode-panelStickyScroll-shadow: #000000; --vscode-banner-background: #04395e; --vscode-banner-foreground: #ffffff; --vscode-banner-iconForeground: #3794ff; - --vscode-statusBar-foreground: #ffffff; - --vscode-statusBar-noFolderForeground: #ffffff; - --vscode-statusBar-background: #007acc; - --vscode-statusBar-noFolderBackground: #68217a; - --vscode-statusBar-focusBorder: #ffffff; + --vscode-statusBar-foreground: #cccccc; + --vscode-statusBar-noFolderForeground: #cccccc; + --vscode-statusBar-background: #181818; + --vscode-statusBar-noFolderBackground: #1f1f1f; + --vscode-statusBar-border: #2b2b2b; + --vscode-statusBar-focusBorder: #0078d4; + --vscode-statusBar-noFolderBorder: #2b2b2b; --vscode-statusBarItem-activeBackground: rgba(255, 255, 255, 0.18); - --vscode-statusBarItem-focusBorder: #ffffff; + --vscode-statusBarItem-focusBorder: #0078d4; --vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, 0.12); - --vscode-statusBarItem-hoverForeground: #ffffff; + --vscode-statusBarItem-hoverForeground: #cccccc; --vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, 0.2); - --vscode-statusBarItem-prominentForeground: #ffffff; - --vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, 0.5); - --vscode-statusBarItem-prominentHoverForeground: #ffffff; + --vscode-statusBarItem-prominentForeground: #cccccc; + --vscode-statusBarItem-prominentBackground: rgba(110, 118, 129, 0.4); + --vscode-statusBarItem-prominentHoverForeground: #cccccc; --vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, 0.3); - --vscode-statusBarItem-errorBackground: #c72e0f; + --vscode-statusBarItem-errorBackground: #b91007; --vscode-statusBarItem-errorForeground: #ffffff; - --vscode-statusBarItem-errorHoverForeground: #ffffff; + --vscode-statusBarItem-errorHoverForeground: #cccccc; --vscode-statusBarItem-errorHoverBackground: rgba(255, 255, 255, 0.12); --vscode-statusBarItem-warningBackground: #7a6400; --vscode-statusBarItem-warningForeground: #ffffff; - --vscode-statusBarItem-warningHoverForeground: #ffffff; + --vscode-statusBarItem-warningHoverForeground: #cccccc; --vscode-statusBarItem-warningHoverBackground: rgba(255, 255, 255, 0.12); - --vscode-activityBar-background: #333333; - --vscode-activityBar-foreground: #ffffff; - --vscode-activityBar-inactiveForeground: rgba(255, 255, 255, 0.4); - --vscode-activityBar-activeBorder: #ffffff; - --vscode-activityBar-dropBorder: #ffffff; - --vscode-activityBarBadge-background: #007acc; + --vscode-activityBar-background: #181818; + --vscode-activityBar-foreground: #d7d7d7; + --vscode-activityBar-inactiveForeground: #868686; + --vscode-activityBar-border: #2b2b2b; + --vscode-activityBar-activeBorder: #0078d4; + --vscode-activityBar-dropBorder: #d7d7d7; + --vscode-activityBarBadge-background: #0078d4; --vscode-activityBarBadge-foreground: #ffffff; --vscode-activityBarTop-foreground: #e7e7e7; --vscode-activityBarTop-activeBorder: #e7e7e7; @@ -416,69 +433,74 @@ html[data-theme='dark'] { --vscode-activityBarTop-dropBorder: #e7e7e7; --vscode-profileBadge-background: #4d4d4d; --vscode-profileBadge-foreground: #ffffff; - --vscode-statusBarItem-remoteBackground: #16825d; + --vscode-statusBarItem-remoteBackground: #0078d4; --vscode-statusBarItem-remoteForeground: #ffffff; - --vscode-statusBarItem-remoteHoverForeground: #ffffff; + --vscode-statusBarItem-remoteHoverForeground: #cccccc; --vscode-statusBarItem-remoteHoverBackground: rgba(255, 255, 255, 0.12); --vscode-statusBarItem-offlineBackground: #6c1717; --vscode-statusBarItem-offlineForeground: #ffffff; - --vscode-statusBarItem-offlineHoverForeground: #ffffff; + --vscode-statusBarItem-offlineHoverForeground: #cccccc; --vscode-statusBarItem-offlineHoverBackground: rgba(255, 255, 255, 0.12); - --vscode-extensionBadge-remoteBackground: #007acc; + --vscode-extensionBadge-remoteBackground: #0078d4; --vscode-extensionBadge-remoteForeground: #ffffff; - --vscode-sideBar-background: #252526; - --vscode-sideBarTitle-background: #252526; - --vscode-sideBarTitle-foreground: #bbbbbb; + --vscode-sideBar-background: #181818; + --vscode-sideBar-foreground: #cccccc; + --vscode-sideBar-border: #2b2b2b; + --vscode-sideBarTitle-background: #181818; + --vscode-sideBarTitle-foreground: #cccccc; --vscode-sideBar-dropBackground: rgba(83, 89, 93, 0.5); - --vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0); - --vscode-sideBarSectionHeader-border: rgba(204, 204, 204, 0.2); - --vscode-sideBarActivityBarTop-border: rgba(204, 204, 204, 0.2); - --vscode-sideBarStickyScroll-background: #252526; + --vscode-sideBarSectionHeader-background: #181818; + --vscode-sideBarSectionHeader-foreground: #cccccc; + --vscode-sideBarSectionHeader-border: #2b2b2b; + --vscode-sideBarActivityBarTop-border: #2b2b2b; + --vscode-sideBarStickyScroll-background: #181818; --vscode-sideBarStickyScroll-shadow: #000000; --vscode-titleBar-activeForeground: #cccccc; - --vscode-titleBar-inactiveForeground: rgba(204, 204, 204, 0.6); - --vscode-titleBar-activeBackground: #3c3c3c; - --vscode-titleBar-inactiveBackground: rgba(60, 60, 60, 0.6); + --vscode-titleBar-inactiveForeground: #9d9d9d; + --vscode-titleBar-activeBackground: #181818; + --vscode-titleBar-inactiveBackground: #1f1f1f; + --vscode-titleBar-border: #2b2b2b; --vscode-menubar-selectionForeground: #cccccc; --vscode-menubar-selectionBackground: rgba(90, 93, 94, 0.31); --vscode-commandCenter-foreground: #cccccc; --vscode-commandCenter-activeForeground: #cccccc; - --vscode-commandCenter-inactiveForeground: rgba(204, 204, 204, 0.6); + --vscode-commandCenter-inactiveForeground: #9d9d9d; --vscode-commandCenter-background: rgba(255, 255, 255, 0.05); --vscode-commandCenter-activeBackground: rgba(255, 255, 255, 0.08); --vscode-commandCenter-border: rgba(204, 204, 204, 0.2); --vscode-commandCenter-activeBorder: rgba(204, 204, 204, 0.3); - --vscode-commandCenter-inactiveBorder: rgba(204, 204, 204, 0.15); - --vscode-notificationCenter-border: #303031; - --vscode-notificationToast-border: #303031; + --vscode-commandCenter-inactiveBorder: rgba(157, 157, 157, 0.25); + --vscode-notificationCenter-border: #313131; + --vscode-notificationToast-border: #313131; --vscode-notifications-foreground: #cccccc; - --vscode-notifications-background: #252526; - --vscode-notificationLink-foreground: #3794ff; - --vscode-notificationCenterHeader-background: #303031; - --vscode-notifications-border: #303031; + --vscode-notifications-background: #1f1f1f; + --vscode-notificationLink-foreground: #4daafc; + --vscode-notificationCenterHeader-foreground: #cccccc; + --vscode-notificationCenterHeader-background: #1f1f1f; + --vscode-notifications-border: #2b2b2b; --vscode-notificationsErrorIcon-foreground: #f14c4c; --vscode-notificationsWarningIcon-foreground: #cca700; --vscode-notificationsInfoIcon-foreground: #3794ff; --vscode-chat-requestBorder: rgba(255, 255, 255, 0.1); - --vscode-chat-requestBackground: rgba(30, 30, 30, 0.62); - --vscode-chat-slashCommandBackground: rgba(52, 65, 75, 0.56); + --vscode-chat-requestBackground: rgba(31, 31, 31, 0.62); + --vscode-chat-slashCommandBackground: #34414b; --vscode-chat-slashCommandForeground: #40a6ff; --vscode-chat-avatarBackground: #1f1f1f; --vscode-chat-avatarForeground: #cccccc; --vscode-simpleFindWidget-sashBorder: #454545; --vscode-commentsView-resolvedIcon: rgba(204, 204, 204, 0.5); - --vscode-commentsView-unresolvedIcon: #007fd4; + --vscode-commentsView-unresolvedIcon: #0078d4; --vscode-editorCommentsWidget-replyInputBackground: #252526; --vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, 0.5); - --vscode-editorCommentsWidget-unresolvedBorder: #007fd4; - --vscode-editorCommentsWidget-rangeBackground: rgba(0, 127, 212, 0.1); - --vscode-editorCommentsWidget-rangeActiveBackground: rgba(0, 127, 212, 0.1); + --vscode-editorCommentsWidget-unresolvedBorder: #0078d4; + --vscode-editorCommentsWidget-rangeBackground: rgba(0, 120, 212, 0.1); + --vscode-editorCommentsWidget-rangeActiveBackground: rgba(0, 120, 212, 0.1); --vscode-editorGutter-commentRangeForeground: #37373d; --vscode-editorOverviewRuler-commentForeground: #37373d; --vscode-editorOverviewRuler-commentUnresolvedForeground: #37373d; - --vscode-editorGutter-commentGlyphForeground: #d4d4d4; - --vscode-editorGutter-commentUnresolvedGlyphForeground: #d4d4d4; - --vscode-debugToolBar-background: #333333; + --vscode-editorGutter-commentGlyphForeground: #cccccc; + --vscode-editorGutter-commentUnresolvedGlyphForeground: #cccccc; + --vscode-debugToolBar-background: #181818; --vscode-debugIcon-startForeground: #89d185; --vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, 0.2); --vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, 0.3); @@ -495,25 +517,27 @@ html[data-theme='dark'] { --vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, 0.28); --vscode-mergeEditor-conflict\.input1\.background: rgba(64, 200, 174, 0.2); --vscode-mergeEditor-conflict\.input2\.background: rgba(64, 166, 255, 0.2); - --vscode-settings-headerForeground: #e7e7e7; - --vscode-settings-settingsHeaderHoverForeground: rgba(231, 231, 231, 0.7); - --vscode-settings-modifiedItemIndicator: #0c7d9d; - --vscode-settings-headerBorder: rgba(128, 128, 128, 0.35); - --vscode-settings-sashBorder: rgba(128, 128, 128, 0.35); - --vscode-settings-dropdownBackground: #3c3c3c; - --vscode-settings-dropdownForeground: #f0f0f0; + --vscode-settings-headerForeground: #ffffff; + --vscode-settings-settingsHeaderHoverForeground: rgba(255, 255, 255, 0.7); + --vscode-settings-modifiedItemIndicator: rgba(187, 128, 9, 0.4); + --vscode-settings-headerBorder: #2b2b2b; + --vscode-settings-sashBorder: #2b2b2b; + --vscode-settings-dropdownBackground: #313131; + --vscode-settings-dropdownForeground: #cccccc; --vscode-settings-dropdownBorder: #3c3c3c; --vscode-settings-dropdownListBorder: #454545; - --vscode-settings-checkboxBackground: #3c3c3c; - --vscode-settings-checkboxForeground: #f0f0f0; - --vscode-settings-checkboxBorder: #6b6b6b; - --vscode-settings-textInputBackground: #3c3c3c; + --vscode-settings-checkboxBackground: #313131; + --vscode-settings-checkboxForeground: #cccccc; + --vscode-settings-checkboxBorder: #3c3c3c; + --vscode-settings-textInputBackground: #313131; --vscode-settings-textInputForeground: #cccccc; - --vscode-settings-numberInputBackground: #3c3c3c; + --vscode-settings-textInputBorder: #3c3c3c; + --vscode-settings-numberInputBackground: #313131; --vscode-settings-numberInputForeground: #cccccc; + --vscode-settings-numberInputBorder: #3c3c3c; --vscode-settings-focusedRowBackground: rgba(42, 45, 46, 0.6); --vscode-settings-rowHoverBackground: rgba(42, 45, 46, 0.3); - --vscode-settings-focusedRowBorder: #007fd4; + --vscode-settings-focusedRowBorder: #0078d4; --vscode-terminal-foreground: #cccccc; --vscode-terminal-selectionBackground: #264f78; --vscode-terminal-inactiveSelectionBackground: #3a3d41; @@ -521,12 +545,13 @@ html[data-theme='dark'] { --vscode-terminalCommandDecoration-successBackground: #1b81a8; --vscode-terminalCommandDecoration-errorBackground: #f14c4c; --vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8); - --vscode-terminal-border: rgba(128, 128, 128, 0.35); - --vscode-terminal-findMatchBackground: #515c6a; + --vscode-terminal-border: #2b2b2b; + --vscode-terminal-findMatchBackground: #9e6a03; --vscode-terminal-hoverHighlightBackground: rgba(38, 79, 120, 0.13); --vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, 0.33); --vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49); --vscode-terminal-dropBackground: rgba(83, 89, 93, 0.5); + --vscode-terminal-tab\.activeBorder: #0078d4; --vscode-terminalStickyScrollHover-background: #2a2d2e; --vscode-testing-iconFailed: #f14c4c; --vscode-testing-iconErrored: #f14c4c; @@ -546,41 +571,51 @@ html[data-theme='dark'] { --vscode-testing-uncoveredBackground: rgba(255, 0, 0, 0.2); --vscode-testing-uncoveredBorder: rgba(255, 0, 0, 0.15); --vscode-testing-uncoveredGutterBackground: rgba(255, 0, 0, 0.3); - --vscode-testing-coverCountBadgeBackground: #4d4d4d; - --vscode-testing-coverCountBadgeForeground: #ffffff; + --vscode-testing-coverCountBadgeBackground: #616161; + --vscode-testing-coverCountBadgeForeground: #f8f8f8; --vscode-testing-message\.error\.decorationForeground: #f14c4c; --vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, 0.2); - --vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, 0.5); + --vscode-testing-message\.info\.decorationForeground: rgba(204, 204, 204, 0.5); --vscode-testing-iconErrored\.retired: rgba(241, 76, 76, 0.7); --vscode-testing-iconFailed\.retired: rgba(241, 76, 76, 0.7); --vscode-testing-iconPassed\.retired: rgba(115, 201, 145, 0.7); --vscode-testing-iconQueued\.retired: rgba(204, 167, 0, 0.7); --vscode-testing-iconUnset\.retired: rgba(132, 132, 132, 0.7); --vscode-testing-iconSkipped\.retired: rgba(132, 132, 132, 0.7); - --vscode-welcomePage-tileBackground: #252526; - --vscode-welcomePage-tileHoverBackground: #2c2c2d; + --vscode-welcomePage-tileBackground: #2b2b2b; + --vscode-welcomePage-tileHoverBackground: #262626; --vscode-welcomePage-tileBorder: rgba(255, 255, 255, 0.1); - --vscode-welcomePage-progress\.background: #3c3c3c; - --vscode-welcomePage-progress\.foreground: #3794ff; + --vscode-welcomePage-progress\.background: #313131; + --vscode-welcomePage-progress\.foreground: #0078d4; --vscode-walkthrough-stepTitle\.foreground: #ffffff; --vscode-walkThrough-embeddedEditorBackground: rgba(0, 0, 0, 0.4); - --vscode-inlineChat-background: #252526; + --vscode-inlineChat-background: #202020; --vscode-inlineChat-border: #454545; --vscode-inlineChat-shadow: rgba(0, 0, 0, 0.36); --vscode-inlineChat-regionHighlight: rgba(38, 79, 120, 0.25); --vscode-inlineChatInput-border: #454545; - --vscode-inlineChatInput-focusBorder: #007fd4; - --vscode-inlineChatInput-placeholderForeground: #a6a6a6; - --vscode-inlineChatInput-background: #3c3c3c; + --vscode-inlineChatInput-focusBorder: #0078d4; + --vscode-inlineChatInput-placeholderForeground: #989898; + --vscode-inlineChatInput-background: #313131; --vscode-inlineChatDiff-inserted: rgba(156, 204, 44, 0.1); --vscode-editorOverviewRuler-inlineChatInserted: rgba(156, 204, 44, 0.12); --vscode-inlineChatDiff-removed: rgba(255, 0, 0, 0.1); --vscode-editorOverviewRuler-inlineChatRemoved: rgba(255, 0, 0, 0.12); --vscode-debugExceptionWidget-border: #a31515; --vscode-debugExceptionWidget-background: #420b0d; - --vscode-statusBar-debuggingBackground: #cc6633; + --vscode-statusBar-debuggingBackground: #0078d4; --vscode-statusBar-debuggingForeground: #ffffff; - --vscode-commandCenter-debuggingBackground: rgba(204, 102, 51, 0.26); + --vscode-statusBar-debuggingBorder: #2b2b2b; + --vscode-commandCenter-debuggingBackground: rgba(0, 120, 212, 0.26); + --vscode-editorGutter-modifiedBackground: #0078d4; + --vscode-editorGutter-addedBackground: #2ea043; + --vscode-editorGutter-deletedBackground: #f85149; + --vscode-minimapGutter-modifiedBackground: #0078d4; + --vscode-minimapGutter-addedBackground: #2ea043; + --vscode-minimapGutter-deletedBackground: #f85149; + --vscode-editorOverviewRuler-modifiedForeground: rgba(0, 120, 212, 0.6); + --vscode-editorOverviewRuler-addedForeground: rgba(46, 160, 67, 0.6); + --vscode-editorOverviewRuler-deletedForeground: rgba(248, 81, 73, 0.6); --vscode-keybindingTable-headerBackground: rgba(204, 204, 204, 0.04); --vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, 0.04); --vscode-debugIcon-breakpointForeground: #e51400; @@ -591,15 +626,7 @@ html[data-theme='dark'] { --vscode-editor-inlineValuesForeground: rgba(255, 255, 255, 0.5); --vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2); --vscode-ports-iconRunningProcessForeground: #369432; - --vscode-editorGutter-modifiedBackground: #1b81a8; - --vscode-editorGutter-addedBackground: #487e02; - --vscode-editorGutter-deletedBackground: #f14c4c; - --vscode-minimapGutter-modifiedBackground: #1b81a8; - --vscode-minimapGutter-addedBackground: #487e02; - --vscode-minimapGutter-deletedBackground: #f14c4c; - --vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, 0.6); - --vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, 0.6); - --vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, 0.6); + --vscode-profiles-sashBorder: #2b2b2b; --vscode-debugTokenExpression-name: #c586c0; --vscode-debugTokenExpression-value: rgba(204, 204, 204, 0.6); --vscode-debugTokenExpression-string: #ce9178; @@ -613,7 +640,7 @@ html[data-theme='dark'] { --vscode-debugView-valueChangedHighlight: #569cd6; --vscode-debugConsole-infoForeground: #3794ff; --vscode-debugConsole-warningForeground: #cca700; - --vscode-debugConsole-errorForeground: #f48771; + --vscode-debugConsole-errorForeground: #f85149; --vscode-debugConsole-sourceForeground: #cccccc; --vscode-debugConsoleInputIcon-foreground: #cccccc; --vscode-debugIcon-pauseForeground: #75beff; @@ -629,38 +656,39 @@ html[data-theme='dark'] { --vscode-scm-historyItemDeletionsForeground: #c74e39; --vscode-scm-historyItemStatisticsBorder: rgba(204, 204, 204, 0.2); --vscode-scm-historyItemSelectedStatisticsBorder: rgba(255, 255, 255, 0.2); - --vscode-extensionButton-background: #0e639c; + --vscode-extensionButton-background: #0078d4; --vscode-extensionButton-foreground: #ffffff; - --vscode-extensionButton-hoverBackground: #1177bb; + --vscode-extensionButton-hoverBackground: #026ec1; --vscode-extensionButton-separator: rgba(255, 255, 255, 0.4); - --vscode-extensionButton-prominentBackground: #0e639c; + --vscode-extensionButton-prominentBackground: #0078d4; --vscode-extensionButton-prominentForeground: #ffffff; - --vscode-extensionButton-prominentHoverBackground: #1177bb; + --vscode-extensionButton-prominentHoverBackground: #026ec1; --vscode-extensionIcon-starForeground: #ff8e00; - --vscode-extensionIcon-verifiedForeground: #3794ff; + --vscode-extensionIcon-verifiedForeground: #4daafc; --vscode-extensionIcon-preReleaseForeground: #1d9271; --vscode-extensionIcon-sponsorForeground: #d758b3; --vscode-notebook-cellBorderColor: #37373d; - --vscode-notebook-focusedEditorBorder: #007fd4; + --vscode-notebook-focusedEditorBorder: #0078d4; --vscode-notebookStatusSuccessIcon-foreground: #89d185; --vscode-notebookEditorOverviewRuler-runningCellForeground: #89d185; - --vscode-notebookStatusErrorIcon-foreground: #f48771; + --vscode-notebookStatusErrorIcon-foreground: #f85149; --vscode-notebookStatusRunningIcon-foreground: #cccccc; --vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, 0.35); --vscode-notebook-selectedCellBackground: #37373d; --vscode-notebook-selectedCellBorder: #37373d; - --vscode-notebook-focusedCellBorder: #007fd4; + --vscode-notebook-focusedCellBorder: #0078d4; --vscode-notebook-inactiveFocusedCellBorder: #37373d; --vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, 0.15); - --vscode-notebook-cellInsertionIndicator: #007fd4; + --vscode-notebook-cellInsertionIndicator: #0078d4; --vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, 0.4); --vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7); --vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, 0.4); --vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, 0.04); - --vscode-notebook-cellEditorBackground: #252526; - --vscode-notebook-editorBackground: #1e1e1e; + --vscode-notebook-cellEditorBackground: #181818; + --vscode-notebook-editorBackground: #1f1f1f; --vscode-interactive-activeCodeBorder: #007acc; --vscode-interactive-inactiveCodeBorder: #37373d; + --vscode-searchEditor-textInputBorder: #3c3c3c; --vscode-terminal-ansiBlack: #000000; --vscode-terminal-ansiRed: #cd3131; --vscode-terminal-ansiGreen: #0dbc79; @@ -689,42 +717,42 @@ html[data-theme='dark'] { --vscode-gitDecoration-submoduleResourceForeground: #8db9e2; } -html[data-theme='light'] { +html[data-theme='light modern'] { --vscode-font-family: "Segoe WPC", "Segoe UI", sans-serif; --vscode-font-weight: normal; --vscode-font-size: 13px; --vscode-editor-font-family: Consolas, 'Courier New', monospace; --vscode-editor-font-weight: normal; --vscode-editor-font-size: 14px; - --vscode-foreground: #616161; + --vscode-foreground: #3b3b3b; --vscode-disabledForeground: rgba(97, 97, 97, 0.5); - --vscode-errorForeground: #a1260d; - --vscode-descriptionForeground: #717171; - --vscode-icon-foreground: #424242; - --vscode-focusBorder: #0090f1; - --vscode-textLink-foreground: #006ab1; - --vscode-textLink-activeForeground: #006ab1; - --vscode-textSeparator-foreground: rgba(0, 0, 0, 0.18); - --vscode-textPreformat-foreground: #a31515; - --vscode-textPreformat-background: rgba(0, 0, 0, 0.1); - --vscode-textBlockQuote-background: #f2f2f2; - --vscode-textBlockQuote-border: rgba(0, 122, 204, 0.5); - --vscode-textCodeBlock-background: rgba(220, 220, 220, 0.4); - --vscode-sash-hoverBorder: #0090f1; - --vscode-badge-background: #c4c4c4; - --vscode-badge-foreground: #333333; + --vscode-errorForeground: #f85149; + --vscode-descriptionForeground: #3b3b3b; + --vscode-icon-foreground: #3b3b3b; + --vscode-focusBorder: #005fb8; + --vscode-textLink-foreground: #005fb8; + --vscode-textLink-activeForeground: #005fb8; + --vscode-textSeparator-foreground: #21262d; + --vscode-textPreformat-foreground: #3b3b3b; + --vscode-textPreformat-background: rgba(0, 0, 0, 0.12); + --vscode-textBlockQuote-background: #f8f8f8; + --vscode-textBlockQuote-border: #e5e5e5; + --vscode-textCodeBlock-background: #f8f8f8; + --vscode-sash-hoverBorder: #005fb8; + --vscode-badge-background: #cccccc; + --vscode-badge-foreground: #3b3b3b; --vscode-scrollbar-shadow: #dddddd; --vscode-scrollbarSlider-background: rgba(100, 100, 100, 0.4); --vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7); --vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, 0.6); - --vscode-progressBar-background: #0e70c0; + --vscode-progressBar-background: #005fb8; --vscode-editor-background: #ffffff; - --vscode-editor-foreground: #000000; + --vscode-editor-foreground: #3b3b3b; --vscode-editorStickyScroll-background: #ffffff; --vscode-editorStickyScrollHover-background: #f0f0f0; --vscode-editorStickyScroll-shadow: #dddddd; - --vscode-editorWidget-background: #f3f3f3; - --vscode-editorWidget-foreground: #616161; + --vscode-editorWidget-background: #f8f8f8; + --vscode-editorWidget-foreground: #3b3b3b; --vscode-editorWidget-border: #c8c8c8; --vscode-editorError-foreground: #e51400; --vscode-editorWarning-foreground: #bf8803; @@ -738,16 +766,16 @@ html[data-theme='light'] { --vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, 0.33); --vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, 0.3); --vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, 0.15); - --vscode-editorHoverWidget-background: #f3f3f3; - --vscode-editorHoverWidget-foreground: #616161; + --vscode-editorHoverWidget-background: #f8f8f8; + --vscode-editorHoverWidget-foreground: #3b3b3b; --vscode-editorHoverWidget-border: #c8c8c8; - --vscode-editorHoverWidget-statusBarBackground: #e7e7e7; + --vscode-editorHoverWidget-statusBarBackground: #ececec; --vscode-editorInlayHint-foreground: #969696; - --vscode-editorInlayHint-background: rgba(196, 196, 196, 0.1); + --vscode-editorInlayHint-background: rgba(204, 204, 204, 0.1); --vscode-editorInlayHint-typeForeground: #969696; - --vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, 0.1); + --vscode-editorInlayHint-typeBackground: rgba(204, 204, 204, 0.1); --vscode-editorInlayHint-parameterForeground: #969696; - --vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, 0.1); + --vscode-editorInlayHint-parameterBackground: rgba(204, 204, 204, 0.1); --vscode-editorLightBulb-foreground: #ddb100; --vscode-editorLightBulbAutoFix-foreground: #007acc; --vscode-editorLightBulbAi-foreground: #ddb100; @@ -759,17 +787,17 @@ html[data-theme='light'] { --vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, 0.2); --vscode-diffEditor-diagonalFill: rgba(34, 34, 34, 0.2); --vscode-diffEditor-unchangedRegionBackground: #f8f8f8; - --vscode-diffEditor-unchangedRegionForeground: #616161; + --vscode-diffEditor-unchangedRegionForeground: #3b3b3b; --vscode-diffEditor-unchangedCodeBackground: rgba(184, 184, 184, 0.16); --vscode-widget-shadow: rgba(0, 0, 0, 0.16); - --vscode-widget-border: #d4d4d4; + --vscode-widget-border: #e5e5e5; --vscode-toolbar-hoverBackground: rgba(184, 184, 184, 0.31); --vscode-toolbar-activeBackground: rgba(166, 166, 166, 0.31); - --vscode-breadcrumb-foreground: rgba(97, 97, 97, 0.8); + --vscode-breadcrumb-foreground: rgba(59, 59, 59, 0.8); --vscode-breadcrumb-background: #ffffff; - --vscode-breadcrumb-focusForeground: #4e4e4e; - --vscode-breadcrumb-activeSelectionForeground: #4e4e4e; - --vscode-breadcrumbPicker-background: #f3f3f3; + --vscode-breadcrumb-focusForeground: #2f2f2f; + --vscode-breadcrumb-activeSelectionForeground: #2f2f2f; + --vscode-breadcrumbPicker-background: #f8f8f8; --vscode-merge-currentHeaderBackground: rgba(64, 200, 174, 0.5); --vscode-merge-currentContentBackground: rgba(64, 200, 174, 0.2); --vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, 0.5); @@ -785,10 +813,11 @@ html[data-theme='light'] { --vscode-problemsWarningIcon-foreground: #bf8803; --vscode-problemsInfoIcon-foreground: #1a85ff; --vscode-input-background: #ffffff; - --vscode-input-foreground: #616161; - --vscode-inputOption-activeBorder: #007acc; + --vscode-input-foreground: #3b3b3b; + --vscode-input-border: #cecece; + --vscode-inputOption-activeBorder: #005fb8; --vscode-inputOption-hoverBackground: rgba(184, 184, 184, 0.31); - --vscode-inputOption-activeBackground: rgba(0, 144, 241, 0.2); + --vscode-inputOption-activeBackground: #bed6ed; --vscode-inputOption-activeForeground: #000000; --vscode-input-placeholderForeground: #767676; --vscode-inputValidation-infoBackground: #d6ecf2; @@ -798,39 +827,41 @@ html[data-theme='light'] { --vscode-inputValidation-errorBackground: #f2dede; --vscode-inputValidation-errorBorder: #be1100; --vscode-dropdown-background: #ffffff; - --vscode-dropdown-foreground: #616161; + --vscode-dropdown-listBackground: #ffffff; + --vscode-dropdown-foreground: #3b3b3b; --vscode-dropdown-border: #cecece; --vscode-button-foreground: #ffffff; --vscode-button-separator: rgba(255, 255, 255, 0.4); - --vscode-button-background: #007acc; - --vscode-button-hoverBackground: #0062a3; - --vscode-button-secondaryForeground: #ffffff; - --vscode-button-secondaryBackground: #5f6a79; - --vscode-button-secondaryHoverBackground: #4c5561; - --vscode-checkbox-background: #ffffff; - --vscode-checkbox-selectBackground: #f3f3f3; - --vscode-checkbox-foreground: #616161; - --vscode-checkbox-border: #919191; - --vscode-checkbox-selectBorder: #424242; + --vscode-button-background: #005fb8; + --vscode-button-hoverBackground: #0258a8; + --vscode-button-border: rgba(0, 0, 0, 0.1); + --vscode-button-secondaryForeground: #3b3b3b; + --vscode-button-secondaryBackground: #e5e5e5; + --vscode-button-secondaryHoverBackground: #cccccc; + --vscode-checkbox-background: #f8f8f8; + --vscode-checkbox-selectBackground: #f8f8f8; + --vscode-checkbox-foreground: #3b3b3b; + --vscode-checkbox-border: #cecece; + --vscode-checkbox-selectBorder: #3b3b3b; --vscode-keybindingLabel-background: rgba(221, 221, 221, 0.4); - --vscode-keybindingLabel-foreground: #555555; + --vscode-keybindingLabel-foreground: #3b3b3b; --vscode-keybindingLabel-border: rgba(204, 204, 204, 0.4); --vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, 0.4); - --vscode-list-focusOutline: #0090f1; - --vscode-list-focusAndSelectionOutline: #90c2f9; - --vscode-list-activeSelectionBackground: #0060c0; - --vscode-list-activeSelectionForeground: #ffffff; - --vscode-list-activeSelectionIconForeground: #ffffff; + --vscode-list-focusOutline: #005fb8; + --vscode-list-focusAndSelectionOutline: #005fb8; + --vscode-list-activeSelectionBackground: #e8e8e8; + --vscode-list-activeSelectionForeground: #000000; + --vscode-list-activeSelectionIconForeground: #000000; --vscode-list-inactiveSelectionBackground: #e4e6f1; - --vscode-list-hoverBackground: #e8e8e8; + --vscode-list-hoverBackground: #f2f2f2; --vscode-list-dropBackground: #d6ebff; - --vscode-list-dropBetweenBackground: #424242; + --vscode-list-dropBetweenBackground: #3b3b3b; --vscode-list-highlightForeground: #0066bf; - --vscode-list-focusHighlightForeground: #bbe7ff; + --vscode-list-focusHighlightForeground: #0066bf; --vscode-list-invalidItemForeground: #b89500; --vscode-list-errorForeground: #b01011; --vscode-list-warningForeground: #855f00; - --vscode-listFilterWidget-background: #f3f3f3; + --vscode-listFilterWidget-background: #f8f8f8; --vscode-listFilterWidget-outline: rgba(0, 0, 0, 0); --vscode-listFilterWidget-noMatchesOutline: #be1100; --vscode-listFilterWidget-shadow: rgba(0, 0, 0, 0.16); @@ -839,12 +870,12 @@ html[data-theme='light'] { --vscode-tree-indentGuidesStroke: #a9a9a9; --vscode-tree-inactiveIndentGuidesStroke: rgba(169, 169, 169, 0.4); --vscode-tree-tableColumnsBorder: rgba(97, 97, 97, 0.13); - --vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, 0.04); - --vscode-menu-border: #d4d4d4; - --vscode-menu-foreground: #616161; + --vscode-tree-tableOddRowsBackground: rgba(59, 59, 59, 0.04); + --vscode-menu-border: #cecece; + --vscode-menu-foreground: #3b3b3b; --vscode-menu-background: #ffffff; --vscode-menu-selectionForeground: #ffffff; - --vscode-menu-selectionBackground: #0060c0; + --vscode-menu-selectionBackground: #005fb8; --vscode-menu-separatorBackground: #d4d4d4; --vscode-minimap-findMatchHighlight: #d18616; --vscode-minimap-selectionOccurrenceHighlight: #c9c9c9; @@ -856,58 +887,58 @@ html[data-theme='light'] { --vscode-minimapSlider-background: rgba(100, 100, 100, 0.2); --vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, 0.35); --vscode-minimapSlider-activeBackground: rgba(0, 0, 0, 0.3); - --vscode-charts-foreground: #616161; - --vscode-charts-lines: rgba(97, 97, 97, 0.5); + --vscode-charts-foreground: #3b3b3b; + --vscode-charts-lines: rgba(59, 59, 59, 0.5); --vscode-charts-red: #e51400; --vscode-charts-blue: #1a85ff; --vscode-charts-yellow: #bf8803; --vscode-charts-orange: #d18616; --vscode-charts-green: #388a34; --vscode-charts-purple: #652d90; - --vscode-quickInput-background: #f3f3f3; - --vscode-quickInput-foreground: #616161; + --vscode-quickInput-background: #f8f8f8; + --vscode-quickInput-foreground: #3b3b3b; --vscode-quickInputTitle-background: rgba(0, 0, 0, 0.06); - --vscode-pickerGroup-foreground: #0066bf; - --vscode-pickerGroup-border: #cccedb; - --vscode-quickInputList-focusForeground: #ffffff; - --vscode-quickInputList-focusIconForeground: #ffffff; - --vscode-quickInputList-focusBackground: #0060c0; - --vscode-search-resultsInfoForeground: #616161; + --vscode-pickerGroup-foreground: #8b949e; + --vscode-pickerGroup-border: #e5e5e5; + --vscode-quickInputList-focusForeground: #000000; + --vscode-quickInputList-focusIconForeground: #000000; + --vscode-quickInputList-focusBackground: #e8e8e8; + --vscode-search-resultsInfoForeground: #3b3b3b; --vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, 0.22); - --vscode-multiDiffEditor-headerBackground: #ececec; + --vscode-multiDiffEditor-headerBackground: #f8f8f8; --vscode-multiDiffEditor-border: #cccccc; - --vscode-symbolIcon-arrayForeground: #616161; - --vscode-symbolIcon-booleanForeground: #616161; + --vscode-symbolIcon-arrayForeground: #3b3b3b; + --vscode-symbolIcon-booleanForeground: #3b3b3b; --vscode-symbolIcon-classForeground: #d67e00; - --vscode-symbolIcon-colorForeground: #616161; - --vscode-symbolIcon-constantForeground: #616161; + --vscode-symbolIcon-colorForeground: #3b3b3b; + --vscode-symbolIcon-constantForeground: #3b3b3b; --vscode-symbolIcon-constructorForeground: #652d90; --vscode-symbolIcon-enumeratorForeground: #d67e00; --vscode-symbolIcon-enumeratorMemberForeground: #007acc; --vscode-symbolIcon-eventForeground: #d67e00; --vscode-symbolIcon-fieldForeground: #007acc; - --vscode-symbolIcon-fileForeground: #616161; - --vscode-symbolIcon-folderForeground: #616161; + --vscode-symbolIcon-fileForeground: #3b3b3b; + --vscode-symbolIcon-folderForeground: #3b3b3b; --vscode-symbolIcon-functionForeground: #652d90; --vscode-symbolIcon-interfaceForeground: #007acc; - --vscode-symbolIcon-keyForeground: #616161; - --vscode-symbolIcon-keywordForeground: #616161; + --vscode-symbolIcon-keyForeground: #3b3b3b; + --vscode-symbolIcon-keywordForeground: #3b3b3b; --vscode-symbolIcon-methodForeground: #652d90; - --vscode-symbolIcon-moduleForeground: #616161; - --vscode-symbolIcon-namespaceForeground: #616161; - --vscode-symbolIcon-nullForeground: #616161; - --vscode-symbolIcon-numberForeground: #616161; - --vscode-symbolIcon-objectForeground: #616161; - --vscode-symbolIcon-operatorForeground: #616161; - --vscode-symbolIcon-packageForeground: #616161; - --vscode-symbolIcon-propertyForeground: #616161; - --vscode-symbolIcon-referenceForeground: #616161; - --vscode-symbolIcon-snippetForeground: #616161; - --vscode-symbolIcon-stringForeground: #616161; - --vscode-symbolIcon-structForeground: #616161; - --vscode-symbolIcon-textForeground: #616161; - --vscode-symbolIcon-typeParameterForeground: #616161; - --vscode-symbolIcon-unitForeground: #616161; + --vscode-symbolIcon-moduleForeground: #3b3b3b; + --vscode-symbolIcon-namespaceForeground: #3b3b3b; + --vscode-symbolIcon-nullForeground: #3b3b3b; + --vscode-symbolIcon-numberForeground: #3b3b3b; + --vscode-symbolIcon-objectForeground: #3b3b3b; + --vscode-symbolIcon-operatorForeground: #3b3b3b; + --vscode-symbolIcon-packageForeground: #3b3b3b; + --vscode-symbolIcon-propertyForeground: #3b3b3b; + --vscode-symbolIcon-referenceForeground: #3b3b3b; + --vscode-symbolIcon-snippetForeground: #3b3b3b; + --vscode-symbolIcon-stringForeground: #3b3b3b; + --vscode-symbolIcon-structForeground: #3b3b3b; + --vscode-symbolIcon-textForeground: #3b3b3b; + --vscode-symbolIcon-typeParameterForeground: #3b3b3b; + --vscode-symbolIcon-unitForeground: #3b3b3b; --vscode-symbolIcon-variableForeground: #007acc; --vscode-actionBar-toggledBackground: #dddddd; --vscode-editorHoverWidget-highlightForeground: #0066bf; @@ -918,7 +949,7 @@ html[data-theme='light'] { --vscode-editorMultiCursor-primary\.foreground: #000000; --vscode-editorMultiCursor-secondary\.foreground: #000000; --vscode-editorWhitespace-foreground: rgba(51, 51, 51, 0.2); - --vscode-editorLineNumber-foreground: #237893; + --vscode-editorLineNumber-foreground: #6e7681; --vscode-editorIndentGuide-background: rgba(51, 51, 51, 0.2); --vscode-editorIndentGuide-activeBackground: rgba(51, 51, 51, 0.2); --vscode-editorIndentGuide-background1: #d3d3d3; @@ -934,12 +965,12 @@ html[data-theme='light'] { --vscode-editorIndentGuide-activeBackground5: rgba(0, 0, 0, 0); --vscode-editorIndentGuide-activeBackground6: rgba(0, 0, 0, 0); --vscode-editorActiveLineNumber-foreground: #0b216f; - --vscode-editorLineNumber-activeForeground: #0b216f; + --vscode-editorLineNumber-activeForeground: #171184; --vscode-editorRuler-foreground: #d3d3d3; --vscode-editorCodeLens-foreground: #919191; --vscode-editorBracketMatch-background: rgba(0, 100, 0, 0.1); --vscode-editorBracketMatch-border: #b9b9b9; - --vscode-editorOverviewRuler-border: rgba(127, 127, 127, 0.3); + --vscode-editorOverviewRuler-border: #e5e5e5; --vscode-editorGutter-background: #ffffff; --vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, 0.47); --vscode-editorGhostText-foreground: rgba(0, 0, 0, 0.47); @@ -972,7 +1003,7 @@ html[data-theme='light'] { --vscode-diffEditor-unchangedRegionShadow: rgba(115, 115, 115, 0.75); --vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0; --vscode-editor-foldBackground: rgba(173, 214, 255, 0.3); - --vscode-editorGutter-foldingControlForeground: #424242; + --vscode-editorGutter-foldingControlForeground: #3b3b3b; --vscode-editor-linkedEditingBackground: rgba(255, 0, 0, 0.3); --vscode-editor-wordHighlightBackground: rgba(87, 87, 87, 0.25); --vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, 0.25); @@ -984,7 +1015,7 @@ html[data-theme='light'] { --vscode-peekViewTitleLabel-foreground: #000000; --vscode-peekViewTitleDescription-foreground: #616161; --vscode-peekView-border: #1a85ff; - --vscode-peekViewResult-background: #f3f3f3; + --vscode-peekViewResult-background: #ffffff; --vscode-peekViewResult-lineForeground: #646465; --vscode-peekViewResult-fileForeground: #1e1e1e; --vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, 0.2); @@ -992,8 +1023,8 @@ html[data-theme='light'] { --vscode-peekViewEditor-background: #f2f8fc; --vscode-peekViewEditorGutter-background: #f2f8fc; --vscode-peekViewEditorStickyScroll-background: #f2f8fc; - --vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, 0.3); - --vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, 0.87); + --vscode-peekViewResult-matchHighlightBackground: rgba(187, 128, 9, 0.4); + --vscode-peekViewEditor-matchHighlightBackground: rgba(187, 128, 9, 0.4); --vscode-editorMarkerNavigationError-background: #e51400; --vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, 0.1); --vscode-editorMarkerNavigationWarning-background: #bf8803; @@ -1001,83 +1032,96 @@ html[data-theme='light'] { --vscode-editorMarkerNavigationInfo-background: #1a85ff; --vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, 0.1); --vscode-editorMarkerNavigation-background: #ffffff; - --vscode-editorSuggestWidget-background: #f3f3f3; + --vscode-editorSuggestWidget-background: #f8f8f8; --vscode-editorSuggestWidget-border: #c8c8c8; - --vscode-editorSuggestWidget-foreground: #000000; - --vscode-editorSuggestWidget-selectedForeground: #ffffff; - --vscode-editorSuggestWidget-selectedIconForeground: #ffffff; - --vscode-editorSuggestWidget-selectedBackground: #0060c0; + --vscode-editorSuggestWidget-foreground: #3b3b3b; + --vscode-editorSuggestWidget-selectedForeground: #000000; + --vscode-editorSuggestWidget-selectedIconForeground: #000000; + --vscode-editorSuggestWidget-selectedBackground: #e8e8e8; --vscode-editorSuggestWidget-highlightForeground: #0066bf; - --vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff; - --vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, 0.5); - --vscode-editorWatermark-foreground: rgba(0, 0, 0, 0.68); + --vscode-editorSuggestWidget-focusHighlightForeground: #0066bf; + --vscode-editorSuggestWidgetStatus-foreground: rgba(59, 59, 59, 0.5); + --vscode-editorWatermark-foreground: rgba(59, 59, 59, 0.68); --vscode-tab-activeBackground: #ffffff; --vscode-tab-unfocusedActiveBackground: #ffffff; - --vscode-tab-inactiveBackground: #ececec; - --vscode-tab-unfocusedInactiveBackground: #ececec; - --vscode-tab-activeForeground: #333333; - --vscode-tab-inactiveForeground: rgba(51, 51, 51, 0.7); - --vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, 0.7); - --vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, 0.35); - --vscode-tab-border: #f3f3f3; - --vscode-tab-lastPinnedBorder: rgba(97, 97, 97, 0.19); - --vscode-tab-dragAndDropBorder: #333333; + --vscode-tab-inactiveBackground: #f8f8f8; + --vscode-tab-unfocusedInactiveBackground: #f8f8f8; + --vscode-tab-activeForeground: #3b3b3b; + --vscode-tab-inactiveForeground: #868686; + --vscode-tab-unfocusedActiveForeground: rgba(59, 59, 59, 0.7); + --vscode-tab-unfocusedInactiveForeground: rgba(134, 134, 134, 0.5); + --vscode-tab-hoverBackground: #ffffff; + --vscode-tab-unfocusedHoverBackground: #f8f8f8; + --vscode-tab-border: #e5e5e5; + --vscode-tab-lastPinnedBorder: #d4d4d4; + --vscode-tab-activeBorder: #f8f8f8; + --vscode-tab-unfocusedActiveBorder: #f8f8f8; + --vscode-tab-activeBorderTop: #005fb8; + --vscode-tab-unfocusedActiveBorderTop: #e5e5e5; + --vscode-tab-selectedBorderTop: #68a3da; + --vscode-tab-selectedBackground: rgba(255, 255, 255, 0.65); + --vscode-tab-selectedForeground: rgba(51, 51, 51, 0.7); + --vscode-tab-dragAndDropBorder: #3b3b3b; --vscode-tab-activeModifiedBorder: #33aaee; --vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, 0.5); --vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, 0.7); --vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, 0.25); --vscode-editorPane-background: #ffffff; - --vscode-editorGroupHeader-tabsBackground: #f3f3f3; + --vscode-editorGroupHeader-tabsBackground: #f8f8f8; + --vscode-editorGroupHeader-tabsBorder: #e5e5e5; --vscode-editorGroupHeader-noTabsBackground: #ffffff; - --vscode-editorGroup-border: #e7e7e7; + --vscode-editorGroup-border: #e5e5e5; --vscode-editorGroup-dropBackground: rgba(38, 119, 203, 0.18); - --vscode-editorGroup-dropIntoPromptForeground: #616161; - --vscode-editorGroup-dropIntoPromptBackground: #f3f3f3; - --vscode-sideBySideEditor-horizontalBorder: #e7e7e7; - --vscode-sideBySideEditor-verticalBorder: #e7e7e7; - --vscode-panel-background: #ffffff; - --vscode-panel-border: rgba(128, 128, 128, 0.35); - --vscode-panelTitle-activeForeground: #424242; - --vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, 0.75); - --vscode-panelTitle-activeBorder: #424242; - --vscode-panelInput-border: #dddddd; - --vscode-panel-dropBorder: #424242; + --vscode-editorGroup-dropIntoPromptForeground: #3b3b3b; + --vscode-editorGroup-dropIntoPromptBackground: #f8f8f8; + --vscode-sideBySideEditor-horizontalBorder: #e5e5e5; + --vscode-sideBySideEditor-verticalBorder: #e5e5e5; + --vscode-panel-background: #f8f8f8; + --vscode-panel-border: #e5e5e5; + --vscode-panelTitle-activeForeground: #3b3b3b; + --vscode-panelTitle-inactiveForeground: #3b3b3b; + --vscode-panelTitle-activeBorder: #005fb8; + --vscode-panelInput-border: #e5e5e5; + --vscode-panel-dropBorder: #3b3b3b; --vscode-panelSection-dropBackground: rgba(38, 119, 203, 0.18); --vscode-panelSectionHeader-background: rgba(128, 128, 128, 0.2); - --vscode-panelSection-border: rgba(128, 128, 128, 0.35); - --vscode-panelStickyScroll-background: #ffffff; + --vscode-panelSection-border: #e5e5e5; + --vscode-panelStickyScroll-background: #f8f8f8; --vscode-panelStickyScroll-shadow: #dddddd; - --vscode-banner-background: #004386; - --vscode-banner-foreground: #ffffff; + --vscode-banner-background: #a2a2a2; + --vscode-banner-foreground: #000000; --vscode-banner-iconForeground: #1a85ff; - --vscode-statusBar-foreground: #ffffff; - --vscode-statusBar-noFolderForeground: #ffffff; - --vscode-statusBar-background: #007acc; - --vscode-statusBar-noFolderBackground: #68217a; - --vscode-statusBar-focusBorder: #ffffff; + --vscode-statusBar-foreground: #3b3b3b; + --vscode-statusBar-noFolderForeground: #3b3b3b; + --vscode-statusBar-background: #f8f8f8; + --vscode-statusBar-noFolderBackground: #f8f8f8; + --vscode-statusBar-border: #e5e5e5; + --vscode-statusBar-focusBorder: #005fb8; + --vscode-statusBar-noFolderBorder: #e5e5e5; --vscode-statusBarItem-activeBackground: rgba(255, 255, 255, 0.18); - --vscode-statusBarItem-focusBorder: #ffffff; + --vscode-statusBarItem-focusBorder: #005fb8; --vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, 0.12); - --vscode-statusBarItem-hoverForeground: #ffffff; + --vscode-statusBarItem-hoverForeground: #3b3b3b; --vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, 0.2); - --vscode-statusBarItem-prominentForeground: #ffffff; - --vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, 0.5); - --vscode-statusBarItem-prominentHoverForeground: #ffffff; + --vscode-statusBarItem-prominentForeground: #3b3b3b; + --vscode-statusBarItem-prominentBackground: rgba(110, 118, 129, 0.4); + --vscode-statusBarItem-prominentHoverForeground: #3b3b3b; --vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, 0.3); --vscode-statusBarItem-errorBackground: #c72e0f; --vscode-statusBarItem-errorForeground: #ffffff; - --vscode-statusBarItem-errorHoverForeground: #ffffff; + --vscode-statusBarItem-errorHoverForeground: #3b3b3b; --vscode-statusBarItem-errorHoverBackground: rgba(255, 255, 255, 0.12); --vscode-statusBarItem-warningBackground: #725102; --vscode-statusBarItem-warningForeground: #ffffff; - --vscode-statusBarItem-warningHoverForeground: #ffffff; + --vscode-statusBarItem-warningHoverForeground: #3b3b3b; --vscode-statusBarItem-warningHoverBackground: rgba(255, 255, 255, 0.12); - --vscode-activityBar-background: #2c2c2c; - --vscode-activityBar-foreground: #ffffff; - --vscode-activityBar-inactiveForeground: rgba(255, 255, 255, 0.4); - --vscode-activityBar-activeBorder: #ffffff; - --vscode-activityBar-dropBorder: #ffffff; - --vscode-activityBarBadge-background: #007acc; + --vscode-activityBar-background: #f8f8f8; + --vscode-activityBar-foreground: #1f1f1f; + --vscode-activityBar-inactiveForeground: #616161; + --vscode-activityBar-border: #e5e5e5; + --vscode-activityBar-activeBorder: #005fb8; + --vscode-activityBar-dropBorder: #1f1f1f; + --vscode-activityBarBadge-background: #005fb8; --vscode-activityBarBadge-foreground: #ffffff; --vscode-activityBarTop-foreground: #424242; --vscode-activityBarTop-activeBorder: #424242; @@ -1085,68 +1129,73 @@ html[data-theme='light'] { --vscode-activityBarTop-dropBorder: #424242; --vscode-profileBadge-background: #c4c4c4; --vscode-profileBadge-foreground: #333333; - --vscode-statusBarItem-remoteBackground: #16825d; + --vscode-statusBarItem-remoteBackground: #005fb8; --vscode-statusBarItem-remoteForeground: #ffffff; - --vscode-statusBarItem-remoteHoverForeground: #ffffff; + --vscode-statusBarItem-remoteHoverForeground: #3b3b3b; --vscode-statusBarItem-remoteHoverBackground: rgba(255, 255, 255, 0.12); --vscode-statusBarItem-offlineBackground: #6c1717; --vscode-statusBarItem-offlineForeground: #ffffff; - --vscode-statusBarItem-offlineHoverForeground: #ffffff; + --vscode-statusBarItem-offlineHoverForeground: #3b3b3b; --vscode-statusBarItem-offlineHoverBackground: rgba(255, 255, 255, 0.12); - --vscode-extensionBadge-remoteBackground: #007acc; + --vscode-extensionBadge-remoteBackground: #005fb8; --vscode-extensionBadge-remoteForeground: #ffffff; - --vscode-sideBar-background: #f3f3f3; - --vscode-sideBarTitle-background: #f3f3f3; - --vscode-sideBarTitle-foreground: #6f6f6f; + --vscode-sideBar-background: #f8f8f8; + --vscode-sideBar-foreground: #3b3b3b; + --vscode-sideBar-border: #e5e5e5; + --vscode-sideBarTitle-background: #f8f8f8; + --vscode-sideBarTitle-foreground: #3b3b3b; --vscode-sideBar-dropBackground: rgba(38, 119, 203, 0.18); - --vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0); - --vscode-sideBarSectionHeader-border: rgba(97, 97, 97, 0.19); - --vscode-sideBarActivityBarTop-border: rgba(97, 97, 97, 0.19); - --vscode-sideBarStickyScroll-background: #f3f3f3; + --vscode-sideBarSectionHeader-background: #f8f8f8; + --vscode-sideBarSectionHeader-foreground: #3b3b3b; + --vscode-sideBarSectionHeader-border: #e5e5e5; + --vscode-sideBarActivityBarTop-border: #e5e5e5; + --vscode-sideBarStickyScroll-background: #f8f8f8; --vscode-sideBarStickyScroll-shadow: #dddddd; - --vscode-titleBar-activeForeground: #333333; - --vscode-titleBar-inactiveForeground: rgba(51, 51, 51, 0.6); - --vscode-titleBar-activeBackground: #dddddd; - --vscode-titleBar-inactiveBackground: rgba(221, 221, 221, 0.6); - --vscode-menubar-selectionForeground: #333333; + --vscode-titleBar-activeForeground: #1e1e1e; + --vscode-titleBar-inactiveForeground: #8b949e; + --vscode-titleBar-activeBackground: #f8f8f8; + --vscode-titleBar-inactiveBackground: #f8f8f8; + --vscode-titleBar-border: #e5e5e5; + --vscode-menubar-selectionForeground: #1e1e1e; --vscode-menubar-selectionBackground: rgba(184, 184, 184, 0.31); - --vscode-commandCenter-foreground: #333333; - --vscode-commandCenter-activeForeground: #333333; - --vscode-commandCenter-inactiveForeground: rgba(51, 51, 51, 0.6); + --vscode-commandCenter-foreground: #1e1e1e; + --vscode-commandCenter-activeForeground: #1e1e1e; + --vscode-commandCenter-inactiveForeground: #8b949e; --vscode-commandCenter-background: rgba(0, 0, 0, 0.05); --vscode-commandCenter-activeBackground: rgba(0, 0, 0, 0.08); - --vscode-commandCenter-border: rgba(51, 51, 51, 0.2); - --vscode-commandCenter-activeBorder: rgba(51, 51, 51, 0.3); - --vscode-commandCenter-inactiveBorder: rgba(51, 51, 51, 0.15); - --vscode-notificationCenter-border: #d4d4d4; - --vscode-notificationToast-border: #d4d4d4; - --vscode-notifications-foreground: #616161; - --vscode-notifications-background: #f3f3f3; - --vscode-notificationLink-foreground: #006ab1; - --vscode-notificationCenterHeader-background: #e7e7e7; - --vscode-notifications-border: #e7e7e7; + --vscode-commandCenter-border: rgba(30, 30, 30, 0.2); + --vscode-commandCenter-activeBorder: rgba(30, 30, 30, 0.3); + --vscode-commandCenter-inactiveBorder: rgba(139, 148, 158, 0.25); + --vscode-notificationCenter-border: #e5e5e5; + --vscode-notificationToast-border: #e5e5e5; + --vscode-notifications-foreground: #3b3b3b; + --vscode-notifications-background: #ffffff; + --vscode-notificationLink-foreground: #005fb8; + --vscode-notificationCenterHeader-foreground: #3b3b3b; + --vscode-notificationCenterHeader-background: #ffffff; + --vscode-notifications-border: #e5e5e5; --vscode-notificationsErrorIcon-foreground: #e51400; --vscode-notificationsWarningIcon-foreground: #bf8803; --vscode-notificationsInfoIcon-foreground: #1a85ff; --vscode-chat-requestBorder: rgba(0, 0, 0, 0.1); --vscode-chat-requestBackground: rgba(255, 255, 255, 0.62); - --vscode-chat-slashCommandBackground: rgba(210, 236, 255, 0.6); + --vscode-chat-slashCommandBackground: #d2ecff; --vscode-chat-slashCommandForeground: #306ca2; --vscode-chat-avatarBackground: #f2f2f2; - --vscode-chat-avatarForeground: #616161; + --vscode-chat-avatarForeground: #3b3b3b; --vscode-simpleFindWidget-sashBorder: #c8c8c8; --vscode-commentsView-resolvedIcon: rgba(97, 97, 97, 0.5); - --vscode-commentsView-unresolvedIcon: #0090f1; + --vscode-commentsView-unresolvedIcon: #005fb8; --vscode-editorCommentsWidget-replyInputBackground: #f3f3f3; --vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, 0.5); - --vscode-editorCommentsWidget-unresolvedBorder: #0090f1; - --vscode-editorCommentsWidget-rangeBackground: rgba(0, 144, 241, 0.1); - --vscode-editorCommentsWidget-rangeActiveBackground: rgba(0, 144, 241, 0.1); + --vscode-editorCommentsWidget-unresolvedBorder: #005fb8; + --vscode-editorCommentsWidget-rangeBackground: rgba(0, 95, 184, 0.1); + --vscode-editorCommentsWidget-rangeActiveBackground: rgba(0, 95, 184, 0.1); --vscode-editorGutter-commentRangeForeground: #d5d8e9; --vscode-editorOverviewRuler-commentForeground: #d5d8e9; --vscode-editorOverviewRuler-commentUnresolvedForeground: #d5d8e9; - --vscode-editorGutter-commentGlyphForeground: #000000; - --vscode-editorGutter-commentUnresolvedGlyphForeground: #000000; + --vscode-editorGutter-commentGlyphForeground: #3b3b3b; + --vscode-editorGutter-commentUnresolvedGlyphForeground: #3b3b3b; --vscode-debugToolBar-background: #f3f3f3; --vscode-debugIcon-startForeground: #388a34; --vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, 0.45); @@ -1164,40 +1213,42 @@ html[data-theme='light'] { --vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, 0.28); --vscode-mergeEditor-conflict\.input1\.background: rgba(64, 200, 174, 0.2); --vscode-mergeEditor-conflict\.input2\.background: rgba(64, 166, 255, 0.2); - --vscode-settings-headerForeground: #444444; - --vscode-settings-settingsHeaderHoverForeground: rgba(68, 68, 68, 0.7); - --vscode-settings-modifiedItemIndicator: #66afe0; - --vscode-settings-headerBorder: rgba(128, 128, 128, 0.35); - --vscode-settings-sashBorder: rgba(128, 128, 128, 0.35); + --vscode-settings-headerForeground: #1f1f1f; + --vscode-settings-settingsHeaderHoverForeground: rgba(31, 31, 31, 0.7); + --vscode-settings-modifiedItemIndicator: rgba(187, 128, 9, 0.4); + --vscode-settings-headerBorder: #e5e5e5; + --vscode-settings-sashBorder: #e5e5e5; --vscode-settings-dropdownBackground: #ffffff; - --vscode-settings-dropdownForeground: #616161; + --vscode-settings-dropdownForeground: #3b3b3b; --vscode-settings-dropdownBorder: #cecece; --vscode-settings-dropdownListBorder: #c8c8c8; - --vscode-settings-checkboxBackground: #ffffff; - --vscode-settings-checkboxForeground: #616161; - --vscode-settings-checkboxBorder: #919191; + --vscode-settings-checkboxBackground: #f8f8f8; + --vscode-settings-checkboxForeground: #3b3b3b; + --vscode-settings-checkboxBorder: #cecece; --vscode-settings-textInputBackground: #ffffff; - --vscode-settings-textInputForeground: #616161; + --vscode-settings-textInputForeground: #3b3b3b; --vscode-settings-textInputBorder: #cecece; --vscode-settings-numberInputBackground: #ffffff; - --vscode-settings-numberInputForeground: #616161; + --vscode-settings-numberInputForeground: #3b3b3b; --vscode-settings-numberInputBorder: #cecece; - --vscode-settings-focusedRowBackground: rgba(232, 232, 232, 0.6); - --vscode-settings-rowHoverBackground: rgba(232, 232, 232, 0.3); - --vscode-settings-focusedRowBorder: #0090f1; - --vscode-terminal-foreground: #333333; + --vscode-settings-focusedRowBackground: rgba(242, 242, 242, 0.6); + --vscode-settings-rowHoverBackground: rgba(242, 242, 242, 0.3); + --vscode-settings-focusedRowBorder: #005fb8; + --vscode-terminal-foreground: #3b3b3b; + --vscode-terminalCursor-foreground: #005fb8; --vscode-terminal-selectionBackground: #add6ff; --vscode-terminal-inactiveSelectionBackground: #e5ebf1; --vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, 0.25); --vscode-terminalCommandDecoration-successBackground: #2090d3; --vscode-terminalCommandDecoration-errorBackground: #e51400; --vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8); - --vscode-terminal-border: rgba(128, 128, 128, 0.35); + --vscode-terminal-border: #e5e5e5; --vscode-terminal-findMatchBackground: #a8ac94; --vscode-terminal-hoverHighlightBackground: rgba(173, 214, 255, 0.07); --vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, 0.33); --vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49); --vscode-terminal-dropBackground: rgba(38, 119, 203, 0.18); + --vscode-terminal-tab\.activeBorder: #005fb8; --vscode-terminalStickyScrollHover-background: #f0f0f0; --vscode-testing-iconFailed: #f14c4c; --vscode-testing-iconErrored: #f14c4c; @@ -1217,11 +1268,11 @@ html[data-theme='light'] { --vscode-testing-uncoveredBackground: rgba(255, 0, 0, 0.2); --vscode-testing-uncoveredBorder: rgba(255, 0, 0, 0.15); --vscode-testing-uncoveredGutterBackground: rgba(255, 0, 0, 0.3); - --vscode-testing-coverCountBadgeBackground: #c4c4c4; - --vscode-testing-coverCountBadgeForeground: #333333; + --vscode-testing-coverCountBadgeBackground: #cccccc; + --vscode-testing-coverCountBadgeForeground: #3b3b3b; --vscode-testing-message\.error\.decorationForeground: #e51400; --vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, 0.2); - --vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, 0.5); + --vscode-testing-message\.info\.decorationForeground: rgba(59, 59, 59, 0.5); --vscode-testing-iconErrored\.retired: rgba(241, 76, 76, 0.7); --vscode-testing-iconFailed\.retired: rgba(241, 76, 76, 0.7); --vscode-testing-iconPassed\.retired: rgba(115, 201, 145, 0.7); @@ -1229,18 +1280,18 @@ html[data-theme='light'] { --vscode-testing-iconUnset\.retired: rgba(132, 132, 132, 0.7); --vscode-testing-iconSkipped\.retired: rgba(132, 132, 132, 0.7); --vscode-welcomePage-tileBackground: #f3f3f3; - --vscode-welcomePage-tileHoverBackground: #dbdbdb; + --vscode-welcomePage-tileHoverBackground: #dfdfdf; --vscode-welcomePage-tileBorder: rgba(0, 0, 0, 0.1); --vscode-welcomePage-progress\.background: #ffffff; - --vscode-welcomePage-progress\.foreground: #006ab1; + --vscode-welcomePage-progress\.foreground: #005fb8; --vscode-walkthrough-stepTitle\.foreground: #000000; --vscode-walkThrough-embeddedEditorBackground: #f4f4f4; - --vscode-inlineChat-background: #f3f3f3; + --vscode-inlineChat-background: #f8f8f8; --vscode-inlineChat-border: #c8c8c8; --vscode-inlineChat-shadow: rgba(0, 0, 0, 0.16); --vscode-inlineChat-regionHighlight: rgba(173, 214, 255, 0.15); --vscode-inlineChatInput-border: #c8c8c8; - --vscode-inlineChatInput-focusBorder: #0090f1; + --vscode-inlineChatInput-focusBorder: #005fb8; --vscode-inlineChatInput-placeholderForeground: #767676; --vscode-inlineChatInput-background: #ffffff; --vscode-inlineChatDiff-inserted: rgba(156, 204, 44, 0.13); @@ -1249,11 +1300,21 @@ html[data-theme='light'] { --vscode-editorOverviewRuler-inlineChatRemoved: rgba(255, 0, 0, 0.16); --vscode-debugExceptionWidget-border: #a31515; --vscode-debugExceptionWidget-background: #f1dfde; - --vscode-statusBar-debuggingBackground: #cc6633; - --vscode-statusBar-debuggingForeground: #ffffff; - --vscode-commandCenter-debuggingBackground: rgba(204, 102, 51, 0.26); - --vscode-keybindingTable-headerBackground: rgba(97, 97, 97, 0.04); - --vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, 0.04); + --vscode-statusBar-debuggingBackground: #fd716c; + --vscode-statusBar-debuggingForeground: #000000; + --vscode-statusBar-debuggingBorder: #e5e5e5; + --vscode-commandCenter-debuggingBackground: rgba(253, 113, 108, 0.26); + --vscode-editorGutter-modifiedBackground: #005fb8; + --vscode-editorGutter-addedBackground: #2ea043; + --vscode-editorGutter-deletedBackground: #f85149; + --vscode-minimapGutter-modifiedBackground: #005fb8; + --vscode-minimapGutter-addedBackground: #2ea043; + --vscode-minimapGutter-deletedBackground: #f85149; + --vscode-editorOverviewRuler-modifiedForeground: rgba(0, 95, 184, 0.6); + --vscode-editorOverviewRuler-addedForeground: rgba(46, 160, 67, 0.6); + --vscode-editorOverviewRuler-deletedForeground: rgba(248, 81, 73, 0.6); + --vscode-keybindingTable-headerBackground: rgba(59, 59, 59, 0.04); + --vscode-keybindingTable-rowsBackground: rgba(59, 59, 59, 0.04); --vscode-debugIcon-breakpointForeground: #e51400; --vscode-debugIcon-breakpointDisabledForeground: #848484; --vscode-debugIcon-breakpointUnverifiedForeground: #848484; @@ -1262,15 +1323,7 @@ html[data-theme='light'] { --vscode-editor-inlineValuesForeground: rgba(0, 0, 0, 0.5); --vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2); --vscode-ports-iconRunningProcessForeground: #369432; - --vscode-editorGutter-modifiedBackground: #2090d3; - --vscode-editorGutter-addedBackground: #48985d; - --vscode-editorGutter-deletedBackground: #e51400; - --vscode-minimapGutter-modifiedBackground: #2090d3; - --vscode-minimapGutter-addedBackground: #48985d; - --vscode-minimapGutter-deletedBackground: #e51400; - --vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, 0.6); - --vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, 0.6); - --vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, 0.6); + --vscode-profiles-sashBorder: #e5e5e5; --vscode-debugTokenExpression-name: #9b46b0; --vscode-debugTokenExpression-value: rgba(108, 108, 108, 0.8); --vscode-debugTokenExpression-string: #a31515; @@ -1279,14 +1332,14 @@ html[data-theme='light'] { --vscode-debugTokenExpression-error: #e51400; --vscode-debugView-exceptionLabelForeground: #ffffff; --vscode-debugView-exceptionLabelBackground: #a31515; - --vscode-debugView-stateLabelForeground: #616161; + --vscode-debugView-stateLabelForeground: #3b3b3b; --vscode-debugView-stateLabelBackground: rgba(136, 136, 136, 0.27); --vscode-debugView-valueChangedHighlight: #569cd6; --vscode-debugConsole-infoForeground: #1a85ff; --vscode-debugConsole-warningForeground: #bf8803; - --vscode-debugConsole-errorForeground: #a1260d; - --vscode-debugConsole-sourceForeground: #616161; - --vscode-debugConsoleInputIcon-foreground: #616161; + --vscode-debugConsole-errorForeground: #f85149; + --vscode-debugConsole-sourceForeground: #3b3b3b; + --vscode-debugConsoleInputIcon-foreground: #3b3b3b; --vscode-debugIcon-pauseForeground: #007acc; --vscode-debugIcon-stopForeground: #a1260d; --vscode-debugIcon-disconnectForeground: #a1260d; @@ -1298,37 +1351,37 @@ html[data-theme='light'] { --vscode-debugIcon-stepBackForeground: #007acc; --vscode-scm-historyItemAdditionsForeground: #587c0c; --vscode-scm-historyItemDeletionsForeground: #ad0707; - --vscode-scm-historyItemStatisticsBorder: rgba(97, 97, 97, 0.2); - --vscode-scm-historyItemSelectedStatisticsBorder: rgba(255, 255, 255, 0.2); - --vscode-extensionButton-background: #007acc; + --vscode-scm-historyItemStatisticsBorder: rgba(59, 59, 59, 0.2); + --vscode-scm-historyItemSelectedStatisticsBorder: rgba(0, 0, 0, 0.2); + --vscode-extensionButton-background: #005fb8; --vscode-extensionButton-foreground: #ffffff; - --vscode-extensionButton-hoverBackground: #0062a3; + --vscode-extensionButton-hoverBackground: #0258a8; --vscode-extensionButton-separator: rgba(255, 255, 255, 0.4); - --vscode-extensionButton-prominentBackground: #007acc; + --vscode-extensionButton-prominentBackground: #005fb8; --vscode-extensionButton-prominentForeground: #ffffff; - --vscode-extensionButton-prominentHoverBackground: #0062a3; + --vscode-extensionButton-prominentHoverBackground: #0258a8; --vscode-extensionIcon-starForeground: #df6100; - --vscode-extensionIcon-verifiedForeground: #006ab1; + --vscode-extensionIcon-verifiedForeground: #005fb8; --vscode-extensionIcon-preReleaseForeground: #1d9271; --vscode-extensionIcon-sponsorForeground: #b51e78; - --vscode-notebook-cellBorderColor: #e8e8e8; - --vscode-notebook-focusedEditorBorder: #0090f1; + --vscode-notebook-cellBorderColor: #e5e5e5; + --vscode-notebook-focusedEditorBorder: #005fb8; --vscode-notebookStatusSuccessIcon-foreground: #388a34; --vscode-notebookEditorOverviewRuler-runningCellForeground: #388a34; - --vscode-notebookStatusErrorIcon-foreground: #a1260d; - --vscode-notebookStatusRunningIcon-foreground: #616161; + --vscode-notebookStatusErrorIcon-foreground: #f85149; + --vscode-notebookStatusRunningIcon-foreground: #3b3b3b; --vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, 0.35); --vscode-notebook-selectedCellBackground: rgba(200, 221, 241, 0.31); - --vscode-notebook-selectedCellBorder: #e8e8e8; - --vscode-notebook-focusedCellBorder: #0090f1; - --vscode-notebook-inactiveFocusedCellBorder: #e8e8e8; + --vscode-notebook-selectedCellBorder: #e5e5e5; + --vscode-notebook-focusedCellBorder: #005fb8; + --vscode-notebook-inactiveFocusedCellBorder: #e5e5e5; --vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, 0.08); - --vscode-notebook-cellInsertionIndicator: #0090f1; + --vscode-notebook-cellInsertionIndicator: #005fb8; --vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, 0.4); --vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7); --vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, 0.6); --vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, 0.2); - --vscode-notebook-cellEditorBackground: #f3f3f3; + --vscode-notebook-cellEditorBackground: #f8f8f8; --vscode-notebook-editorBackground: #ffffff; --vscode-interactive-activeCodeBorder: #007acc; --vscode-interactive-inactiveCodeBorder: #e4e6f1; @@ -1361,7 +1414,7 @@ html[data-theme='light'] { --vscode-gitDecoration-submoduleResourceForeground: #1258a7; } -html[data-theme='high contrast'] { +html[data-theme='high contrast black'] { --vscode-font-family: "Segoe WPC", "Segoe UI", sans-serif; --vscode-font-weight: normal; --vscode-font-size: 13px; @@ -1658,6 +1711,8 @@ html[data-theme='high contrast'] { --vscode-tab-unfocusedInactiveForeground: #ffffff; --vscode-tab-border: #6fc3df; --vscode-tab-lastPinnedBorder: #6fc3df; + --vscode-tab-selectedBackground: #000000; + --vscode-tab-selectedForeground: #ffffff; --vscode-tab-dragAndDropBorder: #f38518; --vscode-tab-inactiveModifiedBorder: #ffffff; --vscode-tab-unfocusedActiveModifiedBorder: #ffffff; @@ -1705,6 +1760,7 @@ html[data-theme='high contrast'] { --vscode-activityBar-foreground: #ffffff; --vscode-activityBar-inactiveForeground: #ffffff; --vscode-activityBar-border: #6fc3df; + --vscode-activityBar-activeBorder: #6fc3df; --vscode-activityBarBadge-background: #000000; --vscode-activityBarBadge-foreground: #ffffff; --vscode-activityBarTop-foreground: #ffffff; @@ -1857,14 +1913,6 @@ html[data-theme='high contrast'] { --vscode-statusBar-debuggingForeground: #ffffff; --vscode-statusBar-debuggingBorder: #6fc3df; --vscode-commandCenter-debuggingBackground: rgba(186, 89, 44, 0.26); - --vscode-debugIcon-breakpointForeground: #e51400; - --vscode-debugIcon-breakpointDisabledForeground: #848484; - --vscode-debugIcon-breakpointUnverifiedForeground: #848484; - --vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00; - --vscode-debugIcon-breakpointStackframeForeground: #89d185; - --vscode-editor-inlineValuesForeground: rgba(255, 255, 255, 0.5); - --vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2); - --vscode-ports-iconRunningProcessForeground: #ffffff; --vscode-editorGutter-modifiedBackground: #1b81a8; --vscode-editorGutter-addedBackground: #487e02; --vscode-editorGutter-deletedBackground: #f48771; @@ -1874,6 +1922,15 @@ html[data-theme='high contrast'] { --vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, 0.6); --vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, 0.6); --vscode-editorOverviewRuler-deletedForeground: rgba(244, 135, 113, 0.6); + --vscode-debugIcon-breakpointForeground: #e51400; + --vscode-debugIcon-breakpointDisabledForeground: #848484; + --vscode-debugIcon-breakpointUnverifiedForeground: #848484; + --vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00; + --vscode-debugIcon-breakpointStackframeForeground: #89d185; + --vscode-editor-inlineValuesForeground: rgba(255, 255, 255, 0.5); + --vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2); + --vscode-ports-iconRunningProcessForeground: #ffffff; + --vscode-profiles-sashBorder: #6fc3df; --vscode-debugTokenExpression-name: #ffffff; --vscode-debugTokenExpression-value: #ffffff; --vscode-debugTokenExpression-string: #f48771; diff --git a/packages/control-property-editor/src/index.tsx b/packages/control-property-editor/src/index.tsx index 634aab1fb6..75a3868540 100644 --- a/packages/control-property-editor/src/index.tsx +++ b/packages/control-property-editor/src/index.tsx @@ -10,8 +10,6 @@ import { initI18n } from './i18n'; import './index.css'; import App from './App'; import { store } from './store'; -import type { ThemeName } from './components'; -import { setThemeOnDocument } from './components'; import { registerAppIcons } from './icons'; import { initializeLivereload, setProjectScenario } from './slice'; @@ -41,9 +39,6 @@ export function start(options: StartOptions): void { registerAppIcons(); initIcons(); - const theme = localStorage.getItem('theme') ?? 'dark'; - setThemeOnDocument(theme as ThemeName); - store.dispatch(setProjectScenario(scenario)); store.dispatch(initializeLivereload({ port: options.livereloadPort, url: options.livereloadUrl })); diff --git a/packages/control-property-editor/src/use-theme.ts b/packages/control-property-editor/src/use-theme.ts new file mode 100644 index 0000000000..ffe1b9df8d --- /dev/null +++ b/packages/control-property-editor/src/use-theme.ts @@ -0,0 +1,19 @@ +import type React from 'react'; +import { useEffect } from 'react'; +import { useLocalStorage } from './use-local-storage'; + +export type ThemeName = 'dark modern' | 'light modern' | 'high contrast black'; +/** + * React hook that lets you read and update applications theme. + * + * @returns [theme, setTheme] [T, React.Dispatch] + */ +export function useTheme(): [ThemeName, React.Dispatch] { + const [theme, setTheme] = useLocalStorage('theme', 'dark modern'); + + useEffect(() => { + document.getElementsByTagName('HTML')[0].setAttribute('data-theme', theme); + }, [theme]); + + return [theme, setTheme]; +} diff --git a/packages/control-property-editor/test/unit/toolbar/ThemeSelector.test.tsx b/packages/control-property-editor/test/unit/toolbar/ThemeSelector.test.tsx index 7a27a903f1..94da98e599 100644 --- a/packages/control-property-editor/test/unit/toolbar/ThemeSelector.test.tsx +++ b/packages/control-property-editor/test/unit/toolbar/ThemeSelector.test.tsx @@ -32,12 +32,12 @@ test('renders theme selector callout', () => { }); test('check selected theme', () => { - localStorage.setItem('theme', 'light'); + localStorage.setItem('com.sap.ux.control-property-editor.theme', '"light modern"'); render(); screen.getByRole('button').click(); const themeCalloutContent = screen.getAllByRole('button', { pressed: true }); const pressedButton = themeCalloutContent.find((button) => button.getAttribute('aria-pressed') === 'true'); - expect(pressedButton?.getAttribute('id')).toStrictEqual('theme-light-rect'); + expect(pressedButton?.getAttribute('id')).toStrictEqual('theme-light-modern-rect'); }); test('change theme to light', () => { @@ -46,12 +46,12 @@ test('change theme to light', () => { screen.getByTitle('Light').click(); const themeCalloutContent = screen.getAllByRole('button', { pressed: true }); const pressedButton = themeCalloutContent.find((button) => button.getAttribute('aria-pressed') === 'true'); - expect(pressedButton?.getAttribute('id')).toStrictEqual('theme-light-rect'); - expect(localStorage.getItem('theme')).toStrictEqual('light'); + expect(pressedButton?.getAttribute('id')).toStrictEqual('theme-light-modern-rect'); + expect(localStorage.getItem('com.sap.ux.control-property-editor.theme')).toStrictEqual('"light modern"'); }); test('change theme to light and navigate via keyboard for dark to have focus', async () => { - localStorage.setItem('theme', 'light'); + localStorage.setItem('com.sap.ux.control-property-editor.theme', '"light modern"'); // Use 'isVisible' property to make virtual nodes visible - 'isVisible' is used by fluent for testing purposes Object.defineProperty(HTMLElement.prototype, 'isVisible', { configurable: true, @@ -75,7 +75,7 @@ test('change theme to light and navigate via keyboard for dark to have focus', a const darkButton = screen.getByTitle('Dark'); expect(document.activeElement).toEqual(darkButton); // select focused theme - expect(localStorage.getItem('theme')).toStrictEqual('light'); + expect(localStorage.getItem('com.sap.ux.control-property-editor.theme')).toStrictEqual('"light modern"'); triggerKeyDown('Enter', 13); - expect(localStorage.getItem('theme')).toStrictEqual('dark'); + expect(localStorage.getItem('com.sap.ux.control-property-editor.theme')).toStrictEqual('"dark modern"'); }); From 28ec5d2f73c3be6f90e3aa80a9945c47164949eb Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 16 Sep 2024 10:06:52 +0000 Subject: [PATCH 002/122] chore: apply latest changesets --- .changeset/fast-nails-live.md | 5 ----- packages/control-property-editor/CHANGELOG.md | 6 ++++++ packages/control-property-editor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/fast-nails-live.md diff --git a/.changeset/fast-nails-live.md b/.changeset/fast-nails-live.md deleted file mode 100644 index 956aefcf11..0000000000 --- a/.changeset/fast-nails-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/control-property-editor': patch ---- - -updated color variables for themes diff --git a/packages/control-property-editor/CHANGELOG.md b/packages/control-property-editor/CHANGELOG.md index 956557167b..052af3f14f 100644 --- a/packages/control-property-editor/CHANGELOG.md +++ b/packages/control-property-editor/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/control-property-editor +## 0.5.2 + +### Patch Changes + +- cdabb95: updated color variables for themes + ## 0.5.1 ### Patch Changes diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index 82015d4158..98d7860dca 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -3,7 +3,7 @@ "displayName": "Control Property Editor", "description": "Control Property Editor", "license": "Apache-2.0", - "version": "0.5.1", + "version": "0.5.2", "main": "dist/app.js", "repository": { "type": "git", From 09f91c3484f679e984729db6951d364ae93507bf Mon Sep 17 00:00:00 2001 From: Davis Voicescuks Date: Mon, 16 Sep 2024 19:18:18 +0300 Subject: [PATCH 003/122] fix(cpe): change fragment index (#2363) --- .changeset/silly-pans-complain.md | 6 ++++++ .../src/adp/ui/AddFragment.fragment.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/silly-pans-complain.md diff --git a/.changeset/silly-pans-complain.md b/.changeset/silly-pans-complain.md new file mode 100644 index 0000000000..619c277637 --- /dev/null +++ b/.changeset/silly-pans-complain.md @@ -0,0 +1,6 @@ +--- +'@sap-ux-private/preview-middleware-client': patch +'@sap-ux/preview-middleware': patch +--- + +Fix changing index in Add Fragment dialog diff --git a/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml b/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml index 5f36c7dff0..df508b867a 100644 --- a/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml +++ b/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml @@ -28,7 +28,7 @@ ); + const input = screen.getByRole('combobox'); + expect(input).toBeDefined(); + expect(onChangeFn).toHaveBeenCalledWith('select', 111); + }); }); From 10e100cef48a36f0d77100d075055037bfe4cd67 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 18 Sep 2024 17:27:54 +0000 Subject: [PATCH 022/122] chore: apply latest changesets --- .changeset/sour-singers-explode.md | 6 ------ examples/prompting-ui/CHANGELOG.md | 7 +++++++ examples/prompting-ui/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/sour-singers-explode.md diff --git a/.changeset/sour-singers-explode.md b/.changeset/sour-singers-explode.md deleted file mode 100644 index 21e1219869..0000000000 --- a/.changeset/sour-singers-explode.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@sap-ux/ui-prompting': patch ---- - -- List/dropdown question - automatically select the option when only one item is available in a dropdown list. -- Updated README.md to remove the mention of `ui-components`. diff --git a/examples/prompting-ui/CHANGELOG.md b/examples/prompting-ui/CHANGELOG.md index 40011731cb..f8cd562ba7 100644 --- a/examples/prompting-ui/CHANGELOG.md +++ b/examples/prompting-ui/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fe-fpm-writer-ui +## 0.1.1 + +### Patch Changes + +- Updated dependencies [3174ebc] + - @sap-ux/ui-prompting@0.1.10 + ## 0.1.0 ### Minor Changes diff --git a/examples/prompting-ui/package.json b/examples/prompting-ui/package.json index 296c36070e..8eb10ea093 100644 --- a/examples/prompting-ui/package.json +++ b/examples/prompting-ui/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/prompting-ui", - "version": "0.1.0", + "version": "0.1.1", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index 49414951dd..2bbbf8bf26 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.1.10 + +### Patch Changes + +- 3174ebc: - List/dropdown question - automatically select the option when only one item is available in a dropdown list. + - Updated README.md to remove the mention of `ui-components`. + ## 0.1.9 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index 4e774ec5c5..f82822a635 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.1.9", + "version": "0.1.10", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From 7b60a4ca20ade5281ab4e74c7707b369bb3a1088 Mon Sep 17 00:00:00 2001 From: Cian Morrin <99677697+cianmSAP@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:55:53 +0100 Subject: [PATCH 023/122] fix(abap-delploy-config): verify destination input (#2387) --- .changeset/neat-poems-boil.md | 5 +++++ .../abap-deploy-config-inquirer/src/prompts/validators.ts | 2 +- .../test/prompts/validators.test.ts | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/neat-poems-boil.md diff --git a/.changeset/neat-poems-boil.md b/.changeset/neat-poems-boil.md new file mode 100644 index 0000000000..68dc6f20e1 --- /dev/null +++ b/.changeset/neat-poems-boil.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/abap-deploy-config-inquirer': patch +--- + +update destination validator diff --git a/packages/abap-deploy-config-inquirer/src/prompts/validators.ts b/packages/abap-deploy-config-inquirer/src/prompts/validators.ts index 7cf58e31d7..1a5b8a2cc6 100644 --- a/packages/abap-deploy-config-inquirer/src/prompts/validators.ts +++ b/packages/abap-deploy-config-inquirer/src/prompts/validators.ts @@ -36,7 +36,7 @@ import { export function validateDestinationQuestion(destination: string, destinations?: Destinations): boolean { PromptState.resetAbapDeployConfig(); updateDestinationPromptState(destination, destinations); - return true; + return !!destination?.trim(); } /** diff --git a/packages/abap-deploy-config-inquirer/test/prompts/validators.test.ts b/packages/abap-deploy-config-inquirer/test/prompts/validators.test.ts index 43fa929b57..8d2435c91b 100644 --- a/packages/abap-deploy-config-inquirer/test/prompts/validators.test.ts +++ b/packages/abap-deploy-config-inquirer/test/prompts/validators.test.ts @@ -45,6 +45,13 @@ describe('Test validators', () => { expect(PromptState.abapDeployConfig.url).toBe('https://mock.url.dest2.com'); expect(result).toBe(true); }); + + it('should return false for invalid destination', async () => { + const result = validateDestinationQuestion('', mockDestinations); + expect(PromptState.abapDeployConfig.destination).toBe(undefined); + expect(PromptState.abapDeployConfig.url).toBe(undefined); + expect(result).toBe(false); + }); }); describe('validateTargetSystem', () => { From 5212bd88aa324377f94a24d40b8d26c98a146c77 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 18 Sep 2024 18:06:57 +0000 Subject: [PATCH 024/122] chore: apply latest changesets --- .changeset/neat-poems-boil.md | 5 ----- packages/abap-deploy-config-inquirer/CHANGELOG.md | 6 ++++++ packages/abap-deploy-config-inquirer/package.json | 2 +- packages/create/CHANGELOG.md | 7 +++++++ packages/create/package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/neat-poems-boil.md diff --git a/.changeset/neat-poems-boil.md b/.changeset/neat-poems-boil.md deleted file mode 100644 index 68dc6f20e1..0000000000 --- a/.changeset/neat-poems-boil.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/abap-deploy-config-inquirer': patch ---- - -update destination validator diff --git a/packages/abap-deploy-config-inquirer/CHANGELOG.md b/packages/abap-deploy-config-inquirer/CHANGELOG.md index aa43eac5fd..da075ff4fd 100644 --- a/packages/abap-deploy-config-inquirer/CHANGELOG.md +++ b/packages/abap-deploy-config-inquirer/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/abap-deploy-config-inquirer +## 0.0.19 + +### Patch Changes + +- 7b60a4c: update destination validator + ## 0.0.18 ### Patch Changes diff --git a/packages/abap-deploy-config-inquirer/package.json b/packages/abap-deploy-config-inquirer/package.json index 972100e070..2bd717ec4d 100644 --- a/packages/abap-deploy-config-inquirer/package.json +++ b/packages/abap-deploy-config-inquirer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-inquirer" }, - "version": "0.0.18", + "version": "0.0.19", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index 10d6b5c16e..71788af300 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/create +## 0.8.19 + +### Patch Changes + +- Updated dependencies [7b60a4c] + - @sap-ux/abap-deploy-config-inquirer@0.0.19 + ## 0.8.18 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index 4191623b43..39a428e0ae 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/create", "description": "SAP Fiori tools module to add or remove features", - "version": "0.8.18", + "version": "0.8.19", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", From 04b3e6cbb84db9ff7f38beeaf0ea947a45b193a9 Mon Sep 17 00:00:00 2001 From: kitzkan Date: Thu, 19 Sep 2024 17:05:43 +0100 Subject: [PATCH 025/122] feat: app info file handling logic to new module @sap-ux/fiori-tools-settings (#2379) * Added app info file handling logic to .fioritools folder * adding js docs * tests * add to sonar properties * add to sonar properties * pnpm lock * Update package.json to start from version 0.0.0 * add fs commit to delete appInfo file --------- Co-authored-by: Austin Devine --- .changeset/brown-candles-push.md | 5 + packages/fiori-tools-settings/.eslintignore | 2 + packages/fiori-tools-settings/.eslintrc.js | 7 + packages/fiori-tools-settings/LICENSE | 201 ++++++++++++++++++ packages/fiori-tools-settings/README.md | 10 + packages/fiori-tools-settings/jest.config.js | 2 + packages/fiori-tools-settings/package.json | 41 ++++ .../src/applicationInfoHandler.ts | 108 ++++++++++ packages/fiori-tools-settings/src/index.ts | 1 + .../test/applicationInfoHandler.test.ts | 65 ++++++ .../fiori-tools-settings/tsconfig.eslint.json | 4 + packages/fiori-tools-settings/tsconfig.json | 11 + pnpm-lock.yaml | 29 ++- sonar-project.properties | 2 + tsconfig.json | 3 + 15 files changed, 485 insertions(+), 6 deletions(-) create mode 100644 .changeset/brown-candles-push.md create mode 100644 packages/fiori-tools-settings/.eslintignore create mode 100644 packages/fiori-tools-settings/.eslintrc.js create mode 100644 packages/fiori-tools-settings/LICENSE create mode 100644 packages/fiori-tools-settings/README.md create mode 100644 packages/fiori-tools-settings/jest.config.js create mode 100644 packages/fiori-tools-settings/package.json create mode 100644 packages/fiori-tools-settings/src/applicationInfoHandler.ts create mode 100644 packages/fiori-tools-settings/src/index.ts create mode 100644 packages/fiori-tools-settings/test/applicationInfoHandler.test.ts create mode 100644 packages/fiori-tools-settings/tsconfig.eslint.json create mode 100644 packages/fiori-tools-settings/tsconfig.json diff --git a/.changeset/brown-candles-push.md b/.changeset/brown-candles-push.md new file mode 100644 index 0000000000..3780a9be93 --- /dev/null +++ b/.changeset/brown-candles-push.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/fiori-tools-settings': minor +--- + +Added app info file handling logic to .fioritools folder diff --git a/packages/fiori-tools-settings/.eslintignore b/packages/fiori-tools-settings/.eslintignore new file mode 100644 index 0000000000..59f25a165b --- /dev/null +++ b/packages/fiori-tools-settings/.eslintignore @@ -0,0 +1,2 @@ +/test/test-output/ +dist diff --git a/packages/fiori-tools-settings/.eslintrc.js b/packages/fiori-tools-settings/.eslintrc.js new file mode 100644 index 0000000000..b717f83ae9 --- /dev/null +++ b/packages/fiori-tools-settings/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['../../.eslintrc'], + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigRootDir: __dirname + } +}; diff --git a/packages/fiori-tools-settings/LICENSE b/packages/fiori-tools-settings/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/packages/fiori-tools-settings/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/fiori-tools-settings/README.md b/packages/fiori-tools-settings/README.md new file mode 100644 index 0000000000..3bdfecf5fa --- /dev/null +++ b/packages/fiori-tools-settings/README.md @@ -0,0 +1,10 @@ +# @sap-ux/fiori-tools-settings + +Package provides utilities to manage and store configuration data related to Fiori tools projects. It writes essential settings to a hidden .fioritools folder within the project workspace. + +## License + +Read [License](./LICENSE). + +## Keywords +SAP diff --git a/packages/fiori-tools-settings/jest.config.js b/packages/fiori-tools-settings/jest.config.js new file mode 100644 index 0000000000..9e9be597ec --- /dev/null +++ b/packages/fiori-tools-settings/jest.config.js @@ -0,0 +1,2 @@ +const config = require('../../jest.base'); +module.exports = config; diff --git a/packages/fiori-tools-settings/package.json b/packages/fiori-tools-settings/package.json new file mode 100644 index 0000000000..1d959936d7 --- /dev/null +++ b/packages/fiori-tools-settings/package.json @@ -0,0 +1,41 @@ +{ + "name": "@sap-ux/fiori-tools-settings", + "description": "Utilities for managing and persisting Fiori tools configuration settings in the hidden .fioritools folder.", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/SAP/open-ux-tools.git", + "directory": "packages/fiori-tools-settings" + }, + "license": "Apache-2.0", + "main": "dist/index.js", + "scripts": { + "build": "tsc --build", + "clean": "rimraf --glob dist test/test-output coverage *.tsbuildinfo", + "watch": "tsc --watch", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "test": "jest --ci --forceExit --detectOpenHandles --colors --passWithNoTests --silent", + "test-u": "jest --ci --forceExit --detectOpenHandles --colors -u", + "link": "pnpm link --global", + "unlink": "pnpm unlink --global" + }, + "files": [ + "LICENSE", + "dist", + "templates", + "!dist/*.map", + "!dist/**/*.map" + ], + "dependencies": { + "mem-fs": "2.1.0", + "mem-fs-editor": "9.4.0" + }, + "devDependencies": { + "@types/mem-fs-editor": "7.0.1", + "@types/mem-fs": "1.1.2" + }, + "engines": { + "node": ">=18.x" + } +} diff --git a/packages/fiori-tools-settings/src/applicationInfoHandler.ts b/packages/fiori-tools-settings/src/applicationInfoHandler.ts new file mode 100644 index 0000000000..87bbe129d8 --- /dev/null +++ b/packages/fiori-tools-settings/src/applicationInfoHandler.ts @@ -0,0 +1,108 @@ +import { homedir } from 'os'; +import { create as createStorage } from 'mem-fs'; +import { create } from 'mem-fs-editor'; +import type { Editor } from 'mem-fs-editor'; +import { join } from 'path'; + +export const appInfoFilePath = join(homedir(), '.fioritools', 'appInfo.json'); +export const defaultAppInfoContents = { + latestGeneratedFiles: [] +}; + +interface AppInfoSettings { + latestGeneratedFiles: string[]; +} + +/** + * Returns a mem-fs editor instance. If an instance is not provided, a new one is created. + * + * @param {Editor} [fs] - An optional mem-fs editor instance. + * @returns {Editor} - The mem-fs editor instance. + */ +function getFsInstance(fs?: Editor): Editor { + return fs ?? create(createStorage()); +} + +/** + * Reads and parses a JSON file. + * If the file exists, this function reads its content, parses the JSON, and returns the resulting object. + * If the file does not exist, it returns the default application information settings. + * + * @param {string} filePath - The path to the JSON file. + * @param {Editor} fs - The mem-fs editor instance used for file system operations. + * @returns {AppInfoSettings} - The parsed JSON object, or the default settings if the file does not exist. + */ +function readJSONFile(filePath: string, fs: Editor): AppInfoSettings { + return fs.exists(filePath) ? JSON.parse(fs.read(filePath)) : defaultAppInfoContents; +} + +/** + * Adds a new file path to the `latestGeneratedFiles` array in the `appInfo.json` file. + * If the file does not exist, it creates it. This function ensures that the provided file path is included + * in the list of generated files for future reference. + * + * @param {string} path - The file path to add to the `latestGeneratedFiles` array. + * @param {Editor} [fs] - The optional mem-fs editor instance. If not provided, a new instance is created. + */ +export function writeApplicationInfoSettings(path: string, fs?: Editor) { + fs = getFsInstance(fs); + const appInfoContents: AppInfoSettings = readJSONFile(appInfoFilePath, fs); + appInfoContents.latestGeneratedFiles.push(path); + fs.write(appInfoFilePath, JSON.stringify(appInfoContents, null, 2)); + fs.commit((err) => { + console.log('Error in writting to AppInfo.json file', err); + }); +} + +/** + * Deletes the `appInfo.json` file if it exists. + * This function checks if the file exists and attempts to delete it. If an error occurs during deletion, + * it throws a new error with a descriptive message. + * + * @param {Editor} [fs] - The optional mem-fs editor instance. If not provided, a new instance is created. + * @throws {Error} Throws an error if there is a problem deleting the file. + */ +export function deleteAppInfoSettings(fs?: Editor) { + fs = getFsInstance(fs); + if (fs.exists(appInfoFilePath)) { + try { + fs.delete(appInfoFilePath); + fs.commit((err) => { + console.log('Failed to commit the deletion of the AppInfo.json file: ', err); + }); + } catch (err) { + throw new Error(`Error deleting appInfo.json file: ${err}`); + } + } +} + +/** + * Loads the file path from the `latestGeneratedFiles` array in the `appInfo.json` file, + * removes it from the array, updates the file, and executes a VS Code command to load + * the application info page for the generated project. + * + * This function ensures that a VS Code command is executed with the file path of the most recently + * generated file. If no file paths are available or if `executeCommand` is not provided, the function + * will skip the command execution. After processing, the `appInfo.json` file is deleted. + * + * @param {Function} [executeCommand] - An optional callback function to execute a VS Code command. + * The function will be called with the file path from the `latestGeneratedFiles` array. + * If not provided, the command execution step will be skipped. + * @param {Editor} [fs] - The optional mem-fs editor instance. If not provided, a new instance is created. + * @example + * loadApplicationInfoFromSettings(filePath => { + * // Perform VS Code command with the file path + * vscode.commands.executeCommand('fake.extension.loadInfo', filePath); + * }); + */ +export function loadApplicationInfoFromSettings(executeCommand?: (filePath: string) => void, fs?: Editor): void { + fs = getFsInstance(fs); + const appInfoContents: AppInfoSettings = readJSONFile(appInfoFilePath, fs); + if (appInfoContents.latestGeneratedFiles.length > 0) { + const filePath = appInfoContents.latestGeneratedFiles.shift(); + if (executeCommand && filePath) { + executeCommand(filePath); + } + deleteAppInfoSettings(fs); + } +} diff --git a/packages/fiori-tools-settings/src/index.ts b/packages/fiori-tools-settings/src/index.ts new file mode 100644 index 0000000000..4bd33e1011 --- /dev/null +++ b/packages/fiori-tools-settings/src/index.ts @@ -0,0 +1 @@ +export * from './applicationInfoHandler'; diff --git a/packages/fiori-tools-settings/test/applicationInfoHandler.test.ts b/packages/fiori-tools-settings/test/applicationInfoHandler.test.ts new file mode 100644 index 0000000000..dca505cbab --- /dev/null +++ b/packages/fiori-tools-settings/test/applicationInfoHandler.test.ts @@ -0,0 +1,65 @@ +import { create as createStorage } from 'mem-fs'; +import { create } from 'mem-fs-editor'; +import type { Editor } from 'mem-fs-editor'; +import { + writeApplicationInfoSettings, + deleteAppInfoSettings, + loadApplicationInfoFromSettings, + appInfoFilePath, + defaultAppInfoContents +} from '../src'; + +describe('Application Info Settings', () => { + let fs: Editor; + + beforeEach(() => { + fs = create(createStorage()); + }); + + afterEach(() => { + deleteAppInfoSettings(fs); + }); + + it('writeApplicationInfoSettings should add a file path to appInfo.json', () => { + const testPath = 'test-file-path'; + writeApplicationInfoSettings(testPath, fs); + const appInfoContents = JSON.parse(fs.read(appInfoFilePath) || '{}'); + expect(appInfoContents.latestGeneratedFiles).toContain(testPath); + }); + + it('writeApplicationInfoSettings should add a file path to appInfo.json when mem-fs editor not provided', () => { + const testPath = 'test-file-path'; + writeApplicationInfoSettings(testPath); + const executeCommand = jest.fn(); + loadApplicationInfoFromSettings(executeCommand); + expect(executeCommand).toHaveBeenCalledWith(testPath); + }); + + it('deleteAppInfoSettings should delete the appInfo.json file if it exists', () => { + fs.write(appInfoFilePath, JSON.stringify(defaultAppInfoContents)); + deleteAppInfoSettings(fs); + expect(fs.exists(appInfoFilePath)).toBe(false); + }); + + it('loadApplicationInfoFromSettings should execute command and delete the file', () => { + const testPath = 'test-file-path'; + fs.write(appInfoFilePath, JSON.stringify({ latestGeneratedFiles: [testPath] })); + const executeCommand = jest.fn(); + loadApplicationInfoFromSettings(executeCommand, fs); + expect(executeCommand).toHaveBeenCalledWith(testPath); + expect(fs.exists(appInfoFilePath)).toBe(false); + }); + + it('should throw an error if fs.delete fails', () => { + // Create a mock file system that throws an error when delete is called + const errorFs = create(createStorage()); + errorFs.write(appInfoFilePath, JSON.stringify(defaultAppInfoContents)); + // Override the delete method to throw an error + errorFs.delete = jest.fn(() => { + throw new Error('Mock delete error'); + }); + expect(() => deleteAppInfoSettings(errorFs)).toThrow( + 'Error deleting appInfo.json file: Error: Mock delete error' + ); + }); +}); diff --git a/packages/fiori-tools-settings/tsconfig.eslint.json b/packages/fiori-tools-settings/tsconfig.eslint.json new file mode 100644 index 0000000000..d5f1aa3474 --- /dev/null +++ b/packages/fiori-tools-settings/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["src", "test", ".eslintrc.js"] +} diff --git a/packages/fiori-tools-settings/tsconfig.json b/packages/fiori-tools-settings/tsconfig.json new file mode 100644 index 0000000000..52fe8f60c3 --- /dev/null +++ b/packages/fiori-tools-settings/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "include": [ + "src", + "src/**/*.json" ], + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + "references": [] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3031e554ae..919978dd54 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1519,6 +1519,22 @@ importers: specifier: 7.0.1 version: 7.0.1 + packages/fiori-tools-settings: + dependencies: + mem-fs: + specifier: 2.1.0 + version: 2.1.0 + mem-fs-editor: + specifier: 9.4.0 + version: 9.4.0(mem-fs@2.1.0) + devDependencies: + '@types/mem-fs': + specifier: 1.1.2 + version: 1.1.2 + '@types/mem-fs-editor': + specifier: 7.0.1 + version: 7.0.1 + packages/guided-answers-helper: {} packages/i18n: @@ -6462,7 +6478,7 @@ packages: debug: 4.3.7 espree: 9.6.1 globals: 13.24.0 - ignore: 5.3.2 + ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -6741,7 +6757,7 @@ packages: '@vue/compiler-sfc': 3.4.37 chalk: 4.1.2 commander: 6.2.1 - fast-glob: 3.3.2 + fast-glob: 3.3.1 fs-extra: 9.1.0 intl-messageformat-parser: 6.1.2 json-stable-stringify: 1.1.1 @@ -8731,7 +8747,7 @@ packages: endent: 2.1.0 find-cache-dir: 3.3.2 flat-cache: 3.0.4 - micromatch: 4.0.5 + micromatch: 4.0.7 react-docgen-typescript: 2.2.2(typescript@5.3.3) tslib: 2.6.3 typescript: 5.3.3 @@ -15787,6 +15803,7 @@ packages: /ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} + dev: true /immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} @@ -16758,7 +16775,7 @@ packages: '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.11 - micromatch: 4.0.5 + micromatch: 4.0.7 pretty-format: 29.7.0 slash: 3.0.0 stack-utils: 2.0.5 @@ -17061,7 +17078,7 @@ packages: chalk: 4.1.2 flow-parser: 0.215.1 graceful-fs: 4.2.11 - micromatch: 4.0.5 + micromatch: 4.0.7 neo-async: 2.6.2 node-dir: 0.1.17 recast: 0.23.9 @@ -17095,7 +17112,7 @@ packages: chalk: 4.1.2 flow-parser: 0.215.1 graceful-fs: 4.2.11 - micromatch: 4.0.5 + micromatch: 4.0.7 neo-async: 2.6.2 node-dir: 0.1.17 recast: 0.23.9 diff --git a/sonar-project.properties b/sonar-project.properties index 6df22f248a..7576d049d6 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -27,6 +27,7 @@ sonar.javascript.lcov.reportPaths=packages/abap-deploy-config-inquirer/coverage/ packages/fiori-elements-writer/coverage/lcov.info, \ packages/fiori-freestyle-writer/coverage/lcov.info, \ packages/fiori-generator-shared/coverage/lcov.info, \ + packages/fiori-tools-settings/coverage/lcov.info, \ packages/guided-answers-helper/coverage/lcov.info, \ packages/jest-file-matchers/coverage/lcov.info, \ packages/launch-config/coverage/lcov.info, \ @@ -92,6 +93,7 @@ sonar.testExecutionReportPaths=packages/abap-deploy-config-inquirer/coverage/son packages/fiori-elements-writer/coverage/sonar-report.xml, \ packages/fiori-freestyle-writer/coverage/sonar-report.xml, \ packages/fiori-generator-shared/coverage/sonar-report.xml, \ + packages/fiori-tools-settings/coverage/sonar-report.xml, \ packages/guided-answers-helper/coverage/sonar-report.xml, \ packages/jest-file-matchers/coverage/sonar-report.xml, \ packages/launch-config/coverage/sonar-report.xml, \ diff --git a/tsconfig.json b/tsconfig.json index 69ce659b46..3f182f91e1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -98,6 +98,9 @@ { "path": "packages/fiori-generator-shared" }, + { + "path": "packages/fiori-tools-settings" + }, { "path": "packages/guided-answers-helper" }, From 6577a59c7a022e45c4f7921228cf30486a0b3fed Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 19 Sep 2024 16:17:31 +0000 Subject: [PATCH 026/122] chore: apply latest changesets --- .changeset/brown-candles-push.md | 5 ----- packages/fiori-tools-settings/CHANGELOG.md | 7 +++++++ packages/fiori-tools-settings/package.json | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 .changeset/brown-candles-push.md create mode 100644 packages/fiori-tools-settings/CHANGELOG.md diff --git a/.changeset/brown-candles-push.md b/.changeset/brown-candles-push.md deleted file mode 100644 index 3780a9be93..0000000000 --- a/.changeset/brown-candles-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/fiori-tools-settings': minor ---- - -Added app info file handling logic to .fioritools folder diff --git a/packages/fiori-tools-settings/CHANGELOG.md b/packages/fiori-tools-settings/CHANGELOG.md new file mode 100644 index 0000000000..801cd8394a --- /dev/null +++ b/packages/fiori-tools-settings/CHANGELOG.md @@ -0,0 +1,7 @@ +# @sap-ux/fiori-tools-settings + +## 0.1.0 + +### Minor Changes + +- 04b3e6c: Added app info file handling logic to .fioritools folder diff --git a/packages/fiori-tools-settings/package.json b/packages/fiori-tools-settings/package.json index 1d959936d7..652c2ebd5b 100644 --- a/packages/fiori-tools-settings/package.json +++ b/packages/fiori-tools-settings/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-tools-settings", "description": "Utilities for managing and persisting Fiori tools configuration settings in the hidden .fioritools folder.", - "version": "0.0.0", + "version": "0.1.0", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", From 463f482d279b819e2ce24e92fa18210bc48ef841 Mon Sep 17 00:00:00 2001 From: kitzkan Date: Thu, 19 Sep 2024 17:47:16 +0100 Subject: [PATCH 027/122] Revise launch config (#2347) * remove fs node module * removing write application info logic * return file editor * fix launch config tests * pnpm recursive install * add changeset * remove exports of ftns from workspace manager to test * refactor createLaunchConfig * Linting auto fix commit * reuse createLaunchConfig * pnpm install updates * launch config review * Update project data source types in types.ts * fixing lint issues --------- Co-authored-by: github-actions[bot] Co-authored-by: Klaus Keller <66327622+Klaus-Keller@users.noreply.github.com> --- .changeset/tidy-papayas-film.md | 6 + packages/launch-config/package.json | 2 - .../launch-config/src/debug-config/config.ts | 30 +- .../src/debug-config/workspaceManager.ts | 25 +- packages/launch-config/src/index.ts | 2 +- .../src/launch-config-crud/create.ts | 249 ++++++++------- packages/launch-config/src/types/types.ts | 18 +- .../test/debug-config/config.test.ts | 31 +- .../configureLaunchConfig.test.ts | 244 -------------- .../test/debug-config/helpers.test.ts | 6 +- .../debug-config/workspaceManager.test.ts | 149 ++++----- .../test/launch-config-crud/create.test.ts | 298 +++++++++++++++++- .../test/launch-config-crud/update.test.ts | 3 +- packages/launch-config/tsconfig.json | 6 - pnpm-lock.yaml | 6 - 15 files changed, 568 insertions(+), 507 deletions(-) create mode 100644 .changeset/tidy-papayas-film.md delete mode 100644 packages/launch-config/test/debug-config/configureLaunchConfig.test.ts diff --git a/.changeset/tidy-papayas-film.md b/.changeset/tidy-papayas-film.md new file mode 100644 index 0000000000..093413332b --- /dev/null +++ b/.changeset/tidy-papayas-film.md @@ -0,0 +1,6 @@ +--- +'@sap-ux/launch-config': minor +--- + +Reverted the use of Node.js `fs` modules and replaced them with `mem-fs` for writing launch config files & Removed `writeApplicationInfoSettings()` from `@sap-ux/launch-config` +Refactoring create launch config functionalities. \ No newline at end of file diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index b6fd0eaf62..ce20331e55 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -34,8 +34,6 @@ "@sap-ux/project-access": "workspace:*", "@sap-ux/ui5-config": "workspace:*", "@sap-ux/ui5-info": "workspace:*", - "@sap-ux/odata-service-inquirer": "workspace:*", - "@sap-ux/store": "workspace:*", "i18next": "23.5.1", "jsonc-parser": "3.2.0", "mem-fs": "2.1.0", diff --git a/packages/launch-config/src/debug-config/config.ts b/packages/launch-config/src/debug-config/config.ts index f130269fb6..7e6c6bbf28 100644 --- a/packages/launch-config/src/debug-config/config.ts +++ b/packages/launch-config/src/debug-config/config.ts @@ -1,8 +1,7 @@ -import { DatasourceType, OdataVersion } from '@sap-ux/odata-service-inquirer'; import { basename } from 'path'; import { getLaunchConfig } from '../launch-config-crud/utils'; import type { LaunchConfig, LaunchJSON, DebugOptions, LaunchConfigEnv } from '../types'; -import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID } from '../types'; +import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID, ProjectDataSourceType } from '../types'; // debug constants const testFlpSandboxHtml = 'test/flpSandbox.html'; @@ -27,7 +26,7 @@ function getEnvUrlParams(sapClientParam: string): string { } /** - * Creates a launch configuration. + * Gets launch configuration. * * @param {string} name - The name of the configuration. * @param {string} cwd - The current working directory. @@ -37,7 +36,7 @@ function getEnvUrlParams(sapClientParam: string): string { * @param {string} [runConfig] - The optional run configuration for AppStudio. * @returns {LaunchConfig} The launch configuration object. */ -function createLaunchConfig( +function configureLaunchConfig( name: string, cwd: string, runtimeArgs: string[], @@ -56,13 +55,13 @@ function createLaunchConfig( /** * Configures the launch.json file based on provided options. * + * @param rootFolder - The root folder path where the app will be generated. * @param {string} cwd - The current working directory. * @param {DebugOptions} configOpts - Configuration options for the launch.json file. * @returns {LaunchJSON} The configured launch.json object. */ -export function configureLaunchJsonFile(cwd: string, configOpts: DebugOptions): LaunchJSON { +export function configureLaunchJsonFile(rootFolder: string, cwd: string, configOpts: DebugOptions): LaunchJSON { const { - projectPath, isAppStudio, datasourceType, flpAppId, @@ -73,14 +72,13 @@ export function configureLaunchJsonFile(cwd: string, configOpts: DebugOptions): isFioriElement, migratorMockIntent } = configOpts; - - const projectName = basename(projectPath); + const projectName = basename(rootFolder); const flpAppIdWithHash = flpAppId && !flpAppId.startsWith('#') ? `#${flpAppId}` : flpAppId; const startHtmlFile = flpSandboxAvailable ? testFlpSandboxHtml : indexHtml; const runConfig = isAppStudio ? JSON.stringify({ handlerId: FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID, - runnableId: projectPath + runnableId: rootFolder }) : undefined; const envUrlParam = getEnvUrlParams(sapClientParam); @@ -88,9 +86,9 @@ export function configureLaunchJsonFile(cwd: string, configOpts: DebugOptions): const launchFile: LaunchJSON = { version: '0.2.0', configurations: [] }; // Add live configuration if the datasource is not from a metadata file - if (datasourceType !== DatasourceType.metadataFile) { + if (datasourceType !== ProjectDataSourceType.metadataFile) { const startCommand = `${startHtmlFile}${flpAppIdWithHash}`; - const liveConfig = createLaunchConfig( + const liveConfig = configureLaunchConfig( `Start ${projectName}`, cwd, ['fiori', 'run'], @@ -102,13 +100,13 @@ export function configureLaunchJsonFile(cwd: string, configOpts: DebugOptions): } // Add mock configuration for OData V2 or V4 - if (odataVersion && [OdataVersion.v2, OdataVersion.v4].includes(odataVersion)) { + if (odataVersion && ['2.0', '4.0'].includes(odataVersion)) { const params = `${flpAppIdWithHash ?? ''}`; const mockCmdArgs = - isMigrator && odataVersion === OdataVersion.v2 + isMigrator && odataVersion === '2.0' ? ['--open', `${testFlpSandboxMockServerHtml}${params}`] : ['--config', './ui5-mock.yaml', '--open', `${testFlpSandboxHtml}${params}`]; - const mockConfig = createLaunchConfig( + const mockConfig = configureLaunchConfig( `Start ${projectName} Mock`, cwd, ['fiori', 'run'], @@ -120,12 +118,12 @@ export function configureLaunchJsonFile(cwd: string, configOpts: DebugOptions): } // Add local configuration - const shouldUseMockServer = isFioriElement && odataVersion === OdataVersion.v2 && isMigrator; + const shouldUseMockServer = isFioriElement && odataVersion === '2.0' && isMigrator; const localHtmlFile = shouldUseMockServer ? testFlpSandboxMockServerHtml : startHtmlFile; const startLocalCommand = `${localHtmlFile}${ migratorMockIntent ? `#${migratorMockIntent.replace('#', '')}` : flpAppIdWithHash }`; - const localConfig = createLaunchConfig( + const localConfig = configureLaunchConfig( `Start ${projectName} Local`, cwd, ['fiori', 'run'], diff --git a/packages/launch-config/src/debug-config/workspaceManager.ts b/packages/launch-config/src/debug-config/workspaceManager.ts index 6dd8d0b17a..6222d65010 100644 --- a/packages/launch-config/src/debug-config/workspaceManager.ts +++ b/packages/launch-config/src/debug-config/workspaceManager.ts @@ -10,7 +10,7 @@ import { formatCwd, getLaunchJsonPath, isFolderInWorkspace, handleAppsNotInWorks * @param {any} vscode - The VS Code API object. * @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file and the cwd for the launch configuration. */ -export function handleUnsavedWorkspace(projectPath: string, vscode: any): WorkspaceHandlerInfo { +function handleUnsavedWorkspace(projectPath: string, vscode: any): WorkspaceHandlerInfo { const workspace = vscode.workspace; const wsFolder = workspace.getWorkspaceFolder(vscode.Uri.file(projectPath))?.uri?.fsPath; const nestedFolder = relative(wsFolder ?? projectPath, projectPath); @@ -31,7 +31,7 @@ export function handleUnsavedWorkspace(projectPath: string, vscode: any): Worksp * @param {any} vscode - The VS Code API object. * @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file and the cwd for the launch configuration. */ -export function handleSavedWorkspace( +function handleSavedWorkspace( projectPath: string, projectName: string, targetFolder: string, @@ -58,7 +58,7 @@ export function handleSavedWorkspace( * @param {any} vscode - The VS Code API object. * @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file and the cwd for the launch configuration. */ -export function handleOpenFolderButNoWorkspaceFile( +function handleOpenFolderButNoWorkspaceFile( projectPath: string, targetFolder: string, isAppStudio: boolean, @@ -83,6 +83,7 @@ export function handleOpenFolderButNoWorkspaceFile( * This function handles different scenarios depending on whether a workspace is open, * whether the project is inside or outside of a workspace, and other factors. * + * @param rootFolder - The root folder path where the app will be generated. * @param {DebugOptions} options - The options used to determine how to manage the workspace configuration. * @param {string} options.projectPath -The project's path including project name. * @param {boolean} [options.isAppStudio] - A boolean indicating whether the current environment is BAS. @@ -90,30 +91,30 @@ export function handleOpenFolderButNoWorkspaceFile( * @param {any} options.vscode - The VS Code API object. * @returns {WorkspaceHandlerInfo} An object containing the path to the `launch.json` configuration file, the cwd command, workspaceFolderUri if provided will enable reload. */ -export function handleWorkspaceConfig(options: DebugOptions): WorkspaceHandlerInfo { - const { projectPath, isAppStudio = false, writeToAppOnly = false, vscode } = options; +export function handleWorkspaceConfig(rootFolder: string, options: DebugOptions): WorkspaceHandlerInfo { + const { isAppStudio = false, writeToAppOnly = false, vscode } = options; - const projectName = basename(projectPath); - const targetFolder = dirname(projectPath); + const projectName = basename(rootFolder); + const targetFolder = dirname(rootFolder); // Directly handle the case where we ignore workspace settings if (writeToAppOnly) { - return handleAppsNotInWorkspace(projectPath, isAppStudio, vscode); + return handleAppsNotInWorkspace(rootFolder, isAppStudio, vscode); } const workspace = vscode.workspace; const workspaceFile = workspace?.workspaceFile; // Handles the scenario where no workspace or folder is open in VS Code. if (!workspace) { - return handleAppsNotInWorkspace(projectPath, isAppStudio, vscode); + return handleAppsNotInWorkspace(rootFolder, isAppStudio, vscode); } // Handle case where a folder is open, but not a workspace file if (!workspaceFile) { - return handleOpenFolderButNoWorkspaceFile(projectPath, targetFolder, isAppStudio, vscode); + return handleOpenFolderButNoWorkspaceFile(rootFolder, targetFolder, isAppStudio, vscode); } // Handles the case where a previously saved workspace is open if (workspaceFile.scheme === 'file') { - return handleSavedWorkspace(projectPath, projectName, targetFolder, isAppStudio, vscode); + return handleSavedWorkspace(rootFolder, projectName, targetFolder, isAppStudio, vscode); } // Handles the case where an unsaved workspace is open - return handleUnsavedWorkspace(projectPath, vscode); + return handleUnsavedWorkspace(rootFolder, vscode); } diff --git a/packages/launch-config/src/index.ts b/packages/launch-config/src/index.ts index d38fecfed7..fae4f11272 100644 --- a/packages/launch-config/src/index.ts +++ b/packages/launch-config/src/index.ts @@ -1,5 +1,5 @@ export * from './types'; -export { createLaunchConfig, configureLaunchConfig } from './launch-config-crud/create'; +export { createLaunchConfig } from './launch-config-crud/create'; export { deleteLaunchConfig } from './launch-config-crud/delete'; export { convertOldLaunchConfigToFioriRun } from './launch-config-crud/modify'; export { getLaunchConfigs, getLaunchConfigByName } from './launch-config-crud/read'; diff --git a/packages/launch-config/src/launch-config-crud/create.ts b/packages/launch-config/src/launch-config-crud/create.ts index 626da87ef3..d21a715bd4 100644 --- a/packages/launch-config/src/launch-config-crud/create.ts +++ b/packages/launch-config/src/launch-config-crud/create.ts @@ -2,73 +2,102 @@ import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; import { join, basename } from 'path'; import { DirName } from '@sap-ux/project-access'; -import { LAUNCH_JSON_FILE } from '../types'; -import type { FioriOptions, LaunchJSON, UpdateWorkspaceFolderOptions, DebugOptions } from '../types'; +import { LAUNCH_JSON_FILE, ProjectDataSourceType } from '../types'; +import type { FioriOptions, LaunchJSON, UpdateWorkspaceFolderOptions, DebugOptions, LaunchConfig } from '../types'; import type { Editor } from 'mem-fs-editor'; import { generateNewFioriLaunchConfig } from './utils'; import { updateLaunchJSON } from './writer'; import { parse } from 'jsonc-parser'; import { handleWorkspaceConfig } from '../debug-config/workspaceManager'; import { configureLaunchJsonFile } from '../debug-config/config'; -import { getFioriToolsDirectory } from '@sap-ux/store'; import type { Logger } from '@sap-ux/logger'; -import { DatasourceType } from '@sap-ux/odata-service-inquirer'; import { t } from '../i18n'; -import fs from 'fs'; /** - * Enhance or create the launch.json file with new launch config. + * Writes the `launch.json` file with the specified configurations. If the file already exists, it will be overwritten. * - * @param rootFolder - workspace root folder. - * @param fioriOptions - options for the new launch config. - * @param fs - optional, the memfs editor instance. - * @returns memfs editor instance. + * @param {Editor} fs - The file system editor used to write the `launch.json` file. + * @param {string} launchJSONPath - The full path to the `launch.json` file. + * @param {LaunchConfig[]} configurations - An array of launch configurations to be included in the `launch.json` file. + * @returns {void} */ -export async function createLaunchConfig(rootFolder: string, fioriOptions: FioriOptions, fs?: Editor): Promise { - if (!fs) { - fs = create(createStorage()); - } - const launchJSONPath = join(rootFolder, DirName.VSCode, LAUNCH_JSON_FILE); - if (fs.exists(launchJSONPath)) { +function writeLaunchJsonFile(fs: Editor, launchJSONPath: string, configurations: LaunchConfig[]): void { + const newLaunchJSONContent = { version: '0.2.0', configurations }; + fs.write(launchJSONPath, JSON.stringify(newLaunchJSONContent, null, 4)); +} + +/** + * Handles the case where there are no debug options provided. It either enhances an existing `launch.json` + * file with a new launch configuration or creates a new `launch.json` file with the initial configuration. + * + * @param {string} rootFolder - The root directory where the `launch.json` file is located or will be created. + * @param {FioriOptions} fioriOptions - The options used to generate the new launch configuration for the `launch.json` file. + * @param {Editor} fs - The file system editor used to read and write the `launch.json` file. + * @returns {Promise} - A promise that resolves with the file system editor after the `launch.json` file has been + * updated or created. + */ +async function handleNoDebugOptions(rootFolder: string, fioriOptions: FioriOptions, fs: Editor): Promise { + const launchJsonWritePath = join(rootFolder, DirName.VSCode, LAUNCH_JSON_FILE); + if (fs.exists(launchJsonWritePath)) { // launch.json exists, enhance existing file with new config const launchConfig = generateNewFioriLaunchConfig(rootFolder, fioriOptions); - const launchJsonString = fs.read(launchJSONPath); + const launchJsonString = fs.read(launchJsonWritePath); const launchJson = parse(launchJsonString) as LaunchJSON; await updateLaunchJSON( launchConfig, - launchJSONPath, + launchJsonWritePath, ['configurations', launchJson.configurations.length + 1], { isArrayInsertion: true }, fs ); - } else { - // launch.json is missing, new file with new config - const configurations = generateNewFioriLaunchConfig(rootFolder, fioriOptions); - const newLaunchJSONContent = { version: '0.2.0', configurations: [configurations] }; - fs.write(launchJSONPath, JSON.stringify(newLaunchJSONContent, null, 4)); + return fs; } + // launch.json is missing, new file with new config + const configurations = [generateNewFioriLaunchConfig(rootFolder, fioriOptions)]; + writeLaunchJsonFile(fs, launchJsonWritePath, configurations); return fs; } /** - * Writes the application info settings to the appInfo.json file. - * Adds the specified path to the latestGeneratedFiles array. + * Updates or replaces the `launch.json` file depending on whether the file should be replaced + * or enhanced with additional configurations. If `replaceWithNew` is true, the entire file + * content is replaced with the new configurations. Otherwise, the configurations are added + * to the existing `launch.json`. * - * @param {string} path - The project file path to add. - * @param log - The logger instance. + * @param {Editor} fs - The file system editor to read and write the `launch.json` file. + * @param {string} launchJSONPath - The path to the existing `launch.json` file. + * @param {LaunchConfig[]} configurations - An array of new launch configurations to be added or replaced. + * @param {boolean} replaceWithNew - A flag indicating whether to replace the existing `launch.json` + * with new configurations (`true`) or append to the existing ones (`false`). + * @returns {Promise} - A promise that resolves once the `launch.json` file has been updated or replaced. */ -export function writeApplicationInfoSettings(path: string, log?: Logger): void { - const appInfoFilePath: string = getFioriToolsDirectory(); - const appInfoContents = fs.existsSync(appInfoFilePath) - ? JSON.parse(fs.readFileSync(appInfoFilePath, 'utf-8')) - : { latestGeneratedFiles: [] }; - appInfoContents.latestGeneratedFiles.push(path); - try { - fs.writeFileSync(appInfoFilePath, JSON.stringify(appInfoContents, null, 2)); - } catch (error) { - log?.error(t('errorAppInfoFile', { error: error })); +async function handleExistingLaunchJson( + fs: Editor, + launchJSONPath: string, + configurations: LaunchConfig[], + replaceWithNew: boolean = false +): Promise { + const launchJsonString = fs.read(launchJSONPath); + const launchJson = parse(launchJsonString) as LaunchJSON; + if (replaceWithNew) { + // replaceWithNew is needed in cases where launch config exists in + // `.vscode` but isn't added to the workspace. If `replaceWithNew` is `true`, it indicates that the app is not + // in the workspace, so the entire `launch.json` and replaced since launch config is then generated in app folder. + writeLaunchJsonFile(fs, launchJSONPath, configurations); + } else { + for (const config of configurations) { + await updateLaunchJSON( + config, + launchJSONPath, + ['configurations', launchJson.configurations.length + 1], + { + isArrayInsertion: true + }, + fs + ); + } } } @@ -76,18 +105,10 @@ export function writeApplicationInfoSettings(path: string, log?: Logger): void { * Updates the workspace folders in VSCode if the update options are provided. * * @param {UpdateWorkspaceFolderOptions} updateWorkspaceFolders - The options for updating workspace folders. - * @param {string} rootFolderPath - The root folder path of the project. - * @param log - The logger instance. */ -export function updateWorkspaceFoldersIfNeeded( - updateWorkspaceFolders: UpdateWorkspaceFolderOptions | undefined, - rootFolderPath: string, - log?: Logger -): void { +function updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders?: UpdateWorkspaceFolderOptions): void { if (updateWorkspaceFolders) { const { uri, vscode, projectName } = updateWorkspaceFolders; - writeApplicationInfoSettings(rootFolderPath, log); - if (uri && vscode) { const currentWorkspaceFolders = vscode.workspace.workspaceFolders || []; vscode.workspace.updateWorkspaceFolders(currentWorkspaceFolders.length, undefined, { @@ -99,79 +120,85 @@ export function updateWorkspaceFoldersIfNeeded( } /** - * Creates or updates the launch.json file with the provided configurations. + * Handles the creation and configuration of the `launch.json` file based on debug options. + * This function processes workspace configuration, updates the `launch.json` file if it exists, + * and creates it if it does not. Additionally, it updates workspace folders if applicable. * - * @param {string} rootFolderPath - The root folder path of the project. - * @param {LaunchJSON} launchJsonFile - The launch.json configuration to write. - * @param {UpdateWorkspaceFolderOptions} [updateWorkspaceFolders] - Optional workspace folder update options. - * @param {boolean} appNotInWorkspace - Indicates if the app is not in the workspace. - * @param log - The logger instance. + * @param rootFolder - root folder. + * @param {Editor} fs - The file system editor to read and write the `launch.json` file. + * @param {DebugOptions} debugOptions - Debug configuration options that dictate how the `launch.json` + * should be generated and what commands should be logged. + * @param {Logger} logger - Logger instance for logging information or warnings. + * @returns {Promise} - Returns the file system editor after potentially modifying the workspace + * and updating or creating the `launch.json` file. */ -export function createOrUpdateLaunchConfigJSON( - rootFolderPath: string, - launchJsonFile?: LaunchJSON, - updateWorkspaceFolders?: UpdateWorkspaceFolderOptions, - appNotInWorkspace: boolean = false, - log?: Logger -): void { - try { - const launchJSONPath = join(rootFolderPath, DirName.VSCode, LAUNCH_JSON_FILE); - if (fs.existsSync(launchJSONPath) && !appNotInWorkspace) { - const existingLaunchConfig = parse(fs.readFileSync(launchJSONPath, 'utf-8')) as LaunchJSON; - const updatedConfigurations = existingLaunchConfig.configurations.concat( - launchJsonFile?.configurations ?? [] - ); - fs.writeFileSync( - launchJSONPath, - JSON.stringify({ ...existingLaunchConfig, configurations: updatedConfigurations }, null, 4) - ); - } else { - const dotVscodePath = join(rootFolderPath, DirName.VSCode); - fs.mkdirSync(dotVscodePath, { recursive: true }); - const path = join(dotVscodePath, 'launch.json'); - fs.writeFileSync(path, JSON.stringify(launchJsonFile ?? {}, null, 4), 'utf8'); - } - } catch (error) { - log?.error(t('errorLaunchFile', { error: error })); +async function handleDebugOptions( + rootFolder: string, + fs: Editor, + debugOptions: DebugOptions, + logger?: Logger +): Promise { + const { launchJsonPath, workspaceFolderUri, cwd, appNotInWorkspace } = handleWorkspaceConfig( + rootFolder, + debugOptions + ); + const configurations = configureLaunchJsonFile(rootFolder, cwd, debugOptions).configurations; + + const npmCommand = debugOptions.datasourceType === ProjectDataSourceType.metadataFile ? 'run start-mock' : 'start'; + logger?.info( + t('startServerMessage', { + folder: basename(rootFolder), + npmCommand + }) + ); + const launchJsonWritePath = join(launchJsonPath, DirName.VSCode, LAUNCH_JSON_FILE); + if (fs.exists(launchJsonWritePath)) { + await handleExistingLaunchJson(fs, launchJsonWritePath, configurations, appNotInWorkspace); + } else { + writeLaunchJsonFile(fs, launchJsonWritePath, configurations); } - updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders, rootFolderPath, log); + + // The `workspaceFolderUri` is a URI obtained from VS Code that specifies the path to the workspace folder. + // This URI is populated when a reload of the workspace is required. It allows us to identify and update + // the workspace folder correctly within VS Code. + const updateWorkspaceFolders = workspaceFolderUri + ? ({ + uri: workspaceFolderUri, + projectName: basename(rootFolder), + vscode: debugOptions.vscode + } as UpdateWorkspaceFolderOptions) + : undefined; + + updateWorkspaceFoldersIfNeeded(updateWorkspaceFolders); + return fs; } /** - * Generates and creates launch configuration for the project based on debug options. + * Enhance or create the launch.json file with new launch config. * - * @param {DebugOptions} options - The options for configuring the debug setup. - * @param log - The logger instance. + * @param rootFolder - workspace root folder. + * @param fioriOptions - options for the new launch config. + * @param fs - optional, the memfs editor instance. + * @param logger - optional, the logger instance. + * @returns memfs editor instance. */ -export function configureLaunchConfig(options: DebugOptions, log?: Logger): void { - const { datasourceType, projectPath, vscode } = options; - if (datasourceType === DatasourceType.capProject) { - log?.info(t('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' })); - return; +export async function createLaunchConfig( + rootFolder: string, + fioriOptions: FioriOptions, + fs?: Editor, + logger?: Logger +): Promise { + fs = fs ?? create(createStorage()); + const debugOptions = fioriOptions.debugOptions; + if (!debugOptions) { + return await handleNoDebugOptions(rootFolder, fioriOptions, fs); } - if (!vscode) { - return; + if (!debugOptions.vscode) { + return fs; } - const { launchJsonPath, workspaceFolderUri, cwd, appNotInWorkspace } = handleWorkspaceConfig(options); - // construct launch.json file - const launchJsonFile = configureLaunchJsonFile(cwd, options); - // update workspace folders if workspaceFolderUri is available - const updateWorkspaceFolders = workspaceFolderUri - ? { - uri: workspaceFolderUri, - projectName: basename(options.projectPath), - vscode - } - : undefined; - - createOrUpdateLaunchConfigJSON(launchJsonPath, launchJsonFile, updateWorkspaceFolders, appNotInWorkspace, log); - - const npmCommand = datasourceType === DatasourceType.metadataFile ? 'run start-mock' : 'start'; - const projectName = basename(projectPath); - log?.info( - t('startServerMessage', { - folder: projectName, - npmCommand - }) - ); + if (debugOptions.datasourceType === ProjectDataSourceType.capProject) { + logger?.info(t('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' })); + return fs; + } + return await handleDebugOptions(rootFolder, fs, debugOptions, logger); } diff --git a/packages/launch-config/src/types/types.ts b/packages/launch-config/src/types/types.ts index 8cf24216be..5e6e44fd4d 100644 --- a/packages/launch-config/src/types/types.ts +++ b/packages/launch-config/src/types/types.ts @@ -1,6 +1,5 @@ import type { ODataVersion } from '@sap-ux/project-access'; import type { FioriToolsProxyConfigBackend } from '@sap-ux/ui5-config'; -import type { OdataVersion, DatasourceType } from '@sap-ux/odata-service-inquirer'; export enum Arguments { FrameworkVersion = '--framework-version', @@ -21,6 +20,7 @@ export interface FioriOptions { backendConfigs?: FioriToolsProxyConfigBackend[]; urlParameters?: string; visible?: boolean; + debugOptions?: DebugOptions; } export interface LaunchJSON { @@ -60,14 +60,22 @@ export interface LaunchConfigInfo { filePath: string; } +/** + * Enum representing the types of data sources or origins for a project. + * These types indicate how a project is generated. + */ +export enum ProjectDataSourceType { + capProject = 'capProject', + odataServiceUrl = 'odataServiceUrl', + metadataFile = 'metadataFile' +} + /** * Configuration options for debugging launch configurations. */ export interface DebugOptions { - /** Path to the project directory. */ - projectPath: string; /** Type of the data source used in the project. */ - datasourceType: DatasourceType; + datasourceType: ProjectDataSourceType; /** SAP client parameter for the connection. */ sapClientParam: string; /** FLP application ID. */ @@ -75,7 +83,7 @@ export interface DebugOptions { /** Indicates if the FLP sandbox environment is available. */ flpSandboxAvailable: boolean; /** Version of the OData service. */ - odataVersion?: OdataVersion; + odataVersion?: ODataVersion; /** Indicates if the project is a Fiori Element. */ isFioriElement?: boolean; /** Intent parameter for the migrator mock. */ diff --git a/packages/launch-config/test/debug-config/config.test.ts b/packages/launch-config/test/debug-config/config.test.ts index 7a0b31841b..d7142587d4 100644 --- a/packages/launch-config/test/debug-config/config.test.ts +++ b/packages/launch-config/test/debug-config/config.test.ts @@ -1,11 +1,11 @@ import { configureLaunchJsonFile } from '../../src/debug-config/config'; import type { DebugOptions, LaunchConfig, LaunchJSON } from '../../src/types'; import path from 'path'; -import { DatasourceType, OdataVersion } from '@sap-ux/odata-service-inquirer'; -import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID } from '../../src/types'; +import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID, ProjectDataSourceType } from '../../src/types'; const projectName = 'project1'; const cwd = `\${workspaceFolder}`; +const projectPath = path.join(__dirname, projectName); // Base configuration template const baseConfigurationObj: Partial = { @@ -56,13 +56,12 @@ describe('debug config tests', () => { beforeEach(() => { configOptions = { vscode: vscodeMock, - projectPath: path.join(__dirname, projectName), - odataVersion: OdataVersion.v2, + odataVersion: '2.0', sapClientParam: '', flpAppId: 'project1-tile', isFioriElement: true, flpSandboxAvailable: true, - datasourceType: DatasourceType.odataServiceUrl + datasourceType: ProjectDataSourceType.odataServiceUrl }; }); @@ -72,7 +71,7 @@ describe('debug config tests', () => { }); it('Should return the correct configuration for OData v2', () => { - const launchFile = configureLaunchJsonFile(cwd, configOptions); + const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); expect(launchFile.configurations.length).toBe(3); expect(findConfiguration(launchFile, `Start ${projectName}`)).toEqual(liveConfigurationObj); @@ -81,8 +80,8 @@ describe('debug config tests', () => { }); it('Should return the correct configuration for OData v4', () => { - configOptions.odataVersion = OdataVersion.v4; - const launchFile = configureLaunchJsonFile(cwd, configOptions); + configOptions.odataVersion = '4.0'; + const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); expect(launchFile.configurations.length).toBe(3); expect(findConfiguration(launchFile, `Start ${projectName}`)).toEqual(liveConfigurationObj); @@ -91,8 +90,8 @@ describe('debug config tests', () => { }); it('Should return correct configuration for local metadata', () => { - configOptions.datasourceType = DatasourceType.metadataFile; - const launchFile = configureLaunchJsonFile(cwd, configOptions); + configOptions.datasourceType = ProjectDataSourceType.metadataFile; + const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); expect(launchFile.configurations.length).toBe(2); expect(findConfiguration(launchFile, `Start ${projectName}`)).toBeUndefined(); @@ -102,7 +101,7 @@ describe('debug config tests', () => { it('Should return correct configuration when project is being migrated', () => { configOptions.isMigrator = true; - const launchFile = configureLaunchJsonFile(cwd, configOptions); + const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); const mockConfigWithMigrator = { ...mockConfigurationObj, args: ['--open', 'test/flpSandboxMockServer.html#project1-tile'] @@ -114,7 +113,7 @@ describe('debug config tests', () => { configOptions.isFioriElement = false; configOptions.flpSandboxAvailable = false; configOptions.flpAppId = ''; - const launchFile = configureLaunchJsonFile(cwd, configOptions); + const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); const localConfig = { ...localConfigurationObj, args: ['--config', './ui5-local.yaml', '--open', 'index.html'] @@ -124,7 +123,7 @@ describe('debug config tests', () => { it('Should return correct configuration when migrator mock intent is provided', () => { configOptions.migratorMockIntent = 'flpSandboxMockFlpIntent'; - const launchFile = configureLaunchJsonFile(cwd, configOptions); + const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); const localConfig = { ...localConfigurationObj, args: ['--config', './ui5-local.yaml', '--open', 'test/flpSandbox.html#flpSandboxMockFlpIntent'] @@ -133,12 +132,12 @@ describe('debug config tests', () => { }); it('Should return correct configuration on BAS and sapClientParam is available', () => { - configOptions.odataVersion = OdataVersion.v2; - configOptions.datasourceType = DatasourceType.odataServiceUrl; + configOptions.odataVersion = '2.0'; + configOptions.datasourceType = ProjectDataSourceType.odataServiceUrl; configOptions.sapClientParam = 'sapClientParam'; configOptions.isAppStudio = true; - const launchFile = configureLaunchJsonFile(cwd, configOptions); + const launchFile = configureLaunchJsonFile(path.join(__dirname, projectName), cwd, configOptions); expect(launchFile.configurations.length).toBe(3); const projectPath = path.join(__dirname, 'project1'); diff --git a/packages/launch-config/test/debug-config/configureLaunchConfig.test.ts b/packages/launch-config/test/debug-config/configureLaunchConfig.test.ts deleted file mode 100644 index 0a4f12249a..0000000000 --- a/packages/launch-config/test/debug-config/configureLaunchConfig.test.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { join } from 'path'; -import { handleWorkspaceConfig } from '../../src/debug-config/workspaceManager'; -import type { DebugOptions, UpdateWorkspaceFolderOptions, LaunchJSON } from '../../src/types'; -import { LAUNCH_JSON_FILE } from '../../src/types'; -import { - writeApplicationInfoSettings, - updateWorkspaceFoldersIfNeeded, - createOrUpdateLaunchConfigJSON, - configureLaunchConfig -} from '../../src/launch-config-crud/create'; -import { t } from '../../src/i18n'; -import { DatasourceType } from '@sap-ux/odata-service-inquirer'; -import type { Editor } from 'mem-fs-editor'; -import { DirName } from '@sap-ux/project-access'; -import { getFioriToolsDirectory } from '@sap-ux/store'; -import type { Logger } from '@sap-ux/logger'; -import { existsSync, mkdir } from 'fs'; -import fs from 'fs'; - -// Mock dependencies -jest.mock('mem-fs'); -jest.mock('mem-fs-editor'); -jest.mock('jsonc-parser', () => ({ - parse: jest.fn().mockReturnValue({ - configurations: [{ name: 'Existing Config', type: 'node' }] - }) -})); -jest.mock('../../src/debug-config/workspaceManager', () => ({ - handleWorkspaceConfig: jest.fn() -})); -jest.mock('../../src/debug-config/config', () => ({ - configureLaunchJsonFile: jest.fn(), - writeApplicationInfoSettings: jest.requireActual('../../src/debug-config/config').writeApplicationInfoSettings -})); -const mockLog = { - error: jest.fn(), - info: jest.fn() -} as unknown as Logger; - -const mockEditor = { - exists: jest.fn().mockReturnValue(false), - read: jest.fn(), - write: jest.fn() -} as unknown as Editor; -const mockPath = '/mock/project/path'; -// Define a variable to control the behavior of writeFileSync -let writeFileSyncMockBehavior: 'success' | 'error'; - -jest.mock('fs', () => ({ - ...jest.requireActual('fs'), - //mkdirSync: jest.fn(), - existsSync: jest.fn().mockReturnValue(true), - readFileSync: jest.fn((path: string, encoding: string) => { - // Mock different behaviors based on the path - if (path) { - return JSON.stringify({ latestGeneratedFiles: [] }); // Mock file content - } - throw new Error('Simulated read error'); - }), - writeFileSync: jest.fn().mockImplementation(() => { - if (writeFileSyncMockBehavior === 'error') { - throw new Error('Simulated write error'); // Throw an error for `writeFileSync` when behavior is 'error' - } - // Otherwise, assume it succeeds - }) -})); - -// Function to set the behavior for writeFileSync -const setWriteFileSyncBehavior = (behavior: 'success' | 'error') => { - writeFileSyncMockBehavior = behavior; - // Reinitialize the mock to apply the new behavior - fs.writeFileSync = jest.fn().mockImplementation(() => { - if (writeFileSyncMockBehavior === 'error') { - throw new Error(); - } - }); -}; - -describe('Config Functions', () => { - const launchJson = { - configurations: [{ name: 'New Config', type: 'node' }] - } as LaunchJSON; - - const existingLaunchJson = { - configurations: [{ name: 'Existing Config', type: 'node' }] - } as LaunchJSON; - - afterEach(() => { - jest.clearAllMocks(); - }); - - describe('writeApplicationInfoSettings', () => { - it('should write application info settings to appInfo.json', () => { - writeApplicationInfoSettings(mockPath, mockLog); - expect(fs.writeFileSync).toHaveBeenCalledWith( - getFioriToolsDirectory(), - JSON.stringify({ latestGeneratedFiles: [mockPath] }, null, 2) - ); - }); - - it('should handle error while writing to appInfo.json', () => { - setWriteFileSyncBehavior('error'); - writeApplicationInfoSettings(mockPath, mockLog); - expect(mockLog.error).toHaveBeenCalledWith(t('errorAppInfoFile')); - }); - }); - - describe('updateWorkspaceFoldersIfNeeded', () => { - it('should update workspace folders if options are provided', () => { - const updateOptions = { - uri: '/mock/uri', - vscode: { - workspace: { - workspaceFolders: [], - updateWorkspaceFolders: jest.fn() - } - }, - projectName: 'Test Project' - } as UpdateWorkspaceFolderOptions; - updateWorkspaceFoldersIfNeeded(updateOptions, '/root/folder/path', mockLog); - expect(updateOptions.vscode.workspace.updateWorkspaceFolders).toHaveBeenCalledWith(0, undefined, { - name: 'Test Project', - uri: '/mock/uri' - }); - }); - - it('should not update workspace folders if no options are provided', () => { - const updateOptions: UpdateWorkspaceFolderOptions | undefined = undefined; - updateWorkspaceFoldersIfNeeded(updateOptions, '/root/folder/path', mockLog); - // No updateWorkspaceFolders call expected hence no app info json written - expect(fs.writeFileSync).not.toHaveBeenCalled(); - }); - }); - - describe('createOrUpdateLaunchConfigJSON', () => { - it('should create a new launch.json file if it does not exist', () => { - const rootFolderPath = '/root/folder'; - const appNotInWorkspace = false; - fs.mkdirSync = jest.fn().mockReturnValue(rootFolderPath); - fs.existsSync = jest.fn().mockReturnValue(false); - createOrUpdateLaunchConfigJSON(rootFolderPath, launchJson, undefined, appNotInWorkspace, mockLog); - expect(fs.writeFileSync).toHaveBeenCalledWith( - join(rootFolderPath, DirName.VSCode, LAUNCH_JSON_FILE), - JSON.stringify(launchJson, null, 4), - 'utf8' - ); - }); - - it('should update an existing launch.json file', () => { - const rootFolderPath = '/root/folder'; - const appNotInWorkspace = false; - fs.existsSync = jest.fn().mockReturnValue(true); - createOrUpdateLaunchConfigJSON(rootFolderPath, launchJson, undefined, appNotInWorkspace, mockLog); - - expect(fs.writeFileSync).toHaveBeenCalledWith( - join(rootFolderPath, DirName.VSCode, LAUNCH_JSON_FILE), - JSON.stringify( - { - configurations: [...existingLaunchJson.configurations, ...launchJson.configurations] - }, - null, - 4 - ) - ); - }); - - it('should not update an existing launch.json file when app not in workspace', () => { - const rootFolderPath = '/root/folder'; - const appNotInWorkspace = true; - fs.existsSync = jest.fn().mockReturnValue(true); - createOrUpdateLaunchConfigJSON(rootFolderPath, launchJson, undefined, appNotInWorkspace, mockLog); - expect(fs.writeFileSync).toHaveBeenCalledWith( - join(rootFolderPath, DirName.VSCode, LAUNCH_JSON_FILE), - JSON.stringify(launchJson, null, 4), - 'utf8' - ); - }); - - it('should handle errors while writing launch.json file', () => { - const rootFolderPath = '/root/folder'; - const appNotInWorkspace = false; - setWriteFileSyncBehavior('error'); - createOrUpdateLaunchConfigJSON(rootFolderPath, launchJson, undefined, appNotInWorkspace, mockLog); - expect(mockLog.error).toHaveBeenCalledWith(t('errorLaunchFile')); - }); - }); - - describe('configureLaunchConfig', () => { - it('should configure launch config and update workspace folders', () => { - const mockOptions = { - projectPath: '/mock/project/path', - writeToAppOnly: true, - vscode: { - workspace: { - workspaceFolders: [], - updateWorkspaceFolders: jest.fn() - } - } as any - } as DebugOptions; - - const mockLog = { - info: jest.fn(), - error: jest.fn() - } as unknown as Logger; - - // Mock handleWorkspaceConfig to return a specific launchJsonPath and cwd - (handleWorkspaceConfig as jest.Mock).mockReturnValue({ - launchJsonPath: '/mock/launch.json', - cwd: '${workspaceFolder}/path', - workspaceFolderUri: '/mock/launch.json' - }); - - // Call the function under test - configureLaunchConfig(mockOptions, mockLog); - - // Expectations to ensure that workspace folders are updated correctly - expect(mockOptions.vscode.workspace.updateWorkspaceFolders).toHaveBeenCalledWith(0, undefined, { - uri: '/mock/launch.json', - name: 'path' - }); - }); - - it('should log startApp message when datasourceType is capProject', () => { - const options = { - datasourceType: DatasourceType.capProject, - projectPath: 'some/path' - } as DebugOptions; - configureLaunchConfig(options, mockLog); - expect(mockLog.info).toHaveBeenCalledWith( - t('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' }) - ); - }); - - it('Should not run in Yeoman CLI or if vscode not found', () => { - const options = { - datasourceType: DatasourceType.metadataFile, - projectPath: 'some/path', - vscode: false - } as DebugOptions; - configureLaunchConfig(options, mockLog); - expect(mockLog.info).not.toHaveBeenCalled(); - }); - }); -}); diff --git a/packages/launch-config/test/debug-config/helpers.test.ts b/packages/launch-config/test/debug-config/helpers.test.ts index 2445185ace..61be487724 100644 --- a/packages/launch-config/test/debug-config/helpers.test.ts +++ b/packages/launch-config/test/debug-config/helpers.test.ts @@ -95,7 +95,7 @@ describe('launchConfig Unit Tests', () => { // Test for create launch config outside workspace describe('handleAppsNotInWorkspace', () => { it('should create a launch config for non-workspace apps', () => { - const mockProjectPath = '/mock/project/path'; + const mockProjectPath = path.join('/mock/project/path'); const result = handleAppsNotInWorkspace(mockProjectPath, isAppStudio, mockVscode); expect(result.cwd).toBe('${workspaceFolder}'); expect(result.launchJsonPath).toBe( @@ -107,7 +107,7 @@ describe('launchConfig Unit Tests', () => { }); it('should handle cases where vscode.Uri is not available', () => { - const mockProjectPath = '/mock/project/path'; + const mockProjectPath = path.join('/mock/project/path'); const result = handleAppsNotInWorkspace(mockProjectPath, isAppStudio, {}); expect(result.cwd).toBe('${workspaceFolder}'); expect(result.launchJsonPath).toBe( @@ -117,7 +117,7 @@ describe('launchConfig Unit Tests', () => { }); it('should handle cases where isAppStudio is true', () => { - const mockProjectPath = '/mock/project/path', + const mockProjectPath = path.join('/mock/project/path'), isAppStudio = true; const result = handleAppsNotInWorkspace(mockProjectPath, isAppStudio, mockVscode); expect(result.cwd).toBe('${workspaceFolder}'); diff --git a/packages/launch-config/test/debug-config/workspaceManager.test.ts b/packages/launch-config/test/debug-config/workspaceManager.test.ts index fecef5dc4b..d91b03163b 100644 --- a/packages/launch-config/test/debug-config/workspaceManager.test.ts +++ b/packages/launch-config/test/debug-config/workspaceManager.test.ts @@ -1,9 +1,4 @@ -import { - handleWorkspaceConfig, - handleUnsavedWorkspace, - handleSavedWorkspace, - handleOpenFolderButNoWorkspaceFile -} from '../../src/debug-config/workspaceManager'; +import { handleWorkspaceConfig } from '../../src/debug-config/workspaceManager'; import { formatCwd, getLaunchJsonPath, @@ -44,18 +39,45 @@ describe('launchConfig Unit Tests', () => { jest.clearAllMocks(); }); - describe('handleUnsavedWorkspace', () => { - it('should update paths for nested folders inside a workspace', () => { + describe('handleOpenFolderButNoWorkspaceFile', () => { + it('should create a launch config for non-workspace apps if folder is not in workspace', () => { + const mockProjectPath = path.join('/mock/project/path'); + (isFolderInWorkspace as jest.Mock).mockReturnValue(false); + (handleAppsNotInWorkspace as jest.Mock).mockReturnValue({ + launchJsonPath: mockProjectPath, + cwd: '${workspaceFolder}' + }); + + const options = { + isAppStudio, + vscode: mockVscode + } as DebugOptions; + + const result = handleWorkspaceConfig(mockProjectPath, options); + expect(result).toEqual({ + launchJsonPath: mockProjectPath, + cwd: '${workspaceFolder}' + }); + }); + + it('should update paths for nested folders inside an open folder', () => { const mockProjectPath = path.join('/mock/project/nestedFolder'); - const mockWsFolder = path.join('/mock/workspace/folder'); + const mockTargetFolder = path.join('/target/folder'); const mockNestedFolder = 'nestedFolder'; - mockVscode.workspace.getWorkspaceFolder.mockReturnValue({ uri: { fsPath: mockWsFolder } }); + + (isFolderInWorkspace as jest.Mock).mockReturnValue(true); (path.relative as jest.Mock).mockReturnValue(mockNestedFolder); (formatCwd as jest.Mock).mockReturnValue('${workspaceFolder}/nestedFolder'); + (getLaunchJsonPath as jest.Mock).mockReturnValue(mockTargetFolder); + + const options = { + isAppStudio, + vscode: mockVscode + } as DebugOptions; - const result = handleUnsavedWorkspace(mockProjectPath, mockVscode); + const result = handleWorkspaceConfig(mockProjectPath, options); expect(result).toEqual({ - launchJsonPath: mockWsFolder, + launchJsonPath: mockTargetFolder, cwd: '${workspaceFolder}/nestedFolder' }); }); @@ -63,20 +85,17 @@ describe('launchConfig Unit Tests', () => { describe('handleSavedWorkspace', () => { it('should handle projects inside the workspace', () => { - const mockProjectPath = '/mock/project/path'; - const mockProjectName = 'project'; - const mockTargetFolder = '/target/folder'; + const mockProjectPath = path.join('/mock/project/path'); + const mockTargetFolder = path.join('/target/folder'); (isFolderInWorkspace as jest.Mock).mockReturnValue(true); (formatCwd as jest.Mock).mockReturnValue('${workspaceFolder}/project'); (getLaunchJsonPath as jest.Mock).mockReturnValue(mockTargetFolder); - const result = handleSavedWorkspace( - mockProjectPath, - mockProjectName, - mockTargetFolder, + const options = { isAppStudio, - mockVscode - ); + vscode: mockVscode + } as DebugOptions; + const result = handleWorkspaceConfig(mockProjectPath, options); expect(result).toEqual({ launchJsonPath: mockTargetFolder, cwd: '${workspaceFolder}/project' @@ -84,22 +103,18 @@ describe('launchConfig Unit Tests', () => { }); it('should create a launch config for non-workspace apps', () => { - const mockProjectPath = '/mock/project/path'; - const mockProjectName = 'project'; - const mockTargetFolder = '/target/folder'; + const mockProjectPath = path.join('/mock/project/path'); (isFolderInWorkspace as jest.Mock).mockReturnValue(false); (handleAppsNotInWorkspace as jest.Mock).mockReturnValue({ launchJsonPath: mockProjectPath, cwd: '${workspaceFolder}' }); - const result = handleSavedWorkspace( - mockProjectPath, - mockProjectName, - mockTargetFolder, + const options = { isAppStudio, - mockVscode - ); + vscode: mockVscode + } as DebugOptions; + const result = handleWorkspaceConfig(mockProjectPath, options); expect(result).toEqual({ launchJsonPath: mockProjectPath, cwd: '${workspaceFolder}' @@ -107,48 +122,21 @@ describe('launchConfig Unit Tests', () => { }); }); - describe('handleOpenFolderButNoWorkspaceFile', () => { - it('should create a launch config for non-workspace apps if folder is not in workspace', () => { - const mockProjectPath = '/mock/project/path'; - const mockTargetFolder = '/target/folder'; - (isFolderInWorkspace as jest.Mock).mockReturnValue(false); - (handleAppsNotInWorkspace as jest.Mock).mockReturnValue({ - launchJsonPath: mockProjectPath, - cwd: '${workspaceFolder}' - }); - - const result = handleOpenFolderButNoWorkspaceFile( - mockProjectPath, - mockTargetFolder, - isAppStudio, - mockVscode - ); - expect(result).toEqual({ - launchJsonPath: mockProjectPath, - cwd: '${workspaceFolder}' - }); - }); - - it('should update paths for nested folders inside an open folder', () => { - const mockProjectPath = '/mock/project/nestedFolder'; - const mockTargetFolder = '/target/folder'; - const mockWsFolder = '/mock/workspace/folder'; + describe('handleUnsavedWorkspace', () => { + it('should update paths for nested folders inside a workspace', () => { + const mockProjectPath = path.join('mock/project/configureLaunchConfig'); + const mockWsFolder = path.join('mock/workspace/folder'); const mockNestedFolder = 'nestedFolder'; - - (isFolderInWorkspace as jest.Mock).mockReturnValue(true); mockVscode.workspace.getWorkspaceFolder.mockReturnValue({ uri: { fsPath: mockWsFolder } }); + mockVscode.workspace.workspaceFile.scheme = 'folder'; (path.relative as jest.Mock).mockReturnValue(mockNestedFolder); (formatCwd as jest.Mock).mockReturnValue('${workspaceFolder}/nestedFolder'); - (getLaunchJsonPath as jest.Mock).mockReturnValue(mockTargetFolder); - - const result = handleOpenFolderButNoWorkspaceFile( - mockProjectPath, - mockTargetFolder, - isAppStudio, - mockVscode - ); + const options = { + vscode: mockVscode + } as DebugOptions; + const result = handleWorkspaceConfig(mockProjectPath, options); expect(result).toEqual({ - launchJsonPath: mockTargetFolder, + launchJsonPath: mockWsFolder, cwd: '${workspaceFolder}/nestedFolder' }); }); @@ -156,9 +144,8 @@ describe('launchConfig Unit Tests', () => { describe('handleWorkspaceConfig', () => { it('should handle writeToAppOnly option', () => { - const mockProjectPath = '/mock/project/path'; + const mockProjectPath = path.join('/mock/project/path'); const options = { - projectPath: mockProjectPath, writeToAppOnly: true, vscode: mockVscode } as DebugOptions; @@ -168,7 +155,7 @@ describe('launchConfig Unit Tests', () => { cwd: '${workspaceFolder}' }); - const result = handleWorkspaceConfig(options); + const result = handleWorkspaceConfig(mockProjectPath, options); expect(result).toEqual({ launchJsonPath: mockProjectPath, cwd: '${workspaceFolder}' @@ -177,10 +164,9 @@ describe('launchConfig Unit Tests', () => { }); it('should handle open folder but no workspace file case', () => { - const mockProjectPath = '/mock/project/path'; - const mockTargetFolder = '/target/folder'; + const mockProjectPath = path.join('/mock/project/path'); + const mockTargetFolder = path.join('/target/folder'); const options = { - projectPath: mockProjectPath, vscode: { ...mockVscode, workspace: { ...mockVscode.workspace, workspaceFile: undefined } @@ -193,7 +179,7 @@ describe('launchConfig Unit Tests', () => { (getLaunchJsonPath as jest.Mock).mockReturnValue(mockTargetFolder); // Call the function under test - const result = handleWorkspaceConfig(options); + const result = handleWorkspaceConfig(mockProjectPath, options); // Assertions expect(result).toEqual({ @@ -210,9 +196,8 @@ describe('launchConfig Unit Tests', () => { }); it('should handle no workspace case', () => { - const mockProjectPath = '/mock/project/path'; + const mockProjectPath = path.join('/mock/project/path'); const options = { - projectPath: mockProjectPath, vscode: { ...mockVscode, workspace: undefined } } as DebugOptions; (handleAppsNotInWorkspace as jest.Mock).mockReturnValue({ @@ -220,7 +205,7 @@ describe('launchConfig Unit Tests', () => { cwd: '${workspaceFolder}' }); - const result = handleWorkspaceConfig(options); + const result = handleWorkspaceConfig(mockProjectPath, options); expect(result).toEqual({ launchJsonPath: mockProjectPath, cwd: '${workspaceFolder}' @@ -229,8 +214,8 @@ describe('launchConfig Unit Tests', () => { }); it('should handle saved workspace case', () => { - const mockProjectPath = '/mock/project/path'; - const mockTargetFolder = '/target/folder'; + const mockProjectPath = path.join('/mock/project/path'); + const mockTargetFolder = path.join('/target/folder'); const mockVscode = { workspace: { getWorkspaceFolder: jest.fn().mockReturnValue({ uri: { fsPath: mockTargetFolder } }), @@ -239,11 +224,10 @@ describe('launchConfig Unit Tests', () => { }; // Prepare options for the test const options = { - projectPath: mockProjectPath, vscode: mockVscode } as DebugOptions; // Call the function under test - const result = handleWorkspaceConfig(options); + const result = handleWorkspaceConfig(mockProjectPath, options); // Assertions expect(result).toEqual({ launchJsonPath: mockTargetFolder, @@ -270,11 +254,10 @@ describe('launchConfig Unit Tests', () => { // Prepare options for the test const options = { - projectPath: mockProjectPath, vscode: mockVscode } as DebugOptions; // Call the function under test - const result = handleWorkspaceConfig(options); + const result = handleWorkspaceConfig(mockProjectPath, options); // Assertions expect(result).toEqual({ launchJsonPath: mockProjectPath, diff --git a/packages/launch-config/test/launch-config-crud/create.test.ts b/packages/launch-config/test/launch-config-crud/create.test.ts index e6c9b19e78..718b8e792f 100644 --- a/packages/launch-config/test/launch-config-crud/create.test.ts +++ b/packages/launch-config/test/launch-config-crud/create.test.ts @@ -1,14 +1,35 @@ -import { join } from 'path'; +import { basename, join } from 'path'; import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; import { createLaunchConfig } from '../../src/launch-config-crud/create'; import { DirName, FileName } from '@sap-ux/project-access'; import { TestPaths } from '../test-data/utils'; +import type { DebugOptions } from '../../src/types'; +import { LAUNCH_JSON_FILE, ProjectDataSourceType } from '../../src/types'; +import type { Logger } from '@sap-ux/logger'; +import { t } from '../../src/i18n'; +import { isFolderInWorkspace } from '../../src/debug-config/helpers'; + +// Mock the helpers +jest.mock('../../src/debug-config/helpers', () => ({ + ...jest.requireActual('../../src/debug-config/helpers'), + isFolderInWorkspace: jest.fn() +})); describe('create', () => { const memFs = create(createStorage()); const memFilePath = join(TestPaths.tmpDir, 'fe-projects', FileName.Package); const memFileContent = '{}\n'; + const mockLog = { + error: jest.fn(), + info: jest.fn() + } as unknown as Logger; + + const clearMemFsPaths = (path: string) => { + if (memFs.exists(path)) { + memFs.delete(path); + } + }; beforeEach(() => { memFs.writeJSON(memFilePath, memFileContent); @@ -153,4 +174,279 @@ describe('create', () => { ] }); }); + + test('launch.json file is missing, create new file with new config when debug options is provided', async () => { + const projectPath = join(TestPaths.tmpDir, 'test-projects'); + const launchConfigPath = join(projectPath, '.vscode', 'launch.json'); + if (memFs.exists(launchConfigPath)) { + memFs.delete(launchConfigPath); + } + const fs = await createLaunchConfig( + projectPath, + { + name: 'test-projects', + projectRoot: projectPath, + debugOptions: { + datasourceType: ProjectDataSourceType.odataServiceUrl, + vscode: true + } as DebugOptions + }, + memFs, + mockLog + ); + + expect(fs.exists(launchConfigPath)).toBe(true); + expect(mockLog.info).toHaveBeenCalledWith( + t('startServerMessage', { + folder: basename(projectPath), + npmCommand: 'start' + }) + ); + expect(fs.readJSON(launchConfigPath)).toStrictEqual({ + version: '0.2.0', + configurations: [ + { + name: 'Start test-projects', + type: 'node', + request: 'launch', + cwd: '${workspaceFolder}', + runtimeExecutable: 'npx', + windows: { + runtimeExecutable: 'npx.cmd' + }, + runtimeArgs: ['fiori', 'run'], + args: ['--open', 'index.htmlundefined'], + console: 'internalConsole', + internalConsoleOptions: 'openOnSessionStart', + outputCapture: 'std', + env: { + 'DEBUG': '--inspect', + 'FIORI_TOOLS_URL_PARAMS': 'sap-ui-xx-viewCache=false' + } + }, + { + name: 'Start test-projects Local', + type: 'node', + request: 'launch', + cwd: '${workspaceFolder}', + runtimeExecutable: 'npx', + windows: { + runtimeExecutable: 'npx.cmd' + }, + runtimeArgs: ['fiori', 'run'], + args: ['--config', './ui5-local.yaml', '--open', 'index.htmlundefined'], + console: 'internalConsole', + internalConsoleOptions: 'openOnSessionStart', + outputCapture: 'std', + env: { + 'FIORI_TOOLS_URL_PARAMS': 'sap-ui-xx-viewCache=false' + } + } + ] + }); + }); + + test('launch.json file is missing, will not create config when debug options provided and app source is cap project', async () => { + const projectPath = join(TestPaths.tmpDir, 'test-projects'); + const launchConfigPath = join(projectPath, DirName.VSCode, LAUNCH_JSON_FILE); + clearMemFsPaths(launchConfigPath); + + const fs = await createLaunchConfig( + TestPaths.tmpDir, + { + name: 'test-projects', + projectRoot: projectPath, + debugOptions: { + datasourceType: ProjectDataSourceType.capProject, + vscode: true + } as DebugOptions + }, + memFs, + mockLog + ); + expect(fs.exists(launchConfigPath)).toBe(false); + expect(mockLog.info).toHaveBeenCalledWith( + t('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' }) + ); + }); + + test('Should create launch.json or run in Yeoman CLI or if vscode not found', async () => { + const projectPath = join(TestPaths.tmpDir, 'test-projects'); + const launchConfigPath = join(projectPath, DirName.VSCode, LAUNCH_JSON_FILE); + clearMemFsPaths(launchConfigPath); + const fs = await createLaunchConfig( + TestPaths.tmpDir, + { + name: 'test-projects', + projectRoot: projectPath, + debugOptions: { + datasourceType: ProjectDataSourceType.capProject, + vscode: false + } as DebugOptions + }, + memFs, + mockLog + ); + expect(fs.exists(launchConfigPath)).toBe(false); + }); + + test('launch.json file already exists, update file with debig config when debug options is provided and app is created out of', async () => { + const projectPath = join(TestPaths.tmpDir, 'test', 'test-projects'); + const launchJSONPath = join(TestPaths.tmpDir, 'test', '.vscode', 'launch.json'); + clearMemFsPaths(launchJSONPath); + memFs.writeJSON(launchJSONPath, { + version: '0.2.0', + configurations: [ + { + name: 'LaunchConfig_One' + } + ] + }); + (isFolderInWorkspace as jest.Mock).mockReturnValue(true); + const result: any = await createLaunchConfig( + projectPath, + { + name: 'test-projects', + projectRoot: projectPath, + debugOptions: { + datasourceType: ProjectDataSourceType.odataServiceUrl, + vscode: { + workspace: { + workspaceFile: { scheme: 'file' } + } + } as any, + isAppStudio: false + } as DebugOptions + }, + memFs + ); + expect(result.exists(launchJSONPath)).toBe(true); + const expectedLaunchConfigPath = join(TestPaths.tmpDir, 'test', '.vscode', 'launch.json'); + const updatedJson = result.readJSON(expectedLaunchConfigPath); + expect(updatedJson).toStrictEqual({ + version: '0.2.0', + configurations: [ + { + name: 'LaunchConfig_One' + }, + { + name: 'Start test-projects', + type: 'node', + request: 'launch', + cwd: '${workspaceFolder}/test-projects', + runtimeExecutable: 'npx', + windows: { + runtimeExecutable: 'npx.cmd' + }, + runtimeArgs: ['fiori', 'run'], + args: ['--open', 'index.htmlundefined'], + console: 'internalConsole', + internalConsoleOptions: 'openOnSessionStart', + outputCapture: 'std', + env: { + DEBUG: '--inspect', + FIORI_TOOLS_URL_PARAMS: 'sap-ui-xx-viewCache=false' + } + }, + { + name: 'Start test-projects Local', + type: 'node', + request: 'launch', + cwd: '${workspaceFolder}/test-projects', + runtimeExecutable: 'npx', + windows: { + runtimeExecutable: 'npx.cmd' + }, + runtimeArgs: ['fiori', 'run'], + args: ['--config', './ui5-local.yaml', '--open', 'index.htmlundefined'], + console: 'internalConsole', + internalConsoleOptions: 'openOnSessionStart', + outputCapture: 'std', + env: { + FIORI_TOOLS_URL_PARAMS: 'sap-ui-xx-viewCache=false' + } + } + ] + }); + }); + + test('launch.json file already exists, update file with debig config when debug options is provided', async () => { + const projectPath = join(TestPaths.tmpDir, 'test', 'test-projects'); + const launchJSONPath = join(TestPaths.tmpDir, 'test', '.vscode', 'launch.json'); + clearMemFsPaths(launchJSONPath); + memFs.writeJSON(launchJSONPath, { + version: '0.2.0', + configurations: [ + { + name: 'LaunchConfig_One' + } + ] + }); + (isFolderInWorkspace as jest.Mock).mockReturnValue(true); + const result: any = await createLaunchConfig( + projectPath, + { + name: 'test-projects', + projectRoot: projectPath, + debugOptions: { + datasourceType: ProjectDataSourceType.odataServiceUrl, + vscode: { + workspace: { + workspaceFile: { scheme: 'file' } + } + } as any, + isAppStudio: false + } as DebugOptions + }, + memFs + ); + expect(result.exists(launchJSONPath)).toBe(true); + const expectedLaunchConfigPath = join(TestPaths.tmpDir, 'test', '.vscode', 'launch.json'); + const updatedJson = result.readJSON(expectedLaunchConfigPath); + expect(updatedJson).toStrictEqual({ + version: '0.2.0', + configurations: [ + { + name: 'LaunchConfig_One' + }, + { + name: 'Start test-projects', + type: 'node', + request: 'launch', + cwd: '${workspaceFolder}/test-projects', + runtimeExecutable: 'npx', + windows: { + runtimeExecutable: 'npx.cmd' + }, + runtimeArgs: ['fiori', 'run'], + args: ['--open', 'index.htmlundefined'], + console: 'internalConsole', + internalConsoleOptions: 'openOnSessionStart', + outputCapture: 'std', + env: { + DEBUG: '--inspect', + FIORI_TOOLS_URL_PARAMS: 'sap-ui-xx-viewCache=false' + } + }, + { + name: 'Start test-projects Local', + type: 'node', + request: 'launch', + cwd: '${workspaceFolder}/test-projects', + runtimeExecutable: 'npx', + windows: { + runtimeExecutable: 'npx.cmd' + }, + runtimeArgs: ['fiori', 'run'], + args: ['--config', './ui5-local.yaml', '--open', 'index.htmlundefined'], + console: 'internalConsole', + internalConsoleOptions: 'openOnSessionStart', + outputCapture: 'std', + env: { + FIORI_TOOLS_URL_PARAMS: 'sap-ui-xx-viewCache=false' + } + } + ] + }); + }); }); diff --git a/packages/launch-config/test/launch-config-crud/update.test.ts b/packages/launch-config/test/launch-config-crud/update.test.ts index 53a0ec8cd3..a4a328542e 100644 --- a/packages/launch-config/test/launch-config-crud/update.test.ts +++ b/packages/launch-config/test/launch-config-crud/update.test.ts @@ -5,6 +5,7 @@ import { create } from 'mem-fs-editor'; import { createLaunchConfig, LAUNCH_JSON_FILE, updateLaunchConfig } from '../../src'; import { TestPaths } from '../test-data/utils'; import { parse } from 'jsonc-parser'; +import type { Editor } from 'mem-fs-editor'; function checkJSONComments(launchJsonString: string) { expect(launchJsonString).toMatch('// test json with comments - comment 1'); @@ -34,7 +35,7 @@ describe('update', () => { test('Create and then update existing launch config in launch.json', async (): Promise => { // create a new const launchJSONPath = join(TestPaths.feProjectsLaunchConfig); - let result = await createLaunchConfig( + let result: Editor = await createLaunchConfig( TestPaths.feProjects, { name: 'LaunchConfig_One', diff --git a/packages/launch-config/tsconfig.json b/packages/launch-config/tsconfig.json index d03f1afd91..c8d9cee638 100644 --- a/packages/launch-config/tsconfig.json +++ b/packages/launch-config/tsconfig.json @@ -13,15 +13,9 @@ { "path": "../logger" }, - { - "path": "../odata-service-inquirer" - }, { "path": "../project-access" }, - { - "path": "../store" - }, { "path": "../ui5-config" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 919978dd54..6b18891833 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1656,15 +1656,9 @@ importers: packages/launch-config: dependencies: - '@sap-ux/odata-service-inquirer': - specifier: workspace:* - version: link:../odata-service-inquirer '@sap-ux/project-access': specifier: workspace:* version: link:../project-access - '@sap-ux/store': - specifier: workspace:* - version: link:../store '@sap-ux/ui5-config': specifier: workspace:* version: link:../ui5-config From 1acf3d234ed2bd8f8583e0251d42caad6f7fd13e Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 19 Sep 2024 16:57:59 +0000 Subject: [PATCH 028/122] chore: apply latest changesets --- .changeset/tidy-papayas-film.md | 6 ------ packages/launch-config/CHANGELOG.md | 7 +++++++ packages/launch-config/package.json | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .changeset/tidy-papayas-film.md diff --git a/.changeset/tidy-papayas-film.md b/.changeset/tidy-papayas-film.md deleted file mode 100644 index 093413332b..0000000000 --- a/.changeset/tidy-papayas-film.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@sap-ux/launch-config': minor ---- - -Reverted the use of Node.js `fs` modules and replaced them with `mem-fs` for writing launch config files & Removed `writeApplicationInfoSettings()` from `@sap-ux/launch-config` -Refactoring create launch config functionalities. \ No newline at end of file diff --git a/packages/launch-config/CHANGELOG.md b/packages/launch-config/CHANGELOG.md index 78c0f0bee9..8f34582bb6 100644 --- a/packages/launch-config/CHANGELOG.md +++ b/packages/launch-config/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/launch-config +## 0.5.0 + +### Minor Changes + +- 463f482: Reverted the use of Node.js `fs` modules and replaced them with `mem-fs` for writing launch config files & Removed `writeApplicationInfoSettings()` from `@sap-ux/launch-config` + Refactoring create launch config functionalities. + ## 0.4.4 ### Patch Changes diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index ce20331e55..a7344575bd 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/launch-config", - "version": "0.4.4", + "version": "0.5.0", "description": "SAP Fiori tools launch config administration", "repository": { "type": "git", From 15c57bce95c0272d893f019866f1240a1faa637c Mon Sep 17 00:00:00 2001 From: Tom <114915993+tom-sap@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:11:55 +0100 Subject: [PATCH 029/122] fix(ui-c): accessibility updates for uitable (#2391) * fix(ui-c): accessibility updates for uitable * Create curly-points-argue.md --- .changeset/curly-points-argue.md | 5 +++ .../src/components/UITable/UITable-helper.tsx | 7 +++-- .../src/components/UITable/UITable.scss | 31 ++++++++++++++++--- .../src/components/UITable/UITable.tsx | 4 +-- 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 .changeset/curly-points-argue.md diff --git a/.changeset/curly-points-argue.md b/.changeset/curly-points-argue.md new file mode 100644 index 0000000000..b469880811 --- /dev/null +++ b/.changeset/curly-points-argue.md @@ -0,0 +1,5 @@ +--- +"@sap-ux/ui-components": patch +--- + +fix(ui-c): accessibility updates for uitable diff --git a/packages/ui-components/src/components/UITable/UITable-helper.tsx b/packages/ui-components/src/components/UITable/UITable-helper.tsx index 4280da9204..77e82f8894 100644 --- a/packages/ui-components/src/components/UITable/UITable-helper.tsx +++ b/packages/ui-components/src/components/UITable/UITable-helper.tsx @@ -203,10 +203,13 @@ export const _onHeaderRender: IRenderFunction = (props, def if (item?.column) { const column: UIColumn = item.column; const editable = (column.editable ? '' : 'not-') + 'editable-container'; - const containerDiv = column.key !== '__row_number__' ?
: null; + const isRowNumber = column.key === '__row_number__'; + const containerDiv = isRowNumber ?
: null; + // row number column header is focusable on the parent of this cell + const isFocusable = !isRowNumber; return ( -
+
{column.iconName && ( )} diff --git a/packages/ui-components/src/components/UITable/UITable.scss b/packages/ui-components/src/components/UITable/UITable.scss index da5071afd2..2bce586e3f 100644 --- a/packages/ui-components/src/components/UITable/UITable.scss +++ b/packages/ui-components/src/components/UITable/UITable.scss @@ -62,6 +62,10 @@ overflow: hidden; position: relative; justify-content: center; + outline-offset: -5px; + position: absolute; + inset: 0; + padding-inline: 12px 8px; .type-icon { padding: 3px 10px 0 0; @@ -86,6 +90,11 @@ } } + &:focus { + outline: none; + box-shadow: 0 0 0 3px var(--vscode-focusBorder) inset; + } + .ms-DetailsHeader-cell, .ms-DetailsHeader-cell:hover, .ms-DetailsHeader-cell .ms-Icon { @@ -105,8 +114,22 @@ } .ms-DetailsHeader-cell { - box-shadow: inset 0 1px 0 var(--vscode-editorWidget-border), - inset 0 -1px 0 var(--vscode-editorWidget-border), inset -1px 0 0 var(--vscode-editorWidget-border); + box-shadow: + inset 0 1px 0 var(--vscode-editorWidget-border), + inset 0 -1px 0 var(--vscode-editorWidget-border), + inset -1px 0 0 var(--vscode-editorWidget-border); + + &:focus { + outline: none; + + &::after { + display: none; + } + .data-editor__header-cell { + outline: none; + box-shadow: 0 0 0 3px var(--vscode-focusBorder) inset; + } + } } .ms-DetailsHeader-cell:first-of-type { @@ -116,7 +139,7 @@ } &.ms-DetailsHeader .ms-DetailsHeader-cell.selected { - box-shadow: inset 0 1px 0 var(--vscode-editorWidget-border), inset 0 -3px 0 var(--vscode-focusBorder), + box-shadow: inset 0 1px 0 var(--vscode-editorWidget-border), inset 0 5px 0 var(--vscode-focusBorder), inset 0 -1px 0 var(--vscode-editorWidget-border), inset -1px 0 0 var(--vscode-editorWidget-border); } @@ -168,7 +191,7 @@ .ms-DetailsRow.is-selected .ms-DetailsRow-cellCheck { margin-top: 0; - background-color: var(--vscode-focusBorder); + box-shadow: 3px 0 0 var(--vscode-focusBorder) inset; } } diff --git a/packages/ui-components/src/components/UITable/UITable.tsx b/packages/ui-components/src/components/UITable/UITable.tsx index cf701b6335..fce3ff7ac9 100644 --- a/packages/ui-components/src/components/UITable/UITable.tsx +++ b/packages/ui-components/src/components/UITable/UITable.tsx @@ -266,7 +266,7 @@ export class UITable extends React.Component { // in app-migrator, show a warning message for library projects on main migration view if (props.item.hideCells && props.column.fieldName === 'moduleName' && !props.item.status) { return ( -
+
{cell?.props?.children || null}
This is a reuse library and does not require input during migration @@ -275,7 +275,7 @@ export class UITable extends React.Component { ); } else { return ( -
+
{cell?.props?.children || null}
); From 351e4033af9ea61b01e903bd19b3135ceecc1909 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 19 Sep 2024 18:22:44 +0000 Subject: [PATCH 030/122] chore: apply latest changesets --- .changeset/curly-points-argue.md | 5 ----- examples/prompting-ui/CHANGELOG.md | 8 ++++++++ examples/prompting-ui/package.json | 2 +- packages/ui-components/CHANGELOG.md | 6 ++++++ packages/ui-components/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 .changeset/curly-points-argue.md diff --git a/.changeset/curly-points-argue.md b/.changeset/curly-points-argue.md deleted file mode 100644 index b469880811..0000000000 --- a/.changeset/curly-points-argue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@sap-ux/ui-components": patch ---- - -fix(ui-c): accessibility updates for uitable diff --git a/examples/prompting-ui/CHANGELOG.md b/examples/prompting-ui/CHANGELOG.md index f8cd562ba7..ced897e799 100644 --- a/examples/prompting-ui/CHANGELOG.md +++ b/examples/prompting-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer-ui +## 0.1.2 + +### Patch Changes + +- Updated dependencies [15c57bc] + - @sap-ux/ui-components@1.18.1 + - @sap-ux/ui-prompting@0.1.11 + ## 0.1.1 ### Patch Changes diff --git a/examples/prompting-ui/package.json b/examples/prompting-ui/package.json index 8eb10ea093..e155d0e89a 100644 --- a/examples/prompting-ui/package.json +++ b/examples/prompting-ui/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/prompting-ui", - "version": "0.1.1", + "version": "0.1.2", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index a8b25981c2..4e8087e99f 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui-components +## 1.18.1 + +### Patch Changes + +- 15c57bc: fix(ui-c): accessibility updates for uitable + ## 1.18.0 ### Minor Changes diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 5b6859a5e1..9dd12a7a2c 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-components", - "version": "1.18.0", + "version": "1.18.1", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index 2bbbf8bf26..8bcd354363 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.1.11 + +### Patch Changes + +- Updated dependencies [15c57bc] + - @sap-ux/ui-components@1.18.1 + ## 0.1.10 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index f82822a635..2532077a33 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.1.10", + "version": "0.1.11", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From 00e1835f24dd29a385612163cbe7f48639dbd70f Mon Sep 17 00:00:00 2001 From: Davis Voicescuks Date: Fri, 20 Sep 2024 00:44:13 +0300 Subject: [PATCH 031/122] fix(preview-middleware): manifest changes not visible after reload (#2385) --------- Co-authored-by: Klaus Keller <66327622+Klaus-Keller@users.noreply.github.com> --- .changeset/afraid-dodos-buy.md | 7 +++ .../adp-tooling/src/preview/adp-preview.ts | 46 ++++++++++++---- .../test/unit/preview/adp-preview.test.ts | 38 +++++++++++++ .../test/unit/base/flp.test.ts | 2 + .../reload-middleware/src/base/livereload.ts | 25 +++++++++ .../reload-middleware/src/ui5/middleware.ts | 3 + .../test/unit/base/livereload.test.ts | 55 ++++++++++++++++++- 7 files changed, 164 insertions(+), 12 deletions(-) create mode 100644 .changeset/afraid-dodos-buy.md diff --git a/.changeset/afraid-dodos-buy.md b/.changeset/afraid-dodos-buy.md new file mode 100644 index 0000000000..85d4210ef3 --- /dev/null +++ b/.changeset/afraid-dodos-buy.md @@ -0,0 +1,7 @@ +--- +'@sap-ux/preview-middleware': patch +'@sap-ux/adp-tooling': patch +'@sap-ux/reload-middleware': patch +--- + +Fixed manifest changes not visible in preview after reload diff --git a/packages/adp-tooling/src/preview/adp-preview.ts b/packages/adp-tooling/src/preview/adp-preview.ts index fbd3355287..55cca14f45 100644 --- a/packages/adp-tooling/src/preview/adp-preview.ts +++ b/packages/adp-tooling/src/preview/adp-preview.ts @@ -6,13 +6,19 @@ import type { NextFunction, Request, Response, Router, RequestHandler } from 'ex import type { Logger, ToolsLogger } from '@sap-ux/logger'; import type { UI5FlexLayer } from '@sap-ux/project-access'; import { createAbapServiceProvider } from '@sap-ux/system-access'; -import type { MergedAppDescriptor } from '@sap-ux/axios-extension'; +import type { LayeredRepositoryService, MergedAppDescriptor } from '@sap-ux/axios-extension'; import RoutesHandler from './routes-handler'; import type { AdpPreviewConfig, CommonChangeProperties, DescriptorVariant, OperationType } from '../types'; import type { Editor } from 'mem-fs-editor'; import { addXmlFragment, isAddXMLChange, moduleNameContentMap, tryFixChange } from './change-handler'; +declare global { + // false positive, const can't be used here https://github.com/eslint/eslint/issues/15896 + // eslint-disable-next-line no-var + var __SAP_UX_MANIFEST_SYNC_REQUIRED__: boolean | undefined; +} + export const enum ApiRoutes { FRAGMENT = '/adp/api/fragment', CONTROLLER = '/adp/api/controller', @@ -32,10 +38,13 @@ export class AdpPreview { */ private routesHandler: RoutesHandler; + private lrep: LayeredRepositoryService | undefined; + private descriptorVariantId: string | undefined; + /** * @returns merged manifest. */ - get descriptor() { + get descriptor(): MergedAppDescriptor { if (this.mergedDescriptor) { return this.mergedDescriptor; } else { @@ -46,7 +55,9 @@ export class AdpPreview { /** * @returns a list of resources required to the adaptation project as well as the original app. */ - get resources() { + get resources(): { + [name: string]: string; + } { if (this.mergedDescriptor) { const resources = { [this.mergedDescriptor.name]: this.mergedDescriptor.url @@ -91,14 +102,29 @@ export class AdpPreview { * @returns the UI5 flex layer for which editing is enabled */ async init(descriptorVariant: DescriptorVariant): Promise { + this.descriptorVariantId = descriptorVariant.id; const provider = await createAbapServiceProvider( this.config.target, { ignoreCertErrors: this.config.ignoreCertErrors }, true, this.logger ); - const lrep = provider.getLayeredRepository(); + this.lrep = provider.getLayeredRepository(); + // fetch a merged descriptor from the backend + await this.lrep.getCsrfToken(); + await this.sync(); + return descriptorVariant.layer; + } + + /** + * Synchronize local changes with the backend. + * + */ + async sync(): Promise { + if (!this.lrep || !this.descriptorVariantId) { + throw new Error('Not initialized'); + } const zip = new ZipFile(); const files = await this.project.byGlob('**/*.*'); for (const file of files) { @@ -106,11 +132,7 @@ export class AdpPreview { } const buffer = zip.toBuffer(); - // fetch a merged descriptor from the backend - await lrep.getCsrfToken(); - this.mergedDescriptor = (await lrep.mergeAppDescriptorVariant(buffer))[descriptorVariant.id]; - - return descriptorVariant.layer; + this.mergedDescriptor = (await this.lrep.mergeAppDescriptorVariant(buffer))[this.descriptorVariantId]; } /** @@ -120,8 +142,12 @@ export class AdpPreview { * @param res outgoing response object * @param next next middleware that is to be called if the request cannot be handled */ - async proxy(req: Request, res: Response, next: NextFunction) { + async proxy(req: Request, res: Response, next: NextFunction): Promise { if (req.path === '/manifest.json') { + if (global.__SAP_UX_MANIFEST_SYNC_REQUIRED__) { + await this.sync(); + global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = false; + } res.status(200); res.send(JSON.stringify(this.descriptor.manifest, undefined, 2)); } else if (req.path === '/Component-preload.js') { diff --git a/packages/adp-tooling/test/unit/preview/adp-preview.test.ts b/packages/adp-tooling/test/unit/preview/adp-preview.test.ts index 2b87fb7f1c..41e81e8c16 100644 --- a/packages/adp-tooling/test/unit/preview/adp-preview.test.ts +++ b/packages/adp-tooling/test/unit/preview/adp-preview.test.ts @@ -176,6 +176,32 @@ describe('AdaptationProject', () => { expect(() => adp.descriptor).toThrowError(); expect(() => adp.resources).toThrowError(); + await expect(() => adp.sync()).rejects.toEqual(Error('Not initialized')); + }); + }); + describe('sync', () => { + test('updates merged descriptor', async () => { + const adp = new AdpPreview( + { + target: { + url: backend + } + }, + mockProject as unknown as ReaderCollection, + middlewareUtil, + logger + ); + + mockProject.byGlob.mockResolvedValueOnce([ + { + getPath: () => '/manifest.appdescr_variant', + getBuffer: () => Buffer.from(descriptorVariant) + } + ]); + await adp.init(JSON.parse(descriptorVariant)); + (adp as any).mergedDescriptor = undefined; + await adp.sync(); + expect(adp.descriptor).toBeDefined(); }); }); describe('proxy', () => { @@ -209,6 +235,18 @@ describe('AdaptationProject', () => { server = supertest(app); }); + afterEach(() => { + global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = false; + }); + + test('/manifest.json with sync', async () => { + global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = true; + const syncSpy = jest.spyOn(AdpPreview.prototype, 'sync').mockImplementation(() => Promise.resolve()); + const response = await server.get('/my/adaptation/manifest.json').expect(200); + expect(syncSpy).toHaveBeenCalledTimes(1); + expect(JSON.parse(response.text)).toEqual(mockMergedDescriptor.manifest); + }); + test('/manifest.json', async () => { const response = await server.get('/my/adaptation/manifest.json').expect(200); expect(JSON.parse(response.text)).toEqual(mockMergedDescriptor.manifest); diff --git a/packages/preview-middleware/test/unit/base/flp.test.ts b/packages/preview-middleware/test/unit/base/flp.test.ts index 20f0421e41..7186ac779d 100644 --- a/packages/preview-middleware/test/unit/base/flp.test.ts +++ b/packages/preview-middleware/test/unit/base/flp.test.ts @@ -524,6 +524,7 @@ describe('FlpSandbox', () => { describe('initAdp', () => { const url = 'http://sap.example'; + const syncSpy = jest.fn(); const adpToolingMock = jest.spyOn(adpTooling, 'AdpPreview').mockImplementation((): adpTooling.AdpPreview => { return { init: () => { @@ -539,6 +540,7 @@ describe('initAdp', () => { }, resources: [], proxy: jest.fn(), + sync: syncSpy, onChangeRequest: jest.fn(), addApis: jest.fn() } as unknown as adpTooling.AdpPreview; diff --git a/packages/reload-middleware/src/base/livereload.ts b/packages/reload-middleware/src/base/livereload.ts index ed553ad8e5..05b3126852 100644 --- a/packages/reload-middleware/src/base/livereload.ts +++ b/packages/reload-middleware/src/base/livereload.ts @@ -7,8 +7,15 @@ import { getAvailablePort } from './utils'; import { ToolsLogger } from '@sap-ux/logger'; import { isAppStudio, exposePort } from '@sap-ux/btp-utils'; import { promises } from 'fs'; +import { extname } from 'path'; import { defaultLiveReloadOpts, defaultConnectLivereloadOpts } from './constants'; +declare global { + // false positive, const can't be used here https://github.com/eslint/eslint/issues/15896 + // eslint-disable-next-line no-var + var __SAP_UX_MANIFEST_SYNC_REQUIRED__: boolean | undefined; +} + /** * Get a livereload server instance. * @@ -54,3 +61,21 @@ export const getConnectLivereload = async (options: ConnectLivereloadOptions): P return connectLivereload({ ...connectOpts, ...options }) as RequestHandler; }; + +/** + * Listen to file changes to set a global flag if there are any changes that affect manifest.json. + * + * @param livereload - Live reload server. + */ +export function watchManifestChanges(livereload: LiveReloadServer): void { + livereload.watcher.on('all', async (_event, path) => { + const fileExtension = extname(path); + if (fileExtension === '.appdescr_variant') { + global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = true; + } else if (fileExtension === '.change') { + if (path.endsWith('appdescr_fe_changePageConfiguration.change')) { + global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = true; + } + } + }); +} diff --git a/packages/reload-middleware/src/ui5/middleware.ts b/packages/reload-middleware/src/ui5/middleware.ts index c88dd40262..d2afd7f24b 100644 --- a/packages/reload-middleware/src/ui5/middleware.ts +++ b/packages/reload-middleware/src/ui5/middleware.ts @@ -9,6 +9,7 @@ import type { MiddlewareParameters } from '@ui5/server'; import type { RequestHandler } from 'express'; import { ToolsLogger, UI5ToolingTransport } from '@sap-ux/logger'; import { resolve } from 'path'; +import { watchManifestChanges } from '../base/livereload'; module.exports = async ({ options, middlewareUtil }: MiddlewareParameters): Promise => { const logger = new ToolsLogger({ @@ -38,6 +39,7 @@ module.exports = async ({ options, middlewareUtil }: MiddlewareParameters ({ __esModule: true, @@ -15,7 +16,7 @@ jest.mock('connect-livereload', () => ({ jest.mock('@sap-ux/btp-utils', () => { return { __esModule: true, - ...jest.requireActual('@sap-ux/btp-utils'), + ...jest.requireActual('@sap-ux/btp-utils') }; }); @@ -95,7 +96,9 @@ describe('Connect Livereload', () => { expect(connectLivereloadSpy).toHaveBeenCalledTimes(1); expect(exposeSpy).toHaveBeenCalledWith(12345); - expect(connectLivereloadSpy).toHaveBeenCalledWith(expect.objectContaining({ port: 12345, src: 'http://example.com/livereload.js?snipver=1&port=443' })); + expect(connectLivereloadSpy).toHaveBeenCalledWith( + expect.objectContaining({ port: 12345, src: 'http://example.com/livereload.js?snipver=1&port=443' }) + ); }); test('connect-livereload with default configuration', () => { @@ -110,3 +113,51 @@ describe('Connect Livereload', () => { expect(connectLivereloadSpy).toHaveBeenCalledWith(expect.objectContaining({ port: 12345 })); }); }); + +describe('adp backend sync', () => { + const onSpy = jest.fn void]>(); + + beforeEach(() => { + jest.spyOn(livereload, 'createServer').mockImplementation((): any => { + return { + watcher: { + on: onSpy + }, + config: { port: 35729 } + }; + }); + }); + + afterEach(() => { + jest.clearAllMocks(); + global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = false; + }); + + test('ignore property changes', async () => { + const server = await getLivereloadServer({}); + + watchManifestChanges(server); + + onSpy.mock.calls[0][1]('add', 'property.change'); + + expect(global.__SAP_UX_MANIFEST_SYNC_REQUIRED__).toBeFalsy(); + }); + test('sync on appdescr_variant changes', async () => { + const server = await getLivereloadServer({}); + + watchManifestChanges(server); + + onSpy.mock.calls[0][1]('change', 'manifest.appdescr_variant'); + + expect(global.__SAP_UX_MANIFEST_SYNC_REQUIRED__).toBe(true); + }); + test('sync on manifest change', async () => { + const server = await getLivereloadServer({}); + + watchManifestChanges(server); + + onSpy.mock.calls[0][1]('add', '123_appdescr_fe_changePageConfiguration.change'); + + expect(global.__SAP_UX_MANIFEST_SYNC_REQUIRED__).toBe(true); + }); +}); From 8f5c16ca008f699a37e7f689c308bb0c62bf7e5d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 19 Sep 2024 21:55:12 +0000 Subject: [PATCH 032/122] chore: apply latest changesets --- .changeset/afraid-dodos-buy.md | 7 ------- packages/adp-tooling/CHANGELOG.md | 6 ++++++ packages/adp-tooling/package.json | 2 +- packages/create/CHANGELOG.md | 8 ++++++++ packages/create/package.json | 2 +- packages/preview-middleware/CHANGELOG.md | 8 ++++++++ packages/preview-middleware/package.json | 2 +- packages/reload-middleware/CHANGELOG.md | 6 ++++++ packages/reload-middleware/package.json | 2 +- 9 files changed, 32 insertions(+), 11 deletions(-) delete mode 100644 .changeset/afraid-dodos-buy.md diff --git a/.changeset/afraid-dodos-buy.md b/.changeset/afraid-dodos-buy.md deleted file mode 100644 index 85d4210ef3..0000000000 --- a/.changeset/afraid-dodos-buy.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@sap-ux/preview-middleware': patch -'@sap-ux/adp-tooling': patch -'@sap-ux/reload-middleware': patch ---- - -Fixed manifest changes not visible in preview after reload diff --git a/packages/adp-tooling/CHANGELOG.md b/packages/adp-tooling/CHANGELOG.md index d6b0204910..e30c22cf1c 100644 --- a/packages/adp-tooling/CHANGELOG.md +++ b/packages/adp-tooling/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/adp-tooling +## 0.12.50 + +### Patch Changes + +- 00e1835: Fixed manifest changes not visible in preview after reload + ## 0.12.49 ### Patch Changes diff --git a/packages/adp-tooling/package.json b/packages/adp-tooling/package.json index fe6d4a4074..644ebf4c2c 100644 --- a/packages/adp-tooling/package.json +++ b/packages/adp-tooling/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling" }, - "version": "0.12.49", + "version": "0.12.50", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index 71788af300..f1550be146 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/create +## 0.8.20 + +### Patch Changes + +- Updated dependencies [00e1835] + - @sap-ux/preview-middleware@0.16.68 + - @sap-ux/adp-tooling@0.12.50 + ## 0.8.19 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index 39a428e0ae..a7f6efdc26 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/create", "description": "SAP Fiori tools module to add or remove features", - "version": "0.8.19", + "version": "0.8.20", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/preview-middleware/CHANGELOG.md b/packages/preview-middleware/CHANGELOG.md index 0fd9a2e889..0d7da954b0 100644 --- a/packages/preview-middleware/CHANGELOG.md +++ b/packages/preview-middleware/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/preview-middleware +## 0.16.68 + +### Patch Changes + +- 00e1835: Fixed manifest changes not visible in preview after reload +- Updated dependencies [00e1835] + - @sap-ux/adp-tooling@0.12.50 + ## 0.16.67 ### Patch Changes diff --git a/packages/preview-middleware/package.json b/packages/preview-middleware/package.json index 1907dd9a9b..3c90280afd 100644 --- a/packages/preview-middleware/package.json +++ b/packages/preview-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware" }, - "version": "0.16.67", + "version": "0.16.68", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/reload-middleware/CHANGELOG.md b/packages/reload-middleware/CHANGELOG.md index 106ea876b6..4b8bb0f55b 100644 --- a/packages/reload-middleware/CHANGELOG.md +++ b/packages/reload-middleware/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/reload-middleware +## 0.2.3 + +### Patch Changes + +- 00e1835: Fixed manifest changes not visible in preview after reload + ## 0.2.2 ### Patch Changes diff --git a/packages/reload-middleware/package.json b/packages/reload-middleware/package.json index 547f329853..739e52bb3c 100644 --- a/packages/reload-middleware/package.json +++ b/packages/reload-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Areload-middleware" }, - "version": "0.2.2", + "version": "0.2.3", "author": "@SAP/ux-tools-team", "license": "Apache-2.0", "main": "dist/index.js", From e12dd50bc7c4430fc7aae67faafd27aaee8fbfde Mon Sep 17 00:00:00 2001 From: Emre Cevik Date: Fri, 20 Sep 2024 08:56:27 +0200 Subject: [PATCH 033/122] fix: theme picker hover and border for dropdowns (#2377) * fix: add hover background for theme picker and border * changeset and removed comment * fix: removed unnecessary line * feedback --------- Co-authored-by: vinayhospete <126550907+vinayhospete@users.noreply.github.com> Co-authored-by: Davis Voicescuks --- .changeset/pretty-gorillas-crash.md | 5 +++++ packages/control-property-editor/src/Workarounds.scss | 5 ++--- .../src/components/ThemeSelectorCallout.scss | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/pretty-gorillas-crash.md diff --git a/.changeset/pretty-gorillas-crash.md b/.changeset/pretty-gorillas-crash.md new file mode 100644 index 0000000000..d9ec1b1847 --- /dev/null +++ b/.changeset/pretty-gorillas-crash.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/control-property-editor': patch +--- + +Added hover over theme picker and border for Callout diff --git a/packages/control-property-editor/src/Workarounds.scss b/packages/control-property-editor/src/Workarounds.scss index 7dd28e9739..d5d19902e0 100644 --- a/packages/control-property-editor/src/Workarounds.scss +++ b/packages/control-property-editor/src/Workarounds.scss @@ -90,7 +90,6 @@ } } -// Callout -.ms-Callout-main { - border: 1px solid var(--vscode-contrastBorder); +.ms-Callout { + border: 1px solid var(--vscode-widget-border); } diff --git a/packages/control-property-editor/src/components/ThemeSelectorCallout.scss b/packages/control-property-editor/src/components/ThemeSelectorCallout.scss index 2de4dd26c2..f1561c11b1 100644 --- a/packages/control-property-editor/src/components/ThemeSelectorCallout.scss +++ b/packages/control-property-editor/src/components/ThemeSelectorCallout.scss @@ -46,6 +46,11 @@ background-color: var(--vscode-progressBar-background); } +.theme-child:hover:not(.selected) { + background-color: var(--vscode-toolbar-hoverBackground, var(--vscode-menubar-selectionBackground)); + outline: 1px dashed var(--vscode-contrastActiveBorder); +} + div#theme-light-modern { margin-left: 3px; margin-bottom: 3px; From ad54319c2792998a763a557815f7639d910331ea Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 20 Sep 2024 07:07:40 +0000 Subject: [PATCH 034/122] chore: apply latest changesets --- .changeset/pretty-gorillas-crash.md | 5 ----- packages/control-property-editor/CHANGELOG.md | 6 ++++++ packages/control-property-editor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/pretty-gorillas-crash.md diff --git a/.changeset/pretty-gorillas-crash.md b/.changeset/pretty-gorillas-crash.md deleted file mode 100644 index d9ec1b1847..0000000000 --- a/.changeset/pretty-gorillas-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/control-property-editor': patch ---- - -Added hover over theme picker and border for Callout diff --git a/packages/control-property-editor/CHANGELOG.md b/packages/control-property-editor/CHANGELOG.md index 5dd0fc03d4..038f108618 100644 --- a/packages/control-property-editor/CHANGELOG.md +++ b/packages/control-property-editor/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/control-property-editor +## 0.5.8 + +### Patch Changes + +- e12dd50: Added hover over theme picker and border for Callout + ## 0.5.7 ### Patch Changes diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index 533794c08d..0eb288f031 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -3,7 +3,7 @@ "displayName": "Control Property Editor", "description": "Control Property Editor", "license": "Apache-2.0", - "version": "0.5.7", + "version": "0.5.8", "main": "dist/app.js", "repository": { "type": "git", From 1fdac943a85d4d136e07983381f10e2b67abd2dc Mon Sep 17 00:00:00 2001 From: Andis Redmans <90789422+815are@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:45:06 +0300 Subject: [PATCH 035/122] fix: missing unique react key (#2368) * fix: missing unique react key missing unique react key * test: additional test additional test * changeset changeset * fix: sonar sonar * fix: lint lint --------- Co-authored-by: Klaus Keller <66327622+Klaus-Keller@users.noreply.github.com> Co-authored-by: Davis Voicescuks --- .changeset/mean-jeans-grow.md | 5 ++++ .../src/components/UITable/UITable.tsx | 21 +++++++++++++-- .../test/unit/components/UITable.test.tsx | 27 +++++++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .changeset/mean-jeans-grow.md diff --git a/.changeset/mean-jeans-grow.md b/.changeset/mean-jeans-grow.md new file mode 100644 index 0000000000..685cc25d4e --- /dev/null +++ b/.changeset/mean-jeans-grow.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/ui-components': patch +--- + +UITable. Fix for react warning 'Each child in a list should have a unique "key" prop' diff --git a/packages/ui-components/src/components/UITable/UITable.tsx b/packages/ui-components/src/components/UITable/UITable.tsx index fce3ff7ac9..97f22e41c9 100644 --- a/packages/ui-components/src/components/UITable/UITable.tsx +++ b/packages/ui-components/src/components/UITable/UITable.tsx @@ -254,6 +254,11 @@ export class UITable extends React.Component { return null; } const cell = defaultRender(props); + const { column, cellValueKey } = props; + let key = column.key; + if (cellValueKey !== undefined) { + key += `-${cellValueKey}`; + } const onClick = (e: React.MouseEvent | null) => { const target = e?.target as HTMLElement; const targetTag = target?.tagName; @@ -266,7 +271,13 @@ export class UITable extends React.Component { // in app-migrator, show a warning message for library projects on main migration view if (props.item.hideCells && props.column.fieldName === 'moduleName' && !props.item.status) { return ( -
+
{cell?.props?.children || null}
This is a reuse library and does not require input during migration @@ -275,7 +286,13 @@ export class UITable extends React.Component { ); } else { return ( -
+
{cell?.props?.children || null}
); diff --git a/packages/ui-components/test/unit/components/UITable.test.tsx b/packages/ui-components/test/unit/components/UITable.test.tsx index f9362ecfb9..716c20b64d 100644 --- a/packages/ui-components/test/unit/components/UITable.test.tsx +++ b/packages/ui-components/test/unit/components/UITable.test.tsx @@ -127,6 +127,33 @@ describe('', () => { expect(wrapper.find('.ms-DetailsList').length).toEqual(1); }); + it('Render table with data', () => { + const moduleName = { + key: 'moduleName', + name: 'moduleName', + fieldName: 'moduleName', + minWidth: 100, + maxWidth: 200, + isResizable: true, + editable: true, + validate: undefined as any, + iconName: undefined as any, + iconTooltip: undefined as any, + columnControlType: ColumnControlType.UITextInput, + getValueKey: () => 'dummyKey' + }; + const wrapper = Enzyme.mount( + + ); + expect(wrapper.find('[data-automationid="DetailsRowCell"]').at(0).key()).toEqual('textcolumn'); + expect(wrapper.find('[data-automationid="DetailsRowCell"]').at(1).key()).toEqual('moduleName-dummyKey'); + }); + it('Toggle cell for editing', () => { const wrapper = Enzyme.mount(); From 6365cecb1851d1414f9e85fa2ce4ff13e41b06ea Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 20 Sep 2024 07:56:40 +0000 Subject: [PATCH 036/122] chore: apply latest changesets --- .changeset/mean-jeans-grow.md | 5 ----- examples/prompting-ui/CHANGELOG.md | 8 ++++++++ examples/prompting-ui/package.json | 2 +- packages/ui-components/CHANGELOG.md | 6 ++++++ packages/ui-components/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 .changeset/mean-jeans-grow.md diff --git a/.changeset/mean-jeans-grow.md b/.changeset/mean-jeans-grow.md deleted file mode 100644 index 685cc25d4e..0000000000 --- a/.changeset/mean-jeans-grow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/ui-components': patch ---- - -UITable. Fix for react warning 'Each child in a list should have a unique "key" prop' diff --git a/examples/prompting-ui/CHANGELOG.md b/examples/prompting-ui/CHANGELOG.md index ced897e799..629a22f58d 100644 --- a/examples/prompting-ui/CHANGELOG.md +++ b/examples/prompting-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer-ui +## 0.1.3 + +### Patch Changes + +- Updated dependencies [1fdac94] + - @sap-ux/ui-components@1.18.2 + - @sap-ux/ui-prompting@0.1.12 + ## 0.1.2 ### Patch Changes diff --git a/examples/prompting-ui/package.json b/examples/prompting-ui/package.json index e155d0e89a..7909f14ca0 100644 --- a/examples/prompting-ui/package.json +++ b/examples/prompting-ui/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/prompting-ui", - "version": "0.1.2", + "version": "0.1.3", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index 4e8087e99f..7373e483ae 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui-components +## 1.18.2 + +### Patch Changes + +- 1fdac94: UITable. Fix for react warning 'Each child in a list should have a unique "key" prop' + ## 1.18.1 ### Patch Changes diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 9dd12a7a2c..dd86c5e927 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-components", - "version": "1.18.1", + "version": "1.18.2", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index 8bcd354363..c71e3d6fbe 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.1.12 + +### Patch Changes + +- Updated dependencies [1fdac94] + - @sap-ux/ui-components@1.18.2 + ## 0.1.11 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index 2532077a33..04e70f86de 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.1.11", + "version": "0.1.12", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From a18d4a27d86b58afa6a993c83c59b876323e0441 Mon Sep 17 00:00:00 2001 From: Andis Redmans <90789422+815are@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:14:31 +0300 Subject: [PATCH 037/122] feat(fpm-writer): property `allowAutoAddDependencyLib` to the building block API, which allows turning off the automatic addition of the 'sap.fe.macros' library (#2393) * feat: allow to ignore auto generation allow to ignore auto generation * feat: enhance storybook example enhance storybook example * fix: lint lint * feat: implementation implementation * changelog changelog * fix: lint lint --------- Co-authored-by: Austin Devine --- .changeset/eight-jobs-unite.md | 5 ++ .changeset/sweet-rivers-dress.md | 5 ++ examples/prompting-ui/src/BuildingBlock.tsx | 10 +++ .../src/addons/preview/component.tsx | 20 +++--- .../fe-fpm-writer/src/building-block/index.ts | 71 +++++++++++++------ .../fe-fpm-writer/src/building-block/types.ts | 8 +++ .../__snapshots__/building-block.test.ts.snap | 68 ++++++++++++++++++ .../test/unit/building-block.test.ts | 58 +++++++++++++++ 8 files changed, 215 insertions(+), 30 deletions(-) create mode 100644 .changeset/eight-jobs-unite.md create mode 100644 .changeset/sweet-rivers-dress.md diff --git a/.changeset/eight-jobs-unite.md b/.changeset/eight-jobs-unite.md new file mode 100644 index 0000000000..20a681bdfa --- /dev/null +++ b/.changeset/eight-jobs-unite.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/fe-fpm-writer': patch +--- + +Added property `allowAutoAddDependencyLib` to the building block API. This property allows turning off the automatic addition of the 'sap.fe.macros' library to the 'manifest.json' file under library dependencies (`"sap.ui5"/"dependencies"/"libs"`). The default value is `true`. diff --git a/.changeset/sweet-rivers-dress.md b/.changeset/sweet-rivers-dress.md new file mode 100644 index 0000000000..4b514d9302 --- /dev/null +++ b/.changeset/sweet-rivers-dress.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/prompting-ui': patch +--- + +Extend the building block examples with an option to toggle the `allowAutoAddDependencyLib` property, allowing to turning off the automatic addition of the 'sap.fe.macros' library to the 'manifest.json'. diff --git a/examples/prompting-ui/src/BuildingBlock.tsx b/examples/prompting-ui/src/BuildingBlock.tsx index cdc69461ef..f479440e0f 100644 --- a/examples/prompting-ui/src/BuildingBlock.tsx +++ b/examples/prompting-ui/src/BuildingBlock.tsx @@ -35,6 +35,7 @@ export const BuildingBlockQuestions = (props: { showDescriptions: true }); const [alwaysAbsolutePath, setAlwaysAbsolutePath] = useState(true); + const [allowAutoAddDependencyLib, setAllowAutoAddDependencyLib] = useState(true); const choices = useChoices(); const { groups, questions, initialAnswers = {} } = useQuestions(type, visibleQuestions); const [answers, setAnswers] = useState(externalAnswers ?? initialAnswers); @@ -137,6 +138,15 @@ export const BuildingBlockQuestions = (props: { setAlwaysAbsolutePath(!!checked); }} /> + , checked?: boolean) => { + const newAnswers = setAnswer({ ...answers }, 'allowAutoAddDependencyLib', checked); + setAnswers(newAnswers); + setAllowAutoAddDependencyLib(!!checked); + }} + />
{ const { active = false } = props; - const [preview, setPreview] = useState<{ codeSnippets: { content: string; fileName: string }[]; answers: unknown }>( - { - answers: {}, - codeSnippets: [] - } - ); + const [preview, setPreview] = useState<{ + codeSnippets: { content: string; fileName: string; language: SupportedLanguages }[]; + answers: unknown; + }>({ + answers: {}, + codeSnippets: [] + }); useEffect(function () { const handleMessage = (responseAction: Actions) => { @@ -27,7 +30,8 @@ export const render = (props: { active?: boolean }): React.ReactElement => { setPreview({ codeSnippets: Object.values(responseAction.codeSnippets).map((snippet) => ({ content: snippet.content, - fileName: snippet.filePathProps?.fileName ?? 'Please select a file' + fileName: snippet.filePathProps?.fileName ?? 'Please select a file', + language: snippet.language === 'xml' ? 'html' : (snippet.language as SupportedLanguages) })), answers: answersPreview }); @@ -48,7 +52,7 @@ export const render = (props: { active?: boolean }): React.ReactElement => { {preview.codeSnippets.map((snippet) => ( - {snippet.content} + {snippet.content} ))} diff --git a/packages/fe-fpm-writer/src/building-block/index.ts b/packages/fe-fpm-writer/src/building-block/index.ts index aabb2a2025..001d01ee98 100644 --- a/packages/fe-fpm-writer/src/building-block/index.ts +++ b/packages/fe-fpm-writer/src/building-block/index.ts @@ -2,7 +2,7 @@ import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; import { render } from 'ejs'; import type { Editor } from 'mem-fs-editor'; -import { join, parse } from 'path'; +import { join, parse, relative } from 'path'; import { BuildingBlockType, type BuildingBlock, type BuildingBlockConfig, type BuildingBlockMetaPath } from './types'; import { DOMParser, XMLSerializer } from '@xmldom/xmldom'; import * as xpath from 'xpath'; @@ -40,31 +40,32 @@ export async function generateBuildingBlock( config: BuildingBlockConfig, fs?: Editor ): Promise { + const { viewOrFragmentPath, aggregationPath, buildingBlockData, allowAutoAddDependencyLib = true } = config; // Validate the base and view paths if (!fs) { fs = create(createStorage()); } validateBasePath(basePath, fs, []); - if (!fs.exists(join(basePath, config.viewOrFragmentPath))) { - throw new Error(`Invalid view path ${config.viewOrFragmentPath}.`); + if (!fs.exists(join(basePath, viewOrFragmentPath))) { + throw new Error(`Invalid view path ${viewOrFragmentPath}.`); } // Read the view xml and template files and update contents of the view xml file - const xmlDocument = getUI5XmlDocument(basePath, config.viewOrFragmentPath, fs); + const xmlDocument = getUI5XmlDocument(basePath, viewOrFragmentPath, fs); const { content: manifest } = await getManifest(basePath, fs); - const templateDocument = getTemplateDocument(config.buildingBlockData, xmlDocument, fs, manifest); - fs = updateViewFile(basePath, config.viewOrFragmentPath, config.aggregationPath, xmlDocument, templateDocument, fs); + const templateDocument = getTemplateDocument(buildingBlockData, xmlDocument, fs, manifest); + fs = updateViewFile(basePath, viewOrFragmentPath, aggregationPath, xmlDocument, templateDocument, fs); - if (manifest && !validateDependenciesLibs(manifest, ['sap.fe.macros'])) { + if (allowAutoAddDependencyLib && manifest && !validateDependenciesLibs(manifest, ['sap.fe.macros'])) { // "sap.fe.macros" is missing - enhance manifest.json for missing "sap.fe.macros" const manifestPath = await getManifestPath(basePath, fs); - const templatePath = getTemplatePath('/building-block/common/manifest.json'); + const manifestContent = await getManifestContent(fs); const content = fs.read(manifestPath); const tabInfo = detectTabSpacing(content); extendJSON(fs, { filepath: manifestPath, - content: render(fs.read(templatePath), { libraries: { 'sap.fe.macros': {} } }), + content: manifestContent, tabInfo: tabInfo }); } @@ -220,6 +221,18 @@ function getTemplateContent( ); } +/** + * Method returns the manifest content for the required dependency library. + * + * @param {Editor} fs - the memfs editor instance + * @returns {Promise} Manifest content for the required dependency library. + */ +export async function getManifestContent(fs: Editor): Promise { + // "sap.fe.macros" is missing - enhance manifest.json for missing "sap.fe.macros" + const templatePath = getTemplatePath('/building-block/common/manifest.json'); + return render(fs.read(templatePath), { libraries: { 'sap.fe.macros': {} } }); +} + /** * Returns the template xml file document. * @@ -319,7 +332,9 @@ export async function getSerializedFileContent( config: BuildingBlockConfig, fs?: Editor ): Promise<{ [questionName: string]: CodeSnippet }> { - if (!config.buildingBlockData?.buildingBlockType) { + const snippets: { [questionName: string]: CodeSnippet } = {}; + const { buildingBlockData, viewOrFragmentPath, allowAutoAddDependencyLib = true } = config; + if (!buildingBlockData?.buildingBlockType) { return {}; } // Validate the base and view paths @@ -327,17 +342,29 @@ export async function getSerializedFileContent( fs = create(createStorage()); } // Read the view xml and template files and get content of the view xml file - const xmlDocument = config.viewOrFragmentPath - ? getUI5XmlDocument(basePath, config.viewOrFragmentPath, fs) - : undefined; - const { content: manifest } = await getManifest(basePath, fs, false); - const content = getTemplateContent(config.buildingBlockData, xmlDocument, manifest, fs, true); - const filePathProps = getFilePathProps(basePath, config.viewOrFragmentPath); - return { - viewOrFragmentPath: { - content, - language: CodeSnippetLanguage.XML, - filePathProps - } + const xmlDocument = viewOrFragmentPath ? getUI5XmlDocument(basePath, viewOrFragmentPath, fs) : undefined; + const { content: manifest, path: manifestPath } = await getManifest(basePath, fs, false); + const content = getTemplateContent(buildingBlockData, xmlDocument, manifest, fs, true); + const filePathProps = getFilePathProps(basePath, viewOrFragmentPath); + // Snippet for fragment xml + snippets['viewOrFragmentPath'] = { + content, + language: CodeSnippetLanguage.XML, + filePathProps }; + // Snippet for manifest.json + if (allowAutoAddDependencyLib) { + const manifestContent = await getManifestContent(fs); + snippets['manifest'] = { + content: manifestContent, + language: CodeSnippetLanguage.JSON, + filePathProps: { + fileName: parse(manifestPath).base, + relativePath: relative(basePath, manifestPath), + fullPath: manifestPath + } + }; + } + + return snippets; } diff --git a/packages/fe-fpm-writer/src/building-block/types.ts b/packages/fe-fpm-writer/src/building-block/types.ts index 8c3cf4cb75..69eb5d2a53 100644 --- a/packages/fe-fpm-writer/src/building-block/types.ts +++ b/packages/fe-fpm-writer/src/building-block/types.ts @@ -385,4 +385,12 @@ export interface BuildingBlockConfig { * The building block parameters. */ buildingBlockData: T; + + /** + * Allows updating the 'manifest.json' file with missing dependency libraries. + * Dependency libraries are listed under '"sap.ui5"/"dependencies"/"libs"', and 'sap.fe.macros' is required for Building Blocks. + * + * @default true + */ + allowAutoAddDependencyLib?: boolean; } diff --git a/packages/fe-fpm-writer/test/unit/__snapshots__/building-block.test.ts.snap b/packages/fe-fpm-writer/test/unit/__snapshots__/building-block.test.ts.snap index 4ae035e1d2..0856ef9e0f 100644 --- a/packages/fe-fpm-writer/test/unit/__snapshots__/building-block.test.ts.snap +++ b/packages/fe-fpm-writer/test/unit/__snapshots__/building-block.test.ts.snap @@ -1,5 +1,33 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Building Blocks Do not update "manifest.json" with missing dependency when "allowAutoAddDependencyLib=false" 1`] = ` +Object { + "default": Object { + "sap.app": Object { + "id": "my.test.App", + }, + "sap.ui5": Object { + "dependencies": Object { + "libs": Object { + "sap.fe.core": Object {}, + }, + "minUI5Version": "1.127.0", + }, + }, + }, + "sap.app": Object { + "id": "my.test.App", + }, + "sap.ui5": Object { + "dependencies": Object { + "libs": Object { + "sap.fe.templates": Object {}, + }, + }, + }, +} +`; + exports[`Building Blocks Generate with just ID and xml view without macros namespace generate chart building block: generate-chart-with-id-no-macros-ns 1`] = ` Object { "generate-chart-with-id-no-macros-ns/webapp/ext/main/Main.view.xml": Object { @@ -905,6 +933,16 @@ exports[`Building Blocks Generate with optional parameters getSerializedFileCont `; exports[`Building Blocks Generate with optional parameters getSerializedFileContent for chart building block 2`] = ` +"{ + \\"sap.ui5\\": { + \\"dependencies\\": { + \\"libs\\": {\\"sap.fe.macros\\":{}} + } + } +}" +`; + +exports[`Building Blocks Generate with optional parameters getSerializedFileContent for chart building block 3`] = ` " { expect(codeSnippet.viewOrFragmentPath.content).toMatchSnapshot(); expect(codeSnippet.viewOrFragmentPath.filePathProps?.fileName).toBe('Main.view.xml'); + // Check inline snapshot as content is static + expect(codeSnippet.manifest.content).toMatchSnapshot(); + expect(codeSnippet.manifest.filePathProps?.fileName).toBe('manifest.json'); } ); @@ -598,6 +601,29 @@ describe('Building Blocks', () => { } ); + test('getSerializedFileContent - "allowAutoAddDependencyLib=false"', async () => { + const basePath = join(testAppPath, `get-snippet-without-manifest-snippet`); + const aggregationPath = `/mvc:View/*[local-name()='Page']/*[local-name()='content']`; + fs.write(join(basePath, xmlViewFilePath), testXmlViewContent); + fs.write(join(basePath, manifestFilePath), JSON.stringify(testManifestContent)); + const codeSnippet = await getSerializedFileContent( + basePath, + { + viewOrFragmentPath: '', + aggregationPath, + buildingBlockData: { + buildingBlockType: BuildingBlockType.Table, + id: 'Test' + }, + allowAutoAddDependencyLib: false + }, + fs + ); + + expect(codeSnippet.viewOrFragmentPath.content).toBeDefined(); + expect(codeSnippet.manifest).toBeUndefined(); + }); + // While runtime does not support approach without contextPath - special test for Chart const chartInput = [ { @@ -683,4 +709,36 @@ describe('Building Blocks', () => { expect(codeSnippet.viewOrFragmentPath.filePathProps?.fileName).toBeUndefined(); }); }); + + test('Do not update "manifest.json" with missing dependency when "allowAutoAddDependencyLib=false"', async () => { + const aggregationPath = `/mvc:View/*[local-name()='Page']/*[local-name()='content']`; + const basePath = join(__dirname, 'sample/building-block/webapp-prompts'); + fs.write( + join(basePath, manifestFilePath), + JSON.stringify({ + ...testManifestContent, + 'sap.ui5': { + dependencies: { + libs: { + 'sap.fe.templates': {} + } + } + } + }) + ); + await generateBuildingBlock( + basePath, + { + viewOrFragmentPath: xmlViewFilePath, + aggregationPath: aggregationPath, + allowAutoAddDependencyLib: false, + buildingBlockData: { + id: 'testFilterBar', + buildingBlockType: BuildingBlockType.FilterBar + } + }, + fs + ); + expect(fs.readJSON(join(basePath, manifestFilePath))).toMatchSnapshot(); + }); }); From cb92850238501890b5b0afa38055a1ee7570ad78 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 20 Sep 2024 09:25:45 +0000 Subject: [PATCH 038/122] chore: apply latest changesets --- .changeset/eight-jobs-unite.md | 5 ----- .changeset/sweet-rivers-dress.md | 5 ----- examples/fe-fpm-cli/CHANGELOG.md | 7 +++++++ examples/fe-fpm-cli/package.json | 2 +- examples/prompting-ui/CHANGELOG.md | 6 ++++++ examples/prompting-ui/package.json | 2 +- examples/simple-generator/CHANGELOG.md | 6 ++++++ examples/simple-generator/package.json | 2 +- packages/fe-fpm-writer/CHANGELOG.md | 6 ++++++ packages/fe-fpm-writer/package.json | 2 +- packages/fiori-elements-writer/CHANGELOG.md | 7 +++++++ packages/fiori-elements-writer/package.json | 2 +- 12 files changed, 37 insertions(+), 15 deletions(-) delete mode 100644 .changeset/eight-jobs-unite.md delete mode 100644 .changeset/sweet-rivers-dress.md diff --git a/.changeset/eight-jobs-unite.md b/.changeset/eight-jobs-unite.md deleted file mode 100644 index 20a681bdfa..0000000000 --- a/.changeset/eight-jobs-unite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/fe-fpm-writer': patch ---- - -Added property `allowAutoAddDependencyLib` to the building block API. This property allows turning off the automatic addition of the 'sap.fe.macros' library to the 'manifest.json' file under library dependencies (`"sap.ui5"/"dependencies"/"libs"`). The default value is `true`. diff --git a/.changeset/sweet-rivers-dress.md b/.changeset/sweet-rivers-dress.md deleted file mode 100644 index 4b514d9302..0000000000 --- a/.changeset/sweet-rivers-dress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/prompting-ui': patch ---- - -Extend the building block examples with an option to toggle the `allowAutoAddDependencyLib` property, allowing to turning off the automatic addition of the 'sap.fe.macros' library to the 'manifest.json'. diff --git a/examples/fe-fpm-cli/CHANGELOG.md b/examples/fe-fpm-cli/CHANGELOG.md index 0dbc4f79c1..97e509006a 100644 --- a/examples/fe-fpm-cli/CHANGELOG.md +++ b/examples/fe-fpm-cli/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fe-fpm-cli +## 0.0.29 + +### Patch Changes + +- Updated dependencies [a18d4a2] + - @sap-ux/fe-fpm-writer@0.31.2 + ## 0.0.28 ### Patch Changes diff --git a/examples/fe-fpm-cli/package.json b/examples/fe-fpm-cli/package.json index ec4055c439..827bec11d3 100644 --- a/examples/fe-fpm-cli/package.json +++ b/examples/fe-fpm-cli/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fe-fpm-cli", - "version": "0.0.28", + "version": "0.0.29", "description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.", "license": "Apache-2.0", "private": true, diff --git a/examples/prompting-ui/CHANGELOG.md b/examples/prompting-ui/CHANGELOG.md index 629a22f58d..22e4f24b22 100644 --- a/examples/prompting-ui/CHANGELOG.md +++ b/examples/prompting-ui/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/fe-fpm-writer-ui +## 0.1.4 + +### Patch Changes + +- a18d4a2: Extend the building block examples with an option to toggle the `allowAutoAddDependencyLib` property, allowing to turning off the automatic addition of the 'sap.fe.macros' library to the 'manifest.json'. + ## 0.1.3 ### Patch Changes diff --git a/examples/prompting-ui/package.json b/examples/prompting-ui/package.json index 7909f14ca0..65d4f2d230 100644 --- a/examples/prompting-ui/package.json +++ b/examples/prompting-ui/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/prompting-ui", - "version": "0.1.3", + "version": "0.1.4", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/examples/simple-generator/CHANGELOG.md b/examples/simple-generator/CHANGELOG.md index ef4e64c1b0..d7253ab3fe 100644 --- a/examples/simple-generator/CHANGELOG.md +++ b/examples/simple-generator/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/generator-simple-fe +## 1.0.50 + +### Patch Changes + +- @sap-ux/fiori-elements-writer@1.1.24 + ## 1.0.49 ### Patch Changes diff --git a/examples/simple-generator/package.json b/examples/simple-generator/package.json index 034afc4070..6e166de152 100644 --- a/examples/simple-generator/package.json +++ b/examples/simple-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/generator-simple-fe", - "version": "1.0.49", + "version": "1.0.50", "description": "Simple example of a yeoman generator for Fiori elements.", "license": "Apache-2.0", "private": true, diff --git a/packages/fe-fpm-writer/CHANGELOG.md b/packages/fe-fpm-writer/CHANGELOG.md index df77b5a234..cd31a42a6d 100644 --- a/packages/fe-fpm-writer/CHANGELOG.md +++ b/packages/fe-fpm-writer/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/fe-fpm-writer +## 0.31.2 + +### Patch Changes + +- a18d4a2: Added property `allowAutoAddDependencyLib` to the building block API. This property allows turning off the automatic addition of the 'sap.fe.macros' library to the 'manifest.json' file under library dependencies (`"sap.ui5"/"dependencies"/"libs"`). The default value is `true`. + ## 0.31.1 ### Patch Changes diff --git a/packages/fe-fpm-writer/package.json b/packages/fe-fpm-writer/package.json index 55357e3c7f..a81b360858 100644 --- a/packages/fe-fpm-writer/package.json +++ b/packages/fe-fpm-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fe-fpm-writer", "description": "SAP Fiori elements flexible programming model writer", - "version": "0.31.1", + "version": "0.31.2", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-elements-writer/CHANGELOG.md b/packages/fiori-elements-writer/CHANGELOG.md index d30f7ee42a..40e74a04f1 100644 --- a/packages/fiori-elements-writer/CHANGELOG.md +++ b/packages/fiori-elements-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fiori-elements-writer +## 1.1.24 + +### Patch Changes + +- Updated dependencies [a18d4a2] + - @sap-ux/fe-fpm-writer@0.31.2 + ## 1.1.23 ### Patch Changes diff --git a/packages/fiori-elements-writer/package.json b/packages/fiori-elements-writer/package.json index 951a40991e..2cd63e0e0a 100644 --- a/packages/fiori-elements-writer/package.json +++ b/packages/fiori-elements-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-elements-writer", "description": "SAP Fiori elements application writer", - "version": "1.1.23", + "version": "1.1.24", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", From 89ec1c39e8c7b0b896e4ac59a086af933f307ab3 Mon Sep 17 00:00:00 2001 From: Tom <114915993+tom-sap@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:59:11 +0100 Subject: [PATCH 039/122] Uitable a11y2 (#2396) * fix(ui-c): accessibility updates for uitable * fix(ui-c): accessibility updates for uitable * Create soft-years-play.md * Update soft-years-play.md --- .changeset/soft-years-play.md | 5 +++++ .../ui-components/src/components/UITable/UITable.scss | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/soft-years-play.md diff --git a/.changeset/soft-years-play.md b/.changeset/soft-years-play.md new file mode 100644 index 0000000000..b90d54bd7a --- /dev/null +++ b/.changeset/soft-years-play.md @@ -0,0 +1,5 @@ +--- +"@sap-ux/ui-components": patch +--- + +Uitable a11y fix: The `:focus` style should have been added to the column header cells (not to the header row). diff --git a/packages/ui-components/src/components/UITable/UITable.scss b/packages/ui-components/src/components/UITable/UITable.scss index 2bce586e3f..4e40992bee 100644 --- a/packages/ui-components/src/components/UITable/UITable.scss +++ b/packages/ui-components/src/components/UITable/UITable.scss @@ -88,13 +88,14 @@ .editable-container { margin-left: auto; } - } - &:focus { - outline: none; - box-shadow: 0 0 0 3px var(--vscode-focusBorder) inset; + &:focus { + outline: none; + box-shadow: 0 0 0 3px var(--vscode-focusBorder) inset; + } } + .ms-DetailsHeader-cell, .ms-DetailsHeader-cell:hover, .ms-DetailsHeader-cell .ms-Icon { From 8914af39ec23115f09d817a9717825547ae46667 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 20 Sep 2024 13:10:30 +0000 Subject: [PATCH 040/122] chore: apply latest changesets --- .changeset/soft-years-play.md | 5 ----- examples/prompting-ui/CHANGELOG.md | 8 ++++++++ examples/prompting-ui/package.json | 2 +- packages/ui-components/CHANGELOG.md | 6 ++++++ packages/ui-components/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 .changeset/soft-years-play.md diff --git a/.changeset/soft-years-play.md b/.changeset/soft-years-play.md deleted file mode 100644 index b90d54bd7a..0000000000 --- a/.changeset/soft-years-play.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@sap-ux/ui-components": patch ---- - -Uitable a11y fix: The `:focus` style should have been added to the column header cells (not to the header row). diff --git a/examples/prompting-ui/CHANGELOG.md b/examples/prompting-ui/CHANGELOG.md index 22e4f24b22..d327c27de7 100644 --- a/examples/prompting-ui/CHANGELOG.md +++ b/examples/prompting-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer-ui +## 0.1.5 + +### Patch Changes + +- Updated dependencies [89ec1c3] + - @sap-ux/ui-components@1.18.3 + - @sap-ux/ui-prompting@0.1.13 + ## 0.1.4 ### Patch Changes diff --git a/examples/prompting-ui/package.json b/examples/prompting-ui/package.json index 65d4f2d230..1e9163c5cf 100644 --- a/examples/prompting-ui/package.json +++ b/examples/prompting-ui/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/prompting-ui", - "version": "0.1.4", + "version": "0.1.5", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index 7373e483ae..f5307603f4 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui-components +## 1.18.3 + +### Patch Changes + +- 89ec1c3: Uitable a11y fix: The `:focus` style should have been added to the column header cells (not to the header row). + ## 1.18.2 ### Patch Changes diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index dd86c5e927..79a1f3382a 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-components", - "version": "1.18.2", + "version": "1.18.3", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index c71e3d6fbe..cdd0c3e30a 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.1.13 + +### Patch Changes + +- Updated dependencies [89ec1c3] + - @sap-ux/ui-components@1.18.3 + ## 0.1.12 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index 04e70f86de..371585653a 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.1.12", + "version": "0.1.13", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From b4b3ebe90bc5cb133ea1d7fb5053ff4e4aded975 Mon Sep 17 00:00:00 2001 From: IainSAP <46536134+IainSAP@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:36:21 +0100 Subject: [PATCH 041/122] Fixes ampersand escaping (#2399) * Fixes ampersand escaping * Adds cset --- .changeset/five-pans-glow.md | 5 ++++ .../datasources/metadata-file/validators.ts | 4 +-- .../metadata-file/fixtures/validatorTest.xml | 28 +++++++++++++++++++ .../prompts/metadata-file/validators.test.ts | 12 ++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .changeset/five-pans-glow.md create mode 100644 packages/odata-service-inquirer/test/unit/prompts/metadata-file/fixtures/validatorTest.xml create mode 100644 packages/odata-service-inquirer/test/unit/prompts/metadata-file/validators.test.ts diff --git a/.changeset/five-pans-glow.md b/.changeset/five-pans-glow.md new file mode 100644 index 0000000000..744ad71a17 --- /dev/null +++ b/.changeset/five-pans-glow.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/odata-service-inquirer': patch +--- + +Fix: correctly escapes ' & ' diff --git a/packages/odata-service-inquirer/src/prompts/datasources/metadata-file/validators.ts b/packages/odata-service-inquirer/src/prompts/datasources/metadata-file/validators.ts index 995036ff97..a10ab1416f 100644 --- a/packages/odata-service-inquirer/src/prompts/datasources/metadata-file/validators.ts +++ b/packages/odata-service-inquirer/src/prompts/datasources/metadata-file/validators.ts @@ -27,8 +27,8 @@ export const validateMetadataFile = async ( } try { - const metadata = await readFile(path, 'utf-8'); - metadata.replace(/ & /g, ' & '); + let metadata = await readFile(path, 'utf-8'); + metadata = metadata.replace(/ & /g, ' & '); const { validationMsg, version } = validateODataVersion(metadata, odataVersion); if (validationMsg) { return validationMsg; diff --git a/packages/odata-service-inquirer/test/unit/prompts/metadata-file/fixtures/validatorTest.xml b/packages/odata-service-inquirer/test/unit/prompts/metadata-file/fixtures/validatorTest.xml new file mode 100644 index 0000000000..fbce877b39 --- /dev/null +++ b/packages/odata-service-inquirer/test/unit/prompts/metadata-file/fixtures/validatorTest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/odata-service-inquirer/test/unit/prompts/metadata-file/validators.test.ts b/packages/odata-service-inquirer/test/unit/prompts/metadata-file/validators.test.ts new file mode 100644 index 0000000000..ab8b20b68f --- /dev/null +++ b/packages/odata-service-inquirer/test/unit/prompts/metadata-file/validators.test.ts @@ -0,0 +1,12 @@ +import path from 'path'; +import { validateMetadataFile } from '../../../../src/prompts/datasources/metadata-file/validators'; + +describe('metadata valiadtors', () => { + test('validateMetadataFile', async () => { + const testXmlPath = path.join(__dirname, 'fixtures/validatorTest.xml'); + expect(await validateMetadataFile(testXmlPath)).toMatchObject({ + version: '2', + metadata: expect.stringContaining('Terms & Conditions') //Ensure that the & is replaced with & + }); + }); +}); From c6ca5c260320e7f2cc842de74b618add6de1643f Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 20 Sep 2024 17:47:31 +0000 Subject: [PATCH 042/122] chore: apply latest changesets --- .changeset/five-pans-glow.md | 5 ----- packages/odata-service-inquirer/CHANGELOG.md | 6 ++++++ packages/odata-service-inquirer/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/five-pans-glow.md diff --git a/.changeset/five-pans-glow.md b/.changeset/five-pans-glow.md deleted file mode 100644 index 744ad71a17..0000000000 --- a/.changeset/five-pans-glow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/odata-service-inquirer': patch ---- - -Fix: correctly escapes ' & ' diff --git a/packages/odata-service-inquirer/CHANGELOG.md b/packages/odata-service-inquirer/CHANGELOG.md index b3a7e1d131..9781e75000 100644 --- a/packages/odata-service-inquirer/CHANGELOG.md +++ b/packages/odata-service-inquirer/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/odata-service-inquirer +## 0.5.41 + +### Patch Changes + +- b4b3ebe: Fix: correctly escapes ' & ' + ## 0.5.40 ### Patch Changes diff --git a/packages/odata-service-inquirer/package.json b/packages/odata-service-inquirer/package.json index d04ee58515..080a582565 100644 --- a/packages/odata-service-inquirer/package.json +++ b/packages/odata-service-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/odata-service-inquirer", "description": "Prompts module that can prompt users for inputs required for odata service writing", - "version": "0.5.40", + "version": "0.5.41", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", From 484195df74984d7b3d32752c6827ec29a5d31443 Mon Sep 17 00:00:00 2001 From: kitzkan Date: Mon, 23 Sep 2024 10:50:21 +0100 Subject: [PATCH 043/122] Add scripts variant management script to FF & FE package json (#2327) * add scripts variant management * adding changeset * fix vairant script * update snapshots * changing disableCacheParam var name * Add sapuxlayer to package json (#2359) * add sapuxlayer * document sapuxLayer property * update snap shots and set default sapuxLayer * update test name * Update index.ts fix typp * reverting default sap ux layer settings * use package type from project-access in ui5-application-writer * Add ignore cert error to odata-service-writer (#2343) * add ignore cert error to odata service writer and ui5 config * lint issues * Add fiori-tools-preview middleware to ui5 yamls (#2382) * update fiori preview middleares * add fiori preview & update snapshots * add doc to firori middlware type * Create thin-numbers-repair.md * Delete .changeset/thin-numbers-repair.md --------- Co-authored-by: Austin Devine * adding default app name to simple generator example app * update changeset * snapshot fix * sonar issue --------- Co-authored-by: IainSAP <46536134+IainSAP@users.noreply.github.com> Co-authored-by: J Long Co-authored-by: Austin Devine --- .changeset/purple-snakes-impress.md | 11 + examples/simple-generator/src/app/index.ts | 2 +- .../src/packageConfig.ts | 4 + packages/fiori-elements-writer/src/types.ts | 1 + .../test/__snapshots__/alp.test.ts.snap | 36 +- .../test/__snapshots__/feop.test.ts.snap | 36 +- .../test/__snapshots__/fpm.test.ts.snap | 36 +- .../test/__snapshots__/lrop.test.ts.snap | 319 +++++++++++++++++- .../test/__snapshots__/ovp.test.ts.snap | 72 +++- .../test/__snapshots__/worklist.test.ts.snap | 72 +++- .../fiori-elements-writer/test/lrop.test.ts | 21 ++ .../src/packageConfig.ts | 5 + packages/fiori-freestyle-writer/src/types.ts | 1 + .../test/__snapshots__/basic.test.ts.snap | 157 ++++++++- .../test/__snapshots__/index.test.ts.snap | 54 ++- .../__snapshots__/listdetail.test.ts.snap | 90 ++++- .../test/__snapshots__/worklist.test.ts.snap | 90 ++++- .../fiori-freestyle-writer/test/basic.test.ts | 22 ++ .../test/packageConfig.test.ts | 3 + .../fiori-generator-shared/src/helpers.ts | 21 ++ packages/fiori-generator-shared/src/index.ts | 2 +- .../test/helpers.test.ts | 31 +- packages/odata-service-writer/src/index.ts | 10 +- packages/odata-service-writer/src/types.ts | 4 + .../src/data/defaults.ts | 3 +- .../ui5-application-writer/src/data/index.ts | 8 +- packages/ui5-application-writer/src/index.ts | 8 +- packages/ui5-application-writer/src/types.ts | 13 +- .../templates/core/package.json | 9 +- .../test/__snapshots__/index.test.ts.snap | 14 +- .../test/__snapshots__/options.test.ts.snap | 44 ++- .../ui5-application-writer/test/data.test.ts | 5 +- packages/ui5-config/src/middlewares.ts | 27 +- packages/ui5-config/src/types/index.ts | 15 + packages/ui5-config/src/ui5config.ts | 22 +- .../test/__snapshots__/index.test.ts.snap | 4 +- packages/ui5-config/test/index.test.ts | 20 +- 37 files changed, 1201 insertions(+), 91 deletions(-) create mode 100644 .changeset/purple-snakes-impress.md diff --git a/.changeset/purple-snakes-impress.md b/.changeset/purple-snakes-impress.md new file mode 100644 index 0000000000..8c8902a827 --- /dev/null +++ b/.changeset/purple-snakes-impress.md @@ -0,0 +1,11 @@ +--- +'@sap-ux/fiori-freestyle-writer': minor +'@sap-ux/fiori-generator-shared': minor +'@sap-ux/ui5-application-writer': minor +'@sap-ux/fiori-elements-writer': minor +'@sap-ux/odata-service-writer': minor +'@sap-ux/ui5-config': minor +'@sap-ux/generator-simple-fe': patch +--- + +Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. diff --git a/examples/simple-generator/src/app/index.ts b/examples/simple-generator/src/app/index.ts index c4775ced38..cb34dbd90b 100644 --- a/examples/simple-generator/src/app/index.ts +++ b/examples/simple-generator/src/app/index.ts @@ -145,7 +145,7 @@ export default class extends Generator { // configuring the source/template root folder to point to the folder containing the karma templates this.sourceRoot(join(__dirname, '..', '..', 'templates', 'karma')); // hard-coded output folder just for testing, in a real generator the .tmp prefix is not needed - this.destinationRoot(join('.tmp', this.app.package.name)); + this.destinationRoot(join('.tmp', this.app.package.name ?? 'default-app-name')); } async writing(): Promise { diff --git a/packages/fiori-elements-writer/src/packageConfig.ts b/packages/fiori-elements-writer/src/packageConfig.ts index ad1ccceeef..4650db8010 100644 --- a/packages/fiori-elements-writer/src/packageConfig.ts +++ b/packages/fiori-elements-writer/src/packageConfig.ts @@ -1,5 +1,6 @@ import { t } from './i18n'; import type { PackageJsonScripts } from './types'; +import { getVariantPreviewAppScript } from '@sap-ux/fiori-generator-shared'; /** * Get an object reflecting the scripts that need to be added to the package.json. @@ -76,5 +77,8 @@ export function getPackageJsonTasks({ scripts['int-test'] = 'fiori run --config ./ui5-mock.yaml --open "test/integration/opaTests.qunit.html"'; } + scripts['start-variants-management'] = localOnly + ? `echo \\"${t('info.mockOnlyWarning')}\\"` + : getVariantPreviewAppScript(sapClient); return scripts; } diff --git a/packages/fiori-elements-writer/src/types.ts b/packages/fiori-elements-writer/src/types.ts index 275a19d3f4..e5fa2f6cf5 100644 --- a/packages/fiori-elements-writer/src/types.ts +++ b/packages/fiori-elements-writer/src/types.ts @@ -126,4 +126,5 @@ export interface PackageJsonScripts { 'start-noflp'?: string; 'start-mock'?: string; 'int-test'?: string; + 'start-variants-management'?: string; } diff --git a/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap index b8bee8994c..2cc241c08c 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap @@ -40,7 +40,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#alp2-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -74,6 +75,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: alp2 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -121,6 +127,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: alp2 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -165,6 +176,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: alp2 + ui5Theme: sap_belize ", "state": "modified", }, @@ -6005,7 +6021,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#alp1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -6036,6 +6053,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: alp1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -6083,6 +6105,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: alp1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -6125,6 +6152,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: alp1 + ui5Theme: sap_belize ", "state": "modified", }, diff --git a/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap index d0b93b3ec7..eac59ec2af 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap @@ -40,7 +40,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#fefeop1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -71,6 +72,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefeop1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -118,6 +124,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefeop1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -160,6 +171,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefeop1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -3712,7 +3728,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#fefeop2ts-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -3780,6 +3797,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefeop2ts + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -3835,6 +3857,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefeop2ts + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -3893,6 +3920,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefeop2ts + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: diff --git a/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap index bd85370b0d..c5f79f79ff 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap @@ -40,7 +40,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#fefpmjs-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -72,6 +73,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefpmjs + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -119,6 +125,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefpmjs + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -161,6 +172,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefpmjs + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -3730,7 +3746,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#fefpmts-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -3799,6 +3816,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefpmts + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -3854,6 +3876,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefpmts + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -3912,6 +3939,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fefpmts + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: diff --git a/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap index 82e6347bb4..56aaea47ff 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap @@ -40,7 +40,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#felrop2-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -74,6 +75,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop2 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -123,6 +129,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop2 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -168,6 +179,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop2 + ui5Theme: sap_belize ", "state": "modified", }, @@ -3648,7 +3664,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#felrop2-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -3682,6 +3699,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop2 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -3731,6 +3753,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop2 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -3776,6 +3803,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop2 + ui5Theme: sap_belize ", "state": "modified", }, @@ -7274,7 +7306,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lrop_v2_ts-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -7345,6 +7378,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -7402,6 +7440,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -7463,6 +7506,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -10742,7 +10790,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#felrop1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -10773,6 +10822,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -10820,6 +10874,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -10862,6 +10921,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -14409,7 +14473,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#felrop194-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -14440,6 +14505,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop194 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -14487,6 +14557,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop194 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -14529,6 +14604,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop194 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -18077,7 +18157,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"int-test\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/integration/opaTests.qunit.html\\\\\\"\\" + \\"int-test\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/integration/opaTests.qunit.html\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -18108,6 +18189,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v4_addtests + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -18155,6 +18241,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v4_addtests + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -18197,6 +18288,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v4_addtests + ui5Theme: sap_belize ", "state": "modified", }, @@ -23637,7 +23733,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"int-test\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/integration/opaTests.qunit.html\\\\\\"\\" + \\"int-test\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/integration/opaTests.qunit.html\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -23668,6 +23765,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v4_annotation_reuse_lib + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -23715,6 +23817,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v4_annotation_reuse_lib + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -23757,6 +23864,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v4_annotation_reuse_lib + ui5Theme: sap_belize ", "state": "modified", }, @@ -24967,7 +25079,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#felropui5-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -24998,6 +25111,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felropui5 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -25045,6 +25163,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felropui5 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -25087,6 +25210,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felropui5 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -28634,7 +28762,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#felropui5-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -28665,6 +28794,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felropui5 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -28712,6 +28846,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felropui5 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -28754,6 +28893,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felropui5 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -32302,7 +32446,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#felrop3-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -32336,6 +32481,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop3 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -32385,6 +32535,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop3 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -32430,6 +32585,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop3 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -35912,7 +36072,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#felrop4-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -35946,6 +36107,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop4 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -35995,6 +36161,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop4 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -36040,6 +36211,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: felrop4 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -39281,7 +39457,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lropV2_set_toolsId-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -39315,6 +39492,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_set_toolsId + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -39364,6 +39546,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_set_toolsId + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -39409,6 +39596,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_set_toolsId + ui5Theme: sap_belize ", "state": "modified", }, @@ -42890,7 +43082,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lropV2_set_toolsId_only-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -42924,6 +43117,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_set_toolsId_only + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -42973,6 +43171,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_set_toolsId_only + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -43018,6 +43221,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_set_toolsId_only + ui5Theme: sap_belize ", "state": "modified", }, @@ -46517,7 +46725,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lropV2_ts_ui5_1_108-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -46588,6 +46797,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_108 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -46645,6 +46859,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_108 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -46706,6 +46925,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_108 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -49992,7 +50216,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lropV2_ts_ui5_1_111-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -50063,6 +50288,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_111 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -50120,6 +50350,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_111 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -50181,6 +50416,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_111 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -53467,7 +53707,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lropV2_ts_ui5_1_113-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -53538,6 +53779,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_113 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -53595,6 +53841,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_113 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -53656,6 +53907,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lropV2_ts_ui5_1_113 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -56922,7 +57178,8 @@ archive.zip \\"build\\": \\"ui5 build --config=ui5.yaml --clean-dest --dest dist\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\" + \\"start-noflp\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\", + \\"start-variants-management\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\" }, \\"sapux\\": true } @@ -56953,6 +57210,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -56990,6 +57252,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -57365,7 +57632,8 @@ archive.zip \\"build\\": \\"ui5 build --config=ui5.yaml --clean-dest --dest dist\\", \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#lrop_v2_ts-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", - \\"deploy-config\\": \\"fiori add deploy-config\\" + \\"deploy-config\\": \\"fiori add deploy-config\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -57399,6 +57667,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -57448,6 +57721,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -57493,6 +57771,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: lrop_v2_ts + ui5Theme: sap_fiori_3 ", "state": "modified", }, diff --git a/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap index bf146b9a06..9069497518 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap @@ -40,7 +40,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#feovp1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -77,6 +78,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -124,6 +130,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -168,6 +179,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -1736,7 +1752,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#feovp1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -1810,6 +1827,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -1865,6 +1887,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp1 + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -1925,6 +1952,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp1 + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -3272,7 +3304,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#feovp2-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -3306,6 +3339,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp2 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -3353,6 +3391,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp2 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -3395,6 +3438,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp2 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -9205,7 +9253,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#feovp2-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -9276,6 +9325,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp2 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -9331,6 +9385,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp2 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -9389,6 +9448,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: feovp2 + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: diff --git a/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap index ae3cb61ce5..bd1a8a9b7c 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap @@ -40,7 +40,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#fewrk1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -75,6 +76,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -124,6 +130,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -169,6 +180,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -3656,7 +3672,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#fewrk1-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -3691,6 +3708,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -3740,6 +3762,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -3785,6 +3812,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -7272,7 +7304,8 @@ archive.zip \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#fewrk2-tile\\\\\\"\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -7303,6 +7336,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk2 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -7350,6 +7388,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk2 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -7392,6 +7435,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk2 + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -10941,7 +10989,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"int-test\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/integration/opaTests.qunit.html\\\\\\"\\" + \\"int-test\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/integration/opaTests.qunit.html\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" }, \\"sapux\\": true } @@ -10972,6 +11021,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk2 + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -11019,6 +11073,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk2 + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -11061,6 +11120,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: fewrk2 + ui5Theme: sap_fiori_3 ", "state": "modified", }, diff --git a/packages/fiori-elements-writer/test/lrop.test.ts b/packages/fiori-elements-writer/test/lrop.test.ts index 452e1b21b5..54d6d1babd 100644 --- a/packages/fiori-elements-writer/test/lrop.test.ts +++ b/packages/fiori-elements-writer/test/lrop.test.ts @@ -403,4 +403,25 @@ describe(`Fiori Elements template: ${TEST_NAME}`, () => { await projectChecks(testPath, config, debug?.debugFull); }); }); + + test('sapuxLayer is added to package json for edmx projects when provided', async () => { + const fioriElementsApp: FioriElementsApp = { + ...Object.assign(feBaseConfig('felrop1'), { + template: { + type: TemplateType.ListReportObjectPage, + settings: v4TemplateSettings + } + }), + service: v4Service, + package: { + ...feBaseConfig('felrop1').package, + sapuxLayer: 'CUSTOMER_BASE' + } + } as FioriElementsApp; + + const fs = await generate(curTestOutPath, fioriElementsApp); + const packageJsonPath = join(curTestOutPath, 'package.json'); + const packageJson = fs.readJSON(packageJsonPath); + expect((packageJson as any)?.sapuxLayer).toBe('CUSTOMER_BASE'); + }); }); diff --git a/packages/fiori-freestyle-writer/src/packageConfig.ts b/packages/fiori-freestyle-writer/src/packageConfig.ts index 0369ebe2b2..99f8c6d078 100644 --- a/packages/fiori-freestyle-writer/src/packageConfig.ts +++ b/packages/fiori-freestyle-writer/src/packageConfig.ts @@ -1,5 +1,6 @@ import { t } from './i18n'; import type { PackageJsonScripts } from './types'; +import { getVariantPreviewAppScript } from '@sap-ux/fiori-generator-shared'; /** * Get an object reflecting the scripts that need to be added to the package.json. @@ -68,5 +69,9 @@ export function getPackageJsonTasks({ scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "test/flpSandbox.html${params}"`; } + scripts['start-variants-management'] = localOnly + ? `echo \\"${t('info.mockOnlyWarning')}\\"` + : getVariantPreviewAppScript(sapClient); + return scripts; } diff --git a/packages/fiori-freestyle-writer/src/types.ts b/packages/fiori-freestyle-writer/src/types.ts index f93b76b273..df4b9abb5d 100644 --- a/packages/fiori-freestyle-writer/src/types.ts +++ b/packages/fiori-freestyle-writer/src/types.ts @@ -51,4 +51,5 @@ export interface PackageJsonScripts { 'start-local': string; 'start-noflp'?: string; 'start-mock'?: string; + 'start-variants-management'?: string; } diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap index a6b40470ea..86ecc6640c 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap @@ -1431,7 +1431,8 @@ archive.zip \\"build\\": \\"ui5 build --config=ui5.yaml --clean-dest --dest dist\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\" + \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -1465,6 +1466,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -1496,6 +1502,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -2167,7 +2178,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -2238,6 +2250,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -2293,6 +2310,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -2349,6 +2371,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -2794,7 +2821,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -2860,6 +2888,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_horizon - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -2915,6 +2948,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -2971,6 +3009,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -3410,7 +3453,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -3476,6 +3520,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_horizon - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -3531,6 +3580,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -3587,6 +3641,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -4008,7 +4067,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -4042,6 +4102,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -4089,6 +4154,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -4129,6 +4199,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -4802,7 +4877,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\" } } ", @@ -4836,6 +4912,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -4883,6 +4964,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -4923,6 +5009,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -5596,7 +5687,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -5630,6 +5722,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -5677,6 +5774,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -5717,6 +5819,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -6391,7 +6498,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -6425,6 +6533,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -6472,6 +6585,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -6512,6 +6630,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -6943,7 +7066,8 @@ archive.zip \\"build\\": \\"ui5 build --config=ui5.yaml --clean-dest --dest dist\\", \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#nods1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -6977,6 +7101,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -7024,6 +7153,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -7064,6 +7198,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: nods1 + ui5Theme: sap_belize ", "state": "modified", }, diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap index 68714b33d8..7cd9b9f075 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap @@ -39,7 +39,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -68,6 +69,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -115,6 +121,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -155,6 +166,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -1379,7 +1395,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -1408,6 +1425,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -1455,6 +1477,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -1495,6 +1522,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -4035,7 +4067,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -4064,6 +4097,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -4111,6 +4149,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -4151,6 +4194,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 ", "state": "modified", }, diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap index 281c5ac3b6..8dd6a32d9f 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap @@ -57,7 +57,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -123,6 +124,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -178,6 +184,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -234,6 +245,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -2756,7 +2772,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -2822,6 +2839,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_horizon - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -2877,6 +2899,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -2933,6 +2960,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -5455,7 +5487,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -5521,6 +5554,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_horizon - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -5576,6 +5614,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -5632,6 +5675,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -8154,7 +8202,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -8198,6 +8247,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -8245,6 +8299,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -8285,6 +8344,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -10710,7 +10774,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#testme-app\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -10776,6 +10841,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -10831,6 +10901,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -10887,6 +10962,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: test.me + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap index 6df0a62114..a4292798ad 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap @@ -39,7 +39,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"echo \\\\\\\\\\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\\\\\\\\\"\\" } } ", @@ -73,6 +74,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -120,6 +126,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -160,6 +171,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -6782,7 +6798,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -6816,6 +6833,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -6869,6 +6891,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -6912,6 +6939,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize ", "state": "modified", }, @@ -10135,7 +10167,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -10169,6 +10202,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_fiori_3_dark - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -10216,6 +10254,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_fiori_3_dark - name: sap-fe-mockserver beforeMiddleware: csp configuration: @@ -10256,6 +10299,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_fiori_3_dark ", "state": "modified", }, @@ -13077,7 +13125,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -13148,6 +13197,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -13209,6 +13263,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -13268,6 +13327,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_belize - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -16456,7 +16520,8 @@ archive.zip \\"deploy\\": \\"fiori verify\\", \\"deploy-config\\": \\"fiori add deploy-config\\", \\"start-noflp\\": \\"fiori run --open \\\\\\"index.html?sap-client=012&sap-ui-xx-viewCache=false\\\\\\"\\", - \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\" + \\"start-mock\\": \\"fiori run --config ./ui5-mock.yaml --open \\\\\\"test/flpSandbox.html?sap-client=012&sap-ui-xx-viewCache=false#wrk1-tile\\\\\\"\\", + \\"start-variants-management\\": \\"fiori run --open \\\\\\"preview.html?&sap-client=012&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\\\\\"\\" } } ", @@ -16523,6 +16588,11 @@ server: overridesToOverride: true excludePatterns: - /Component-preload.js + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_horizon - name: fiori-tools-proxy afterMiddleware: compression configuration: @@ -16584,6 +16654,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: @@ -16643,6 +16718,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: wrk1 + ui5Theme: sap_horizon - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: diff --git a/packages/fiori-freestyle-writer/test/basic.test.ts b/packages/fiori-freestyle-writer/test/basic.test.ts index 597eea43bc..630f5d7b74 100644 --- a/packages/fiori-freestyle-writer/test/basic.test.ts +++ b/packages/fiori-freestyle-writer/test/basic.test.ts @@ -251,6 +251,28 @@ describe(`Fiori freestyle template: ${TEST_NAME}`, () => { expect(await fs.read(Component.js).includes('my/demo/App')).toBeTruthy(); }); + test('sapuxLayer is added to package json for edmx projects when provided', async () => { + const freestyleApp: FreestyleApp = { + app: { + id: 'my.demo.App', + projectType: 'EDMXBackend' + }, + package: { + name: 'my.demo.App', + sapuxLayer: 'CUSTOMER_BASE' + }, + template: { + type: TemplateType.Basic, + settings: {} + } + }; + + const fs = await generate(curTestOutPath, freestyleApp); + const packageJsonPath = join(curTestOutPath, 'package.json'); + const packageJson = fs.readJSON(packageJsonPath); + expect((packageJson as any)?.sapuxLayer).toBe('CUSTOMER_BASE'); + }); + describe('set view-name at scaffolding time', () => { const viewPrefix = 'MainView'; const freestyleApp: FreestyleApp = { diff --git a/packages/fiori-freestyle-writer/test/packageConfig.test.ts b/packages/fiori-freestyle-writer/test/packageConfig.test.ts index 0379c33e65..f5dd5d19a0 100644 --- a/packages/fiori-freestyle-writer/test/packageConfig.test.ts +++ b/packages/fiori-freestyle-writer/test/packageConfig.test.ts @@ -16,6 +16,7 @@ describe('Test common utils', () => { "start-local": "fiori run --config ./ui5-local.yaml --open \\"test/flpSandbox.html?sap-client=100&sap-ui-xx-viewCache=false#testApp-tile\\"", "start-mock": "fiori run --config ./ui5-mock.yaml --open \\"test/flpSandbox.html?sap-client=100&sap-ui-xx-viewCache=false#testApp-tile\\"", "start-noflp": "fiori run --open \\"index.html?sap-client=100&sap-ui-xx-viewCache=false\\"", + "start-variants-management": "fiori run --open \\"preview.html?&sap-client=100&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\"", } `); }); @@ -27,6 +28,7 @@ describe('Test common utils', () => { "start-local": "fiori run --config ./ui5-local.yaml --open \\"test/flpSandbox.html?sap-ui-xx-viewCache=false\\"", "start-mock": "fiori run --config ./ui5-mock.yaml --open \\"test/flpSandbox.html?sap-ui-xx-viewCache=false\\"", "start-noflp": "fiori run --open \\"index.html?sap-ui-xx-viewCache=false\\"", + "start-variants-management": "fiori run --open \\"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\\"", } `); }); @@ -44,6 +46,7 @@ describe('Test common utils', () => { "start": "echo \\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\"", "start-local": "fiori run --config ./ui5-local.yaml --open \\"testLocalStart.html?sap-ui-xx-viewCache=false#testApp-tile\\"", "start-noflp": "echo \\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\"", + "start-variants-management": "echo \\\\\\"This application was generated with a local metadata file and does not reference a live server. Please add the required server configuration or start this application with mock data using the target: npm run start-mock\\\\\\"", } `); }); diff --git a/packages/fiori-generator-shared/src/helpers.ts b/packages/fiori-generator-shared/src/helpers.ts index 3fd97f1aac..7f16e671a8 100644 --- a/packages/fiori-generator-shared/src/helpers.ts +++ b/packages/fiori-generator-shared/src/helpers.ts @@ -29,3 +29,24 @@ export function getBootstrapResourceUrls( return { uShellBootstrapResourceUrl, uiBootstrapResourceUrl }; } + +/** + * Generates a variant management script in preview mode. + * + * @param {string} sapClient - The SAP client parameter to include in the URL. If not provided, the URL will not include the `sap-client` parameter. + * @returns {string} A variant management script to run the application in preview mode. + */ +export function getVariantPreviewAppScript(sapClient?: string): string { + const previewAppAnchor = '#preview-app'; + const disableCacheParam = 'sap-ui-xx-viewCache=false'; + const sapClientParam = sapClient ? `&sap-client=${sapClient}` : ''; + const urlParam = `?${[ + sapClientParam, + disableCacheParam, + 'fiori-tools-rta-mode=true', + 'sap-ui-rta-skip-flex-validation=true' + ] + .filter(Boolean) + .join('&')}`; + return `fiori run --open \"preview.html${urlParam}${previewAppAnchor}\"`; +} diff --git a/packages/fiori-generator-shared/src/index.ts b/packages/fiori-generator-shared/src/index.ts index baa58df695..c6eec5d169 100644 --- a/packages/fiori-generator-shared/src/index.ts +++ b/packages/fiori-generator-shared/src/index.ts @@ -1,5 +1,5 @@ export * from './cap'; export * from './environment'; -export { getBootstrapResourceUrls } from './helpers'; +export { getBootstrapResourceUrls, getVariantPreviewAppScript } from './helpers'; export { generateReadMe } from './read-me'; export * from './system-utils'; diff --git a/packages/fiori-generator-shared/test/helpers.test.ts b/packages/fiori-generator-shared/test/helpers.test.ts index 4748fd914b..076a172780 100644 --- a/packages/fiori-generator-shared/test/helpers.test.ts +++ b/packages/fiori-generator-shared/test/helpers.test.ts @@ -1,4 +1,4 @@ -import { getBootstrapResourceUrls } from '../src/index'; +import { getBootstrapResourceUrls, getVariantPreviewAppScript } from '../src/index'; describe('getResourceUrlsForUi5Bootstrap', () => { it('should return relative paths for Edmx projects', () => { @@ -42,3 +42,32 @@ describe('getResourceUrlsForUi5Bootstrap', () => { }); }); }); + +describe('getVariantPreviewAppScript', () => { + it('should return the correct command with a given SAP client', () => { + const sapClient = '100'; + const expectedCommand = + 'fiori run --open "preview.html?&sap-client=100&sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app"'; + expect(getVariantPreviewAppScript(sapClient)).toBe(expectedCommand); + }); + + it('should return the correct command with an empty SAP client', () => { + const sapClient = ''; + const expectedCommand = + 'fiori run --open "preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app"'; + expect(getVariantPreviewAppScript(sapClient)).toBe(expectedCommand); + }); + + it('should return the correct command with no SAP client argument', () => { + const sapClient = undefined; + const expectedCommand = + 'fiori run --open "preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app"'; + expect(getVariantPreviewAppScript(sapClient)).toBe(expectedCommand); + }); + + it('should handle default parameter value correctly', () => { + const expectedCommand = + 'fiori run --open "preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app"'; + expect(getVariantPreviewAppScript()).toBe(expectedCommand); + }); +}); diff --git a/packages/odata-service-writer/src/index.ts b/packages/odata-service-writer/src/index.ts index 8f69619888..6f0340c72f 100644 --- a/packages/odata-service-writer/src/index.ts +++ b/packages/odata-service-writer/src/index.ts @@ -94,7 +94,10 @@ async function generate(basePath: string, service: OdataService, fs?: Editor): P ui5Config.addBackendToFioriToolsProxydMiddleware(service.previewSettings as ProxyBackend); } catch (error: any) { if (error instanceof YAMLError && error.code === yamlErrorCode.nodeNotFound) { - ui5Config.addFioriToolsProxydMiddleware({ backend: [service.previewSettings as ProxyBackend] }); + ui5Config.addFioriToolsProxydMiddleware({ + backend: [service.previewSettings as ProxyBackend], + ignoreCertError: service.ignoreCertError + }); } else { throw error; } @@ -106,7 +109,10 @@ async function generate(basePath: string, service: OdataService, fs?: Editor): P ui5LocalConfigPath = join(dirname(paths.ui5Yaml), 'ui5-local.yaml'); if (fs.exists(ui5LocalConfigPath)) { ui5LocalConfig = await UI5Config.newInstance(fs.read(ui5LocalConfigPath)); - ui5LocalConfig.addFioriToolsProxydMiddleware({ backend: [service.previewSettings as ProxyBackend] }); + ui5LocalConfig.addFioriToolsProxydMiddleware({ + backend: [service.previewSettings as ProxyBackend], + ignoreCertError: service.ignoreCertError + }); } } diff --git a/packages/odata-service-writer/src/types.ts b/packages/odata-service-writer/src/types.ts index af649cb390..dea7c5d77b 100644 --- a/packages/odata-service-writer/src/types.ts +++ b/packages/odata-service-writer/src/types.ts @@ -74,4 +74,8 @@ export interface OdataService { annotations?: EdmxAnnotationsInfo | CdsAnnotationsInfo; localAnnotationsName?: string; // The name used in the manifest.json and as the filename for local annotations previewSettings?: Partial; + /** + * Indicates whether certificate errors should be ignored. + */ + ignoreCertError?: boolean; } diff --git a/packages/ui5-application-writer/src/data/defaults.ts b/packages/ui5-application-writer/src/data/defaults.ts index b70aeb0851..099dda7084 100644 --- a/packages/ui5-application-writer/src/data/defaults.ts +++ b/packages/ui5-application-writer/src/data/defaults.ts @@ -1,5 +1,6 @@ import { UI5_DEFAULT, getEsmTypesVersion, getTypesVersion, getTypesPackage } from '@sap-ux/ui5-config'; -import type { App, AppOptions, Package, UI5, UI5Framework } from '../types'; +import type { App, AppOptions, UI5, UI5Framework } from '../types'; +import type { Package } from '@sap-ux/project-access'; import versionToManifestDescMapping from '@ui5/manifest/mapping.json'; // from https://github.com/SAP/ui5-manifest/blob/master/mapping.json import { getUI5Libs } from './ui5Libs'; import semVer from 'semver'; diff --git a/packages/ui5-application-writer/src/data/index.ts b/packages/ui5-application-writer/src/data/index.ts index 27124fdc79..9d92668602 100644 --- a/packages/ui5-application-writer/src/data/index.ts +++ b/packages/ui5-application-writer/src/data/index.ts @@ -1,4 +1,5 @@ -import type { App, UI5, AppOptions, Package, Ui5App } from '../types'; +import type { App, UI5, AppOptions, Ui5App } from '../types'; +import type { Package } from '@sap-ux/project-access'; import { mergeObjects } from '@sap-ux/ui5-config'; import { mergeApp, packageDefaults, mergeUi5, getSpecTagVersion } from './defaults'; import { validate } from './validators'; @@ -31,6 +32,11 @@ export function mergeWithDefaults(ui5App: Ui5App): { ui5App.package ); + if (!isEdmxProjectType) { + // sapuxLayer is not defined for cap projects + ui5App.package.sapuxLayer = undefined; + } + if (ui5App.appOptions.sapux && isEdmxProjectType) { // Add @sap/ux-specification to devDependencies only for non-CAP projects ui5App.package.devDependencies = ui5App.package.devDependencies || {}; diff --git a/packages/ui5-application-writer/src/index.ts b/packages/ui5-application-writer/src/index.ts index d9b37b6d7f..c956ea8a3c 100644 --- a/packages/ui5-application-writer/src/index.ts +++ b/packages/ui5-application-writer/src/index.ts @@ -2,9 +2,9 @@ import { join } from 'path'; import { create as createStorage } from 'mem-fs'; import type { Editor } from 'mem-fs-editor'; import { create } from 'mem-fs-editor'; -import type { App, AppOptions, Package, UI5 } from './types'; +import type { App, AppOptions, UI5 } from './types'; import { UI5Config, getEsmTypesVersion, getTypesPackage } from '@sap-ux/ui5-config'; -import { getMinimumUI5Version, type Manifest } from '@sap-ux/project-access'; +import { getMinimumUI5Version, type Manifest, type Package } from '@sap-ux/project-access'; import { mergeWithDefaults } from './data'; import { ui5TSSupport } from './data/ui5Libs'; import { applyOptionalFeatures, enableTypescript as enableTypescriptOption, getTemplateOptions } from './options'; @@ -59,6 +59,8 @@ async function generate(basePath: string, ui5AppConfig: Ui5App, fs?: Editor): Pr }); ui5Config.addFioriToolsAppReloadMiddleware(); if (isEdmxProjectType) { + // add preview middleware to ui5Config + ui5Config.addFioriToolsPreviewMiddleware(ui5App.app.id, ui5App.ui5?.ui5Theme); const ui5LocalConfigPath = join(basePath, 'ui5-local.yaml'); // write ui5-local.yaml only for non-CAP applications const ui5LocalConfig = await UI5Config.newInstance(fs.read(ui5LocalConfigPath)); @@ -71,6 +73,8 @@ async function generate(basePath: string, ui5AppConfig: Ui5App, fs?: Editor): Pr ui5LocalConfig.addFioriToolsAppReloadMiddleware(); // Add optional features await applyOptionalFeatures(ui5App, fs, basePath, tmplPath, [ui5Config, ui5LocalConfig]); + // add preview middleware to ui5LocalConfig + ui5LocalConfig.addFioriToolsPreviewMiddleware(ui5App.app.id, ui5App.ui5?.ui5Theme); // write ui5 local yaml fs.write(ui5LocalConfigPath, ui5LocalConfig.toString()); } else { diff --git a/packages/ui5-application-writer/src/types.ts b/packages/ui5-application-writer/src/types.ts index 6454d2f1d8..bf35aaf298 100644 --- a/packages/ui5-application-writer/src/types.ts +++ b/packages/ui5-application-writer/src/types.ts @@ -1,15 +1,4 @@ -import type { ProjectType } from '@sap-ux/project-access'; -export interface Package { - name: string; - version?: string; - description?: string; - scripts?: Record; - dependencies?: Record; - devDependencies?: Record; - ui5?: { - dependencies?: string[]; - }; -} +import type { ProjectType, Package } from '@sap-ux/project-access'; export interface App { id: string; diff --git a/packages/ui5-application-writer/templates/core/package.json b/packages/ui5-application-writer/templates/core/package.json index 5987faf21a..541b9c6bf2 100644 --- a/packages/ui5-application-writer/templates/core/package.json +++ b/packages/ui5-application-writer/templates/core/package.json @@ -9,6 +9,9 @@ ], "main": "webapp/index.html", "dependencies": {}, - "devDependencies": <%- JSON.stringify(package.devDependencies, null, 8) -%>, - "scripts": <%- JSON.stringify(package.scripts, null, 4) -%> -} + "devDependencies": <%- JSON.stringify(package.devDependencies, null, 8).trim() -%>, + "scripts": <%- JSON.stringify(package.scripts, null, 4).trim() -%> + <% if (package.sapuxLayer) { %> + ,"sapuxLayer": "<%= package.sapuxLayer %>" + <% } %> +} \ No newline at end of file diff --git a/packages/ui5-application-writer/test/__snapshots__/index.test.ts.snap b/packages/ui5-application-writer/test/__snapshots__/index.test.ts.snap index 27195b7bb5..f1028071ad 100644 --- a/packages/ui5-application-writer/test/__snapshots__/index.test.ts.snap +++ b/packages/ui5-application-writer/test/__snapshots__/index.test.ts.snap @@ -35,8 +35,8 @@ archive.zip \\"start\\": \\"ui5 serve --config=ui5.yaml --open index.html\\", \\"start-local\\": \\"ui5 serve --config=ui5-local.yaml --open index.html\\", \\"build\\": \\"ui5 build --config=ui5.yaml --clean-dest --dest dist\\" -}} -", +} +}", "state": "modified", }, "ui5-local.yaml": Object { @@ -61,6 +61,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: testAppId + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -88,6 +93,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: testAppId + ui5Theme: sap_fiori_3 ", "state": "modified", }, diff --git a/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap b/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap index 25bc7069a1..421d7ce583 100644 --- a/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap +++ b/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap @@ -97,6 +97,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -124,6 +129,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -340,6 +350,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -367,6 +382,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -554,8 +574,8 @@ archive.zip \\"start\\": \\"ui5 serve --config=ui5.yaml --open index.html\\", \\"start-local\\": \\"ui5 serve --config=ui5-local.yaml --open index.html\\", \\"build\\": \\"ui5 build --config=ui5.yaml --clean-dest --dest dist\\" -}} -", +} +}", "state": "modified", }, "ui5-local.yaml": Object { @@ -580,6 +600,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -607,6 +632,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 ", "state": "modified", }, @@ -1199,6 +1229,11 @@ server: - name: ui5-tooling-modules-middleware afterMiddleware: compression configuration: {} + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 builder: customTasks: - name: ui5-tooling-transpile-task @@ -1237,6 +1272,11 @@ server: port: 35729 path: webapp delay: 300 + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: app.with.namespace + ui5Theme: sap_fiori_3 - name: ui5-tooling-transpile-middleware afterMiddleware: compression configuration: diff --git a/packages/ui5-application-writer/test/data.test.ts b/packages/ui5-application-writer/test/data.test.ts index adc990132c..473da25761 100644 --- a/packages/ui5-application-writer/test/data.test.ts +++ b/packages/ui5-application-writer/test/data.test.ts @@ -280,6 +280,7 @@ describe('Setting defaults', () => { devDepB: '9.10.11', '@ui5/cli': '3.0.0' }, + sapuxLayer: 'CUSTOMER_BASE', scripts: { doTaskA: 'echo "Doing task A"', doTaskB: 'echo "Doing task B"' @@ -300,6 +301,7 @@ describe('Setting defaults', () => { devDepB: '9.10.11' }, name: 'test-package-name', + sapuxLayer: 'CUSTOMER_BASE', scripts: { start: 'ui5 serve --config=ui5.yaml --open index.html', 'start-local': 'ui5 serve --config=ui5-local.yaml --open index.html', @@ -332,7 +334,8 @@ describe('Setting defaults', () => { scripts: { doTaskA: 'echo "Doing task A"', doTaskB: 'echo "Doing task B"' - } + }, + sapuxLayer: 'CUSTOMER_BASE' // expect sapuxLayer to be undefined for cap projects } }; diff --git a/packages/ui5-config/src/middlewares.ts b/packages/ui5-config/src/middlewares.ts index 9fd41b70ef..375f153cf5 100644 --- a/packages/ui5-config/src/middlewares.ts +++ b/packages/ui5-config/src/middlewares.ts @@ -4,7 +4,8 @@ import type { FioriAppReloadConfig, FioriToolsProxyConfig, MockserverConfig, - FioriToolsProxyConfigUI5 + FioriToolsProxyConfigUI5, + FioriPreviewConfig } from './types'; import type { NodeComment } from '@sap-ux/yaml'; @@ -25,6 +26,24 @@ export function getAppReloadMiddlewareConfig(): CustomMiddleware} The configuration object for the middleware. + */ +export function getPreviewMiddlewareConfig(appId: string, ui5Theme: string): CustomMiddleware { + return { + name: 'fiori-tools-preview', + afterMiddleware: 'fiori-tools-appreload', + configuration: { + component: appId, + ui5Theme: ui5Theme + } + }; +} + /** * Returns default comments for the given backend configuration values. * @@ -54,12 +73,14 @@ export function getBackendComments( * @param backends configuration of backends * @param ui5 UI5 configuration * @param afterMiddleware middleware after which fiori-tools-proxy middleware will be started + * @param ignoreCertError ignore certificate errors * @returns {{config, comments}} configuration and comments */ export function getFioriToolsProxyMiddlewareConfig( backends?: FioriToolsProxyConfigBackend[], ui5?: Partial, - afterMiddleware = 'compression' + afterMiddleware = 'compression', + ignoreCertError: boolean = false ): { config: CustomMiddleware; comments: NodeComment>[]; @@ -68,7 +89,7 @@ export function getFioriToolsProxyMiddlewareConfig( name: 'fiori-tools-proxy', afterMiddleware, configuration: { - ignoreCertError: false + ignoreCertError: ignoreCertError } }; let comments: NodeComment>[] = [ diff --git a/packages/ui5-config/src/types/index.ts b/packages/ui5-config/src/types/index.ts index bad44157c9..364666faad 100644 --- a/packages/ui5-config/src/types/index.ts +++ b/packages/ui5-config/src/types/index.ts @@ -43,6 +43,21 @@ export interface FioriAppReloadConfig { delay: number; } +/** + * Interface representing the configuration for Fiori Preview. + */ +export interface FioriPreviewConfig { + /** + * The name of the component to be previewed. + */ + component: string; + /** + * The theme to be used for the SAP Fiori preview. + * This defines the UI5 theme, such as "sap_fiori_3" or other available themes. + */ + ui5Theme: string; +} + export interface ServeStaticPath { path: string; src: string; diff --git a/packages/ui5-config/src/ui5config.ts b/packages/ui5-config/src/ui5config.ts index 38c351a9df..821b4696d4 100644 --- a/packages/ui5-config/src/ui5config.ts +++ b/packages/ui5-config/src/ui5config.ts @@ -20,7 +20,8 @@ import { getAppReloadMiddlewareConfig, getBackendComments, getFioriToolsProxyMiddlewareConfig, - getMockServerMiddlewareConfig + getMockServerMiddlewareConfig, + getPreviewMiddlewareConfig } from './middlewares'; import { fioriToolsProxy, serveStatic } from './constants'; @@ -226,6 +227,22 @@ export class UI5Config { return this; } + /** + * Adds the Fiori Tools preview middleware configuration to the UI5 server configuration. + * This middleware is used to preview the Fiori application with the specified UI5 theme. + * + * @param {string} appId - The ID of the application for which the preview middleware is configured. + * @param {string} ui5Theme - The UI5 theme to be used. + * @returns {UI5Config} The updated UI5 configuration object. + */ + public addFioriToolsPreviewMiddleware(appId: string, ui5Theme: string): UI5Config { + this.document.appendTo({ + path: 'server.customMiddleware', + value: getPreviewMiddlewareConfig(appId, ui5Theme) + }); + return this; + } + /** * Adds a instance of the Fiori tools proxy middleware to the config. * @@ -238,7 +255,8 @@ export class UI5Config { const { config, comments } = getFioriToolsProxyMiddlewareConfig( proxyConfig.backend, proxyConfig.ui5, - afterMiddleware + afterMiddleware, + proxyConfig.ignoreCertError ); this.document.appendTo({ path: 'server.customMiddleware', diff --git a/packages/ui5-config/test/__snapshots__/index.test.ts.snap b/packages/ui5-config/test/__snapshots__/index.test.ts.snap index 11f2a24874..b32ac31dd8 100644 --- a/packages/ui5-config/test/__snapshots__/index.test.ts.snap +++ b/packages/ui5-config/test/__snapshots__/index.test.ts.snap @@ -211,13 +211,13 @@ exports[`UI5Config addFioriToolsProxydMiddleware add / get commonly configured b " `; -exports[`UI5Config addFioriToolsProxydMiddleware add backend with flexible parameters (and UI5 defaults) 1`] = ` +exports[`UI5Config addFioriToolsProxydMiddleware add backend with flexible parameters (and UI5 defaults) & writes ignoreCertError true if enabled 1`] = ` "server: customMiddleware: - name: fiori-tools-proxy afterMiddleware: compression configuration: - ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted + ignoreCertError: true # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted backend: - url: http://localhost:8080 path: /~testpath~ diff --git a/packages/ui5-config/test/index.test.ts b/packages/ui5-config/test/index.test.ts index c6d38d0f5c..4c36093c3b 100644 --- a/packages/ui5-config/test/index.test.ts +++ b/packages/ui5-config/test/index.test.ts @@ -191,9 +191,10 @@ describe('UI5Config', () => { expect(backendConfigs).toEqual(backend); }); - test('add backend with flexible parameters (and UI5 defaults)', () => { + test('add backend with flexible parameters (and UI5 defaults) & writes ignoreCertError true if enabled', () => { ui5Config.addFioriToolsProxydMiddleware({ backend: [{ url, path, pathPrefix: '/~prefix', scp: true }], + ignoreCertError: true, ui5: {} }); expect(ui5Config.toString()).toMatchSnapshot(); @@ -234,6 +235,23 @@ describe('UI5Config', () => { ui5Config.addFioriToolsAppReloadMiddleware(); expect(() => ui5Config.addBackendToFioriToolsProxydMiddleware({ url, path })).toThrowError(); }); + + test('Should add preview middlewares correctly', () => { + ui5Config.addFioriToolsPreviewMiddleware('my.app', 'sap_fiori_3'); + expect(ui5Config.toString().replace(/\s+/g, ' ').trim()).toBe( + ` + server: + customMiddleware: + - name: fiori-tools-preview + afterMiddleware: fiori-tools-appreload + configuration: + component: my.app + ui5Theme: sap_fiori_3 + ` + .replace(/\s+/g, ' ') + .trim() + ); + }); }); describe('addUi5ToFioriToolsProxydMiddleware', () => { From 1e04fc796c19a35289864f298c4cd6156b716e67 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 23 Sep 2024 10:02:33 +0000 Subject: [PATCH 044/122] chore: apply latest changesets --- .changeset/purple-snakes-impress.md | 11 ----------- examples/fe-fpm-cli/CHANGELOG.md | 6 ++++++ examples/fe-fpm-cli/package.json | 2 +- examples/simple-generator/CHANGELOG.md | 11 +++++++++++ examples/simple-generator/package.json | 2 +- .../abap-deploy-config-inquirer/CHANGELOG.md | 10 ++++++++++ .../abap-deploy-config-inquirer/package.json | 2 +- packages/abap-deploy-config-writer/CHANGELOG.md | 9 +++++++++ packages/abap-deploy-config-writer/package.json | 2 +- packages/adp-tooling/CHANGELOG.md | 10 ++++++++++ packages/adp-tooling/package.json | 2 +- packages/annotation-generator/CHANGELOG.md | 7 +++++++ packages/annotation-generator/package.json | 2 +- packages/app-config-writer/CHANGELOG.md | 9 +++++++++ packages/app-config-writer/package.json | 2 +- packages/cap-config-writer/CHANGELOG.md | 8 ++++++++ packages/cap-config-writer/package.json | 2 +- .../cards-editor-config-writer/CHANGELOG.md | 7 +++++++ .../cards-editor-config-writer/package.json | 2 +- packages/cards-editor-middleware/CHANGELOG.md | 6 ++++++ packages/cards-editor-middleware/package.json | 2 +- packages/create/CHANGELOG.md | 17 +++++++++++++++++ packages/create/package.json | 2 +- packages/deploy-tooling/CHANGELOG.md | 9 +++++++++ packages/deploy-tooling/package.json | 2 +- packages/environment-check/CHANGELOG.md | 9 +++++++++ packages/environment-check/package.json | 2 +- packages/fe-fpm-writer/CHANGELOG.md | 7 +++++++ packages/fe-fpm-writer/package.json | 2 +- packages/fiori-annotation-api/CHANGELOG.md | 7 +++++++ packages/fiori-annotation-api/package.json | 2 +- packages/fiori-elements-writer/CHANGELOG.md | 16 ++++++++++++++++ packages/fiori-elements-writer/package.json | 2 +- packages/fiori-freestyle-writer/CHANGELOG.md | 14 ++++++++++++++ packages/fiori-freestyle-writer/package.json | 2 +- packages/fiori-generator-shared/CHANGELOG.md | 10 ++++++++++ packages/fiori-generator-shared/package.json | 2 +- packages/launch-config/CHANGELOG.md | 8 ++++++++ packages/launch-config/package.json | 2 +- packages/mockserver-config-writer/CHANGELOG.md | 7 +++++++ packages/mockserver-config-writer/package.json | 2 +- packages/odata-service-inquirer/CHANGELOG.md | 8 ++++++++ packages/odata-service-inquirer/package.json | 2 +- packages/odata-service-writer/CHANGELOG.md | 12 ++++++++++++ packages/odata-service-writer/package.json | 2 +- packages/preview-middleware/CHANGELOG.md | 7 +++++++ packages/preview-middleware/package.json | 2 +- packages/project-access/CHANGELOG.md | 7 +++++++ packages/project-access/package.json | 2 +- packages/telemetry/CHANGELOG.md | 8 ++++++++ packages/telemetry/package.json | 2 +- packages/ui5-application-inquirer/CHANGELOG.md | 6 ++++++ packages/ui5-application-inquirer/package.json | 2 +- packages/ui5-application-writer/CHANGELOG.md | 11 +++++++++++ packages/ui5-application-writer/package.json | 2 +- packages/ui5-config/CHANGELOG.md | 6 ++++++ packages/ui5-config/package.json | 2 +- .../ui5-library-reference-inquirer/CHANGELOG.md | 6 ++++++ .../ui5-library-reference-inquirer/package.json | 2 +- .../ui5-library-reference-writer/CHANGELOG.md | 8 ++++++++ .../ui5-library-reference-writer/package.json | 2 +- packages/ui5-library-writer/CHANGELOG.md | 9 +++++++++ packages/ui5-library-writer/package.json | 2 +- packages/ui5-proxy-middleware/CHANGELOG.md | 7 +++++++ packages/ui5-proxy-middleware/package.json | 2 +- 65 files changed, 314 insertions(+), 43 deletions(-) delete mode 100644 .changeset/purple-snakes-impress.md diff --git a/.changeset/purple-snakes-impress.md b/.changeset/purple-snakes-impress.md deleted file mode 100644 index 8c8902a827..0000000000 --- a/.changeset/purple-snakes-impress.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@sap-ux/fiori-freestyle-writer': minor -'@sap-ux/fiori-generator-shared': minor -'@sap-ux/ui5-application-writer': minor -'@sap-ux/fiori-elements-writer': minor -'@sap-ux/odata-service-writer': minor -'@sap-ux/ui5-config': minor -'@sap-ux/generator-simple-fe': patch ---- - -Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. diff --git a/examples/fe-fpm-cli/CHANGELOG.md b/examples/fe-fpm-cli/CHANGELOG.md index 97e509006a..6731c1f8bf 100644 --- a/examples/fe-fpm-cli/CHANGELOG.md +++ b/examples/fe-fpm-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/fe-fpm-cli +## 0.0.30 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.3 + ## 0.0.29 ### Patch Changes diff --git a/examples/fe-fpm-cli/package.json b/examples/fe-fpm-cli/package.json index 827bec11d3..893715ee7d 100644 --- a/examples/fe-fpm-cli/package.json +++ b/examples/fe-fpm-cli/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fe-fpm-cli", - "version": "0.0.29", + "version": "0.0.30", "description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.", "license": "Apache-2.0", "private": true, diff --git a/examples/simple-generator/CHANGELOG.md b/examples/simple-generator/CHANGELOG.md index d7253ab3fe..d628b076c8 100644 --- a/examples/simple-generator/CHANGELOG.md +++ b/examples/simple-generator/CHANGELOG.md @@ -1,5 +1,16 @@ # @sap-ux/generator-simple-fe +## 1.0.51 + +### Patch Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. +- Updated dependencies [484195d] + - @sap-ux/fiori-freestyle-writer@1.1.0 + - @sap-ux/fiori-elements-writer@1.2.0 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.11 + ## 1.0.50 ### Patch Changes diff --git a/examples/simple-generator/package.json b/examples/simple-generator/package.json index 6e166de152..13ea030a85 100644 --- a/examples/simple-generator/package.json +++ b/examples/simple-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/generator-simple-fe", - "version": "1.0.50", + "version": "1.0.51", "description": "Simple example of a yeoman generator for Fiori elements.", "license": "Apache-2.0", "private": true, diff --git a/packages/abap-deploy-config-inquirer/CHANGELOG.md b/packages/abap-deploy-config-inquirer/CHANGELOG.md index da075ff4fd..7a005dbc05 100644 --- a/packages/abap-deploy-config-inquirer/CHANGELOG.md +++ b/packages/abap-deploy-config-inquirer/CHANGELOG.md @@ -1,5 +1,15 @@ # @sap-ux/abap-deploy-config-inquirer +## 0.0.20 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/fiori-generator-shared@0.4.0 + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.11 + ## 0.0.19 ### Patch Changes diff --git a/packages/abap-deploy-config-inquirer/package.json b/packages/abap-deploy-config-inquirer/package.json index 2bd717ec4d..3f6f3c5c85 100644 --- a/packages/abap-deploy-config-inquirer/package.json +++ b/packages/abap-deploy-config-inquirer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-inquirer" }, - "version": "0.0.19", + "version": "0.0.20", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/abap-deploy-config-writer/CHANGELOG.md b/packages/abap-deploy-config-writer/CHANGELOG.md index 7470b900c8..783cdef4ac 100644 --- a/packages/abap-deploy-config-writer/CHANGELOG.md +++ b/packages/abap-deploy-config-writer/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/abap-deploy-config-writer +## 0.0.44 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + - @sap-ux/system-access@0.5.11 + ## 0.0.43 ### Patch Changes diff --git a/packages/abap-deploy-config-writer/package.json b/packages/abap-deploy-config-writer/package.json index e585e16f6e..658b6a21db 100644 --- a/packages/abap-deploy-config-writer/package.json +++ b/packages/abap-deploy-config-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-writer" }, - "version": "0.0.43", + "version": "0.0.44", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/adp-tooling/CHANGELOG.md b/packages/adp-tooling/CHANGELOG.md index e30c22cf1c..8b00415591 100644 --- a/packages/adp-tooling/CHANGELOG.md +++ b/packages/adp-tooling/CHANGELOG.md @@ -1,5 +1,15 @@ # @sap-ux/adp-tooling +## 0.12.51 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.11 + ## 0.12.50 ### Patch Changes diff --git a/packages/adp-tooling/package.json b/packages/adp-tooling/package.json index 644ebf4c2c..aa1767e55c 100644 --- a/packages/adp-tooling/package.json +++ b/packages/adp-tooling/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling" }, - "version": "0.12.50", + "version": "0.12.51", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/annotation-generator/CHANGELOG.md b/packages/annotation-generator/CHANGELOG.md index 1043a5cf27..7eb53fcee4 100644 --- a/packages/annotation-generator/CHANGELOG.md +++ b/packages/annotation-generator/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/annotation-generator +## 0.2.4 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 +- @sap-ux/fiori-annotation-api@0.2.4 + ## 0.2.3 ### Patch Changes diff --git a/packages/annotation-generator/package.json b/packages/annotation-generator/package.json index 62c19a5431..a36fbc0a23 100644 --- a/packages/annotation-generator/package.json +++ b/packages/annotation-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/annotation-generator", - "version": "0.2.3", + "version": "0.2.4", "description": "Library that provides API for generation of annotations by SAP Fiori App Generator", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/app-config-writer/CHANGELOG.md b/packages/app-config-writer/CHANGELOG.md index fb9db63d09..fbba972e14 100644 --- a/packages/app-config-writer/CHANGELOG.md +++ b/packages/app-config-writer/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/app-config-writer +## 0.4.35 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + - @sap-ux/axios-extension@1.16.6 + ## 0.4.34 ### Patch Changes diff --git a/packages/app-config-writer/package.json b/packages/app-config-writer/package.json index f1f73f2ec3..0d3668f3e3 100644 --- a/packages/app-config-writer/package.json +++ b/packages/app-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/app-config-writer", "description": "Add or update configuration for SAP Fiori tools application", - "version": "0.4.34", + "version": "0.4.35", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cap-config-writer/CHANGELOG.md b/packages/cap-config-writer/CHANGELOG.md index 7c39c2b87a..1beb7f27b4 100644 --- a/packages/cap-config-writer/CHANGELOG.md +++ b/packages/cap-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/cap-config-writer +## 0.7.42 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/fiori-generator-shared@0.4.0 + - @sap-ux/project-access@1.27.4 + ## 0.7.41 ### Patch Changes diff --git a/packages/cap-config-writer/package.json b/packages/cap-config-writer/package.json index 81e7136b48..60b7d22dd5 100644 --- a/packages/cap-config-writer/package.json +++ b/packages/cap-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/cap-config-writer", "description": "Add or update configuration for SAP CAP projects", - "version": "0.7.41", + "version": "0.7.42", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cards-editor-config-writer/CHANGELOG.md b/packages/cards-editor-config-writer/CHANGELOG.md index 95c8b0a04a..deff7c4b98 100644 --- a/packages/cards-editor-config-writer/CHANGELOG.md +++ b/packages/cards-editor-config-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/cards-editor-config-writer +## 0.4.5 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + ## 0.4.4 ### Patch Changes diff --git a/packages/cards-editor-config-writer/package.json b/packages/cards-editor-config-writer/package.json index 46e6534e07..46c53d72ff 100644 --- a/packages/cards-editor-config-writer/package.json +++ b/packages/cards-editor-config-writer/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/cards-editor-config-writer", - "version": "0.4.4", + "version": "0.4.5", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cards-editor-middleware/CHANGELOG.md b/packages/cards-editor-middleware/CHANGELOG.md index f05f688050..b485ab9945 100644 --- a/packages/cards-editor-middleware/CHANGELOG.md +++ b/packages/cards-editor-middleware/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/cards-editor-middleware +## 0.4.25 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 + ## 0.4.24 ### Patch Changes diff --git a/packages/cards-editor-middleware/package.json b/packages/cards-editor-middleware/package.json index 3e040aafb0..bad5df0867 100644 --- a/packages/cards-editor-middleware/package.json +++ b/packages/cards-editor-middleware/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/cards-editor-middleware", - "version": "0.4.24", + "version": "0.4.25", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index f1550be146..8523f32c1e 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,22 @@ # @sap-ux/create +## 0.8.21 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/abap-deploy-config-inquirer@0.0.20 + - @sap-ux/cap-config-writer@0.7.42 + - @sap-ux/abap-deploy-config-writer@0.0.44 + - @sap-ux/adp-tooling@0.12.51 + - @sap-ux/app-config-writer@0.4.35 + - @sap-ux/cards-editor-config-writer@0.4.5 + - @sap-ux/mockserver-config-writer@0.6.5 + - @sap-ux/project-access@1.27.4 + - @sap-ux/preview-middleware@0.16.69 + - @sap-ux/system-access@0.5.11 + ## 0.8.20 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index a7f6efdc26..ff38b396ed 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/create", "description": "SAP Fiori tools module to add or remove features", - "version": "0.8.20", + "version": "0.8.21", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/deploy-tooling/CHANGELOG.md b/packages/deploy-tooling/CHANGELOG.md index 3c810bdd59..c34befcaa7 100644 --- a/packages/deploy-tooling/CHANGELOG.md +++ b/packages/deploy-tooling/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/deploy-tooling +## 0.15.18 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.11 + ## 0.15.17 ### Patch Changes diff --git a/packages/deploy-tooling/package.json b/packages/deploy-tooling/package.json index 0855ee7635..1389946f7e 100644 --- a/packages/deploy-tooling/package.json +++ b/packages/deploy-tooling/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Adeploy-tooling" }, - "version": "0.15.17", + "version": "0.15.18", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/environment-check/CHANGELOG.md b/packages/environment-check/CHANGELOG.md index 9a17e0ce4c..bf6437d338 100644 --- a/packages/environment-check/CHANGELOG.md +++ b/packages/environment-check/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/environment-check +## 0.17.38 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + - @sap-ux/axios-extension@1.16.6 + ## 0.17.37 ### Patch Changes diff --git a/packages/environment-check/package.json b/packages/environment-check/package.json index 6fad8fbca2..67a9dfa4c0 100644 --- a/packages/environment-check/package.json +++ b/packages/environment-check/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/environment-check", - "version": "0.17.37", + "version": "0.17.38", "description": "SAP Fiori environment check", "license": "Apache-2.0", "bin": { diff --git a/packages/fe-fpm-writer/CHANGELOG.md b/packages/fe-fpm-writer/CHANGELOG.md index cd31a42a6d..e30ac1f03e 100644 --- a/packages/fe-fpm-writer/CHANGELOG.md +++ b/packages/fe-fpm-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fe-fpm-writer +## 0.31.3 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 +- @sap-ux/fiori-annotation-api@0.2.4 + ## 0.31.2 ### Patch Changes diff --git a/packages/fe-fpm-writer/package.json b/packages/fe-fpm-writer/package.json index a81b360858..d5b6df188d 100644 --- a/packages/fe-fpm-writer/package.json +++ b/packages/fe-fpm-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fe-fpm-writer", "description": "SAP Fiori elements flexible programming model writer", - "version": "0.31.2", + "version": "0.31.3", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-annotation-api/CHANGELOG.md b/packages/fiori-annotation-api/CHANGELOG.md index 23c4f7f714..3316eab9ca 100644 --- a/packages/fiori-annotation-api/CHANGELOG.md +++ b/packages/fiori-annotation-api/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fiori-annotation-api +## 0.2.4 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 +- @sap-ux/cds-odata-annotation-converter@0.3.6 + ## 0.2.3 ### Patch Changes diff --git a/packages/fiori-annotation-api/package.json b/packages/fiori-annotation-api/package.json index 8024c09d30..614c8683fa 100644 --- a/packages/fiori-annotation-api/package.json +++ b/packages/fiori-annotation-api/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fiori-annotation-api", - "version": "0.2.3", + "version": "0.2.4", "description": "Library that provides API for reading and writing annotations in SAP Fiori elements projects.", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/fiori-elements-writer/CHANGELOG.md b/packages/fiori-elements-writer/CHANGELOG.md index 40e74a04f1..ffb37495cc 100644 --- a/packages/fiori-elements-writer/CHANGELOG.md +++ b/packages/fiori-elements-writer/CHANGELOG.md @@ -1,5 +1,21 @@ # @sap-ux/fiori-elements-writer +## 1.2.0 + +### Minor Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/fiori-generator-shared@0.4.0 + - @sap-ux/ui5-application-writer@1.2.0 + - @sap-ux/odata-service-writer@0.23.0 + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/fe-fpm-writer@0.31.3 + - @sap-ux/ui5-test-writer@0.4.1 + ## 1.1.24 ### Patch Changes diff --git a/packages/fiori-elements-writer/package.json b/packages/fiori-elements-writer/package.json index 2cd63e0e0a..c148095d8c 100644 --- a/packages/fiori-elements-writer/package.json +++ b/packages/fiori-elements-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-elements-writer", "description": "SAP Fiori elements application writer", - "version": "1.1.24", + "version": "1.2.0", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-freestyle-writer/CHANGELOG.md b/packages/fiori-freestyle-writer/CHANGELOG.md index c02308e615..0f6c784e2d 100644 --- a/packages/fiori-freestyle-writer/CHANGELOG.md +++ b/packages/fiori-freestyle-writer/CHANGELOG.md @@ -1,5 +1,19 @@ # @sap-ux/fiori-freestyle-writer +## 1.1.0 + +### Minor Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/fiori-generator-shared@0.4.0 + - @sap-ux/ui5-application-writer@1.2.0 + - @sap-ux/odata-service-writer@0.23.0 + - @sap-ux/ui5-config@0.25.0 + ## 1.0.24 ### Patch Changes diff --git a/packages/fiori-freestyle-writer/package.json b/packages/fiori-freestyle-writer/package.json index 0103419c47..f2e01c007a 100644 --- a/packages/fiori-freestyle-writer/package.json +++ b/packages/fiori-freestyle-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-freestyle-writer", "description": "SAP Fiori freestyle application writer", - "version": "1.0.24", + "version": "1.1.0", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-generator-shared/CHANGELOG.md b/packages/fiori-generator-shared/CHANGELOG.md index ffacfa6721..2cc37471cc 100644 --- a/packages/fiori-generator-shared/CHANGELOG.md +++ b/packages/fiori-generator-shared/CHANGELOG.md @@ -1,5 +1,15 @@ # @sap-ux/fiori-generator-shared +## 0.4.0 + +### Minor Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. + +### Patch Changes + +- @sap-ux/project-access@1.27.4 + ## 0.3.21 ### Patch Changes diff --git a/packages/fiori-generator-shared/package.json b/packages/fiori-generator-shared/package.json index d1d1552aee..798b0241b3 100644 --- a/packages/fiori-generator-shared/package.json +++ b/packages/fiori-generator-shared/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-generator-shared", "description": "Commonly used shared functionality and types to support the fiori generator.", - "version": "0.3.21", + "version": "0.4.0", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/launch-config/CHANGELOG.md b/packages/launch-config/CHANGELOG.md index 8f34582bb6..dd933a2db6 100644 --- a/packages/launch-config/CHANGELOG.md +++ b/packages/launch-config/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/launch-config +## 0.5.1 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + ## 0.5.0 ### Minor Changes diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index a7344575bd..4b05572c60 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/launch-config", - "version": "0.5.0", + "version": "0.5.1", "description": "SAP Fiori tools launch config administration", "repository": { "type": "git", diff --git a/packages/mockserver-config-writer/CHANGELOG.md b/packages/mockserver-config-writer/CHANGELOG.md index e9468ebfc7..ef3d14dd57 100644 --- a/packages/mockserver-config-writer/CHANGELOG.md +++ b/packages/mockserver-config-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/mockserver-config-writer +## 0.6.5 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + ## 0.6.4 ### Patch Changes diff --git a/packages/mockserver-config-writer/package.json b/packages/mockserver-config-writer/package.json index 4dee826ed0..ac60d25830 100644 --- a/packages/mockserver-config-writer/package.json +++ b/packages/mockserver-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/mockserver-config-writer", "description": "Add or update configuration for SAP Fiori tools mockserver", - "version": "0.6.4", + "version": "0.6.5", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/odata-service-inquirer/CHANGELOG.md b/packages/odata-service-inquirer/CHANGELOG.md index 9781e75000..fbae91cd96 100644 --- a/packages/odata-service-inquirer/CHANGELOG.md +++ b/packages/odata-service-inquirer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/odata-service-inquirer +## 0.5.42 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 +- @sap-ux/telemetry@0.5.30 +- @sap-ux/axios-extension@1.16.6 + ## 0.5.41 ### Patch Changes diff --git a/packages/odata-service-inquirer/package.json b/packages/odata-service-inquirer/package.json index 080a582565..b6871d91f6 100644 --- a/packages/odata-service-inquirer/package.json +++ b/packages/odata-service-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/odata-service-inquirer", "description": "Prompts module that can prompt users for inputs required for odata service writing", - "version": "0.5.41", + "version": "0.5.42", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/odata-service-writer/CHANGELOG.md b/packages/odata-service-writer/CHANGELOG.md index 9385f14538..d21934010a 100644 --- a/packages/odata-service-writer/CHANGELOG.md +++ b/packages/odata-service-writer/CHANGELOG.md @@ -1,5 +1,17 @@ # @sap-ux/odata-service-writer +## 0.23.0 + +### Minor Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/mockserver-config-writer@0.6.5 + ## 0.22.5 ### Patch Changes diff --git a/packages/odata-service-writer/package.json b/packages/odata-service-writer/package.json index ee15766de6..fff3dd258b 100644 --- a/packages/odata-service-writer/package.json +++ b/packages/odata-service-writer/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aodata-service-writer" }, - "version": "0.22.5", + "version": "0.23.0", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/preview-middleware/CHANGELOG.md b/packages/preview-middleware/CHANGELOG.md index 0d7da954b0..6a4364ce42 100644 --- a/packages/preview-middleware/CHANGELOG.md +++ b/packages/preview-middleware/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/preview-middleware +## 0.16.69 + +### Patch Changes + +- @sap-ux/adp-tooling@0.12.51 +- @sap-ux/project-access@1.27.4 + ## 0.16.68 ### Patch Changes diff --git a/packages/preview-middleware/package.json b/packages/preview-middleware/package.json index 3c90280afd..079758ebe3 100644 --- a/packages/preview-middleware/package.json +++ b/packages/preview-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware" }, - "version": "0.16.68", + "version": "0.16.69", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/project-access/CHANGELOG.md b/packages/project-access/CHANGELOG.md index 8581fa3b7c..a640ae9583 100644 --- a/packages/project-access/CHANGELOG.md +++ b/packages/project-access/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/project-access +## 1.27.4 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + ## 1.27.3 ### Patch Changes diff --git a/packages/project-access/package.json b/packages/project-access/package.json index c6b8fe8efc..093002d274 100644 --- a/packages/project-access/package.json +++ b/packages/project-access/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/project-access", - "version": "1.27.3", + "version": "1.27.4", "description": "Library to access SAP Fiori tools projects", "repository": { "type": "git", diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index 8b11a1c95d..0de0c73abb 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/telemetry +## 0.5.30 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + ## 0.5.29 ### Patch Changes diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index 8d3a74c7f7..7e9368b8ae 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/telemetry", - "version": "0.5.29", + "version": "0.5.30", "description": "Library for sending usage telemetry data", "repository": { "type": "git", diff --git a/packages/ui5-application-inquirer/CHANGELOG.md b/packages/ui5-application-inquirer/CHANGELOG.md index b6eebd8585..a41b350e2d 100644 --- a/packages/ui5-application-inquirer/CHANGELOG.md +++ b/packages/ui5-application-inquirer/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui5-application-inquirer +## 0.6.6 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 + ## 0.6.5 ### Patch Changes diff --git a/packages/ui5-application-inquirer/package.json b/packages/ui5-application-inquirer/package.json index d35d5ec33e..ad173b59d3 100644 --- a/packages/ui5-application-inquirer/package.json +++ b/packages/ui5-application-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-application-inquirer", "description": "Prompts module that can prompt users for inputs required for UI5 application writing", - "version": "0.6.5", + "version": "0.6.6", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-application-writer/CHANGELOG.md b/packages/ui5-application-writer/CHANGELOG.md index e37d50bb22..5f04ce2fff 100644 --- a/packages/ui5-application-writer/CHANGELOG.md +++ b/packages/ui5-application-writer/CHANGELOG.md @@ -1,5 +1,16 @@ # @sap-ux/ui5-application-writer +## 1.2.0 + +### Minor Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + ## 1.1.6 ### Patch Changes diff --git a/packages/ui5-application-writer/package.json b/packages/ui5-application-writer/package.json index 7ce65e6c5d..c6f8a299e8 100644 --- a/packages/ui5-application-writer/package.json +++ b/packages/ui5-application-writer/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-application-writer" }, - "version": "1.1.6", + "version": "1.2.0", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-config/CHANGELOG.md b/packages/ui5-config/CHANGELOG.md index 41bc2fed9a..6c49ede644 100644 --- a/packages/ui5-config/CHANGELOG.md +++ b/packages/ui5-config/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui5-config +## 0.25.0 + +### Minor Changes + +- 484195d: Enhancements to FE & FF Configurations: The updates include adding the `start-variants-management` script to `package.json` for FE and FF. The OdataService interface now has an `ignoreCertError` property. UI5 application writer introduces the `sapuxLayer` property to `package.json` templates and adds `fiori-tools-preview middleware` to ui5, ui5-mock, and ui5-local.yaml. Additionally, the `addFioriToolsPreviewMiddleware` function has been added for YAML config integration. + ## 0.24.1 ### Patch Changes diff --git a/packages/ui5-config/package.json b/packages/ui5-config/package.json index d3c951cba8..2e80049d4c 100644 --- a/packages/ui5-config/package.json +++ b/packages/ui5-config/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-config" }, - "version": "0.24.1", + "version": "0.25.0", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-library-reference-inquirer/CHANGELOG.md b/packages/ui5-library-reference-inquirer/CHANGELOG.md index 32e0f03819..6df11c12e9 100644 --- a/packages/ui5-library-reference-inquirer/CHANGELOG.md +++ b/packages/ui5-library-reference-inquirer/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui5-library-reference-inquirer +## 0.3.31 + +### Patch Changes + +- @sap-ux/project-access@1.27.4 + ## 0.3.30 ### Patch Changes diff --git a/packages/ui5-library-reference-inquirer/package.json b/packages/ui5-library-reference-inquirer/package.json index 16b9b38281..70152ac924 100644 --- a/packages/ui5-library-reference-inquirer/package.json +++ b/packages/ui5-library-reference-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-reference-inquirer", "description": "Prompts module that can provide prompts for UI5 library writer", - "version": "0.3.30", + "version": "0.3.31", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-writer/CHANGELOG.md b/packages/ui5-library-reference-writer/CHANGELOG.md index 3749a8b717..bf1a86fe64 100644 --- a/packages/ui5-library-reference-writer/CHANGELOG.md +++ b/packages/ui5-library-reference-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/ui5-library-reference-writer +## 0.1.25 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + ## 0.1.24 ### Patch Changes diff --git a/packages/ui5-library-reference-writer/package.json b/packages/ui5-library-reference-writer/package.json index 0b12f55c55..250a75fdc3 100644 --- a/packages/ui5-library-reference-writer/package.json +++ b/packages/ui5-library-reference-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/ui5-library-reference-writer" }, - "version": "0.1.24", + "version": "0.1.25", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-library-writer/CHANGELOG.md b/packages/ui5-library-writer/CHANGELOG.md index 1c9fb74c60..5265832bf2 100644 --- a/packages/ui5-library-writer/CHANGELOG.md +++ b/packages/ui5-library-writer/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/ui5-library-writer +## 0.5.21 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-application-writer@1.2.0 + - @sap-ux/ui5-config@0.25.0 + - @sap-ux/project-access@1.27.4 + ## 0.5.20 ### Patch Changes diff --git a/packages/ui5-library-writer/package.json b/packages/ui5-library-writer/package.json index 4bd4d3d592..2a9644d318 100644 --- a/packages/ui5-library-writer/package.json +++ b/packages/ui5-library-writer/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-library-writer" }, - "version": "0.5.20", + "version": "0.5.21", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-proxy-middleware/CHANGELOG.md b/packages/ui5-proxy-middleware/CHANGELOG.md index 8802ec75cb..8a9e67a505 100644 --- a/packages/ui5-proxy-middleware/CHANGELOG.md +++ b/packages/ui5-proxy-middleware/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-proxy-middleware +## 1.4.7 + +### Patch Changes + +- Updated dependencies [484195d] + - @sap-ux/ui5-config@0.25.0 + ## 1.4.6 ### Patch Changes diff --git a/packages/ui5-proxy-middleware/package.json b/packages/ui5-proxy-middleware/package.json index 4f6d34807a..7aa09e86cd 100644 --- a/packages/ui5-proxy-middleware/package.json +++ b/packages/ui5-proxy-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-proxy-middleware" }, - "version": "1.4.6", + "version": "1.4.7", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", From 195d7582021ed9ba9028810ba8089cc90fedf5c2 Mon Sep 17 00:00:00 2001 From: Andis Redmans <90789422+815are@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:05:23 +0300 Subject: [PATCH 045/122] fix(ui-components): Applied missing styles for the disabled state of UILink. (#2394) * fix: apply missing styles for disabled state apply missing styles for disabled state * test: additional test additional test --------- Co-authored-by: Klaus Keller <66327622+Klaus-Keller@users.noreply.github.com> --- .changeset/rude-walls-clap.md | 5 +++ .../src/components/UILink/UILink.tsx | 39 ++++++++++--------- .../ui-components/stories/UILink.story.tsx | 28 +++++++++++-- .../test/unit/components/UILink.test.tsx | 19 +++++++++ 4 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 .changeset/rude-walls-clap.md diff --git a/.changeset/rude-walls-clap.md b/.changeset/rude-walls-clap.md new file mode 100644 index 0000000000..1b298b85ef --- /dev/null +++ b/.changeset/rude-walls-clap.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/ui-components': patch +--- + +Applied missing styles for the disabled state of UILink. diff --git a/packages/ui-components/src/components/UILink/UILink.tsx b/packages/ui-components/src/components/UILink/UILink.tsx index d839371cf4..20a6dcff11 100644 --- a/packages/ui-components/src/components/UILink/UILink.tsx +++ b/packages/ui-components/src/components/UILink/UILink.tsx @@ -40,7 +40,7 @@ export class UILink extends React.Component { * @returns {JSX.Element} */ render(): JSX.Element { - const { secondary, underline } = this.props; + const { secondary, underline, disabled } = this.props; const styles = secondary ? linkStyle.secondary : linkStyle.primary; const linkStyles = (): Partial => { return { @@ -48,23 +48,26 @@ export class UILink extends React.Component { color: styles.color, fontFamily: 'var(--vscode-font-family)', textDecoration: underline === false ? undefined : 'underline', - selectors: { - '&:hover, &:hover:focus, &:hover:active': { - color: styles.hoverColor, - textDecoration: underline === false ? 'underline' : 'none' - }, - '&:active, &:focus': { - color: styles.hoverColor, - textDecoration: underline === false ? 'underline' : 'none', - outline: 'none' - }, - // Focus through tab navigation - '.ms-Fabric--isFocusVisible &:focus': { - boxShadow: 'none', - outline: '1px solid var(--vscode-focusBorder)', - outlineOffset: '-1px' - } - } + selectors: !disabled + ? { + '&:hover, &:hover:focus, &:hover:active': { + color: styles.hoverColor, + textDecoration: underline === false ? 'underline' : 'none' + }, + '&:active, &:focus': { + color: styles.hoverColor, + textDecoration: underline === false ? 'underline' : 'none', + outline: 'none' + }, + // Focus through tab navigation + '.ms-Fabric--isFocusVisible &:focus': { + boxShadow: 'none', + outline: '1px solid var(--vscode-focusBorder)', + outlineOffset: '-1px' + } + } + : undefined, + opacity: disabled ? 0.4 : undefined } }; }; diff --git a/packages/ui-components/stories/UILink.story.tsx b/packages/ui-components/stories/UILink.story.tsx index ee500a8c65..20c4833821 100644 --- a/packages/ui-components/stories/UILink.story.tsx +++ b/packages/ui-components/stories/UILink.story.tsx @@ -1,21 +1,37 @@ -import React from 'react'; +import React, { useState } from 'react'; import type { IStackTokens } from '@fluentui/react'; import { Text, Stack } from '@fluentui/react'; import { UILink } from '../src/components/UILink'; +import { UICheckbox } from '../src/components/UICheckbox'; export default { title: 'Basic Inputs/Link' }; const stackTokens: IStackTokens = { childrenGap: 40 }; export const defaultUsage = (): JSX.Element => { + const [disabled, setDisabled] = useState(false); return ( + + + , checked?: boolean) => { + setDisabled(!!checked); + }} + /> + + + Primary UILink - I am a link + + I am a link + @@ -24,7 +40,9 @@ export const defaultUsage = (): JSX.Element => { Primary UILink with no underline - I am a link + + I am a link + @@ -33,7 +51,9 @@ export const defaultUsage = (): JSX.Element => { Secondary UILink - I am a secondary link + + I am a secondary link + diff --git a/packages/ui-components/test/unit/components/UILink.test.tsx b/packages/ui-components/test/unit/components/UILink.test.tsx index 56757c0cd6..ddaec262fb 100644 --- a/packages/ui-components/test/unit/components/UILink.test.tsx +++ b/packages/ui-components/test/unit/components/UILink.test.tsx @@ -30,6 +30,7 @@ describe('', () => { Object { "color": "var(--vscode-textLink-foreground)", "fontFamily": "var(--vscode-font-family)", + "opacity": undefined, "selectors": Object { "&:active, &:focus": Object { "color": "var(--vscode-textLink-activeForeground)", @@ -60,6 +61,7 @@ describe('', () => { Object { "color": "var(--vscode-foreground)", "fontFamily": "var(--vscode-font-family)", + "opacity": undefined, "selectors": Object { "&:active, &:focus": Object { "color": "var(--vscode-foreground)", @@ -90,6 +92,7 @@ describe('', () => { Object { "color": "var(--vscode-textLink-foreground)", "fontFamily": "var(--vscode-font-family)", + "opacity": undefined, "selectors": Object { "&:active, &:focus": Object { "color": "var(--vscode-textLink-activeForeground)", @@ -110,4 +113,20 @@ describe('', () => { } `); }); + + it('Styles - disabled', () => { + wrapper.setProps({ + disabled: true + }); + const styles = getStyles(); + expect(styles.root).toMatchInlineSnapshot(` + Object { + "color": "var(--vscode-textLink-foreground)", + "fontFamily": "var(--vscode-font-family)", + "opacity": 0.4, + "selectors": undefined, + "textDecoration": "underline", + } + `); + }); }); From d2a523a6ff2416b2c70ac651b1d9dd619a2a802f Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 23 Sep 2024 13:16:17 +0000 Subject: [PATCH 046/122] chore: apply latest changesets --- .changeset/rude-walls-clap.md | 5 ----- examples/prompting-ui/CHANGELOG.md | 8 ++++++++ examples/prompting-ui/package.json | 2 +- packages/ui-components/CHANGELOG.md | 6 ++++++ packages/ui-components/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 .changeset/rude-walls-clap.md diff --git a/.changeset/rude-walls-clap.md b/.changeset/rude-walls-clap.md deleted file mode 100644 index 1b298b85ef..0000000000 --- a/.changeset/rude-walls-clap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/ui-components': patch ---- - -Applied missing styles for the disabled state of UILink. diff --git a/examples/prompting-ui/CHANGELOG.md b/examples/prompting-ui/CHANGELOG.md index d327c27de7..f5a27bda51 100644 --- a/examples/prompting-ui/CHANGELOG.md +++ b/examples/prompting-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer-ui +## 0.1.6 + +### Patch Changes + +- Updated dependencies [195d758] + - @sap-ux/ui-components@1.18.4 + - @sap-ux/ui-prompting@0.1.14 + ## 0.1.5 ### Patch Changes diff --git a/examples/prompting-ui/package.json b/examples/prompting-ui/package.json index 1e9163c5cf..b0b1fcf0c8 100644 --- a/examples/prompting-ui/package.json +++ b/examples/prompting-ui/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/prompting-ui", - "version": "0.1.5", + "version": "0.1.6", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index f5307603f4..2958b092be 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui-components +## 1.18.4 + +### Patch Changes + +- 195d758: Applied missing styles for the disabled state of UILink. + ## 1.18.3 ### Patch Changes diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 79a1f3382a..847238d335 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-components", - "version": "1.18.3", + "version": "1.18.4", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index cdd0c3e30a..f0931167c1 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.1.14 + +### Patch Changes + +- Updated dependencies [195d758] + - @sap-ux/ui-components@1.18.4 + ## 0.1.13 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index 371585653a..193f484054 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.1.13", + "version": "0.1.14", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From e989a209c92614d2aaa455c1fb82460a94061903 Mon Sep 17 00:00:00 2001 From: kitzkan Date: Mon, 23 Sep 2024 14:51:42 +0100 Subject: [PATCH 047/122] Add skipLiveScripts flag to `DebugConfig` options (#2402) * Remove ProjectDataSourceType from DebugConfig and Replace with skipLiveScripts Flag * revice --- .changeset/cold-hotels-marry.md | 5 ++++ .../launch-config/src/debug-config/config.ts | 6 ++-- .../src/launch-config-crud/create.ts | 8 ++--- .../src/translations/launch-config.i18n.json | 1 - packages/launch-config/src/types/types.ts | 14 ++------- .../test/debug-config/config.test.ts | 10 +++---- .../test/launch-config-crud/create.test.ts | 30 +------------------ 7 files changed, 17 insertions(+), 57 deletions(-) create mode 100644 .changeset/cold-hotels-marry.md diff --git a/.changeset/cold-hotels-marry.md b/.changeset/cold-hotels-marry.md new file mode 100644 index 0000000000..6e34b7542e --- /dev/null +++ b/.changeset/cold-hotels-marry.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/launch-config': minor +--- + +Remove ProjectDataSourceType from DebugConfig and Replace with skipLiveScripts Flag diff --git a/packages/launch-config/src/debug-config/config.ts b/packages/launch-config/src/debug-config/config.ts index 7e6c6bbf28..333a2dc66e 100644 --- a/packages/launch-config/src/debug-config/config.ts +++ b/packages/launch-config/src/debug-config/config.ts @@ -1,7 +1,7 @@ import { basename } from 'path'; import { getLaunchConfig } from '../launch-config-crud/utils'; import type { LaunchConfig, LaunchJSON, DebugOptions, LaunchConfigEnv } from '../types'; -import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID, ProjectDataSourceType } from '../types'; +import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID } from '../types'; // debug constants const testFlpSandboxHtml = 'test/flpSandbox.html'; @@ -63,7 +63,7 @@ function configureLaunchConfig( export function configureLaunchJsonFile(rootFolder: string, cwd: string, configOpts: DebugOptions): LaunchJSON { const { isAppStudio, - datasourceType, + skipLiveScript = false, flpAppId, flpSandboxAvailable, sapClientParam, @@ -86,7 +86,7 @@ export function configureLaunchJsonFile(rootFolder: string, cwd: string, configO const launchFile: LaunchJSON = { version: '0.2.0', configurations: [] }; // Add live configuration if the datasource is not from a metadata file - if (datasourceType !== ProjectDataSourceType.metadataFile) { + if (!skipLiveScript) { const startCommand = `${startHtmlFile}${flpAppIdWithHash}`; const liveConfig = configureLaunchConfig( `Start ${projectName}`, diff --git a/packages/launch-config/src/launch-config-crud/create.ts b/packages/launch-config/src/launch-config-crud/create.ts index d21a715bd4..79f8c8385e 100644 --- a/packages/launch-config/src/launch-config-crud/create.ts +++ b/packages/launch-config/src/launch-config-crud/create.ts @@ -2,7 +2,7 @@ import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; import { join, basename } from 'path'; import { DirName } from '@sap-ux/project-access'; -import { LAUNCH_JSON_FILE, ProjectDataSourceType } from '../types'; +import { LAUNCH_JSON_FILE } from '../types'; import type { FioriOptions, LaunchJSON, UpdateWorkspaceFolderOptions, DebugOptions, LaunchConfig } from '../types'; import type { Editor } from 'mem-fs-editor'; import { generateNewFioriLaunchConfig } from './utils'; @@ -144,7 +144,7 @@ async function handleDebugOptions( ); const configurations = configureLaunchJsonFile(rootFolder, cwd, debugOptions).configurations; - const npmCommand = debugOptions.datasourceType === ProjectDataSourceType.metadataFile ? 'run start-mock' : 'start'; + const npmCommand = debugOptions.skipLiveScript ? 'run start-mock' : 'start'; logger?.info( t('startServerMessage', { folder: basename(rootFolder), @@ -196,9 +196,5 @@ export async function createLaunchConfig( if (!debugOptions.vscode) { return fs; } - if (debugOptions.datasourceType === ProjectDataSourceType.capProject) { - logger?.info(t('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' })); - return fs; - } return await handleDebugOptions(rootFolder, fs, debugOptions, logger); } diff --git a/packages/launch-config/src/translations/launch-config.i18n.json b/packages/launch-config/src/translations/launch-config.i18n.json index 21f182dd92..da0ff7048d 100644 --- a/packages/launch-config/src/translations/launch-config.i18n.json +++ b/packages/launch-config/src/translations/launch-config.i18n.json @@ -1,6 +1,5 @@ { "info": { - "startApp": "To start the application, type {{npmStart}} or {{cdsRun}}", "startServerMessage": "To start the server, launch a terminal and browse to the {{folder}} folder and type npm {{npmCommand}}" }, "error": { diff --git a/packages/launch-config/src/types/types.ts b/packages/launch-config/src/types/types.ts index 5e6e44fd4d..10e0adefde 100644 --- a/packages/launch-config/src/types/types.ts +++ b/packages/launch-config/src/types/types.ts @@ -60,22 +60,10 @@ export interface LaunchConfigInfo { filePath: string; } -/** - * Enum representing the types of data sources or origins for a project. - * These types indicate how a project is generated. - */ -export enum ProjectDataSourceType { - capProject = 'capProject', - odataServiceUrl = 'odataServiceUrl', - metadataFile = 'metadataFile' -} - /** * Configuration options for debugging launch configurations. */ export interface DebugOptions { - /** Type of the data source used in the project. */ - datasourceType: ProjectDataSourceType; /** SAP client parameter for the connection. */ sapClientParam: string; /** FLP application ID. */ @@ -96,6 +84,8 @@ export interface DebugOptions { writeToAppOnly?: boolean; /** Reference to the VS Code instance. */ vscode?: any; + /** skips live script if set to true. */ + skipLiveScript?: boolean; } /** diff --git a/packages/launch-config/test/debug-config/config.test.ts b/packages/launch-config/test/debug-config/config.test.ts index d7142587d4..b3f10d719d 100644 --- a/packages/launch-config/test/debug-config/config.test.ts +++ b/packages/launch-config/test/debug-config/config.test.ts @@ -1,7 +1,7 @@ import { configureLaunchJsonFile } from '../../src/debug-config/config'; import type { DebugOptions, LaunchConfig, LaunchJSON } from '../../src/types'; import path from 'path'; -import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID, ProjectDataSourceType } from '../../src/types'; +import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID } from '../../src/types'; const projectName = 'project1'; const cwd = `\${workspaceFolder}`; @@ -60,9 +60,8 @@ describe('debug config tests', () => { sapClientParam: '', flpAppId: 'project1-tile', isFioriElement: true, - flpSandboxAvailable: true, - datasourceType: ProjectDataSourceType.odataServiceUrl - }; + flpSandboxAvailable: true + } as DebugOptions; }); afterEach(() => { @@ -90,7 +89,7 @@ describe('debug config tests', () => { }); it('Should return correct configuration for local metadata', () => { - configOptions.datasourceType = ProjectDataSourceType.metadataFile; + configOptions.skipLiveScript = true; const launchFile = configureLaunchJsonFile(projectPath, cwd, configOptions); expect(launchFile.configurations.length).toBe(2); @@ -133,7 +132,6 @@ describe('debug config tests', () => { it('Should return correct configuration on BAS and sapClientParam is available', () => { configOptions.odataVersion = '2.0'; - configOptions.datasourceType = ProjectDataSourceType.odataServiceUrl; configOptions.sapClientParam = 'sapClientParam'; configOptions.isAppStudio = true; diff --git a/packages/launch-config/test/launch-config-crud/create.test.ts b/packages/launch-config/test/launch-config-crud/create.test.ts index 718b8e792f..8fa7481cae 100644 --- a/packages/launch-config/test/launch-config-crud/create.test.ts +++ b/packages/launch-config/test/launch-config-crud/create.test.ts @@ -5,7 +5,7 @@ import { createLaunchConfig } from '../../src/launch-config-crud/create'; import { DirName, FileName } from '@sap-ux/project-access'; import { TestPaths } from '../test-data/utils'; import type { DebugOptions } from '../../src/types'; -import { LAUNCH_JSON_FILE, ProjectDataSourceType } from '../../src/types'; +import { LAUNCH_JSON_FILE } from '../../src/types'; import type { Logger } from '@sap-ux/logger'; import { t } from '../../src/i18n'; import { isFolderInWorkspace } from '../../src/debug-config/helpers'; @@ -187,7 +187,6 @@ describe('create', () => { name: 'test-projects', projectRoot: projectPath, debugOptions: { - datasourceType: ProjectDataSourceType.odataServiceUrl, vscode: true } as DebugOptions }, @@ -246,30 +245,6 @@ describe('create', () => { }); }); - test('launch.json file is missing, will not create config when debug options provided and app source is cap project', async () => { - const projectPath = join(TestPaths.tmpDir, 'test-projects'); - const launchConfigPath = join(projectPath, DirName.VSCode, LAUNCH_JSON_FILE); - clearMemFsPaths(launchConfigPath); - - const fs = await createLaunchConfig( - TestPaths.tmpDir, - { - name: 'test-projects', - projectRoot: projectPath, - debugOptions: { - datasourceType: ProjectDataSourceType.capProject, - vscode: true - } as DebugOptions - }, - memFs, - mockLog - ); - expect(fs.exists(launchConfigPath)).toBe(false); - expect(mockLog.info).toHaveBeenCalledWith( - t('startApp', { npmStart: '`npm start`', cdsRun: '`cds run --in-memory`' }) - ); - }); - test('Should create launch.json or run in Yeoman CLI or if vscode not found', async () => { const projectPath = join(TestPaths.tmpDir, 'test-projects'); const launchConfigPath = join(projectPath, DirName.VSCode, LAUNCH_JSON_FILE); @@ -280,7 +255,6 @@ describe('create', () => { name: 'test-projects', projectRoot: projectPath, debugOptions: { - datasourceType: ProjectDataSourceType.capProject, vscode: false } as DebugOptions }, @@ -309,7 +283,6 @@ describe('create', () => { name: 'test-projects', projectRoot: projectPath, debugOptions: { - datasourceType: ProjectDataSourceType.odataServiceUrl, vscode: { workspace: { workspaceFile: { scheme: 'file' } @@ -389,7 +362,6 @@ describe('create', () => { name: 'test-projects', projectRoot: projectPath, debugOptions: { - datasourceType: ProjectDataSourceType.odataServiceUrl, vscode: { workspace: { workspaceFile: { scheme: 'file' } From d6f249da1242706554f663f21ba675bc31dc871f Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 23 Sep 2024 14:03:12 +0000 Subject: [PATCH 048/122] chore: apply latest changesets --- .changeset/cold-hotels-marry.md | 5 ----- packages/launch-config/CHANGELOG.md | 6 ++++++ packages/launch-config/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/cold-hotels-marry.md diff --git a/.changeset/cold-hotels-marry.md b/.changeset/cold-hotels-marry.md deleted file mode 100644 index 6e34b7542e..0000000000 --- a/.changeset/cold-hotels-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/launch-config': minor ---- - -Remove ProjectDataSourceType from DebugConfig and Replace with skipLiveScripts Flag diff --git a/packages/launch-config/CHANGELOG.md b/packages/launch-config/CHANGELOG.md index dd933a2db6..26053d348f 100644 --- a/packages/launch-config/CHANGELOG.md +++ b/packages/launch-config/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/launch-config +## 0.6.0 + +### Minor Changes + +- e989a20: Remove ProjectDataSourceType from DebugConfig and Replace with skipLiveScripts Flag + ## 0.5.1 ### Patch Changes diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index 4b05572c60..f61c8eefb7 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/launch-config", - "version": "0.5.1", + "version": "0.6.0", "description": "SAP Fiori tools launch config administration", "repository": { "type": "git", From 8f442a67029b69ff059c4f47cebc5df6512278b0 Mon Sep 17 00:00:00 2001 From: Davis Voicescuks Date: Tue, 24 Sep 2024 14:44:22 +0300 Subject: [PATCH 049/122] fix(cpe): quick action improvements (#2395) * fix: quick action improvements * chore: add changeset * test: fix test * fix: update notification * fix: windows specific bug fix * fix: pr comments --------- Co-authored-by: GLOBAL\vadson71 --- .changeset/great-jars-collect.md | 8 +++ .../control-property-editor-common/src/api.ts | 6 +- packages/control-property-editor/src/slice.ts | 17 +++-- .../src/toolbar/UndoRedoSaveActions.tsx | 6 +- .../test/unit/slice.test.ts | 12 ++-- .../unit/toolbar/UndoRedoSaveActions.test.tsx | 4 +- .../adp/controllers/AddFragment.controller.ts | 35 ++++++++-- .../src/adp/extension-point.ts | 7 +- .../src/adp/init-dialogs.ts | 18 ++--- .../preview-middleware-client/src/adp/init.ts | 38 ++-------- .../common/op-add-custom-section.ts | 5 +- .../common/op-add-header-field.ts | 10 ++- .../src/adp/ui/AddFragment.fragment.xml | 13 ++-- .../src/cpe/changes/service.ts | 8 +-- .../src/cpe/communication-service.ts | 40 +++++++++++ .../src/cpe/connector-service.ts | 15 +++- .../preview-middleware-client/src/cpe/init.ts | 28 ++------ .../src/flp/WorkspaceConnector.ts | 2 +- .../src/flp/enableFakeConnector.ts | 2 +- .../preview-middleware-client/src/i18n.ts | 15 ++++ .../src/messagebundle.properties | 7 ++ .../sap/ui/model/resource/ResourceModel.ts | 5 ++ .../AddFragment.controller.test.ts | 70 +++++++++++++++---- .../test/unit/adp/init.test.ts | 39 ++++------- .../test/unit/adp/quick-actions/fe-v2.test.ts | 10 ++- .../test/unit/adp/quick-actions/fe-v4.test.ts | 5 +- .../test/unit/cpe/changes/service.test.ts | 4 +- .../test/unit/cpe/connector-service.test.ts | 39 +++++++++++ .../test/unit/cpe/init.test.ts | 13 ++-- .../test/unit/flp/WorkspaceConnector.test.ts | 2 +- .../types/sap.ui.fl.d.ts | 2 +- .../types/sap.ui.rta.d.ts | 2 +- 32 files changed, 322 insertions(+), 165 deletions(-) create mode 100644 .changeset/great-jars-collect.md create mode 100644 packages/preview-middleware-client/src/cpe/communication-service.ts create mode 100644 packages/preview-middleware-client/test/__mock__/sap/ui/model/resource/ResourceModel.ts diff --git a/.changeset/great-jars-collect.md b/.changeset/great-jars-collect.md new file mode 100644 index 0000000000..5edf65b161 --- /dev/null +++ b/.changeset/great-jars-collect.md @@ -0,0 +1,8 @@ +--- +'@sap-ux-private/control-property-editor-common': patch +'@sap-ux-private/preview-middleware-client': patch +'@sap-ux/control-property-editor': patch +'@sap-ux/preview-middleware': patch +--- + +Usability improvements for Quick Actions that add fragments diff --git a/packages/control-property-editor-common/src/api.ts b/packages/control-property-editor-common/src/api.ts index 7ab7b20c7d..bbcdd61701 100644 --- a/packages/control-property-editor-common/src/api.ts +++ b/packages/control-property-editor-common/src/api.ts @@ -299,9 +299,7 @@ export const save = createExternalAction('save'); export const quickActionListChanged = createExternalAction('quick-action-list-changed'); export const updateQuickAction = createExternalAction('update-quick-action'); export const executeQuickAction = createExternalAction('execute-quick-action'); -export const numberOfChangesRequiringReloadChanged = createExternalAction( - 'number-of-changes-requiring-reload-changed' -); +export const setApplicationRequiresReload = createExternalAction('set-application-requires-reload'); export type ExternalAction = | ReturnType @@ -325,6 +323,6 @@ export type ExternalAction = | ReturnType | ReturnType | ReturnType - | ReturnType + | ReturnType | ReturnType | ReturnType; diff --git a/packages/control-property-editor/src/slice.ts b/packages/control-property-editor/src/slice.ts index 30eb64577d..3e604a5ba4 100644 --- a/packages/control-property-editor/src/slice.ts +++ b/packages/control-property-editor/src/slice.ts @@ -15,7 +15,7 @@ import type { ShowMessage } from '@sap-ux-private/control-property-editor-common'; import { - numberOfChangesRequiringReloadChanged, + setApplicationRequiresReload, changeStackModified, controlSelected, iconsLoaded, @@ -61,7 +61,7 @@ interface SliceState { canRedo: boolean; }; canSave: boolean; - pendingChangesRequiresSaveAndReload: boolean; + applicationRequiresReload: boolean; isAppLoading: boolean; quickActions: QuickActionGroup[]; } @@ -149,7 +149,7 @@ export const initialState: SliceState = { canRedo: false }, canSave: false, - pendingChangesRequiresSaveAndReload: false, + applicationRequiresReload: false, isAppLoading: true, quickActions: [] }; @@ -280,9 +280,12 @@ const slice = createSlice, string>({ state.dialogMessage = action.payload; }) .addMatcher(fileChanged.match, (state, action: ReturnType): void => { + const firstFile = action.payload[0] ?? ''; + const separator = firstFile.indexOf('\\') > -1 ? '\\' : '/'; + const newFileChanges = action.payload.filter((changedFile) => { const idx = state.changes.pendingChangeIds.findIndex((pendingFile) => - changedFile.includes(pendingFile) + changedFile.includes(pendingFile.replace(/\//g, separator)) ); if (idx > -1) { state.changes.pendingChangeIds.splice(idx, 1); @@ -324,9 +327,9 @@ const slice = createSlice, string>({ state.isAppLoading = false; }) .addMatcher( - numberOfChangesRequiringReloadChanged.match, - (state, action: ReturnType): void => { - state.pendingChangesRequiresSaveAndReload = action.payload > 0; + setApplicationRequiresReload.match, + (state, action: ReturnType): void => { + state.applicationRequiresReload = action.payload; } ) .addMatcher( diff --git a/packages/control-property-editor/src/toolbar/UndoRedoSaveActions.tsx b/packages/control-property-editor/src/toolbar/UndoRedoSaveActions.tsx index ab92b6e21d..b07d65cfcc 100644 --- a/packages/control-property-editor/src/toolbar/UndoRedoSaveActions.tsx +++ b/packages/control-property-editor/src/toolbar/UndoRedoSaveActions.tsx @@ -23,11 +23,9 @@ export function UndoRedoSaveActions(): ReactElement { const canSave = useSelector((state) => state.canSave); const isLoading = useSelector((state) => state.isAppLoading); const fileChanges = useSelector((state) => state.fileChanges) ?? []; - const pendingChangesRequiresSaveAndReload = useSelector( - (state) => state.pendingChangesRequiresSaveAndReload - ); + const applicationRequiresReload = useSelector((state) => state.applicationRequiresReload); const { pending } = useSelector((state) => state.changes); - const saveAndReload = (fileChanges.length > 0 && pending.length > 0) || pendingChangesRequiresSaveAndReload; + const saveAndReload = (fileChanges.length > 0 && pending.length > 0) || applicationRequiresReload; return ( <> { deviceType: DeviceType.Desktop }); }); - describe('numberOfChangesRequiringReloadChanged', () => { + describe('setApplicationRequiresReload', () => { test('one change requires reload', () => { expect( - reducer({ pendingChangesRequiresSaveAndReload: false } as any, numberOfChangesRequiringReloadChanged(1)) + reducer({ applicationRequiresReload: false } as any, setApplicationRequiresReload(true)) ).toStrictEqual({ - pendingChangesRequiresSaveAndReload: true + applicationRequiresReload: true }); }); test('no changes require reload', () => { expect( - reducer({ pendingChangesRequiresSaveAndReload: true } as any, numberOfChangesRequiringReloadChanged(0)) + reducer({ applicationRequiresReload: true } as any, setApplicationRequiresReload(false)) ).toStrictEqual({ - pendingChangesRequiresSaveAndReload: false + applicationRequiresReload: false }); }); }); diff --git a/packages/control-property-editor/test/unit/toolbar/UndoRedoSaveActions.test.tsx b/packages/control-property-editor/test/unit/toolbar/UndoRedoSaveActions.test.tsx index 6b90b1b52d..fe2bc12df9 100644 --- a/packages/control-property-editor/test/unit/toolbar/UndoRedoSaveActions.test.tsx +++ b/packages/control-property-editor/test/unit/toolbar/UndoRedoSaveActions.test.tsx @@ -11,7 +11,7 @@ import { redo, save, undo, - numberOfChangesRequiringReloadChanged, + setApplicationRequiresReload, reloadApplication } from '@sap-ux-private/control-property-editor-common'; @@ -54,7 +54,7 @@ describe('toolbar', () => { // update state store.dispatch(setUndoRedoEnablement({ canRedo: true, canUndo: true })); store.dispatch(setSaveEnablement(true)); - store.dispatch(numberOfChangesRequiringReloadChanged(5)); + store.dispatch(setApplicationRequiresReload(true)); store.dispatch(appLoaded()); dispatch.mockClear(); diff --git a/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts b/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts index 941c5c080e..04f738ad15 100644 --- a/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts +++ b/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts @@ -21,7 +21,12 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; import type ElementOverlay from 'sap/ui/dt/ElementOverlay'; /** sap.ui.fl */ -import {type AddFragmentChangeContentType} from 'sap/ui/fl/Change'; +import { type AddFragmentChangeContentType } from 'sap/ui/fl/Change'; + +import { setApplicationRequiresReload } from '@sap-ux-private/control-property-editor-common'; + +import { getResourceModel, getTextBundle } from '../../i18n'; +import { CommunicationService } from '../../cpe/communication-service'; import ControlUtils from '../control-utils'; import CommandExecutor from '../command-executor'; @@ -38,20 +43,30 @@ interface CreateFragmentProps { const radix = 10; type AddFragmentModel = JSONModel & { + getProperty(sPath: '/title'): string; + getProperty(sPath: '/completeView'): boolean; getProperty(sPath: '/newFragmentName'): string; getProperty(sPath: '/selectedIndex'): number; getProperty(sPath: '/selectedAggregation/value'): string; }; +export interface AddFragmentOptions { + title: string; + aggregation?: string; +} + /** * @namespace open.ux.preview.client.adp.controllers */ export default class AddFragment extends BaseDialog { - constructor(name: string, overlays: UI5Element, rta: RuntimeAuthoring, private aggregation?: string) { + constructor(name: string, overlays: UI5Element, rta: RuntimeAuthoring, private options: AddFragmentOptions) { super(name); this.rta = rta; this.overlays = overlays; - this.model = new JSONModel(); + this.model = new JSONModel({ + title: options.title, + completeView: options.aggregation === undefined + }); this.ui5Version = sap.ui.version; this.commandExecutor = new CommandExecutor(this.rta); } @@ -67,7 +82,9 @@ export default class AddFragment extends BaseDialog { this.setEscapeHandler(); await this.buildDialogData(); + const resourceModel = await getResourceModel('open.ux.preview.client'); + this.dialog.setModel(resourceModel, 'i18n'); this.dialog.setModel(this.model); this.dialog.open(); @@ -153,9 +170,11 @@ export default class AddFragment extends BaseDialog { targetAggregation }; - await this.createFragmentChange(fragmentData); + const templateName = await this.createFragmentChange(fragmentData); - notifyUser(`Note: The '${fragmentName}.fragment.xml' fragment will be created once you save the change.`, 8000); + const textKey = templateName ? 'ADP_ADD_FRAGMENT_WITH_TEMPLATE_NOTIFICATION' : 'ADP_ADD_FRAGMENT_NOTIFICATION'; + const bundle = await getTextBundle(); + notifyUser(bundle.getText(textKey, [fragmentName]), 8000); this.handleDialogClose(); } @@ -184,7 +203,7 @@ export default class AddFragment extends BaseDialog { } return false; }); - const defaultAggregation = this.aggregation ?? controlMetadata.getDefaultAggregationName(); + const defaultAggregation = this.options.aggregation ?? controlMetadata.getDefaultAggregationName(); const selectedControlName = controlMetadata.getName(); let selectedControlChildren: string[] | number[] = Object.keys( @@ -262,7 +281,7 @@ export default class AddFragment extends BaseDialog { * * @param fragmentData Fragment Data */ - private async createFragmentChange(fragmentData: CreateFragmentProps) { + private async createFragmentChange(fragmentData: CreateFragmentProps): Promise { const { fragmentName, index, targetAggregation } = fragmentData; const flexSettings = this.rta.getFlexSettings(); @@ -290,8 +309,10 @@ export default class AddFragment extends BaseDialog { const preparedChange = command.getPreparedChange(); const content = preparedChange.getContent(); preparedChange.setContent({ ...content, templateName }); + CommunicationService.sendAction(setApplicationRequiresReload(true)); } await this.commandExecutor.pushAndExecuteCommand(command); + return templateName; } private getFragmentTemplateName(targetAggregation: string): string { diff --git a/packages/preview-middleware-client/src/adp/extension-point.ts b/packages/preview-middleware-client/src/adp/extension-point.ts index 4d216f11c1..8a45a91d7f 100644 --- a/packages/preview-middleware-client/src/adp/extension-point.ts +++ b/packages/preview-middleware-client/src/adp/extension-point.ts @@ -8,7 +8,7 @@ import { ExternalAction, addExtensionPoint } from '@sap-ux-private/control-prope import { Deferred, createDeferred } from './utils'; -import { SubscribeFunction } from '../cpe/types'; +import { CommunicationService } from '../cpe/communication-service'; import { DialogNames, handler } from './init-dialogs'; type ActionService = { @@ -50,11 +50,10 @@ export default class ExtensionPointService { /** * Initializes communication with CPE, and the extension point plugin. * - * @param subscribe Handles actions from CPE */ - public init(subscribe: SubscribeFunction) { + public init() { this.initPlugin(); - subscribe(async (action: ExternalAction): Promise => { + CommunicationService.subscribe(async (action: ExternalAction): Promise => { if (addExtensionPoint.match(action)) { try { const { controlId, name } = action.payload; diff --git a/packages/preview-middleware-client/src/adp/init-dialogs.ts b/packages/preview-middleware-client/src/adp/init-dialogs.ts index a1ff345ed8..8b649c27df 100644 --- a/packages/preview-middleware-client/src/adp/init-dialogs.ts +++ b/packages/preview-middleware-client/src/adp/init-dialogs.ts @@ -14,13 +14,14 @@ import FlUtils from 'sap/ui/fl/Utils'; /** sap.ui.dt */ import type ElementOverlay from 'sap/ui/dt/ElementOverlay'; -import AddFragment from './controllers/AddFragment.controller'; +import AddFragment, { AddFragmentOptions } from './controllers/AddFragment.controller'; import ControllerExtension from './controllers/ControllerExtension.controller'; import { ExtensionPointData } from './extension-point'; import ExtensionPoint from './controllers/ExtensionPoint.controller'; import ManagedObject from 'sap/ui/base/ManagedObject'; import { isReuseComponent } from '../cpe/utils'; import { Ui5VersionInfo } from '../utils/version'; +import { getTextBundle } from '../i18n'; export const enum DialogNames { ADD_FRAGMENT = 'AddFragment', @@ -118,25 +119,24 @@ export const getAddFragmentItemText = (overlay: ElementOverlay) => { * @param rta Runtime Authoring * @param dialogName Dialog name * @param extensionPointData Control ID - * @param aggregation Name of aggregation that should be selected when dialog is opened + * @param options Dialog options */ export async function handler( overlay: UI5Element, rta: RuntimeAuthoring, dialogName: DialogNames, extensionPointData?: ExtensionPointData, - aggregation?: string + options: Partial = {} ): Promise { let controller: Controller; + const resources = await getTextBundle(); switch (dialogName) { case DialogNames.ADD_FRAGMENT: - controller = new AddFragment( - `open.ux.preview.client.adp.controllers.${dialogName}`, - overlay, - rta, - aggregation - ); + controller = new AddFragment(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta, { + aggregation: options.aggregation, + title: resources.getText(options.title ?? 'ADP_ADD_FRAGMENT_DIALOG_TITLE') + }); break; case DialogNames.CONTROLLER_EXTENSION: controller = new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta); diff --git a/packages/preview-middleware-client/src/adp/init.ts b/packages/preview-middleware-client/src/adp/init.ts index 722119ed9a..2a3478de00 100644 --- a/packages/preview-middleware-client/src/adp/init.ts +++ b/packages/preview-middleware-client/src/adp/init.ts @@ -1,17 +1,11 @@ import log from 'sap/base/Log'; import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; -import { - ExternalAction, - showMessage, - startPostMessageCommunication, - enableTelemetry -} from '@sap-ux-private/control-property-editor-common'; +import { showMessage, enableTelemetry } from '@sap-ux-private/control-property-editor-common'; -import { ActionHandler } from '../cpe/types'; -import { getError } from '../utils/error'; import { getUi5Version, getUI5VersionValidationMessage, isLowerThanMinimalUi5Version } from '../utils/version'; +import { CommunicationService } from '../cpe/communication-service'; import init from '../cpe/init'; import { getApplicationType } from '../utils/application'; import { getTextBundle } from '../i18n'; @@ -25,27 +19,7 @@ export default async function (rta: RuntimeAuthoring) { if (flexSettings.telemetry === true) { enableTelemetry(); } - const actionHandlers: ActionHandler[] = []; - /** - * - * @param handler action handler - */ - function subscribe(handler: ActionHandler): void { - actionHandlers.push(handler); - } - const { sendAction } = startPostMessageCommunication( - window.parent, - async function onAction(action: ExternalAction) { - for (const handler of actionHandlers) { - try { - await handler(action); - } catch (error) { - log.error('Handler Failed: ', getError(error)); - } - } - } - ); const ui5VersionInfo = await getUi5Version(); const syncViewsIds = await getAllSyncViewsIds(ui5VersionInfo); @@ -54,7 +28,7 @@ export default async function (rta: RuntimeAuthoring) { if (!isLowerThanMinimalUi5Version(ui5VersionInfo, { major: 1, minor: 78 })) { const ExtensionPointService = (await import('open/ux/preview/client/adp/extension-point')).default; const extPointService = new ExtensionPointService(rta); - extPointService.init(subscribe); + extPointService.init(); } const applicationType = getApplicationType(rta.getRootControlInstance().getManifest()); @@ -63,13 +37,15 @@ export default async function (rta: RuntimeAuthoring) { await init(rta, quickActionRegistries); if (isLowerThanMinimalUi5Version(ui5VersionInfo)) { - sendAction(showMessage({ message: getUI5VersionValidationMessage(ui5VersionInfo), shouldHideIframe: true })); + CommunicationService.sendAction( + showMessage({ message: getUI5VersionValidationMessage(ui5VersionInfo), shouldHideIframe: true }) + ); return; } if (syncViewsIds.length > 0) { const bundle = await getTextBundle(); - sendAction( + CommunicationService.sendAction( showMessage({ message: bundle.getText('ADP_SYNC_VIEWS_MESSAGE'), shouldHideIframe: false diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts index 1f7f81e18d..4764c7e598 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts @@ -29,7 +29,10 @@ export class AddCustomSectionQuickAction )[0] as ObjectPageLayout; const overlay = OverlayRegistry.getOverlay(objectPageLayout) || []; - await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, 'sections'); + await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, { + aggregation: 'sections', + title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION' + }); return []; } } diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts index 2e252989cb..7059f38738 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts @@ -32,10 +32,16 @@ export class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase i // check if only flex box exist in the headerContent. if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) { const overlay = OverlayRegistry.getOverlay(headerContent[0]) || []; - await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, 'items'); + await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, { + aggregation: 'items', + title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD' + }); } else if (this.control) { const overlay = OverlayRegistry.getOverlay(this.control) || []; - await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, 'headerContent'); + await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, { + aggregation: 'headerContent', + title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD' + }); } return []; } diff --git a/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml b/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml index df508b867a..2c8f137b54 100644 --- a/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml +++ b/packages/preview-middleware-client/src/adp/ui/AddFragment.fragment.xml @@ -2,7 +2,7 @@ xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:f="sap.ui.layout.form" - title="Add XML Fragment" + title="{/title}" contentWidth="500px" class="sapUiRTABorder"> @@ -12,10 +12,11 @@ labelSpanS="4" singleContainerFullSize="false"> -