Skip to content

Commit 20d099b

Browse files
dependabot[bot]ksroda-saclaude
authored
deps: bump js-yaml from 4.2.0 to 5.1.0 in /scripts (#279)
* deps: bump js-yaml from 4.2.0 to 5.1.0 in /scripts Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 5.1.0. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.2.0...5.1.0) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 5.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * deps: migrate scripts to js-yaml 5 API js-yaml 5 dropped the default export, breaking the CI validate job. Switch to named imports (load/dump), migrate the deprecated dump option quotingType: '"' to quoteStyle: "double", and drop the now redundant @types/js-yaml (v5 ships its own types). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kamila Środa <ksroda@secureauth.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 723a93f commit 20d099b

5 files changed

Lines changed: 28 additions & 31 deletions

File tree

scripts/aggregate-manifests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { readFileSync, writeFileSync } from "fs";
22
import { glob } from "glob";
3-
import yaml from "js-yaml";
3+
import { load, dump } from "js-yaml";
44
import path from "path";
55
import { fileURLToPath } from "url";
66

@@ -64,7 +64,7 @@ async function main() {
6464
for (const file of manifestFiles.sort()) {
6565
const fullPath = path.join(SAMPLES, file);
6666
const content = readFileSync(fullPath, "utf-8");
67-
const manifest = yaml.load(content) as FrameworkManifest;
67+
const manifest = load(content) as FrameworkManifest;
6868

6969
frameworks[manifest.framework] = {
7070
label: manifest.label,
@@ -110,10 +110,10 @@ async function main() {
110110
);
111111

112112
const output = { frameworks: orderedFrameworks, scenarios };
113-
const yamlStr = yaml.dump(output, {
113+
const yamlStr = dump(output, {
114114
lineWidth: 120,
115115
noRefs: true,
116-
quotingType: '"',
116+
quoteStyle: "double",
117117
});
118118
const outputPath = path.join(ROOT, "snippet-manifest.yaml");
119119
writeFileSync(

scripts/extract-snippets.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { readdirSync, readFileSync, writeFileSync } from "fs";
22
import { glob } from "glob";
3-
import yaml from "js-yaml";
3+
import { load } from "js-yaml";
44
import path from "path";
55
import { fileURLToPath } from "url";
66

@@ -62,7 +62,7 @@ function getPlaceholderMap(): PlaceholderMap {
6262
path.join(ROOT, "placeholder-map.yaml"),
6363
"utf-8",
6464
);
65-
return yaml.load(content) as PlaceholderMap;
65+
return load(content) as PlaceholderMap;
6666
}
6767

6868
function applyPlaceholders(
@@ -84,7 +84,7 @@ function getLibVersion(
8484
manifestDir: string,
8585
libOverride?: string,
8686
): string {
87-
const manifest = yaml.load(
87+
const manifest = load(
8888
readFileSync(path.join(manifestDir, "manifest.yaml"), "utf-8"),
8989
) as FrameworkManifest;
9090
const lib = libOverride ?? manifest.lib;
@@ -135,7 +135,7 @@ function getLibVersion(
135135

136136
// Flutter — pubspec.yaml dependencies
137137
try {
138-
const pubspec = yaml.load(
138+
const pubspec = load(
139139
readFileSync(path.join(scenarioDir, "pubspec.yaml"), "utf-8"),
140140
) as { dependencies?: Record<string, unknown> };
141141
const dep = pubspec?.dependencies?.[lib];
@@ -223,9 +223,11 @@ function getLibVersion(
223223
// lives inside *.xcworkspace/, which is typically gitignored, so CI checkouts
224224
// can't see it; project.yml is the committed source of truth for SPM pins.
225225
try {
226-
const projectYml = yaml.load(
226+
const projectYml = load(
227227
readFileSync(path.join(scenarioDir, "project.yml"), "utf-8"),
228-
) as { packages?: Record<string, { url?: string; from?: string | number }> };
228+
) as {
229+
packages?: Record<string, { url?: string; from?: string | number }>;
230+
};
229231
const libLower = lib.toLowerCase();
230232
for (const [name, pkg] of Object.entries(projectYml?.packages ?? {})) {
231233
const url = (pkg?.url || "").toLowerCase();
@@ -291,7 +293,9 @@ function getLibVersion(
291293
if (module === libLower) {
292294
// Extract version.ref or version from this entry
293295
const entry = libMatch[0];
294-
const versionRefMatch = entry.match(/version\.ref\s*=\s*["']([^"']+)["']/);
296+
const versionRefMatch = entry.match(
297+
/version\.ref\s*=\s*["']([^"']+)["']/,
298+
);
295299
if (versionRefMatch) {
296300
const ref = versionRefMatch[1];
297301
const versionLineRegex = new RegExp(
@@ -301,7 +305,9 @@ function getLibVersion(
301305
const vMatch = versionsBlock.match(versionLineRegex);
302306
if (vMatch) return vMatch[1];
303307
}
304-
const versionMatch = entry.match(/version\s*=\s*["']([0-9][^"']+)["']/);
308+
const versionMatch = entry.match(
309+
/version\s*=\s*["']([0-9][^"']+)["']/,
310+
);
305311
if (versionMatch) return versionMatch[1];
306312
}
307313
}
@@ -439,7 +445,7 @@ async function main() {
439445
for (const manifestFile of manifestFiles.sort()) {
440446
const frameworkDir = path.join(SAMPLES, path.dirname(manifestFile));
441447
const content = readFileSync(path.join(SAMPLES, manifestFile), "utf-8");
442-
const manifest = yaml.load(content) as FrameworkManifest;
448+
const manifest = load(content) as FrameworkManifest;
443449
const fw = manifest.framework;
444450
const lang = manifest.lang;
445451

scripts/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
},
1212
"dependencies": {
1313
"glob": "13.0.6",
14-
"js-yaml": "4.2.0",
14+
"js-yaml": "5.1.0",
1515
"tsx": "4.22.4"
1616
},
1717
"devDependencies": {
18-
"@types/js-yaml": "4.0.9",
1918
"@types/node": "26.0.1",
2019
"typescript": "6.0.3"
2120
}

scripts/validate-structure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { existsSync, readFileSync } from "fs";
22
import { glob } from "glob";
3-
import yaml from "js-yaml";
3+
import { load } from "js-yaml";
44
import path from "path";
55
import { fileURLToPath } from "url";
66

@@ -41,7 +41,7 @@ async function main() {
4141
for (const manifestFile of manifestFiles) {
4242
const frameworkDir = path.join(SAMPLES, path.dirname(manifestFile));
4343
const content = readFileSync(path.join(SAMPLES, manifestFile), "utf-8");
44-
const manifest = yaml.load(content) as FrameworkManifest;
44+
const manifest = load(content) as FrameworkManifest;
4545

4646
for (const scenarioId of Object.keys(manifest.scenarios)) {
4747
const dirName = scenarioId.replace(/^[^_]+_/, "").replaceAll("_", "-");

scripts/yarn.lock

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ __metadata:
99
version: 0.0.0-use.local
1010
resolution: "@ciam-quickstart/scripts@workspace:."
1111
dependencies:
12-
"@types/js-yaml": "npm:4.0.9"
1312
"@types/node": "npm:26.0.1"
1413
glob: "npm:13.0.6"
15-
js-yaml: "npm:4.2.0"
14+
js-yaml: "npm:5.1.0"
1615
tsx: "npm:4.22.4"
1716
typescript: "npm:6.0.3"
1817
languageName: unknown
@@ -245,13 +244,6 @@ __metadata:
245244
languageName: node
246245
linkType: hard
247246

248-
"@types/js-yaml@npm:4.0.9":
249-
version: 4.0.9
250-
resolution: "@types/js-yaml@npm:4.0.9"
251-
checksum: 10c0/24de857aa8d61526bbfbbaa383aa538283ad17363fcd5bb5148e2c7f604547db36646440e739d78241ed008702a8920665d1add5618687b6743858fae00da211
252-
languageName: node
253-
linkType: hard
254-
255247
"@types/node@npm:26.0.1":
256248
version: 26.0.1
257249
resolution: "@types/node@npm:26.0.1"
@@ -546,14 +538,14 @@ __metadata:
546538
languageName: node
547539
linkType: hard
548540

549-
"js-yaml@npm:4.2.0":
550-
version: 4.2.0
551-
resolution: "js-yaml@npm:4.2.0"
541+
"js-yaml@npm:5.1.0":
542+
version: 5.1.0
543+
resolution: "js-yaml@npm:5.1.0"
552544
dependencies:
553545
argparse: "npm:^2.0.1"
554546
bin:
555-
js-yaml: bin/js-yaml.js
556-
checksum: 10c0/1916456c118746603b067d74bbcbb0445d9a1d5e474ad4ae775e7b20525bed902e01d9d97dd0c81fcd8d4f596162309d0eb057f4aa38f3e9647f14075e9dea45
547+
js-yaml: bin/js-yaml.mjs
548+
checksum: 10c0/a21c3817fb736ab3215c9d1ffb0a94823d02ecb51b481e88ab4bf0f9522baccbe9168bdf265bc315124d5087e2261de93e56176c2a7cd589d8275a18d7b3316e
557549
languageName: node
558550
linkType: hard
559551

0 commit comments

Comments
 (0)