svelteesp32 1.5.1 → 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 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/cppCode.js CHANGED
@@ -6,6 +6,7 @@ const commandLine_1 = require("./commandLine");
6
6
  const psychicTemplate = `
7
7
  //engine: PsychicHttpServer
8
8
  //cmdline: {{{commandLine}}}
9
+ //You should use server.config.max_uri_handlers = {{fileCount}}; or higher value to proper handles all files
9
10
  {{#if created }}
10
11
  //created: {{now}}
11
12
  {{/if}}
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_types_1 = require("mime-types");
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");
@@ -27,9 +27,9 @@ if (files.size === 0) {
27
27
  }
28
28
  console.log();
29
29
  console.log('Translation to header file');
30
- const longestFilename = [...files.keys()].reduce((p, c) => (c.length > p ? c.length : p), 0);
30
+ const longestFilename = [...files.keys()].reduce((p, c) => Math.max(c.length, p), 0);
31
31
  for (const [originalFilename, content] of files) {
32
- const mime = (0, mime_types_1.lookup)(originalFilename) || 'text/plain';
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.5.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",
@@ -38,8 +38,8 @@
38
38
  "format:fix": "prettier --write .",
39
39
  "lint:check": "eslint .",
40
40
  "lint:fix": "eslint --fix .",
41
- "fix": "npm run format:fix && npm run lint:fix",
42
- "npm:reinstall": "rm -rf ./node_modules && rm -f ./package-lock.json && npm i"
41
+ "fix": "npm run format:fix && npm run lint:fix && npm run format:fix",
42
+ "npm:reinstall": "rm -rf ./node_modules && rm -f ./package-lock.json && npm i && npm i"
43
43
  },
44
44
  "keywords": [
45
45
  "svelte",
@@ -54,24 +54,23 @@
54
54
  "espasyncwebserver"
55
55
  ],
56
56
  "devDependencies": {
57
- "@types/mime-types": "^2.1.4",
58
- "@types/node": "^22.5.4",
59
- "@typescript-eslint/eslint-plugin": "^8.4.0",
60
- "@typescript-eslint/parser": "^8.4.0",
61
- "eslint": "^9.10.0",
57
+ "@types/node": "^22.10.1",
58
+ "@typescript-eslint/eslint-plugin": "^8.17.0",
59
+ "@typescript-eslint/parser": "^8.17.0",
60
+ "eslint": "^9.16.0",
62
61
  "eslint-config-prettier": "^9.1.0",
63
62
  "eslint-plugin-simple-import-sort": "^12.1.1",
64
- "eslint-plugin-unicorn": "^55.0.0",
65
- "nodemon": "^3.1.4",
66
- "prettier": "^3.3.3",
63
+ "eslint-plugin-unicorn": "^56.0.1",
64
+ "nodemon": "^3.1.7",
65
+ "prettier": "^3.4.2",
67
66
  "ts-node": "^10.9.2",
68
- "tsx": "^4.19.0",
69
- "typescript": "^5.5.4"
67
+ "tsx": "^4.19.2",
68
+ "typescript": "^5.7.2"
70
69
  },
71
70
  "dependencies": {
72
71
  "glob": "^11.0.0",
73
72
  "handlebars": "^4.7.8",
74
- "mime-types": "^2.1.35",
73
+ "mime": "^4.0.4",
75
74
  "ts-command-line-args": "^2.5.1"
76
75
  }
77
76
  }