Skip to content

Conversation

@tobiasso85
Copy link
Contributor

@tobiasso85 tobiasso85 commented Jul 22, 2019

serveResources uses stringEscaper to escape .properties files.

Builds on @ui5/builder#293
In order to make the tests work @ui5/builder#293 needs to be linked into the project.

@CLAassistant
Copy link

CLAassistant commented Jul 22, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

Tests are failing

@tobiasso85 tobiasso85 requested a review from RandomByte July 25, 2019 11:06
matz3
matz3 previously requested changes Jul 26, 2019
@tobiasso85
Copy link
Contributor Author

Tests are failing

In order to make the tests work @ui5/builder#293 needs to be linked into the project.

Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

Fine with me. We need to wait for the release of SAP/ui5-builder#293 and then rebase this PR to have the tests pass

serveResources uses stringEscaper to escape .properties files.
propertiesFileEncoding -> propertiesSourceFileEncoding
propertiesSourceFileEncoding -> propertiesFileSourceEncoding
No special logic for properties files regarding charset and type.
The resource is drained because it is piped in the serveResources
middleware. Therefore the getStream and pipe functionality is stubbed.
Such that its content can be compared in the test.
@tobiasso85 tobiasso85 force-pushed the properties-file-escaping branch from e0d424f to 62dd62f Compare July 29, 2019 14:49
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 93.874% when pulling 62dd62f on properties-file-escaping into f7125e8 on master.

@RandomByte
Copy link
Member

Please squash and merge!

@tobiasso85 tobiasso85 merged commit dd4844d into master Jul 29, 2019
@tobiasso85 tobiasso85 deleted the properties-file-escaping branch July 29, 2019 14:56
type = mime.lookup(resourcePath) || "application/octet-stream";
// Special handling for *.properties files escape non ascii characters.
const nonAsciiEscaper = require("@ui5/builder").processors.nonAsciiEscaper;
const propertiesFileSourceEncoding = project && project.resources && project.resources.configuration && project.resources.configuration.propertiesFileSourceEncoding;
Copy link
Member

Choose a reason for hiding this comment

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

I think we missed something here 🤔

project is the root project. However, resources are taken from resources.all. So we rather need to look for the project on the resource. Just like we do in the lbt Bundler

We also need to add a test for this: A dependency tree of two projects, one with UTF-8 encoding and another one with ISO-8859-1, making sure that both are being processed correctly (stubs should be sufficient, no actual comparison of the results)

Copy link
Member

Choose a reason for hiding this comment

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

Should be resolved with: #219

d3xter666 pushed a commit to UI5/cli that referenced this pull request Sep 25, 2025
In serveResources middleware use nonAsciiEscaper processor to escape .properties files.
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.

6 participants