-
Notifications
You must be signed in to change notification settings - Fork 16
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] Properties File Escaping #214
Conversation
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.
Tests are failing
In order to make the tests work @ui5/builder#293 needs to be linked into the project. |
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.
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.
Default is "ISO-8859-1"
propertiesFileEncoding -> propertiesSourceFileEncoding
propertiesSourceFileEncoding -> propertiesFileSourceEncoding
No special logic for properties files regarding charset and type.
Fix test messages in main.js
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.
e0d424f
to
62dd62f
Compare
Please squash and merge! |
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; |
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.
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)
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 be resolved with: #219
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.