Merge pull request #3901 from backstage/dependabot/npm_and_yarn/microsite/js-yaml-4.0.0

chore(deps-dev): bump js-yaml from 3.14.1 to 4.0.0 in /microsite
This commit is contained in:
Ben Lambert
2021-01-04 13:16:52 +01:00
committed by GitHub
7 changed files with 33 additions and 9 deletions
+1 -1
View File
@@ -48,7 +48,7 @@
"express": "^4.17.1",
"fs-extra": "^9.0.1",
"git-url-parse": "^11.4.3",
"js-yaml": "^3.14.0",
"js-yaml": "^4.0.0",
"mime-types": "^2.1.27",
"mock-fs": "^4.13.0",
"recursive-readdir": "^2.2.2",
@@ -303,7 +303,7 @@ describe('helpers', () => {
const updatedMkdocsYml = await fs.readFile('/mkdocs.yml');
expect(updatedMkdocsYml.toString()).toContain(
"repo_url: 'https://github.com/backstage/backstage'",
'repo_url: https://github.com/backstage/backstage',
);
});
@@ -322,10 +322,10 @@ describe('helpers', () => {
const updatedMkdocsYml = await fs.readFile('/mkdocs_with_repo_url.yml');
expect(updatedMkdocsYml.toString()).toContain(
"repo_url: 'https://github.com/backstage/backstage'",
'repo_url: https://github.com/backstage/backstage',
);
expect(updatedMkdocsYml.toString()).not.toContain(
"repo_url: 'https://github.com/neworg/newrepo'",
'repo_url: https://github.com/neworg/newrepo',
);
});
});
@@ -241,7 +241,7 @@ export const patchMkdocsYmlPreBuild = async (
let mkdocsYml: any;
try {
mkdocsYml = yaml.safeLoad(mkdocsYmlFileString);
mkdocsYml = yaml.load(mkdocsYmlFileString);
// mkdocsYml should be an object type after successful parsing.
// But based on its type definition, it can also be a string or undefined, which we don't want.
@@ -267,7 +267,7 @@ export const patchMkdocsYmlPreBuild = async (
}
try {
await fs.writeFile(mkdocsYmlPath, yaml.safeDump(mkdocsYml), 'utf8');
await fs.writeFile(mkdocsYmlPath, yaml.dump(mkdocsYml), 'utf8');
} catch (error) {
logger.warn(
`Could not write to ${mkdocsYmlPath} after updating it before running the generator. ${error.message}`,