@maizzle/framework 5.2.7 → 5.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
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",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"ws": "^8.18.0"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@biomejs/biome": "2.2.
|
|
100
|
+
"@biomejs/biome": "2.2.7",
|
|
101
101
|
"@types/js-beautify": "^1.14.3",
|
|
102
102
|
"@types/markdown-it": "^14.1.2",
|
|
103
103
|
"@vitest/coverage-v8": "^3.0.4",
|
|
@@ -7,21 +7,38 @@ const plugin = (env => tree => {
|
|
|
7
7
|
return node
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// Handle <env:?> tags (render only if current env matches)
|
|
11
|
+
if (
|
|
12
|
+
typeof node.tag === 'string'
|
|
13
|
+
&& node.tag.startsWith('env:')
|
|
14
|
+
) {
|
|
15
|
+
const tagEnv = node.tag.slice(4) // Remove 'env:' prefix
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
if (tagEnv === '' || tagEnv !== env) {
|
|
18
|
+
// No env specified or tag doesn't target current env, remove everything
|
|
19
|
+
node.content = []
|
|
20
|
+
node.tag = false
|
|
21
|
+
} else {
|
|
22
|
+
// Tag targets current env, remove tag and keep content
|
|
23
|
+
node.tag = false
|
|
24
|
+
}
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
//
|
|
27
|
+
// Handle <not-env:?> tags (render only if current env does not match)
|
|
18
28
|
if (
|
|
19
29
|
typeof node.tag === 'string'
|
|
20
|
-
&& node.tag.startsWith('env:')
|
|
21
|
-
&& tagEnv !== env
|
|
30
|
+
&& node.tag.startsWith('not-env:')
|
|
22
31
|
) {
|
|
23
|
-
node.
|
|
24
|
-
|
|
32
|
+
const tagEnv = node.tag.slice(8) // Remove 'not-env:' prefix
|
|
33
|
+
|
|
34
|
+
if (tagEnv === '' || tagEnv === env) {
|
|
35
|
+
// No env specified or tag targets current env, remove everything
|
|
36
|
+
node.content = []
|
|
37
|
+
node.tag = false
|
|
38
|
+
} else {
|
|
39
|
+
// Tag doesn't target current env, remove tag and keep content
|
|
40
|
+
node.tag = false
|
|
41
|
+
}
|
|
25
42
|
}
|
|
26
43
|
|
|
27
44
|
return node
|
package/src/server/index.js
CHANGED
|
@@ -258,7 +258,9 @@ export default async (config = {}) => {
|
|
|
258
258
|
staticFiles = [staticFiles]
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
const staticFilesSourcePaths = staticFiles
|
|
261
|
+
const staticFilesSourcePaths = staticFiles
|
|
262
|
+
.flatMap((definition) => definition.source)
|
|
263
|
+
.filter(p => typeof p === 'string')
|
|
262
264
|
|
|
263
265
|
/**
|
|
264
266
|
* Global watcher
|
|
@@ -273,7 +275,7 @@ export default async (config = {}) => {
|
|
|
273
275
|
'**/*.css',
|
|
274
276
|
...staticFilesSourcePaths,
|
|
275
277
|
...get(config, 'server.watch', []),
|
|
276
|
-
])
|
|
278
|
+
].filter(p => typeof p === 'string'))
|
|
277
279
|
|
|
278
280
|
async function globalPathsHandler(file, eventType) {
|
|
279
281
|
// Update express.static to serve new files
|