-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Expose golang fqbn
package for public use
#2768
Conversation
Because it may turn out useful for other projects.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2768 +/- ##
==========================================
+ Coverage 67.54% 67.57% +0.03%
==========================================
Files 237 238 +1
Lines 22362 22362
==========================================
+ Hits 15104 15111 +7
+ Misses 6066 6062 -4
+ Partials 1192 1189 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This changes allows to make a clean i18n package (without dependency on a specific implementation of the translation package) that, in turn, allows to export packages that internally use i18n with the minimal dependency load.
45062fb
to
ea29e02
Compare
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.
super
Hello, will this package get a public doc similar to what exists, for example, for arduino/go-paths-helper: https://pkg.go.dev/github.com/arduino/go-paths-helper? I want to reference this new official implementation from my library. However, I could not find anything related to FQBN here: https://pkg.go.dev/search?q=arduino&m=package. Does it take some time to get published? I do not know how this works. Thanks, and keep up the great work 💪 |
@dankeboy36 👋 it will become available once we tag the next release. If you want to see it right now you have to navigate the following URL: |
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
This is a tentative design for exporting some of the internals of the Arduino CLI for reuse in other projects.
What is the current behavior?
The
FQBN
struct is not exported.What is the new behavior?
The
FQBN
struct is exported through a publicfqbn
package.Does this PR introduce a breaking change, and is titled accordingly?
Other information
Importing the newly created
fqbn
package as-is would cause a small dependency hell:I also suspect that the Arduino CLI locales are bundled as part of the dependencies. To reduce this burden I've isolated the
i18n.Tr
function from the rest of the locales handling, and moved those latter functions to thelocales
package. I've also replaced thegotext.Po
instance with an interface with only theGet
method required fori18n
to work properly.If the translations are not used in the importing project, a thin wrapper is used instead of
gotext.Po
.This change has reduced the dependencies to the minimum:
and also reduced the executable size by 300KB (that I suppose are the locales that are no longer bundled).