svelteesp32 1.5.2 → 1.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 +2 -0
- package/dist/index.js +4 -4
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ In order to be able to easily update OTA, it is important - from the users' poin
|
|
|
12
12
|
|
|
13
13
|
This npm package provides a solution for **inserting any JS client application into the ESP web server** (PsychicHttp and also ESPAsyncWebServer available, PsychicHttp is the default). For this, JS, html, css, font, assets, etc. files must be converted to binary byte array. Npm mode is easy to use and easy to **integrate into your CI/CD pipeline**.
|
|
14
14
|
|
|
15
|
+
> Starting with version v1.6.0, mime npm package is used instead of mime-types (application/javascript -> text/javascript)
|
|
16
|
+
|
|
15
17
|
> Starting with version v1.5.0, PsychicHttp v2 is also supported.
|
|
16
18
|
|
|
17
19
|
> Version v1.4.0 has a breaking change! --no-gzip changed to --gzip. Starting with this version c++ compiler directives are available to setup operation in project level.
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const node_crypto_1 = require("node:crypto");
|
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const node_zlib_1 = require("node:zlib");
|
|
10
|
-
const
|
|
10
|
+
const mime_1 = __importDefault(require("mime"));
|
|
11
11
|
const commandLine_1 = require("./commandLine");
|
|
12
12
|
const consoleColor_1 = require("./consoleColor");
|
|
13
13
|
const cppCode_1 = require("./cppCode");
|
|
@@ -29,7 +29,7 @@ console.log();
|
|
|
29
29
|
console.log('Translation to header file');
|
|
30
30
|
const longestFilename = [...files.keys()].reduce((p, c) => Math.max(c.length, p), 0);
|
|
31
31
|
for (const [originalFilename, content] of files) {
|
|
32
|
-
const
|
|
32
|
+
const mimeType = mime_1.default.getType(originalFilename) || 'text/plain';
|
|
33
33
|
summary.filecount++;
|
|
34
34
|
const filename = originalFilename.replace(/\\/g, '/');
|
|
35
35
|
const dataname = filename.replace(/[!&()+./@{}~-]/g, '_');
|
|
@@ -54,7 +54,7 @@ for (const [originalFilename, content] of files) {
|
|
|
54
54
|
content,
|
|
55
55
|
contentGzip: zipContent,
|
|
56
56
|
isGzip: true,
|
|
57
|
-
mime,
|
|
57
|
+
mime: mimeType,
|
|
58
58
|
md5
|
|
59
59
|
});
|
|
60
60
|
console.log((0, consoleColor_1.greenLog)(` [${originalFilename}] ${' '.repeat(longestFilename - originalFilename.length)} ✓ gzip used (${content.length} -> ${zipContent.length} = ${zipRatio}%)`));
|
|
@@ -67,7 +67,7 @@ for (const [originalFilename, content] of files) {
|
|
|
67
67
|
content,
|
|
68
68
|
contentGzip: content,
|
|
69
69
|
isGzip: false,
|
|
70
|
-
mime,
|
|
70
|
+
mime: mimeType,
|
|
71
71
|
md5
|
|
72
72
|
});
|
|
73
73
|
console.log((0, consoleColor_1.yellowLog)(` [${originalFilename}] ${' '.repeat(longestFilename - originalFilename.length)} x gzip unused ${content.length <= 1024 ? `(too small) ` : ''}(${content.length} -> ${zipContent.length} = ${zipRatio}%)`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelteesp32",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Convert Svelte (or any frontend) JS application to serve it from ESP32 webserver (PsychicHttp)",
|
|
5
5
|
"author": "BCsabaEngine",
|
|
6
6
|
"license": "ISC",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"espasyncwebserver"
|
|
55
55
|
],
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/mime-types": "^2.1.4",
|
|
58
57
|
"@types/node": "^22.10.1",
|
|
59
58
|
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
60
59
|
"@typescript-eslint/parser": "^8.17.0",
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
"dependencies": {
|
|
72
71
|
"glob": "^11.0.0",
|
|
73
72
|
"handlebars": "^4.7.8",
|
|
74
|
-
"mime
|
|
73
|
+
"mime": "^4.0.4",
|
|
75
74
|
"ts-command-line-args": "^2.5.1"
|
|
76
75
|
}
|
|
77
76
|
}
|