From 7eef95f57c45d3469b699eb435d1e35b32731cde Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 14 Mar 2023 21:58:54 +0100 Subject: [PATCH 1/7] lint warning fix --- interface/src/framework/security/UserForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/framework/security/UserForm.tsx b/interface/src/framework/security/UserForm.tsx index f17c9dfbd..57b88472c 100644 --- a/interface/src/framework/security/UserForm.tsx +++ b/interface/src/framework/security/UserForm.tsx @@ -1,4 +1,4 @@ -import { FC, useState, useEffect } from 'react'; +import React, { FC, useState, useEffect } from 'react'; import Schema, { ValidateFieldsError } from 'async-validator'; import CancelIcon from '@mui/icons-material/Cancel'; From 70eb9e6b0868f87f8d94eabf3578eb4f5c536282 Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 14 Mar 2023 21:59:07 +0100 Subject: [PATCH 2/7] fix no web translations --- interface/src/i18n/no/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index ffbc15a9d..7e327c4e0 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -99,10 +99,10 @@ const no: Translation = { NUM_DEVICES: '{num} Enhet{{er}}', NUM_TEMP_SENSORS: '{num} Temperatursensor{{er}}', NUM_ANALOG_SENSORS: '{num} Analogsensor{{er}}', - NUM_DAYS: '{num} sag{{er}}', - NUM_SECONDS: '{num} sekund{{er}}', - NUM_HOURS: '{num} time{{r}}', - NUM_MINUTES: '{num} minutt{{er}}', + NUM_DAYS: '{num} Dag{{er}}', + NUM_SECONDS: '{num} Sekund{{er}}', + NUM_HOURS: '{num} Time{{r}}', + NUM_MINUTES: '{num} Minutt{{er}}', APPLICATION_SETTINGS: 'Innstillinger', CUSTOMIZATIONS: 'Tilpasninger', APPLICATION_RESTARTING: 'EMS-ESP restarter', From ec8b55c1e8c18928c7d7df016be79d72adf5572a Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 14 Mar 2023 21:59:25 +0100 Subject: [PATCH 3/7] package updates --- interface/.eslintignore | 3 +- interface/package.json | 19 ++- interface/yarn.lock | 328 +++++++++++++++++++++++++--------------- yarn.lock | 4 - 4 files changed, 218 insertions(+), 136 deletions(-) delete mode 100644 yarn.lock diff --git a/interface/.eslintignore b/interface/.eslintignore index 13595478c..68ad634f1 100644 --- a/interface/.eslintignore +++ b/interface/.eslintignore @@ -1,6 +1,7 @@ node_modules/ build/ +dist/ .prettierrc -.eslintrc.js +.eslintrc* .yarn/ env.d.ts diff --git a/interface/package.json b/interface/package.json index 74a6e2dfb..9ad5a4fb9 100644 --- a/interface/package.json +++ b/interface/package.json @@ -16,18 +16,19 @@ "standalone": "npm-run-all -p dev typesafe-i18n mock-api", "typesafe-i18n": "typesafe-i18n", "format": "prettier --write '**/*.{ts,tsx,js,css,json,md}'", - "lint": "eslint . --ext .ts,.tsx" + "lint": "tsc --noEmit && eslint src/**/*.ts{,x} --cache --max-warnings=0", + "lint:fix": "eslint src/**/*.ts{,x} --fix" }, "dependencies": { "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", "@msgpack/msgpack": "^2.8.0", "@mui/icons-material": "^5.11.11", - "@mui/material": "^5.11.12", + "@mui/material": "^5.11.13", "@remix-run/router": "^1.4.0", "@table-library/react-table-library": "4.0.29", - "@types/lodash-es": "^4.17.6", - "@types/node": "^18.15.0", + "@types/lodash-es": "^4.17.7", + "@types/node": "^18.15.3", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@types/react-router-dom": "^5.3.3", @@ -51,16 +52,20 @@ "devDependencies": { "@types/mime-types": "^2", "@types/styled-components": "^5", - "@typescript-eslint/eslint-plugin": "^5.54.1", - "@typescript-eslint/parser": "^5.54.1", + "@typescript-eslint/eslint-plugin": "^5.55.0", + "@typescript-eslint/parser": "^5.55.0", "@vitejs/plugin-react-swc": "^3.2.0", "eslint": "^8.36.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.7.0", "eslint-import-resolver-typescript": "^3.5.3", "eslint-plugin-deprecation": "^1.3.3", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", + "eslint-plugin-react-hooks": "^4.6.0", "nodemon": "^2.0.21", "npm-run-all": "^4.1.5", "prettier": "^2.8.4", @@ -69,7 +74,7 @@ "vite": "^4.1.4", "vite-plugin-minify": "^1.5.2", "vite-plugin-svgr": "^2.4.0", - "vite-tsconfig-paths": "^4.0.5" + "vite-tsconfig-paths": "^4.0.7" }, "packageManager": "yarn@3.4.1" } diff --git a/interface/yarn.lock b/interface/yarn.lock index f29f24dd7..7002aa7fa 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -703,14 +703,14 @@ __metadata: languageName: node linkType: hard -"@mui/base@npm:5.0.0-alpha.119": - version: 5.0.0-alpha.119 - resolution: "@mui/base@npm:5.0.0-alpha.119" +"@mui/base@npm:5.0.0-alpha.121": + version: 5.0.0-alpha.121 + resolution: "@mui/base@npm:5.0.0-alpha.121" dependencies: "@babel/runtime": ^7.21.0 "@emotion/is-prop-valid": ^1.2.0 "@mui/types": ^7.2.3 - "@mui/utils": ^5.11.11 + "@mui/utils": ^5.11.13 "@popperjs/core": ^2.11.6 clsx: ^1.2.1 prop-types: ^15.8.1 @@ -722,14 +722,14 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 1ad5876a0b455cdc880abc51c331771d954bac769daa5b4c91bccceaaca8c2cf15401e2fa4030e46cdfb0ab876edd6e33818db1b365203e61bb1ec513618bba8 + checksum: b14c9b5ed631058a0ef780a78c5e9129c67338baa4f65a4ab90e23f68410e24d133a9c19f195c136325338b5f444600e43cdd817430b546b73e5371b5d24f32f languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.11.12": - version: 5.11.12 - resolution: "@mui/core-downloads-tracker@npm:5.11.12" - checksum: db9f8497da36455bcd6590aceae0a364fe3107db6067d96612e3b0d8993bc3e0f0d66dbe6fd09d2d99b5a811b20d019682cb96a39d7570948cd644f4f8a32404 +"@mui/core-downloads-tracker@npm:^5.11.13": + version: 5.11.13 + resolution: "@mui/core-downloads-tracker@npm:5.11.13" + checksum: b8a32c9fc4beac4b596afe5fd3d2aecc2449e59d9e58a7ae6fbe528249fa6eabff3abf9195233eb7a46d523d6f1dc5c4ae95e1a69c287182c81311508c07c2c6 languageName: node linkType: hard @@ -749,16 +749,16 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:^5.11.12": - version: 5.11.12 - resolution: "@mui/material@npm:5.11.12" +"@mui/material@npm:^5.11.13": + version: 5.11.13 + resolution: "@mui/material@npm:5.11.13" dependencies: "@babel/runtime": ^7.21.0 - "@mui/base": 5.0.0-alpha.119 - "@mui/core-downloads-tracker": ^5.11.12 - "@mui/system": ^5.11.12 + "@mui/base": 5.0.0-alpha.121 + "@mui/core-downloads-tracker": ^5.11.13 + "@mui/system": ^5.11.13 "@mui/types": ^7.2.3 - "@mui/utils": ^5.11.12 + "@mui/utils": ^5.11.13 "@types/react-transition-group": ^4.4.5 clsx: ^1.2.1 csstype: ^3.1.1 @@ -778,16 +778,16 @@ __metadata: optional: true "@types/react": optional: true - checksum: 0bc03f700683e0a0d234c3b2d2a9ccd875af2bef5fce1946f1409afbb3fb69043c77a96ad9c6cd8f942ef793b8a198aaefe058a31d38c0452711841e2bd51c03 + checksum: 008e7e79bff7f193724c80308c9751151fc61dcaa76ce8f96d11473280ec6d78f61c9bdb8d23f0869e78b9359aa0bdd5164953d57a4e2f7160280f5d2a6b0b2d languageName: node linkType: hard -"@mui/private-theming@npm:^5.11.12": - version: 5.11.12 - resolution: "@mui/private-theming@npm:5.11.12" +"@mui/private-theming@npm:^5.11.13": + version: 5.11.13 + resolution: "@mui/private-theming@npm:5.11.13" dependencies: "@babel/runtime": ^7.21.0 - "@mui/utils": ^5.11.12 + "@mui/utils": ^5.11.13 prop-types: ^15.8.1 peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 @@ -795,7 +795,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 02bee3bd2ae5223e92bdc0c9464386d587adabc7ed24a3fb3aa4659dad189bf02935b482fa56ad431c51fc1ede79bed24b921e0db26f965ad593ebeed2251a26 + checksum: 9e5e02c6482945d9fa52e920fb206fb032d1b1df4bb06ea9d032babb53ed171e3b5a7969091072a5d04b0ab52c90f01ba51b90ba27730019d3f7eccc49ca4628 languageName: node linkType: hard @@ -820,15 +820,15 @@ __metadata: languageName: node linkType: hard -"@mui/system@npm:^5.11.12": - version: 5.11.12 - resolution: "@mui/system@npm:5.11.12" +"@mui/system@npm:^5.11.13": + version: 5.11.13 + resolution: "@mui/system@npm:5.11.13" dependencies: "@babel/runtime": ^7.21.0 - "@mui/private-theming": ^5.11.12 + "@mui/private-theming": ^5.11.13 "@mui/styled-engine": ^5.11.11 "@mui/types": ^7.2.3 - "@mui/utils": ^5.11.12 + "@mui/utils": ^5.11.13 clsx: ^1.2.1 csstype: ^3.1.1 prop-types: ^15.8.1 @@ -844,7 +844,7 @@ __metadata: optional: true "@types/react": optional: true - checksum: a357b26b34ba3fe9aa6d2e826e94a9e8c6fe4bb4d20ac77b7a8688ff414ac7df77ff537837dd36e20aa9be8b9bb9c1ecab6ad2af057b152e1d0c9ea3234aefbf + checksum: e6f1852ecf3dc901645c096f650950b858f5a5e53fc72ca68a7565e844d0841681c79402c3b63100574d1863b3af88d84b832bc680e8dae3a4a2147c7c9aee0f languageName: node linkType: hard @@ -860,9 +860,9 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.11.11": - version: 5.11.11 - resolution: "@mui/utils@npm:5.11.11" +"@mui/utils@npm:^5.11.13": + version: 5.11.13 + resolution: "@mui/utils@npm:5.11.13" dependencies: "@babel/runtime": ^7.21.0 "@types/prop-types": ^15.7.5 @@ -871,22 +871,7 @@ __metadata: react-is: ^18.2.0 peerDependencies: react: ^17.0.0 || ^18.0.0 - checksum: 268ac11cfcf5acc90137502f1fb999c4b5a4a05b00769056f48a15c9aa0c358b2ce93655c04929136282ed2f3b8b0a62d12653449c3463ed4b79723764ab6d71 - languageName: node - linkType: hard - -"@mui/utils@npm:^5.11.12": - version: 5.11.12 - resolution: "@mui/utils@npm:5.11.12" - dependencies: - "@babel/runtime": ^7.21.0 - "@types/prop-types": ^15.7.5 - "@types/react-is": ^16.7.1 || ^17.0.0 - prop-types: ^15.8.1 - react-is: ^18.2.0 - peerDependencies: - react: ^17.0.0 || ^18.0.0 - checksum: aa65847c5ab3ae69f0fb156b1b79adbf6285270de4ff1fa87e098930988aa8d88ef00b5bf12c62e75c77077a9f1b84a150edae8637ca416e6c4c0edff8092d90 + checksum: 0f403f2635fd5cd39c013b9d4defa2cf1ecc023e35b8c9866d6123792480dcafe47207e43420c10b0d030e64df31e78adfdb8248e2476da27f07d80ed0b44927 languageName: node linkType: hard @@ -1328,12 +1313,12 @@ __metadata: languageName: node linkType: hard -"@types/lodash-es@npm:^4.17.6": - version: 4.17.6 - resolution: "@types/lodash-es@npm:4.17.6" +"@types/lodash-es@npm:^4.17.7": + version: 4.17.7 + resolution: "@types/lodash-es@npm:4.17.7" dependencies: "@types/lodash": "*" - checksum: 9bd239dd525086e278821949ce12fbdd4f100a060fed9323fc7ad5661113e1641f28a7ebab617230ed3474680d8f4de705c1928b48252bb684be6ec9eed715db + checksum: 4b1f39fd1d921311c37a846c0e0df9d1fa23e27448a6ad1efd7574e703abd2b2fa5e8f3b5037146000f167ba231d0d01e52747d902654151b4ceeff9f2a9b380 languageName: node linkType: hard @@ -1358,10 +1343,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.15.0": - version: 18.15.0 - resolution: "@types/node@npm:18.15.0" - checksum: d81372276dd5053b1743338b61a2178ff9722dc609189d01fc7d1c2acd539414039e0e4780678730514390dad3f29c366a28c29e8dbd5b0025651181f6dd6669 +"@types/node@npm:^18.15.3": + version: 18.15.3 + resolution: "@types/node@npm:18.15.3" + checksum: 31b1d92475a82c30de29aa6c0771b18a276552d191283b4423ba2d61b3f01159bf0d02576c0b7cc834b043997893800db6bb47f246083ed85aa45e79c80875d7 languageName: node linkType: hard @@ -1479,18 +1464,18 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/eslint-plugin@npm:5.54.1" +"@typescript-eslint/eslint-plugin@npm:^5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.55.0" dependencies: - "@typescript-eslint/scope-manager": 5.54.1 - "@typescript-eslint/type-utils": 5.54.1 - "@typescript-eslint/utils": 5.54.1 + "@eslint-community/regexpp": ^4.4.0 + "@typescript-eslint/scope-manager": 5.55.0 + "@typescript-eslint/type-utils": 5.55.0 + "@typescript-eslint/utils": 5.55.0 debug: ^4.3.4 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 natural-compare-lite: ^1.4.0 - regexpp: ^3.2.0 semver: ^7.3.7 tsutils: ^3.21.0 peerDependencies: @@ -1499,7 +1484,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 76476c08ca0142a9bf6e2381f5cd1c037d86fbafa9c0dded4a97bd3b23b5962dd2c3943bade11b21d674195674f0e36dbf80faa15a1906f5a2ca1f699baf1dd5 + checksum: e3239ec6016eeb73b8b4d8310581978e28b8d3378140a8eb70bd8e33ffd332266020c19d493e0ccae4edfd4abd6097608718c50308fe6288f4ffeb8e4784efd9 languageName: node linkType: hard @@ -1514,20 +1499,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/parser@npm:5.54.1" +"@typescript-eslint/parser@npm:^5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/parser@npm:5.55.0" dependencies: - "@typescript-eslint/scope-manager": 5.54.1 - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/typescript-estree": 5.54.1 + "@typescript-eslint/scope-manager": 5.55.0 + "@typescript-eslint/types": 5.55.0 + "@typescript-eslint/typescript-estree": 5.55.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: f466513d306ca926b97c2cec1eebaf2cd15d45bd5633a4358f23ba9a4de1b0ec4630b1c20abc395943934ed1d2ef65f545fd6737c317a7abe579612101e8a83f + checksum: 48a20dc7e67960b5168b77bfb9d11d053a21d57bb83cf7b59f750191cbca5eea3b4636a8e6e75cc0aca5a84cdef91fed5440934fc2935f8c6fa71630a253a50c languageName: node linkType: hard @@ -1541,22 +1526,22 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/scope-manager@npm:5.54.1" +"@typescript-eslint/scope-manager@npm:5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/scope-manager@npm:5.55.0" dependencies: - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/visitor-keys": 5.54.1 - checksum: 9add24cf3a7852634ad0680a827646860ac4698a6ac8aae31e8b781e29f59e84b51f0cdaacffd0747811012647f01b51969d988da9b302ead374ceebffbe204b + "@typescript-eslint/types": 5.55.0 + "@typescript-eslint/visitor-keys": 5.55.0 + checksum: f253db88f69a29e4abe2f567d0a611cc3e7fb1a911a2cc54a2f6baf16e3de4d1883b3f8e45ee61b3db9fa5543dda0fd7b608de9d28ba6173ab49bfd17ff90cad languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/type-utils@npm:5.54.1" +"@typescript-eslint/type-utils@npm:5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/type-utils@npm:5.55.0" dependencies: - "@typescript-eslint/typescript-estree": 5.54.1 - "@typescript-eslint/utils": 5.54.1 + "@typescript-eslint/typescript-estree": 5.55.0 + "@typescript-eslint/utils": 5.55.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -1564,7 +1549,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 0073838b782b7f4619775be124ca6643fec43a2d56043eaf3ceb100960a5193f14ac747b28ce17a5c9ac643fdee8abda82a7d905c81521358de7b27a2dcbc9af + checksum: 5c60d441355b51f96b596324068c10605c74abb46748c0bbc6d8f7f2ea40acb6b4bda3b537105fa189172324c56d18bd88e7102e67f99f8c03bc05c6d0e2023d languageName: node linkType: hard @@ -1575,10 +1560,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/types@npm:5.54.1" - checksum: 84a8f725cfa10646af389659e09c510c38d82c65960c7b613f844a264acc0e197471cba03f3e8f4b6411bc35dca28922c8352a7bd44621411c73fd6dd4096da2 +"@typescript-eslint/types@npm:5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/types@npm:5.55.0" + checksum: 7d851f09a2106514d3a9c7164d34758f30abfe554e3c7a02be75cdc7e16644e23ca32840a8f39a0321bc509927fb4d98ce91b22b21e8544ac56cef33b815a864 languageName: node linkType: hard @@ -1600,12 +1585,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/typescript-estree@npm:5.54.1" +"@typescript-eslint/typescript-estree@npm:5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.55.0" dependencies: - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/visitor-keys": 5.54.1 + "@typescript-eslint/types": 5.55.0 + "@typescript-eslint/visitor-keys": 5.55.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -1614,7 +1599,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: ea42bdb4832fa96fa1121237c9b664ac4506e2836646651e08a8542c8601d78af6c288779707f893ca4c884221829bb7d7b4b43c4a9c3ed959519266d03a139b + checksum: d24a11aee3d01067018d99804f420aecb8af88e43bf170d5d14f6480bd378c0a81ce49a37f5d6c36e5f0f319e3fa8b099720f295f2767338be1a4f7e9a5323e1 languageName: node linkType: hard @@ -1636,21 +1621,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/utils@npm:5.54.1" +"@typescript-eslint/utils@npm:5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/utils@npm:5.55.0" dependencies: + "@eslint-community/eslint-utils": ^4.2.0 "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.54.1 - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/typescript-estree": 5.54.1 + "@typescript-eslint/scope-manager": 5.55.0 + "@typescript-eslint/types": 5.55.0 + "@typescript-eslint/typescript-estree": 5.55.0 eslint-scope: ^5.1.1 - eslint-utils: ^3.0.0 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 8f428ea4d338ce85d55fd0c9ae2b217b323f29f51b7c9f8077fef7001ca21d28b032c5e5165b67ae6057aef69edb0e7a164c3c483703be6f3e4e574248bbc399 + checksum: 368cfc3fb9d6af6901e739e2e41c3f7f1c1244576607445f4f59d95eccb237f73e1a75e7f0816ec9a32a0f1ec6bb4a3602a99e17e70fe184e62f7c69dcbe4b8d languageName: node linkType: hard @@ -1664,13 +1649,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/visitor-keys@npm:5.54.1" +"@typescript-eslint/visitor-keys@npm:5.55.0": + version: 5.55.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.55.0" dependencies: - "@typescript-eslint/types": 5.54.1 + "@typescript-eslint/types": 5.55.0 eslint-visitor-keys: ^3.3.0 - checksum: 3a691abd2a43b86a0c41526d14a2afcc93a2e0512b5f8b9ec43f6029c493870808036eae5ee4fc655d26e1999017c4a4dffb241f47c36c2a1238ec9fbd08719c + checksum: 0b24c72dff99dd2cf41c19d20067f8ab20a38aa2e82c79c5530bec7cf651031e95c80702fc21c813c9b94e5f3d4cd210f13967b2966ef38abe548cb5f05848a3 languageName: node linkType: hard @@ -1812,29 +1797,33 @@ __metadata: "@emotion/styled": ^11.10.6 "@msgpack/msgpack": ^2.8.0 "@mui/icons-material": ^5.11.11 - "@mui/material": ^5.11.12 + "@mui/material": ^5.11.13 "@remix-run/router": ^1.4.0 "@table-library/react-table-library": 4.0.29 - "@types/lodash-es": ^4.17.6 + "@types/lodash-es": ^4.17.7 "@types/mime-types": ^2 - "@types/node": ^18.15.0 + "@types/node": ^18.15.3 "@types/react": ^18.0.28 "@types/react-dom": ^18.0.11 "@types/react-router-dom": ^5.3.3 "@types/styled-components": ^5 - "@typescript-eslint/eslint-plugin": ^5.54.1 - "@typescript-eslint/parser": ^5.54.1 + "@typescript-eslint/eslint-plugin": ^5.55.0 + "@typescript-eslint/parser": ^5.55.0 "@vitejs/plugin-react-swc": ^3.2.0 "@yarnpkg/pnpify": ^4.0.0-rc.40 async-validator: ^4.2.5 axios: ^1.3.4 eslint: ^8.36.0 + eslint-config-airbnb: ^19.0.4 + eslint-config-airbnb-typescript: ^17.0.0 eslint-config-prettier: ^8.7.0 eslint-import-resolver-typescript: ^3.5.3 eslint-plugin-deprecation: ^1.3.3 eslint-plugin-import: ^2.27.5 eslint-plugin-jsx-a11y: ^6.7.1 + eslint-plugin-prettier: ^4.2.1 eslint-plugin-react: ^7.32.2 + eslint-plugin-react-hooks: ^4.6.0 history: ^5.3.0 jwt-decode: ^3.1.2 lodash-es: ^4.17.21 @@ -1856,7 +1845,7 @@ __metadata: vite: ^4.1.4 vite-plugin-minify: ^1.5.2 vite-plugin-svgr: ^2.4.0 - vite-tsconfig-paths: ^4.0.5 + vite-tsconfig-paths: ^4.0.7 languageName: unknown linkType: soft @@ -2489,6 +2478,13 @@ __metadata: languageName: node linkType: hard +"confusing-browser-globals@npm:^1.0.10": + version: 1.0.11 + resolution: "confusing-browser-globals@npm:1.0.11" + checksum: 3afc635abd37e566477f610e7978b15753f0e84025c25d49236f1f14d480117185516bdd40d2a2167e6bed8048641a9854964b9c067e3dcdfa6b5d0ad3c3a5ef + languageName: node + linkType: hard + "console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" @@ -2981,6 +2977,52 @@ __metadata: languageName: node linkType: hard +"eslint-config-airbnb-base@npm:^15.0.0": + version: 15.0.0 + resolution: "eslint-config-airbnb-base@npm:15.0.0" + dependencies: + confusing-browser-globals: ^1.0.10 + object.assign: ^4.1.2 + object.entries: ^1.1.5 + semver: ^6.3.0 + peerDependencies: + eslint: ^7.32.0 || ^8.2.0 + eslint-plugin-import: ^2.25.2 + checksum: 38626bad2ce2859fccac86b30cd2b86c9b7d8d71d458331860861dc05290a5b198bded2f4fb89efcb9046ec48f8ab4c4fb00365ba8916f27b172671da28b93ea + languageName: node + linkType: hard + +"eslint-config-airbnb-typescript@npm:^17.0.0": + version: 17.0.0 + resolution: "eslint-config-airbnb-typescript@npm:17.0.0" + dependencies: + eslint-config-airbnb-base: ^15.0.0 + peerDependencies: + "@typescript-eslint/eslint-plugin": ^5.13.0 + "@typescript-eslint/parser": ^5.0.0 + eslint: ^7.32.0 || ^8.2.0 + eslint-plugin-import: ^2.25.3 + checksum: e598ae7bcc3629bbc847a749f8c1ad69e6ef111335b60d88bde91d1bb335077b06688868257fe2fcc95c3687a0d6e3e1f91e0534cc633f5a118239e52bb05a54 + languageName: node + linkType: hard + +"eslint-config-airbnb@npm:^19.0.4": + version: 19.0.4 + resolution: "eslint-config-airbnb@npm:19.0.4" + dependencies: + eslint-config-airbnb-base: ^15.0.0 + object.assign: ^4.1.2 + object.entries: ^1.1.5 + peerDependencies: + eslint: ^7.32.0 || ^8.2.0 + eslint-plugin-import: ^2.25.3 + eslint-plugin-jsx-a11y: ^6.5.1 + eslint-plugin-react: ^7.28.0 + eslint-plugin-react-hooks: ^4.3.0 + checksum: 253178689c3c80eef2567e3aaf0612e18973bc9cf51d9be36074b5dd58210e8b6942200a424bcccbb81ac884e41303479ab09f251a2a97addc2de61efdc9576c + languageName: node + linkType: hard + "eslint-config-prettier@npm:^8.7.0": version: 8.7.0 resolution: "eslint-config-prettier@npm:8.7.0" @@ -3098,6 +3140,30 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-prettier@npm:^4.2.1": + version: 4.2.1 + resolution: "eslint-plugin-prettier@npm:4.2.1" + dependencies: + prettier-linter-helpers: ^1.0.0 + peerDependencies: + eslint: ">=7.28.0" + prettier: ">=2.0.0" + peerDependenciesMeta: + eslint-config-prettier: + optional: true + checksum: b9e839d2334ad8ec7a5589c5cb0f219bded260839a857d7a486997f9870e95106aa59b8756ff3f37202085ebab658de382b0267cae44c3a7f0eb0bcc03a4f6d6 + languageName: node + linkType: hard + +"eslint-plugin-react-hooks@npm:^4.6.0": + version: 4.6.0 + resolution: "eslint-plugin-react-hooks@npm:4.6.0" + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + checksum: 23001801f14c1d16bf0a837ca7970d9dd94e7b560384b41db378b49b6e32dc43d6e2790de1bd737a652a86f81a08d6a91f402525061b47719328f586a57e86c3 + languageName: node + linkType: hard + "eslint-plugin-react@npm:^7.32.2": version: 7.32.2 resolution: "eslint-plugin-react@npm:7.32.2" @@ -3292,6 +3358,13 @@ __metadata: languageName: node linkType: hard +"fast-diff@npm:^1.1.2": + version: 1.2.0 + resolution: "fast-diff@npm:1.2.0" + checksum: 1b5306eaa9e826564d9e5ffcd6ebd881eb5f770b3f977fcbf38f05c824e42172b53c79920e8429c54eb742ce15a0caf268b0fdd5b38f6de52234c4a8368131ae + languageName: node + linkType: hard + "fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.2, fast-glob@npm:^3.2.9": version: 3.2.12 resolution: "fast-glob@npm:3.2.12" @@ -4889,7 +4962,7 @@ __metadata: languageName: node linkType: hard -"object.assign@npm:^4.1.3, object.assign@npm:^4.1.4": +"object.assign@npm:^4.1.2, object.assign@npm:^4.1.3, object.assign@npm:^4.1.4": version: 4.1.4 resolution: "object.assign@npm:4.1.4" dependencies: @@ -4901,7 +4974,7 @@ __metadata: languageName: node linkType: hard -"object.entries@npm:^1.1.6": +"object.entries@npm:^1.1.5, object.entries@npm:^1.1.6": version: 1.1.6 resolution: "object.entries@npm:1.1.6" dependencies: @@ -5178,6 +5251,15 @@ __metadata: languageName: node linkType: hard +"prettier-linter-helpers@npm:^1.0.0": + version: 1.0.0 + resolution: "prettier-linter-helpers@npm:1.0.0" + dependencies: + fast-diff: ^1.1.2 + checksum: 00ce8011cf6430158d27f9c92cfea0a7699405633f7f1d4a45f07e21bf78e99895911cbcdc3853db3a824201a7c745bd49bfea8abd5fb9883e765a90f74f8392 + languageName: node + linkType: hard + "prettier@npm:^2.8.4": version: 2.8.4 resolution: "prettier@npm:2.8.4" @@ -5440,13 +5522,6 @@ __metadata: languageName: node linkType: hard -"regexpp@npm:^3.2.0": - version: 3.2.0 - resolution: "regexpp@npm:3.2.0" - checksum: a78dc5c7158ad9ddcfe01aa9144f46e192ddbfa7b263895a70a5c6c73edd9ce85faf7c0430e59ac38839e1734e275b9c3de5c57ee3ab6edc0e0b1bdebefccef8 - languageName: node - linkType: hard - "relateurl@npm:^0.2.7": version: 0.2.7 resolution: "relateurl@npm:0.2.7" @@ -6351,14 +6426,19 @@ __metadata: languageName: node linkType: hard -"vite-tsconfig-paths@npm:^4.0.5": - version: 4.0.5 - resolution: "vite-tsconfig-paths@npm:4.0.5" +"vite-tsconfig-paths@npm:^4.0.7": + version: 4.0.7 + resolution: "vite-tsconfig-paths@npm:4.0.7" dependencies: debug: ^4.1.1 globrex: ^0.1.2 tsconfck: ^2.0.1 - checksum: 49b4064881343ef0b75e52eeb1d5cdfe1f26b32ded68e71efc84022e8e96bdb3d3f37f79f3678b43e935dca279cc24c5936942b5fdbaf1489b497e48572314d9 + peerDependencies: + vite: "*" + peerDependenciesMeta: + vite: + optional: true + checksum: 490123daa28dcf0b1290c2374876041e0ed2964d5244f08ad2cb8354436eff110592d5ffec0960276552943b46361b6a98f2363406e89ae0988287769188f5e8 languageName: node linkType: hard diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index fb57ccd13..000000000 --- a/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - From ada142ff2963d913feae10ec8b4335de739d21db Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 14 Mar 2023 21:59:31 +0100 Subject: [PATCH 4/7] add comment --- src/locale_translations.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/locale_translations.h b/src/locale_translations.h index 4baf8ee79..df2997adb 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -1,7 +1,7 @@ /* * EMS-ESP - https://github.com/emsesp/EMS-ESP * Copyright 2020-2023 Paul Derbyshire - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -29,8 +29,7 @@ #define EMSESP_LOCALE_FR "fr" #define EMSESP_LOCALE_TR "tr" -// IMPORTANT! -// translations are in the order: en, de, nl, sv, pl, no, fr, tr +// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr // // if there is no translation, it will default to en // From 3dfd34b7bf68379b7c86d4c1f4c3e458283c86aa Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 14 Mar 2023 21:59:40 +0100 Subject: [PATCH 5/7] upgrade 6.21.0 --- lib/ArduinoJson/ArduinoJson.h | 2 +- lib/ArduinoJson/CHANGELOG.md | 7 + lib/ArduinoJson/LICENSE.txt | 2 +- lib/ArduinoJson/README.md | 160 --- lib/ArduinoJson/src/ArduinoJson.h | 2 +- lib/ArduinoJson/src/ArduinoJson.hpp | 39 +- .../src/ArduinoJson/Array/ElementProxy.hpp | 10 +- .../src/ArduinoJson/Array/JsonArray.hpp | 39 +- .../src/ArduinoJson/Array/JsonArrayConst.hpp | 23 +- .../src/ArduinoJson/Array/JsonArrayImpl.hpp | 10 +- .../ArduinoJson/Array/JsonArrayIterator.hpp | 24 +- .../src/ArduinoJson/Array/Utilities.hpp | 29 +- .../ArduinoJson/Collection/CollectionData.hpp | 7 +- .../ArduinoJson/Collection/CollectionImpl.hpp | 6 +- .../src/ArduinoJson/Configuration.hpp | 29 +- .../Deserialization/DeserializationError.hpp | 21 +- .../DeserializationOptions.hpp | 35 + .../ArduinoJson/Deserialization/Filter.hpp | 10 +- .../Deserialization/NestingLimit.hpp | 9 +- .../ArduinoJson/Deserialization/Reader.hpp | 23 +- .../Readers/ArduinoStreamReader.hpp | 6 +- .../Readers/ArduinoStringReader.hpp | 8 +- .../Deserialization/Readers/FlashReader.hpp | 7 +- .../Readers/IteratorReader.hpp | 7 +- .../Deserialization/Readers/RamReader.hpp | 6 +- .../Readers/StdStreamReader.hpp | 7 +- .../Deserialization/Readers/VariantReader.hpp | 6 +- .../Deserialization/deserialize.hpp | 78 +- .../Document/BasicJsonDocument.hpp | 37 +- .../Document/DynamicJsonDocument.hpp | 6 +- .../src/ArduinoJson/Document/JsonDocument.hpp | 91 +- .../Document/StaticJsonDocument.hpp | 11 +- .../src/ArduinoJson/Json/EscapeSequence.hpp | 7 +- .../src/ArduinoJson/Json/JsonDeserializer.hpp | 150 +-- .../src/ArduinoJson/Json/JsonSerializer.hpp | 17 +- .../src/ArduinoJson/Json/Latch.hpp | 6 +- .../ArduinoJson/Json/PrettyJsonSerializer.hpp | 13 +- .../src/ArduinoJson/Json/TextFormatter.hpp | 12 +- .../src/ArduinoJson/Json/Utf16.hpp | 6 +- lib/ArduinoJson/src/ArduinoJson/Json/Utf8.hpp | 6 +- .../src/ArduinoJson/Memory/Alignment.hpp | 6 +- .../src/ArduinoJson/Memory/MemoryPool.hpp | 10 +- .../src/ArduinoJson/Misc/SafeBoolIdiom.hpp | 26 - .../src/ArduinoJson/Misc/SerializedValue.hpp | 9 +- .../MsgPack/MsgPackDeserializer.hpp | 1075 ++++++++--------- .../ArduinoJson/MsgPack/MsgPackSerializer.hpp | 13 +- .../src/ArduinoJson/MsgPack/endianess.hpp | 6 +- .../src/ArduinoJson/MsgPack/ieee754.hpp | 6 +- lib/ArduinoJson/src/ArduinoJson/Namespace.hpp | 33 +- .../src/ArduinoJson/Numbers/FloatParts.hpp | 15 +- .../src/ArduinoJson/Numbers/FloatTraits.hpp | 185 +-- .../src/ArduinoJson/Numbers/JsonFloat.hpp | 7 +- .../src/ArduinoJson/Numbers/JsonInteger.hpp | 20 +- .../ArduinoJson/Numbers/arithmeticCompare.hpp | 11 +- .../src/ArduinoJson/Numbers/convertNumber.hpp | 14 +- .../src/ArduinoJson/Numbers/parseNumber.hpp | 8 +- .../src/ArduinoJson/Object/JsonObject.hpp | 77 +- .../ArduinoJson/Object/JsonObjectConst.hpp | 44 +- .../src/ArduinoJson/Object/JsonObjectImpl.hpp | 14 +- .../ArduinoJson/Object/JsonObjectIterator.hpp | 24 +- .../src/ArduinoJson/Object/JsonPair.hpp | 11 +- .../src/ArduinoJson/Object/MemberProxy.hpp | 10 +- .../src/ArduinoJson/Polyfills/alias_cast.hpp | 7 +- .../src/ArduinoJson/Polyfills/assert.hpp | 2 +- .../src/ArduinoJson/Polyfills/attributes.hpp | 8 +- .../src/ArduinoJson/Polyfills/ctype.hpp | 7 +- .../src/ArduinoJson/Polyfills/integer.hpp | 7 +- .../src/ArduinoJson/Polyfills/limits.hpp | 6 +- .../src/ArduinoJson/Polyfills/math.hpp | 6 +- .../src/ArduinoJson/Polyfills/mpl/max.hpp | 7 +- .../src/ArduinoJson/Polyfills/pgmspace.hpp | 44 +- .../Polyfills/pgmspace_generic.hpp | 36 +- .../ArduinoJson/Polyfills/preprocessor.hpp | 46 +- .../src/ArduinoJson/Polyfills/type_traits.hpp | 2 +- .../Polyfills/type_traits/conditional.hpp | 7 +- .../Polyfills/type_traits/declval.hpp | 8 +- .../Polyfills/type_traits/enable_if.hpp | 7 +- .../type_traits/integral_constant.hpp | 6 +- .../Polyfills/type_traits/is_array.hpp | 7 +- .../Polyfills/type_traits/is_base_of.hpp | 12 +- .../Polyfills/type_traits/is_class.hpp | 6 +- .../Polyfills/type_traits/is_const.hpp | 7 +- .../Polyfills/type_traits/is_convertible.hpp | 6 +- .../Polyfills/type_traits/is_enum.hpp | 6 +- .../type_traits/is_floating_point.hpp | 6 +- .../Polyfills/type_traits/is_integral.hpp | 13 +- .../Polyfills/type_traits/is_pointer.hpp | 7 +- .../Polyfills/type_traits/is_same.hpp | 7 +- .../Polyfills/type_traits/is_signed.hpp | 14 +- .../Polyfills/type_traits/is_unsigned.hpp | 12 +- .../Polyfills/type_traits/make_unsigned.hpp | 14 +- .../Polyfills/type_traits/make_void.hpp | 6 +- .../Polyfills/type_traits/remove_const.hpp | 7 +- .../Polyfills/type_traits/remove_cv.hpp | 7 +- .../type_traits/remove_reference.hpp | 7 +- .../Polyfills/type_traits/type_identity.hpp | 7 +- .../src/ArduinoJson/Polyfills/utility.hpp | 16 + .../Serialization/CountingDecorator.hpp | 6 +- .../src/ArduinoJson/Serialization/Writer.hpp | 6 +- .../Writers/ArduinoStringWriter.hpp | 8 +- .../Serialization/Writers/DummyWriter.hpp | 7 +- .../Serialization/Writers/PrintWriter.hpp | 8 +- .../Writers/StaticStringWriter.hpp | 7 +- .../Serialization/Writers/StdStreamWriter.hpp | 7 +- .../Serialization/Writers/StdStringWriter.hpp | 19 +- .../src/ArduinoJson/Serialization/measure.hpp | 8 +- .../ArduinoJson/Serialization/serialize.hpp | 19 +- .../StringStorage/StringCopier.hpp | 7 +- .../ArduinoJson/StringStorage/StringMover.hpp | 7 +- .../StringStorage/StringStorage.hpp | 6 +- .../Strings/Adapters/ArduinoString.hpp | 25 - .../Strings/Adapters/FlashString.hpp | 6 +- .../Strings/Adapters/JsonString.hpp | 6 +- .../Strings/Adapters/RamString.hpp | 6 +- .../Strings/Adapters/StdString.hpp | 23 - .../Strings/Adapters/StringObject.hpp | 51 + .../Strings/Adapters/StringView.hpp | 22 - .../src/ArduinoJson/Strings/IsString.hpp | 6 +- .../src/ArduinoJson/Strings/JsonString.hpp | 16 +- .../src/ArduinoJson/Strings/StoragePolicy.hpp | 6 +- .../src/ArduinoJson/Strings/StringAdapter.hpp | 6 +- .../ArduinoJson/Strings/StringAdapters.hpp | 19 +- .../src/ArduinoJson/Strings/StringTraits.hpp | 79 ++ .../src/ArduinoJson/Variant/Converter.hpp | 10 +- .../src/ArduinoJson/Variant/ConverterImpl.hpp | 119 +- .../src/ArduinoJson/Variant/JsonVariant.hpp | 37 +- .../ArduinoJson/Variant/JsonVariantConst.hpp | 65 +- .../src/ArduinoJson/Variant/SlotFunctions.hpp | 6 +- .../ArduinoJson/Variant/VariantAttorney.hpp | 6 +- .../ArduinoJson/Variant/VariantCompare.hpp | 274 ++--- .../ArduinoJson/Variant/VariantContent.hpp | 7 +- .../src/ArduinoJson/Variant/VariantData.hpp | 6 +- .../ArduinoJson/Variant/VariantFunctions.hpp | 6 +- .../src/ArduinoJson/Variant/VariantImpl.hpp | 6 +- .../ArduinoJson/Variant/VariantOperators.hpp | 11 +- .../ArduinoJson/Variant/VariantRefBase.hpp | 23 +- .../src/ArduinoJson/Variant/VariantSlot.hpp | 6 +- .../src/ArduinoJson/Variant/VariantTag.hpp | 6 +- .../src/ArduinoJson/Variant/VariantTo.hpp | 8 +- .../src/ArduinoJson/Variant/Visitor.hpp | 6 +- .../src/ArduinoJson/compatibility.hpp | 4 +- lib/ArduinoJson/src/ArduinoJson/version.hpp | 8 +- lib/ArduinoJson/src/CMakeLists.txt | 90 -- 143 files changed, 1893 insertions(+), 2168 deletions(-) delete mode 100644 lib/ArduinoJson/README.md create mode 100644 lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp delete mode 100644 lib/ArduinoJson/src/ArduinoJson/Misc/SafeBoolIdiom.hpp create mode 100644 lib/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp delete mode 100644 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/ArduinoString.hpp delete mode 100644 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/StdString.hpp create mode 100644 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringObject.hpp delete mode 100644 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringView.hpp create mode 100644 lib/ArduinoJson/src/ArduinoJson/Strings/StringTraits.hpp delete mode 100644 lib/ArduinoJson/src/CMakeLists.txt diff --git a/lib/ArduinoJson/ArduinoJson.h b/lib/ArduinoJson/ArduinoJson.h index 7e3afa58a..15c218f48 100644 --- a/lib/ArduinoJson/ArduinoJson.h +++ b/lib/ArduinoJson/ArduinoJson.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include "src/ArduinoJson.h" diff --git a/lib/ArduinoJson/CHANGELOG.md b/lib/ArduinoJson/CHANGELOG.md index dd4945bce..bee743479 100644 --- a/lib/ArduinoJson/CHANGELOG.md +++ b/lib/ArduinoJson/CHANGELOG.md @@ -1,6 +1,13 @@ ArduinoJson: change log ======================= +v6.21.0 (2023-03-14) +------- + +* Drop support for C++98/C++03. Minimum required is C++11. +* Remove `ARDUINOJSON_NAMESPACE`; use `ArduinoJson` instead. +* Make string support generic (issue #1807) + v6.20.1 (2023-02-08) ------- diff --git a/lib/ArduinoJson/LICENSE.txt b/lib/ArduinoJson/LICENSE.txt index e59620d1d..15f1b9fbb 100644 --- a/lib/ArduinoJson/LICENSE.txt +++ b/lib/ArduinoJson/LICENSE.txt @@ -1,7 +1,7 @@ The MIT License (MIT) --------------------- -Copyright © 2014-2022, Benoit BLANCHON +Copyright © 2014-2023, Benoit BLANCHON Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/lib/ArduinoJson/README.md b/lib/ArduinoJson/README.md deleted file mode 100644 index b0f539dd3..000000000 --- a/lib/ArduinoJson/README.md +++ /dev/null @@ -1,160 +0,0 @@ -

- ArduinoJson -

- ---- - -[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bblanchon/ArduinoJson/ci.yml?branch=6.x&logo=github)](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x) -[![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) -[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) -[![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/6.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) -[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.20.1&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.20.1) -[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.20.1)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.20.1) -[![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.20.1&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson) -[![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github&color=orange)](https://github.com/bblanchon/ArduinoJson/stargazers) -[![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github&color=orange)](https://github.com/sponsors/bblanchon) - -ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). - -## Features - -* [JSON deserialization](https://arduinojson.org/v6/api/json/deserializejson/) - * [Optionally decodes UTF-16 escape sequences to UTF-8](https://arduinojson.org/v6/api/config/decode_unicode/) - * [Optionally stores links to the input buffer (zero-copy)](https://arduinojson.org/v6/api/json/deserializejson/) - * [Optionally supports comments in the input](https://arduinojson.org/v6/api/config/enable_comments/) - * [Optionally filters the input to keep only desired values](https://arduinojson.org/v6/api/json/deserializejson/#filtering) - * Supports single quotes as a string delimiter - * Compatible with [NDJSON](http://ndjson.org/) and [JSON Lines](https://jsonlines.org/) -* [JSON serialization](https://arduinojson.org/v6/api/json/serializejson/) - * [Can write to a buffer or a stream](https://arduinojson.org/v6/api/json/serializejson/) - * [Optionally indents the document (prettified JSON)](https://arduinojson.org/v6/api/json/serializejsonpretty/) -* [MessagePack serialization](https://arduinojson.org/v6/api/msgpack/serializemsgpack/) -* [MessagePack deserialization](https://arduinojson.org/v6/api/msgpack/deserializemsgpack/) -* Efficient - * [Twice smaller than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/) - * [Almost 10% faster than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/) - * [Consumes roughly 10% less RAM than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/) - * [Fixed memory allocation, no heap fragmentation](https://arduinojson.org/v6/api/jsondocument/) - * [Optionally works without heap memory (zero malloc)](https://arduinojson.org/v6/api/staticjsondocument/) - * [Deduplicates strings](https://arduinojson.org/news/2020/08/01/version-6-16-0/) -* Versatile - * Supports [custom allocators (to use external RAM chip, for example)](https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/) - * Supports [`String`](https://arduinojson.org/v6/api/config/enable_arduino_string/), [`std::string`](https://arduinojson.org/v6/api/config/enable_std_string/), and [`std::string_view`](https://arduinojson.org/v6/api/config/enable_string_view/) - * Supports [`Stream`](https://arduinojson.org/v6/api/config/enable_arduino_stream/) and [`std::istream`/`std::ostream`](https://arduinojson.org/v6/api/config/enable_std_stream/) - * Supports [Flash strings](https://arduinojson.org/v6/api/config/enable_progmem/) - * Supports [custom readers](https://arduinojson.org/v6/api/json/deserializejson/#custom-reader) and [custom writers](https://arduinojson.org/v6/api/json/serializejson/#custom-writer) - * Supports [custom converters](https://arduinojson.org/news/2021/05/04/version-6-18-0/) -* Portable - * Usable on any C++ project (not limited to Arduino) - * Compatible with C++98, C++11, C++14 and C++17 - * Zero warnings with `-Wall -Wextra -pedantic` and `/W4` - * [Header-only library](https://en.wikipedia.org/wiki/Header-only) - * Works with virtually any board - * Arduino boards: [Uno](https://amzn.to/38aL2ik), [Due](https://amzn.to/36YkWi2), [Micro](https://amzn.to/35WkdwG), [Nano](https://amzn.to/2QTvwRX), [Mega](https://amzn.to/36XWhuf), [Yun](https://amzn.to/30odURc), [Leonardo](https://amzn.to/36XWjlR)... - * Espressif chips: [ESP8266](https://amzn.to/36YluV8), [ESP32](https://amzn.to/2G4pRCB) - * Lolin (WeMos) boards: [D1 mini](https://amzn.to/2QUpz7q), [D1 Mini Pro](https://amzn.to/36UsGSs)... - * Teensy boards: [4.0](https://amzn.to/30ljXGq), [3.2](https://amzn.to/2FT0EuC), [2.0](https://amzn.to/2QXUMXj) - * Particle boards: [Argon](https://amzn.to/2FQHa9X), [Boron](https://amzn.to/36WgLUd), [Electron](https://amzn.to/30vEc4k), [Photon](https://amzn.to/387F9Cd)... - * Texas Instruments boards: [MSP430](https://amzn.to/30nJWgg)... - * Soft cores: [Nios II](https://en.wikipedia.org/wiki/Nios_II)... - * Tested on all major development environments - * [Arduino IDE](https://www.arduino.cc/en/Main/Software) - * [Atmel Studio](http://www.atmel.com/microsite/atmel-studio/) - * [Atollic TrueSTUDIO](https://atollic.com/truestudio/) - * [Energia](http://energia.nu/) - * [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) - * [Keil uVision](http://www.keil.com/) - * [MPLAB X IDE](http://www.microchip.com/mplab/mplab-x-ide) - * [Particle](https://www.particle.io/) - * [PlatformIO](http://platformio.org/) - * [Sloeber plugin for Eclipse](https://eclipse.baeyens.it/) - * [Visual Micro](http://www.visualmicro.com/) - * [Visual Studio](https://www.visualstudio.com/) - * [Even works with online compilers like wandbox.org](https://wandbox.org/permlink/RlZSKy17DjJ6HcdN) - * [CMake friendly](https://arduinojson.org/v6/how-to/use-arduinojson-with-cmake/) -* Well designed - * [Elegant API](http://arduinojson.org/v6/example/) - * [Thread-safe](https://en.wikipedia.org/wiki/Thread_safety) - * Self-contained (no external dependency) - * `const` friendly - * [`for` friendly](https://arduinojson.org/v6/api/jsonobject/begin_end/) - * [TMP friendly](https://en.wikipedia.org/wiki/Template_metaprogramming) - * Handles [integer overflows](https://arduinojson.org/v6/api/jsonvariant/as/#integer-overflows) -* Well tested - * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) - * Continuously tested on - * [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) - * [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) - * [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) - * [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) - * Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/) -* Well documented - * [Tutorials](https://arduinojson.org/v6/doc/deserialization/) - * [Examples](https://arduinojson.org/v6/example/) - * [How-tos](https://arduinojson.org/v6/example/) - * [FAQ](https://arduinojson.org/v6/faq/) - * [Troubleshooter](https://arduinojson.org/v6/troubleshooter/) - * [Book](https://arduinojson.org/book/) - * [Changelog](CHANGELOG.md) -* Vibrant user community - * Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) - * [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson) - * [Responsive support](https://github.com/bblanchon/ArduinoJson/issues?q=is%3Aissue+is%3Aclosed) - -## Quickstart - -### Deserialization - -Here is a program that parses a JSON document with ArduinoJson. - -```c++ -char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; - -DynamicJsonDocument doc(1024); -deserializeJson(doc, json); - -const char* sensor = doc["sensor"]; -long time = doc["time"]; -double latitude = doc["data"][0]; -double longitude = doc["data"][1]; -``` - -See the [tutorial on arduinojson.org](https://arduinojson.org/v6/doc/deserialization/) - -### Serialization - -Here is a program that generates a JSON document with ArduinoJson: - -```c++ -DynamicJsonDocument doc(1024); - -doc["sensor"] = "gps"; -doc["time"] = 1351824120; -doc["data"][0] = 48.756080; -doc["data"][1] = 2.302038; - -serializeJson(doc, Serial); -// This prints: -// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]} -``` - -See the [tutorial on arduinojson.org](https://arduinojson.org/v6/doc/serialization/) - -## Sponsors - -ArduinoJson is thankful to its sponsors. Please give them a visit; they deserve it! - -

- - Programming Electronics Academy - -

-

- - 1technophile - -

- -If you run a commercial project that embeds ArduinoJson, think about [sponsoring the library's development](https://github.com/sponsors/bblanchon): it ensures the code that your products rely on stays actively maintained. It can also give your project some exposure to the makers' community. - -If you are an individual user and want to support the development (or give a sign of appreciation), consider purchasing the book [Mastering ArduinoJson](https://arduinojson.org/book/) ❤, or simply [cast a star](https://github.com/bblanchon/ArduinoJson/stargazers) ⭐. diff --git a/lib/ArduinoJson/src/ArduinoJson.h b/lib/ArduinoJson/src/ArduinoJson.h index f79212dbc..c9ac0ca64 100644 --- a/lib/ArduinoJson/src/ArduinoJson.h +++ b/lib/ArduinoJson/src/ArduinoJson.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once diff --git a/lib/ArduinoJson/src/ArduinoJson.hpp b/lib/ArduinoJson/src/ArduinoJson.hpp index 3a490f33e..0c8832a1b 100644 --- a/lib/ArduinoJson/src/ArduinoJson.hpp +++ b/lib/ArduinoJson/src/ArduinoJson.hpp @@ -1,9 +1,13 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once +#if __cplusplus < 201103L && (!defined(_MSC_VER) || _MSC_VER < 1910) +# error ArduinoJson requires C++11 or newer. Configure your compiler for C++11 or downgrade ArduinoJson to 6.20. +#endif + #include "ArduinoJson/Configuration.hpp" // Include Arduino.h before stdlib.h to avoid conflict with atexit() @@ -45,36 +49,3 @@ #include "ArduinoJson/MsgPack/MsgPackSerializer.hpp" #include "ArduinoJson/compatibility.hpp" - -namespace ArduinoJson { -using ARDUINOJSON_NAMESPACE::BasicJsonDocument; -using ARDUINOJSON_NAMESPACE::copyArray; -using ARDUINOJSON_NAMESPACE::DeserializationError; -using ARDUINOJSON_NAMESPACE::deserializeJson; -using ARDUINOJSON_NAMESPACE::deserializeMsgPack; -using ARDUINOJSON_NAMESPACE::DynamicJsonDocument; -using ARDUINOJSON_NAMESPACE::JsonArray; -using ARDUINOJSON_NAMESPACE::JsonArrayConst; -using ARDUINOJSON_NAMESPACE::JsonDocument; -using ARDUINOJSON_NAMESPACE::JsonFloat; -using ARDUINOJSON_NAMESPACE::JsonInteger; -using ARDUINOJSON_NAMESPACE::JsonObject; -using ARDUINOJSON_NAMESPACE::JsonObjectConst; -using ARDUINOJSON_NAMESPACE::JsonPair; -using ARDUINOJSON_NAMESPACE::JsonPairConst; -using ARDUINOJSON_NAMESPACE::JsonString; -using ARDUINOJSON_NAMESPACE::JsonUInt; -using ARDUINOJSON_NAMESPACE::JsonVariant; -using ARDUINOJSON_NAMESPACE::JsonVariantConst; -using ARDUINOJSON_NAMESPACE::measureJson; -using ARDUINOJSON_NAMESPACE::serialized; -using ARDUINOJSON_NAMESPACE::serializeJson; -using ARDUINOJSON_NAMESPACE::serializeJsonPretty; -using ARDUINOJSON_NAMESPACE::serializeMsgPack; -using ARDUINOJSON_NAMESPACE::StaticJsonDocument; - -namespace DeserializationOption { -using ARDUINOJSON_NAMESPACE::Filter; -using ARDUINOJSON_NAMESPACE::NestingLimit; -} // namespace DeserializationOption -} // namespace ArduinoJson diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp index b3e00a2c0..1a9e9ce27 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp @@ -1,18 +1,18 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE // A proxy class to get or set an element of an array. // https://arduinojson.org/v6/api/jsonarray/subscript/ template -class ElementProxy : public VariantRefBase >, - public VariantOperators > { +class ElementProxy : public VariantRefBase>, + public VariantOperators> { friend class VariantAttorney; public: @@ -57,4 +57,4 @@ class ElementProxy : public VariantRefBase >, size_t _index; }; -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp index a26b1f1f1..00df67ceb 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -7,14 +7,14 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE class JsonObject; // A reference to an array in a JsonDocument // https://arduinojson.org/v6/api/jsonarray/ -class JsonArray : public VariantOperators { - friend class VariantAttorney; +class JsonArray : public detail::VariantOperators { + friend class detail::VariantAttorney; public: typedef JsonArrayIterator iterator; @@ -23,14 +23,14 @@ class JsonArray : public VariantOperators { FORCE_INLINE JsonArray() : _data(0), _pool(0) {} // INTERNAL USE ONLY - FORCE_INLINE JsonArray(MemoryPool* pool, CollectionData* data) + FORCE_INLINE JsonArray(detail::MemoryPool* pool, detail::CollectionData* data) : _data(data), _pool(pool) {} // Returns a JsonVariant pointing to the array. // https://arduinojson.org/v6/api/jsonvariant/ operator JsonVariant() { void* data = _data; // prevent warning cast-align - return JsonVariant(_pool, reinterpret_cast(data)); + return JsonVariant(_pool, reinterpret_cast(data)); } // Returns a read-only reference to the array. @@ -118,8 +118,8 @@ class JsonArray : public VariantOperators { // Gets or sets the element at the specified index. // https://arduinojson.org/v6/api/jsonarray/subscript/ - FORCE_INLINE ElementProxy operator[](size_t index) const { - return ElementProxy(*this, index); + FORCE_INLINE detail::ElementProxy operator[](size_t index) const { + return {*this, index}; } // Creates an object and appends it to the array. @@ -167,35 +167,35 @@ class JsonArray : public VariantOperators { } private: - MemoryPool* getPool() const { + detail::MemoryPool* getPool() const { return _pool; } - VariantData* getData() const { + detail::VariantData* getData() const { return collectionToVariant(_data); } - VariantData* getOrCreateData() const { + detail::VariantData* getOrCreateData() const { return collectionToVariant(_data); } - CollectionData* _data; - MemoryPool* _pool; + detail::CollectionData* _data; + detail::MemoryPool* _pool; }; template <> -struct Converter : private VariantAttorney { +struct Converter : private detail::VariantAttorney { static void toJson(JsonVariantConst src, JsonVariant dst) { variantCopyFrom(getData(dst), getData(src), getPool(dst)); } static JsonArray fromJson(JsonVariant src) { - VariantData* data = getData(src); - MemoryPool* pool = getPool(src); + auto data = getData(src); + auto pool = getPool(src); return JsonArray(pool, data != 0 ? data->asArray() : 0); } - static InvalidConversion fromJson( + static detail::InvalidConversion fromJson( JsonVariantConst); static bool checkJson(JsonVariantConst) { @@ -203,8 +203,9 @@ struct Converter : private VariantAttorney { } static bool checkJson(JsonVariant src) { - VariantData* data = getData(src); + auto data = getData(src); return data && data->isArray(); } }; -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp index 17e65a4bb..6c60e9813 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -8,15 +8,15 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE class JsonObject; // A read-only reference to an array in a JsonDocument // https://arduinojson.org/v6/api/jsonarrayconst/ -class JsonArrayConst : public VariantOperators { +class JsonArrayConst : public detail::VariantOperators { friend class JsonArray; - friend class VariantAttorney; + friend class detail::VariantAttorney; public: typedef JsonArrayConstIterator iterator; @@ -39,7 +39,8 @@ class JsonArrayConst : public VariantOperators { FORCE_INLINE JsonArrayConst() : _data(0) {} // INTERNAL USE ONLY - FORCE_INLINE JsonArrayConst(const CollectionData* data) : _data(data) {} + FORCE_INLINE JsonArrayConst(const detail::CollectionData* data) + : _data(data) {} // Compares the content of two arrays. // Returns true if the two arrays are equal. @@ -107,28 +108,28 @@ class JsonArrayConst : public VariantOperators { } private: - const VariantData* getData() const { + const detail::VariantData* getData() const { return collectionToVariant(_data); } - const CollectionData* _data; + const detail::CollectionData* _data; }; template <> -struct Converter : private VariantAttorney { +struct Converter : private detail::VariantAttorney { static void toJson(JsonVariantConst src, JsonVariant dst) { variantCopyFrom(getData(dst), getData(src), getPool(dst)); } static JsonArrayConst fromJson(JsonVariantConst src) { - const VariantData* data = getData(src); + auto data = getData(src); return data ? data->asArray() : 0; } static bool checkJson(JsonVariantConst src) { - const VariantData* data = getData(src); + auto data = getData(src); return data && data->isArray(); } }; -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayImpl.hpp index 45a520f49..dc0487af8 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayImpl.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayImpl.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -7,12 +7,16 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE inline JsonObject JsonArray::createNestedObject() const { return add().to(); } +ARDUINOJSON_END_PUBLIC_NAMESPACE + +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE + template inline JsonArray VariantRefBase::createNestedArray() const { return add().template to(); @@ -29,4 +33,4 @@ inline ElementProxy VariantRefBase::operator[]( return ElementProxy(derived(), index); } -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp index 382d11775..3e1b7526c 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -7,11 +7,12 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE class VariantPtr { public: - VariantPtr(MemoryPool* pool, VariantData* data) : _variant(pool, data) {} + VariantPtr(detail::MemoryPool* pool, detail::VariantData* data) + : _variant(pool, data) {} JsonVariant* operator->() { return &_variant; @@ -30,7 +31,8 @@ class JsonArrayIterator { public: JsonArrayIterator() : _slot(0) {} - explicit JsonArrayIterator(MemoryPool* pool, VariantSlot* slot) + explicit JsonArrayIterator(detail::MemoryPool* pool, + detail::VariantSlot* slot) : _pool(pool), _slot(slot) {} JsonVariant operator*() const { @@ -59,13 +61,13 @@ class JsonArrayIterator { } private: - MemoryPool* _pool; - VariantSlot* _slot; + detail::MemoryPool* _pool; + detail::VariantSlot* _slot; }; class VariantConstPtr { public: - VariantConstPtr(const VariantData* data) : _variant(data) {} + VariantConstPtr(const detail::VariantData* data) : _variant(data) {} JsonVariantConst* operator->() { return &_variant; @@ -84,7 +86,8 @@ class JsonArrayConstIterator { public: JsonArrayConstIterator() : _slot(0) {} - explicit JsonArrayConstIterator(const VariantSlot* slot) : _slot(slot) {} + explicit JsonArrayConstIterator(const detail::VariantSlot* slot) + : _slot(slot) {} JsonVariantConst operator*() const { return JsonVariantConst(_slot->data()); @@ -112,6 +115,7 @@ class JsonArrayConstIterator { } private: - const VariantSlot* _slot; + const detail::VariantSlot* _slot; }; -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp index 1bff6830c..398e11d45 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -7,21 +7,21 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE // Copies a value to a JsonVariant. // This is a degenerated form of copyArray() to stop the recursion. template -inline typename enable_if::value, bool>::type copyArray( - const T& src, JsonVariant dst) { +inline typename detail::enable_if::value, bool>::type +copyArray(const T& src, JsonVariant dst) { return dst.set(src); } // Copies values from an array to a JsonArray or a JsonVariant. // https://arduinojson.org/v6/api/misc/copyarray/ template -inline typename enable_if::value, - bool>::type +inline typename detail::enable_if< + !detail::is_base_of::value, bool>::type copyArray(T (&src)[N], const TDestination& dst) { return copyArray(src, N, dst); } @@ -29,8 +29,8 @@ copyArray(T (&src)[N], const TDestination& dst) { // Copies values from an array to a JsonArray or a JsonVariant. // https://arduinojson.org/v6/api/misc/copyarray/ template -inline typename enable_if::value, - bool>::type +inline typename detail::enable_if< + !detail::is_base_of::value, bool>::type copyArray(const T* src, size_t len, const TDestination& dst) { bool ok = true; for (size_t i = 0; i < len; i++) { @@ -63,8 +63,8 @@ inline bool copyArray(const T* src, size_t len, JsonDocument& dst) { // Copies a value from a JsonVariant. // This is a degenerated form of copyArray() to stop the recursion. template -inline typename enable_if::value, size_t>::type copyArray( - JsonVariantConst src, T& dst) { +inline typename detail::enable_if::value, size_t>::type +copyArray(JsonVariantConst src, T& dst) { dst = src.as(); return 1; } @@ -103,11 +103,12 @@ inline size_t copyArray(JsonVariantConst src, char (&dst)[N]) { // Copies values from a JsonDocument to an array. // https://arduinojson.org/v6/api/misc/copyarray/ template -inline typename enable_if::value && - is_base_of::value, - size_t>::type +inline typename detail::enable_if< + detail::is_array::value && + detail::is_base_of::value, + size_t>::type copyArray(const TSource& src, T& dst) { return copyArray(src.template as(), dst); } -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp index 560e7e336..aa807b5de 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -9,7 +9,7 @@ #include // size_t -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE class MemoryPool; class VariantData; @@ -91,4 +91,5 @@ inline VariantData* collectionToVariant(CollectionData* collection) { void* data = collection; // prevent warning cast-align return reinterpret_cast(data); } -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp index f933f527e..c99b524be 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -9,7 +9,7 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE inline VariantSlot* CollectionData::addSlot(MemoryPool* pool) { VariantSlot* slot = pool->allocVariant(); @@ -194,4 +194,4 @@ inline void CollectionData::movePointers(ptrdiff_t stringDistance, slot->movePointers(stringDistance, variantDistance); } -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp b/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp index ed5687a39..b33a8339e 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp @@ -1,31 +1,9 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once -#if __cplusplus >= 201103L -# define ARDUINOJSON_HAS_LONG_LONG 1 -# define ARDUINOJSON_HAS_RVALUE_REFERENCES 1 -#else -# define ARDUINOJSON_HAS_LONG_LONG 0 -# define ARDUINOJSON_HAS_RVALUE_REFERENCES 0 -#endif - -#ifndef ARDUINOJSON_HAS_NULLPTR -# if __cplusplus >= 201103L -# define ARDUINOJSON_HAS_NULLPTR 1 -# else -# define ARDUINOJSON_HAS_NULLPTR 0 -# endif -#endif - -#if defined(_MSC_VER) && !ARDUINOJSON_HAS_LONG_LONG -# define ARDUINOJSON_HAS_INT64 1 -#else -# define ARDUINOJSON_HAS_INT64 0 -#endif - // Support std::istream and std::ostream #ifndef ARDUINOJSON_ENABLE_STD_STREAM # ifdef __has_include @@ -83,8 +61,7 @@ // Store integral values with long (0) or long long (1) #ifndef ARDUINOJSON_USE_LONG_LONG -# if ARDUINOJSON_HAS_LONG_LONG && defined(__SIZEOF_POINTER__) && \ - __SIZEOF_POINTER__ >= 4 || \ +# if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ >= 4 || \ defined(_MSC_VER) # define ARDUINOJSON_USE_LONG_LONG 1 # endif @@ -230,7 +207,7 @@ # endif #endif -#if ARDUINOJSON_HAS_NULLPTR && defined(nullptr) +#if defined(nullptr) # error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr // See https://github.com/bblanchon/ArduinoJson/issues/1355 #endif diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp index 16c52ffd2..2e97a024f 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp @@ -1,10 +1,9 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once -#include #include #include #include @@ -13,9 +12,9 @@ # include #endif -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE -class DeserializationError : public SafeBoolIdom { +class DeserializationError { public: enum Code { Ok, @@ -53,9 +52,9 @@ class DeserializationError : public SafeBoolIdom { return lhs != rhs._code; } - // Behaves like a bool - operator bool_type() const { - return _code != Ok ? safe_true() : safe_false(); + // Returns true if there is an error + explicit operator bool() const { + return _code != Ok; } // Returns internal enum, useful for switch statement @@ -80,10 +79,10 @@ class DeserializationError : public SafeBoolIdom { ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s3, "InvalidInput"); ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s4, "NoMemory"); ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s5, "TooDeep"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY( - const char*, messages, ARDUINOJSON_EXPAND6({s0, s1, s2, s3, s4, s5})); + ARDUINOJSON_DEFINE_PROGMEM_ARRAY(const char*, messages, + {s0, s1, s2, s3, s4, s5}); return reinterpret_cast( - pgm_read(messages + _code)); + detail::pgm_read(messages + _code)); } #endif @@ -104,4 +103,4 @@ inline std::ostream& operator<<(std::ostream& s, DeserializationError::Code c) { } #endif -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp new file mode 100644 index 000000000..8400cc0b2 --- /dev/null +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp @@ -0,0 +1,35 @@ +// ArduinoJson - https://arduinojson.org +// Copyright © 2014-2023, Benoit BLANCHON +// MIT License + +#pragma once + +#include +#include + +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE + +template +struct DeserializationOptions { + TFilter filter; + DeserializationOption::NestingLimit nestingLimit; +}; + +template +inline DeserializationOptions makeDeserializationOptions( + TFilter filter, DeserializationOption::NestingLimit nestingLimit = {}) { + return {filter, nestingLimit}; +} + +template +inline DeserializationOptions makeDeserializationOptions( + DeserializationOption::NestingLimit nestingLimit, TFilter filter) { + return {filter, nestingLimit}; +} + +inline DeserializationOptions makeDeserializationOptions( + DeserializationOption::NestingLimit nestingLimit = {}) { + return {{}, nestingLimit}; +} + +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp index 501acf3e4..8857cedfe 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp @@ -1,13 +1,14 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE +namespace DeserializationOption { class Filter { public: explicit Filter(JsonVariantConst v) : _variant(v) {} @@ -39,7 +40,9 @@ class Filter { private: JsonVariantConst _variant; }; +} // namespace DeserializationOption +namespace detail { struct AllowAllFilter { bool allow() const { return true; @@ -62,5 +65,6 @@ struct AllowAllFilter { return AllowAllFilter(); } }; +} // namespace detail -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp index af5724d0a..6d2f67545 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -7,8 +7,9 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE +namespace DeserializationOption { class NestingLimit { public: NestingLimit() : _value(ARDUINOJSON_DEFAULT_NESTING_LIMIT) {} @@ -26,4 +27,6 @@ class NestingLimit { private: uint8_t _value; }; -} // namespace ARDUINOJSON_NAMESPACE +} // namespace DeserializationOption + +ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp index 4e1958c75..e52af6d5c 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp @@ -1,14 +1,15 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include +#include #include // for size_t -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE // The default reader is a simple wrapper for Readers that are not copiable template @@ -33,7 +34,8 @@ struct BoundedReader { // no default implementation because we need to pass the size to the // constructor }; -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PRIVATE_NAMESPACE #include #include @@ -54,3 +56,18 @@ struct BoundedReader { #if ARDUINOJSON_ENABLE_STD_STREAM # include #endif + +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE + +template +Reader::type> makeReader(TInput&& input) { + return Reader::type>{ + detail::forward(input)}; +} + +template +BoundedReader makeReader(TChar* input, size_t inputSize) { + return BoundedReader{input, inputSize}; +} + +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp index 179e37681..ac4f212d5 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template struct Reader -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template struct Reader::value>::type> + typename enable_if::value>::type> : BoundedReader { explicit Reader(const ::String& s) : BoundedReader(s.c_str(), s.length()) {} }; -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp index c48248c1d..da6880ded 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template <> struct Reader { @@ -52,4 +52,5 @@ struct BoundedReader { return length; } }; -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp index 96494df01..718907988 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp @@ -1,10 +1,10 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template class IteratorReader { @@ -41,4 +41,5 @@ struct Reader::type> : IteratorReader(source.begin(), source.end()) {} }; -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp index 120ce8a80..78d019953 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template struct IsCharOrVoid { @@ -48,4 +48,4 @@ struct BoundedReader(ptr) + len) {} }; -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp index c92f7931b..ecace4266 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template struct Reader #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template struct Reader::value>::type> @@ -16,4 +16,4 @@ struct Reader::value>::type> : Reader(x.template as()) {} }; -} // namespace ARDUINOJSON_NAMESPACE +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp index 062b10921..1d0868048 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp @@ -1,16 +1,16 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once #include -#include -#include +#include #include +#include #include -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE template