-
Notifications
You must be signed in to change notification settings - Fork 432
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
fix: replace the JSON5 parser with JSON #6149
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Full Report@sanity/portable-text-editor
@sanity/migrate
@sanity/block-tools
@sanity/types
sanity/desk
@sanity/cli
@sanity/codegen
sanity/structure
@sanity/util/concurrency-limiter
@sanity/util/legacyDateFormat
@sanity/schema/_internal
@sanity/util/paths
sanity/router
@sanity/schema
sanity/cli
@sanity/vision
@sanity/util/fs
sanity/_internal
@sanity/util/client
@sanity/util/createSafeJsonParser
sanity/_internalBrowser
@sanity/util/content
sanity
@sanity/mutator
@sanity/diff
|
Component Testing Report Updated Apr 8, 2024 4:42 PM (UTC)
|
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.
confirmed that the plaintext string no longer getting inserted!
I'm a little nervous about going from a package with 150k weekly downloads to one with 37 downloads. I'm not sure if the workaround (per my tests, something like:
config.compilerOptions["target"]= 'ES2017'
is preferable.
Got it! I read through the source code, and it's fairly small/straightforward and has no external dependencies, so I felt the risk was low. Not sure I follow the alternate solve in your comment? 🤔 |
Yep, it seemed like a pretty straightforward fork to me too -- and the original package hasn't been updated in years so it's not like we gain benefits there 😬
I tell a lie -- not sure why I thought that would work, TBH. |
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.
Considering the lower impact of any future issues with this package (and annoying/difficult workarounds) let's move ahead! 👍
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.
👍
5e577c2
to
56eb6ad
Compare
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is an install script?Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Description
sanity init
in a Next.js project used the golden-fleece library to patch thetsconfig.json
with thetarget
property. This introduced a bug, since we inserted a JSON5 string into a JSON file.This PR replaces the JSON5 parser with a JSON one (silver-fleece).
What to review
If the
sanity init
command now works (better) inside of a Next.js project.Testing
./path/to/sanity init
inside a fresh Next.js project, choosingY
for TypeScript.Notes for release
Fixes a bug where wrongly formatted configuration would be inserted into
tsconfig.json
whensanity init
was run inside of a Next.js project.