Repository: 11ty/eleventy
Pull request #3227 (2024-03-22 15:19:12)

refactor: Group like modules into appropriate folders
I really wanted to get to know the Eleventy codebase better (see #3159). 

At first I just started looking around, but I kept having to spend mental energy reminding myself “this module is related to that one over there in that folder,” and so on.

I originally started moving files around simply in pursuit of exploring the codebase—with more of the related files grouped into directories for my own mental benefit while exploring.

But since Eleventy v3 is still in alpha, I thought that perhaps it might be an opportune time to turn my exploration into a Pull Request.

@zachleat: I am self-taught, and not as disciplined as I sometimes wish—but I do **love** this project! ❤️ If I naïvely changed something that offends your sensibilities, please know that that is the _last_ thing I want. But, on the off chance you find this helpful, then I have no way of knowing unless I tried. Thanks for Eleventy! 🙏🏽


Patch:
diff --git a/cmd.cjs b/cmd.cjs
index d5f0567f..bcc9ba43 100755
--- a/cmd.cjs
+++ b/cmd.cjs
@@ -19,8 +19,8 @@ require("please-upgrade-node")(pkg, {
 const debug = require("debug")("Eleventy:cmd");
 
 (async function () {
-	const { default: EleventyErrorHandler } = await import("./src/EleventyErrorHandler.js");
-	const { default: EleventyBaseError } = await import("./src/EleventyBaseError.js");
+	const { default: EleventyErrorHandler } = await import("./src/Errors/EleventyErrorHandler.js");
+	const { default: EleventyBaseError } = await import("./src/Errors/EleventyBaseError.js");
 
 	class EleventyCommandCheckError extends EleventyBaseError {}
 
diff --git a/src/Benchmark.js b/src/Benchmark/Benchmark.js
similarity index 100%
rename from src/Benchmark.js
rename to src/Benchmark/Benchmark.js
diff --git a/src/BenchmarkGroup.js b/src/Benchmark/BenchmarkGroup.js
similarity index 98%
rename from src/BenchmarkGroup.js
rename to src/Benchmark/BenchmarkGroup.js
index 0523b2f5..a857b1e3 100644
--- a/src/BenchmarkGroup.js
+++ b/src/Benchmark/BenchmarkGroup.js
@@ -1,6 +1,6 @@
 import debugUtil from "debug";
 
-import ConsoleLogger from "./Util/ConsoleLogger.js";
+import ConsoleLogger from "../Util/ConsoleLogger.js";
 import Benchmark from "./Benchmark.js";
 
 const debugBenchmark = debugUtil("Eleventy:Benchmark");
diff --git a/src/BenchmarkManager.js b/src/Benchmark/BenchmarkManager.js
similarity index 100%
rename from src/BenchmarkManager.js
rename to src/Benchmark/BenchmarkManager.js
diff --git a/src/ComputedData.js b/src/Data/ComputedData.js
similarity index 100%
rename from src/ComputedData.js
rename to src/Data/ComputedData.js
diff --git a/src/ComputedDataProxy.js b/src/Data/ComputedDataProxy.js
similarity index 100%
rename from src/ComputedDataProxy.js
rename to src/Data/ComputedDataProxy.js
diff --git a/src/ComputedDataQueue.js b/src/Data/ComputedDataQueue.js
similarity index 100%
rename from src/ComputedDataQueue.js
rename to src/Data/ComputedDataQueue.js
diff --git a/src/ComputedDataTemplateString.js b/src/Data/ComputedDataTemplateString.js
similarity index 100%
rename from src/ComputedDataTemplateString.js
rename to src/Data/ComputedDataTemplateString.js
diff --git a/src/TemplateData.js b/src/Data/TemplateData.js
similarity index 98%
rename from src/TemplateData.js
rename to src/Data/TemplateData.js
index ca33f535..66ecde1d 100644
--- a/src/TemplateData.js
+++ b/src/Data/TemplateData.js
@@ -6,13 +6,13 @@ import lodash from "@11ty/lodash-custom";
 import { TemplatePath, isPlainObject } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
-import merge from "./Util/Merge.js";
-import unique from "./Util/Unique.js";
-import TemplateGlob from "./TemplateGlob.js";
-import EleventyExtensionMap from "./EleventyExtensionMap.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import merge from "../Util/Merge.js";
+import unique from "../Util/Unique.js";
+import TemplateGlob from "../TemplateGlob.js";
+import EleventyExtensionMap from "../EleventyExtensionMap.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
 import TemplateDataInitialGlobalData from "./TemplateDataInitialGlobalData.js";
-import { EleventyImport, EleventyLoadContent } from "./Util/Require.js";
+import { EleventyImport, EleventyLoadContent } from "../Util/Require.js";
 
 const fsStatAsync = util.promisify(fs.stat);
 const { set: lodashSet, get: lodashGet } = lodash;
diff --git a/src/TemplateDataInitialGlobalData.js b/src/Data/TemplateDataInitialGlobalData.js
similarity index 89%
rename from src/TemplateDataInitialGlobalData.js
rename to src/Data/TemplateDataInitialGlobalData.js
index 6292f842..b7d634a3 100644
--- a/src/TemplateDataInitialGlobalData.js
+++ b/src/Data/TemplateDataInitialGlobalData.js
@@ -1,8 +1,8 @@
 import semver from "semver";
 import lodash from "@11ty/lodash-custom";
 
-import EleventyBaseError from "./EleventyBaseError.js";
-import { getEleventyPackageJson } from "./Util/ImportJsonSync.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
+import { getEleventyPackageJson } from "../Util/ImportJsonSync.js";
 
 const { set: lodashSet } = lodash;
 const pkg = getEleventyPackageJson();
diff --git a/src/Eleventy.js b/src/Eleventy.js
index 837e9957..5ee4a92f 100644
--- a/src/Eleventy.js
+++ b/src/Eleventy.js
@@ -2,11 +2,11 @@ import { performance } from "node:perf_hooks";
 import { TemplatePath } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
-import TemplateData from "./TemplateData.js";
+import TemplateData from "./Data/TemplateData.js";
 import TemplateWriter from "./TemplateWriter.js";
 import EleventyExtensionMap from "./EleventyExtensionMap.js";
-import EleventyErrorHandler from "./EleventyErrorHandler.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyErrorHandler from "./Errors/EleventyErrorHandler.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import EleventyServe from "./EleventyServe.js";
 import EleventyWatch from "./EleventyWatch.js";
 import EleventyWatchTargets from "./EleventyWatchTargets.js";
diff --git a/src/EleventyExtensionMap.js b/src/EleventyExtensionMap.js
index 38e49df1..1d744b0d 100644
--- a/src/EleventyExtensionMap.js
+++ b/src/EleventyExtensionMap.js
@@ -1,7 +1,7 @@
 import { TemplatePath } from "@11ty/eleventy-utils";
 
-import TemplateEngineManager from "./TemplateEngineManager.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import TemplateEngineManager from "./Engines/TemplateEngineManager.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 
 class EleventyExtensionMapConfigError extends EleventyBaseError {}
 
diff --git a/src/EleventyFiles.js b/src/EleventyFiles.js
index e6275a99..da1571e8 100644
--- a/src/EleventyFiles.js
+++ b/src/EleventyFiles.js
@@ -4,10 +4,10 @@ import { TemplatePath } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
 import EleventyExtensionMap from "./EleventyExtensionMap.js";
-import TemplateData from "./TemplateData.js";
+import TemplateData from "./Data/TemplateData.js";
 import TemplateGlob from "./TemplateGlob.js";
 import TemplatePassthroughManager from "./TemplatePassthroughManager.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import checkPassthroughCopyBehavior from "./Util/PassthroughCopyBehaviorCheck.js";
 
 const debug = debugUtil("Eleventy:EleventyFiles");
diff --git a/src/EleventyServe.js b/src/EleventyServe.js
index 0a48cf65..b0fb3fea 100644
--- a/src/EleventyServe.js
+++ b/src/EleventyServe.js
@@ -2,7 +2,7 @@ import { TemplatePath } from "@11ty/eleventy-utils";
 import EleventyDevServer from "@11ty/eleventy-dev-server";
 import debugUtil from "debug";
 
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import ConsoleLogger from "./Util/ConsoleLogger.js";
 import PathPrefixer from "./Util/PathPrefixer.js";
 import merge from "./Util/Merge.js";
diff --git a/src/Engines/JavaScript.js b/src/Engines/JavaScript.js
index 22fd31ac..51a497c9 100644
--- a/src/Engines/JavaScript.js
+++ b/src/Engines/JavaScript.js
@@ -1,7 +1,7 @@
 import { TemplatePath } from "@11ty/eleventy-utils";
 
 import TemplateEngine from "./TemplateEngine.js";
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
 import getJavaScriptData from "../Util/GetJavaScriptData.js";
 import EventBusUtil from "../Util/EventBusUtil.js";
 import { EleventyImport } from "../Util/Require.js";
diff --git a/src/Engines/Nunjucks.js b/src/Engines/Nunjucks.js
index 762be9d8..00c247d2 100755
--- a/src/Engines/Nunjucks.js
+++ b/src/Engines/Nunjucks.js
@@ -2,8 +2,8 @@ import NunjucksLib from "nunjucks";
 import { TemplatePath } from "@11ty/eleventy-utils";
 
 import TemplateEngine from "./TemplateEngine.js";
-import EleventyErrorUtil from "../EleventyErrorUtil.js";
-import EleventyShortcodeError from "../EleventyShortcodeError.js";
+import EleventyErrorUtil from "../Errors/EleventyErrorUtil.js";
+import EleventyShortcodeError from "../Errors/EleventyShortcodeError.js";
 import EventBusUtil from "../Util/EventBusUtil.js";
 
 class Nunjucks extends TemplateEngine {
diff --git a/src/Engines/TemplateEngine.js b/src/Engines/TemplateEngine.js
index faa17303..b5067199 100644
--- a/src/Engines/TemplateEngine.js
+++ b/src/Engines/TemplateEngine.js
@@ -1,5 +1,5 @@
 import EleventyExtensionMap from "../EleventyExtensionMap.js";
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
 
 class TemplateEngineConfigError extends EleventyBaseError {}
 
diff --git a/src/TemplateEngineManager.js b/src/Engines/TemplateEngineManager.js
similarity index 94%
rename from src/TemplateEngineManager.js
rename to src/Engines/TemplateEngineManager.js
index 3f1c231a..aa2e08d3 100644
--- a/src/TemplateEngineManager.js
+++ b/src/Engines/TemplateEngineManager.js
@@ -1,5 +1,5 @@
-import EleventyBaseError from "./EleventyBaseError.js";
-import { EleventyImportFromEleventy } from "./Util/Require.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
+import { EleventyImportFromEleventy } from "../Util/Require.js";
 
 class TemplateEngineManagerConfigError extends EleventyBaseError {}
 
@@ -122,8 +122,8 @@ class TemplateEngineManager {
 			this.getClassNameFromTemplateKey(name) === "Custom" &&
 			instance.constructor.name !== "CustomEngine"
 		) {
-			const CustomEngine = await this.getCustomEngineClass();
-			const overrideCustomEngine = new CustomEngine(name, dirs, this.eleventyConfig);
+			let CustomEngine = await this.getCustomEngineClass();
+			let overrideCustomEngine = new CustomEngine(name, dirs, this.eleventyConfig);
 			// Keep track of the "default" engine 11ty would normally use
 			// This allows the user to access the default engine in their override
 			overrideCustomEngine.setDefaultEngine(instance);
diff --git a/src/EleventyBaseError.js b/src/Errors/EleventyBaseError.js
similarity index 100%
rename from src/EleventyBaseError.js
rename to src/Errors/EleventyBaseError.js
diff --git a/src/EleventyErrorHandler.js b/src/Errors/EleventyErrorHandler.js
similarity index 97%
rename from src/EleventyErrorHandler.js
rename to src/Errors/EleventyErrorHandler.js
index 52858109..54a7a64a 100644
--- a/src/EleventyErrorHandler.js
+++ b/src/Errors/EleventyErrorHandler.js
@@ -1,6 +1,6 @@
 import debugUtil from "debug";
 
-import ConsoleLogger from "./Util/ConsoleLogger.js";
+import ConsoleLogger from "../Util/ConsoleLogger.js";
 import EleventyErrorUtil from "./EleventyErrorUtil.js";
 
 const debug = debugUtil("Eleventy:EleventyErrorHandler");
diff --git a/src/EleventyErrorUtil.js b/src/Errors/EleventyErrorUtil.js
similarity index 95%
rename from src/EleventyErrorUtil.js
rename to src/Errors/EleventyErrorUtil.js
index a0cad913..e4f9e29b 100644
--- a/src/EleventyErrorUtil.js
+++ b/src/Errors/EleventyErrorUtil.js
@@ -1,4 +1,4 @@
-import TemplateContentPrematureUseError from "./Errors/TemplateContentPrematureUseError.js";
+import TemplateContentPrematureUseError from "./TemplateContentPrematureUseError.js";
 
 /* Hack to workaround the variety of error handling schemes in template languages */
 class EleventyErrorUtil {
diff --git a/src/EleventyShortcodeError.js b/src/Errors/EleventyShortcodeError.js
similarity index 100%
rename from src/EleventyShortcodeError.js
rename to src/Errors/EleventyShortcodeError.js
diff --git a/src/Errors/TemplateContentPrematureUseError.js b/src/Errors/TemplateContentPrematureUseError.js
index e7fcc2e1..5266cd27 100644
--- a/src/Errors/TemplateContentPrematureUseError.js
+++ b/src/Errors/TemplateContentPrematureUseError.js
@@ -1,4 +1,4 @@
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "./EleventyBaseError.js";
 
 class TemplateContentPrematureUseError extends EleventyBaseError {}
 
diff --git a/src/Errors/TemplateContentUnrenderedTemplateError.js b/src/Errors/TemplateContentUnrenderedTemplateError.js
index ee1dff1a..ee270d5d 100644
--- a/src/Errors/TemplateContentUnrenderedTemplateError.js
+++ b/src/Errors/TemplateContentUnrenderedTemplateError.js
@@ -1,4 +1,4 @@
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "./EleventyBaseError.js";
 
 class TemplateContentUnrenderedTemplateError extends EleventyBaseError {}
 
diff --git a/src/Errors/UsingCircularTemplateContentReferenceError.js b/src/Errors/UsingCircularTemplateContentReferenceError.js
index e9729aac..5608febb 100644
--- a/src/Errors/UsingCircularTemplateContentReferenceError.js
+++ b/src/Errors/UsingCircularTemplateContentReferenceError.js
@@ -1,4 +1,4 @@
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "./EleventyBaseError.js";
 
 class UsingCircularTemplateContentReferenceError extends EleventyBaseError {}
 
diff --git a/src/Plugins/Pagination.js b/src/Plugins/Pagination.js
index 5b12cf42..927afa9d 100755
--- a/src/Plugins/Pagination.js
+++ b/src/Plugins/Pagination.js
@@ -1,11 +1,11 @@
 import { isPlainObject } from "@11ty/eleventy-utils";
 import lodash from "@11ty/lodash-custom";
 
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
 import { DeepCopy } from "../Util/Merge.js";
 import { ProxyWrap } from "../Util/ProxyWrap.js";
 // import { DeepFreeze } from "../Util/DeepFreeze.js";
-import TemplateData from "../TemplateData.js";
+import TemplateData from "../Data/TemplateData.js";
 
 const { set: lodashSet, get: lodashGet, chunk: lodashChunk } = lodash;
 
diff --git a/src/Plugins/RenderPlugin.js b/src/Plugins/RenderPlugin.js
index cf4d6532..4a87ec85 100644
--- a/src/Plugins/RenderPlugin.js
+++ b/src/Plugins/RenderPlugin.js
@@ -9,11 +9,11 @@ const fsExists = util.promisify(fs.exists);
 
 import Merge from "../Util/Merge.js";
 import { ProxyWrap } from "../Util/ProxyWrap.js";
-import TemplateDataInitialGlobalData from "../TemplateDataInitialGlobalData.js";
-import EleventyShortcodeError from "../EleventyShortcodeError.js";
+import TemplateDataInitialGlobalData from "../Data/TemplateDataInitialGlobalData.js";
+import EleventyShortcodeError from "../Errors/EleventyShortcodeError.js";
 import TemplateRender from "../TemplateRender.js";
 import TemplateConfig from "../TemplateConfig.js";
-import EleventyErrorUtil from "../EleventyErrorUtil.js";
+import EleventyErrorUtil from "../Errors/EleventyErrorUtil.js";
 import Liquid from "../Engines/Liquid.js";
 
 async function compile(content, templateLang, { templateConfig, extensionMap } = {}) {
diff --git a/src/Template.js b/src/Template.js
index 90887282..6aebd2ab 100755
--- a/src/Template.js
+++ b/src/Template.js
@@ -12,17 +12,17 @@ import debugUtil from "debug";
 import ConsoleLogger from "./Util/ConsoleLogger.js";
 import getDateFromGitLastUpdated from "./Util/DateGitLastUpdated.js";
 import getDateFromGitFirstAdded from "./Util/DateGitFirstAdded.js";
-import TemplateData from "./TemplateData.js";
+import TemplateData from "./Data/TemplateData.js";
 import TemplateContent from "./TemplateContent.js";
 import TemplatePermalink from "./TemplatePermalink.js";
 import TemplateLayout from "./TemplateLayout.js";
 import TemplateFileSlug from "./TemplateFileSlug.js";
-import ComputedData from "./ComputedData.js";
+import ComputedData from "./Data/ComputedData.js";
 import Pagination from "./Plugins/Pagination.js";
 import TemplateBehavior from "./TemplateBehavior.js";
 import TemplateContentPrematureUseError from "./Errors/TemplateContentPrematureUseError.js";
 import TemplateContentUnrenderedTemplateError from "./Errors/TemplateContentUnrenderedTemplateError.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 
 const { set: lodashSet, get: lodashGet } = lodash;
 const writeFile = util.promisify(fs.writeFile);
diff --git a/src/TemplateCollection.js b/src/TemplateCollection.js
index 889bd7f2..edee1717 100755
--- a/src/TemplateCollection.js
+++ b/src/TemplateCollection.js
@@ -2,7 +2,7 @@ import multimatch from "multimatch";
 import { TemplatePath } from "@11ty/eleventy-utils";
 
 import Sortable from "./Util/Sortable.js";
-import TemplateData from "./TemplateData.js";
+import TemplateData from "./Data/TemplateData.js";
 
 class TemplateCollection extends Sortable {
 	constructor() {
diff --git a/src/TemplateConfig.js b/src/TemplateConfig.js
index 3b5c445b..2b4578d5 100644
--- a/src/TemplateConfig.js
+++ b/src/TemplateConfig.js
@@ -4,7 +4,7 @@ import { TemplatePath } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
 import { EleventyImport, EleventyImportFromEleventy } from "./Util/Require.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import UserConfig from "./UserConfig.js";
 import GlobalDependencyMap from "./GlobalDependencyMap.js";
 import ExistsCache from "./Util/ExistsCache.js";
diff --git a/src/TemplateContent.js b/src/TemplateContent.js
index 6af9404c..ee15bcce 100644
--- a/src/TemplateContent.js
+++ b/src/TemplateContent.js
@@ -9,10 +9,10 @@ import { TemplatePath } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
 import EleventyExtensionMap from "./EleventyExtensionMap.js";
-import TemplateData from "./TemplateData.js";
+import TemplateData from "./Data/TemplateData.js";
 import TemplateRender from "./TemplateRender.js";
-import EleventyBaseError from "./EleventyBaseError.js";
-import EleventyErrorUtil from "./EleventyErrorUtil.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
+import EleventyErrorUtil from "./Errors/EleventyErrorUtil.js";
 import eventBus from "./EventBus.js";
 
 const { set: lodashSet } = lodash;
diff --git a/src/TemplateLayout.js b/src/TemplateLayout.js
index 4fe7f809..8c817d93 100644
--- a/src/TemplateLayout.js
+++ b/src/TemplateLayout.js
@@ -3,7 +3,7 @@ import debugUtil from "debug";
 
 import TemplateLayoutPathResolver from "./TemplateLayoutPathResolver.js";
 import TemplateContent from "./TemplateContent.js";
-import TemplateData from "./TemplateData.js";
+import TemplateData from "./Data/TemplateData.js";
 import templateCache from "./TemplateCache.js";
 
 // const debug = debugUtil("Eleventy:TemplateLayout");
diff --git a/src/TemplateMap.js b/src/TemplateMap.js
index 93442fab..b3dc23c9 100644
--- a/src/TemplateMap.js
+++ b/src/TemplateMap.js
@@ -5,10 +5,10 @@ import { isPlainObject } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
 import TemplateCollection from "./TemplateCollection.js";
-import EleventyErrorUtil from "./EleventyErrorUtil.js";
+import EleventyErrorUtil from "./Errors/EleventyErrorUtil.js";
 import UsingCircularTemplateContentReferenceError from "./Errors/UsingCircularTemplateContentReferenceError.js";
-import EleventyBaseError from "./EleventyBaseError.js";
-import TemplateData from "./TemplateData.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
+import TemplateData from "./Data/TemplateData.js";
 
 const debug = debugUtil("Eleventy:TemplateMap");
 const debugDev = debugUtil("Dev:Eleventy:TemplateMap");
diff --git a/src/TemplatePassthrough.js b/src/TemplatePassthrough.js
index f11f0b19..22403107 100644
--- a/src/TemplatePassthrough.js
+++ b/src/TemplatePassthrough.js
@@ -7,7 +7,7 @@ import copy from "recursive-copy";
 import { TemplatePath } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import checkPassthroughCopyBehavior from "./Util/PassthroughCopyBehaviorCheck.js";
 
 const fsStat = util.promisify(fs.stat);
diff --git a/src/TemplatePassthroughManager.js b/src/TemplatePassthroughManager.js
index 1f48a9d5..d45b3a16 100644
--- a/src/TemplatePassthroughManager.js
+++ b/src/TemplatePassthroughManager.js
@@ -4,7 +4,7 @@ import { TemplatePath } from "@11ty/eleventy-utils";
 import debugUtil from "debug";
 
 import EleventyExtensionMap from "./EleventyExtensionMap.js";
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import TemplatePassthrough from "./TemplatePassthrough.js";
 import checkPassthroughCopyBehavior from "./Util/PassthroughCopyBehaviorCheck.js";
 
diff --git a/src/TemplateRender.js b/src/TemplateRender.js
index c712c83d..fc2e7a3c 100644
--- a/src/TemplateRender.js
+++ b/src/TemplateRender.js
@@ -1,6 +1,6 @@
 import { TemplatePath } from "@11ty/eleventy-utils";
 
-import EleventyBaseError from "./EleventyBaseError.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
 import EleventyExtensionMap from "./EleventyExtensionMap.js";
 import CustomEngine from "./Engines/Custom.js";
 
diff --git a/src/TemplateWriter.js b/src/TemplateWriter.js
index 5843eaa4..f512beaa 100755
--- a/src/TemplateWriter.js
+++ b/src/TemplateWriter.js
@@ -5,9 +5,9 @@ import Template from "./Template.js";
 import TemplateMap from "./TemplateMap.js";
 import EleventyFiles from "./EleventyFiles.js";
 import EleventyExtensionMap from "./EleventyExtensionMap.js";
-import EleventyBaseError from "./EleventyBaseError.js";
-import EleventyErrorHandler from "./EleventyErrorHandler.js";
-import EleventyErrorUtil from "./EleventyErrorUtil.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
+import EleventyErrorHandler from "./Errors/EleventyErrorHandler.js";
+import EleventyErrorUtil from "./Errors/EleventyErrorUtil.js";
 import FileSystemSearch from "./FileSystemSearch.js";
 import ConsoleLogger from "./Util/ConsoleLogger.js";
 
diff --git a/src/UserConfig.js b/src/UserConfig.js
index 0aa868ff..43e940a8 100644
--- a/src/UserConfig.js
+++ b/src/UserConfig.js
@@ -5,8 +5,8 @@ import { RetrieveGlobals } from "node-retrieve-globals";
 
 import EventEmitter from "./Util/AsyncEventEmitter.js";
 import EleventyCompatibility from "./Util/Compatibility.js";
-import EleventyBaseError from "./EleventyBaseError.js";
-import BenchmarkManager from "./BenchmarkManager.js";
+import EleventyBaseError from "./Errors/EleventyBaseError.js";
+import BenchmarkManager from "./Benchmark/BenchmarkManager.js";
 import { DeepCopy } from "./Util/Merge.js";
 
 const debug = debugUtil("Eleventy:UserConfig");
diff --git a/src/Util/GetJavaScriptData.js b/src/Util/GetJavaScriptData.js
index 275f3319..7d72a64f 100644
--- a/src/Util/GetJavaScriptData.js
+++ b/src/Util/GetJavaScriptData.js
@@ -1,4 +1,4 @@
-import EleventyBaseError from "../EleventyBaseError.js";
+import EleventyBaseError from "../Errors/EleventyBaseError.js";
 
 class JavaScriptInvalidDataFormatError extends EleventyBaseError {}
 


Test patch:
diff --git a/test/BenchmarkTest.js b/test/BenchmarkTest.js
index 3e97659c..f07f8ed2 100644
--- a/test/BenchmarkTest.js
+++ b/test/BenchmarkTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import Benchmark from "../src/Benchmark.js";
+import Benchmark from "../src/Benchmark/Benchmark.js";
 
 test("Standard Benchmark", async (t) => {
   await new Promise((resolve) => {
diff --git a/test/ComputedDataProxyTest.js b/test/ComputedDataProxyTest.js
index 53c507d0..4ee4add1 100644
--- a/test/ComputedDataProxyTest.js
+++ b/test/ComputedDataProxyTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import ComputedDataProxy from "../src/ComputedDataProxy.js";
+import ComputedDataProxy from "../src/Data/ComputedDataProxy.js";
 
 test("Get vars used by function", async (t) => {
   let cd = new ComputedDataProxy(["key1"]);
diff --git a/test/ComputedDataQueueTest.js b/test/ComputedDataQueueTest.js
index 37980bdd..ad9ca74f 100644
--- a/test/ComputedDataQueueTest.js
+++ b/test/ComputedDataQueueTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import ComputedDataQueue from "../src/ComputedDataQueue.js";
+import ComputedDataQueue from "../src/Data/ComputedDataQueue.js";
 
 test("Standard uses", (t) => {
   let queue = new ComputedDataQueue();
diff --git a/test/ComputedDataTemplateStringTest.js b/test/ComputedDataTemplateStringTest.js
index 0e3d3011..6b8e3fe4 100644
--- a/test/ComputedDataTemplateStringTest.js
+++ b/test/ComputedDataTemplateStringTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import ComputedDataTemplateString from "../src/ComputedDataTemplateString.js";
+import ComputedDataTemplateString from "../src/Data/ComputedDataTemplateString.js";
 
 test("Get fake proxy data", (t) => {
   let cd = new ComputedDataTemplateString(["key1", "key2"]);
diff --git a/test/ComputedDataTest.js b/test/ComputedDataTest.js
index c9e647df..121fda91 100644
--- a/test/ComputedDataTest.js
+++ b/test/ComputedDataTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import ComputedData from "../src/ComputedData.js";
+import ComputedData from "../src/Data/ComputedData.js";
 import TemplateConfig from "../src/TemplateConfig.js";
 
 test("Basic get/set", async (t) => {
diff --git a/test/EleventyErrorHandlerTest.js b/test/EleventyErrorHandlerTest.js
index 2e1c455d..e2e050a5 100644
--- a/test/EleventyErrorHandlerTest.js
+++ b/test/EleventyErrorHandlerTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import EleventyErrorHandler from "../src/EleventyErrorHandler.js";
+import EleventyErrorHandler from "../src/Errors/EleventyErrorHandler.js";
 
 test("Log a warning, warning", (t) => {
   let errorHandler = new EleventyErrorHandler();
diff --git a/test/EleventyErrorUtilTest.js b/test/EleventyErrorUtilTest.js
index a3a77e51..34728abd 100644
--- a/test/EleventyErrorUtilTest.js
+++ b/test/EleventyErrorUtilTest.js
@@ -1,5 +1,5 @@
 import test from "ava";
-import EleventyErrorUtil from "../src/EleventyErrorUtil.js";
+import EleventyErrorUtil from "../src/Errors/EleventyErrorUtil.js";
 
 const SAMPLE_ERROR = new Error("Nothing to see here");
 
diff --git a/test/PaginationTest.js b/test/PaginationTest.js
index b816b218..6f1fcfda 100644
--- a/test/PaginationTest.js
+++ b/test/PaginationTest.js
@@ -1,7 +1,7 @@
 import test from "ava";
 import slugify from "slugify";
 
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import Pagination from "../src/Plugins/Pagination.js";
 import TemplateConfig from "../src/TemplateConfig.js";
 import FileSystemSearch from "../src/FileSystemSearch.js";
diff --git a/test/TemplateDataTest.js b/test/TemplateDataTest.js
index 061577c8..8a21237c 100644
--- a/test/TemplateDataTest.js
+++ b/test/TemplateDataTest.js
@@ -2,7 +2,7 @@ import test from "ava";
 import semver from "semver";
 import { createRequire } from "module";
 
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import TemplateConfig from "../src/TemplateConfig.js";
 import FileSystemSearch from "../src/FileSystemSearch.js";
 
diff --git a/test/TemplateEngineManagerTest.js b/test/TemplateEngineManagerTest.js
index beb5be7f..db0697f7 100644
--- a/test/TemplateEngineManagerTest.js
+++ b/test/TemplateEngineManagerTest.js
@@ -1,6 +1,6 @@
 import test from "ava";
 
-import TemplateEngineManager from "../src/TemplateEngineManager.js";
+import TemplateEngineManager from "../src/Engines/TemplateEngineManager.js";
 import TemplateConfig from "../src/TemplateConfig.js";
 
 test("Unsupported engine", async (t) => {
diff --git a/test/TemplateMapTest-ComputedData.js b/test/TemplateMapTest-ComputedData.js
index 7c296cd6..750b7a56 100644
--- a/test/TemplateMapTest-ComputedData.js
+++ b/test/TemplateMapTest-ComputedData.js
@@ -1,7 +1,7 @@
 import test from "ava";
 
 import TemplateConfig from "../src/TemplateConfig.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import TemplateMap from "../src/TemplateMap.js";
 import getNewTemplate from "./_getNewTemplateForTests.js";
 
diff --git a/test/TemplateTest-CompileOptions.js b/test/TemplateTest-CompileOptions.js
index d2a85c19..24178a88 100644
--- a/test/TemplateTest-CompileOptions.js
+++ b/test/TemplateTest-CompileOptions.js
@@ -1,7 +1,7 @@
 import test from "ava";
 
 import TemplateConfig from "../src/TemplateConfig.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import getNewTemplate from "./_getNewTemplateForTests.js";
 import { renderTemplate } from "./_getRenderedTemplates.js";
 
diff --git a/test/TemplateTest-ComputedData.js b/test/TemplateTest-ComputedData.js
index 8968a0be..c7ba19da 100644
--- a/test/TemplateTest-ComputedData.js
+++ b/test/TemplateTest-ComputedData.js
@@ -1,6 +1,6 @@
 import test from "ava";
 
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import TemplateConfig from "../src/TemplateConfig.js";
 import getNewTemplate from "./_getNewTemplateForTests.js";
 import { renderTemplate } from "./_getRenderedTemplates.js";
diff --git a/test/TemplateTest-CustomExtensions.js b/test/TemplateTest-CustomExtensions.js
index 49c5402f..4e65bd53 100644
--- a/test/TemplateTest-CustomExtensions.js
+++ b/test/TemplateTest-CustomExtensions.js
@@ -2,7 +2,7 @@ import test from "ava";
 import { marked } from "marked";
 
 import TemplateConfig from "../src/TemplateConfig.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import getNewTemplate from "./_getNewTemplateForTests.js";
 import { renderTemplate } from "./_getRenderedTemplates.js";
 
diff --git a/test/TemplateTest-DataCascade.js b/test/TemplateTest-DataCascade.js
index b085f77f..2bb0a823 100644
--- a/test/TemplateTest-DataCascade.js
+++ b/test/TemplateTest-DataCascade.js
@@ -1,7 +1,7 @@
 import test from "ava";
 
 import TemplateConfig from "../src/TemplateConfig.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import getNewTemplate from "./_getNewTemplateForTests.js";
 
 // Prior to and including 0.10.0 this mismatched the documentation)! (Issue #915)
diff --git a/test/TemplateTest.js b/test/TemplateTest.js
index 9c6a3a24..ff0c6762 100644
--- a/test/TemplateTest.js
+++ b/test/TemplateTest.js
@@ -4,10 +4,10 @@ import pretty from "pretty";
 import TOML from "@iarna/toml";
 
 import TemplateConfig from "../src/TemplateConfig.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import FileSystemSearch from "../src/FileSystemSearch.js";
 import EleventyExtensionMap from "../src/EleventyExtensionMap.js";
-import EleventyErrorUtil from "../src/EleventyErrorUtil.js";
+import EleventyErrorUtil from "../src/Errors/EleventyErrorUtil.js";
 import TemplateContentPrematureUseError from "../src/Errors/TemplateContentPrematureUseError.js";
 import { normalizeNewLines } from "./Util/normalizeNewLines.js";
 import eventBus from "../src/EventBus.js";
diff --git a/test/TemplateTest_Permalink.js b/test/TemplateTest_Permalink.js
index c0217d4f..da158738 100644
--- a/test/TemplateTest_Permalink.js
+++ b/test/TemplateTest_Permalink.js
@@ -2,7 +2,7 @@ import test from "ava";
 import fs from "fs";
 
 import TemplateConfig from "../src/TemplateConfig.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 import getNewTemplate from "./_getNewTemplateForTests.js";
 
 async function writeMapEntries(mapEntries) {
diff --git a/test/UserDataExtensionsTest.js b/test/UserDataExtensionsTest.js
index a2952ba6..0ca00921 100644
--- a/test/UserDataExtensionsTest.js
+++ b/test/UserDataExtensionsTest.js
@@ -4,7 +4,7 @@ import yaml from "js-yaml";
 
 import TemplateConfig from "../src/TemplateConfig.js";
 import FileSystemSearch from "../src/FileSystemSearch.js";
-import TemplateData from "../src/TemplateData.js";
+import TemplateData from "../src/Data/TemplateData.js";
 
 test("Local data", async (t) => {
   let eleventyConfig = new TemplateConfig();