Skip to content
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

[FEATURE] specVersion 2.1: Add support for "customConfiguration" #308

Merged
merged 1 commit into from
May 5, 2020

Conversation

matz3
Copy link
Member

@matz3 matz3 commented Apr 16, 2020

  • Add "customConfiguration" object for arbitrary configuration
  • Also cover kind extension
  • Add tests for all types / kinds (maybe generic?)
  • Add generic tests to validate common configuration of 2.1 and 2.0 to avoid a lot of duplicated tests

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2020

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Apr 17, 2020

Coverage Status

Coverage increased (+0.007%) to 89.82% when pulling 71499c0 on specVersion-2.1 into d5d98c4 on master.

@@ -0,0 +1,494 @@
const test = require("ava");

test("commonUtils", async (t) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rather exclude this file in the ava config (see package.json).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! done

}
});
});
test("framework configuration: Invalid (specVersion " + version + ")", async (t) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all framework tests should be common across application, library and theme-library.

Copy link

@tobiasso85 tobiasso85 Apr 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@matz3
Copy link
Member Author

matz3 commented Apr 20, 2020

All types of kind extension should also have the customConfiguration

@tobiasso85 tobiasso85 changed the title [FEATURE] Add specification version 2.1 [FEATURE] Add specification version 2.1 which supports customConfiguration Apr 23, 2020
@matz3
Copy link
Member Author

matz3 commented Apr 28, 2020

Looks ok from my side. Maybe @RandomByte also want to have a look

"metadata": {
"$ref": "../extension.json#/definitions/metadata"
},
"task": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this a reference as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"metadata": {
"$ref": "../extension.json#/definitions/metadata"
},
"middleware": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this a reference as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

test(`kind: extension / type: ${type} basic (${specVersion})`, async (t) => {
await assertValidation(t, Object.assign({
"specVersion": specVersion,
"kind": "extension",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate information. Already defined in additionalConfiguration, so should be removed here

Suggested change
"kind": "extension",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

test(`kind: extension / type: ${type} additionalProperties (${specVersion})`, async (t) => {
await assertValidation(t, Object.assign({
"specVersion": specVersion,
"kind": "extension",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate information. Already defined in additionalConfiguration, so should be removed here

Suggested change
"kind": "extension",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}]);
});

test(`${type} Invalid configuration: Additional property (${specVersion})`, async (t) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test(`${type} Invalid configuration: Additional property (${specVersion})`, async (t) => {
test(`kind: extension / type: ${type} Invalid configuration: Additional property (${specVersion})`, async (t) => {

Align with other test names

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Adds support for the "customConfiguration" configuration to provide
custom data. Must be handled by custom tools. Can be consumed when
using @ui5/project API.
@matz3 matz3 changed the title [FEATURE] Add specification version 2.1 which supports customConfiguration [FEATURE] specVersion 2.1: Add support for "customConfiguration" May 5, 2020
@matz3 matz3 merged commit 201aaab into master May 5, 2020
@matz3 matz3 deleted the specVersion-2.1 branch May 5, 2020 13:42
@RandomByte
Copy link
Member

RandomByte commented May 11, 2020

We forgot to enhance this if with the new spec version:

if (project.specVersion !== "0.1" && project.specVersion !== "1.0" &&
project.specVersion !== "1.1" && project.specVersion !== "2.0") {

Also tests were not adapted. Currently you can't use specVersion 2.1 in a project, it will raise an error

Unsupported specification version 2.1 defined for project openui5-sample-app. Your UI5 CLI installation might be outdated. For details see https://sap.github.io/ui5-tooling/pages/Configuration/#specification-versions

RandomByte added a commit that referenced this pull request May 11, 2020
#308 only allowed the use of the
new spec version for extensions.
RandomByte added a commit that referenced this pull request May 11, 2020
#308 only allowed the use of the
new spec version for extensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants