-
Notifications
You must be signed in to change notification settings - Fork 11
feat: esp-idf #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: esp-idf #43
Conversation
WalkthroughThis pull request introduces version 1.9.0 and adds native support for the esp-idf framework. The update includes changes to versioning and documentation in the root files, new demo project files under Changes
Sequence Diagram(s)sequenceDiagram
participant A as app_main
participant B as start_http_server
participant C as initSvelteStaticFiles
participant D as HTTP Server
A->>B: Call start_http_server()
B->>C: Initialize static file handlers
B->>D: Configure and start HTTP server with SVELTEESP32_COUNT
D-->>B: Confirmation (server port/info)
B-->>A: Return control to app_main
A->>A: Enter infinite loop (1s delay cycles)
sequenceDiagram
participant Dev as Developer
participant S as package.script
participant G as Code Generator (tsx src/index.ts)
participant O as Output Header File
Dev->>S: Execute espidf command line
S->>G: Run code generator command with espidf parameters
G->>O: Generate header file with specified etag/gzip/cache settings
Possibly related PRs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Used @karlp 's esp-idf example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
demo/esp32idf/include/placeholder.txt (1)
1-2
: Placeholder Content CheckThe file "placeholder.txt" correctly contains the placeholder text. Consider adding a brief comment or renaming the file in the future to better describe its role (e.g., "generated_headers.info") if it’s meant to indicate the location of generated header files.
demo/esp32idf/README.md (1)
1-9
: README Documentation ClarityThe README provides a clear and concise overview of the minimalistic ESP-IDF project along with a well-formatted build command. For improved guidance, consider adding extra details about project configuration, troubleshooting tips, or references to ESP-IDF documentation for users unfamiliar with the environment.
demo/esp32idf/src/main.c (1)
1-14
: HTTP Server implementation looks good with a minor consideration.The HTTP server implementation looks solid. The configuration sets a large buffer for URI handlers (
SVELTEESP32_COUNT + 99
), which ensures plenty of handlers are available.Consider adding error handling for the
initSvelteStaticFiles()
call to handle potential initialization failures:- initSvelteStaticFiles(httpd); + esp_err_t err = initSvelteStaticFiles(httpd); + if (err != ESP_OK) { + printf("Failed to initialize static files: %s\n", esp_err_to_name(err)); + return; + }README.md (1)
13-15
: Good addition of ESP-IDF documentation.The README has been properly updated to include ESP-IDF in the list of supported frameworks, with a clear note about the version that introduced this feature.
There's a bare URL in line 13. Consider making it a proper markdown link:
- 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) and ESP-IDF 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**. + 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](https://github.com/ESP32Async/ESPAsyncWebServer)) and ESP-IDF 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**.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
13-13: Bare URL used
null(MD034, no-bare-urls)
demo/esp32idf/platformio.ini (1)
8-48
: Consider adding documentation comments for each environmentThe environment configurations are well-structured with a clear naming convention that reflects different feature combinations (E for ETAG, G for GZIP, C for compiler). However, adding brief comments explaining the purpose of each environment would improve maintainability for future contributors.
[env:idf] +# Base configuration without any features enabled build_flags = -I include/_ [env:idf_E] +# Configuration with ETAG support enabled build_flags = -I include/e
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
demo/svelte/dist/favicon.png.gz
is excluded by!**/dist/**
,!**/*.gz
demo/svelte/package-lock.json
is excluded by!**/package-lock.json
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (12)
CHANGELOG.md
(1 hunks)README.md
(1 hunks)demo/esp32idf/.gitignore
(1 hunks)demo/esp32idf/.vscode/extensions.json
(1 hunks)demo/esp32idf/README.md
(1 hunks)demo/esp32idf/include/placeholder.txt
(1 hunks)demo/esp32idf/platformio.ini
(1 hunks)demo/esp32idf/src/main.c
(1 hunks)demo/svelte/package.json
(2 hunks)package.json
(4 hunks)package.script
(1 hunks)src/cppCode.ts
(2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md
13-13: Bare URL used
null
(MD034, no-bare-urls)
🔇 Additional comments (14)
demo/esp32idf/.gitignore (1)
1-10
: Gitignore Patterns VerificationThe .gitignore file is appropriate for the ESP-IDF demo project. It excludes typical build and configuration directories (e.g.,
.pio
,.vscode
) as well as specific files likesrc/credentials.h
and header files in the include directory. Please verify that ignoring all header files (include/**/*.h
) is intentional, as it might prevent trackable changes if headers are updated.demo/esp32idf/.vscode/extensions.json (1)
1-10
: VSCode Extensions ConfigurationThis configuration file effectively recommends the PlatformIO extension to ensure a streamlined development experience and explicitly excludes the unwanted cpptools extension pack. The file is correctly formatted and aligns with the project's ESP-IDF focus.
CHANGELOG.md (1)
3-8
: Changelog Update for ESP-IDF SupportThe new changelog entry for version 1.9.0 clearly documents the addition of the ESP-IDF code generator feature. Ensure that the documentation in this file remains consistent with the project README and other related files.
demo/esp32idf/src/main.c (1)
16-24
: Main function uses standard ESP-IDF pattern.The
app_main
function follows the common ESP-IDF pattern with an infinite loop to keep the main thread alive, which is appropriate for this embedded application.README.md (1)
53-54
: Example for ESP-IDF usage is well documented.The command line example for ESP-IDF code generation is correctly documented, making it easy for users to understand how to use the new feature.
demo/svelte/package.json (1)
27-49
: Dependencies updated to latest minor versions.The dependency updates are good practice to keep up with bug fixes and improvements. All changes are to minor versions which should maintain compatibility.
src/cppCode.ts (2)
4-4
: Updated import path for ESP-IDF template.The import statement has been updated to reflect the new location of the ESP-IDF template implementation.
587-592
: ESP-IDF template correctly integrated into template selection.The ESP-IDF template has been properly integrated into the
getTemplate
function, making it available when the 'espidf' engine is specified.demo/esp32idf/platformio.ini (1)
1-5
: LGTM - Well-structured base configurationThe base environment configuration correctly sets up the ESP-IDF framework with the appropriate platform (espressif32) and board (lolin_s3_mini) settings.
package.json (4)
3-3
: LGTM - Version bump aligns with new featureThe version bump from 1.8.1 to 1.9.0 appropriately reflects the addition of a significant new feature (ESP-IDF framework support).
34-34
: LGTM - Test script updated to include ESP-IDF environmentThe test:all script has been expanded to include the new ESP-IDF environment, ensuring comprehensive testing across all supported platforms.
58-60
: LGTM - Minor dependency updatesThe incremental updates to TypeScript-related dependencies are appropriate and maintain compatibility.
74-74
:❓ Verification inconclusive
Verify compatibility with mime-types major version update
The update from mime-types v2.1.35 to v3.0.1 represents a major version change that could potentially introduce breaking changes.
🌐 Web query:
What breaking changes were introduced in mime-types v3.0.0?
💡 Result:
The
mime-types
gem version 3.0.0 introduced several breaking changes for Ruby applications:Major Breaking Changes
1. Ruby Version Requirement
- Dropped support for Ruby versions below 2.0[1][3][7].
2. Registry Data Separation
- MIME type registry data was moved to the
mime-types-data
gem[1][3][7]. This means:
- Applications must now include both
mime-types
andmime-types-data
as dependencies[1][7].- The columnar registry format became the primary format, replacing older registry styles[1][7].
3. License and Governance
- Switched exclusively to the MIT license[1][3].
- Added a formal code of conduct[1][3].
4. API Changes
- Removed all methods deprecated in the 2.x series[3][7]:
- Array-based and string-based
MIME::Type
initialization warnings became errors.- Legacy registry formats (v1) were eliminated[3].
MIME::Types::Loader::PATH
replaced withMIME::Types::Data::PATH
[3].- Caching now uses the data gem's version rather than the library version[3].
5. Structural Changes
- The
data_version
attribute was removed[3].- Internal class methods were moved to separate files for better modularity[3].
Impact Summary
Applications upgrading to v3.0.0 needed to:
- Ensure Ruby ≥ 2.0 compatibility.
- Add
mime-types-data
as a dependency.- Replace deprecated initialization methods.
- Update any hardcoded registry paths or version checks.
For JavaScript/Node.js implementations (unrelated to the Ruby gem), breaking changes in
mime-types
v3.0.0 included dropping Node < 18 support and removing CJS/module fallbacks[4][10][13].Citations:
- 1: https://rubygems.org/gems/mime-types/versions/3.1?locale=en
- 2: https://webcuratortool.readthedocs.io/en/stable/guides/release-notes.html
- 3: https://github.com/mime-types/ruby-mime-types/blob/main/History.md
- 4: https://classic.yarnpkg.com/en/package/mime-types
- 5: https://inveniordm.docs.cern.ch/releases/v3/version-v3.0.0/
- 6: https://tldraw.dev/releases/v3.0.0
- 7: https://github.com/mime-types/ruby-mime-types
- 8: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types
- 9: https://www.halostatue.ca/posts/the-mime-types-project
- 10: https://github.com/broofa/mime/blob/main/CHANGELOG.md
- 11: https://www.nuget.org/packages/MimeTypes/
- 12: https://gitlab.apertis.org/pkg/node-mime/-/blob/apertis/3.0.0+dfsg+_cs3.97.1-1+apertis0/CHANGELOG.md
- 13: https://www.npmjs.com/package/mime-types/v/3.0.0
- 14: https://rubygems.org/gems/mime-types/versions/3.6.0?locale=en
- 15: https://pypi.org/project/Products.MimetypesRegistry/
- 16: https://www.npmjs.com/package/mime
- 17: https://swagger.io/docs/specification/v2_0/mime-types/
- 18: https://learn.microsoft.com/en-us/dotnet/core/compatibility/3.0
- 19: https://my.diffend.io/gems/mime-types/prev/3.1
Action: Verify Node.js Runtime and Module Compatibility for
mime-types
v3.0.1
- The upgrade from
"mime-types": "^2.1.35"
to"mime-types": "^3.0.1"
is a major version change.- For Node.js, mime-types v3.x drops support for Node versions below 18. Please confirm that your project runs on Node.js v18 or later.
- The v3 update also removes CommonJS/module fallbacks. Verify that any existing usage of module resolution in your codebase (especially if relying on CommonJS) is compatible with this change.
- Ensure these conditions are met to avoid any runtime or module-loading issues.
package.script (1)
31-39
: LGTM - Consistent implementation of ESP-IDF configurationsThe added commands for ESP-IDF follow the same pattern as the existing environments, creating a complete set of configurations with different combinations of ETAG and GZIP settings. This maintains consistency and ensures all feature combinations are available to users.
Summary by CodeRabbit
New Features
Documentation
Chores