xnd Posted July 21 Share Posted July 21 (edited) https://vitejs.dev/Hello, I think, it would be really useful to have some template project or starter JS/TS project which have common things configured: - standard JS project with package.json with useful pre-defined scripts and README.md with basic info / documentation (not long) - JavaScript or TypeScript support (where TS files from src folder are transpiled into dist folder) and of course dist folder will be mentioned in .gitignore file - ESLint for static code analysis with useful rules that will be helpful for Shelly-specific environment (which will take into consideration Shelly Script Language Features and limitations (which are defined in https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures) - checks for Shelly limitations like:  •• max. size of output script file,  •• exceeded Resource Limits (defined in: https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures#resource-limits): No more than 5 timers used in a script; No more than 5 subscriptions for events used in a script; No more than 5 subscriptions for status changes used in a script; No more than 5 RPC calls used in a script. No more than 10 MQTT topic subscriptions used in a script. No more than 5 HTTP registered endpoints used in a script.  •• Limited levels of nested anonymous functions (https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures#limited-levels-of-nested-anonymous-functions) \---> most of them can be implemented in ESLint (as custom ESLint plugin or using no-restricted-sytax rule)  - build tool to transpile modern syntax of TS/JS language into Shelly compatibile subset of JS (for example: Vite / swc / esbuild / Babel, ...) - possibility to make debugging more easy simple example which just occurred to my mind - create 2 output JS shelly scripts: 1.) development version (with enabled debug logging) 2.) production version (where final JS shelly script will not contain debug related code like logs, ... - optional: unit testing support (for testing code locally, with some helpful mocks)  I know how to implement all of the ideas I mentioned. I have already completed a small portion (approximately 10%) of one of my projects. However, I do not have the time to improve and implement the above-mentioned ideas, or it will be very slow if you wait for me to complete them. Edited July 21 by xnd Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.