@maizzle/framework 5.0.0-beta.16 → 5.0.0-beta.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "5.0.0-beta.16",
3
+ "version": "5.0.0-beta.17",
4
4
  "description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -63,7 +63,7 @@ export async function process(html = '', config = {}) {
63
63
  },
64
64
  ),
65
65
  },
66
- get(config, 'build.fetch', {})
66
+ get(config, 'fetch', {})
67
67
  )
68
68
  )
69
69
 
@@ -87,6 +87,8 @@ export async function process(html = '', config = {}) {
87
87
  ),
88
88
  expandLinkTag,
89
89
  postcssPlugin,
90
+ envTags(config.env),
91
+ envAttributes(config.env),
90
92
  ...get(config, 'posthtml.plugins.after', get(config, 'posthtml.plugins', []))
91
93
  ])
92
94
  .process(html, posthtmlOptions)
package/types/config.d.ts CHANGED
@@ -12,6 +12,7 @@ import type WidowWordsConfig from './widowWords';
12
12
  import type { CoreBeautifyOptions } from 'js-beautify';
13
13
  import type { BaseURLConfig } from 'posthtml-base-url';
14
14
  import type URLParametersConfig from './urlParameters';
15
+ import type { PostHTMLFetchConfig } from 'posthtml-fetch';
15
16
  import type { PostHTMLComponents } from 'posthtml-component';
16
17
 
17
18
  import type { Config as TailwindConfig } from 'tailwindcss';
@@ -169,6 +170,11 @@ export default interface Config {
169
170
  tailwind?: TailwindConfig;
170
171
  }
171
172
 
173
+ /**
174
+ * Configure the [`<fetch>`](https://maizzle.com/docs/tags#fetch) tag.
175
+ */
176
+ fetch?: PostHTMLFetchConfig;
177
+
172
178
  /**
173
179
  * Transform text inside elements marked with custom attributes.
174
180
  * Filters work only on elements that contain only text.
package/types/events.d.ts CHANGED
@@ -18,7 +18,12 @@ export default interface Events {
18
18
  * }
19
19
  * ```
20
20
  */
21
- beforeCreate?: (params: { config: Config }) => void | Promise<void>;
21
+ beforeCreate?: (params: {
22
+ /**
23
+ * The computed Maizzle config object.
24
+ */
25
+ config: Config
26
+ }) => void | Promise<void>;
22
27
 
23
28
  /**
24
29
  * Runs after the Template's config has been computed, but just before it is compiled.
@@ -43,11 +48,13 @@ export default interface Events {
43
48
  */
44
49
  html: string;
45
50
  /**
46
- * The Template's Front Matter.
51
+ * The Template's Front Matter data.
47
52
  */
48
53
  matter: { [key: string]: string };
49
54
  /**
50
55
  * The Template's computed config.
56
+ *
57
+ * This is the Environment config merged with the Template's Front Matter.
51
58
  */
52
59
  config: Config;
53
60
  /**
@@ -82,11 +89,13 @@ export default interface Events {
82
89
  */
83
90
  html: string;
84
91
  /**
85
- * The Template's Front Matter.
92
+ * The Template's Front Matter data.
86
93
  */
87
94
  matter: { [key: string]: string };
88
95
  /**
89
96
  * The Template's computed config.
97
+ *
98
+ * This is the Environment config merged with the Template's Front Matter.
90
99
  */
91
100
  config: Config;
92
101
  /**
@@ -121,11 +130,13 @@ export default interface Events {
121
130
  */
122
131
  html: string;
123
132
  /**
124
- * The Template's Front Matter.
133
+ * The Template's Front Matter data.
125
134
  */
126
135
  matter: { [key: string]: string };
127
136
  /**
128
137
  * The Template's computed config.
138
+ *
139
+ * This is the Environment config merged with the Template's Front Matter.
129
140
  */
130
141
  config: Config;
131
142
  /**
@@ -146,7 +157,7 @@ export default interface Events {
146
157
  * @example
147
158
  * ```
148
159
  * export default {
149
- * afterBuild: async ({files, config}) => {
160
+ * afterBuild: async ({config, files}) => {
150
161
  * // do something...
151
162
  * }
152
163
  * }
@@ -154,12 +165,12 @@ export default interface Events {
154
165
  */
155
166
  afterBuild?: (params: {
156
167
  /**
157
- * An array of paths to all the files inside the `build.output.path` directory.
168
+ * The computed Maizzle config object.
158
169
  */
159
- files: string[];
170
+ config: Config;
160
171
  /**
161
- * The Maizzle config object.
172
+ * An array of paths to all the files inside the `build.output.path` directory.
162
173
  */
163
- config: Config;
174
+ files: string[];
164
175
  }) => string | Promise<string>;
165
176
  }