Skip to content

Commit 5d253ff

Browse files
committed
remove long deprecated code
1 parent de2497a commit 5d253ff

11 files changed

+9
-53
lines changed

src/Data/TemplateData.js

-9
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ class TemplateData {
5858
return this.dirs.data;
5959
}
6060

61-
// This was async in 2.0 and prior but doesn’t need to be any more.
62-
getInputDir() {
63-
return this.dirs.input;
64-
}
65-
66-
getDataDir() {
67-
return this.dataDir;
68-
}
69-
7061
exists(pathname) {
7162
// It's common for data files not to exist, so we avoid going to the FS to
7263
// re-check if they do via a quick-and-dirty cache.

src/Eleventy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ Arguments:
978978
return (
979979
path.endsWith(".css") &&
980980
// TODO how to make this work with relative includes?
981-
!TemplatePath.startsWithSubPath(path, this.eleventyFiles.getIncludesDir())
981+
!TemplatePath.startsWithSubPath(path, this.eleventyFiles?.includesDir)
982982
);
983983
});
984984

@@ -1106,7 +1106,7 @@ Arguments:
11061106
return;
11071107
}
11081108

1109-
let dataDir = TemplatePath.stripLeadingDotSlash(this.templateData.getDataDir());
1109+
let dataDir = TemplatePath.stripLeadingDotSlash(this.templateData?.dataDir);
11101110
function filterOutGlobalDataFiles(path) {
11111111
return !dataDir || !TemplatePath.stripLeadingDotSlash(path).startsWith(dataDir);
11121112
}

src/EleventyFiles.js

-15
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ class EleventyFiles {
4949
return this.dirs.data;
5050
}
5151

52-
// Backwards compat
53-
getDataDir() {
54-
return this.dataDir;
55-
}
56-
5752
setFileSystemSearch(fileSystemSearch) {
5853
this.fileSystemSearch = fileSystemSearch;
5954
}
@@ -292,16 +287,6 @@ class EleventyFiles {
292287
return Array.from(ignoreFiles);
293288
}
294289

295-
/* Backwards compat */
296-
getIncludesDir() {
297-
return this.includesDir;
298-
}
299-
300-
/* Backwards compat */
301-
getLayoutsDir() {
302-
return this.layoutsDir;
303-
}
304-
305290
getFileGlobs() {
306291
return this.normalizedTemplateGlobs;
307292
}

src/Engines/Nunjucks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class Nunjucks extends TemplateEngine {
3737

3838
#getFileSystemDirs() {
3939
let paths = new Set();
40-
paths.add(super.getIncludesDir());
40+
paths.add(super.includesDir);
4141
paths.add(TemplatePath.getWorkingDir());
4242

4343
// Filter out undefined paths

src/Engines/TemplateEngine.js

-5
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ export default class TemplateEngine {
8585
return this.name;
8686
}
8787

88-
// Backwards compat
89-
getIncludesDir() {
90-
return this.includesDir;
91-
}
92-
9388
/**
9489
* @protected
9590
*/

src/TemplateContent.js

-4
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ class TemplateContent {
174174
return this.inputPath;
175175
}
176176

177-
getInputDir() {
178-
return this.inputDir;
179-
}
180-
181177
isVirtualTemplate() {
182178
let def = this.getVirtualTemplateDefinition();
183179
return !!def;

src/TemplateLayoutPathResolver.js

-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fs from "node:fs";
21
import { TemplatePath } from "@11ty/eleventy-utils";
32
// import debugUtil from "debug";
43
// const debug = debugUtil("Eleventy:TemplateLayoutPathResolver");
@@ -43,11 +42,6 @@ class TemplateLayoutPathResolver {
4342
return this.dirs.layouts || this.dirs.includes;
4443
}
4544

46-
/* Backwards compat */
47-
getLayoutsDir() {
48-
return this.layoutsDir;
49-
}
50-
5145
setAliases() {
5246
this.aliases = Object.assign({}, this.config.layoutAliases, this.aliases);
5347
}

src/TemplateRender.js

-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ class TemplateRender {
4444
return this.dirs.includes;
4545
}
4646

47-
/* Backwards compat */
48-
getIncludesDir() {
49-
return this.includesDir;
50-
}
51-
5247
get config() {
5348
return this.#config;
5449
}

src/UserConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ class UserConfig {
445445
* langs?: string[],
446446
* async?: boolean
447447
* }} [options] - Options for the filter
448-
* If `async` is undefined, it attempt to be determined.
448+
* If `async` is undefined, it will be inferred, possibly incorrectly.
449449
* @returns
450450
*/
451451
addFilter(name, callback, options) {

test/EleventyFilesTest.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test("Dirs paths", async (t) => {
2323

2424
t.deepEqual(evf.inputDir, "./src/");
2525
t.deepEqual(evf.includesDir, "./src/includes/");
26-
t.deepEqual(evf.getDataDir(), "./src/data/");
26+
t.deepEqual(evf.dataDir, "./src/data/");
2727
t.deepEqual(evf.outputDir, "./dist/");
2828
});
2929

@@ -41,7 +41,7 @@ test("Dirs paths (relative)", async (t) => {
4141

4242
t.deepEqual(evf.inputDir, "./src/");
4343
t.deepEqual(evf.includesDir, "./includes/");
44-
t.deepEqual(evf.getDataDir(), "./data/");
44+
t.deepEqual(evf.dataDir, "./data/");
4545
t.deepEqual(evf.outputDir, "./dist/");
4646
});
4747

@@ -260,7 +260,7 @@ test("getDataDir", async (t) => {
260260

261261
let { eleventyFiles: evf } = getEleventyFilesInstance([], eleventyConfig);
262262
evf.init();
263-
t.is(evf.getDataDir(), "./_data/");
263+
t.is(evf.dataDir, "./_data/");
264264
});
265265

266266
test("getDataDir subdir", async (t) => {
@@ -272,7 +272,7 @@ test("getDataDir subdir", async (t) => {
272272

273273
let { eleventyFiles: evf } = getEleventyFilesInstance([], eleventyConfig);
274274
evf.init();
275-
t.is(evf.getDataDir(), "./test/stubs/_data/");
275+
t.is(evf.dataDir, "./test/stubs/_data/");
276276
});
277277

278278
test("Include and Data Dirs", async (t) => {

test/TemplateRenderTest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test("Basic", async (t) => {
3030

3131
test("Includes Dir", async (t) => {
3232
let tr = await getNewTemplateRender("liquid", "./test/stubs");
33-
t.is(tr.getIncludesDir(), "./test/stubs/_includes/");
33+
t.is(tr.includesDir, "./test/stubs/_includes/");
3434
});
3535

3636
test("Invalid override", async (t) => {

0 commit comments

Comments
 (0)