build: replace lodash with eta for nuspec templating#593
Open
MarshallOfSound wants to merge 3 commits intomainfrom
Open
build: replace lodash with eta for nuspec templating#593MarshallOfSound wants to merge 3 commits intomainfrom
MarshallOfSound wants to merge 3 commits intomainfrom
Conversation
Replace the single use of lodash (`template`) with a small local implementation that supports the same `<% %>`, `<%= %>` and `<%- %>` delimiters, so existing custom `nuspecTemplate` files continue to work.
dsanders11
requested changes
Apr 8, 2026
Member
dsanders11
left a comment
There was a problem hiding this comment.
Test coverage would be good.
Replace the local template implementation with the eta package, pinned to an exact version. eta's `<%= %>` tag is XML-escaped by default, so the bundled template's `<%- %>` tags are updated accordingly. `autoTrim` is disabled and `useWith` enabled so rendered output matches the previous behaviour.
Remove the one-line src/template.ts wrapper and call eta directly at the single call site.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the
lodashdependency. The only usage was_.template()for rendering the.nuspecfile, which is now handled byeta(pinned to an exact version).Changes
package.json/yarn.lock— droplodashand@types/lodash, addeta@4.5.1src/index.ts— render the nuspec vianew Eta({ autoTrim: false, useWith: true }).renderString(...)template.nuspectemplate— change<%- expr %>to<%= expr %>The Eta config (
autoTrim: false,useWith: true) keeps the rendered output byte-identical to what lodash produced for the bundled template, including XML escaping and theadditionalFilesloop.Note on
nuspecTemplateEta auto-escapes
<%= %>and reserves<%-/-%>for whitespace trimming, so the lodash-style<%- expr %>escape tag is no longer supported. Consumers passing a customnuspecTemplateshould switch<%- expr %>to<%= expr %>(escaped) or<%~ expr %>(raw).