Docs on publishing of header-only C++ libs (include in node c++ modules)
还没有人认领这个 Issue。
评估
调研方向
定位此仓库中的 header-only C++ 库,并将 Nan 的 package.json 和 include_dirs.js 模式与链接的示例进行比较。为每个库添加所请求的包元数据,然后运行 npm pack 并检查 tarball,以确认其中仅包含头文件和 npm 的默认文件。
由索引模型根据 Issue 内容生成。
描述
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:
- 主要语言
- 没有语言数据
- 星标
- 110
- 派生
- 17
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mapbox/cpp 的其他 Issue
-
glossary
难度 1/5 1 小时以内 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 25/100
-
Docs on ABIs 未关闭
难度 4/5 3-5 天 新手友好度 30/100
-
难度 5/5 一周以上 新手友好度 30/100
-
难度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
Help-Wanted Needs-Triage Package-Request
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/winget-pkgs#438680 ·
-
package-update
难度 2/5 1-3 小时 新手友好度 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 70/100
-
OS:Windows
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 68/100