-
Notifications
You must be signed in to change notification settings - Fork 8
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: support PsychicHttp v2 #29
Conversation
WalkthroughThe changes involve updates across various configuration files and source code to support the new Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 (
|
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (10)
- .github/workflows/ci-dev.yaml (1 hunks)
- .github/workflows/ci-full.yaml (1 hunks)
- CHANGELOG.md (1 hunks)
- README.md (3 hunks)
- demo/esp32/platformio.ini (1 hunks)
- demo/esp32/src/main.cpp (1 hunks)
- package.json (3 hunks)
- package.script (1 hunks)
- src/commandLine.ts (2 hunks)
- src/cppCode.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/ci-full.yaml
Additional context used
Markdownlint
README.md
16-16: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
Additional comments not posted (31)
.github/workflows/ci-dev.yaml (1)
17-17
: LGTM!The Node.js version update from
20.16.0
to20.17.0
is approved.The change is minor and should not break the workflow. It may introduce new features, performance improvements, or bug fixes associated with the newer Node.js version, which could be beneficial for supporting PsychicHttp v2.
CHANGELOG.md (2)
3-5
: LGTM!The code changes are approved. The new version section (1.5) and sub-version (1.5.0) are correctly formatted and follow the existing changelog structure.
7-9
: LGTM! The changes are significant.The code changes are approved. The documented changes are significant and reflect the updates mentioned in the summary:
- The new engine type (-e psychic2) for PsychicHttp v2 indicates an enhancement or expansion of functionality related to the engine types available.
- Running tests with GitHub repos instead of packages may improve the testing process by allowing for more direct integration with source control.
These modifications reflect significant updates to the functionality and testing approach of the project.
demo/esp32/src/main.cpp (4)
69-102
: LGTM!The new conditional compilation block for the
PSYCHIC2
platform is correctly implemented and follows the same structure as the existing blocks for other platforms.
77-79
: LGTM!The preprocessor directives are correctly implemented and serve as a safety check to ensure the correct number of files and the presence of an index file.
Also applies to: 81-83
89-89
: LGTM!The server setup and initialization are correctly implemented. The server is declared with the correct port and initialized in the
setup()
function. TheinitSvelteStaticFiles
function is called to initialize static files for Svelte.Also applies to: 98-99
92-96
: LGTM!The WiFi configuration is correctly implemented. The WiFi mode is set to station mode, and the connection is established using the credentials from the
credentials.h
file. The code handles the connection failure by entering an infinite loop, which is a common practice in embedded systems.package.json (4)
3-3
: LGTM! The version increment is appropriate.The version has been incremented from
1.4.2
to1.5.0
, which follows semantic versioning. The minor version increment is suitable for adding new backwards compatible functionality.
33-33
: LGTM! The new script addition is consistent.The new
dev:psychic2
script enhances the development capabilities by providing an alternative setup for testing or running the application. The script is consistent with the existingdev:psychic
script, with the only difference being the environment flag-e psychic2
.
58-58
: LGTM! The dependency version update is a minor increment.The
@types/node
dependency has been updated from^22.5.1
to^22.5.2
, which is a minor version increment. This may include bug fixes or improvements. The caret^
sign ensures that npm installs a version with the same major version.
53-53
: LGTM! But verify the usage of the new dependency.The addition of the new
psychichttpserverV2
dependency suggests an expansion of the project's capabilities or support for new features related to thePsychicHttp
library. The dependency name follows the naming convention of the existingpsychichttpserver
dependency, with the addition ofV2
suffix, indicating a new version.Verify that the new dependency is being used correctly in the codebase by running the following script:
src/commandLine.ts (3)
6-6
: LGTM!The code changes are approved.
23-23
: LGTM!The code changes are approved.
28-28
: LGTM!The code changes are approved.
package.script (9)
21-21
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
andgzip
disabled.
22-22
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
disabled andgzip
enabled.
23-23
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
disabled andgzip
set tocompiler
.
24-24
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
enabled andgzip
disabled.
25-25
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
andgzip
enabled.
26-26
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
enabled andgzip
set tocompiler
.
27-27
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
set tocompiler
andgzip
disabled.
28-28
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
set tocompiler
andgzip
enabled.
29-29
: LGTM!The command is correctly structured and specifies the appropriate options for generating the output file in the
psychic2
mode withetag
andgzip
set tocompiler
.demo/esp32/platformio.ini (4)
74-74
: LGTM!The change to use the full URL for the
PsychicHttp
library dependency enhances clarity and ensures that the specific source of the library is explicitly defined.
80-80
: LGTM!The changes to use the full URL for the
PsychicHttp
library dependency across variouspsychic
environments enhance clarity and ensure that the specific source of the library is explicitly defined.Also applies to: 87-87, 94-94, 102-102, 108-108, 115-115, 121-121, 128-128
132-136
: LGTM!The introduction of the new
psychic2
environment configuration, along with the appropriatebuild_flags
andlib_deps
entries, supports the updated version of thePsychicHttp
library.
138-190
: LGTM!The introduction of the new
psychic2
environment configurations, along with the appropriatebuild_flags
andlib_deps
entries, supports the updated version of thePsychicHttp
library and provides various options for enabling features like ETAG and GZIP.README.md (1)
225-236
: Approve updated command line options.The update to the command line options table to include
psychic2
as a valid engine option is accurate and reflects the new capabilities introduced with PsychicHttp v2. The table is well-structured and the addition fits seamlessly with the existing options.src/cppCode.ts (3)
203-378
: LGTM! The newpsychic2Template
enhances configurability and maintainability.The introduction of the
psychic2Template
constant brings significant improvements to the codebase:
- It incorporates additional conditional compilation directives for handling ETag and GZip configurations, allowing for more granular control over these features.
- The template includes checks for the
etag
andgzip
flags, generating warnings if these features are enabled or disabled, enhancing the clarity of the configuration.- The template defines constants for versioning and file counts, which were previously absent.
- The handling of HTTP requests has been updated to include these new configurations, ensuring that the server responds correctly based on the specified settings.
Overall, the changes enhance the configurability and maintainability of the code, allowing for better handling of HTTP responses based on the defined settings. The code follows the existing patterns and is well-structured.
551-553
: LGTM! The changes togetCppCode
improve flexibility.The modifications to the
getCppCode
function enhance the flexibility of the code generation process:
- The function now accommodates the new
psychic2Template
, allowing it to generate code for thePsychicHttpServerV2
engine.- The introduction of the ternary operator to select between the three templates (
psychic
,psychic2
, andasyncTemplate
) based on thecmdLine.engine
value is a concise and effective way to adapt the code generation process based on the specified engine.These changes improve the adaptability of the code generation process and maintain a clean and readable structure.
551-553
: LGTM! The changes togetCppCode
do not affect its public interface.The modifications to the
getCppCode
function do not alter its exported signature:
- The function still accepts the same parameters (
sources: CppCodeSources, filesByExtension: ExtensionGroups
) and returns a string.- The changes are internal to the function, improving its flexibility and maintainability by accommodating the new
psychic2Template
.As the public interface remains unchanged, the modifications do not impact the usage of the
getCppCode
function.
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
Summary by CodeRabbit
New Features
psychic2
, enhancing functionality for PsychicHttp v2.psychic2
, allowing for additional configurations.PsychicHttpServer
setup for thePSYCHIC2
platform.Bug Fixes
Documentation
Chores