diff --git a/package.json b/package.json index 5bfb105527..41992244dc 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "@iconify-json/lucide": "^1.2.123", "@types/hast": "^3.0.5", "@types/html-escaper": "^3.0.4", - "@types/js-yaml": "^4.0.9", "@types/mdast": "^4.0.4", "@types/node": "^26.2.0", "@types/viz.js": "^2.1.5", @@ -95,7 +94,7 @@ "cheerio": "^1.2.0", "classnames": "^2.5.1", "dotenv": "^17.4.2", - "js-yaml": "^4.3.1", + "js-yaml": "^5.3.0", "jsonpointer": "^5.0.1", "react": "^19.2.8", "react-dom": "^19.2.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 76cb66c2c0..e7a3c043f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,8 +74,8 @@ importers: specifier: ^17.4.2 version: 17.4.2 js-yaml: - specifier: ^4.3.1 - version: 4.3.1 + specifier: ^5.3.0 + version: 5.3.0 jsonpointer: specifier: ^5.0.1 version: 5.0.1 @@ -173,9 +173,6 @@ importers: '@types/html-escaper': specifier: ^3.0.4 version: 3.0.4 - '@types/js-yaml': - specifier: ^4.0.9 - version: 4.0.9 '@types/mdast': specifier: ^4.0.4 version: 4.0.4 @@ -1913,9 +1910,6 @@ packages: '@types/is-empty@1.2.3': resolution: {integrity: sha512-4J1l5d79hoIvsrKh5VUKVRA1aIdsOb10Hu5j3J2VfP/msDnfTdGPmNp2E1Wg+vs97Bktzo+MZePFFXSGoykYJw==} - '@types/js-yaml@4.0.9': - resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} - '@types/jsesc@2.5.1': resolution: {integrity: sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==} @@ -3506,6 +3500,10 @@ packages: resolution: {integrity: sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==} hasBin: true + js-yaml@5.3.0: + resolution: {integrity: sha512-muutsYr+e2+d3rTgUGslq5rxbBlUy3cJ61IsHag2QNDQV+7zXWjkUpmALIajhrlLlrgRUiymj6U3zUr/TMK84Q==} + hasBin: true + jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} @@ -7220,8 +7218,6 @@ snapshots: '@types/is-empty@1.2.3': {} - '@types/js-yaml@4.0.9': {} - '@types/jsesc@2.5.1': {} '@types/json-schema@7.0.15': {} @@ -9325,6 +9321,10 @@ snapshots: dependencies: argparse: 2.0.1 + js-yaml@5.3.0: + dependencies: + argparse: 2.0.1 + jsesc@3.1.0: {} json-buffer@3.0.1: {} diff --git a/scripts/validate-config-examples.mjs b/scripts/validate-config-examples.mjs index cc6bc839f1..f8cdbb2c06 100644 --- a/scripts/validate-config-examples.mjs +++ b/scripts/validate-config-examples.mjs @@ -33,7 +33,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import Ajv2020 from 'ajv/dist/2020.js'; -import yaml from 'js-yaml'; +import * as yaml from 'js-yaml'; const ROOT = path.resolve(fileURLToPath(import.meta.url), '..', '..'); const SCHEMA_PATH = path.join(ROOT, 'public', 'mergify-configuration-schema.json'); diff --git a/src/components/Tables/OptionsTable.tsx b/src/components/Tables/OptionsTable.tsx index c7b0654a07..6f88b2d98b 100644 --- a/src/components/Tables/OptionsTable.tsx +++ b/src/components/Tables/OptionsTable.tsx @@ -25,9 +25,11 @@ export function defToIdPrefix(def: string): string { function dumpDefault(value: unknown): string { return yaml .dump(value, { - noCompatMode: true, lineWidth: -1, - quotingType: '"', + // Not the default ('single'): these dumps are copy-pasted into configs, and + // double quotes keep Jinja templates like "{{ title }} '{{ name }}'" readable + // without escaping the inner single quotes. + quoteStyle: 'double', noRefs: true, }) .replace(/\n$/, '');