@jaredwray/fumanchu 4.6.0 → 4.6.1
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 +7 -0
- package/dist/index.cjs +2854 -3150
- package/dist/index.d.cts +65 -64
- package/dist/index.d.mts +106 -0
- package/dist/index.mjs +2868 -0
- package/package.json +34 -20
- package/dist/index.d.ts +0 -105
- package/dist/index.js +0 -3170
package/package.json
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaredwray/fumanchu",
|
|
3
3
|
"description": "Handlebars + Helpers = Fumanchu",
|
|
4
|
-
"version": "4.6.
|
|
4
|
+
"version": "4.6.1",
|
|
5
5
|
"homepage": "https://github.com/jaredwray/fumanchu",
|
|
6
6
|
"author": "Jared Wray (me@jaredwray.com)",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.cjs",
|
|
9
|
-
"module": "dist/index.
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"import":
|
|
13
|
-
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.cts",
|
|
18
|
+
"default": "./dist/index.cjs"
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
|
-
"types": "dist/index.d.
|
|
22
|
+
"types": "dist/index.d.mts",
|
|
17
23
|
"scripts": {
|
|
18
24
|
"lint": "biome check --write --error-on-warnings",
|
|
19
25
|
"lint:ci": "biome check --error-on-warnings",
|
|
20
26
|
"test": "pnpm lint && vitest run --coverage",
|
|
21
27
|
"test:ci": "pnpm lint:ci && vitest run --coverage",
|
|
22
|
-
"build": "
|
|
28
|
+
"build": "tsdown ./src/index.ts --format esm,cjs --dts",
|
|
23
29
|
"prepare": "pnpm build",
|
|
24
30
|
"clean": "rimraf ./node_modules ./coverage yarn.lock package-lock.json ./dist ./site/dist",
|
|
25
|
-
"website:build": "
|
|
26
|
-
"website:
|
|
31
|
+
"website:build": "docula build",
|
|
32
|
+
"website:dev": "docula dev",
|
|
33
|
+
"benchmark": "pnpm tsx benchmark/compile.ts"
|
|
27
34
|
},
|
|
28
35
|
"keywords": [
|
|
29
36
|
"array",
|
|
@@ -52,7 +59,10 @@
|
|
|
52
59
|
"util",
|
|
53
60
|
"utility"
|
|
54
61
|
],
|
|
55
|
-
"repository":
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://github.com/jaredwray/fumanchu.git"
|
|
65
|
+
},
|
|
56
66
|
"bugs": {
|
|
57
67
|
"url": "https://github.com/jaredwray/fumanchu/issues"
|
|
58
68
|
},
|
|
@@ -63,11 +73,11 @@
|
|
|
63
73
|
"license"
|
|
64
74
|
],
|
|
65
75
|
"dependencies": {
|
|
66
|
-
"@cacheable/memory": "^2.0.
|
|
76
|
+
"@cacheable/memory": "^2.0.8",
|
|
67
77
|
"chrono-node": "2.9.0",
|
|
68
|
-
"dayjs": "^1.11.
|
|
78
|
+
"dayjs": "^1.11.20",
|
|
69
79
|
"ent": "^2.2.2",
|
|
70
|
-
"handlebars": "^4.7.
|
|
80
|
+
"handlebars": "^4.7.9",
|
|
71
81
|
"html-tag": "^2.0.0",
|
|
72
82
|
"is-glob": "^4.0.3",
|
|
73
83
|
"kind-of": "^6.0.3",
|
|
@@ -77,20 +87,24 @@
|
|
|
77
87
|
"to-gfm-code-block": "^0.1.1"
|
|
78
88
|
},
|
|
79
89
|
"devDependencies": {
|
|
80
|
-
"@biomejs/biome": "^2.
|
|
90
|
+
"@biomejs/biome": "^2.4.10",
|
|
91
|
+
"@faker-js/faker": "^10.3.0",
|
|
92
|
+
"@monstermann/tinybench-pretty-printer": "^0.3.0",
|
|
81
93
|
"@types/ent": "^2.2.8",
|
|
82
94
|
"@types/html-tag": "^2.0.2",
|
|
83
95
|
"@types/is-glob": "^4.0.4",
|
|
84
96
|
"@types/kind-of": "^6.0.3",
|
|
85
97
|
"@types/micromatch": "^4.0.10",
|
|
86
|
-
"@types/node": "^25.0
|
|
98
|
+
"@types/node": "^25.5.0",
|
|
87
99
|
"@types/remarkable": "^2.0.8",
|
|
88
|
-
"@vitest/coverage-v8": "^4.
|
|
89
|
-
"docula": "^
|
|
90
|
-
"rimraf": "^6.1.
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
100
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
101
|
+
"docula": "^1.12.0",
|
|
102
|
+
"rimraf": "^6.1.3",
|
|
103
|
+
"tinybench": "^6.0.0",
|
|
104
|
+
"tsdown": "^0.21.7",
|
|
105
|
+
"tsx": "^4.21.0",
|
|
106
|
+
"typescript": "^6.0.2",
|
|
107
|
+
"vitest": "^4.1.2"
|
|
94
108
|
},
|
|
95
109
|
"contributors": [
|
|
96
110
|
"Jared Wray (https://jaredwray.com)",
|
package/dist/index.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { CacheableMemory, CacheableMemoryOptions } from '@cacheable/memory';
|
|
2
|
-
export { CacheableMemory, CacheableMemoryOptions } from '@cacheable/memory';
|
|
3
|
-
import HandlebarsLib from 'handlebars';
|
|
4
|
-
|
|
5
|
-
type Helper = {
|
|
6
|
-
name: string;
|
|
7
|
-
category: string;
|
|
8
|
-
compatibility?: string[];
|
|
9
|
-
fn: ((...arguments_: any[]) => string) | ((...arguments_: any[]) => number) | ((...arguments_: any[]) => boolean) | ((...arguments_: any[]) => unknown) | ((...arguments_: any[]) => number | string) | ((...arguments_: any[]) => HandlebarsLib.SafeString);
|
|
10
|
-
};
|
|
11
|
-
type HelperFilter = {
|
|
12
|
-
names?: string[];
|
|
13
|
-
categories?: string[];
|
|
14
|
-
compatibility?: string[];
|
|
15
|
-
};
|
|
16
|
-
declare class HelperRegistry {
|
|
17
|
-
private readonly _helpers;
|
|
18
|
-
constructor();
|
|
19
|
-
/**
|
|
20
|
-
* Get all registered helpers.
|
|
21
|
-
* @returns {Helper[]} The array of registered helpers.
|
|
22
|
-
*/
|
|
23
|
-
get helpers(): Helper[];
|
|
24
|
-
/**
|
|
25
|
-
* Initialize the helper registry. This is performed during the construction of the registry such as new HelperRegistry().
|
|
26
|
-
*/
|
|
27
|
-
init(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Register a helper.
|
|
30
|
-
* @param {Helper} helper The helper to register.
|
|
31
|
-
* @returns True if the helper was registered, false otherwise.
|
|
32
|
-
*/
|
|
33
|
-
register(helper: Helper): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Register multiple helpers.
|
|
36
|
-
* @param {Helper[]} helpers The array of helpers to register.
|
|
37
|
-
*/
|
|
38
|
-
registerHelpers(helpers: Helper[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Check if a helper is registered.
|
|
41
|
-
* @param name The name of the helper.
|
|
42
|
-
* @returns True if the helper is registered, false otherwise.
|
|
43
|
-
*/
|
|
44
|
-
has(name: string): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Filter helpers by the given criteria.
|
|
47
|
-
* @param filter The filter criteria.
|
|
48
|
-
* @returns The filtered helpers.
|
|
49
|
-
*/
|
|
50
|
-
filter(filter: HelperFilter): Helper[];
|
|
51
|
-
/**
|
|
52
|
-
* Load Handlebars helpers.
|
|
53
|
-
* @param {Handlebars} handlebars The Handlebars instance.
|
|
54
|
-
* @returns {void}
|
|
55
|
-
*/
|
|
56
|
-
load(handlebars: any, filters?: HelperFilter): void;
|
|
57
|
-
/**
|
|
58
|
-
* Swap Handlebars helpers. This is used when you want to swap out legacy helpers for fumanchu helpers.
|
|
59
|
-
* @param handlebars The Handlebars instance.
|
|
60
|
-
* @returns {void}
|
|
61
|
-
*/
|
|
62
|
-
swap(handlebars: any): void;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Handlebars library not initiated with helpers
|
|
67
|
-
* @type {Handlebars}
|
|
68
|
-
*/
|
|
69
|
-
declare const Handlebars: typeof HandlebarsLib;
|
|
70
|
-
/**
|
|
71
|
-
* Fumanchu Handlebars instance not initiated with helpers
|
|
72
|
-
* @type {Handlebars}
|
|
73
|
-
*/
|
|
74
|
-
declare const handlebars: typeof HandlebarsLib;
|
|
75
|
-
/**
|
|
76
|
-
* Fumanchu Handlebars helpers
|
|
77
|
-
*/
|
|
78
|
-
type HelpersOptions = {
|
|
79
|
-
handlebars?: typeof HandlebarsLib;
|
|
80
|
-
hbs?: typeof HandlebarsLib;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Register Handlebars helpers
|
|
84
|
-
* @param {HelpersOptions} options - Options for Fumanchu helpers
|
|
85
|
-
*/
|
|
86
|
-
declare function helpers(options: HelpersOptions): void;
|
|
87
|
-
/**
|
|
88
|
-
* Create a new Handlebars instance with Fumanchu helpers
|
|
89
|
-
* @returns {Promise<Handlebars>}
|
|
90
|
-
* @deprecated Will be deprecated in future versions, use `fumanchu()` instead.
|
|
91
|
-
*/
|
|
92
|
-
declare function createHandlebars(): Promise<typeof HandlebarsLib>;
|
|
93
|
-
type FumanchuOptions = {
|
|
94
|
-
handlebars?: typeof HandlebarsLib;
|
|
95
|
-
filter?: HelperFilter;
|
|
96
|
-
caching?: boolean | CacheableMemory | CacheableMemoryOptions;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Will return a Handlebars instance with Fumanchu helpers (experimental)
|
|
100
|
-
* @param {FumanchuOptions} [options] - Options for Fumanchu
|
|
101
|
-
* @returns {Handlebars} Handlebars instance with helpers
|
|
102
|
-
*/
|
|
103
|
-
declare function fumanchu(options?: FumanchuOptions): typeof HandlebarsLib;
|
|
104
|
-
|
|
105
|
-
export { type FumanchuOptions, Handlebars, type HelperFilter, HelperRegistry, type HelpersOptions, createHandlebars, fumanchu, handlebars, helpers };
|