Docs on publishing of header-only C++ libs (include in node c++ modules)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Locate the header-only C++ libraries in this repository and compare Nan's package.json and include_dirs.js pattern with the linked examples. Add the requested package metadata for each library, then run npm pack and inspect the tarball to confirm it contains the headers and npm's default files only.
Written by the indexing model from the issue text.
Description
rational
We are increasingly working on small node C++ modules that depend on header-only C++ libs.
Node.js's Nan module has pioneered a best practice for how to include header only C++ libs in node C++ addons by simply adding a package.json and include_dirs.js file to the root of the project. I think we should follow the lead of howNan does this and package all our C++ header only libs in npm as well as mason. I think publishing in two places is worth it because it makes including the libraries from node modules very easy and consistent with how JS modules work.
method
Add:
- package.json
- include_dirs.js
filesparameter topackage.jsonso that only theinclude/directory is included
Example:
{
"name": "@mapbox/geometry-hpp",
"version": "0.9.0",
"description": "A C++ header only geometry type library",
"main": "./include_dirs.js",
"repository" : {
"type" : "git",
"url" : "git://github.com/mapbox/geometry.hpp.git"
},
"files": [
"include"
]
}
Then test that only the right files are going to be packaged:
npm pack
tar -ztvf *tgz
^^ that should list just the headers and the default files npm includes like README.md and package.json etc
Examples:
Example use case:
- Dominant language
- No language data
- Stars
- 110
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/cpp
-
glossary
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Docs on ABIs Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
EclipseFdn/open-vsx.org#13385 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
hiddify/hiddify-app#2348 ·
-
priority-0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
reflex-dev/reflex#7260 · 1 comment ·
-
breaking needs-triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/azure-service-operator#5718 ·