@maizzle/framework 5.0.0 → 5.0.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 +4 -4
- package/src/server/routes/hmr.js +14 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.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",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"lodash-es": "^4.17.21",
|
|
66
66
|
"morphdom": "^2.7.4",
|
|
67
67
|
"ora": "^8.1.0",
|
|
68
|
-
"pathe": "^
|
|
68
|
+
"pathe": "^2.0.0",
|
|
69
69
|
"postcss": "^8.4.49",
|
|
70
70
|
"postcss-calc": "^10.0.2",
|
|
71
71
|
"postcss-css-variables": "^0.19.0",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"@biomejs/biome": "1.9.2",
|
|
98
98
|
"@types/js-beautify": "^1.14.3",
|
|
99
99
|
"@types/markdown-it": "^14.1.2",
|
|
100
|
-
"@vitest/coverage-v8": "^
|
|
100
|
+
"@vitest/coverage-v8": "^3.0.4",
|
|
101
101
|
"supertest": "^7.0.0",
|
|
102
|
-
"vitest": "^
|
|
102
|
+
"vitest": "^3.0.3"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
105
105
|
"node": ">=18.20"
|
package/src/server/routes/hmr.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import express from 'express'
|
|
2
|
-
const router = express.Router()
|
|
3
2
|
import fs from 'node:fs/promises'
|
|
4
|
-
import {
|
|
3
|
+
import { dirname, join } from 'pathe'
|
|
5
4
|
import { fileURLToPath } from 'node:url'
|
|
6
|
-
import {
|
|
5
|
+
import { createRequire } from 'node:module'
|
|
7
6
|
|
|
7
|
+
const router = express.Router()
|
|
8
|
+
const require = createRequire(import.meta.url)
|
|
8
9
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
9
10
|
|
|
10
11
|
router.get('/hmr.js', async (req, res) => {
|
|
11
|
-
|
|
12
|
-
resolve(
|
|
13
|
-
'utf8'
|
|
14
|
-
)
|
|
12
|
+
try {
|
|
13
|
+
const morphdomPath = require.resolve('morphdom/dist/morphdom-umd.js')
|
|
14
|
+
const morphdomScript = await fs.readFile(morphdomPath, 'utf8')
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
join(__dirname, '../client.js'),
|
|
18
|
-
'utf8'
|
|
19
|
-
)
|
|
16
|
+
const clientScript = await fs.readFile(join(__dirname, '../client.js'), 'utf8')
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
res.setHeader('Content-Type', 'application/javascript')
|
|
19
|
+
res.send(morphdomScript + clientScript)
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error('Error reading files:', error)
|
|
22
|
+
res.status(500).send('Internal Server Error')
|
|
23
|
+
}
|
|
23
24
|
})
|
|
24
25
|
|
|
25
26
|
export default router
|