svelteesp32 1.7.0 → 1.8.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/README.md CHANGED
@@ -10,7 +10,9 @@ I often make small to medium-sized microcontroller solutions that run on ESP32 o
10
10
 
11
11
  In order to be able to easily update OTA, it is important - from the users' point of view - that the update file **consists of one file**. I can't use the SPIFFS/LittleFS solution for this. It is necessary that the WebUI files are included inline in the Arduino or PlatformIO c++ code.
12
12
 
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**.
13
+ This npm package provides a solution for **inserting any JS client application into the ESP web server** (PsychicHttp and also ESPAsyncWebServer (https://github.com/ESP32Async/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
+
15
+ > Starting with version v1.8.0, use the new and maintained ESPAsyncWebserver available at https://github.com/ESP32Async/ESPAsyncWebServer
14
16
 
15
17
  > Starting with version v1.7.0, with the cachetime command line option, you can set whether the browser can cache pages
16
18
 
@@ -154,7 +156,7 @@ void initSvelteStaticFiles(PsychicHttpServer * server) {
154
156
 
155
157
  ### Engines and ESP variants
156
158
 
157
- ESPAsyncWebServer is a popular web server that can be used on **both ESP32 and ESP8266 microcontrollers**. When you want to generate a file for this, use the `-e async` switch.
159
+ ESPAsyncWebServer (current location https://github.com/ESP32Async/ESPAsyncWebServer) is a popular web server. When you want to generate a file for this, use the `-e async` switch.
158
160
 
159
161
  If you **only work on ESP32**, I recommend using PsychicHttpServer, which uses the native mode ESP-IDF web server inside. This way, its operation is significantly faster and more continuous. You can access this mode with the `-e psychic` switch.
160
162
 
package/dist/cppCode.js CHANGED
@@ -505,22 +505,22 @@ void {{methodName}}(AsyncWebServer * server) {
505
505
 
506
506
  {{#switch ../gzip}}
507
507
  {{#case "true"}}
508
- AsyncWebServerResponse *response = request->beginResponse_P(200, "{{this.mime}}", datagzip_{{this.dataname}}, {{this.lengthGzip}});
508
+ AsyncWebServerResponse *response = request->beginResponse(200, "{{this.mime}}", datagzip_{{this.dataname}}, {{this.lengthGzip}});
509
509
  {{#if this.isGzip}}
510
510
  response->addHeader("Content-Encoding", "gzip");
511
511
  {{/if}}
512
512
  {{/case}}
513
513
  {{#case "false"}}
514
- AsyncWebServerResponse *response = request->beginResponse_P(200, "{{this.mime}}", data_{{this.dataname}}, {{this.length}});
514
+ AsyncWebServerResponse *response = request->beginResponse(200, "{{this.mime}}", data_{{this.dataname}}, {{this.length}});
515
515
  {{/case}}
516
516
  {{#case "compiler"}}
517
517
  #ifdef {{../definePrefix}}_ENABLE_GZIP
518
- AsyncWebServerResponse *response = request->beginResponse_P(200, "{{this.mime}}", datagzip_{{this.dataname}}, {{this.lengthGzip}});
518
+ AsyncWebServerResponse *response = request->beginResponse(200, "{{this.mime}}", datagzip_{{this.dataname}}, {{this.lengthGzip}});
519
519
  {{#if this.isGzip}}
520
520
  response->addHeader("Content-Encoding", "gzip");
521
521
  {{/if}}
522
522
  #else
523
- AsyncWebServerResponse *response = request->beginResponse_P(200, "{{this.mime}}", data_{{this.dataname}}, {{this.length}});
523
+ AsyncWebServerResponse *response = request->beginResponse(200, "{{this.mime}}", data_{{this.dataname}}, {{this.length}});
524
524
  #endif
525
525
  {{/case}}
526
526
  {{/switch}}
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 mime_1 = __importDefault(require("mime"));
10
+ const mime_types_1 = require("mime-types");
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 mimeType = mime_1.default.getType(originalFilename) || 'text/plain';
32
+ const mimeType = (0, mime_types_1.lookup)(originalFilename) || 'text/plain';
33
33
  summary.filecount++;
34
34
  const filename = originalFilename.replace(/\\/g, '/');
35
35
  const dataname = filename.replace(/[!&()+./@{}~-]/g, '_');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteesp32",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
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,23 +54,24 @@
54
54
  "espasyncwebserver"
55
55
  ],
56
56
  "devDependencies": {
57
- "@types/node": "^22.10.5",
58
- "@typescript-eslint/eslint-plugin": "^8.19.1",
59
- "@typescript-eslint/parser": "^8.19.1",
60
- "eslint": "^9.17.0",
61
- "eslint-config-prettier": "^9.1.0",
57
+ "@types/mime-types": "^2.1.4",
58
+ "@types/node": "^22.13.4",
59
+ "@typescript-eslint/eslint-plugin": "^8.24.1",
60
+ "@typescript-eslint/parser": "^8.24.1",
61
+ "eslint": "^9.20.1",
62
+ "eslint-config-prettier": "^10.0.1",
62
63
  "eslint-plugin-simple-import-sort": "^12.1.1",
63
- "eslint-plugin-unicorn": "^56.0.1",
64
+ "eslint-plugin-unicorn": "^57.0.0",
64
65
  "nodemon": "^3.1.9",
65
- "prettier": "^3.4.2",
66
+ "prettier": "^3.5.1",
66
67
  "ts-node": "^10.9.2",
67
- "tsx": "^4.19.2",
68
- "typescript": "^5.7.2"
68
+ "tsx": "^4.19.3",
69
+ "typescript": "^5.7.3"
69
70
  },
70
71
  "dependencies": {
71
- "glob": "^11.0.0",
72
+ "glob": "^11.0.1",
72
73
  "handlebars": "^4.7.8",
73
- "mime": "^4.0.6",
74
+ "mime-types": "^2.1.35",
74
75
  "ts-command-line-args": "^2.5.1"
75
76
  }
76
77
  }