@jaredwray/fumanchu 3.0.1 → 3.0.2
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 +2 -2
- package/dist/index.d.ts +18 -1
- package/dist/index.js +2 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -27,8 +27,8 @@ We plan to make significant changes over time with this project such as the foll
|
|
|
27
27
|
Because of the complexity in the legacy helpers library we have moved to exporting the libraries and a helper function to make it easier to use. Here are the exports:
|
|
28
28
|
|
|
29
29
|
- `handlebars` - This is an instance of handlebars library without any helpers. It is the same as calling `Handlebars.create()`
|
|
30
|
-
- `helpers` - This is a function that takes an object with a `handlebars` key and adds all the helpers to the handlebars instance. This is the same as calling `helpers({ handlebars: handlebars })`
|
|
31
|
-
- `createHandlebars` - This is an async function that returns a handlebars instance with all the helpers added. This is the same as calling `helpers({ handlebars: handlebars })` but async.
|
|
30
|
+
- `helpers` - This is a function that takes an object with a `handlebars` key and adds all the helpers to the handlebars instance. This is the same as calling `helpers({ handlebars: handlebars }, { ..options })`
|
|
31
|
+
- `createHandlebars` - This is an async function that returns a handlebars instance with all the helpers added. This is the same as calling `helpers({ handlebars: handlebars }, { ..options })` but async.
|
|
32
32
|
- `Handlebars` - This is the handlebars library itself. It is the same as calling `require('handlebars')`
|
|
33
33
|
|
|
34
34
|
Please see the examples below for how to use the library.
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,23 @@ type HelperFilter = {
|
|
|
9
9
|
category?: string;
|
|
10
10
|
compatibility?: HelperRegistryCompatibility;
|
|
11
11
|
};
|
|
12
|
+
type Helper = {
|
|
13
|
+
name: string;
|
|
14
|
+
category: string;
|
|
15
|
+
compatibility?: HelperRegistryCompatibility;
|
|
16
|
+
fn: ((...arguments_: any[]) => string);
|
|
17
|
+
};
|
|
18
|
+
declare class HelperRegistry {
|
|
19
|
+
private readonly _helpers;
|
|
20
|
+
constructor();
|
|
21
|
+
init(): void;
|
|
22
|
+
register(helper: Helper): boolean;
|
|
23
|
+
registerHelpers(helpers: Helper[]): void;
|
|
24
|
+
has(name: string): boolean;
|
|
25
|
+
filter(filter: HelperFilter): Helper[];
|
|
26
|
+
loadHandlebars(handlebars: any): void;
|
|
27
|
+
swapHelpers(handlebars: any): void;
|
|
28
|
+
}
|
|
12
29
|
|
|
13
30
|
/**
|
|
14
31
|
* Handlebars library not initiated with helpers
|
|
@@ -61,4 +78,4 @@ type FumanchuOptions = {
|
|
|
61
78
|
*/
|
|
62
79
|
declare function fumanchu(options?: FumanchuOptions): typeof HandlebarsLib;
|
|
63
80
|
|
|
64
|
-
export { type FumanchuCachingOptions, type FumanchuOptions, Handlebars, createHandlebars, fumanchu, handlebars, helpers };
|
|
81
|
+
export { type FumanchuCachingOptions, type FumanchuOptions, Handlebars, type HelperFilter, HelperRegistry, createHandlebars, fumanchu, handlebars, helpers };
|
package/dist/index.js
CHANGED
|
@@ -2034,6 +2034,7 @@ var require_helpers = __commonJS({
|
|
|
2034
2034
|
var src_exports = {};
|
|
2035
2035
|
__export(src_exports, {
|
|
2036
2036
|
Handlebars: () => Handlebars,
|
|
2037
|
+
HelperRegistry: () => HelperRegistry,
|
|
2037
2038
|
createHandlebars: () => createHandlebars,
|
|
2038
2039
|
fumanchu: () => fumanchu,
|
|
2039
2040
|
handlebars: () => handlebars,
|
|
@@ -2116,6 +2117,7 @@ function fumanchu(options) {
|
|
|
2116
2117
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2117
2118
|
0 && (module.exports = {
|
|
2118
2119
|
Handlebars,
|
|
2120
|
+
HelperRegistry,
|
|
2119
2121
|
createHandlebars,
|
|
2120
2122
|
fumanchu,
|
|
2121
2123
|
handlebars,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaredwray/fumanchu",
|
|
3
3
|
"description": "Handlebars + Helpers = Fumanchu",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"homepage": "https://github.com/jaredwray/fumanchu",
|
|
6
6
|
"author": "Jared Wray (me@jaredwray.com)",
|
|
7
7
|
"source": "dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"arr-flatten": "^1.1.0",
|
|
60
60
|
"array-sort": "^1.0.0",
|
|
61
|
-
"cacheable": "^1.8.
|
|
61
|
+
"cacheable": "^1.8.5",
|
|
62
62
|
"create-frame": "^1.0.0",
|
|
63
63
|
"define-property": "^2.0.2",
|
|
64
64
|
"ent": "^2.2.1",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"year": "^0.2.1"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@vitest/coverage-v8": "^2.1.
|
|
93
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
94
94
|
"c8": "^10.1.2",
|
|
95
95
|
"chai": "^4.3.10",
|
|
96
|
-
"docula": "^0.9.
|
|
96
|
+
"docula": "^0.9.5",
|
|
97
97
|
"engine-handlebars": "^1.1.0",
|
|
98
98
|
"lodash": "^4.17.21",
|
|
99
99
|
"mocha": "^10.8.2",
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"templates": "^1.2.9",
|
|
103
103
|
"tsup": "^8.3.5",
|
|
104
104
|
"typecript": "^0.0.1-security",
|
|
105
|
-
"typescript": "^5.
|
|
106
|
-
"vitest": "^2.1.
|
|
107
|
-
"xo": "^0.
|
|
105
|
+
"typescript": "^5.7.2",
|
|
106
|
+
"vitest": "^2.1.8",
|
|
107
|
+
"xo": "^0.60.0"
|
|
108
108
|
},
|
|
109
109
|
"xo": {
|
|
110
110
|
"ignores": [
|