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
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 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
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
simp/pupmod-simp-stunnel#173 ·
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
Wetzel402/Skylite-UX#112 ·
-
Release notes未關閉
難度 2/5 1-3 小時 新手友好度 68/100
mieweb/timehuddle#634 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
維護者通常 1 天內回覆