Skip to content

Commit

Permalink
Breaking: js-yaml bump from v3 to v4. Fixes #2126
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jun 27, 2024
1 parent e2116a5 commit 047f661
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"eslint-config-prettier": "^9.1.0",
"globals": "^15.6.0",
"husky": "^9.0.11",
"js-yaml": "^4.1.0",
"jsdoc": "^4.0.3",
"lint-staged": "^15.2.7",
"markdown-it-emoji": "^3.0.0",
Expand Down Expand Up @@ -128,6 +127,7 @@
"gray-matter": "^4.0.3",
"is-glob": "^4.0.3",
"iso-639-1": "^3.1.2",
"js-yaml": "^4.1.0",
"kleur": "^4.1.5",
"liquidjs": "^10.14.0",
"luxon": "^3.4.4",
Expand Down
2 changes: 1 addition & 1 deletion src/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ class Template extends TemplateContent {
}

async addComputedData(data) {
if (this.config.keys.computed in data) {
if (isPlainObject(data?.[this.config.keys.computed])) {
this.computedData = new ComputedData(this.config);

// Note that `permalink` is only a thing that gets consumed—it does not go directly into generated data
Expand Down
3 changes: 3 additions & 0 deletions src/UserConfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import chalk from "kleur";
import { DateTime } from "luxon";
import yaml from "js-yaml";

import debugUtil from "debug";
import { RetrieveGlobals } from "node-retrieve-globals";
import { DeepCopy, TemplatePath } from "@11ty/eleventy-utils";
Expand Down Expand Up @@ -128,6 +130,7 @@ class UserConfig {

// Supplementary engines
engines: {
yaml: yaml.load.bind(yaml),
node: (frontMatterCode, { filePath }) => {
let vm = new RetrieveGlobals(frontMatterCode, {
filePath,
Expand Down
4 changes: 4 additions & 0 deletions src/Util/ReservedData.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class ReservedData {

// Check in the data cascade for reserved data properties.
static getReservedKeys(data) {
if (!data) {
return [];
}

let keys = this.properties.filter((key) => {
return key in data;
});
Expand Down

0 comments on commit 047f661

Please sign in to comment.