@maizzle/framework 5.0.0-beta.9 → 5.0.0
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/package.json +31 -29
- package/src/commands/build.js +106 -30
- package/src/generators/plaintext.js +22 -18
- package/src/generators/render.js +16 -18
- package/src/index.js +3 -3
- package/src/posthtml/defaultComponentsConfig.js +10 -2
- package/src/posthtml/defaultConfig.js +13 -3
- package/src/posthtml/index.js +59 -14
- package/src/server/index.js +171 -98
- package/src/server/routes/index.js +51 -13
- package/src/server/views/404.html +59 -0
- package/src/server/views/index.html +162 -14
- package/src/transformers/addAttributes.js +2 -3
- package/src/transformers/attributeToStyle.js +1 -3
- package/src/transformers/baseUrl.js +6 -6
- package/src/transformers/filters/index.js +1 -2
- package/src/transformers/index.js +57 -95
- package/src/transformers/inline.js +44 -48
- package/src/transformers/markdown.js +14 -7
- package/src/transformers/minify.js +4 -3
- package/src/transformers/posthtmlMso.js +1 -3
- package/src/transformers/prettify.js +4 -3
- package/src/transformers/preventWidows.js +15 -65
- package/src/transformers/{comb.js → purge.js} +9 -8
- package/src/transformers/removeAttributes.js +3 -4
- package/src/transformers/replaceStrings.js +7 -5
- package/src/transformers/safeClassNames.js +1 -2
- package/src/transformers/shorthandCss.js +1 -3
- package/src/transformers/sixHex.js +1 -3
- package/src/transformers/template.js +9 -9
- package/src/transformers/urlParameters.js +1 -3
- package/src/transformers/useAttributeSizes.js +1 -3
- package/src/utils/getConfigByFilePath.js +10 -0
- package/src/utils/node.js +0 -23
- package/src/utils/string.js +34 -12
- package/types/build.d.ts +51 -28
- package/types/config.d.ts +127 -64
- package/types/css/inline.d.ts +10 -26
- package/types/css/purge.d.ts +3 -3
- package/types/events.d.ts +153 -5
- package/types/index.d.ts +4 -3
- package/types/posthtml.d.ts +3 -3
- package/types/urlParameters.d.ts +1 -1
- package/types/widowWords.d.ts +16 -36
- package/types/components.d.ts +0 -195
- package/types/expressions.d.ts +0 -100
package/types/events.d.ts
CHANGED
|
@@ -1,5 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type Config from "./config";
|
|
2
|
+
|
|
3
|
+
export default interface Events {
|
|
4
|
+
/**
|
|
5
|
+
* Runs after the Environment config has been computed, but before Templates are processed.
|
|
6
|
+
* Exposes the `config` object so you can further customize it.
|
|
7
|
+
*
|
|
8
|
+
* @default undefined
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* export default {
|
|
13
|
+
* beforeCreate: async ({config}) => {
|
|
14
|
+
* // do something with `config`
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
beforeCreate?: (params: {
|
|
20
|
+
/**
|
|
21
|
+
* The computed Maizzle config object.
|
|
22
|
+
*/
|
|
23
|
+
config: Config
|
|
24
|
+
}) => void | Promise<void>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Runs after the Template's config has been computed, but just before it is compiled.
|
|
28
|
+
*
|
|
29
|
+
* Must return the `html` string, otherwise the original will be used.
|
|
30
|
+
*
|
|
31
|
+
* @default undefined
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```
|
|
35
|
+
* export default {
|
|
36
|
+
* beforeRender: async ({html, matter, config, posthtml}) => {
|
|
37
|
+
* // do something...
|
|
38
|
+
* return html;
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
beforeRender?: (params: {
|
|
44
|
+
/**
|
|
45
|
+
* The Template's HTML string.
|
|
46
|
+
*/
|
|
47
|
+
html: string;
|
|
48
|
+
/**
|
|
49
|
+
* The Template's Front Matter data.
|
|
50
|
+
*/
|
|
51
|
+
matter: { [key: string]: string };
|
|
52
|
+
/**
|
|
53
|
+
* The Template's computed config.
|
|
54
|
+
*
|
|
55
|
+
* This is the Environment config merged with the Template's Front Matter.
|
|
56
|
+
*/
|
|
57
|
+
config: Config;
|
|
58
|
+
}) => string | Promise<string>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Runs after the Template has been compiled, but before any Transformers have been applied.
|
|
62
|
+
*
|
|
63
|
+
* Must return the `html` string, otherwise the original will be used.
|
|
64
|
+
*
|
|
65
|
+
* @default undefined
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```
|
|
69
|
+
* export default {
|
|
70
|
+
* afterRender: async async ({html, matter, config, posthtml}) => {
|
|
71
|
+
* // do something...
|
|
72
|
+
* return html;
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
afterRender?: (params: {
|
|
78
|
+
/**
|
|
79
|
+
* The Template's HTML string.
|
|
80
|
+
*/
|
|
81
|
+
html: string;
|
|
82
|
+
/**
|
|
83
|
+
* The Template's Front Matter data.
|
|
84
|
+
*/
|
|
85
|
+
matter: { [key: string]: string };
|
|
86
|
+
/**
|
|
87
|
+
* The Template's computed config.
|
|
88
|
+
*
|
|
89
|
+
* This is the Environment config merged with the Template's Front Matter.
|
|
90
|
+
*/
|
|
91
|
+
config: Config;
|
|
92
|
+
}) => string | Promise<string>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Runs after all Transformers have been applied, just before the final HTML is returned.
|
|
96
|
+
*
|
|
97
|
+
* Must return the `html` string, otherwise the original will be used.
|
|
98
|
+
*
|
|
99
|
+
* @default undefined
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```
|
|
103
|
+
* export default {
|
|
104
|
+
* afterTransformers: async ({html, matter, config, posthtml}) => {
|
|
105
|
+
* // do something...
|
|
106
|
+
* return html;
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
afterTransformers?: (params: {
|
|
112
|
+
/**
|
|
113
|
+
* The Template's HTML string.
|
|
114
|
+
*/
|
|
115
|
+
html: string;
|
|
116
|
+
/**
|
|
117
|
+
* The Template's Front Matter data.
|
|
118
|
+
*/
|
|
119
|
+
matter: { [key: string]: string };
|
|
120
|
+
/**
|
|
121
|
+
* The Template's computed config.
|
|
122
|
+
*
|
|
123
|
+
* This is the Environment config merged with the Template's Front Matter.
|
|
124
|
+
*/
|
|
125
|
+
config: Config;
|
|
126
|
+
}) => string | Promise<string>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Runs after all Templates have been compiled and output to disk.
|
|
130
|
+
* `files` will contain the paths to all the files inside the `build.output.path` directory.
|
|
131
|
+
*
|
|
132
|
+
* @default undefined
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```
|
|
136
|
+
* export default {
|
|
137
|
+
* afterBuild: async ({config, files}) => {
|
|
138
|
+
* // do something...
|
|
139
|
+
* }
|
|
140
|
+
* }
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
afterBuild?: (params: {
|
|
144
|
+
/**
|
|
145
|
+
* The computed Maizzle config object.
|
|
146
|
+
*/
|
|
147
|
+
config: Config;
|
|
148
|
+
/**
|
|
149
|
+
* An array of paths to all the files inside the `build.output.path` directory.
|
|
150
|
+
*/
|
|
151
|
+
files: string[];
|
|
152
|
+
}) => string | Promise<string>;
|
|
153
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -37,10 +37,11 @@ declare namespace MaizzleFramework {
|
|
|
37
37
|
*
|
|
38
38
|
* @param {string} input The Markdown string to compile.
|
|
39
39
|
* @param {MarkdownConfig} [options] A configuration object for the Markdown compiler.
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
40
|
+
* @param {PostHTMLConfig} [posthtmlOptions] A configuration object for PostHTML.
|
|
41
|
+
* @returns {Promise<string>} The compiled HTML string.
|
|
42
|
+
* @see https://maizzle.com/docs/markdown#api
|
|
42
43
|
*/
|
|
43
|
-
function markdown(input: string, options?: MarkdownConfig): string
|
|
44
|
+
function markdown(input: string, options?: MarkdownConfig, posthtmlOptions?: PostHTMLConfig): Promise<string>;
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Prevent widow words inside a tag by adding a ` ` between its last two words.
|
package/types/posthtml.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Directive } from 'posthtml-parser';
|
|
2
|
-
import type
|
|
2
|
+
import type { PostHTMLExpressions } from 'posthtml-expressions';
|
|
3
3
|
|
|
4
4
|
export interface PostHTMLOptions {
|
|
5
5
|
/**
|
|
@@ -128,9 +128,9 @@ export interface PostHTMLOptions {
|
|
|
128
128
|
|
|
129
129
|
export default interface PostHTMLConfig {
|
|
130
130
|
/**
|
|
131
|
-
Configure expressions.
|
|
131
|
+
Configure [posthtml-expressions](https://github.com/posthtml/posthtml-expressions) options.
|
|
132
132
|
*/
|
|
133
|
-
expressions?:
|
|
133
|
+
expressions?: PostHTMLExpressions;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
Configure PostHTML options.
|
package/types/urlParameters.d.ts
CHANGED
package/types/widowWords.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { Opts } from 'string-remove-widows';
|
|
2
|
-
|
|
3
1
|
export default interface WidowWordsConfig {
|
|
4
2
|
/**
|
|
5
3
|
The attribute name to use.
|
|
6
4
|
|
|
7
|
-
@default 'prevent-widows'
|
|
5
|
+
@default ['prevent-widows', 'no-widows']
|
|
8
6
|
*/
|
|
9
|
-
|
|
7
|
+
attributes?: Array<string>;
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
Replace all widow word `nbsp;` instances with a single space.
|
|
@@ -14,45 +12,27 @@ export default interface WidowWordsConfig {
|
|
|
14
12
|
|
|
15
13
|
@default false
|
|
16
14
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
Convert the space entity to the `targetLanguage`.
|
|
21
|
-
|
|
22
|
-
@default true
|
|
23
|
-
*/
|
|
24
|
-
convertEntities?: Opts['convertEntities'];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
Language to encode non-breaking spaces in.
|
|
28
|
-
|
|
29
|
-
@default 'html'
|
|
30
|
-
*/
|
|
31
|
-
targetLanguage?: Opts['targetLanguage'];
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
Should whitespace in front of dashes (-), n-dashes (–) or m-dashes (—) be replaced with a ` `.
|
|
35
|
-
|
|
36
|
-
@default true
|
|
37
|
-
*/
|
|
38
|
-
hyphens?: Opts['hyphens'];
|
|
15
|
+
createWidows?: Boolean;
|
|
39
16
|
|
|
40
17
|
/**
|
|
41
18
|
The minimum amount of words in a target string, in order to trigger the transformer.
|
|
42
19
|
|
|
43
20
|
@default 3
|
|
44
21
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
The minimum amount non-whitespace characters in a target string, in order to trigger the transformer.
|
|
49
|
-
|
|
50
|
-
@default 20
|
|
51
|
-
*/
|
|
52
|
-
minCharCount?: Opts['minCharCount'];
|
|
22
|
+
minWords?: Number;
|
|
53
23
|
|
|
54
24
|
/**
|
|
55
25
|
Start/end pairs of strings that will prevent the transformer from removing widow words inside them.
|
|
56
|
-
|
|
57
|
-
|
|
26
|
+
|
|
27
|
+
@default [
|
|
28
|
+
{ start: '{{', end: '}}' }, // Handlebars, Liquid, Nunjucks, Twig, Jinja2, Mustache
|
|
29
|
+
{ start: '{%', end: '%}' }, // Liquid, Nunjucks, Twig, Jinja2
|
|
30
|
+
{ start: '<%=', end: '%>' }, // EJS, ERB
|
|
31
|
+
{ start: '<%', end: '%>' }, // EJS, ERB
|
|
32
|
+
{ start: '{$', end: '}' }, // Smarty
|
|
33
|
+
{ start: '<\\?', end: '\\?>' }, // PHP
|
|
34
|
+
{ start: '#{', end: '}' } // Pug
|
|
35
|
+
]
|
|
36
|
+
*/
|
|
37
|
+
ignore?: Array<{ start: string; end: string }>;
|
|
58
38
|
}
|
package/types/components.d.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import type ExpressionsConfig from './expressions';
|
|
2
|
-
import type { Options as PostHTMLParserOptions } from 'posthtml-parser';
|
|
3
|
-
|
|
4
|
-
interface AnyObject {
|
|
5
|
-
[key: string]: string | AnyObject;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default interface ComponentsConfig {
|
|
9
|
-
/**
|
|
10
|
-
* Root path where to look for folders containing component files.
|
|
11
|
-
*
|
|
12
|
-
* @default './'
|
|
13
|
-
*/
|
|
14
|
-
root?: string;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Paths where to look for component files. Must be relative to `root`.
|
|
18
|
-
*
|
|
19
|
-
* @default ['src/components', 'src/layouts', 'src/templates']
|
|
20
|
-
*/
|
|
21
|
-
folders?: string[];
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Prefix to use for component tags.
|
|
25
|
-
*
|
|
26
|
-
* @default 'x-'
|
|
27
|
-
*/
|
|
28
|
-
tagPrefix?: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Tag name to be used in HTML when using a component.
|
|
32
|
-
*
|
|
33
|
-
* @default 'component'
|
|
34
|
-
*/
|
|
35
|
-
tag?: string;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Attribute name to be used when referencing a component via its path.
|
|
39
|
-
*
|
|
40
|
-
* @default 'src'
|
|
41
|
-
*/
|
|
42
|
-
attribute?: string;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* File extension that component files must use.
|
|
46
|
-
* Any other files will be ignored and not be made available as components.
|
|
47
|
-
*
|
|
48
|
-
* @default 'html'
|
|
49
|
-
*/
|
|
50
|
-
fileExtension?: string;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Name of the tag that will be replaced with the content that is passed to the component.
|
|
54
|
-
*
|
|
55
|
-
* @default 'yield'
|
|
56
|
-
*/
|
|
57
|
-
yield?: string;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Name of the slot tag, where the content will be injected.
|
|
61
|
-
*
|
|
62
|
-
* @default 'slot'
|
|
63
|
-
*/
|
|
64
|
-
slot?: string;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Name of the fill tag, where the content to be injected is defined.
|
|
68
|
-
*
|
|
69
|
-
* @default 'fill'
|
|
70
|
-
*/
|
|
71
|
-
fill?: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* String to use as a separator between the slot tag and its name.
|
|
75
|
-
*
|
|
76
|
-
* @default ':'
|
|
77
|
-
*/
|
|
78
|
-
slotSeparator?: string;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Tag name for pushing content to a stack.
|
|
82
|
-
*
|
|
83
|
-
* @default 'push'
|
|
84
|
-
*/
|
|
85
|
-
push?: string;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Tag name for popping (rendering) content from a stack.
|
|
89
|
-
*
|
|
90
|
-
* @default 'stack'
|
|
91
|
-
*/
|
|
92
|
-
stack?: string;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Name of the props attribute to use in the `<script>` tag of a component.
|
|
96
|
-
*
|
|
97
|
-
* @default 'props'
|
|
98
|
-
*/
|
|
99
|
-
propsScriptAttribute?: string;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Name of the object that will be used to store the props of a component.
|
|
103
|
-
*
|
|
104
|
-
* @default 'props'
|
|
105
|
-
*/
|
|
106
|
-
propsContext?: string;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Name of the attribute that will be used to pass props to a component as JSON.
|
|
110
|
-
*
|
|
111
|
-
* @default 'locals'
|
|
112
|
-
*/
|
|
113
|
-
propsAttribute?: string;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Name of the key to use when retrieving props passed to a slot via `$slots.slotName.props`.
|
|
117
|
-
*
|
|
118
|
-
* @default 'props'
|
|
119
|
-
*/
|
|
120
|
-
propsSlot?: string;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Configure [`posthtml-parser`](https://github.com/posthtml/posthtml-parser).
|
|
124
|
-
*
|
|
125
|
-
* @default
|
|
126
|
-
* {
|
|
127
|
-
* recognizeNoValueAttribute: true,
|
|
128
|
-
* recognizeSelfClosing: true
|
|
129
|
-
* }
|
|
130
|
-
*/
|
|
131
|
-
parserOptions?: PostHTMLParserOptions;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Configure [`posthtml-expressions`](https://github.com/posthtml/posthtml-expressions).
|
|
135
|
-
*
|
|
136
|
-
* @default
|
|
137
|
-
* {
|
|
138
|
-
* strictMode: false,
|
|
139
|
-
* missingLocal: '{local}',
|
|
140
|
-
* locals: {
|
|
141
|
-
* page: config, // the computed Maizzle config object
|
|
142
|
-
* }
|
|
143
|
-
* }
|
|
144
|
-
*/
|
|
145
|
-
expressions?: ExpressionsConfig;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* PostHTML plugins to apply to each parsed component.
|
|
149
|
-
*
|
|
150
|
-
* @default []
|
|
151
|
-
*/
|
|
152
|
-
plugins?: Array<() => void>;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Extra rules for the PostHTML plugin that is used by components to parse attributes.
|
|
156
|
-
*
|
|
157
|
-
* @default {}
|
|
158
|
-
*/
|
|
159
|
-
attrsParserRules?: Record<string, AnyObject>;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* In strict mode, an error will be thrown if a component cannot be rendered.
|
|
163
|
-
*
|
|
164
|
-
* @default true
|
|
165
|
-
*/
|
|
166
|
-
strict?: boolean;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Utility methods to be passed to `<script props>` in a component.
|
|
170
|
-
*
|
|
171
|
-
* @default {merge: _.mergeWith, template: _.template}
|
|
172
|
-
*/
|
|
173
|
-
utilities?: Record<string, unknown>;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Define additional attributes that should be preserved for specific HTML elements.
|
|
177
|
-
*
|
|
178
|
-
* @default {}
|
|
179
|
-
*/
|
|
180
|
-
elementAttributes?: Record<string, void>;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Attributes that should be preserved on all elements in components.
|
|
184
|
-
*
|
|
185
|
-
* @default ['data-*']
|
|
186
|
-
*/
|
|
187
|
-
safelistAttributes?: string[];
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Attributes that should be removed from all elements in components.
|
|
191
|
-
*
|
|
192
|
-
* @default []
|
|
193
|
-
*/
|
|
194
|
-
blacklistAttributes?: string[];
|
|
195
|
-
}
|
package/types/expressions.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
export default interface ExpressionsConfig {
|
|
2
|
-
/**
|
|
3
|
-
Define the starting and ending delimiters used for expressions.
|
|
4
|
-
|
|
5
|
-
@default ['{{', '}}']
|
|
6
|
-
*/
|
|
7
|
-
delimiters?: string[];
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
Define the starting and ending delimiters used for unescaped expressions.
|
|
11
|
-
|
|
12
|
-
@default ['{{{', '}}}']
|
|
13
|
-
*/
|
|
14
|
-
unescapeDelimiters?: string[];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
Object containing data that will be available under the `page` object.
|
|
18
|
-
|
|
19
|
-
@default {}
|
|
20
|
-
*/
|
|
21
|
-
locals?: Record<string, unknown>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
Attribute name for `<script>` tags that contain locals.
|
|
25
|
-
|
|
26
|
-
@default 'locals'
|
|
27
|
-
*/
|
|
28
|
-
localsAttr?: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
Whether to remove `<script>` tags that contain locals.
|
|
32
|
-
|
|
33
|
-
@default false
|
|
34
|
-
*/
|
|
35
|
-
removeScriptLocals?: boolean;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
Tag names to be used for if/else statements.
|
|
39
|
-
|
|
40
|
-
@default ['if', 'elseif', 'else']
|
|
41
|
-
*/
|
|
42
|
-
conditionalTags?: string[];
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
Tag names to be used for switch statements.
|
|
46
|
-
|
|
47
|
-
@default ['switch', 'case', 'default']
|
|
48
|
-
*/
|
|
49
|
-
switchTags?: string[];
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
Tag names to be used for loops.
|
|
53
|
-
|
|
54
|
-
@default ['each', 'for']
|
|
55
|
-
*/
|
|
56
|
-
loopTags?: string[];
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
Tag names to be used for scopes.
|
|
60
|
-
|
|
61
|
-
@default ['scope']
|
|
62
|
-
*/
|
|
63
|
-
scopeTags?: string[];
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
Name of tag inside of which expression parsing is disabled.
|
|
67
|
-
|
|
68
|
-
@default 'raw'
|
|
69
|
-
*/
|
|
70
|
-
ignoredTag?: string;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
Enabling strict mode will throw an error if an expression cannot be evaluated.
|
|
74
|
-
|
|
75
|
-
@default false
|
|
76
|
-
*/
|
|
77
|
-
strictMode?: boolean;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
What to render when referencing a value that is not defined in `locals`.
|
|
81
|
-
|
|
82
|
-
By default, the string 'undefined' will be output.
|
|
83
|
-
|
|
84
|
-
@default undefined
|
|
85
|
-
|
|
86
|
-
@example
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
// Output empty string if value is not defined
|
|
90
|
-
missingLocal: ''
|
|
91
|
-
|
|
92
|
-
// Output original reference if value is not defined
|
|
93
|
-
missingLocal: '{local}'
|
|
94
|
-
|
|
95
|
-
// Output custom string if value is not defined
|
|
96
|
-
missingLocal: 'ERR_NO_VALUE: {local}'
|
|
97
|
-
```
|
|
98
|
-
*/
|
|
99
|
-
missingLocal?: string;
|
|
100
|
-
}
|