Package specific configuration (for apps and libraries)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- nodejs, react-native, typescript
- 领域
- build-system, tooling
调研方向
没有指定实现文件或测试。首先解决此处提出的配置模式、查找行为、依赖项扫描规则以及平台特定的路径处理;当项目拥有经过同意并记录在案的配置设计,且每个选项的行为都明确时,即可视为完成。
由索引模型根据 Issue 内容生成。
描述
We've actively worked towards putting as few restrictions on the packages bringing Node-API modules as possible, to make it more likely to migrate / re-use existing packages intended for Node.js and we would like to continue to support packages providing Node-API modules without requiring package-specific configuration.
How to configure
We could rely on cosmiconfig (which is also used by the React Native Community CLI):
By default, Cosmiconfig will check the current directory for the following:
- a
package.jsonproperty- a JSON or YAML, extensionless "rc file"
- an "rc file" with the extensions
.json,.yaml,.yml,.js,.ts,.mjs, or.cjs- any of the above two inside a
.configsubdirectory- a
.config.js,.config.ts,.config.mjs, or.config.cjsfile
We could load this config starting from the "app" and then look for it in all direct dependencies of the app package and all transitive dependencies explicitly enumerated - see below.
What to configure
Possible configuration options which could optimise the experience:
Library name mapping to paths
We could allow library authors to provide explicit paths for the Node-API prebuilds bundled with their package:
{
// Alternative names for this property could be "addons" or "modules"? 🤔
"prebuilds": [
// Provide a path for a prebuild
"./build/Release/somthing.node",
// Which would be an alias for an object with the same path
{ "path": "./build/Release/somthing.node" },
// Allow overriding the name (default would be "my-lib--addon") used for the library files when linked into the app
{ "name": "addon", "path": "./build/Release/addon.node" },
// Allow specifying platform-specific paths
{
"name": "addon",
"path": {
"android": "./build/Release/addon.android.node",
"ios": "./build/Debug/addon.apple.node"
},
},
]
}
Control scanning
We could group options related to scanning for Node-API modules, either under a "scanning" (or simply "scan") key.
We could enable scanning of specific transitive dependencies (see #367 for use-case)
{
"scanning": {
"dependencies": ["name-of-lib-with-node-api-module"]
}
}
We could provide lists of glob patterns to include and exclude when scanning for modules
{
"scanning": {
"include": ["./build"],
"exclude": ["./node_modules"],
}
}
Or disable scanning all together:
{
"scanning": {
"disabled": true
}
}
- 主要语言
- TypeScript
- 星标
- 188
- 派生
- 10
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/react-native-node-api 的其他 Issue
-
Android 🤖
难度 2/5 1-3 小时 新手友好度 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projects 未关闭Android 🤖 good first issue
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/react-native-node-api#163 · 1 条评论 ·
-
enhancement good first issue gyp-to-cmake
难度 2/5 1-3 小时 新手友好度 72/100
callstackincubator/react-native-node-api#161 · 3 条评论 · 1 个 reaction ·
-
enhancement Host 🏡
难度 5/5 一周以上 新手友好度 25/100
-
Automatable good first issue
难度 3/5 1-2 天 新手友好度 15/100
callstackincubator/react-native-node-api#424 · 1 条评论 ·
查看 callstackincubator/react-native-node-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
ontola/atomic-server#1625 ·
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
melgarafael/DeskcommCRM#1451 ·
-
难度 1/5 1 小时以内 新手友好度 82/100
-
bug via-triage
难度 2/5 1-3 小时 新手友好度 78/100
-
bot:ai-assisted component:compact-js status:untriaged
难度 2/5 1-3 小时 新手友好度 84/100
midnightntwrk/midnight-sdk#403 ·