Skip to content

Commit

Permalink
Add scripts variant management script to FF & FE package json (#2327)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* adding default app name to simple generator example app

* update changeset

* snapshot fix

* sonar issue

---------

Co-authored-by: IainSAP <[email protected]>
Co-authored-by: J Long <[email protected]>
Co-authored-by: Austin Devine <[email protected]>
  • Loading branch information
4 people authored Sep 23, 2024
1 parent c6ca5c2 commit 484195d
Show file tree
Hide file tree
Showing 37 changed files with 1,201 additions and 91 deletions.
11 changes: 11 additions & 0 deletions .changeset/purple-snakes-impress.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion examples/simple-generator/src/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand Down
4 changes: 4 additions & 0 deletions packages/fiori-elements-writer/src/packageConfig.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions packages/fiori-elements-writer/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,5 @@ export interface PackageJsonScripts {
'start-noflp'?: string;
'start-mock'?: string;
'int-test'?: string;
'start-variants-management'?: string;
}
36 changes: 34 additions & 2 deletions packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
36 changes: 34 additions & 2 deletions packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Loading

0 comments on commit 484195d

Please sign in to comment.