diff --git a/index.html b/index.html index e32de3e..13a3247 100644 --- a/index.html +++ b/index.html @@ -431,7 +431,6 @@

Publish your own firmware apps< - diff --git a/js/index.js b/js/index.js index 2a12dd1..aade826 100644 --- a/js/index.js +++ b/js/index.js @@ -30,6 +30,8 @@ let resizeTimeout = false; import * as utilities from "./utils.js"; import * as esptooljs from "../node_modules/esptool-js/bundle.js"; +import * as toml from '../node_modules/smol-toml/dist/index.js'; + const ESPLoader = esptooljs.ESPLoader; const Transport = esptooljs.Transport; @@ -178,7 +180,7 @@ function populateSupportedChipsets(deviceConfig) { inputElement.setAttribute("class", "form-check-input"); inputElement.name = "chipType"; inputElement.id = "radio-" + chipset; - inputElement.value = deviceConfig["image." + chipset.toLowerCase()]; + inputElement.value = deviceConfig["image"][chipset.toLowerCase()]; if (chipset.toLowerCase() === chip.toLowerCase()) inputElement.checked = true; diff --git a/minimal-launchpad/index.html b/minimal-launchpad/index.html index 2742f8b..69bde08 100644 --- a/minimal-launchpad/index.html +++ b/minimal-launchpad/index.html @@ -96,7 +96,6 @@

- diff --git a/minimal-launchpad/minimal_ui_index.js b/minimal-launchpad/minimal_ui_index.js index 7fd6522..fc0b3e0 100644 --- a/minimal-launchpad/minimal_ui_index.js +++ b/minimal-launchpad/minimal_ui_index.js @@ -10,6 +10,8 @@ const message = document.getElementById("message"); import * as utilities from "../js/utils.js" import * as esptooljs from "../node_modules/esptool-js/bundle.js"; +import * as toml from '../node_modules/smol-toml/dist/index.js'; + const ESPLoader = esptooljs.ESPLoader; const Transport = esptooljs.Transport; @@ -39,19 +41,17 @@ var config = []; // Code for minimalLaunchpad function setImagePartsAndOffsetArray() { - let application = "supported_apps"; + let app = config[config["supported_apps"][0]]; let chipInConfToml = undefined; - let imageString = undefined; - let addressString = undefined; + let appImageObj = undefined; if (chip !== "default" && config["multipart"]) { chipInConfToml = config["chip"]; + appImageObj = app["image"][chipInConfToml.toLowerCase()]; } if (chip !== "default" && chipInConfToml !== undefined) { - imageString = "image." + chipInConfToml.toLowerCase() + ".parts"; - addressString = "image." + chipInConfToml.toLowerCase() + ".addresses"; + imagePartsArray = appImageObj["parts"]; + imagePartsOffsetArray = appImageObj["addresses"]; } - imagePartsArray = config[config[application][0]][imageString]; - imagePartsOffsetArray = config[config[application][0]][addressString]; } async function downloadAndFlash() { @@ -79,7 +79,7 @@ function MDtoHtml() { var converter = new showdown.Converter({ tables: true }); converter.setFlavor('github'); try { - fetch(config[config[application][0]]["readme.text"]).then(response => { + fetch(config[config[application][0]]["readme"]["text"]).then(response => { return response.text(); }).then(result => { let htmlText = converter.makeHtml(result); diff --git a/package-lock.json b/package-lock.json index 1e66981..59ccaa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "dependencies": { "crypto-js": "^4.1.1", "esptool-js": "^0.3.0", - "toml-js": "^0.0.8", + "smol-toml": "^1.1.2", "xterm": "^4.17.0", "xterm-addon-fit": "^0.5.0" } @@ -32,10 +32,14 @@ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, - "node_modules/toml-js": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/toml-js/-/toml-js-0.0.8.tgz", - "integrity": "sha512-MQUXr5oq9fgOQIcucZuda1BtGUmQRt3Y2z1TY9JT3oUR6gs1qLkbsGfVdlr/gJ6JqrjJdPLO5wNXCgkmvzXNTQ==" + "node_modules/smol-toml": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.1.2.tgz", + "integrity": "sha512-opeweddRVyIFjnNPmEodUn4LlVeiZNE3OZ3QiLvyC/pWxNgW3z02oCTVOFVgYI1w1sSO4nifFCcvw1ADOMs5ag==", + "engines": { + "node": ">= 18", + "pnpm": ">= 8" + } }, "node_modules/tslib": { "version": "2.4.1", @@ -76,10 +80,10 @@ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, - "toml-js": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/toml-js/-/toml-js-0.0.8.tgz", - "integrity": "sha512-MQUXr5oq9fgOQIcucZuda1BtGUmQRt3Y2z1TY9JT3oUR6gs1qLkbsGfVdlr/gJ6JqrjJdPLO5wNXCgkmvzXNTQ==" + "smol-toml": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.1.2.tgz", + "integrity": "sha512-opeweddRVyIFjnNPmEodUn4LlVeiZNE3OZ3QiLvyC/pWxNgW3z02oCTVOFVgYI1w1sSO4nifFCcvw1ADOMs5ag==" }, "tslib": { "version": "2.4.1", diff --git a/package.json b/package.json index 8b0fb28..0036e58 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "dependencies": { "crypto-js": "^4.1.1", "esptool-js": "^0.3.0", - "toml-js": "^0.0.8", + "smol-toml": "^1.1.2", "xterm": "^4.17.0", "xterm-addon-fit": "^0.5.0" }