feat: add fromContent method to set contents directly#96
Merged
lukekarrys merged 1 commit intomainfrom Apr 22, 2024
Merged
Conversation
e1cf483 to
b506ba0
Compare
wraithgar
reviewed
Apr 22, 2024
| return this | ||
| } | ||
|
|
||
| fromContent (data) { |
Contributor
There was a problem hiding this comment.
I think this method was ill conceived. In my head it was the implementation that this PR is now providing.
Having it public was probably a mistake, as it should probably also have #canSave set to false if used directly (and load should not use it directly).
That's neither here nor there for this PR but those are the thoughts that this PR makes me have.
Contributor
There was a problem hiding this comment.
fromComment seems to have the same issue. I think that for how we use this it's fine, but some of these public methods could be used in a way that gives weird behavior when folks try to save.
Merged
lukekarrys
pushed a commit
that referenced
this pull request
Apr 22, 2024
🤖 I have created a release *beep* *boop* --- ## [5.1.0](v5.0.3...v5.1.0) (2024-04-22) ### Features * [`17788d0`](17788d0) [#96](#96) add fromContent method to set contents directly (#96) (@lukekarrys) ### Chores * [`9597b84`](9597b84) [#94](#94) postinstall for dependabot template-oss PR (@lukekarrys) * [`5e20e64`](5e20e64) [#94](#94) bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot]) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Currently to replace
read-package-json-fastinpacotewe already have a manifest that needs normalizing. The only way to do that currently is to pass in a string and re-JSON.parse it which is a waste. This allows for content to be set directly.