Repository navigation
Fix invalid escaping of environment variables in uno-config.js - #1061
Conversation
…le writes and update uno-config.js handling
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1061.eastus2.1.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
This PR introduces a custom MSBuild task to write uno-config.js content verbatim (avoiding MSBuild item-value backslash normalization) and updates the build/publish targets to use it when rewriting the dotnet.js fingerprint.
Changes:
- Add
WriteFileVerbatimTask_v0(UTF-8, no BOM) to write content without MSBuild item pipeline transformations. - Replace
<WriteLinesToFile>usages withWriteFileVerbatimTask_v0foruno-config.jsfingerprint updates (build, publish, and worker variants). - Add a unit-test regression check around
JsStringHelper.EscapeJsStringoutput and update server publish targets to use the new task.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Uno.Wasm.Bootstrap/WriteFileVerbatimTask.cs | Adds a dedicated MSBuild task to write file content verbatim (avoids \ → / corruption). |
| src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets | Registers and uses the new task to update uno-config.js fingerprinting without backslash normalization. |
| src/Uno.Wasm.Bootstrap.UnitTests/Given_ShellTask_EnvironmentVariableEscaping.cs | Adds a regression test asserting escaped output contains literal backslash-quote. |
| src/Uno.Wasm.Bootstrap.Server/build/Uno.Wasm.Bootstrap.Server.targets | Switches server publish-time fingerprint rewrite to use the new task via <UsingTask>. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… improve escaping tests
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1061.eastus2.1.azurestaticapps.net |
Introduce WriteFileVerbatimTask_v0 to preserve backslashes in file writes and update uno-config.js handling