generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/create command for variants configuration #2446
Open
ytpo-lyne
wants to merge
59
commits into
main
Choose a base branch
from
feat/create-variantsConfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 48 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
ba8b36c
feat: add varinats config
ytpo-lyne e3c3a41
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 6ae06b5
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 631b9dc
feat: add varinats config
ytpo-lyne 680848d
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 834e46d
feat: add varinats config
ytpo-lyne 11cf9a9
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 77c8d58
feat: add varinats config
ytpo-lyne d8c41ca
feat: add varinats config
ytpo-lyne cdd69d0
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 7e4941a
feat: add varinats config
ytpo-lyne d10a314
adjust type in getSapClientFromPackageJson and refactor addVariantsMa…
heimwege 8d43c14
refactor check for deprecated preview middleware and related types
heimwege 0319d6e
fix typo
heimwege 9a1074d
adjust log level
heimwege e923cc4
feat: add varinats config
ytpo-lyne 5ba3e02
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne f2abaf5
add type guard
heimwege cda7cf9
Merge branch 'feat/create-variantsConfig' of github.com:SAP/open-ux-t…
ytpo-lyne 71af0bb
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 685c0c7
test: utils and package.json
ytpo-lyne bdcb731
test: unit test for create command package.json and .yaml files
iha89 6eb12b9
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne ee9da52
fix typo
heimwege 6964471
adjust unit tests
heimwege 3db3d66
Merge branch 'feat/create-variantsConfig' of github.com:SAP/open-ux-t…
ytpo-lyne 9cf6c87
adjust unit tests
heimwege 600d8a9
feat: rta editor
ytpo-lyne 27aaf52
test: unit test rta editor
ytpo-lyne cc2c225
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 29af44f
test: clean up
ytpo-lyne 56e224b
refactoring
heimwege 9412b87
minor refactoring
heimwege 8125256
refactor addVariantsManagementScript
heimwege a0ed8d9
tiny refactoring
heimwege d1886e5
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne b54b616
Merge branch 'main' into feat/create-variantsConfig
heimwege 0475149
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne 4c4b869
changeset
ytpo-lyne 1902cc7
fix: sonar
ytpo-lyne 974f32c
add unit test
heimwege 5055355
minor refactoring
heimwege f74c5f9
adjust types
heimwege fa20548
Merge branch 'main' into feat/create-variantsConfig
heimwege 1adaa49
fix test data error
heimwege 1f299c5
Merge remote-tracking branch 'origin/feat/create-variantsConfig' into…
heimwege c4f8e10
enhance jsDoc of readUi5Yaml
heimwege 28efeff
refactoring
heimwege bc63749
Merge branch 'main' into feat/create-variantsConfig
heimwege 93b5a14
add unit test
heimwege c22b0dd
add unit test
heimwege 8be57d1
add unit test
heimwege e3a20bd
fix sonar issue
heimwege a4b9f56
Merge branch 'main' into feat/create-variantsConfig
heimwege 22c86cf
Merge branch 'main' into feat/create-variantsConfig
heimwege ee1d679
feat: path to yaml by cli and error handling
ytpo-lyne ae367b2
test: update unit tests and readMe
ytpo-lyne 22bb028
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne d69c142
Merge branch 'main' into feat/create-variantsConfig
ytpo-lyne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@sap-ux/app-config-writer': patch | ||
'@sap-ux/create': patch | ||
--- | ||
|
||
Introduce create command to add Configuration for Variants Creation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { getSmartLinksTargetFromPrompt, promptInboundNavigationConfig, validateText } from './prompt'; | ||
export { generateSmartLinksConfig } from './smartlinks-config'; | ||
export { generateInboundNavigationConfig } from './navigation-config'; | ||
export { generateVariantsConfig } from './variants-config'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './smartLinks'; | ||
export * from './variantsConfig'; | ||
export * from './navigation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { MiddlewareConfig as PreviewConfig } from '@sap-ux/preview-middleware'; | ||
|
||
export type FioriToolsDeprecatedPreviewConfig = { | ||
component: string; | ||
libs?: boolean; | ||
ui5Theme?: string; | ||
}; | ||
|
||
export type PreviewConfigOptions = FioriToolsDeprecatedPreviewConfig | PreviewConfig; | ||
|
||
export enum MiddlewareConfigs { | ||
FioriToolsPreview = 'fiori-tools-preview', | ||
PreviewMiddleware = 'preview-middleware', | ||
ReloadMiddleware = 'reload-middleware', | ||
FioriToolsAppreload = 'fiori-tools-appreload' | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/app-config-writer/src/variants-config/generateVariantsConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { create } from 'mem-fs-editor'; | ||
import { create as createStorage } from 'mem-fs'; | ||
import { updateMiddlewares } from './ui5-yaml'; | ||
import { addVariantsManagementScript } from './package-json'; | ||
import type { Editor } from 'mem-fs-editor'; | ||
import type { ToolsLogger } from '@sap-ux/logger'; | ||
|
||
/** | ||
* Add variants configuration to an app or project. | ||
* | ||
* @param basePath - the base path where the package.json and ui5.yaml is | ||
* @param logger - logger | ||
* @param fs - the memfs editor instance | ||
* @returns Promise<Editor> - memfs editor instance with updated files | ||
*/ | ||
export async function generateVariantsConfig(basePath: string, logger?: ToolsLogger, fs?: Editor): Promise<Editor> { | ||
if (!fs) { | ||
fs = create(createStorage()); | ||
} | ||
await addVariantsManagementScript(fs, basePath, logger).catch((error) => { | ||
logger?.error(`Script 'start-variants-management' cannot be written to package.json. ${error.message}.`); | ||
return fs; | ||
}); | ||
await updateMiddlewares(fs, basePath, logger); | ||
return fs; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './generateVariantsConfig'; |
48 changes: 48 additions & 0 deletions
48
packages/app-config-writer/src/variants-config/package-json.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { join } from 'path'; | ||
import { getSapClientFromPackageJson, getUI5UrlParameters, getRTAUrl } from './utils'; | ||
import type { Editor } from 'mem-fs-editor'; | ||
import type { Package } from '@sap-ux/project-access'; | ||
import type { ToolsLogger } from '@sap-ux/logger'; | ||
|
||
/** | ||
* Add the start-variants-management script to the package.json. | ||
* | ||
* @param fs - mem-fs reference to be used for file access | ||
* @param basePath - path to application root, where package.json is | ||
* @param logger - logger | ||
* @returns Promise<void> - rejects in case variants management script can't be added to package.json | ||
*/ | ||
export async function addVariantsManagementScript(fs: Editor, basePath: string, logger?: ToolsLogger): Promise<void> { | ||
const packageJsonPath = join(basePath, 'package.json'); | ||
const packageJson = fs.readJSON(packageJsonPath) as Package | undefined; | ||
|
||
if (!packageJson) { | ||
return Promise.reject(new Error(`File 'package.json' not found at ${basePath}`)); | ||
} | ||
|
||
if (packageJson?.scripts?.['start-variants-management']) { | ||
return Promise.reject(new Error(`Script already exists.`)); | ||
} | ||
|
||
if (!packageJson.scripts) { | ||
logger?.warn(`File 'package.json' does not contain a script section. Script section added.`); | ||
packageJson.scripts = {}; | ||
} | ||
|
||
const urlParameters: Record<string, string> = {}; | ||
const sapClient = getSapClientFromPackageJson(packageJson.scripts); | ||
if (sapClient) { | ||
urlParameters['sap-client'] = sapClient; | ||
} | ||
|
||
const url = await getRTAUrl(basePath, getUI5UrlParameters(urlParameters)); | ||
|
||
if (!url) { | ||
return Promise.reject(new Error(`No RTA editor specified in ui5.yaml.`)); | ||
} | ||
|
||
packageJson.scripts['start-variants-management'] = `fiori run --open "${url}"`; | ||
fs.writeJSON(packageJsonPath, packageJson); | ||
logger?.debug(`Script 'start-variants-management' written to 'package.json'.`); | ||
return Promise.resolve(); | ||
} |
91 changes: 91 additions & 0 deletions
91
packages/app-config-writer/src/variants-config/ui5-yaml.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { join } from 'path'; | ||
import { MiddlewareConfigs } from '../types'; | ||
import { FileName, type Package, readUi5Yaml } from '@sap-ux/project-access'; | ||
import type { Editor } from 'mem-fs-editor'; | ||
import type { ToolsLogger } from '@sap-ux/logger'; | ||
import type { PreviewConfigOptions } from '../types'; | ||
import type { CustomMiddleware, FioriAppReloadConfig, UI5Config } from '@sap-ux/ui5-config'; | ||
import { getPreviewMiddleware } from './utils'; | ||
|
||
/** | ||
* Gets the reload middleware form the provided yamlConfig. | ||
* The middleware can either be named 'fiori-tools-appreload' or 'reload-middleware'. | ||
* If the middleware is found, a delay of 300ms will be inserted. | ||
* | ||
* @param yamlConfig - the yaml configuration to use | ||
* @returns reload middleware configuration if found or undefined | ||
*/ | ||
export async function getEnhancedReloadMiddleware( | ||
yamlConfig: UI5Config | ||
): Promise<CustomMiddleware<FioriAppReloadConfig> | undefined> { | ||
const reloadMiddleware = | ||
yamlConfig.findCustomMiddleware<FioriAppReloadConfig>(MiddlewareConfigs.FioriToolsAppreload) ?? | ||
yamlConfig.findCustomMiddleware<FioriAppReloadConfig>(MiddlewareConfigs.ReloadMiddleware); | ||
if (!reloadMiddleware) { | ||
return undefined; | ||
} | ||
if (!reloadMiddleware?.configuration?.delay) { | ||
reloadMiddleware.configuration = { ...reloadMiddleware.configuration, delay: 300 }; | ||
} | ||
return reloadMiddleware; | ||
} | ||
|
||
/** | ||
* Creates a preview middleware configuration based on the presence of the @sap/ux-ui5-tooling dependency. | ||
* | ||
* @param fs - mem-fs reference to be used for file access | ||
* @param basePath - path to project root, where package.json and ui5.yaml is | ||
* @returns 'fiori-tools-preview' or 'preview-middleware' configuration | ||
*/ | ||
export function createPreviewMiddlewareConfig(fs: Editor, basePath: string): CustomMiddleware<PreviewConfigOptions> { | ||
const packageJsonPath = join(basePath, 'package.json'); | ||
const packageJson = fs.readJSON(packageJsonPath) as Package | undefined; | ||
return { | ||
name: packageJson?.devDependencies?.['@sap/ux-ui5-tooling'] | ||
? MiddlewareConfigs.FioriToolsPreview | ||
: MiddlewareConfigs.PreviewMiddleware, | ||
afterMiddleware: 'compression' | ||
} as CustomMiddleware<PreviewConfigOptions>; | ||
} | ||
|
||
/** | ||
* Checks the project for ui5.yaml files and reads out the configuration to update the preview and reload middlewares. | ||
* If a reload middleware exists, then a delay of 300ms will be inserted and the preview middleware will be set afterward. | ||
* | ||
* @param fs - mem-fs reference to be used for file access | ||
* @param basePath - path to project root, where package.json and ui5.yaml is | ||
* @param logger - logger | ||
*/ | ||
export async function updateMiddlewares(fs: Editor, basePath: string, logger?: ToolsLogger): Promise<void> { | ||
const ui5Yamls = [FileName.Ui5Yaml, FileName.Ui5MockYaml, FileName.Ui5LocalYaml]; | ||
for (const ui5Yaml of ui5Yamls) { | ||
let ui5YamlConfig: UI5Config; | ||
|
||
try { | ||
ui5YamlConfig = await readUi5Yaml(basePath, ui5Yaml); | ||
} catch (error) { | ||
logger?.debug((error as Error).message); | ||
continue; | ||
} | ||
|
||
let previewMiddleware = await getPreviewMiddleware(ui5YamlConfig); | ||
|
||
if (!previewMiddleware) { | ||
logger?.warn(`No preview middleware found in ${ui5Yaml}. Preview middleware will be added.`); | ||
previewMiddleware = createPreviewMiddlewareConfig(fs, basePath); | ||
} | ||
|
||
const reloadMiddleware = await getEnhancedReloadMiddleware(ui5YamlConfig); | ||
|
||
if (reloadMiddleware) { | ||
previewMiddleware.afterMiddleware = reloadMiddleware.name; | ||
ui5YamlConfig.updateCustomMiddleware(reloadMiddleware); | ||
logger?.debug(`Updated reload middleware in ${ui5Yaml}.`); | ||
} | ||
|
||
ui5YamlConfig.updateCustomMiddleware(previewMiddleware); | ||
const yamlPath = join(basePath, ui5Yaml); | ||
fs.write(yamlPath, ui5YamlConfig.toString()); | ||
logger?.debug(`Updated preview middleware in ${ui5Yaml}.`); | ||
} | ||
} |
139 changes: 139 additions & 0 deletions
139
packages/app-config-writer/src/variants-config/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import { FileName, readUi5Yaml } from '@sap-ux/project-access'; | ||
import { MiddlewareConfigs } from '../types'; | ||
import { stringify } from 'querystring'; | ||
import type { Package } from '@sap-ux/project-access'; | ||
import type { CustomMiddleware, UI5Config } from '@sap-ux/ui5-config'; | ||
import type { PreviewConfigOptions, FioriToolsDeprecatedPreviewConfig } from '../types'; | ||
|
||
/** | ||
* Gets the preview middleware form the yamlConfig or provided path. | ||
* The middleware can either be named 'fiori-tools-preview' or 'preview-middleware'. | ||
* | ||
* @param yamlConfig - the yaml configuration to use; if not provided, the file will be read with the provided basePath and filename | ||
* @param basePath - path to project root, where ui5.yaml is located | ||
* @param filename - name of the ui5 yaml file to read from basePath; default is 'ui5.yaml' | ||
* @returns preview middleware configuration if found or undefined | ||
* @throws {Error} if filename is not found at basePath | ||
* @throws {Error} if basePath and yamlConfig are undefined | ||
*/ | ||
export async function getPreviewMiddleware( | ||
yamlConfig?: UI5Config, | ||
basePath?: string, | ||
filename: string = FileName.Ui5Yaml | ||
): Promise<CustomMiddleware<PreviewConfigOptions> | undefined> { | ||
if (!basePath && !yamlConfig) { | ||
throw new Error('Either base path or yaml config must be provided'); | ||
} | ||
yamlConfig = yamlConfig ?? (await readUi5Yaml(basePath!, filename)); | ||
return ( | ||
yamlConfig.findCustomMiddleware<PreviewConfigOptions>(MiddlewareConfigs.FioriToolsPreview) ?? | ||
yamlConfig.findCustomMiddleware<PreviewConfigOptions>(MiddlewareConfigs.PreviewMiddleware) | ||
); | ||
} | ||
|
||
/** | ||
* Type guard to check if the given configuration is a deprecated preview middleware configuration. | ||
* | ||
* @param configuration preview middleware configuration | ||
* @returns true, if a preview middleware configuration is deprecated | ||
*/ | ||
function isFioriToolsDeprecatedPreviewConfig( | ||
configuration: PreviewConfigOptions | undefined | ||
): configuration is FioriToolsDeprecatedPreviewConfig { | ||
return (configuration as FioriToolsDeprecatedPreviewConfig)?.component !== undefined; | ||
} | ||
|
||
/** | ||
* Extracts sap client string from existing scripts in package.json. | ||
* | ||
* @param scripts - script section of the package.json | ||
* @returns sap client | ||
*/ | ||
export function getSapClientFromPackageJson(scripts: Package['scripts']): string | undefined { | ||
for (const value of Object.values(scripts!)) { | ||
const match = value?.match(/sap-client=(\d{3})/); | ||
if (match) { | ||
return match[1]; | ||
} | ||
} | ||
return undefined; | ||
} | ||
|
||
/** | ||
* Returns the UI5 url parameters. | ||
* This is needed for the UI5 run time adaptation. | ||
* | ||
* @param overwritingParams - parameters to be overwritten | ||
* @returns - UI5 url parameters | ||
*/ | ||
export function getUI5UrlParameters(overwritingParams: Record<string, string> = {}): string { | ||
const parameters: Record<string, string> = { | ||
'fiori-tools-rta-mode': 'true', | ||
'sap-ui-rta-skip-flex-validation': 'true', | ||
'sap-ui-xx-condense-changes': 'true' | ||
}; | ||
return stringify(Object.assign(parameters, overwritingParams)); | ||
} | ||
|
||
/** | ||
* Returns the RTA mount point of the preview middleware configuration from the ui5.yaml file, if given. | ||
* | ||
* @param previewMiddlewareConfig - configuration of the preview middleware | ||
* @returns - RTA mount point or undefined | ||
*/ | ||
function getRTAMountPoint(previewMiddlewareConfig: PreviewConfigOptions | undefined): string | undefined { | ||
if (!isFioriToolsDeprecatedPreviewConfig(previewMiddlewareConfig) && previewMiddlewareConfig?.rta?.editors) { | ||
const editors = previewMiddlewareConfig.rta.editors; | ||
for (const editor of editors) { | ||
if (!('developerMode' in editor)) { | ||
return editor.path; | ||
} | ||
} | ||
} | ||
return undefined; | ||
} | ||
|
||
/** | ||
* Returns the intent of the preview middleware configuration from the ui5.yaml file, if given. | ||
* | ||
* @param previewMiddlewareConfig - configuration of the preview middleware | ||
* @returns - preview intent or undefined | ||
*/ | ||
function getRTAIntent(previewMiddlewareConfig: PreviewConfigOptions | undefined): string | undefined { | ||
if (isFioriToolsDeprecatedPreviewConfig(previewMiddlewareConfig)) { | ||
return undefined; | ||
} | ||
const intent = previewMiddlewareConfig?.flp?.intent; | ||
return intent ? `#${intent.object}-${intent.action}` : undefined; | ||
} | ||
|
||
/** | ||
* Returns the url for variants management in RTA mode. | ||
* The url consist of a specified mount point and intent given from the ui5.yaml file as well as parameters for the RTA mode. | ||
* | ||
* @param basePath - path to project root, where package.json and ui5.yaml is located | ||
* @param query - query to create fragment | ||
* @returns - review url parameters | ||
*/ | ||
export async function getRTAUrl(basePath: string, query: string): Promise<string | undefined> { | ||
let previewMiddleware: CustomMiddleware<PreviewConfigOptions> | undefined; | ||
try { | ||
previewMiddleware = await getPreviewMiddleware(undefined, basePath); | ||
} catch (error) { | ||
//todo: what to do in case there is no ui5.yaml file? try FileName.Ui5MockYaml or FileName.Ui5LocalYaml as fallback? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tobiasqueck you thoughts about potential fallbacks for RTA editor path? |
||
return undefined; | ||
} | ||
|
||
if ( | ||
previewMiddleware?.name === MiddlewareConfigs.PreviewMiddleware && | ||
!getRTAMountPoint(previewMiddleware?.configuration) | ||
) { | ||
return undefined; | ||
} | ||
const mountPoint = getRTAMountPoint(previewMiddleware?.configuration) ?? '/preview.html'; | ||
const intent = getRTAIntent(previewMiddleware?.configuration) ?? '#app-preview'; | ||
|
||
return isFioriToolsDeprecatedPreviewConfig(previewMiddleware?.configuration) | ||
? `${mountPoint}?${query}#preview-app` | ||
: `${mountPoint}?${query}${intent}`; | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/app-config-writer/test/fixtures/variants-config/deprecated-config/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "v2-lrop-0909", | ||
"description": "An SAP Fiori application.", | ||
"scripts": { | ||
"start-variants-management": "fiori run --open \"preview.html?fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true&sap-ui-xx-condense-changes=true&sap-client=500#app-preview\"" | ||
}, | ||
"sapux": true, | ||
"sapuxLayer": "VENDOR" | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/app-config-writer/test/fixtures/variants-config/deprecated-config/ui5.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
specVersion: "3.1" | ||
metadata: | ||
name: v2lrop0909 | ||
type: application | ||
server: | ||
customMiddleware: | ||
- name: fiori-tools-preview | ||
afterMiddleware: compression | ||
configuration: | ||
component: v2lrop0909 | ||
ui5Theme: sap_horizon |
9 changes: 9 additions & 0 deletions
9
packages/app-config-writer/test/fixtures/variants-config/fiori-tools-config/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "test-app", | ||
"description": "An SAP Fiori application.", | ||
"scripts": { | ||
"start": "fiori run --open \"test/flpSandbox.html?sap-client=500#test-app\"" | ||
}, | ||
"sapux": true, | ||
"sapuxLayer": "VENDOR" | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/app-config-writer/test/fixtures/variants-config/fiori-tools-config/ui5-local.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
specVersion: "3.1" | ||
metadata: | ||
name: fiori-tools-config | ||
type: application | ||
server: | ||
customMiddleware: | ||
- name: fiori-tools-appreload | ||
afterMiddleware: compression | ||
- name: fiori-tools-preview | ||
afterMiddleware: compression |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobiasqueck There already exists a type that represents the deprecated config preview config in ui5-config/src/types/index.ts. That still seems to be used to generate outdated configs (see here). Do we need to address this in this PR as well? Or is this part of some generator adjustments that will come later because it seems to be used in app writer (here)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this type (and previewConfigOptions) be moved to preview middleware?