Repository navigation
fix: update dependency jsonc to v3 - #5020
Merged
Merged
Conversation
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.
This PR contains the following updates:
^2.0.0→^3.0.0Release Notes
onury/jsonc (jsonc)
v3.0.0Compare Source
Added
allowTrailingCommasoption forparse(),read(),readSync()and their safe versions. Opt-in (defaultfalse); allows trailing commas in objects and arrays, as in JSONC files such astsconfig.json. Takes effect only when comments are stripped.parse<T>(),read<T>(),readSync<T>()andnormalize<T>()(defaultany); the safe versions returnSafeResult<T>. The type is not validated at runtime.handleCircularoption forwrite()/writeSync()(defaulttrue).jsonc,safeand all option types (IParseOptions,IStringifyOptions,IReadOptions,IWriteOptions,IConfig,Replacer,Reviver,SafeResult);jsoncis also the default export. In v2, the typings only declaredjsonc, soimport { safe } from 'jsonc'did not type-check.Changed
"type": "module"with anexportsmap; the CommonJSindex.jsentry is removed. On Node.js 22.12 or newer,require('jsonc')still works (Node'srequire(esm)) and returnsjsoncitself as in v2; soconst jsonc = require('jsonc')andconst { jsonc, safe } = require('jsonc')both work. On 22.0 – 22.11, useimport.write()/writeSync()now handle circular references likestringify()does (written as"[Circular]"); they used to throw. PasshandleCircular: falsefor the old behavior.stringify()(andnormalize()) now throw for aBigIntand rethrow any other serialization error (e.g. from atoJSON()), as the native method does. They used to return the string"[unable to serialize, circular reference is too complex to analyze]".safe.stringify()now honorshandleCircular: falseand returns[TypeError, undefined]for a circular value; it used to ignore the option.parse()now replaces comments with whitespace instead of removing them, so the position, line and column in a parse error point into the original string (read()already did this). The parsed result is the same.write()/writeSync()return type is narrowed frombooleantotrue.config()argument is now optional; omitted streams reset toprocess.stdout/process.stderr.parse-jsonto v8 andstrip-json-commentsto v5. Parse errors areparse-jsonv8'sJSONError(with a code frame).Fixed
log()/logp()would print an empty string forundefinedand would throw for aSymbolargument.Replacertype, which only allowed a function; it now also accepts an allow-list array of property names (as the runtime always did).IConfigstream types (NodeJS.WriteStream, i.e. a TTY stream), which rejected file streams such asfs.createWriteStream(). They are nowNodeJS.WritableStream.read()/write()examples had syntax errors;stringify()docs claimed it throws on circular references by default).Removed
graceful-fs,mkdirpandstrip-bomdependencies; file I/O usesnode:fsandnode:fs/promises, with native recursivemkdir. Runtime dependencies are nowfast-safe-stringify,parse-jsonandstrip-json-comments.Tooling
tsc) tolib/withtsconfig-oy; Biome (biome-config-oy) replaces TSLint.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.