Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Move data utils to 📁Data #3258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Engines/Custom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import TemplateEngine from "./TemplateEngine.js";
import getJavaScriptData from "../Util/GetJavaScriptData.js";
import getJavaScriptData from "../Data/GetJavaScriptData.js";
import eventBus from "../EventBus.js";

let lastModifiedFile = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/Engines/JavaScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TemplatePath } from "@11ty/eleventy-utils";

import TemplateEngine from "./TemplateEngine.js";
import EleventyBaseError from "../Errors/EleventyBaseError.js";
import getJavaScriptData from "../Util/GetJavaScriptData.js";
import getJavaScriptData from "../Data/GetJavaScriptData.js";
import EventBusUtil from "../Util/EventBusUtil.js";
import { EleventyImport } from "../Util/Require.js";

Expand Down
4 changes: 2 additions & 2 deletions src/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import TemplateBehavior from "./TemplateBehavior.js";
import TemplateContentPrematureUseError from "./Errors/TemplateContentPrematureUseError.js";
import TemplateContentUnrenderedTemplateError from "./Errors/TemplateContentUnrenderedTemplateError.js";
import EleventyBaseError from "./Errors/EleventyBaseError.js";
import ReservedData from "./Util/ReservedData.js";
import ReservedData from "./Data/ReservedData.js";

const { set: lodashSet, get: lodashGet } = lodash;
const writeFile = util.promisify(fs.writeFile);
Expand Down Expand Up @@ -390,7 +390,7 @@ class Template extends TemplateContent {

let newDate = await this.getMappedDate(data);

// Make sure to keep these keys synchronized in src/Util/ReservedData.js
// Make sure to keep these keys synchronized in src/Data/ReservedData.js
data.page.date = newDate;
data.page.inputPath = this.inputPath;
data.page.fileSlug = this.fileSlugStr;
Expand Down
2 changes: 1 addition & 1 deletion test/ReservedDataTest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from "ava";
import ReservedData from "../src/Util/ReservedData.js";
import ReservedData from "../src/Data/ReservedData.js";

test("No reserved Keys", t => {
t.deepEqual(ReservedData.getReservedKeys({ key: {} }).sort(), []);
Expand Down