diff --git a/package-lock.json b/package-lock.json index b63bc5f8c352..dbbf1fb7a5b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "ip": "^2.0.1", "jasmine": "^6.3.0", "jquery": "3.7.1", - "js-yaml": "^4.2.0", + "js-yaml": "^5.1.0", "karma": "^6.4.4", "karma-browserstack-launcher": "1.4.0", "karma-chrome-launcher": "^3.2.0", @@ -560,6 +560,29 @@ "node": ">=20" } }, + "node_modules/@astrojs/markdown-remark/node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@astrojs/markdown-remark/node_modules/shiki": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.2.0.tgz", @@ -651,6 +674,29 @@ "node": "18.20.8 || ^20.3.0 || >=22.0.0" } }, + "node_modules/@astrojs/mdx/node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@astrojs/prism": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-4.0.2.tgz", @@ -3166,6 +3212,29 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@eslint/js": { "version": "8.57.1", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", @@ -6111,6 +6180,29 @@ "@esbuild/win32-x64": "0.27.7" } }, + "node_modules/astro/node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/astro/node_modules/semver": { "version": "7.7.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", @@ -7356,6 +7448,29 @@ } } }, + "node_modules/cosmiconfig/node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/cross-env": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz", @@ -8770,6 +8885,29 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -11608,9 +11746,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.1.0.tgz", + "integrity": "sha512-s8VA5jkR8f22S3NAXmhKPFqGUduqZGlsufabVOgN14iTdw/RXcym7bKkbwjxLK9Yw2lEvvmJjFp119+KPeo8Kg==", "dev": true, "funding": [ { @@ -11627,7 +11765,7 @@ "argparse": "^2.0.1" }, "bin": { - "js-yaml": "bin/js-yaml.js" + "js-yaml": "bin/js-yaml.mjs" } }, "node_modules/jsesc": { diff --git a/package.json b/package.json index 3e7832228454..089cba6de8f7 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "ip": "^2.0.1", "jasmine": "^6.3.0", "jquery": "3.7.1", - "js-yaml": "^4.2.0", + "js-yaml": "^5.1.0", "karma": "^6.4.4", "karma-browserstack-launcher": "1.4.0", "karma-chrome-launcher": "^3.2.0", diff --git a/site/src/libs/config.ts b/site/src/libs/config.ts index c027175c7114..36e101d2577d 100644 --- a/site/src/libs/config.ts +++ b/site/src/libs/config.ts @@ -1,5 +1,5 @@ import fs from 'node:fs' -import yaml from 'js-yaml' +import { load as yamlLoad } from 'js-yaml' import { z } from 'zod' import { zPrefixedVersionSemver, zVersionMajorMinor, zVersionSemver } from './validation' @@ -70,7 +70,7 @@ export function getConfig(): Config { try { // Load the config from the `config.yml` file. - const rawConfig = yaml.load(fs.readFileSync('./config.yml', 'utf8')) + const rawConfig = yamlLoad(fs.readFileSync('./config.yml', 'utf8')) // Parse the config using the config schema to validate its content and get back a fully typed config object. config = configSchema.parse(rawConfig) diff --git a/site/src/libs/data.ts b/site/src/libs/data.ts index 62535fd69450..3d50af972db1 100644 --- a/site/src/libs/data.ts +++ b/site/src/libs/data.ts @@ -1,5 +1,5 @@ import fs from 'node:fs' -import yaml from 'js-yaml' +import { load as yamlLoad } from 'js-yaml' import { z } from 'zod' import { zHexColor, @@ -124,7 +124,7 @@ export function getData(type: TType): z.infer<(typeof da try { // Load the data from the yml file. - const rawData = yaml.load(fs.readFileSync(dataPath, 'utf8')) + const rawData = yamlLoad(fs.readFileSync(dataPath, 'utf8')) // Parse the data using the data schema to validate its content and get back a fully typed data object. const parsedData = dataDefinitions[type].parse(rawData)