Skip to content

Conversation

peppapighs
Copy link

@peppapighs peppapighs commented Oct 12, 2025

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

  • Chores
    • Added a package metadata manifest (package name CherryUSB, version 1.5.2) including description, keywords, repository, author/maintainer, license (Apache-2.0), homepage, frameworks/platforms, and build/include settings.
    • No changes to runtime behavior or public APIs; purely metadata for tooling and package management.

Copy link

coderabbitai bot commented Oct 12, 2025

Walkthrough

Adds a new metadata manifest file library.json for the CherryUSB project containing package metadata (name, version 1.5.2, description, keywords, repository, author/maintainer, license, homepage, frameworks/platforms, and build/include/source fields). No source code or runtime logic changed.

Changes

Cohort / File(s) Summary
Packaging Manifest
library.json
Added package descriptor with name CherryUSB, version 1.5.2, description, keywords, repository (type & url), authors (maintainer), license Apache-2.0, homepage, wildcard frameworks/platforms, and build/include/source metadata. No code/runtime changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A nibble of JSON, neat and bright,
I thump my paws in pure delight—
A tag, a name, a version clear,
Our burrow’s shelves are tidy here.
With license leaf and homepage trail,
The package hops—ready to sail! 🐇📦

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely describes the primary change—adding a library.json file to enable PlatformIO library support—without unnecessary detail or ambiguity, and it directly reflects the content and intent of the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a68aac and 112a6c0.

📒 Files selected for processing (1)
  • library.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • library.json

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e37b62 and 4a68aac.

📒 Files selected for processing (1)
  • library.json (1 hunks)

"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",
Copy link

@coderabbitai coderabbitai bot Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
"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.

Copy link
Author

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

Copy link

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!

@peppapighs peppapighs marked this pull request as draft October 12, 2025 08:01
@peppapighs peppapighs force-pushed the add-platformio-library-json branch from 4a68aac to 70208f1 Compare October 12, 2025 08:05
@sakumisu
Copy link
Collaborator

Thanks, welcome to pr.

@peppapighs peppapighs force-pushed the add-platformio-library-json branch from 70208f1 to 112a6c0 Compare October 12, 2025 08:11
@peppapighs peppapighs marked this pull request as ready for review October 12, 2025 08:20
@peppapighs
Copy link
Author

I have made some changes to add include directories and source files to the build system properly.

@sakumisu
Copy link
Collaborator

Could you share the example how to use it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants