-
Notifications
You must be signed in to change notification settings - Fork 367
Add library.json for PlatformIO library support #367
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
base: master
Are you sure you want to change the base?
Add library.json for PlatformIO library support #367
Conversation
WalkthroughAdds a new metadata manifest file Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
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.
"name": "CherryUSB", | ||
"version": "1.5.2", | ||
"description": "CherryUSB is a tiny and beautiful, high performace and portable USB host and device stack for embedded system with USB IP", | ||
"keywords": "usb, host, device", |
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.
Fix keywords
field to match PlatformIO schema.
PlatformIO’s manifest schema defines keywords
as an array of strings. Supplying a single comma-separated string will fail schema validation, breaking package ingestion. Please switch to an array literal so the library can be indexed correctly.
- "keywords": "usb, host, device",
+ "keywords": [
+ "usb",
+ "host",
+ "device"
+ ],
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"keywords": "usb, host, device", | |
"keywords": [ | |
"usb", | |
"host", | |
"device" | |
], |
🤖 Prompt for AI Agents
In library.json around line 5, the keywords field is currently a single
comma-separated string which doesn't match PlatformIO's manifest schema; change
the value to an array of strings (e.g., ["usb","host","device"]) so each keyword
is its own string entry in the keywords array.
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.
This is false. PlatformIO allows comma-separated string. See https://docs.platformio.org/en/latest/manifests/library-json/fields/keywords.html
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.
🧩 Analysis chain
🌐 Web query:
PlatformIO library.json keywords field format documentation
💡 Result:
The library.json "keywords" field
- Type: string or array. If string, multiple keywords may be comma-separated; alternatively supply an array of strings. [1][2]
- Length: max 255 characters per field/item. [1][2]
- Allowed characters / style: lowercase; may contain a–z, digits and (depending on doc version) periods, underscores, plus signs and dashes; but a keyword must not start or end with a dot, underscore, plus or dash. Use lowercase for discoverability. [1][2]
- Purpose: used for registry search to help discover your library. [1]
Sources: PlatformIO library.json docs and schema. [1][2]
References
[1] PlatformIO docs — library.json / keywords.
[2] PlatformIO library.json schema (manifest JSON schema).
@peppapighs, you're absolutely correct, and I apologize for the incorrect suggestion. The PlatformIO documentation confirms that the keywords
field accepts both a comma-separated string and an array of strings. The current format in your PR:
"keywords": "usb, host, device",
is perfectly valid according to the official PlatformIO library.json specification. Thank you for the correction and for providing the documentation link!
4a68aac
to
70208f1
Compare
Thanks, welcome to pr. |
70208f1
to
112a6c0
Compare
I have made some changes to add include directories and source files to the build system properly. |
Could you share the example how to use it? |
I would like to add support for PlatformIO library to CherryUSB. PlatformIO library requires
library.json
at the root of the library as metadata to install the package. You may find more information here and here. TinyUSB also has this JSON file. The unfortunate thing about this is we now have another place to bump the version number whenever we release a new CherryUSB version.Please let me know if you have any concerns.
Summary by CodeRabbit