Switch json5 to @bybrave/json5 (#19843)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-08-13 17:28:45 +08:00
1 parent 887af16172
commit d6faa1ec44
5 files changed
+15 -10

No files matched your search

+1
View File
@@ -37,6 +37,7 @@
"Brevik",
"bunx",
"Burgener",
"bybrave",
"callees",
"camelified",
"catppuccin",
+1 -1
View File
@@ -48,6 +48,7 @@
"@babel/types": "8.0.4",
"@braindb/mdast-util-wiki-link": "0.2.0",
"@braindb/micromark-extension-wiki-link": "0.1.0",
"@bybrave/json5": "3.1.0",
"@glimmer/syntax": "0.95.0",
"@prettier/cli": "0.12.0",
"@prettier/html-attributes": "0.0.3",
@@ -88,7 +89,6 @@
"index-to-position": "1.2.0",
"is-es5-identifier-name": "1.0.1",
"jest-docblock": "30.4.0",
"json5": "2.2.3",
"leven": "4.1.0",
"linguist-languages": "9.4.0",
"mdast-util-from-markdown": "2.0.3",
-5
View File
@@ -86,11 +86,6 @@ const mainModule = {
return text;
},
},
{
module: getPackageFile("json5/dist/index.mjs"),
find: "export default lib;",
replacement: "export default { parse };",
},
{
module: resolveEsmModulePath("@babel/code-frame"),
process(text) {
+2 -2
View File
@@ -1,5 +1,5 @@
import { pathToFileURL } from "node:url";
import json5 from "json5";
import { parse as parseJson5 } from "@bybrave/json5";
import parseJson from "parse-json";
import { parse as parseToml } from "smol-toml";
import readFile from "../../utilities/read-file.js";
@@ -82,7 +82,7 @@ async function loadToml(file) {
async function loadJson5(file) {
const content = await readFile(file);
try {
return json5.parse(content);
return parseJson5(content);
} catch (/** @type {any} */ error) {
error.message = `JSON5 Error in ${file}:\n${error.message}`;
throw error;
+11 -2
View File
@@ -476,6 +476,15 @@ __metadata:
languageName: node
linkType: hard
"@bybrave/json5@npm:3.1.0":
version: 3.1.0
resolution: "@bybrave/json5@npm:3.1.0"
bin:
json5: lib/cli.js
checksum: 10/167c928e5abb6993d8e2748549d878773e583c9dee911959f495872be2f32219979e4f82e26f1e3e11cdf1e6874f0e3827da7f987cde627dc142c9e1bcaa90c1
languageName: node
linkType: hard
"@cacheable/memory@npm:^2.2.0":
version: 2.2.0
resolution: "@cacheable/memory@npm:2.2.0"
@@ -6524,7 +6533,7 @@ __metadata:
languageName: node
linkType: hard
"json5@npm:2.2.3, json5@npm:^2.2.3":
"json5@npm:^2.2.3":
version: 2.2.3
resolution: "json5@npm:2.2.3"
bin:
@@ -8208,6 +8217,7 @@ __metadata:
"@babel/types": "npm:8.0.4"
"@braindb/mdast-util-wiki-link": "npm:0.2.0"
"@braindb/micromark-extension-wiki-link": "npm:0.1.0"
"@bybrave/json5": "npm:3.1.0"
"@eslint/js": "npm:10.0.1"
"@glimmer/syntax": "npm:0.95.0"
"@prettier/cli": "npm:0.12.0"
@@ -8286,7 +8296,6 @@ __metadata:
jest-watch-typeahead: "npm:3.0.1"
jsesc: "npm:3.1.0"
json-test-suite: "npm:1.0.0"
json5: "npm:2.2.3"
jsx-test-suite: "npm:0.0.2"
knip: "npm:6.32.0"
less-test-suite: "npm:0.0.1"