@11ty/client 4.0.0-alpha.6 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{eleventy.js → core-fs.js} +12780 -7937
- package/dist/{eleventy.core.js → core-minimal.js} +2594 -1839
- package/dist/formats/{eleventy-liquid.js → liquid.js} +569 -133
- package/dist/formats/{eleventy-markdown.js → markdown.js} +486 -115
- package/dist/formats/{eleventy-nunjucks.js → nunjucks.js} +339 -59
- package/dist/plugins/{eleventy-plugin-i18n.js → plugin-i18n.js} +33 -8
- package/package.json +16 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy (Build Awesome) v4.0.0-alpha.8 (@11ty/client/njk Engine Bundle) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -12,11 +12,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
12
12
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
13
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
14
|
});
|
|
15
|
-
var __esm = (fn, res) => function __init() {
|
|
16
|
-
|
|
15
|
+
var __esm = (fn, res, err) => function __init() {
|
|
16
|
+
if (err) throw err[0];
|
|
17
|
+
try {
|
|
18
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw err = [e], e;
|
|
21
|
+
}
|
|
17
22
|
};
|
|
18
23
|
var __commonJS = (cb, mod) => function __require2() {
|
|
19
|
-
|
|
24
|
+
try {
|
|
25
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw mod = 0, e;
|
|
28
|
+
}
|
|
20
29
|
};
|
|
21
30
|
var __export = (target, all) => {
|
|
22
31
|
for (var name in all)
|
|
@@ -959,10 +968,15 @@ __export(shim_consume_fs_exports, {
|
|
|
959
968
|
promises: () => promises,
|
|
960
969
|
readFileSync: () => readFileSync,
|
|
961
970
|
readSync: () => readSync,
|
|
971
|
+
readdir: () => readdir,
|
|
972
|
+
readdirSync: () => readdirSync,
|
|
973
|
+
realpath: () => realpath,
|
|
974
|
+
realpathSync: () => realpathSync,
|
|
975
|
+
stat: () => stat,
|
|
962
976
|
statSync: () => statSync,
|
|
963
977
|
writeFileSync: () => writeFileSync
|
|
964
978
|
});
|
|
965
|
-
var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, writeFileSync, promises, readSync, fstatSync, closeSync, openSync, shim_consume_fs_default;
|
|
979
|
+
var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, writeFileSync, promises, readSync, fstatSync, closeSync, openSync, readdir, readdirSync, realpath, realpathSync, stat, shim_consume_fs_default;
|
|
966
980
|
var init_shim_consume_fs = __esm({
|
|
967
981
|
"../../node_modules/@11ty/package-bundler/shims/shim-consume-fs.js"() {
|
|
968
982
|
GLOBAL_FS_NAME = "eleventyFileSystem";
|
|
@@ -984,7 +998,13 @@ var init_shim_consume_fs = __esm({
|
|
|
984
998
|
readSync: noopError,
|
|
985
999
|
fstatSync: noopError,
|
|
986
1000
|
closeSync: noopError,
|
|
987
|
-
openSync: noopError
|
|
1001
|
+
openSync: noopError,
|
|
1002
|
+
// tinyglobby
|
|
1003
|
+
readdir: noopError,
|
|
1004
|
+
readdirSync: noopError,
|
|
1005
|
+
realpath: noopError,
|
|
1006
|
+
realpathSync: noopError,
|
|
1007
|
+
stat: noopError
|
|
988
1008
|
};
|
|
989
1009
|
}
|
|
990
1010
|
mkdir = fs.mkdir;
|
|
@@ -998,6 +1018,11 @@ var init_shim_consume_fs = __esm({
|
|
|
998
1018
|
fstatSync = fs.fstatSync;
|
|
999
1019
|
closeSync = fs.closeSync;
|
|
1000
1020
|
openSync = fs.openSync;
|
|
1021
|
+
readdir = fs.readdir;
|
|
1022
|
+
readdirSync = fs.readdirSync;
|
|
1023
|
+
realpath = fs.realpath;
|
|
1024
|
+
realpathSync = fs.realpathSync;
|
|
1025
|
+
stat = fs.stat;
|
|
1001
1026
|
shim_consume_fs_default = fs;
|
|
1002
1027
|
}
|
|
1003
1028
|
});
|
|
@@ -3337,8 +3362,8 @@ var require_nodes = __commonJS({
|
|
|
3337
3362
|
__name(FromImport2, "FromImport");
|
|
3338
3363
|
_inheritsLoose(FromImport2, _Node3);
|
|
3339
3364
|
var _proto3 = FromImport2.prototype;
|
|
3340
|
-
_proto3.init = /* @__PURE__ */ __name(function init(lineno, colno, template,
|
|
3341
|
-
_Node3.prototype.init.call(this, lineno, colno, template,
|
|
3365
|
+
_proto3.init = /* @__PURE__ */ __name(function init(lineno, colno, template, names2, withContext) {
|
|
3366
|
+
_Node3.prototype.init.call(this, lineno, colno, template, names2 || new NodeList(), withContext);
|
|
3342
3367
|
}, "init");
|
|
3343
3368
|
return _createClass(FromImport2, [{
|
|
3344
3369
|
key: "typename",
|
|
@@ -3790,12 +3815,12 @@ var require_parser = __commonJS({
|
|
|
3790
3815
|
if (!this.skipSymbol("import")) {
|
|
3791
3816
|
this.fail("parseFrom: expected import", fromTok.lineno, fromTok.colno);
|
|
3792
3817
|
}
|
|
3793
|
-
var
|
|
3818
|
+
var names2 = new nodes.NodeList();
|
|
3794
3819
|
var withContext;
|
|
3795
3820
|
while (1) {
|
|
3796
3821
|
var nextTok = this.peekToken();
|
|
3797
3822
|
if (nextTok.type === lexer.TOKEN_BLOCK_END) {
|
|
3798
|
-
if (!
|
|
3823
|
+
if (!names2.children.length) {
|
|
3799
3824
|
this.fail("parseFrom: Expected at least one import name", fromTok.lineno, fromTok.colno);
|
|
3800
3825
|
}
|
|
3801
3826
|
if (nextTok.value.charAt(0) === "-") {
|
|
@@ -3804,7 +3829,7 @@ var require_parser = __commonJS({
|
|
|
3804
3829
|
this.nextToken();
|
|
3805
3830
|
break;
|
|
3806
3831
|
}
|
|
3807
|
-
if (
|
|
3832
|
+
if (names2.children.length > 0 && !this.skip(lexer.TOKEN_COMMA)) {
|
|
3808
3833
|
this.fail("parseFrom: expected comma", fromTok.lineno, fromTok.colno);
|
|
3809
3834
|
}
|
|
3810
3835
|
var name = this.parsePrimary();
|
|
@@ -3813,13 +3838,13 @@ var require_parser = __commonJS({
|
|
|
3813
3838
|
}
|
|
3814
3839
|
if (this.skipSymbol("as")) {
|
|
3815
3840
|
var alias = this.parsePrimary();
|
|
3816
|
-
|
|
3841
|
+
names2.addChild(new nodes.Pair(name.lineno, name.colno, name, alias));
|
|
3817
3842
|
} else {
|
|
3818
|
-
|
|
3843
|
+
names2.addChild(name);
|
|
3819
3844
|
}
|
|
3820
3845
|
withContext = this.parseWithContext();
|
|
3821
3846
|
}
|
|
3822
|
-
return new nodes.FromImport(fromTok.lineno, fromTok.colno, template,
|
|
3847
|
+
return new nodes.FromImport(fromTok.lineno, fromTok.colno, template, names2, withContext);
|
|
3823
3848
|
}, "parseFrom");
|
|
3824
3849
|
_proto.parseBlock = /* @__PURE__ */ __name(function parseBlock() {
|
|
3825
3850
|
var tag = this.peekToken();
|
|
@@ -7467,8 +7492,8 @@ var require_precompile = __commonJS({
|
|
|
7467
7492
|
fs2.readdirSync(dir).forEach(function(file) {
|
|
7468
7493
|
var filepath = path.join(dir, file);
|
|
7469
7494
|
var subpath = filepath.substr(path.join(input, "/").length);
|
|
7470
|
-
var
|
|
7471
|
-
if (
|
|
7495
|
+
var stat2 = fs2.statSync(filepath);
|
|
7496
|
+
if (stat2 && stat2.isDirectory()) {
|
|
7472
7497
|
subpath += "/";
|
|
7473
7498
|
if (!match(subpath, opts.exclude)) {
|
|
7474
7499
|
addTemplates(filepath);
|
|
@@ -7895,25 +7920,293 @@ var require_nunjucks = __commonJS({
|
|
|
7895
7920
|
}
|
|
7896
7921
|
});
|
|
7897
7922
|
|
|
7898
|
-
// ../../node_modules/@11ty/package-bundler/shims/debug.js
|
|
7899
|
-
function debug_default() {
|
|
7900
|
-
return function() {
|
|
7901
|
-
};
|
|
7902
|
-
}
|
|
7903
|
-
__name(debug_default, "default");
|
|
7904
|
-
|
|
7905
7923
|
// ../../src/Engines/Nunjucks.js
|
|
7906
7924
|
var import_eleventy_utils = __toESM(require_eleventy_utils(), 1);
|
|
7907
7925
|
var import_nunjucks = __toESM(require_nunjucks(), 1);
|
|
7908
7926
|
|
|
7909
|
-
// ../../
|
|
7910
|
-
|
|
7927
|
+
// ../../node_modules/obug/dist/core.js
|
|
7928
|
+
function coerce(value) {
|
|
7929
|
+
if (value instanceof Error) return value.stack || value.message;
|
|
7930
|
+
return value;
|
|
7931
|
+
}
|
|
7932
|
+
__name(coerce, "coerce");
|
|
7933
|
+
function selectColor(colors2, namespace) {
|
|
7934
|
+
let hash = 0;
|
|
7935
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
7936
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
7937
|
+
hash |= 0;
|
|
7938
|
+
}
|
|
7939
|
+
return colors2[Math.abs(hash) % colors2.length];
|
|
7940
|
+
}
|
|
7941
|
+
__name(selectColor, "selectColor");
|
|
7942
|
+
function matchesTemplate(search, template) {
|
|
7943
|
+
let searchIndex = 0;
|
|
7944
|
+
let templateIndex = 0;
|
|
7945
|
+
let starIndex = -1;
|
|
7946
|
+
let matchIndex = 0;
|
|
7947
|
+
while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
|
|
7948
|
+
starIndex = templateIndex;
|
|
7949
|
+
matchIndex = searchIndex;
|
|
7950
|
+
templateIndex++;
|
|
7951
|
+
} else {
|
|
7952
|
+
searchIndex++;
|
|
7953
|
+
templateIndex++;
|
|
7954
|
+
}
|
|
7955
|
+
else if (starIndex !== -1) {
|
|
7956
|
+
templateIndex = starIndex + 1;
|
|
7957
|
+
matchIndex++;
|
|
7958
|
+
searchIndex = matchIndex;
|
|
7959
|
+
} else return false;
|
|
7960
|
+
while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
|
|
7961
|
+
return templateIndex === template.length;
|
|
7962
|
+
}
|
|
7963
|
+
__name(matchesTemplate, "matchesTemplate");
|
|
7964
|
+
function humanize(value) {
|
|
7965
|
+
if (value >= 1e3) return `${(value / 1e3).toFixed(1)}s`;
|
|
7966
|
+
return `${value}ms`;
|
|
7967
|
+
}
|
|
7968
|
+
__name(humanize, "humanize");
|
|
7969
|
+
var globalNamespaces = "";
|
|
7970
|
+
function createDebug(namespace, options) {
|
|
7971
|
+
let prevTime;
|
|
7972
|
+
let enableOverride;
|
|
7973
|
+
let namespacesCache;
|
|
7974
|
+
let enabledCache;
|
|
7975
|
+
const debug3 = /* @__PURE__ */ __name((...args) => {
|
|
7976
|
+
if (!debug3.enabled) return;
|
|
7977
|
+
const curr = Date.now();
|
|
7978
|
+
const diff = curr - (prevTime || curr);
|
|
7979
|
+
prevTime = curr;
|
|
7980
|
+
args[0] = coerce(args[0]);
|
|
7981
|
+
if (typeof args[0] !== "string") args.unshift("%O");
|
|
7982
|
+
let index = 0;
|
|
7983
|
+
args[0] = args[0].replace(/%([a-z%])/gi, (match, format) => {
|
|
7984
|
+
if (match === "%%") return "%";
|
|
7985
|
+
index++;
|
|
7986
|
+
const formatter = options.formatters[format];
|
|
7987
|
+
if (typeof formatter === "function") {
|
|
7988
|
+
const value = args[index];
|
|
7989
|
+
match = formatter.call(debug3, value);
|
|
7990
|
+
args.splice(index, 1);
|
|
7991
|
+
index--;
|
|
7992
|
+
}
|
|
7993
|
+
return match;
|
|
7994
|
+
});
|
|
7995
|
+
options.formatArgs.call(debug3, diff, args);
|
|
7996
|
+
debug3.log(...args);
|
|
7997
|
+
}, "debug");
|
|
7998
|
+
debug3.extend = function(namespace2, delimiter = ":") {
|
|
7999
|
+
return createDebug(this.namespace + delimiter + namespace2, {
|
|
8000
|
+
useColors: this.useColors,
|
|
8001
|
+
color: this.color,
|
|
8002
|
+
formatArgs: this.formatArgs,
|
|
8003
|
+
formatters: this.formatters,
|
|
8004
|
+
inspectOpts: this.inspectOpts,
|
|
8005
|
+
log: this.log,
|
|
8006
|
+
humanize: this.humanize
|
|
8007
|
+
});
|
|
8008
|
+
};
|
|
8009
|
+
Object.assign(debug3, options);
|
|
8010
|
+
debug3.namespace = namespace;
|
|
8011
|
+
Object.defineProperty(debug3, "enabled", {
|
|
8012
|
+
enumerable: true,
|
|
8013
|
+
configurable: false,
|
|
8014
|
+
get: /* @__PURE__ */ __name(() => {
|
|
8015
|
+
if (enableOverride != null) return enableOverride;
|
|
8016
|
+
if (namespacesCache !== globalNamespaces) {
|
|
8017
|
+
namespacesCache = globalNamespaces;
|
|
8018
|
+
enabledCache = enabled(namespace);
|
|
8019
|
+
}
|
|
8020
|
+
return enabledCache;
|
|
8021
|
+
}, "get"),
|
|
8022
|
+
set: /* @__PURE__ */ __name((v) => {
|
|
8023
|
+
enableOverride = v;
|
|
8024
|
+
}, "set")
|
|
8025
|
+
});
|
|
8026
|
+
return debug3;
|
|
8027
|
+
}
|
|
8028
|
+
__name(createDebug, "createDebug");
|
|
8029
|
+
var names = [];
|
|
8030
|
+
var skips = [];
|
|
8031
|
+
function enable(namespaces2) {
|
|
8032
|
+
globalNamespaces = namespaces2;
|
|
8033
|
+
names = [];
|
|
8034
|
+
skips = [];
|
|
8035
|
+
const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
8036
|
+
for (const ns of split) if (ns[0] === "-") skips.push(ns.slice(1));
|
|
8037
|
+
else names.push(ns);
|
|
8038
|
+
}
|
|
8039
|
+
__name(enable, "enable");
|
|
8040
|
+
function enabled(name) {
|
|
8041
|
+
for (const skip of skips) if (matchesTemplate(name, skip)) return false;
|
|
8042
|
+
for (const ns of names) if (matchesTemplate(name, ns)) return true;
|
|
8043
|
+
return false;
|
|
8044
|
+
}
|
|
8045
|
+
__name(enabled, "enabled");
|
|
8046
|
+
|
|
8047
|
+
// ../../node_modules/obug/dist/browser.js
|
|
8048
|
+
var colors = [
|
|
8049
|
+
"#0000CC",
|
|
8050
|
+
"#0000FF",
|
|
8051
|
+
"#0033CC",
|
|
8052
|
+
"#0033FF",
|
|
8053
|
+
"#0066CC",
|
|
8054
|
+
"#0066FF",
|
|
8055
|
+
"#0099CC",
|
|
8056
|
+
"#0099FF",
|
|
8057
|
+
"#00CC00",
|
|
8058
|
+
"#00CC33",
|
|
8059
|
+
"#00CC66",
|
|
8060
|
+
"#00CC99",
|
|
8061
|
+
"#00CCCC",
|
|
8062
|
+
"#00CCFF",
|
|
8063
|
+
"#3300CC",
|
|
8064
|
+
"#3300FF",
|
|
8065
|
+
"#3333CC",
|
|
8066
|
+
"#3333FF",
|
|
8067
|
+
"#3366CC",
|
|
8068
|
+
"#3366FF",
|
|
8069
|
+
"#3399CC",
|
|
8070
|
+
"#3399FF",
|
|
8071
|
+
"#33CC00",
|
|
8072
|
+
"#33CC33",
|
|
8073
|
+
"#33CC66",
|
|
8074
|
+
"#33CC99",
|
|
8075
|
+
"#33CCCC",
|
|
8076
|
+
"#33CCFF",
|
|
8077
|
+
"#6600CC",
|
|
8078
|
+
"#6600FF",
|
|
8079
|
+
"#6633CC",
|
|
8080
|
+
"#6633FF",
|
|
8081
|
+
"#66CC00",
|
|
8082
|
+
"#66CC33",
|
|
8083
|
+
"#9900CC",
|
|
8084
|
+
"#9900FF",
|
|
8085
|
+
"#9933CC",
|
|
8086
|
+
"#9933FF",
|
|
8087
|
+
"#99CC00",
|
|
8088
|
+
"#99CC33",
|
|
8089
|
+
"#CC0000",
|
|
8090
|
+
"#CC0033",
|
|
8091
|
+
"#CC0066",
|
|
8092
|
+
"#CC0099",
|
|
8093
|
+
"#CC00CC",
|
|
8094
|
+
"#CC00FF",
|
|
8095
|
+
"#CC3300",
|
|
8096
|
+
"#CC3333",
|
|
8097
|
+
"#CC3366",
|
|
8098
|
+
"#CC3399",
|
|
8099
|
+
"#CC33CC",
|
|
8100
|
+
"#CC33FF",
|
|
8101
|
+
"#CC6600",
|
|
8102
|
+
"#CC6633",
|
|
8103
|
+
"#CC9900",
|
|
8104
|
+
"#CC9933",
|
|
8105
|
+
"#CCCC00",
|
|
8106
|
+
"#CCCC33",
|
|
8107
|
+
"#FF0000",
|
|
8108
|
+
"#FF0033",
|
|
8109
|
+
"#FF0066",
|
|
8110
|
+
"#FF0099",
|
|
8111
|
+
"#FF00CC",
|
|
8112
|
+
"#FF00FF",
|
|
8113
|
+
"#FF3300",
|
|
8114
|
+
"#FF3333",
|
|
8115
|
+
"#FF3366",
|
|
8116
|
+
"#FF3399",
|
|
8117
|
+
"#FF33CC",
|
|
8118
|
+
"#FF33FF",
|
|
8119
|
+
"#FF6600",
|
|
8120
|
+
"#FF6633",
|
|
8121
|
+
"#FF9900",
|
|
8122
|
+
"#FF9933",
|
|
8123
|
+
"#FFCC00",
|
|
8124
|
+
"#FFCC33"
|
|
8125
|
+
];
|
|
8126
|
+
function formatArgs(diff, args) {
|
|
8127
|
+
const { useColors } = this;
|
|
8128
|
+
args[0] = `${(useColors ? "%c" : "") + this.namespace + (useColors ? " %c" : " ") + args[0] + (useColors ? "%c " : " ")}+${this.humanize(diff)}`;
|
|
8129
|
+
if (!useColors) return;
|
|
8130
|
+
const c = `color: ${this.color}`;
|
|
8131
|
+
args.splice(1, 0, c, "color: inherit");
|
|
8132
|
+
let index = 0;
|
|
8133
|
+
let lastC = 0;
|
|
8134
|
+
args[0].replace(/%[a-z%]/gi, (match) => {
|
|
8135
|
+
if (match === "%%") return;
|
|
8136
|
+
index++;
|
|
8137
|
+
if (match === "%c") lastC = index;
|
|
8138
|
+
});
|
|
8139
|
+
args.splice(lastC, 0, c);
|
|
8140
|
+
}
|
|
8141
|
+
__name(formatArgs, "formatArgs");
|
|
8142
|
+
var log = console.debug || console.log || (() => {
|
|
8143
|
+
});
|
|
8144
|
+
var storage = localstorage();
|
|
8145
|
+
var defaultOptions = {
|
|
8146
|
+
useColors: true,
|
|
8147
|
+
formatArgs,
|
|
8148
|
+
formatters: {
|
|
8149
|
+
/**
|
|
8150
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
8151
|
+
*/
|
|
8152
|
+
j(v) {
|
|
8153
|
+
try {
|
|
8154
|
+
return JSON.stringify(v);
|
|
8155
|
+
} catch (error) {
|
|
8156
|
+
return `[UnexpectedJSONParseError]: ${error.message}`;
|
|
8157
|
+
}
|
|
8158
|
+
}
|
|
8159
|
+
},
|
|
8160
|
+
inspectOpts: {},
|
|
8161
|
+
humanize,
|
|
8162
|
+
log
|
|
8163
|
+
};
|
|
8164
|
+
function createDebug2(namespace, options) {
|
|
8165
|
+
var _ref;
|
|
8166
|
+
const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
|
|
8167
|
+
return createDebug(namespace, Object.assign(defaultOptions, { color }, options));
|
|
8168
|
+
}
|
|
8169
|
+
__name(createDebug2, "createDebug");
|
|
8170
|
+
function localstorage() {
|
|
8171
|
+
try {
|
|
8172
|
+
return localStorage;
|
|
8173
|
+
} catch (_unused) {
|
|
8174
|
+
}
|
|
8175
|
+
}
|
|
8176
|
+
__name(localstorage, "localstorage");
|
|
8177
|
+
function load() {
|
|
8178
|
+
let r;
|
|
8179
|
+
try {
|
|
8180
|
+
r = storage.getItem("debug") || storage.getItem("DEBUG");
|
|
8181
|
+
} catch (_unused2) {
|
|
8182
|
+
}
|
|
8183
|
+
if (!r && typeof process !== "undefined" && "env" in process) r = process.env.DEBUG;
|
|
8184
|
+
return r || "";
|
|
8185
|
+
}
|
|
8186
|
+
__name(load, "load");
|
|
8187
|
+
enable(load());
|
|
8188
|
+
|
|
8189
|
+
// ../../src/Util/IsBuildAwesome.js
|
|
8190
|
+
function isUsingBuildAwesome() {
|
|
8191
|
+
return process?.env?.BUILDAWESOME_PACKAGE === "@awesome.me/buildawesome";
|
|
8192
|
+
}
|
|
8193
|
+
__name(isUsingBuildAwesome, "isUsingBuildAwesome");
|
|
8194
|
+
|
|
8195
|
+
// ../../src/Util/DebugLogUtil.js
|
|
8196
|
+
var PREFIX = isUsingBuildAwesome() ? "BuildAwesome:" : "Eleventy:";
|
|
8197
|
+
function createDebug3(name) {
|
|
8198
|
+
return createDebug2(`${PREFIX}:${name}`);
|
|
8199
|
+
}
|
|
8200
|
+
__name(createDebug3, "createDebug");
|
|
8201
|
+
|
|
8202
|
+
// ../../src/Errors/BaseError.js
|
|
8203
|
+
var BaseError = class extends Error {
|
|
7911
8204
|
static {
|
|
7912
|
-
__name(this, "
|
|
8205
|
+
__name(this, "BaseError");
|
|
7913
8206
|
}
|
|
7914
8207
|
/**
|
|
7915
8208
|
* @param {string} message - The error message to display.
|
|
7916
|
-
* @param {
|
|
8209
|
+
* @param {Error} [originalError] - The original error caught.
|
|
7917
8210
|
*/
|
|
7918
8211
|
constructor(message, originalError) {
|
|
7919
8212
|
if (originalError) {
|
|
@@ -7930,15 +8223,14 @@ var EleventyBaseError = class extends Error {
|
|
|
7930
8223
|
}
|
|
7931
8224
|
}
|
|
7932
8225
|
};
|
|
7933
|
-
var EleventyBaseError_default = EleventyBaseError;
|
|
7934
8226
|
|
|
7935
8227
|
// ../../src/Engines/TemplateEngine.js
|
|
7936
|
-
var TemplateEngineConfigError = class extends
|
|
8228
|
+
var TemplateEngineConfigError = class extends BaseError {
|
|
7937
8229
|
static {
|
|
7938
8230
|
__name(this, "TemplateEngineConfigError");
|
|
7939
8231
|
}
|
|
7940
8232
|
};
|
|
7941
|
-
var debug =
|
|
8233
|
+
var debug = createDebug3("TemplateEngine");
|
|
7942
8234
|
var AMENDED_INSTANCES = /* @__PURE__ */ new Set();
|
|
7943
8235
|
var TemplateEngine = class {
|
|
7944
8236
|
static {
|
|
@@ -8143,26 +8435,11 @@ function augmentObject(targetObject, options = {}) {
|
|
|
8143
8435
|
}
|
|
8144
8436
|
__name(augmentObject, "augmentObject");
|
|
8145
8437
|
|
|
8146
|
-
// ../../src/Util/PromiseUtil.js
|
|
8147
|
-
function withResolvers() {
|
|
8148
|
-
if ("withResolvers" in Promise) {
|
|
8149
|
-
return Promise.withResolvers();
|
|
8150
|
-
}
|
|
8151
|
-
let resolve;
|
|
8152
|
-
let reject;
|
|
8153
|
-
let promise = new Promise((res, rej) => {
|
|
8154
|
-
resolve = res;
|
|
8155
|
-
reject = rej;
|
|
8156
|
-
});
|
|
8157
|
-
return { promise, resolve, reject };
|
|
8158
|
-
}
|
|
8159
|
-
__name(withResolvers, "withResolvers");
|
|
8160
|
-
|
|
8161
8438
|
// ../../src/Engines/Nunjucks.js
|
|
8162
|
-
var debug2 =
|
|
8163
|
-
var
|
|
8439
|
+
var debug2 = createDebug3("Nunjucks");
|
|
8440
|
+
var BuildAwesomeNunjucksError = class extends BaseError {
|
|
8164
8441
|
static {
|
|
8165
|
-
__name(this, "
|
|
8442
|
+
__name(this, "BuildAwesomeNunjucksError");
|
|
8166
8443
|
}
|
|
8167
8444
|
};
|
|
8168
8445
|
var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
@@ -8213,14 +8490,14 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8213
8490
|
}
|
|
8214
8491
|
this.njkEnv = new import_nunjucks.Environment(loaders, this.nunjucksEnvironmentOptions);
|
|
8215
8492
|
}
|
|
8216
|
-
this.config.events.emit("
|
|
8493
|
+
this.config.events.emit("buildawesome.engine.njk", {
|
|
8217
8494
|
nunjucks: import_nunjucks.default,
|
|
8218
8495
|
environment: this.njkEnv
|
|
8219
8496
|
});
|
|
8220
8497
|
}
|
|
8221
8498
|
setLibrary(override) {
|
|
8222
8499
|
this.#setEnv(override);
|
|
8223
|
-
this.config.events.on("
|
|
8500
|
+
this.config.events.on("buildawesome#templatemodified", (templatePath) => {
|
|
8224
8501
|
let absTmplPath = import_eleventy_utils.TemplatePath.normalizeOperatingSystemFilePath(
|
|
8225
8502
|
import_eleventy_utils.TemplatePath.absolutePath(templatePath)
|
|
8226
8503
|
);
|
|
@@ -8269,7 +8546,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8269
8546
|
});
|
|
8270
8547
|
return fn.call(this, ...args);
|
|
8271
8548
|
} catch (e) {
|
|
8272
|
-
throw new
|
|
8549
|
+
throw new BuildAwesomeNunjucksError(
|
|
8273
8550
|
`Error in Nunjucks Filter \`${name}\`${this.page ? ` (${this.page.inputPath})` : ""}`,
|
|
8274
8551
|
e
|
|
8275
8552
|
);
|
|
@@ -8350,7 +8627,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8350
8627
|
let ret = shortcodeFn.call(_Nunjucks.normalizeContext(context), ...argArray);
|
|
8351
8628
|
if (!ret?.then) {
|
|
8352
8629
|
resolve(
|
|
8353
|
-
new
|
|
8630
|
+
new BuildAwesomeNunjucksError(
|
|
8354
8631
|
`Error with Nunjucks shortcode \`${shortcodeName}\`: it was defined as asynchronous but was actually synchronous. This is important for Nunjucks.`
|
|
8355
8632
|
)
|
|
8356
8633
|
);
|
|
@@ -8361,7 +8638,10 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8361
8638
|
},
|
|
8362
8639
|
function(e) {
|
|
8363
8640
|
resolve(
|
|
8364
|
-
new
|
|
8641
|
+
new BuildAwesomeNunjucksError(
|
|
8642
|
+
`Error with Nunjucks shortcode \`${shortcodeName}\``,
|
|
8643
|
+
e
|
|
8644
|
+
)
|
|
8365
8645
|
);
|
|
8366
8646
|
}
|
|
8367
8647
|
);
|
|
@@ -8370,7 +8650,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8370
8650
|
let ret = shortcodeFn.call(_Nunjucks.normalizeContext(context), ...argArray);
|
|
8371
8651
|
return new import_nunjucks.default.runtime.SafeString("" + ret);
|
|
8372
8652
|
} catch (e) {
|
|
8373
|
-
throw new
|
|
8653
|
+
throw new BuildAwesomeNunjucksError(
|
|
8374
8654
|
`Error with Nunjucks shortcode \`${shortcodeName}\``,
|
|
8375
8655
|
e
|
|
8376
8656
|
);
|
|
@@ -8398,7 +8678,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8398
8678
|
body(function(e, bodyContent) {
|
|
8399
8679
|
if (e) {
|
|
8400
8680
|
resolve(
|
|
8401
|
-
new
|
|
8681
|
+
new BuildAwesomeNunjucksError(
|
|
8402
8682
|
`Error with Nunjucks paired shortcode \`${shortcodeName}\``,
|
|
8403
8683
|
e
|
|
8404
8684
|
)
|
|
@@ -8410,7 +8690,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8410
8690
|
...argArray
|
|
8411
8691
|
);
|
|
8412
8692
|
if (!ret?.then) {
|
|
8413
|
-
throw new
|
|
8693
|
+
throw new BuildAwesomeNunjucksError(
|
|
8414
8694
|
`Error with Nunjucks shortcode \`${shortcodeName}\`: it was defined as asynchronous but was actually synchronous. This is important for Nunjucks.`
|
|
8415
8695
|
);
|
|
8416
8696
|
}
|
|
@@ -8420,7 +8700,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8420
8700
|
},
|
|
8421
8701
|
function(e2) {
|
|
8422
8702
|
resolve(
|
|
8423
|
-
new
|
|
8703
|
+
new BuildAwesomeNunjucksError(
|
|
8424
8704
|
`Error with Nunjucks paired shortcode \`${shortcodeName}\``,
|
|
8425
8705
|
e2
|
|
8426
8706
|
)
|
|
@@ -8447,7 +8727,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8447
8727
|
shortcodeFn.call(_Nunjucks.normalizeContext(context), bodyContent, ...argArray)
|
|
8448
8728
|
);
|
|
8449
8729
|
} catch (e) {
|
|
8450
|
-
throw new
|
|
8730
|
+
throw new BuildAwesomeNunjucksError(
|
|
8451
8731
|
`Error with Nunjucks paired shortcode \`${shortcodeName}\``,
|
|
8452
8732
|
e
|
|
8453
8733
|
);
|
|
@@ -8552,7 +8832,7 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8552
8832
|
tmpl = new import_nunjucks.Template(str, this.njkEnv, inputPath, false);
|
|
8553
8833
|
}
|
|
8554
8834
|
return function(data) {
|
|
8555
|
-
let { promise, resolve, reject } = withResolvers();
|
|
8835
|
+
let { promise, resolve, reject } = Promise.withResolvers();
|
|
8556
8836
|
tmpl.render(data, (error, result) => {
|
|
8557
8837
|
if (error) {
|
|
8558
8838
|
reject(error);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy (Build Awesome) v4.0.0-alpha.8 (i18n Plugin) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -12,11 +12,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
12
12
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
13
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
14
|
});
|
|
15
|
-
var __esm = (fn, res) => function __init() {
|
|
16
|
-
|
|
15
|
+
var __esm = (fn, res, err) => function __init() {
|
|
16
|
+
if (err) throw err[0];
|
|
17
|
+
try {
|
|
18
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw err = [e], e;
|
|
21
|
+
}
|
|
17
22
|
};
|
|
18
23
|
var __commonJS = (cb, mod) => function __require2() {
|
|
19
|
-
|
|
24
|
+
try {
|
|
25
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw mod = 0, e;
|
|
28
|
+
}
|
|
20
29
|
};
|
|
21
30
|
var __export = (target, all) => {
|
|
22
31
|
for (var name in all)
|
|
@@ -1751,10 +1760,15 @@ __export(shim_consume_fs_exports, {
|
|
|
1751
1760
|
promises: () => promises,
|
|
1752
1761
|
readFileSync: () => readFileSync,
|
|
1753
1762
|
readSync: () => readSync,
|
|
1763
|
+
readdir: () => readdir,
|
|
1764
|
+
readdirSync: () => readdirSync,
|
|
1765
|
+
realpath: () => realpath,
|
|
1766
|
+
realpathSync: () => realpathSync,
|
|
1767
|
+
stat: () => stat,
|
|
1754
1768
|
statSync: () => statSync,
|
|
1755
1769
|
writeFileSync: () => writeFileSync
|
|
1756
1770
|
});
|
|
1757
|
-
var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, writeFileSync, promises, readSync, fstatSync, closeSync, openSync, shim_consume_fs_default;
|
|
1771
|
+
var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, writeFileSync, promises, readSync, fstatSync, closeSync, openSync, readdir, readdirSync, realpath, realpathSync, stat, shim_consume_fs_default;
|
|
1758
1772
|
var init_shim_consume_fs = __esm({
|
|
1759
1773
|
"../../node_modules/@11ty/package-bundler/shims/shim-consume-fs.js"() {
|
|
1760
1774
|
GLOBAL_FS_NAME = "eleventyFileSystem";
|
|
@@ -1776,7 +1790,13 @@ var init_shim_consume_fs = __esm({
|
|
|
1776
1790
|
readSync: noopError,
|
|
1777
1791
|
fstatSync: noopError,
|
|
1778
1792
|
closeSync: noopError,
|
|
1779
|
-
openSync: noopError
|
|
1793
|
+
openSync: noopError,
|
|
1794
|
+
// tinyglobby
|
|
1795
|
+
readdir: noopError,
|
|
1796
|
+
readdirSync: noopError,
|
|
1797
|
+
realpath: noopError,
|
|
1798
|
+
realpathSync: noopError,
|
|
1799
|
+
stat: noopError
|
|
1780
1800
|
};
|
|
1781
1801
|
}
|
|
1782
1802
|
mkdir = fs.mkdir;
|
|
@@ -1790,6 +1810,11 @@ var init_shim_consume_fs = __esm({
|
|
|
1790
1810
|
fstatSync = fs.fstatSync;
|
|
1791
1811
|
closeSync = fs.closeSync;
|
|
1792
1812
|
openSync = fs.openSync;
|
|
1813
|
+
readdir = fs.readdir;
|
|
1814
|
+
readdirSync = fs.readdirSync;
|
|
1815
|
+
realpath = fs.realpath;
|
|
1816
|
+
realpathSync = fs.realpathSync;
|
|
1817
|
+
stat = fs.stat;
|
|
1793
1818
|
shim_consume_fs_default = fs;
|
|
1794
1819
|
}
|
|
1795
1820
|
});
|
|
@@ -16311,12 +16336,12 @@ function I18nPlugin(eleventyConfig, opts = {}) {
|
|
|
16311
16336
|
);
|
|
16312
16337
|
}
|
|
16313
16338
|
let extensionMap;
|
|
16314
|
-
eleventyConfig.on("
|
|
16339
|
+
eleventyConfig.on("buildawesome.extensionmap", (map) => {
|
|
16315
16340
|
extensionMap = map;
|
|
16316
16341
|
});
|
|
16317
16342
|
let bench = eleventyConfig.benchmarkManager.get("Aggregate");
|
|
16318
16343
|
let contentMaps = {};
|
|
16319
|
-
eleventyConfig.on("
|
|
16344
|
+
eleventyConfig.on("buildawesome.contentmap", function({ urlToInputPath, inputPathToUrl }) {
|
|
16320
16345
|
let b = bench.get("(i18n Plugin) Setting up content map.");
|
|
16321
16346
|
b.before();
|
|
16322
16347
|
contentMaps.inputPathToUrl = inputPathToUrl;
|